CalculiX  2.13
A Free Software Three-Dimensional Structural Finite Element Program
CalculiX.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define Linux   1
 
#define IRIX   2
 
#define IRIX64   3
 
#define HP   4
 
#define NNEW(a, b, c)   a=(b *)u_calloc((c),sizeof(b),__FILE__,__LINE__,#a)
 
#define RENEW(a, b, c)   a=(b *)u_realloc((b *)(a),(c)*sizeof(b),__FILE__,__LINE__,#a)
 
#define SFREE(a)   u_free(a,__FILE__,__LINE__,#a)
 
#define DMEMSET(a, b, c, d)   for(im=b;im<c;im++)a[im]=d
 
#define ITG   int
 
#define ITGFORMAT   "d"
 

Functions

void FORTRAN (actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
 
void FORTRAN (actideactistr,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *iobject, ITG *ne, ITG *neinset, ITG *iponoel, ITG *inoel, ITG *nepar))
 
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))
 
void FORTRAN (addimdnodedload,(ITG *nelemload, char *sideload, ITG *ipkon, ITG *kon, char *lakon, ITG *i, ITG *imdnode, ITG *nmdnode, 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))
 
void FORTRAN (addizdofcload,(ITG *nodeforc, ITG *ndirforc, ITG *nactdof, ITG *mi, ITG *izdof, ITG *nzdof, ITG *i, ITG *iznode, ITG *nznode, ITG *nk, ITG *imdnode, ITG *nmdnode, double *xforc))
 
void FORTRAN (addizdofdload,(ITG *nelemload, char *sideload, ITG *ipkon, ITG *kon, char *lakon, ITG *nactdof, ITG *izdof, ITG *nzdof, ITG *mi, ITG *i, ITG *iznode, ITG *nznode, ITG *nk, ITG *imdnode, ITG *nmdnode))
 
void FORTRAN (adjustcontactnodes,(char *tieset, ITG *ntie, ITG *itietri, double *cg, double *straight, double *co, double *vold, double *xo, double *yo, double *zo, double *x, double *y, double *z, ITG *nx, ITG *ny, ITG *nz, ITG *istep, ITG *iinc, ITG *iit, ITG *mi, ITG *imastop, ITG *nslavnode, ITG *islavnode, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, double *tietol, double *clearini, double *clearslavnode, ITG *itiefac, ITG *ipkon, ITG *kon, char *lakon, ITG *islavsurf))
 
void FORTRAN (allocation,(ITG *nload_, ITG *nforc_, ITG *nboun_, ITG *nk_, ITG *ne_, ITG *nmpc_, ITG *nset_, ITG *nalset_, ITG *nmat_, ITG *ntmat_, ITG *npmat_, ITG *norien_, ITG *nam_, ITG *nprint_, ITG *mi, ITG *ntrans_, char *set, ITG *meminset, ITG *rmeminset, ITG *ncs_, ITG *namtot_, ITG *ncmat_, ITG *memmpc_, ITG *ne1d, ITG *ne2d, ITG *nflow, char *jobnamec, ITG *irstrt, ITG *ithermal, ITG *nener, ITG *nstate_, ITG *istep, char *inpc, ITG *ipoinp, ITG *inp, ITG *ntie_, ITG *nbody_, ITG *nprop_, ITG *ipoinpc, ITG *nevdamp, ITG *npt_, ITG *nslavsm, ITG *nkon_, ITG *mcs, ITG *mortar, ITG *ifacecount, ITG *nintpoint, ITG *infree, ITG *nheading_, ITG *nobject_, ITG *iuel))
 
void FORTRAN (allocont,(ITG *ncont, ITG *ntie, char *tieset, ITG *nset, char *set, ITG *istartset, ITG *iendset, ITG *ialset, char *lakon, ITG *ncone, double *tietol, ITG *ismallsliding, char *kind1, char *kind2, ITG *mortar, ITG *istep))
 
void FORTRAN (applyboun,(ITG *ifaext, ITG *nfaext, ITG *ielfa, ITG *ikboun, ITG *ilboun, ITG *nboun, char *typeboun, ITG *nelemload, ITG *nload, char *sideload, ITG *isolidsurf, ITG *nsolidsurf, ITG *ifabou, ITG *nfabou, ITG *nface, ITG *nodeboun, ITG *ndirboun, ITG *ikmpc, ITG *ilmpc, char *labmpc, ITG *nmpc, ITG *nactdohinv, ITG *compressible, ITG *iatleastonepressurebc, ITG *ipkonf, ITG *kon, ITG *konf, ITG *nblk))
 
void FORTRAN (applympc,(ITG *nface, ITG *ielfa, ITG *is, ITG *ie, ITG *ifabou, ITG *ipompc, double *vfa, double *coefmpc, ITG *nodempc, ITG *ipnei, ITG *neifa, char *labmpc, double *xbounact, ITG *nactdoh, ITG *ifaext, ITG *nfaext))
 
void FORTRAN (applympc_hfa,(ITG *nface, ITG *ielfa, ITG *is, ITG *ie, ITG *ifabou, ITG *ipompc, double *hfa, double *coefmpc, ITG *nodempc, ITG *ipnei, ITG *neifa, char *labmpc, double *xbounact, ITG *nactdoh))
 
void arpack (double *co, ITG *nk, ITG **konp, ITG **ipkonp, char **lakonp, ITG *ne, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, char *labmpc, ITG *nmpc, ITG *nodeforc, ITG *ndirforc, double *xforc, ITG *nforc, ITG *nelemload, char *sideload, double *xload, ITG *nload, ITG *nactdof, ITG *icol, ITG *jq, ITG **irowp, ITG *neq, ITG *nzl, ITG *nmethod, ITG *ikmpc, ITG *ilmpc, ITG *ikboun, ITG *ilboun, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *shcon, ITG *nshcon, double *cocon, ITG *ncocon, double *alcon, ITG *nalcon, double *alzero, ITG **ielmatp, ITG **ielorienp, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, double *t1old, ITG *ithermal, double *prestr, ITG *iprestr, double *vold, ITG *iperturb, double *sti, ITG *nzs, ITG *kode, ITG *mei, double *fei, char *filab, double *eme, ITG *iexpl, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double **xstatep, ITG *npmat_, char *matname, ITG *mi, ITG *ncmat_, ITG *nstate_, double **enerp, char *jobnamec, char *output, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nprint, char *prlab, char *prset, ITG *nener, ITG *isolver, double *trab, ITG *inotr, ITG *ntrans, double *ttime, double *fmpc, char *cbody, ITG *ibody, double *xbody, ITG *nbody, double *thicke, ITG *nslavs, double *tietol, ITG *nkon, ITG *mpcinfo, ITG *ntie, ITG *istep, ITG *mcs, ITG *ics, char *tieset, double *cs, ITG *nintpoint, ITG *mortar, ITG *ifacecount, ITG **islavsurfp, double **pslavsurfp, double **clearinip, ITG *nmat, char *typeboun, ITG *ielprop, double *prop, char *orname)
 
void arpackbu (double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, char *labmpc, ITG *nmpc, ITG *nodeforc, ITG *ndirforc, double *xforc, ITG *nforc, ITG *nelemload, char *sideload, double *xload, ITG *nload, ITG *nactdof, ITG *icol, ITG *jq, ITG *irow, ITG *neq, ITG *nzl, ITG *nmethod, ITG *ikmpc, ITG *ilmpc, ITG *ikboun, ITG *ilboun, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, double *t1old, ITG *ithermal, double *prestr, ITG *iprestr, double *vold, ITG *iperturb, double *sti, ITG *nzs, ITG *kode, ITG *mei, double *fei, char *filab, double *eme, ITG *iexpl, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstate, ITG *npmat_, char *matname, ITG *mi, ITG *ncmat_, ITG *nstate_, double *ener, char *output, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nprint, char *prlab, char *prset, ITG *nener, ITG *isolver, double *trab, ITG *inotr, ITG *ntrans, double *ttime, double *fmpc, char *cbody, ITG *ibody, double *xbody, ITG *nbody, double *thicke, char *jobnamec, ITG *nmat, ITG *ielprop, double *prop, char *orname)
 
void arpackcs (double *co, ITG *nk, ITG **konp, ITG **ipkonp, char **lakonp, ITG *ne, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, char *labmpc, ITG *nmpc, ITG *nodeforc, ITG *ndirforc, double *xforc, ITG *nforc, ITG *nelemload, char *sideload, double *xload, ITG *nload, ITG *nactdof, ITG *icol, ITG *jq, ITG **irowp, ITG *neq, ITG *nzl, ITG *nmethod, ITG *ikmpc, ITG *ilmpc, ITG *ikboun, ITG *ilboun, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG **ielmatp, ITG **ielorienp, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, double *t1old, ITG *ithermal, double *prestr, ITG *iprestr, double *vold, ITG *iperturb, double *sti, ITG *nzs, ITG *kode, ITG *mei, double *fei, char *filab, double *eme, ITG *iexpl, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double **xstatep, ITG *npmat_, char *matname, ITG *mi, ITG *ics, double *cs, ITG *mpcend, ITG *ncmat_, ITG *nstate_, ITG *mcs, ITG *nkon, double **enerp, char *jobnamec, char *output, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nprint, char *prlab, char *prset, ITG *nener, ITG *isolver, double *trab, ITG *inotr, ITG *ntrans, double *ttime, double *fmpc, char *cbody, ITG *ibody, double *xbody, ITG *nbody, ITG *nevtot, double *thicke, ITG *nslavs, double *tietol, ITG *mpcinfo, ITG *ntie, ITG *istep, char *tieset, ITG *nintpoint, ITG *mortar, ITG *ifacecount, ITG **islavsurfp, double **pslavsurfp, double **clearinip, ITG *nmat, char *typeboun, ITG *ielprop, double *prop, char *orname)
 
void FORTRAN (assigndomtonodes,(ITG *ne, char *lakon, ITG *ipkon, ITG *kon, ITG *ielmat, ITG *inomat, double *elcon, ITG *ncmat_, ITG *ntmat_, ITG *mi, ITG *ne2))
 
void FORTRAN (autocovmatrix,(double *co, double *ad, double *au, ITG *jqs, ITG *irows, ITG *ndesi, ITG *nodedesi, double *physcon))
 
void FORTRAN (basis,(double *x, double *y, double *z, double *xo, double *yo, double *zo, ITG *nx, ITG *ny, ITG *nz, double *planfa, ITG *ifatet, ITG *nktet, ITG *netet, double *field, ITG *nfield, double *cotet, ITG *kontyp, ITG *ipkon, ITG *kon, ITG *iparent, double *xp, double *yp, double *zp, double *value, double *ratio, ITG *iselect, ITG *nselect, ITG *istartset, ITG *iendset, ITG *ialset, ITG *imastset, ITG *ielemnr, ITG *nterms, ITG *konl))
 
void biosav (ITG *ipkon, ITG *kon, char *lakon, ITG *ne, double *co, double *qfx, double *h0, ITG *mi, ITG *inomat, ITG *nk)
 
void FORTRAN (biotsavart,(ITG *ipkon, ITG *kon, char *lakon, ITG *ne, double *co, double *qfx, double *h0, ITG *mi, ITG *nka, ITG *nkb))
 
void * biotsavartmt (ITG *i)
 
void FORTRAN (blockanalysis,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nblk, ITG *ipkon, ITG *kon, ITG *ielfa, ITG *nodface, ITG *neiel, ITG *neij, ITG *neifa, ITG *ipoface, ITG *ipnei, ITG *konf, ITG *istartblk, ITG *iendblk, ITG *nactdoh, ITG *nblket, ITG *nblkze, ITG *nef, ITG *ielblk, ITG *nk, ITG *nactdohinv))
 
void FORTRAN (bodyforce,(char *cbody, ITG *ibody, ITG *ipobody, ITG *nbody, char *set, ITG *istartset, ITG *iendset, ITG *ialset, ITG *inewton, ITG *nset, ITG *ifreebody, ITG *k))
 
void FORTRAN (calcbody,(ITG *nef, double *body, ITG *ipobody, ITG *ibody, double *xbody, double *coel, double *vel, char *lakon, ITG *nactdohinv))
 
void FORTRAN (calcguesstincf,(ITG *nface, double *dmin, double *vfa, double *umfa, double *cvfa, double *hcfa, ITG *ithermal, double *tincfguess, ITG *compressible))
 
void FORTRAN (calcinitialflux,(double *area, double *vfa, double *xxn, ITG *ipnei, ITG *nef, ITG *neifa, char *lakonf, double *flux))
 
void FORTRAN (calccvel,(ITG *nef, double *vel, double *shcon, ITG *nshcon, ITG *ielmatf, ITG *ntmat_, ITG *mi, double *cvel, double *physcon))
 
void FORTRAN (calccvelcomp,(ITG *nef, double *vel, double *shcon, ITG *nshcon, ITG *ielmatf, ITG *ntmat_, ITG *mi, double *cvel, double *physcon))
 
void FORTRAN (calccvfa,(ITG *nface, double *vfa, double *shcon, ITG *nshcon, ITG *ielmatf, ITG *ntmat_, ITG *mi, ITG *ielfa, double *cvfa, double *physcon))
 
void FORTRAN (calccvfacomp,(ITG *nface, double *vfa, double *shcon, ITG *nshcon, ITG *ielmatf, ITG *ntmat_, ITG *mi, ITG *ielfa, double *cvfa, double *physcon))
 
void FORTRAN (calcgamma,(ITG *nface, ITG *ielfa, double *vel, double *gradvel, double *gamma, double *xlet, double *xxn, double *xxj, ITG *ipnei, double *betam, ITG *nef, double *flux))
 
void FORTRAN (calcgammak,(ITG *nface, ITG *ielfa, double *vel, double *gradkel, double *gamma, double *xlet, double *xxn, double *xxj, ITG *ipnei, double *betam, ITG *nef, double *flux))
 
void FORTRAN (calcgammao,(ITG *nface, ITG *ielfa, double *vel, double *gradoel, double *gamma, double *xlet, double *xxn, double *xxj, ITG *ipnei, double *betam, ITG *nef, double *flux))
 
void FORTRAN (calcgammap,(ITG *nface, ITG *ielfa, double *vel, double *gradpel, double *gamma, double *xlet, double *xxn, double *xxj, ITG *ipnei, double *betam, ITG *nef, double *flux))
 
void FORTRAN (calcgammat,(ITG *nface, ITG *ielfa, double *vel, double *gradtel, double *gamma, double *xlet, double *xxn, double *xxj, ITG *ipnei, double *betam, ITG *nef, double *flux))
 
void FORTRAN (calcgradkel,(ITG *ne, char *lakon, ITG *ipnei, double *vfa, double *area, double *xxn, double *gradkel, ITG *neifa, double *volume))
 
void FORTRAN (calcgradoel,(ITG *ne, char *lakon, ITG *ipnei, double *vfa, double *area, double *xxn, double *gradoel, ITG *neifa, double *volume))
 
void FORTRAN (calcgradpel,(ITG *ne, char *lakon, ITG *ipnei, double *vfa, double *area, double *xxn, double *gradpel, ITG *neifa, double *volume))
 
void FORTRAN (calcgradtel,(ITG *ne, char *lakon, ITG *ipnei, double *vfa, double *area, double *xxn, double *gradtel, ITG *neifa, double *volume))
 
void FORTRAN (calcgradvel,(ITG *ne, char *lakon, ITG *ipnei, double *vfa, double *area, double *xxn, double *gradv, ITG *neifa, double *volume))
 
void FORTRAN (calchcel,(double *vel, double *cocon, ITG *ncocon, ITG *ielmatf, ITG *ntmat_, ITG *mi, double *hcel, ITG *nef))
 
void FORTRAN (calchcfa,(ITG *nface, double *vfa, double *cocon, ITG *ncocon, ITG *ielmatf, ITG *ntmat_, ITG *mi, ITG *ielfa, double *hcfa))
 
void FORTRAN (calch0interface,(ITG *nmpc, ITG *ipompc, ITG *nodempc, double *coefmpc, double *h0))
 
void FORTRAN (calcmac,(ITG *neq, double *z, double *zz, ITG *nev, double *mac, double *maccpx, ITG *istartnmd, ITG *iendnmd, ITG *nmd, ITG *cyclicsymmetry, ITG *neqact, double *bett, double *betm))
 
void FORTRAN (calcmass,(ITG *ipkon, char *lakon, ITG *kon, double *co, ITG *mi, ITG *nelem, ITG *ne, double *thicke, ITG *ielmat, ITG *nope, double *t0, double *t1, double *rhcon, ITG *nrhcon, ITG *ntmat_, ITG *ithermal, double *csmass, ITG *ielprop, double *prop))
 
void FORTRAN (calcmatwavspeed,(ITG *ne0, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *orab, ITG *ntmat_, ITG *ithermal, double *alzero, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, ITG *npmat_, ITG *mi, double *dtime, double *xstiff, ITG *ncmat_, double *vold, ITG *ielmat, double *t0, double *t1, char *matname, char *lakon, double *xmatwavespeed, ITG *nmat, ITG *ipkon))
 
void FORTRAN (calcpel,(ITG *ne, ITG *nactdoh, double *vel, double *b, ITG *nef))
 
void calcresidual (ITG *nmethod, ITG *neq, double *b, double *fext, double *f, ITG *iexpl, ITG *nactdof, double *aux2, double *vold, double *vini, double *dtime, double *accold, ITG *nk, double *adb, double *aub, ITG *icol, ITG *irow, ITG *nzl, double *alpha, double *fextini, double *fini, ITG *islavnode, ITG *nslavnode, ITG *mortar, ITG *ntie, double *f_cm, double *f_cs, ITG *mi, ITG *nzs, ITG *nasym, ITG *idamping, double *veold, double *adc, double *auc, double *cvini, double *cv)
 
void calcresidual_em (ITG *nmethod, ITG *neq, double *b, double *fext, double *f, ITG *iexpl, ITG *nactdof, double *aux1, double *aux2, double *vold, double *vini, double *dtime, double *accold, ITG *nk, double *adb, double *aub, ITG *icol, ITG *irow, ITG *nzl, double *alpha, double *fextini, double *fini, ITG *islavnode, ITG *nslavnode, ITG *mortar, ITG *ntie, double *f_cm, double *f_cs, ITG *mi, ITG *nzs, ITG *nasym, ITG *ithermal)
 
void FORTRAN (calcrhoel,(ITG *nef, double *vel, double *rhcon, ITG *nrhcon, ITG *ielmatf, ITG *ntmat_, ITG *ithermal, ITG *mi))
 
void FORTRAN (calcrhoelcomp,(ITG *nef, double *vel, double *shcon, ITG *ielmatf, ITG *ntmat_, ITG *mi))
 
void FORTRAN (calcrhofa,(ITG *nface, double *vfa, double *rhcon, ITG *nrhcon, ITG *ielmatf, ITG *ntmat_, ITG *ithermal, ITG *mi, ITG *ielfa))
 
void FORTRAN (calcrhofacomp,(ITG *nface, double *vfa, double *shcon, ITG *ielmatf, ITG *ntmat_, ITG *mi, ITG *ielfa, ITG *ipnei, double *vel, ITG *nef, double *flux, double *gradpel, double *gradtel, double *xxj, double *betam, double *xlet))
 
void FORTRAN (calcstabletimeinccont,(ITG *ne, char *lakon, ITG *kon, ITG *ipkon, ITG *mi, ITG *ielmat, double *elcon, ITG *mortar, double *adb, double *alpha, ITG *nactdof, double *springarea, ITG *ne0, ITG *ntmat_, ITG *ncmat_, double *dtcont))
 
void FORTRAN (calcstabletimeincvol,(ITG *ne0, char *lakon, double *co, ITG *kon, ITG *ipkon, ITG *mi, ITG *ielmat, double *dtvol, double *alpha, double *xmatwavespeed))
 
void FORTRAN (calcstressheatflux,(double *sti, double *umel, double *gradvel, double *qfx, double *hcel, double *gradtel, ITG *nef, ITG *isti, ITG *iqfx, ITG *mi))
 
void FORTRAN (calctel,(ITG *ne, ITG *nactdoh, double *vel, double *b, ITG *nef))
 
void FORTRAN (calcumel,(ITG *nef, double *vel, double *shcon, ITG *nshcon, ITG *ielmatf, ITG *ntmat_, ITG *ithermal, ITG *mi, double *umel))
 
void FORTRAN (calcumfa,(ITG *nface, double *vfa, double *shcon, ITG *nshcon, ITG *ielmatf, ITG *ntmat_, ITG *ithermal, ITG *mi, ITG *ielfa, double *umfa))
 
void FORTRAN (calcvel,(ITG *ne, ITG *nactdoh, double *vel, double *b, ITG *neq, ITG *nef))
 
void FORTRAN (calcview,(char *sideload, double *vold, double *co, double *pmid, double *e1, double *e2, double *e3, ITG *kontri, ITG *nloadtr, double *adview, double *auview, double *dist, ITG *idist, double *area, ITG *ntrit, ITG *mi, ITG *jqrad, ITG *irowrad, ITG *nzsrad, double *sidemean, ITG *ntria, ITG *ntrib, char *covered, ITG *ng))
 
void * calcviewmt (ITG *i)
 
void FORTRAN (calinput,(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *nkon, ITG *ne, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, ITG *nmpc, ITG *nmpc_, ITG *nodeforc, ITG *ndirforc, double *xforc, ITG *nforc, ITG *nforc_, ITG *nelemload, char *sideload, double *xload, ITG *nload, ITG *nload_, ITG *nprint, char *prlab, char *prset, ITG *mpcfree, ITG *nboun_, ITG *mei, char *set, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nset, ITG *nalset, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, double *t0, double *t1, char *matname, ITG *ielmat, char *orname, double *orab, ITG *ielorien, char *amname, double *amta, ITG *namta, ITG *nam, ITG *nmethod, ITG *iamforc, ITG *iamload, ITG *iamt1, ITG *ithermal, ITG *iperturb, ITG *istat, ITG *istep, ITG *nmat, ITG *ntmat_, ITG *norien, double *prestr, ITG *iprestr, ITG *isolver, double *fei, double *veold, double *timepar, double *xmodal, char *filab, ITG *jout, ITG *nlabel, ITG *idrct, ITG *jmax, ITG *iexpl, double *alpha, ITG *iamboun, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, ITG *iplas, ITG *npmat_, ITG *mi, ITG *nk_, double *trab, ITG *inotr, ITG *ntrans, ITG *ikboun, ITG *ilboun, ITG *ikmpc, ITG *ilmpc, ITG *ics, double *dcs, ITG *ncs_, ITG *namtot_, double *cs, ITG *nstate_, ITG *ncmat_, ITG *iumat, ITG *mcs, char *labmpc, ITG *iponor, double *xnor, ITG *knor, double *thickn, double *thicke, ITG *ikforc, ITG *ilforc, double *offset, ITG *iponoel, ITG *inoel, ITG *rig, ITG *infree, ITG *nshcon, double *shcon, double *cocon, ITG *ncocon, double *physcon, ITG *nflow, double *ctrl, ITG *maxlenmpc, ITG *ne1d, ITG *ne2d, ITG *nener, double *vold, ITG *nodebounold, ITG *ndirbounold, double *xbounold, double *xforcold, double *xloadold, double *t1old, double *eme, double *sti, double *ener, double *xstate, char *jobnamec, ITG *irstrt, double *ttime, double *qaold, char *output, char *typeboun, char *inpc, ITG *ipoinp, ITG *inp, char *tieset, double *tietol, ITG *ntie, double *fmpc, char *cbody, ITG *ibody, double *xbody, ITG *nbody, ITG *nbody_, double *xbodyold, ITG *nam_, ITG *ielprop, ITG *nprop, ITG *nprop_, double *prop, ITG *itpamp, ITG *iviewfile, ITG *ipoinpc, ITG *cfd, ITG *nslavs, double *t0g, double *t1g, ITG *network, ITG *cyclicsymmetry, ITG *idefforc, ITG *idefload, ITG *idefbody, ITG *mortar, ITG *ifacecount, ITG *islavsurf, double *pslavsurf, double *clearini, char *heading, ITG *iaxial, ITG *nobject, char *objectset, ITG *nprint_, ITG *iuel, ITG *nuel_, ITG *nodempcref, double *coefmpcref, ITG *ikmpcref, ITG *memmpcref_, ITG *mpcfreeref, ITG *maxlenmpcref, ITG *memmpc_))
 
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, char *labmpc, ITG *nk, ITG *memmpc_, ITG *icascade, ITG *maxlenmpc, ITG *callfrommain, ITG *iperturb, ITG *ithermal)
 
void FORTRAN (cataloguenodes,(ITG *iponofa, ITG *inofa, ITG *ifreefa, ITG *ielfa, ITG *ifaboun, ITG *ipkon, ITG *kon, char *lakon, ITG *nface, ITG *ne))
 
ITG cgsolver (double *A, double *x, double *b, ITG neq, ITG len, ITG *ia, ITG *iz, double *eps, ITG *niter, ITG precFlg)
 
void checkconvergence (double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, double *stn, ITG *nmethod, ITG *kode, char *filab, double *een, double *t1act, double *time, double *epn, ITG *ielmat, char *matname, double *enern, double *xstaten, ITG *nstate_, ITG *istep, ITG *iinc, ITG *iperturb, double *ener, ITG *mi, char *output, ITG *ithermal, double *qfn, ITG *mode, ITG *noddiam, double *trab, ITG *inotr, ITG *ntrans, double *orab, ITG *ielorien, ITG *norien, char *description, double *sti, ITG *icutb, ITG *iit, double *dtime, double *qa, double *vold, double *qam, double *ram1, double *ram2, double *ram, double *cam, double *uam, ITG *ntg, double *ttime, ITG *icntrl, double *theta, double *dtheta, double *veold, double *vini, ITG *idrct, double *tper, ITG *istab, double *tmax, ITG *nactdof, double *b, double *tmin, double *ctrl, double *amta, ITG *namta, ITG *itpamp, ITG *inext, double *dthetaref, ITG *itp, ITG *jprint, ITG *jout, ITG *uncoupled, double *t1, ITG *iitterm, ITG *nelemload, ITG *nload, ITG *nodeboun, ITG *nboun, ITG *itg, ITG *ndirboun, double *deltmx, ITG *iflagact, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, double *emn, double *thicke, char *jobnamec, ITG *mortar, ITG *nmat, ITG *ielprop, double *prop, ITG *ialeatoric, ITG *kscale, double *energy, double *allwk, double *energyref, double *emax, double *enres, double *enetoll, double *energyini, double *allwkini, double *temax, double *reswk, ITG *ne0, ITG *neini, double *dampwk, double *dampwkini, double *energystartstep)
 
void checkconvnet (ITG *icutb, ITG *iin, double *cam1t, double *cam1f, double *cam1p, double *cam2t, double *cam2f, double *cam2p, double *camt, double *camf, double *camp, ITG *icntrl, double *dtheta, double *ctrl, double *cam1a, double *cam2a, double *cama, double *vamt, double *vamf, double *vamp, double *vama, double *qa, double *qamt, double *qamf, double *ramt, double *ramf, double *ramp, ITG *iplausi)
 
void FORTRAN (checkconstraint,(ITG *nobject, char *objectset, double *g0, ITG *nactive, ITG *nnlconst, ITG *ipoacti, ITG *ndesi, double *dgdxglob, ITG *nk, ITG *nodedesi))
 
void checkdivergence (double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, double *stn, ITG *nmethod, ITG *kode, char *filab, double *een, double *t1act, double *time, double *epn, ITG *ielmat, char *matname, double *enern, double *xstaten, ITG *nstate_, ITG *istep, ITG *iinc, ITG *iperturb, double *ener, ITG *mi, char *output, ITG *ithermal, double *qfn, ITG *mode, ITG *noddiam, double *trab, ITG *inotr, ITG *ntrans, double *orab, ITG *ielorien, ITG *norien, char *description, double *sti, ITG *icutb, ITG *iit, double *dtime, double *qa, double *vold, double *qam, double *ram1, double *ram2, double *ram, double *cam, double *uam, ITG *ntg, double *ttime, ITG *icntrl, double *theta, double *dtheta, double *veold, double *vini, ITG *idrct, double *tper, ITG *istab, double *tmax, ITG *nactdof, double *b, double *tmin, double *ctrl, double *amta, ITG *namta, ITG *itpamp, ITG *inext, double *dthetaref, ITG *itp, ITG *jprint, ITG *jout, ITG *uncoupled, double *t1, ITG *iitterm, ITG *nelemload, ITG *nload, ITG *nodeboun, ITG *nboun, ITG *itg, ITG *ndirboun, double *deltmx, ITG *iflagact, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, double *emn, double *thicke, char *jobnamec, ITG *mortar, ITG *nmat, ITG *ielprop, double *prop, ITG *ialeatoric, ITG *kscale, double *energy, double *allwk, double *energyref, double *emax, double *enres, double *enetoll, double *energyini, double *allwkini, double *temax, double *reswk, ITG *ne0, ITG *neini, double *dampwk, double *dampwkini, double *energystartstep)
 
void checkinclength (double *time, double *ttime, double *theta, double *dtheta, ITG *idrct, double *tper, double *tmax, double *tmin, double *ctrl, double *amta, ITG *namta, ITG *itpamp, ITG *inext, double *dthetaref, ITG *itp, ITG *jprint, ITG *jout)
 
void FORTRAN (checkimpacts,(ITG *ne, ITG *neini, double *temax, double *sizemaxinc, double *energyref, double *tmin, double *tper, ITG *idivergence, ITG *idirinctime, ITG *istab, double *dtheta, double *enres, double *energy, double *energyini, double *allwk, double *allwkini, double *dampwk, double *dampwkini, double *emax, ITG *mortar, double *maxdecay, double *enetoll))
 
void FORTRAN (checkinputvaluesnet,(ITG *ieg, ITG *nflow, double *prop, ITG *ielprop, char *lakon))
 
void FORTRAN (checktime,(ITG *itpamp, ITG *namta, double *tinc, double *ttime, double *amta, double *tmin, ITG *inext, ITG *itp, ITG *istep, double *tper))
 
void FORTRAN (checktruecontact,(ITG *ntie, char *tieset, double *tietol, double *elcon, ITG *itruecontact, ITG *ncmat_, ITG *ntmat_))
 
void FORTRAN (closefile,())
 
void FORTRAN (closefilefluid,())
 
void compfluid (double **cop, ITG *nk, ITG **ipkonp, ITG *konf, char **lakonp, char **sideface, ITG *ifreestream, ITG *nfreestream, ITG *isolidsurf, ITG *neighsolidsurf, ITG *nsolidsurf, ITG *nshcon, double *shcon, ITG *nrhcon, double *rhcon, double **voldp, ITG *ntmat_, ITG *nodeboun, ITG *ndirboun, ITG *nboun, ITG *ipompc, ITG *nodempc, ITG *nmpc, ITG *ikmpc, ITG *ilmpc, ITG *ithermal, ITG *ikboun, ITG *ilboun, ITG *turbulent, ITG *isolver, ITG *iexpl, double *ttime, double *time, double *dtime, ITG *nodeforc, ITG *ndirforc, double *xforc, ITG *nforc, ITG *nelemload, char *sideload, double *xload, ITG *nload, double *xbody, ITG *ipobody, ITG *nbody, ITG *ielmatf, char *matname, ITG *mi, ITG *ncmat_, double *physcon, ITG *istep, ITG *iinc, ITG *ibody, double *xloadold, double *xboun, double *coefmpc, ITG *nmethod, double *xforcold, double *xforcact, ITG *iamforc, ITG *iamload, double *xbodyold, double *xbodyact, double *t1old, double *t1, double *t1act, ITG *iamt1, double *amta, ITG *namta, ITG *nam, double *ampli, double *xbounold, double *xbounact, ITG *iamboun, ITG *itg, ITG *ntg, char *amname, double *t0, ITG **nelemface, ITG *nface, double *cocon, ITG *ncocon, double *xloadact, double *tper, ITG *jmax, ITG *jout, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *prset, char *prlab, ITG *nprint, double *trab, ITG *inotr, ITG *ntrans, char *filab, char *labmpc, double *sti, ITG *norien, double *orab, char *jobnamef, char *tieset, ITG *ntie, ITG *mcs, ITG *ics, double *cs, ITG *nkon, ITG *mpcfree, ITG *memmpc_, double *fmpc, ITG *nef, ITG **inomat, double *qfx, ITG *neifa, ITG *neiel, ITG *ielfa, ITG *ifaext, double *vfa, double *vel, ITG *ipnei, ITG *nflnei, ITG *nfaext, char *typeboun, ITG *neij, double *tincf, ITG *nactdoh, ITG *nactdohinv, ITG *ielorien, char *jobnamec, ITG *ifatie, ITG *nstate_, double *xstate, char *orname, ITG *nblk, ITG *ielblk, ITG *istartblk, ITG *iendblk, ITG *nblket, ITG *nblkze, ITG *kon)
 
void FORTRAN (complete_hel,(ITG *neq, double *b, double *hel, double *ad, double *au, ITG *jq, ITG *irow, ITG *nzs))
 
void FORTRAN (complete_hel_blk,(double *vel, double *hel, double *auv6, ITG *ipnei, ITG *neiel, ITG *nef, ITG *nactdohinv))
 
void FORTRAN (complete_hel_cyclic,(ITG *neq, double *b, double *hel, double *ad, double *au, ITG *jq, ITG *irow, ITG *ipnei, ITG *neiel, ITG *ifatie, double *c, char *lakonf, ITG *neifa, ITG *nzs))
 
void FORTRAN (complete_hel_cyclic_blk,(double *vel, double *hel, double *auv6, double *c, ITG *ipnei, ITG *neiel, ITG *neifa, ITG *ifatie, ITG *nef))
 
void complete_hel_blk_main (double *vel, double *hel, double *auv6, double *c, ITG *ipnei, ITG *neiel, ITG *neifa, ITG *ifatie, ITG *nef)
 
void complexfreq (double **cop, ITG *nk, ITG **konp, ITG **ipkonp, char **lakonp, ITG *ne, ITG **nodebounp, ITG **ndirbounp, double **xbounp, ITG *nboun, ITG **ipompcp, ITG **nodempcp, double **coefmpcp, char **labmpcp, ITG *nmpc, ITG *nodeforc, ITG *ndirforc, double *xforc, ITG *nforc, ITG *nelemload, char *sideload, double *xload, ITG *nload, ITG **nactdofp, ITG *neq, ITG *nzl, ITG *icol, ITG *irow, ITG *nmethod, ITG **ikmpcp, ITG **ilmpcp, ITG **ikbounp, ITG **ilbounp, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *cocon, ITG *ncocon, double *alcon, ITG *nalcon, double *alzero, ITG **ielmatp, ITG **ielorienp, ITG *norien, double *orab, ITG *ntmat_, double **t0p, double **t1p, ITG *ithermal, double *prestr, ITG *iprestr, double **voldp, ITG *iperturb, double **stip, ITG *nzs, double *timepar, double *xmodal, double **veoldp, char *amname, double *amta, ITG *namta, ITG *nam, ITG *iamforc, ITG *iamload, ITG **iamt1p, ITG *jout, ITG *kode, char *filab, double **emep, double *xforcold, double *xloadold, double **t1oldp, ITG **iambounp, double **xbounoldp, ITG *iexpl, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstate, ITG *npmat_, char *matname, ITG *mi, ITG *ncmat_, ITG *nstate_, double **enerp, char *jobnamec, double *ttime, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG **ialsetp, ITG *nprint, char *prlab, char *prset, ITG *nener, double *trab, ITG **inotrp, ITG *ntrans, double **fmpcp, char *cbody, ITG *ibody, double *xbody, ITG *nbody, double *xbodyold, ITG *istep, ITG *isolver, ITG *jq, char *output, ITG *mcs, ITG *nkon, ITG *mpcend, ITG *ics, double *cs, ITG *ntie, char *tieset, ITG *idrct, ITG *jmax, double *ctrl, ITG *itpamp, double *tietol, ITG *nalset, ITG *ikforc, ITG *ilforc, double *thicke, char *jobnamef, ITG *mei, ITG *nmat, ITG *ielprop, double *prop, char *orname)
 
void contact (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, ITG *ifree, double *co, double *vold, ITG *ielmat, double *cs, double *elcon, ITG *istep, ITG *iinc, ITG *iit, ITG *ncmat_, ITG *ntmat_, ITG *ne0, double *vini, ITG *nmethod, ITG *iperturb, ITG *ikboun, ITG *nboun, ITG *mi, ITG *imastop, ITG *nslavnode, ITG *islavnode, ITG *islavsurf, ITG *itiefac, double *areaslav, ITG *iponoels, ITG *inoels, double *springarea, double *tietol, double *reltime, ITG *imastnode, ITG *nmastnode, double *xmastnor, char *filab, ITG *mcs, ITG *ics, ITG *nasym, double *xnoels, ITG *mortar, double *pslavsurf, double *pmastsurf, double *clearini, double *theta, double *xstateini, double *xstate, ITG *nstate_, ITG *icutb, ITG *ialeatoric, char *jobnamef)
 
void FORTRAN (convert2slapcol,(double *au, double *ad, ITG *jq, ITG *nzs, ITG *nef, double *aua))
 
void FORTRAN (coriolissolve,(double *cc, ITG *nev, double *aa, double *bb, double *xx, double *eiga, double *eigb, double *eigxx, ITG *iter, double *d, double *temp))
 
void FORTRAN (correctvel,(double *hel, double *adv, double *vfa, ITG *ipnei, double *area, double *bv, double *xxn, ITG *neifa, char *lakon, ITG *ne, ITG *neq))
 
void FORTRAN (correctvfa,(ITG *nface, ITG *ielfa, double *area, double *vfa, double *ap, double *bp, double *xxn, ITG *ifabou, ITG *ipnei, ITG *nef, ITG *neifa, double *hfa, double *vel, double *xboun, char *lakonf, double *flux))
 
void FORTRAN (createfint,(ITG *ne, ITG *ipkon, char *lakon, ITG *kon, ITG *nactdof, ITG *mi, double *fn0, double *fint))
 
void FORTRAN (createialdesi,(ITG *ndesi, ITG *nodedesi, ITG *iponoel, ITG *inoel, ITG *istartdesi, ITG *ialdesi, char *lakon, ITG *ipkon, ITG *kon, ITG *nodedesiinv, ITG *icoordinate, ITG *noregion))
 
void FORTRAN (createialelem,(ITG *ne, ITG *istartelem, ITG *ialelem, ITG *ipoeldi, ITG *ieldi))
 
void FORTRAN (createinterfacempcs,(ITG *imastnode, double *xmastnor, ITG *nmastnode, ITG *ikmpc, ITG *ilmpc, ITG *nmpc, ITG *ipompc, ITG *nodempc, double *coefmpc, char *labmpc, ITG *mpcfree, ITG *ikboun, ITG *nboun))
 
void FORTRAN (createinum,(ITG *ipkon, ITG *inum, ITG *kon, char *lakon, ITG *nk, ITG *ne, char *cflag, ITG *nelemload, ITG *nload, ITG *nodeboun, ITG *nboun, ITG *ndirboun, ITG *ithermal, double *co, double *vold, ITG *mi, ITG *ielmat))
 
void FORTRAN (createmddof,(ITG *imddof, ITG *nmddof, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nactdof, ITG *ithermal, ITG *mi, ITG *imdnode, ITG *nmdnode, ITG *ikmpc, ITG *ilmpc, ITG *ipompc, ITG *nodempc, ITG *nmpc, ITG *imdmpc, ITG *nmdmpc, ITG *imdboun, ITG *nmdboun, ITG *ikboun, ITG *nboun, ITG *nset, ITG *ntie, char *tieset, char *set, char *lakon, ITG *kon, ITG *ipkon, char *labmpc, ITG *ilboun, char *filab, char *prlab, char *prset, ITG *nprint, ITG *ne, ITG *cyclicsymmetry))
 
void FORTRAN (createmdelem,(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, ITG *imdelem, ITG *nmdelem, ITG *iponoel, ITG *inoel, char *prlab, char *prset, ITG *nprint, char *lakon, char *set, ITG *nset, ITG *ialset, ITG *ipkon, ITG *kon, ITG *istartset, ITG *iendset, ITG *nforc, ITG *ikforc, ITG *ilforc))
 
void FORTRAN (createtiedsurfs,(ITG *nodface, ITG *ipoface, char *set, ITG *istartset, ITG *iendset, ITG *ialset, char *tieset, ITG *inomat, ITG *ne, ITG *ipkon, char *lakon, ITG *kon, ITG *ntie, double *tietol, ITG *nalset, ITG *nk, ITG *nset, ITG *iactive))
 
void FORTRAN (create_iau6,(ITG *nef, ITG *ipnei, ITG *neiel, ITG *jq, ITG *irow, ITG *nzs, ITG *iau6, char *lakonf))
 
void FORTRAN (dattime,(char *date, char *clock))
 
void CEE (ddotc,(ITG *n, double *dx, ITG *incx, double *dy, ITG *incy, double *funcddot))
 
void * ddotc1mt (ITG *i)
 
void FORTRAN (desiperelem,(ITG *ndesi, ITG *istartdesi, ITG *ialdesi, ITG *ipoeldi, ITG *ieldi, ITG *ne))
 
void dfdbj (double *bcont, double **dbcontp, ITG *neq, ITG *nope, ITG *konl, ITG *nactdof, double *s, double *z, ITG *ikmpc, ITG *ilmpc, ITG *ipompc, ITG *nodempc, ITG *nmpc, double *coefmpc, double *fnl, ITG *nev, ITG **ikactcontp, ITG **ilactcontp, ITG *nactcont, ITG *nactcont_, ITG *mi, ITG *cyclicsymmetry, ITG *izdof, ITG *nzdof)
 
void FORTRAN (dgesv,(ITG *nteq, ITG *nhrs, double *ac, ITG *lda, ITG *ipiv, double *bc, ITG *ldb, ITG *info))
 
void FORTRAN (dgetrs,(char *trans, ITG *nteq, ITG *nrhs, double *ac, ITG *lda, ITG *ipiv, double *bc, ITG *ldb, ITG *info))
 
void FORTRAN (drfftf,(ITG *ndata, double *r, double *wsave, ITG *isave))
 
void FORTRAN (drffti,(ITG *ndata, double *wsave, ITG *isave))
 
void FORTRAN (dnaupd,(ITG *ido, char *bmat, ITG *n, char *which, ITG *nev, double *tol, double *resid, ITG *ncv, double *z, ITG *ldz, ITG *iparam, ITG *ipntr, double *workd, double *workl, ITG *lworkl, ITG *info))
 
void FORTRAN (dsaupd,(ITG *ido, char *bmat, ITG *n, char *which, ITG *nev, double *tol, double *resid, ITG *ncv, double *z, ITG *ldz, ITG *iparam, ITG *ipntr, double *workd, double *workl, ITG *lworkl, ITG *info))
 
void FORTRAN (dneupd,(ITG *rvec, char *howmny, ITG *select, double *d, double *di, double *z, ITG *ldz, double *sigma, double *sigmai, double *workev, char *bmat, ITG *neq, char *which, ITG *nev, double *tol, double *resid, ITG *ncv, double *v, ITG *ldv, ITG *iparam, ITG *ipntr, double *workd, double *workl, ITG *lworkl, ITG *info))
 
void FORTRAN (dseupd,(ITG *rvec, char *howmny, ITG *select, double *d, double *z, ITG *ldz, double *sigma, char *bmat, ITG *neq, char *which, ITG *nev, double *tol, double *resid, ITG *ncv, double *v, ITG *ldv, ITG *iparam, ITG *ipntr, double *workd, double *workl, ITG *lworkl, ITG *info))
 
void FORTRAN (dsort,(double *dx, ITG *iy, ITG *n, ITG *kflag))
 
void dyna (double **cop, ITG *nk, ITG **konp, ITG **ipkonp, char **lakonp, ITG *ne, ITG **nodebounp, ITG **ndirbounp, double **xbounp, ITG *nboun, ITG **ipompcp, ITG **nodempcp, double **coefmpcp, char **labmpcp, ITG *nmpc, ITG *nodeforc, ITG *ndirforc, double *xforc, ITG *nforc, ITG *nelemload, char *sideload, double *xload, ITG *nload, ITG **nactdofp, ITG *neq, ITG *nzl, ITG *icol, ITG *irow, ITG *nmethod, ITG **ikmpcp, ITG **ilmpcp, ITG **ikbounp, ITG **ilbounp, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *cocon, ITG *ncocon, double *alcon, ITG *nalcon, double *alzero, ITG **ielmatp, ITG **ielorienp, ITG *norien, double *orab, ITG *ntmat_, double **t0p, double **t1p, ITG *ithermal, double *prestr, ITG *iprestr, double **voldp, ITG *iperturb, double **stip, ITG *nzs, double *timepar, double *xmodal, double **veoldp, char *amname, double *amta, ITG *namta, ITG *nam, ITG *iamforc, ITG *iamload, ITG **iamt1p, ITG *jout, ITG *kode, char *filab, double **emep, double *xforcold, double *xloadold, double **t1oldp, ITG **iambounp, double **xbounoldp, ITG *iexpl, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double **xstatep, ITG *npmat_, char *matname, ITG *mi, ITG *ncmat_, ITG *nstate_, double **enerp, char *jobnamec, double *ttime, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG **ialsetp, ITG *nprint, char *prlab, char *prset, ITG *nener, double *trab, ITG **inotrp, ITG *ntrans, double **fmpcp, char *cbody, ITG *ibody, double *xbody, ITG *nbody, double *xbodyold, ITG *istep, ITG *isolver, ITG *jq, char *output, ITG *mcs, ITG *nkon, ITG *mpcend, ITG *ics, double *cs, ITG *ntie, char *tieset, ITG *idrct, ITG *jmax, double *ctrl, ITG *itpamp, double *tietol, ITG *nalset, ITG *ikforc, ITG *ilforc, double *thicke, ITG *nslavs, ITG *nmat, char *typeboun, ITG *ielprop, double *prop, char *orname)
 
void dynacont (double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, char *labmpc, ITG *nmpc, ITG *nodeforc, ITG *ndirforc, double *xforc, ITG *nforc, ITG *nelemload, char *sideload, double *xload, ITG *nload, ITG *nactdof, ITG *neq, ITG *nzl, ITG *icol, ITG *irow, ITG *nmethod, ITG *ikmpc, ITG *ilmpc, ITG *ikboun, ITG *ilboun, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *cocon, ITG *ncocon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, double *prestr, ITG *iprestr, double *vold, ITG *iperturb, double *sti, ITG *nzs, double *tinc, double *tper, double *xmodal, double *veold, char *amname, double *amta, ITG *namta, ITG *nam, ITG *iamforc, ITG *iamload, ITG *iamt1, ITG *jout, char *filab, double *eme, double *xforcold, double *xloadold, double *t1old, ITG *iamboun, double *xbounold, ITG *iexpl, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstate, ITG *npmat_, char *matname, ITG *mi, ITG *ncmat_, ITG *nstate_, double *ener, char *jobnamec, double *ttime, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nprint, char *prlab, char *prset, ITG *nener, double *trab, ITG *inotr, ITG *ntrans, double *fmpc, char *cbody, ITG *ibody, double *xbody, ITG *nbody, double *xbodyold, ITG *istep, ITG *isolver, ITG *jq, char *output, ITG *mcs, ITG *nkon, ITG *mpcend, ITG *ics, double *cs, ITG *ntie, char *tieset, ITG *idrct, ITG *jmax, double *tmin, double *tmax, double *ctrl, ITG *itpamp, double *tietol, ITG *iit, ITG *ncont, ITG *ne0, double *reltime, double *dtime, double *bcontini, double *bj, double *aux, ITG *iaux, double *bcont, ITG *nev, double *v, ITG *nkon0, double *deltmx, double *dtheta, double *theta, ITG *iprescribedboundary, ITG *mpcfree, ITG *memmpc_, ITG *itietri, ITG *koncont, double *cg, double *straight, ITG *iinc, double *vini, double *aa, double *bb, double *aanew, double *d, double *z, double *zeta, double *b, double *time0, double *time1, ITG *ipobody, double *xforcact, double *xloadact, double *t1act, double *xbounact, double *xbodyact, double *cd, double *cv, double *ampli, double *dthetaref, double *bjp, double *bp, double *cstr, ITG *imddof, ITG *nmddof, ITG **ikactcontp, ITG *nactcont, ITG *nactcont_, double *aamech, double *bprev, ITG *iprev, ITG *inonlinmpc, ITG **ikactmechp, ITG *nactmech, ITG *imdnode, ITG *nmdnode, ITG *imdboun, ITG *nmdboun, ITG *imdmpc, ITG *nmdmpc, ITG *itp, ITG *inext, ITG *imastop, ITG *nslavnode, ITG *islavnode, ITG *islavsurf, ITG *itiefac, double *areaslav, ITG *iponoels, ITG *inoels, double *springarea, ITG *izdof, ITG *nzdof, double *fn, ITG *imastnode, ITG *nmastnode, double *xmastnor, double *xstateini, ITG *nslavs, ITG *cyclicsymmetry, double *xnoels, ITG *ielas, ITG *ielprop, double *prop)
 
void dynboun (double *amta, ITG *namta, ITG *nam, double *ampli, double *time, double *ttime, double *dtime, double *xbounold, double *xboun, double *xbounact, ITG *iamboun, ITG *nboun, ITG *nodeboun, ITG *ndirboun, double *ad, double *au, double *adb, double *aub, ITG *icol, ITG *irow, ITG *neq, ITG *nzs, double *sigma, double *b, ITG *isolver, double *alpham, double *betam, ITG *nzl, ITG *init, double *bact, double *bmin, ITG *jq, char *amname, double *bv, double *bprev, double *bdiff, ITG *nactmech, ITG *icorrect, ITG *iprev)
 
void FORTRAN (dynresults,(ITG *nk, double *v, ITG *ithermal, ITG *nactdof, double *vold, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, char *labmpc, ITG *nmpc, double *b, double *bp, double *veold, double *dtime, ITG *mi, ITG *imdnode, ITG *nmdnode, ITG *imdboun, ITG *nmdboun, ITG *imdmpc, ITG *nmdmpc, ITG *nmethod, double *time))
 
void FORTRAN (effectivemodalmass,(ITG *neq, ITG *nactdof, ITG *mi, double *adb, double *aub, ITG *jq, ITG *irow, ITG *nev, double *z, double *co, ITG *nk))
 
void electromagnetics (double **co, ITG *nk, ITG **konp, ITG **ipkonp, char **lakonp, ITG *ne, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG **ipompcp, ITG **nodempcp, double **coefmpcp, char **labmpcp, ITG *nmpc, ITG *nodeforc, ITG *ndirforc, double *xforc, ITG *nforc, ITG **nelemloadp, char **sideloadp, double *xload, ITG *nload, ITG *nactdof, ITG **icolp, ITG *jq, ITG **irowp, ITG *neq, ITG *nzl, ITG *nmethod, ITG **ikmpcp, ITG **ilmpcp, ITG *ikboun, ITG *ilboun, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG **ielmatp, ITG **ielorienp, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, double *t1old, ITG *ithermal, double *prestr, ITG *iprestr, double **vold, ITG *iperturb, double *sti, ITG *nzs, ITG *kode, char *filab, ITG *idrct, ITG *jmax, ITG *jout, double *timepar, double *eme, double *xbounold, double *xforcold, double *xloadold, double *veold, double *accold, char *amname, double *amta, ITG *namta, ITG *nam, ITG *iamforc, ITG **iamloadp, ITG *iamt1, double *alpha, ITG *iexpl, ITG *iamboun, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double **xstatep, ITG *npmat_, ITG *istep, double *ttime, char *matname, double *qaold, ITG *mi, ITG *isolver, ITG *ncmat_, ITG *nstate_, ITG *iumat, double *cs, ITG *mcs, ITG *nkon, double **ener, ITG *mpcinfo, char *output, double *shcon, ITG *nshcon, double *cocon, ITG *ncocon, double *physcon, ITG *nflow, double *ctrl, char **setp, ITG *nset, ITG **istartsetp, ITG **iendsetp, ITG **ialsetp, ITG *nprint, char *prlab, char *prset, ITG *nener, ITG *ikforc, ITG *ilforc, double *trab, ITG *inotr, ITG *ntrans, double **fmpcp, char *cbody, ITG *ibody, double *xbody, ITG *nbody, double *xbodyold, ITG *ielprop, double *prop, ITG *ntie, char **tiesetp, ITG *itpamp, ITG *iviewfile, char *jobnamec, double **tietolp, ITG *nslavs, double *thicke, ITG *ics, ITG *nalset, ITG *nmpc_, ITG *nmat, char *typeboun, ITG *iaxial, ITG *nload_, ITG *nprop, ITG *network, char *orname)
 
void FORTRAN (elementpernode,(ITG *iponoel, ITG *inoel, char *lakon, ITG *ipkon, ITG *kon, ITG *ne, ITG *inoelsize))
 
void FORTRAN (elementperorien,(ITG *ipoorel, ITG *iorel, ITG *ielorien, ITG *ne, ITG *mi))
 
void FORTRAN (envtemp,(ITG *itg, ITG *ieg, ITG *ntg, ITG *ntr, char *sideload, ITG *nelemload, ITG *ipkon, ITG *kon, char *lakon, ITG *ielmat, ITG *ne, ITG *nload, ITG *kontri, ITG *ntri, ITG *nloadtr, ITG *nflow, ITG *ndirboun, ITG *nactdog, ITG *nodeboun, ITG *nacteq, ITG *nboun, ITG *ielprop, double *prop, ITG *nteq, double *v, ITG *network, double *physcon, double *shcon, ITG *ntmat_, double *co, double *vold, char *set, ITG *nshcon, double *rhcon, ITG *nrhcon, ITG *mi, ITG *nmpc, ITG *nodempc, ITG *ipompc, char *labmpc, ITG *ikboun, ITG *nasym, double *ttime, double *time, ITG *iaxial))
 
void FORTRAN (equationcheck,(double *ac, ITG *nteq, ITG *nactdog, ITG *itg, ITG *ntg, ITG *nacteq, ITG *network))
 
void FORTRAN (errorestimator,(double *yi, double *yn, ITG *ipkon, ITG *kon, char *lakon, ITG *nk, ITG *ne, ITG *mi, ITG *ielmat, ITG *nterms, ITG *inum, double *co, double *vold, char *cflag))
 
void FORTRAN (rotationvector,(double *a, double *euler))
 
void FORTRAN (rotationvectorinv,(double *a, double *euler))
 
void expand (double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, char *labmpc, ITG *nmpc, ITG *nodeforc, ITG *ndirforc, double *xforc, ITG *nforc, ITG *nelemload, char *sideload, double *xload, ITG *nload, ITG *nactdof, ITG *neq, ITG *nmethod, ITG *ikmpc, ITG *ilmpc, ITG *ikboun, ITG *ilboun, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, ITG *ithermal, double *prestr, ITG *iprestr, double *vold, ITG *iperturb, double *sti, ITG *nzs, double *adb, double *aub, char *filab, double *eme, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstate, ITG *npmat_, char *matname, ITG *mi, ITG *ics, double *cs, ITG *mpcend, ITG *ncmat_, ITG *nstate_, ITG *mcs, ITG *nkon, double *ener, char *jobnamec, char *output, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nprint, char *prlab, char *prset, ITG *nener, double *trab, ITG *inotr, ITG *ntrans, double *ttime, double *fmpc, ITG *nev, double **z, ITG *iamboun, double *xbounold, ITG *nsectors, ITG *nm, ITG *icol, ITG *irow, ITG *nzl, ITG *nam, ITG *ipompcold, ITG *nodempcold, double *coefmpcold, char *labmpcold, ITG *nmpcold, double *xloadold, ITG *iamload, double *t1old, double *t1, ITG *iamt1, double *xstiff, ITG **icolep, ITG **jqep, ITG **irowep, ITG *isolver, ITG *nzse, double **adbep, double **aubep, ITG *iexpl, ITG *ibody, double *xbody, ITG *nbody, double *cocon, ITG *ncocon, char *tieset, ITG *ntie, ITG *imddof, ITG *nmddof, ITG *imdnode, ITG *nmdnode, ITG *imdboun, ITG *nmdboun, ITG *imdmpc, ITG *nmdmpc, ITG **izdofp, ITG *nzdof, ITG *nherm, double *xmr, double *xmi, char *typeboun, ITG *ielprop, double *prop, char *orname)
 
void FORTRAN (extrapolate,(double *sti, double *stn, ITG *ipkon, ITG *inum, ITG *kon, char *lakon, ITG *nfield, ITG *nk, ITG *ne, ITG *mi, ITG *ndim, double *orab, ITG *ielorien, double *co, ITG *iorienglob, char *cflag, double *vold, ITG *force, ITG *ielmat, double *thicke, ITG *ielprop, double *prop))
 
void FORTRAN (extrapolate_ad_h,(ITG *nface, ITG *ielfa, double *xrlfa, double *ad, double *adfa, double *hel, double *hfa, ITG *icyclic, double *c, ITG *ifatie))
 
void FORTRAN (extrapolate_ad_h_comp,(ITG *nface, ITG *ielfa, double *xrlfa, double *ad, double *adfa, double *hel, double *hfa, ITG *icyclic, double *c, ITG *ifatie))
 
void FORTRAN (extrapolatefluid,(ITG *nk, ITG *iponofa, ITG *inofa, ITG *inum, double *vfa, double *v, ITG *ielfa, ITG *ithermal, ITG *imach, ITG *ikappa, double *xmach, double *xkappa, double *shcon, ITG *nshcon, ITG *ntmat_, ITG *ielmatf, double *physcon, ITG *mi, ITG *iturb, double *xturb))
 
void FORTRAN (extrapolate_gradkel,(ITG *nface, ITG *ielfa, double *xrlfa, double *gradkel, double *gradkfa, ITG *icyclic, double *c, ITG *ifatie))
 
void FORTRAN (extrapolate_gradoel,(ITG *nface, ITG *ielfa, double *xrlfa, double *gradoel, double *gradofa, ITG *icyclic, double *c, ITG *ifatie))
 
void FORTRAN (extrapolate_gradtel,(ITG *nface, ITG *ielfa, double *xrlfa, double *gradtel, double *gradtfa, ITG *icyclic, double *c, ITG *ifatie))
 
void FORTRAN (extrapolate_gradvel,(ITG *nface, ITG *ielfa, double *xrlfa, double *gradv, double *gradvfa, ITG *icyclic, double *c, ITG *ifatie))
 
void FORTRAN (extrapolate_kel,(ITG *nface, ITG *ielfa, double *xrlfa, double *vel, double *vfa, ITG *ifabou, double *xboun, ITG *ipnei, ITG *nef, double *physcon, double *umfa))
 
void FORTRAN (extrapolate_oel,(ITG *nface, ITG *ielfa, double *xrlfa, double *vel, double *vfa, ITG *ifabou, double *xboun, ITG *ipnei, ITG *nef, double *physcon, double *umfa, double *dy))
 
void FORTRAN (extrapolate_pel,(ITG *nface, ITG *ielfa, double *xrlfa, double *vel, double *vfa, ITG *ifabou, double *xboun, ITG *nef))
 
void FORTRAN (extrapolate_tel,(ITG *nface, ITG *ielfa, double *xrlfa, double *vel, double *vfa, ITG *ifabou, double *xboun, ITG *ipnei, ITG *nef))
 
void FORTRAN (extrapolate_vel,(ITG *nface, ITG *ielfa, double *xrlfa, double *vel, double *vfa, ITG *ifabou, double *xboun, ITG *ipnei, ITG *nef, ITG *icyclic, double *c, ITG *ifatie, double *xxn))
 
void FORTRAN (extrapol_kel,(ITG *nface, ITG *ielfa, double *xrlfa, double *vel, double *vfa, ITG *ifabou, double *xbounact, ITG *nef, double *gradtel, double *gradtfa, ITG *neifa, double *rf, double *area, double *volume, double *xle, double *xxi, ITG *icyclic, double *xxn, ITG *ipnei, ITG *ifatie, double *xlet, double *xxj, double *coefmpc, ITG *nmpc, char *labmpc, ITG *ipompc, ITG *nodempc, ITG *ifaext, ITG *nfaext, ITG *nactdoh, double *umfa, double *physcon))
 
void FORTRAN (extrapol_oel,(ITG *nface, ITG *ielfa, double *xrlfa, double *vel, double *vfa, ITG *ifabou, double *xbounact, ITG *nef, double *gradtel, double *gradtfa, ITG *neifa, double *rf, double *area, double *volume, double *xle, double *xxi, ITG *icyclic, double *xxn, ITG *ipnei, ITG *ifatie, double *xlet, double *xxj, double *coefmpc, ITG *nmpc, char *labmpc, ITG *ipompc, ITG *nodempc, ITG *ifaext, ITG *nfaext, ITG *nactdoh, double *umfa, double *physcon, double *dy))
 
void FORTRAN (extrapol_pel,(ITG *nface, ITG *ielfa, double *xrlfa, double *vel, double *vfa, ITG *ifabou, double *xbounact, ITG *nef, double *gradpel, double *gradpfa, ITG *neifa, double *rf, double *area, double *volume, double *xle, double *xxi, ITG *icyclic, double *xxn, ITG *ipnei, ITG *ifatie, double *coefmpc, ITG *nmpc, char *labmpc, ITG *ipompc, ITG *nodempc, ITG *ifaext, ITG *nfaext, ITG *nactdoh))
 
void FORTRAN (extrapol_tel,(ITG *nface, ITG *ielfa, double *xrlfa, double *vel, double *vfa, ITG *ifabou, double *xbounact, ITG *nef, double *gradtel, double *gradtfa, ITG *neifa, double *rf, double *area, double *volume, double *xle, double *xxi, ITG *icyclic, double *xxn, ITG *ipnei, ITG *ifatie, double *xload, double *xlet, double *xxj, double *coefmpc, ITG *nmpc, char *labmpc, ITG *ipompc, ITG *nodempc, ITG *ifaext, ITG *nfaext, ITG *nactdoh))
 
void FORTRAN (extrapol_vel,(ITG *nface, ITG *ielfa, double *xrlfa, double *vel, double *vfa, ITG *ifabou, double *xbounact, ITG *ipnei, ITG *nef, ITG *icyclic, double *c, ITG *ifatie, double *xxn, double *gradvel, double *gradvfa, ITG *neifa, double *rf, double *area, double *volume, double *xle, double *xxi, double *xxj, double *xlet, double *coefmpc, ITG *nmpc, char *labmpc, ITG *ipompc, ITG *nodempc, ITG *ifaext, ITG *nfaext, ITG *nactdoh))
 
void FORTRAN (facepernode,(ITG *iponoelfa, ITG *inoelfa, char *lakonfa, ITG *ipkonfa, ITG *konfa, ITG *nsurfs, ITG *inoelsize))
 
void FORTRAN (fcrit,(double *time, double *tend, double *aai, double *bbi, double *zetaj, double *dj, double *ddj, double *h1, double *h2, double *h3, double *h4, double *func, double *funcp))
 
void FORTRAN (fill_neiel,(ITG *nef, ITG *ipnei, ITG *neiel, ITG *neielcp))
 
void FORTRAN (filter,(double *dgdxglob, ITG *nobject, ITG *nk, ITG *nodedesi, ITG *ndesi, char *objectset, double *xo, double *yo, double *zo, double *x, double *y, double *z, ITG *nx, ITG *ny, ITG *nz, ITG *neighbor, double *r, ITG *ndesia, ITG *ndesib))
 
void filtermain (double *co, double *dgdxglob, ITG *nobject, ITG *nk, ITG *nodedesi, ITG *ndesi, char *objectset)
 
void * filtermt (ITG *i)
 
void FORTRAN (findsurface,(ITG *ipoface, ITG *nodface, ITG *ne, ITG *ipkon, ITG *kon, char *lakon, ITG *ntie, char *tieset))
 
void FORTRAN (findsurface_se,(ITG *nodface, ITG *ipoface, ITG *ne, ITG *ipkon, char *lakon, ITG *kon, ITG *konfa, ITG *ipkonfa, ITG *nk, char *lakonfa, ITG *nsurfs))
 
void FORTRAN (flowoutput,(ITG *itg, ITG *ieg, ITG *ntg, ITG *nteq, double *bc, char *lakon, ITG *ntmat_, double *v, double *shcon, ITG *nshcon, ITG *ipkon, ITG *kon, double *co, ITG *nflow, double *dtime, double *ttime, double *time, ITG *ielmat, double *prop, ITG *ielprop, ITG *nactdog, ITG *nacteq, ITG *iin, double *physcon, double *camt, double *camf, double *camp, double *rhcon, ITG *nrhcon, double *vold, char *jobnamef, char *set, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nset, ITG *mi, ITG *iaxial, ITG *istep, ITG *iit))
 
void FORTRAN (flowresult,(ITG *ntg, ITG *itg, double *cam, double *vold, double *v, ITG *nload, char *sideload, ITG *nelemload, double *xloadact, ITG *nactdog, ITG *network, ITG *mi, ITG *ne, ITG *ipkon, char *lakon, ITG *kon))
 
void FORTRAN (forcesolve,(double *zc, ITG *nev, double *aa, double *bb, double *xx, double *eiga, double *eigb, double *eigxx, ITG *iter, double *d, ITG *neq, double *z, ITG *istartnmd, ITG *iendnmd, ITG *nmd, ITG *cyclicsymmetry, ITG *neqact, ITG *igeneralizedforce))
 
void FORTRAN (formgradient,(ITG *istartdesi, ITG *ialdesi, ITG *ipkon, char *lakon, ITG *ipoface, ITG *ndesi, ITG *nodedesi, ITG *nodface, ITG *kon, double *co, double *dgdx, ITG *nobject, double *weightformgrad, ITG *nodedesiinv, ITG *noregion, char *objectset, double *dgdxglob, ITG *nk))
 
void FORTRAN (formgradinterpol,(ITG *ipkon, char *lakon, ITG *kon, ITG *nobject, double *dgdxglob, double *xinterpol, ITG *nnodes, ITG *ne, ITG *nk, ITG *nodedesiinv, char *objectset))
 
void frd (double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne0, double *v, double *stn, ITG *inum, ITG *nmethod, ITG *kode, char *filab, double *een, double *t1, double *fn, double *time, double *epn, ITG *ielmat, char *matname, double *enern, double *xstaten, ITG *nstate_, ITG *istep, ITG *iinc, ITG *ithermal, double *qfn, ITG *mode, ITG *noddiam, double *trab, ITG *inotr, ITG *ntrans, double *orab, ITG *ielorien, ITG *norien, char *description, ITG *ipneigh, ITG *neigh, ITG *mi, double *stx, double *vr, double *vi, double *stnr, double *stni, double *vmax, double *stnmax, ITG *ngraph, double *veold, double *ener, ITG *ne, double *cs, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, double *eenmax, double *fnr, double *fni, double *emn, double *thicke, char *jobnamec, char *output, double *qfx, double *cdn, ITG *mortar, double *cdnr, double *cdni, ITG *nmat)
 
void frdcyc (double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, double *v, double *stn, ITG *inum, ITG *nmethod, ITG *kode, char *filab, double *een, double *t1, double *fn, double *time, double *epn, ITG *ielmat, char *matname, double *cs, ITG *mcs, ITG *nkon, double *enern, double *xstaten, ITG *nstate_, ITG *istep, ITG *iinc, ITG *iperturb, double *ener, ITG *mi, char *output, ITG *ithermal, double *qfn, ITG *ialset, ITG *istartset, ITG *iendset, double *trab, ITG *inotr, ITG *ntrans, double *orab, ITG *ielorien, ITG *norien, double *sti, double *veold, ITG *noddiam, char *set, ITG *nset, double *emn, double *thicke, char *jobnamec, ITG *ne0, double *cdn, ITG *mortar, ITG *nmat, double *qfx)
 
void frd_norm_se (double *co, ITG *nk, double *stn, ITG *inum, ITG *nmethod, ITG *kode, char *filab, double *fn, double *time, ITG *nstate_, ITG *istep, ITG *iinc, ITG *mode, ITG *noddiam, char *description, ITG *mi, ITG *ngraph, ITG *ne, double *cs, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, double *thicke, char *jobnamec, char *output, double *dgdxtotglob, ITG *numobject, char *objectset, double *extnor, ITG *ntrans, double *trab, ITG *inotr)
 
void frd_sen (double *co, ITG *nk, double *dstn, ITG *inum, ITG *nmethod, ITG *kode, char *filab, double *time, ITG *nstate_, ITG *istep, ITG *iinc, ITG *mode, ITG *noddiam, char *description, ITG *mi, ITG *ngraph, ITG *ne, double *cs, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *jobnamec, char *output, double *v, ITG *iobject, char *objectset, ITG *ntrans, ITG *inotr, double *trab, ITG *idesvar, char *orname, ITG *icoordinate, ITG *inorm, ITG *irand)
 
void frd_sen_se (double *co, ITG *nk, double *stn, ITG *inum, ITG *nmethod, ITG *kode, char *filab, double *fn, double *time, ITG *nstate_, ITG *istep, ITG *iinc, ITG *mode, ITG *noddiam, char *description, ITG *mi, ITG *ngraph, ITG *ne, double *cs, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, double *thicke, char *jobnamec, char *output, double *dgdxglob, ITG *iobject, char *objectset)
 
void frd_orien_se (double *co, ITG *nk, double *stn, ITG *inum, ITG *nmethod, ITG *kode, char *filab, double *fn, double *time, ITG *nstate_, ITG *istep, ITG *iinc, ITG *mode, ITG *noddiam, char *description, ITG *mi, ITG *ngraph, ITG *ne, double *cs, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, double *thicke, char *jobnamec, char *output, double *dgdxtotglob, ITG *numobject, char *objectset, ITG *ntrans, ITG *inotr, double *trab, ITG *idesvar, char *orname)
 
void FORTRAN (frdfluid,(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, double *v, ITG *kode, double *time, ITG *ielmatf, char *matname, char *filab, ITG *inum, ITG *ntrans, ITG *inotr, double *trab, ITG *mi, ITG *istep, double *stn, double *qfn, ITG *nactdofinv, double *xmach, double *xkappa, double *physcon, double *xturb))
 
void frdgeneralvector (double *v, ITG *iset, ITG *ntrans, char *filabl, ITG *nkcoords, ITG *inum, char *m1, ITG *inotr, double *trab, double *co, ITG *istartset, ITG *iendset, ITG *ialset, ITG *mi, ITG *ngraph, FILE *f1, char *output, char *m3)
 
void frdheader (ITG *icounter, double *oner, double *time, double *pi, ITG *noddiam, double *cs, ITG *null, ITG *mode, ITG *noutloc, char *description, ITG *kode, ITG *nmethod, FILE *f1, char *output, ITG *istep, ITG *iinc)
 
void FORTRAN (frditeration,(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, double *v, double *time, ITG *ielmat, char *matname, ITG *mi, ITG *istep, ITG *iinc, ITG *ithermal))
 
void frdselect (double *field1, double *field2, ITG *iset, ITG *nkcoords, ITG *inum, char *m1, ITG *istartset, ITG *iendset, ITG *ialset, ITG *ngraph, ITG *ncomp, ITG *ifield, ITG *icomp, ITG *nfield, ITG *iselect, char *m2, FILE *f1, char *output, char *m3)
 
void frdset (char *filabl, char *set, ITG *iset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *inum, ITG *noutloc, ITG *nout, ITG *nset, ITG *noutmin, ITG *noutplus, ITG *iselect, ITG *ngraph)
 
void frdvector (double *v, ITG *iset, ITG *ntrans, char *filabl, ITG *nkcoords, ITG *inum, char *m1, ITG *inotr, double *trab, double *co, ITG *istartset, ITG *iendset, ITG *ialset, ITG *mi, ITG *ngraph, FILE *f1, char *output, char *m3)
 
void FORTRAN (frictionheating,(ITG *ne0, ITG *ne, ITG *ipkon, char *lakon, ITG *ielmat, ITG *mi, double *elcon, ITG *ncmat_, ITG *ntmat_, ITG *kon, ITG *islavsurf, double *pmastsurf, double *springarea, double *co, double *vold, double *veold, double *pslavsurf, double *xload, ITG *nload, ITG *nload_, ITG *nelemload, ITG *iamload, ITG *idefload, char *sideload, double *stx, ITG *nam))
 
void FORTRAN (fsub,(double *time, double *tend, double *aai, double *bbi, double *ddj, double *h1, double *h2, double *h3, double *h4, double *func, double *funcp))
 
void FORTRAN (fsuper,(double *time, double *tend, double *aai, double *bbi, double *h1, double *h2, double *h3, double *h4, double *h5, double *h6, double *func, double *funcp))
 
void FORTRAN (gasmechbc,(double *vold, ITG *nload, char *sideload, ITG *nelemload, double *xload, ITG *mi))
 
void FORTRAN (genadvecelem,(ITG *inodesd, ITG *ipkon, ITG *ne, char *lakon, ITG *kon, ITG *nload, char *sideload, ITG *nelemload, ITG *nkon, ITG *network))
 
void FORTRAN (gencontelem_f2f,(char *tieset, ITG *ntie, ITG *itietri, ITG *ne, ITG *ipkon, ITG *kon, char *lakon, double *cg, double *straight, ITG *ifree, ITG *koncont, double *co, double *vold, double *xo, double *yo, double *zo, double *x, double *y, double *z, ITG *nx, ITG *ny, ITG *nz, ITG *ielmat, double *elcon, ITG *istep, ITG *iinc, ITG *iit, ITG *ncmat_, ITG *ntmat_, ITG *mi, ITG *imastop, ITG *islavsurf, ITG *itiefac, double *springarea, double *tietol, double *reltime, char *filab, ITG *nasym, double *pslavsurf, double *pmastsurf, double *clearini, double *theta, double *xstateini, double *xstate, ITG *nstate_, ITG *ne0, ITG *icutb, ITG *ialeatoric, ITG *nmethod, char *jobnamef))
 
void FORTRAN (gencontelem_n2f,(char *tieset, ITG *ntie, ITG *itietri, ITG *ne, ITG *ipkon, ITG *kon, char *lakon, double *cg, double *straight, ITG *ifree, ITG *koncont, double *co, double *vold, double *xo, double *yo, double *zo, double *x, double *y, double *z, ITG *nx, ITG *ny, ITG *nz, ITG *ielmat, double *elcon, ITG *istep, ITG *iinc, ITG *iit, ITG *ncmat_, ITG *ntmat_, ITG *nmethod, ITG *mi, ITG *imastop, ITG *nslavnode, ITG *islavnode, ITG *islavsurf, ITG *itiefac, double *areaslav, ITG *iponoels, ITG *inoels, double *springarea, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, double *tietol, double *reltime, char *filab, ITG *nasym, double *xnoels, ITG *icutb, ITG *ne0, char *jobnamef))
 
void FORTRAN (generateeminterfaces,(ITG *istartset, ITG *iendset, ITG *ialset, ITG *iactive, ITG *ipkon, char *lakon, ITG *kon, ITG *ikmpc, ITG *nmpc, ITG *nafaces))
 
void FORTRAN (generatetet,(ITG *kontet, ITG *ifatet, ITG *netet, ITG *inodfa, ITG *ifreefa, double *planfa, ITG *ipofa, ITG *nodes, double *cotet))
 
void FORTRAN (gennactdofinv,(ITG *nactdof, ITG *nactdofinv, ITG *nk, ITG *mi, ITG *nodorig, ITG *ipkon, char *lakon, ITG *kon, ITG *ne))
 
void FORTRAN (gentiedmpc,(char *tieset, ITG *ntie, ITG *itietri, ITG *ipkon, ITG *kon, char *lakon, char *set, ITG *istartset, ITG *iendset, ITG *ialset, double *cg, double *straight, ITG *koncont, double *co, double *xo, double *yo, double *zo, double *x, double *y, double *z, ITG *nx, ITG *ny, ITG *nz, ITG *nset, ITG *ifaceslave, ITG *istartfield, ITG *iendfield, ITG *ifield, ITG *ipompc, ITG *nodempc, double *coefmpc, ITG *nmpc, ITG *nmpc_, ITG *mpcfree, ITG *ikmpc, ITG *ilmpc, char *labmpc, ITG *ithermal, double *tietol, ITG *icfd, ITG *ncont, ITG *imastop, ITG *ikboun, ITG *nboun, char *kind))
 
void FORTRAN (geomview,(double *vold, double *co, double *pmid, double *e1, double *e2, double *e3, ITG *kontri, double *area, double *cs, ITG *mcs, ITG *inocs, ITG *ntrit, ITG *nk, ITG *mi, double *sidemean))
 
void FORTRAN (getdesiinfo,(char *set, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nset, ITG *mi, ITG *nactdof, ITG *ndesi, ITG *nodedesi, ITG *ntie, char *tieset, ITG *itmp, ITG *nmpc, ITG *nodempc, ITG *ipompc, ITG *nodedesiinv, ITG *iponoel, ITG *inoel, char *lakon, ITG *ipkon, ITG *kon, ITG *noregion, ITG *ipoface, ITG *nodface, ITG *nk))
 
void getglobalresults (char *jobnamec, ITG **integerglobp, double **doubleglobp, ITG *nboun, ITG *iamboun, double *xboun, ITG *nload, char *sideload, ITG *iamload, ITG *iglob, ITG *nforc, ITG *iamforc, double *xforc, ITG *ithermal, ITG *nk, double *t1, ITG *iamt1)
 
ITG getSystemCPUs ()
 
void FORTRAN (identamta,(double *amta, double *reftime, ITG *istart, ITG *iend, ITG *id))
 
void FORTRAN (identifytiedface,(char *tieset, ITG *ntie, char *set, ITG *nset, ITG *faceslave, char *kind))
 
void FORTRAN (includefilename,(char *buff, char *includefn, ITG *lincludefn))
 
void FORTRAN (inicalcbody,(ITG *nef, double *body, ITG *ipobody, ITG *ibody, double *xbody, double *coel, double *vel, char *lakon, ITG *nactdohinv, ITG *icent))
 
void inicont (ITG *nk, ITG *ncont, ITG *ntie, char *tieset, ITG *nset, char *set, ITG *istartset, ITG *iendset, ITG *ialset, ITG **itietrip, char *lakon, ITG *ipkon, ITG *kon, ITG **koncontp, ITG *ncone, double *tietol, ITG *ismallsliding, ITG **itiefacp, ITG **islavsurfp, ITG **islavnodep, ITG **imastnodep, ITG **nslavnodep, ITG **nmastnodep, ITG *mortar, ITG **imastopp, ITG *nkon, ITG **iponoels, ITG **inoelsp, ITG **ipep, ITG **imep, ITG *ne, ITG *ifacecount, ITG *iperturb, ITG *ikboun, ITG *nboun, double *co, ITG *istep, double **xnoelsp)
 
void FORTRAN (init,(ITG *nktet, ITG *inodfa, ITG *ipofa, ITG *netet_))
 
void FORTRAN (initialcfd,(ITG *ne, ITG *ipkon, ITG *kon, char *lakon, double *co, double *coel, double *cofa, ITG *nface, ITG *ielfa, double *area, ITG *ipnei, ITG *neiel, double *xxn, double *xxi, double *xle, double *xlen, double *xlet, double *xrlfa, double *cosa, double *volume, ITG *neifa, double *xxj, double *cosb, double *dmin, ITG *ifatie, double *cs, char *tieset, ITG *icyclic, double *c, ITG *neij, double *physcon, ITG *isolidsurf, ITG *nsolidsurf, double *dy, double *xxni, double *xxnj, double *xxicn, ITG *nflnei, ITG *iturbulent, double *rf))
 
void FORTRAN (initialchannel,(ITG *itg, ITG *ieg, ITG *ntg, double *ac, double *bc, char *lakon, double *v, ITG *ipkon, ITG *kon, ITG *nflow, ITG *ikboun, ITG *nboun, double *prop, ITG *ielprop, ITG *nactdog, ITG *ndirboun, ITG *nodeboun, double *xbounact, ITG *ielmat, ITG *ntmat_, double *shcon, ITG *nshcon, double *physcon, ITG *ipiv, ITG *nteq, double *rhcon, ITG *nrhcon, ITG *ipobody, ITG *ibody, double *xbody, double *co, ITG *nbody, ITG *network, ITG *iin_abs, double *vold, char *set, ITG *istep, ITG *iit, ITG *mi, ITG *ineighe, ITG *ilboun, double *ttime, double *time, ITG *iaxial))
 
void FORTRAN (initialnet,(ITG *itg, ITG *ieg, ITG *ntg, double *ac, double *bc, char *lakon, double *v, ITG *ipkon, ITG *kon, ITG *nflow, ITG *ikboun, ITG *nboun, double *prop, ITG *ielprop, ITG *nactdog, ITG *ndirboun, ITG *nodeboun, double *xbounact, ITG *ielmat, ITG *ntmat_, double *shcon, ITG *nshcon, double *physcon, ITG *ipiv, ITG *nteq, double *rhcon, ITG *nrhcon, ITG *ipobody, ITG *ibody, double *xbody, double *co, ITG *nbody, ITG *network, ITG *iin_abs, double *vold, char *set, ITG *istep, ITG *iit, ITG *mi, ITG *ineighe, ITG *ilboun, ITG *channel, ITG *iaxial, ITG *nmpc, char *labmpc, ITG *ipompc, ITG *nodempc, double *coefmpc, double *ttime, double *time, ITG *iponoel, ITG *inoel))
 
void insert (ITG *ipointer, ITG **mast1p, ITG **mast2p, ITG *i1, ITG *i2, ITG *ifree, ITG *nzs_)
 
void insertfreq (ITG *ipointer, ITG **mast1p, ITG **nextp, ITG *i1, ITG *i2, ITG *ifree, ITG *nzs_)
 
void insertrad (ITG *ipointer, ITG **mast1p, ITG **mast2p, ITG *i1, ITG *i2, ITG *ifree, ITG *nzs_)
 
void FORTRAN (integral_boundary,(double *sumfix, double *sumfree, ITG *ifaext, ITG *nfaext, ITG *ielfa, ITG *ifabou, double *vfa, ITG *ipnei, double *xxn))
 
void FORTRAN (interpolatestate,(ITG *ne, ITG *ipkon, ITG *kon, char *lakon, ITG *ne0, ITG *mi, double *xstate, double *pslavsurf, ITG *nstate_, double *xstateini, ITG *islavsurf, ITG *islavsurfold, double *pslavsurfold, char *tieset, ITG *ntie, ITG *itiefac))
 
void FORTRAN (islavactive,(char *tieset, ITG *ntie, ITG *itietri, double *cg, double *straight, double *co, double *vold, double *xo, double *yo, double *zo, double *x, double *y, double *z, ITG *nx, ITG *ny, ITG *nz, ITG *mi, ITG *imastop, ITG *nslavnode, ITG *islavnode, ITG *islavact))
 
void FORTRAN (isortid,(ITG *ix, double *dy, ITG *n, ITG *kflag))
 
void FORTRAN (isortii,(ITG *ix, ITG *iy, ITG *n, ITG *kflag))
 
void FORTRAN (isortiid,(ITG *ix, ITG *iy, double *dy, ITG *n, ITG *kflag))
 
void FORTRAN (isortiddc,(ITG *ix, double *dy1, double *dy2, char *cy, ITG *n, ITG *kflag))
 
void FORTRAN (isortiiddc,(ITG *ix1, ITG *ix2, double *dy1, double *dy2, char *cy, ITG *n, ITG *kflag))
 
void FORTRAN (jouleheating,(ITG *ipkon, char *lakon, ITG *kon, double *co, double *elcon, ITG *nelcon, ITG *mi, ITG *ne, double *sti, ITG *ielmat, ITG *nelemload, char *sideload, double *xload, ITG *nload, ITG *nload_, ITG *iamload, ITG *nam, ITG *idefload, ITG *ncmat_, ITG *ntmat_, double *alcon, ITG *nalcon, ITG *ithermal, double *vold, double *t1))
 
void FORTRAN (keystart,(ITG *ifreeinp, ITG *ipoinp, ITG *inp, char *name, ITG *iline, ITG *ikey))
 
void linstatic (double *co, ITG *nk, ITG **konp, ITG **ipkonp, char **lakonp, ITG *ne, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, char *labmpc, ITG *nmpc, ITG *nodeforc, ITG *ndirforc, double *xforc, ITG *nforc, ITG *nelemload, char *sideload, double *xload, ITG *nload, ITG *nactdof, ITG **icolp, ITG *jq, ITG **irowp, ITG *neq, ITG *nzl, ITG *nmethod, ITG *ikmpc, ITG *ilmpc, ITG *ikboun, ITG *ilboun, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG **ielmatp, ITG **ielorienp, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, double *t1old, ITG *ithermal, double *prestr, ITG *iprestr, double *vold, ITG *iperturb, double *sti, ITG *nzs, ITG *kode, char *filab, double *eme, ITG *iexpl, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double **xstatep, ITG *npmat_, char *matname, ITG *isolver, ITG *mi, ITG *ncmat_, ITG *nstate_, double *cs, ITG *mcs, ITG *nkon, double **enerp, double *xbounold, double *xforcold, double *xloadold, char *amname, double *amta, ITG *namta, ITG *nam, ITG *iamforc, ITG *iamload, ITG *iamt1, ITG *iamboun, double *ttime, char *output, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nprint, char *prlab, char *prset, ITG *nener, double *trab, ITG *inotr, ITG *ntrans, double *fmpc, char *cbody, ITG *ibody, double *xbody, ITG *nbody, double *xbodyold, double *timepar, double *thicke, char *jobnamec, char *tieset, ITG *ntie, ITG *istep, ITG *nmat, ITG *ielprop, double *prop, char *typeboun, ITG *mortar, ITG *mpcinfo, double *tietol, ITG *ics, ITG *icontact, char *orname)
 
void FORTRAN (mafillcorio,(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, ITG *nmpc, ITG *nodeforc, ITG *ndirforc, double *xforc, ITG *nforc, ITG *nelemload, char *sideload, double *xload, ITG *nload, double *xbody, ITG *ipobody, ITG *nbody, double *cgr, double *ad, double *au, ITG *nactdof, ITG *icol, ITG *jq, ITG *irow, ITG *neq, ITG *nzl, ITG *nmethod, ITG *ikmpc, ITG *ilmpc, ITG *ikboun, ITG *ilboun, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, double *prestr, ITG *iprestr, double *vold, ITG *iperturb, double *sti, ITG *nzs, double *stx, double *adb, double *aub, ITG *iexpl, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstiff, ITG *npmat_, double *dtime, char *matname, ITG *mi, ITG *ncmat_, double *ttime, double *time, ITG *istep, ITG *kinc, ITG *ibody, ITG *ielprop, double *prop))
 
void FORTRAN (mafilldm,(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, ITG *nmpc, ITG *nodeforc, ITG *ndirforc, double *xforc, ITG *nforc, ITG *nelemload, char *sideload, double *xload, ITG *nload, double *xbody, ITG *ipobody, ITG *nbody, double *cgr, double *ad, double *au, ITG *nactdof, ITG *icol, ITG *jq, ITG *irow, ITG *neq, ITG *nzl, ITG *nmethod, ITG *ikmpc, ITG *ilmpc, ITG *ikboun, ITG *ilboun, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, double *prestr, ITG *iprestr, double *vold, ITG *iperturb, double *sti, ITG *nzs, double *stx, double *adb, double *aub, ITG *iexpl, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstiff, ITG *npmat_, double *dtime, char *matname, ITG *mi, ITG *ncmat_, double *ttime, double *time, ITG *istep, ITG *kinc, ITG *ibody, double *clearini, ITG *mortar, double *springarea, double *pslavsurf, double *pmastsurf, double *reltime, ITG *nasym))
 
void FORTRAN (mafillem,(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, ITG *nmpc, ITG *nodeforc, ITG *ndirforc, double *xforc, ITG *nforc, ITG *nelemload, char *sideload, double *xload, ITG *nload, double *xbody, ITG *ipobody, ITG *nbody, double *cgr, double *ad, double *au, double *bb, ITG *nactdof, ITG *icol, ITG *jq, ITG *irow, ITG *neq, ITG *nzl, ITG *nmethod, ITG *ikmpc, ITG *ilmpc, ITG *ikboun, ITG *ilboun, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, double *prestr, ITG *iprestr, double *vold, ITG *iperturb, double *sti, ITG *nzs, double *stx, double *adb, double *aub, ITG *iexpl, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstiff, ITG *npmat_, double *dtime, char *matname, ITG *mi, ITG *ncmat_, ITG *mass, ITG *stiffness, ITG *buckling, ITG *rhs, ITG *intscheme, double *physcon, double *shcon, ITG *nshcon, double *cocon, ITG *ncocon, double *ttime, double *time, ITG *istep, ITG *kinc, ITG *coriolis, ITG *ibody, double *xloadold, double *reltime, double *veold, double *springarea, ITG *nstate_, double *xstateini, double *xstate, double *thicke, ITG *integerglob, double *doubleglob, char *tieset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *ntie, ITG *nasym, ITG *iactive, double *h0, double *pslavsurf, double *pmastsurf, ITG *mortar, double *clearini, ITG *ielprop, double *prop, ITG *iponoel, ITG *inoel, ITG *network))
 
void FORTRAN (mafillk,(ITG *nef, ITG *ipnei, ITG *neifa, ITG *neiel, double *vfa, double *xxn, double *area, double *au, double *ad, ITG *jq, ITG *irow, ITG *nzs, double *b, double *vel, double *umfa, double *xlet, double *xle, double *gradkfa, double *xxi, double *body, double *volume, ITG *ielfa, char *lakonf, ITG *ifabou, ITG *nbody, ITG *neq, double *dtimef, double *velo, double *veloo, double *cpfa, double *hcfa, double *cvel, double *gradvel, double *xload, double *gammat, double *xrlfa, double *xxj, ITG *nactdohinv, double *a1, double *a2, double *a3, double *flux, ITG *nefa, ITG *nefb, ITG *iau6, double *xxni, double *xxnj, ITG *iturbulent))
 
void mafillkmain (ITG *nef, ITG *ipnei, ITG *neifa, ITG *neiel, double *vfa, double *xxn, double *area, double *au, double *ad, ITG *jq, ITG *irow, ITG *nzs, double *b, double *vel, double *umel, double *xlet, double *xle, double *gradkfa, double *xxi, double *body, double *volume, ITG *ielfa, char *lakonf, ITG *ifabou, ITG *nbody, ITG *neq, double *dtimef, double *velo, double *veloo, double *cpfa, double *hcfa, double *cvel, double *gradvel, double *xload, double *gammat, double *xrlfa, double *xxj, ITG *nactdohinv, double *a1, double *a2, double *a3, double *flux, ITG *iau6, double *xxni, double *xxnj, ITG *iturbulent)
 
void * mafillkmt (ITG *i)
 
void FORTRAN (mafillnet,(ITG *itg, ITG *ieg, ITG *ntg, double *ac, ITG *nload, char *sideload, ITG *nelemload, double *xloadact, char *lakon, ITG *ntmat_, double *v, double *shcon, ITG *nshcon, ITG *ipkon, ITG *kon, double *co, ITG *nflow, ITG *iinc, ITG *istep, double *dtime, double *ttime, double *time, ITG *ielmat, ITG *nteq, double *prop, ITG *ielprop, ITG *nactdog, ITG *nacteq, double *physcon, double *rhcon, ITG *nrhcon, ITG *ipobody, ITG *ibody, double *xbody, ITG *nbody, double *vold, double *xloadold, double *reltime, ITG *nmethod, char *set, ITG *mi, ITG *nmpc, ITG *nodempc, ITG *ipompc, double *coefmpc, char *labmpc, ITG *iaxial, double *cocon, ITG *ncocon, ITG *iponoel, ITG *inoel))
 
void FORTRAN (mafillo,(ITG *nef, ITG *ipnei, ITG *neifa, ITG *neiel, double *vfa, double *xxn, double *area, double *au, double *ad, ITG *jq, ITG *irow, ITG *nzs, double *b, double *vel, double *umfa, double *xlet, double *xle, double *gradofa, double *xxi, double *body, double *volume, ITG *ielfa, char *lakonf, ITG *ifabou, ITG *nbody, ITG *neq, double *dtimef, double *velo, double *veloo, double *cpfa, double *hcfa, double *cvel, double *gradvel, double *xload, double *gammat, double *xrlfa, double *xxj, ITG *nactdohinv, double *a1, double *a2, double *a3, double *flux, ITG *nefa, ITG *nefb, ITG *iau6, double *xxni, double *xxnj, ITG *iturbulent, double *gradkel, double *gradoel))
 
void mafillomain (ITG *nef, ITG *ipnei, ITG *neifa, ITG *neiel, double *vfa, double *xxn, double *area, double *au, double *ad, ITG *jq, ITG *irow, ITG *nzs, double *b, double *vel, double *umel, double *xlet, double *xle, double *gradofa, double *xxi, double *body, double *volume, ITG *ielfa, char *lakonf, ITG *ifabou, ITG *nbody, ITG *neq, double *dtimef, double *velo, double *veloo, double *cpfa, double *hcfa, double *cvel, double *gradvel, double *xload, double *gammat, double *xrlfa, double *xxj, ITG *nactdohinv, double *a1, double *a2, double *a3, double *flux, ITG *iau6, double *xxni, double *xxnj, ITG *iturbulent, double *gradkel, double *gradoel)
 
void * mafillomt (ITG *i)
 
void FORTRAN (mafillp,(ITG *ne, char *lakonf, ITG *ipnei, ITG *neifa, ITG *neiel, double *vfa, double *area, double *adfa, double *xlet, double *cosa, double *volume, double *au, double *ad, ITG *jq, ITG *irow, double *ap, ITG *ielfa, ITG *ifabou, double *xle, double *b, double *xxn, ITG *neq, ITG *nzs, double *hfa, double *gradpel, double *bp, double *xxi, ITG *neij, double *xlen, double *cosb, ITG *nefa, ITG *nefb, ITG *iau6, double *xxicn))
 
void FORTRAN (mafillpbc,(ITG *nef, double *au, double *ad, ITG *jq, ITG *irow, double *b, ITG *iatleastonepressurebc, ITG *nzs))
 
void FORTRAN (mafillpcomp,(ITG *ne, char *lakonf, ITG *ipnei, ITG *neifa, ITG *neiel, double *vfa, double *area, double *adfa, double *xlet, double *cosa, double *volume, double *au, double *ad, ITG *jq, ITG *irow, double *ap, ITG *ielfa, ITG *ifabou, double *xle, double *b, double *xxn, ITG *neq, ITG *nzs, double *hfa, double *gradpel, double *bp, double *xxi, ITG *neij, double *xlen, double *cosb, ITG *ielmatf, ITG *mi, double *a1, double *a2, double *a3, double *velo, double *veloo, double *dtimef, double *shcon, ITG *ntmat_, double *vel, ITG *nactdohinv, double *xrlfa, double *flux, ITG *nefa, ITG *nefb, ITG *iau6, double *xxicn, double *gamma))
 
void mafillpcompmain (ITG *ne, char *lakonf, ITG *ipnei, ITG *neifa, ITG *neiel, double *vfa, double *area, double *adfa, double *xlet, double *cosa, double *volume, double *au, double *ad, ITG *jq, ITG *irow, double *ap, ITG *ielfa, ITG *ifabou, double *xle, double *b, double *xxn, ITG *neq, ITG *nzs, double *hfa, double *gradpel, double *bp, double *xxi, ITG *neij, double *xlen, double *cosb, ITG *ielmatf, ITG *mi, double *a1, double *a2, double *a3, double *velo, double *veloo, double *dtimef, double *shcon, ITG *ntmat_, double *vel, ITG *nactdohinv, double *xrlfa, double *flux, ITG *iau6, double *xxicn, double *gamma)
 
void * mafillpcompmt (ITG *i)
 
void mafillpmain (ITG *ne, char *lakonf, ITG *ipnei, ITG *neifa, ITG *neiel, double *vfa, double *area, double *adfa, double *xlet, double *cosa, double *volume, double *au, double *ad, ITG *jq, ITG *irow, double *ap, ITG *ielfa, ITG *ifabou, double *xle, double *b, double *xxn, ITG *neq, ITG *nzs, double *hfa, double *gradpel, double *bp, double *xxi, ITG *neij, double *xlen, double *cosb, ITG *iatleastonepressurebc, ITG *iau6, double *xxicn)
 
void * mafillpmt (ITG *i)
 
void FORTRAN (mafillsm,(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, ITG *nmpc, ITG *nodeforc, ITG *ndirforc, double *xforc, ITG *nforc, ITG *nelemload, char *sideload, double *xload, ITG *nload, double *xbody, ITG *ipobody, ITG *nbody, double *cgr, double *ad, double *au, double *bb, ITG *nactdof, ITG *icol, ITG *jq, ITG *irow, ITG *neq, ITG *nzl, ITG *nmethod, ITG *ikmpc, ITG *ilmpc, ITG *ikboun, ITG *ilboun, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, double *prestr, ITG *iprestr, double *vold, ITG *iperturb, double *sti, ITG *nzs, double *stx, double *adb, double *aub, ITG *iexpl, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstiff, ITG *npmat_, double *dtime, char *matname, ITG *mi, ITG *ncmat_, ITG *mass, ITG *stiffness, ITG *buckling, ITG *rhs, ITG *intscheme, double *physcon, double *shcon, ITG *nshcon, double *cocon, ITG *ncocon, double *ttime, double *time, ITG *istep, ITG *kinc, ITG *coriolis, ITG *ibody, double *xloadold, double *reltime, double *veold, double *springarea, ITG *nstate_, double *xstateini, double *xstate, double *thicke, ITG *integerglob, double *doubleglob, char *tieset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *ntie, ITG *nasym, double *pslavsurf, double *pmastsurf, ITG *mortar, double *clearini, ITG *ielprop, double *prop, ITG *ne0, double *fnext, ITG *nea, ITG *neb, ITG *kscale, ITG *iponoel, ITG *inoel, ITG *network))
 
void FORTRAN (mafillsmcsse,(double *co, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, ITG *ipompc, ITG *nodempc, double *coefmpc, ITG *nmpc, ITG *nelemload, char *sideload, double *xload, ITG *nload, double *xbody, ITG *ipobody, ITG *nbody, double *cgr, ITG *nactdof, ITG *neq, ITG *nmethod, ITG *ikmpc, ITG *ilmpc, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, ITG *iprestr, double *vold, ITG *iperturb, double *sti, double *stx, ITG *iexpl, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstiff, ITG *npmat_, double *dtime, char *matname, ITG *mi, ITG *ncmat_, ITG *mass, ITG *stiffness, ITG *buckling, ITG *rhs, ITG *intscheme, double *physcon, double *ttime, double *time, ITG *istep, ITG *iinc, ITG *coriolis, ITG *ibody, double *xloadold, double *reltime, double *veold, double *springarea, ITG *nstate_, double *xstateini, double *xstate, double *thicke, ITG *integerglob, double *doubleglob, char *tieset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *ntie, ITG *nasym, double *pslavsurf, double *pmastsurf, ITG *mortar, double *clearini, ITG *ielprop, double *prop, ITG *ne0, ITG *nea, ITG *neb, double *distmin, ITG *ndesi, ITG *nodedesi, double *df, ITG *jqs, ITG *irows, double *dfminds, ITG *icoordinate, double *dxstiff, double *xdesi, ITG *istartelem, ITG *ialelem, double *v, double *sigma, char *labmpc, ITG *ics, double *cs, ITG *mcs, ITG *nk, ITG *nzss))
 
void FORTRAN (mafillsmse,(double *co, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, ITG *ipompc, ITG *nodempc, double *coefmpc, ITG *nmpc, ITG *nelemload, char *sideload, double *xload, ITG *nload, double *xbody, ITG *ipobody, ITG *nbody, double *cgr, ITG *nactdof, ITG *neq, ITG *nmethod, ITG *ikmpc, ITG *ilmpc, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, ITG *iprestr, double *vold, ITG *iperturb, double *sti, double *stx, ITG *iexpl, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstiff, ITG *npmat_, double *dtime, char *matname, ITG *mi, ITG *ncmat_, ITG *mass, ITG *stiffness, ITG *buckling, ITG *rhs, ITG *intscheme, double *physcon, double *ttime, double *time, ITG *istep, ITG *iinc, ITG *coriolis, ITG *ibody, double *xloadold, double *reltime, double *veold, double *springarea, ITG *nstate_, double *xstateini, double *xstate, double *thicke, ITG *integerglob, double *doubleglob, char *tieset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *ntie, ITG *nasym, double *pslavsurf, double *pmastsurf, ITG *mortar, double *clearini, ITG *ielprop, double *prop, ITG *ne0, ITG *nea, ITG *neb, double *distmin, ITG *ndesi, ITG *nodedesi, double *df, ITG *jqs, ITG *irows, double *dfminds, ITG *icoordinate, double *dxstiff, double *xdesi, ITG *istartelem, ITG *ialelem, double *v, double *sigma, ITG *ieigenfrequency))
 
void * mafillsmmt (ITG *i)
 
void * mafillsmsemt (ITG *i)
 
void mafillsmmain (double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, ITG *nmpc, ITG *nodeforc, ITG *ndirforc, double *xforc, ITG *nforc, ITG *nelemload, char *sideload, double *xload, ITG *nload, double *xbody, ITG *ipobody, ITG *nbody, double *cgr, double *ad, double *au, double *bb, ITG *nactdof, ITG *icol, ITG *jq, ITG *irow, ITG *neq, ITG *nzl, ITG *nmethod, ITG *ikmpc, ITG *ilmpc, ITG *ikboun, ITG *ilboun, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, double *prestr, ITG *iprestr, double *vold, ITG *iperturb, double *sti, ITG *nzs, double *stx, double *adb, double *aub, ITG *iexpl, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstiff, ITG *npmat_, double *dtime, char *matname, ITG *mi, ITG *ncmat_, ITG *mass, ITG *stiffness, ITG *buckling, ITG *rhs, ITG *intscheme, double *physcon, double *shcon, ITG *nshcon, double *cocon, ITG *ncocon, double *ttime, double *time, ITG *istep, ITG *kinc, ITG *coriolis, ITG *ibody, double *xloadold, double *reltime, double *veold, double *springarea, ITG *nstate_, double *xstateini, double *xstate, double *thicke, ITG *integerglob, double *doubleglob, char *tieset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *ntie, ITG *nasym, double *pslavsurf, double *pmastsurf, ITG *mortar, double *clearini, ITG *ielprop, double *prop, ITG *ne0, double *fnext, ITG *kscale, ITG *iponoel, ITG *inoel, ITG *network)
 
void mafillsmmain_se (double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, ITG *nmpc, ITG *nodeforc, ITG *ndirforc, double *xforc, ITG *nforc, ITG *nelemload, char *sideload, double *xload, ITG *nload, double *xbody, ITG *ipobody, ITG *nbody, double *cgr, ITG *nactdof, ITG *neq, ITG *nmethod, ITG *ikmpc, ITG *ilmpc, ITG *ikboun, ITG *ilboun, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, double *prestr, ITG *iprestr, double *vold, ITG *iperturb, double *sti, double *stx, ITG *iexpl, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstiff, ITG *npmat_, double *dtime, char *matname, ITG *mi, ITG *ncmat_, ITG *mass, ITG *stiffness, ITG *buckling, ITG *rhs, ITG *intscheme, double *physcon, double *shcon, ITG *nshcon, double *cocon, ITG *ncocon, double *ttime, double *time, ITG *istep, ITG *kinc, ITG *coriolis, ITG *ibody, double *xloadold, double *reltime, double *veold, double *springarea, ITG *nstate_, double *xstateini, double *xstate, double *thicke, ITG *integerglob, double *doubleglob, char *tieset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *ntie, ITG *nasym, double *pslavsurf, double *pmastsurf, ITG *mortar, double *clearini, ITG *ielprop, double *prop, ITG *ne0, double *fnext, double *distmin, ITG *ndesi, ITG *nodedesi, double *df, ITG *nzss, ITG *jqs, ITG *irows, ITG *icoordinate, double *dxstiff, double *xdesi, ITG *istartelem, ITG *ialelem, double *v, double *sigma, ITG *cyclicsymmetry, char *labmpc, ITG *ics, double *cs, ITG *mcs, ITG *ieigenfrequency)
 
void FORTRAN (mafillsmas,(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, ITG *nmpc, ITG *nodeforc, ITG *ndirforc, double *xforc, ITG *nforc, ITG *nelemload, char *sideload, double *xload, ITG *nload, double *xbody, ITG *ipobody, ITG *nbody, double *cgr, double *ad, double *au, double *bb, ITG *nactdof, ITG *icol, ITG *jq, ITG *irow, ITG *neq, ITG *nzl, ITG *nmethod, ITG *ikmpc, ITG *ilmpc, ITG *ikboun, ITG *ilboun, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, double *prestr, ITG *iprestr, double *vold, ITG *iperturb, double *sti, ITG *nzs, double *stx, double *adb, double *aub, ITG *iexpl, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstiff, ITG *npmat_, double *dtime, char *matname, ITG *mi, ITG *ncmat_, ITG *mass, ITG *stiffness, ITG *buckling, ITG *rhs, ITG *intscheme, double *physcon, double *shcon, ITG *nshcon, double *cocon, ITG *ncocon, double *ttime, double *time, ITG *istep, ITG *kinc, ITG *coriolis, ITG *ibody, double *xloadold, double *reltime, double *veold, double *springarea, ITG *nstate_, double *xstateini, double *xstate, double *thicke, ITG *integerglob, double *doubleglob, char *tieset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *ntie, ITG *nasym, double *pslavsurf, double *pmastsurf, ITG *mortar, double *clearini, ITG *ielprop, double *prop, ITG *ne0, ITG *kscale, ITG *iponoel, ITG *inoel, ITG *network))
 
void FORTRAN (mafillsmas1,(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, ITG *nmpc, ITG *nodeforc, ITG *ndirforc, double *xforc, ITG *nforc, ITG *nelemload, char *sideload, double *xload, ITG *nload, double *xbody, ITG *ipobody, ITG *nbody, double *cgr, double *ad, double *au, double *bb, ITG *nactdof, ITG *icol, ITG *jq, ITG *irow, ITG *neq, ITG *nzl, ITG *nmethod, ITG *ikmpc, ITG *ilmpc, ITG *ikboun, ITG *ilboun, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, double *prestr, ITG *iprestr, double *vold, ITG *iperturb, double *sti, ITG *nzs, double *stx, double *adb, double *aub, ITG *iexpl, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstiff, ITG *npmat_, double *dtime, char *matname, ITG *mi, ITG *ncmat_, ITG *mass, ITG *stiffness, ITG *buckling, ITG *rhs, ITG *intscheme, double *physcon, double *shcon, ITG *nshcon, double *cocon, ITG *ncocon, double *ttime, double *time, ITG *istep, ITG *kinc, ITG *coriolis, ITG *ibody, double *xloadold, double *reltime, double *veold, double *springarea, ITG *nstate_, double *xstateini, double *xstate, double *thicke, ITG *integerglob, double *doubleglob, char *tieset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *ntie, ITG *nasym, double *pslavsurf, double *pmastsurf, ITG *mortar, double *clearini, ITG *ielprop, double *prop, ITG *ne0, ITG *nea, ITG *neb, ITG *kscale))
 
void mafillsmasmain (double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, ITG *nmpc, ITG *nodeforc, ITG *ndirforc, double *xforc, ITG *nforc, ITG *nelemload, char *sideload, double *xload, ITG *nload, double *xbody, ITG *ipobody, ITG *nbody, double *cgr, double *ad, double *au, double *bb, ITG *nactdof, ITG *icol, ITG *jq, ITG *irow, ITG *neq, ITG *nzl, ITG *nmethod, ITG *ikmpc, ITG *ilmpc, ITG *ikboun, ITG *ilboun, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, double *prestr, ITG *iprestr, double *vold, ITG *iperturb, double *sti, ITG *nzs, double *stx, double *adb, double *aub, ITG *iexpl, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstiff, ITG *npmat_, double *dtime, char *matname, ITG *mi, ITG *ncmat_, ITG *mass, ITG *stiffness, ITG *buckling, ITG *rhs, ITG *intscheme, double *physcon, double *shcon, ITG *nshcon, double *cocon, ITG *ncocon, double *ttime, double *time, ITG *istep, ITG *kinc, ITG *coriolis, ITG *ibody, double *xloadold, double *reltime, double *veold, double *springarea, ITG *nstate_, double *xstateini, double *xstate, double *thicke, ITG *integerglob, double *doubleglob, char *tieset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *ntie, ITG *nasym, double *pslavsurf, double *pmastsurf, ITG *mortar, double *clearini, ITG *ielprop, double *prop, ITG *ne0, ITG *kscale)
 
void * mafillsmasmt (ITG *i)
 
void FORTRAN (mafillsmcs,(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, ITG *nmpc, ITG *nodeforc, ITG *ndirforc, double *xforc, ITG *nforc, ITG *nelemload, char *sideload, double *xload, ITG *nload, double *xbody, ITG *ipobody, ITG *nbody, double *cgr, double *ad, double *au, double *bb, ITG *nactdof, ITG *icol, ITG *jq, ITG *irow, ITG *neq, ITG *nzl, ITG *nmethod, ITG *ikmpc, ITG *ilmpc, ITG *ikboun, ITG *ilboun, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, double *prestr, ITG *iprestr, double *vold, ITG *iperturb, double *sti, ITG *nzs, double *stx, double *adb, double *aub, ITG *iexpl, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstiff, ITG *npmat_, double *dtime, char *matname, ITG *mi, ITG *ics, double *cs, ITG *nm, ITG *ncmat_, char *labmpc, ITG *mass, ITG *stiffness, ITG *buckling, ITG *rhs, ITG *intscheme, ITG *mcs, ITG *coriolis, ITG *ibody, double *xloadold, double *reltime, ITG *ielcs, double *veold, double *springarea, double *thicke, ITG *integerglob, double *doubleglob, char *tieset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *ntie, ITG *nasym, double *pslavsurf, double *pmastsurf, ITG *mortar, double *clearini, ITG *ielprop, double *prop, ITG *ne0, ITG *kscale, double *xstateini, double *xstate, ITG *nstate_))
 
void FORTRAN (mafillsmcsas,(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, ITG *nmpc, ITG *nodeforc, ITG *ndirforc, double *xforc, ITG *nforc, ITG *nelemload, char *sideload, double *xload, ITG *nload, double *xbody, ITG *ipobody, ITG *nbody, double *cgr, double *ad, double *au, double *bb, ITG *nactdof, ITG *icol, ITG *jq, ITG *irow, ITG *neq, ITG *nzl, ITG *nmethod, ITG *ikmpc, ITG *ilmpc, ITG *ikboun, ITG *ilboun, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, double *prestr, ITG *iprestr, double *vold, ITG *iperturb, double *sti, ITG *nzs, double *stx, double *adb, double *aub, ITG *iexpl, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstiff, ITG *npmat_, double *dtime, char *matname, ITG *mi, ITG *ics, double *cs, ITG *nm, ITG *ncmat_, char *labmpc, ITG *mass, ITG *stiffness, ITG *buckling, ITG *rhs, ITG *intscheme, ITG *mcs, ITG *coriolis, ITG *ibody, double *xloadold, double *reltime, ITG *ielcs, double *veold, double *springarea, double *thicke, ITG *integerglob, double *doubleglob, char *tieset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *ntie, ITG *nasym, ITG *nstate_, double *xstateini, double *xstate, double *pslavsurf, double *pmastsurf, ITG *mortar, double *clearini, ITG *ielprop, double *prop, ITG *ne0, ITG *kscale))
 
void FORTRAN (mafillsmforc,(ITG *nforc, ITG *ndirforc, ITG *nodeforc, double *xforc, ITG *nactdof, double *fext, ITG *nmpc, ITG *ipompc, ITG *nodempc, ITG *ikmpc, ITG *ilmpc, double *coefmpc, ITG *mi, ITG *rhsi, double *fnext, ITG *nmethod))
 
void FORTRAN (mafillsm_company,(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, ITG *nmpc, ITG *nodeforc, ITG *ndirforc, double *xforc, ITG *nforc, ITG *nelemload, char *sideload, double *xload, ITG *nload, double *xbody, ITG *ipobody, ITG *nbody, double *cgr, double *ad, double *au, double *bb, ITG *nactdof, ITG *icol, ITG *jq, ITG *irow, ITG *neq, ITG *nzl, ITG *nmethod, ITG *ikmpc, ITG *ilmpc, ITG *ikboun, ITG *ilboun, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, double *prestr, ITG *iprestr, double *vold, ITG *iperturb, double *sti, ITG *nzs, double *stx, double *adb, double *aub, ITG *iexpl, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstiff, ITG *npmat_, double *dtime, char *matname, ITG *mi, ITG *ncmat_, ITG *mass, ITG *stiffness, ITG *buckling, ITG *rhs, ITG *intscheme, double *physcon, double *shcon, ITG *nshcon, double *cocon, ITG *ncocon, double *ttime, double *time, ITG *istep, ITG *kinc, ITG *coriolis, ITG *ibody, double *xloadold, double *reltime, double *veold, double *springarea, ITG *nstate_, double *xstateini, double *xstate, double *thicke, ITG *integerglob, double *doubleglob, char *tieset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *ntie, ITG *nasym, double *pslavsurf, double *pmastsurf, ITG *mortar, double *clearini, ITG *ielprop, double *prop, ITG *ne0, double *fnext, ITG *kscale, ITG *iponoel, ITG *inoel, ITG *network))
 
void FORTRAN (mafillt,(ITG *nef, ITG *ipnei, ITG *neifa, ITG *neiel, double *vfa, double *xxn, double *area, double *au, double *ad, ITG *jq, ITG *irow, ITG *nzs, double *b, double *vel, double *umel, double *xlet, double *xle, double *gradtfa, double *xxi, double *body, double *volume, ITG *ielfa, char *lakonf, ITG *ifabou, ITG *nbody, ITG *neq, double *dtimef, double *velo, double *veloo, double *cpfa, double *hcfa, double *cvel, double *gradvel, double *xload, double *gammat, double *xrlfa, double *xxj, ITG *nactdohinv, double *a1, double *a2, double *a3, double *flux, ITG *nefa, ITG *nefb, ITG *iau6, double *xxni, double *xxnj, ITG *iturbulent))
 
void FORTRAN (mafilltcomp,(ITG *nef, ITG *ipnei, ITG *neifa, ITG *neiel, double *vfa, double *xxn, double *area, double *au, double *ad, ITG *jq, ITG *irow, ITG *nzs, double *b, double *vel, double *umel, double *xlet, double *xle, double *gradtfa, double *xxi, double *body, double *volume, ITG *ielfa, char *lakonf, ITG *ifabou, ITG *nbody, ITG *neq, double *dtimef, double *velo, double *veloo, double *cpfa, double *hcfa, double *cvel, double *gradvel, double *xload, double *gammat, double *xrlfa, double *xxj, ITG *nactdohinv, double *a1, double *a2, double *a3, double *flux, ITG *nefa, ITG *nefb, ITG *iau6, double *xxni, double *xxnj))
 
void mafilltcompmain (ITG *nef, ITG *ipnei, ITG *neifa, ITG *neiel, double *vfa, double *xxn, double *area, double *au, double *ad, ITG *jq, ITG *irow, ITG *nzs, double *b, double *vel, double *umel, double *xlet, double *xle, double *gradtfa, double *xxi, double *body, double *volume, ITG *ielfa, char *lakonf, ITG *ifabou, ITG *nbody, ITG *neq, double *dtimef, double *velo, double *veloo, double *cpfa, double *hcfa, double *cvel, double *gradvel, double *xload, double *gammat, double *xrlfa, double *xxj, ITG *nactdohinv, double *a1, double *a2, double *a3, double *flux, ITG *iau6, double *xxni, double *xxnj)
 
void * mafilltcompmt (ITG *i)
 
void mafilltmain (ITG *nef, ITG *ipnei, ITG *neifa, ITG *neiel, double *vfa, double *xxn, double *area, double *au, double *ad, ITG *jq, ITG *irow, ITG *nzs, double *b, double *vel, double *umel, double *xlet, double *xle, double *gradtfa, double *xxi, double *body, double *volume, ITG *ielfa, char *lakonf, ITG *ifabou, ITG *nbody, ITG *neq, double *dtimef, double *velo, double *veloo, double *cpfa, double *hcfa, double *cvel, double *gradvel, double *xload, double *gammat, double *xrlfa, double *xxj, ITG *nactdohinv, double *a1, double *a2, double *a3, double *flux, ITG *iau6, double *xxni, double *xxnj, ITG *iturbulent)
 
void * mafilltmt (ITG *i)
 
void FORTRAN (mafillv,(ITG *nef, ITG *ipnei, ITG *neifa, ITG *neiel, double *vfa, double *xxn, double *area, double *au, double *ad, ITG *jq, ITG *irow, ITG *nzs, double *b, double *vel, double *cosa, double *umfa, double *xlet, double *xle, double *gradvfa, double *xxi, double *body, double *volume, ITG *ielfa, char *lakonf, ITG *ifabou, ITG *nbody, double *dtimef, double *velo, double *veloo, double *sel, double *xrlfa, double *gamma, double *xxj, ITG *nactdohinv, double *a1, double *a2, double *a3, double *flux, ITG *nefa, ITG *nefb, ITG *icyclic, double *c, ITG *ifatie, ITG *iau6, double *xxni, double *xxnj, ITG *iturbulent, double *gradvel))
 
void FORTRAN (mafillvcomp,(ITG *nef, ITG *ipnei, ITG *neifa, ITG *neiel, double *vfa, double *xxn, double *area, double *au, double *ad, ITG *jq, ITG *irow, ITG *nzs, double *b, double *vel, double *cosa, double *umfa, double *xlet, double *xle, double *gradvfa, double *xxi, double *body, double *volume, ITG *ielfa, char *lakonf, ITG *ifabou, ITG *nbody, double *dtimef, double *velo, double *veloo, double *sel, double *xrlfa, double *gamma, double *xxj, ITG *nactdohinv, double *a1, double *a2, double *a3, double *flux, ITG *nefa, ITG *nefb, ITG *icyclic, double *c, ITG *ifatie, ITG *iau6, double *xxni, double *xxnj))
 
void mafillvcompmain (ITG *nef, ITG *ipnei, ITG *neifa, ITG *neiel, double *vfa, double *xxn, double *area, double *au, double *ad, ITG *jq, ITG *irow, ITG *nzs, double *b, double *vel, double *cosa, double *umfa, double *xlet, double *xle, double *gradvfa, double *xxi, double *body, double *volume, ITG *ielfa, char *lakonf, ITG *ifabou, ITG *nbody, double *dtimef, double *velo, double *veloo, double *sel, double *xrlfa, double *gamma, double *xxj, ITG *nactdohinv, double *a1, double *a2, double *a3, double *flux, ITG *icyclic, double *c, ITG *ifatie, ITG *iau6, double *xxni, double *xxnj)
 
void * mafillvcompmt (ITG *i)
 
void mafillvmain (ITG *nef, ITG *ipnei, ITG *neifa, ITG *neiel, double *vfa, double *xxn, double *area, double *au, double *ad, ITG *jq, ITG *irow, ITG *nzs, double *b, double *vel, double *cosa, double *umfa, double *xlet, double *xle, double *gradvfa, double *xxi, double *body, double *volume, ITG *ielfa, char *lakonf, ITG *ifabou, ITG *nbody, double *dtimef, double *velo, double *veloo, double *sel, double *xrlfa, double *gamma, double *xxj, ITG *nactdohinv, double *a1, double *a2, double *a3, double *flux, ITG *icyclic, double *c, ITG *ifatie, ITG *iau6, double *xxni, double *xxnj, ITG *iturbulent, double *gradvel)
 
void * mafillvmt (ITG *i)
 
void * mafillv0mt (ITG *i)
 
void * mafillv1mt (ITG *i)
 
void * mafillv2mt (ITG *i)
 
void * mafillv3mt (ITG *i)
 
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, ITG *iit, ITG *icascade, ITG *network)
 
void mastructcs (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 *ics, double *cs, char *labmpc, ITG *mcs, ITG *mi, ITG *mortar)
 
void mastructem (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 *ithermal, ITG *mi, ITG *ielmat, double *elcon, ITG *ncmat_, ITG *ntmat_, ITG *inomat, ITG *network)
 
void mastructf (ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, ITG *icol, ITG *jq, ITG **mast1p, ITG **irowp, ITG *isolver, ITG *ipointer, ITG *nzs, ITG *ipnei, ITG *ineiel, ITG *mi)
 
void mastructrad (ITG *ntr, ITG *nloadtr, char *sideload, ITG *ipointerrad, ITG **mast1radp, ITG **irowradp, ITG *nzsrad, ITG *jqrad, ITG *icolrad)
 
void mastructrand (ITG *icols, ITG *jqs, ITG **mast1p, ITG **irowsp, ITG *ipointer, ITG *nzss, ITG *ndesi, double *physcon, double *xo, double *yo, double *zo, double *x, double *y, double *z, ITG *nx, ITG *ny, ITG *nz)
 
void mastructse (ITG *kon, ITG *ipkon, char *lakon, ITG *ne, ITG *ipompc, ITG *nodempc, ITG *nmpc, ITG *nactdof, ITG *icols, ITG *jqs, ITG **mast1p, ITG **irowsp, ITG *ipointer, ITG *nzss, ITG *mi, ITG *mortar, ITG *nodedesi, ITG *ndesi, ITG *icoordinate, ITG *ielorien, ITG *istartdesi, ITG *ialdesi)
 
void FORTRAN (materialdata_cfd,(ITG *nef, double *vel, double *shcon, ITG *nshcon, ITG *ielmat, ITG *ntmat_, ITG *mi, double *cvel, double *vfa, double *cocon, ITG *ncocon, double *physcon, double *cvfa, ITG *ithermal, ITG *nface, double *umel, double *umfa, ITG *ielfa, double *hcfa, double *rhcon, ITG *nrhcon))
 
void FORTRAN (materialdata_cfd_comp,(ITG *nef, double *vel, double *shcon, ITG *nshcon, ITG *ielmat, ITG *ntmat_, ITG *mi, double *cvel, double *vfa, double *cocon, ITG *ncocon, double *physcon, double *cvfa, ITG *ithermal, ITG *nface, double *umel, double *umfa, ITG *ielfa, double *hcfa))
 
void FORTRAN (meannode,(ITG *nk, ITG *inum, double *v))
 
void FORTRAN (mpcrem,(ITG *i, ITG *mpcfree, ITG *nodempc, ITG *nmpc, ITG *ikmpc, ITG *ilmpc, char *labmpc, double *coefmpc, ITG *ipompc))
 
void FORTRAN (mult,(double *matrix, double *trans, ITG *n))
 
void FORTRAN (negativepressure,(ITG *ne0, ITG *ne, ITG *mi, double *stx, double *pressureratio))
 
void FORTRAN (networkelementpernode,(ITG *iponoel, ITG *inoel, char *lakon, ITG *ipkon, ITG *kon, ITG *inoelsize, ITG *nflow, ITG *ieg, ITG *ne, ITG *network))
 
void FORTRAN (networkinum,(ITG *ipkon, ITG *inum, ITG *kon, char *lakon, ITG *ne, ITG *itg, ITG *ntg))
 
void FORTRAN (nident,(ITG *x, ITG *px, ITG *n, ITG *id))
 
void FORTRAN (nidentll,(long long *x, long long *px, ITG *n, ITG *id))
 
void FORTRAN (nodestiedface,(char *tieset, ITG *ntie, ITG *ipkon, ITG *kon, char *lakon, char *set, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nset, ITG *faceslave, ITG *istartfield, ITG *iendfield, ITG *ifield, ITG *nconf, ITG *ncone, char *kind))
 
void nonlingeo (double **co, ITG *nk, ITG **konp, ITG **ipkonp, char **lakonp, ITG *ne, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG **ipompcp, ITG **nodempcp, double **coefmpcp, char **labmpcp, ITG *nmpc, ITG *nodeforc, ITG *ndirforc, double *xforc, ITG *nforc, ITG **nelemloadp, char **sideloadp, double *xload, ITG *nload, ITG *nactdof, ITG **icolp, ITG *jq, ITG **irowp, ITG *neq, ITG *nzl, ITG *nmethod, ITG **ikmpcp, ITG **ilmpcp, ITG *ikboun, ITG *ilboun, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG **ielmatp, ITG **ielorienp, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, double *t1old, ITG *ithermal, double *prestr, ITG *iprestr, double **vold, ITG *iperturb, double *sti, ITG *nzs, ITG *kode, char *filab, ITG *idrct, ITG *jmax, ITG *jout, double *timepar, double *eme, double *xbounold, double *xforcold, double *xloadold, double *veold, double *accold, char *amname, double *amta, ITG *namta, ITG *nam, ITG *iamforc, ITG **iamloadp, ITG *iamt1, double *alpha, ITG *iexpl, ITG *iamboun, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double **xstatep, ITG *npmat_, ITG *istep, double *ttime, char *matname, double *qaold, ITG *mi, ITG *isolver, ITG *ncmat_, ITG *nstate_, ITG *iumat, double *cs, ITG *mcs, ITG *nkon, double **ener, ITG *mpcinfo, char *output, double *shcon, ITG *nshcon, double *cocon, ITG *ncocon, double *physcon, ITG *nflow, double *ctrl, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nprint, char *prlab, char *prset, ITG *nener, ITG *ikforc, ITG *ilforc, double *trab, ITG *inotr, ITG *ntrans, double **fmpcp, char *cbody, ITG *ibody, double *xbody, ITG *nbody, double *xbodyold, ITG *ielprop, double *prop, ITG *ntie, char *tieset, ITG *itpamp, ITG *iviewfile, char *jobnamec, double *tietol, ITG *nslavs, double *thicke, ITG *ics, ITG *nintpoint, ITG *mortar, ITG *ifacecount, char *typeboun, ITG **islavsurfp, double **pslavsurfp, double **clearinip, ITG *nmat, double *xmodal, ITG *iaxial, ITG *inext, ITG *nprop, ITG *network, char *orname)
 
void FORTRAN (nonlinmpc,(double *co, double *vold, ITG *ipompc, ITG *nodempc, double *coefmpc, char *labmpc, ITG *nmpc, ITG *ikboun, ITG *ilboun, ITG *nboun, double *xbounact, double *aux, ITG *iaux, ITG *maxlenmpc, ITG *ikmpc, ITG *ilmpc, ITG *icascade, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, double *reltime, ITG *newstep, double *xboun, double *fmpc, ITG *newinc, ITG *idiscon, ITG *ncont, double *trab, ITG *ntrans, ITG *ithermal, ITG *mi))
 
void FORTRAN (norm,(double *vel, double *velnorm, ITG *nef))
 
void FORTRAN (normalsforequ_se,(ITG *nk, double *co, ITG *iponoelfa, ITG *inoelfa, ITG *konfa, ITG *ipkonfa, char *lakonfa, ITG *ne, ITG *ipnor, double *xnor, ITG *nodedesiinv, char *jobnamef))
 
void FORTRAN (normalsoninterface,(ITG *istartset, ITG *iendset, ITG *ialset, ITG *imast, ITG *ipkon, ITG *kon, char *lakon, ITG *imastnode, ITG *nmastnode, double *xmastnor, double *co))
 
void FORTRAN (normalsonsurface_se,(ITG *ipkon, ITG *kon, char *lakon, double *extnor, double *co, ITG *nk, ITG *ipoface, ITG *nodface, ITG *nactdof, ITG *mi, ITG *nodedesiinv, ITG *noregion))
 
void objectivemain_se (double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, double *v, double *stn, ITG *inum, double *stx, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, double *prestr, ITG *iprestr, char *filab, double *eme, double *emn, double *een, ITG *iperturb, double *f, double *fn, ITG *nactdof, ITG *iout, double *qa, double *vold, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, char *labmpc, ITG *nmpc, ITG *nmethod, double *cam, ITG *neq, double *veold, double *accold, double *bet, double *gam, double *dtime, double *time, double *ttime, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstateini, double *xstiff, double *xstate, ITG *npmat_, double *epn, char *matname, ITG *mi, ITG *ielas, ITG *icmd, ITG *ncmat_, ITG *nstate_, double *stiini, double *vini, ITG *ikboun, ITG *ilboun, double *ener, double *enern, double *emeini, double *xstaten, double *eei, double *enerini, double *cocon, ITG *ncocon, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nprint, char *prlab, char *prset, double *qfx, double *qfn, double *trab, ITG *inotr, ITG *ntrans, double *fmpc, ITG *nelemload, ITG *nload, ITG *ikmpc, ITG *ilmpc, ITG *istep, ITG *iinc, double *springarea, double *reltime, ITG *ne0, double *xforc, ITG *nforc, double *thicke, double *shcon, ITG *nshcon, char *sideload, double *xload, double *xloadold, ITG *icfd, ITG *inomat, double *pslavsurf, double *pmastsurf, ITG *mortar, ITG *islavact, double *cdn, ITG *islavnode, ITG *nslavnode, ITG *ntie, double *clearini, ITG *islavsurf, ITG *ielprop, double *prop, double *energyini, double *energy, double *distmin, ITG *ndesi, ITG *nodedesi, ITG *nobject, char *objectset, double *g0, double *dgdx, double *sti, double *df, ITG *nactdofinv, ITG *jqs, ITG *irows, ITG *idisplacement, ITG *nzs, char *jobnamec, ITG *isolver, ITG *icol, ITG *irow, ITG *jq, ITG *kode, double *cs, char *output, ITG *istartdesi, ITG *ialdesi, double *xdesi, char *orname, ITG *icoordinate, ITG *iev, double *d, double *z, double *au, double *ad, double *aub, double *adb, ITG *cyclicsymmetry, ITG *nzss, ITG *nev, ITG *ishapeenergy, double *fint, ITG *nlabel, ITG *igreen, ITG *nasym, ITG *iponoel, ITG *inoel, ITG *nodedesiinv, double *dgdxglob)
 
void * objectivemt_shapeener_dx (ITG *i)
 
void * objectivemt_mass_dx (ITG *i)
 
void FORTRAN (objective_disp,(ITG *nodeset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nk, ITG *idesvar, ITG *iobject, ITG *mi, double *g0, ITG *nobject, double *vold))
 
void FORTRAN (objective_disp_dx,(ITG *nodeset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nk, ITG *idesvar, ITG *iobject, ITG *mi, ITG *nactdof, double *dgdx, ITG *ndesi, ITG *nobject, double *vold, double *b))
 
void FORTRAN (objective_freq,(double *dgdx, double *df, double *vold, ITG *ndesi, ITG *iobject, ITG *mi, ITG *nactdofinv, ITG *jqs, ITG *irows))
 
void FORTRAN (objective_freq_cs,(double *dgdx, double *df, double *vold, ITG *ndesi, ITG *iobject, ITG *mi, ITG *nactdofinv, ITG *jqs, ITG *irows, ITG *nk, ITG *nzss))
 
void FORTRAN (objective_mass_dx,(double *co1, ITG *kon1, ITG *ipkon1, char *lakon1, ITG *nelcon1, double *rhcon1, ITG *ielmat1, ITG *ielorien1, ITG *norien1, ITG *ntmat1_, char *matname1, ITG *mi1, double *thicke1, ITG *mortar1, ITG *nea, ITG *neb, ITG *ielprop1, double *prop1, double *distmin1, ITG *ndesi1, ITG *nodedesi1, ITG *nobject1, double *g01, double *dgdx1, ITG *iobject1, double *xmass1, ITG *istartdesi1, ITG *ialdesi1, double *xdesi1, ITG *idesvar))
 
void FORTRAN (objective_shapeener_dx,(double *co1, ITG *kon1, ITG *ipkon1, char *lakon1, ITG *ne1, double *stx1, double *elcon1, ITG *nelcon1, double *rhcon1, ITG *nrhcon1, double *alcon1, ITG *nalcon1, double *alzero1, ITG *ielmat1, ITG *ielorien1, ITG *norien1, double *orab1, ITG *ntmat1_, double *t01, double *t11, ITG *ithermal1, double *prestr1, ITG *iprestr1, ITG *iperturb1, ITG *iout1, double *vold1, ITG *nmethod1, double *veold1, double *dtime1, double *time1, double *ttime1, double *plicon1, ITG *nplicon1, double *plkcon1, ITG *nplkcon1, double *xstateini1, double *xstiff1, double *xstate1, ITG *npmat1_, char *matname1, ITG *mi1, ITG *ielas1, ITG *icmd1, ITG *ncmat1_, ITG *nstate1_, double *stiini1, double *vini1, double *ener1, double *enerini1, ITG *istep1, ITG *iinc1, double *springarea1, double *reltime1, ITG *calcul_qa1, ITG *iener1, ITG *ikin1, ITG *ne01, double *thicke1, double *emeini1, double *pslavsurf1, double *pmastsurf1, ITG *mortar1, double *clearini1, ITG *nea, ITG *neb, ITG *ielprop1, double *prop1, double *distmin1, ITG *ndesi1, ITG *nodedesi1, ITG *nobject1, double *g01, double *dgdx1, ITG *iobject1, double *sti1, double *xener1, ITG *istartdesi1, ITG *ialdesi1, double *xdesi1, ITG *idesvar))
 
void FORTRAN (objective_shapeener_tot,(ITG *ne, ITG *kon, ITG *ipkon, char *lakon, double *fint, double *vold, ITG *iperturb, ITG *mi, ITG *nactdof, double *dgdx, double *df, ITG *ndesi, ITG *iobject, ITG *jqs, ITG *irows, double *vec))
 
void FORTRAN (objective_stress,(ITG *nodeset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nk, ITG *idesvar, ITG *iobject, ITG *mi, double *g0, ITG *nobject, double *stn, char *objectset))
 
void FORTRAN (objective_stress_dx,(ITG *nodeset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nk, ITG *idesvar, ITG *iobject, double *dgdx, ITG *ndesi, ITG *nobject, double *stn, double *dstn, char *objectset, double *g0))
 
void FORTRAN (op,(ITG *n, double *x, double *y, double *ad, double *au, ITG *jq, ITG *irow))
 
void FORTRAN (opas,(ITG *n, double *x, double *y, double *ad, double *au, ITG *jq, ITG *irow, ITG *nzs))
 
void FORTRAN (op_corio,(ITG *n, double *x, double *y, double *ad, double *au, ITG *jq, ITG *irow))
 
void FORTRAN (openfile,(char *jobname, char *output))
 
void FORTRAN (openfilefluid,(char *jobname))
 
void FORTRAN (posttransition,(double *dgdxglob, ITG *nobject, ITG *nk, ITG *nodedesi, ITG *ndesi, char *objectset))
 
void FORTRAN (postview,(ITG *ntr, char *sideload, ITG *nelemload, ITG *kontri, ITG *ntri, ITG *nloadtr, double *tenv, double *adview, double *auview, double *area, double *fenv, ITG *jqrad, ITG *irowrad, ITG *nzsrad))
 
void FORTRAN (precfd,(ITG *ne, ITG *ipkon, ITG *kon, char *lakon, ITG *ipnei, ITG *neifa, ITG *neiel, ITG *ipoface, ITG *nodface, ITG *ielfa, ITG *nkonnei, ITG *nface, ITG *ifaext, ITG *nfaext, ITG *isolidsurf, ITG *nsolidsurf, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, double *vel, double *vold, ITG *mi, ITG *neij, ITG *nef, ITG *nactdoh, ITG *ipkonf, char *lakonf, ITG *ielmatf, ITG *ielmat, ITG *ielorienf, ITG *ielorien, ITG *norien, double *cs, ITG *mcs, char *tieset, double *x, double *y, double *z, double *xo, double *yo, double *zo, ITG *nx, ITG *ny, ITG *nz, double *co, ITG *ifatei))
 
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)
 
void FORTRAN (preconvert2slapcol,(ITG *irow, ITG *ia, ITG *jq, ITG *ja, ITG *nzs, ITG *nef))
 
void FORTRAN (predgmres,(ITG *n, double *b, double *x, ITG *nelt, ITG *ia, ITG *ja, double *a, ITG *isym, ITG *itol, double *tol, ITG *itmax, ITG *iter, double *err, ITG *ierr, ITG *iunit, double *sb, double *sx, double *rgwk, ITG *lrgw, ITG *igwk, ITG *ligw, double *rwork, ITG *iwork))
 
void prediction (double *uam, ITG *nmethod, double *bet, double *gam, double *dtime, ITG *ithermal, ITG *nk, double *veold, double *accold, double *v, ITG *iinc, ITG *idiscon, double *vold, ITG *nactdof, ITG *mi)
 
void prediction_em (double *uam, ITG *nmethod, double *bet, double *gam, double *dtime, ITG *ithermal, ITG *nk, double *veold, double *v, ITG *iinc, ITG *idiscon, double *vold, ITG *nactdof, ITG *mi)
 
void FORTRAN (prefilter,(double *co, ITG *nodedesi, ITG *ndesi, double *xo, double *yo, double *zo, double *x, double *y, double *z, ITG *nx, ITG *ny, ITG *nz))
 
void preiter (double *ad, double **aup, double *b, ITG **icolp, ITG **irowp, ITG *neq, ITG *nzs, ITG *isolver, ITG *iperturb)
 
void FORTRAN (prethickness,(double *co, double *xo, double *yo, double *zo, double *x, double *y, double *z, ITG *nx, ITG *ny, ITG *nz, ITG *ifree, ITG *nodedesiinv, ITG *ndesiboun, ITG *nodedesiboun, char *set, ITG *nset, char *objectset, ITG *iobject, ITG *istartset, ITG *iendset, ITG *ialset))
 
void FORTRAN (pretransition,(ITG *ipkon, ITG *kon, char *lakon, double *co, ITG *nk, ITG *ipoface, ITG *nodface, ITG *nodedesiinv, double *xo, double *yo, double *zo, double *x, double *y, double *z, ITG *nx, ITG *ny, ITG *nz, ITG *ifree))
 
void FORTRAN (printoutfluid,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nprint, char *prlab, char *prset, ITG *ipkon, char *lakon, double *stx, double *eei, double *xstate, double *ener, ITG *mi, ITG *nstate_, double *co, ITG *kon, double *qfx, double *ttime, double *trab, ITG *inotr, ITG *ntrans, double *orab, ITG *ielorien, ITG *norien, double *vold, ITG *ielmatf, double *thicke, double *eme, double *vcontu, double *physcon, ITG *nactdoh, ITG *ielpropf, double *prop, double *xkappa, double *xmach, ITG *ithermal, char *orname))
 
void FORTRAN (printoutface,(double *co, double *rhcon, ITG *nrhcon, ITG *ntmat_, double *vold, double *shcon, ITG *nshcon, double *cocon, ITG *ncocon, ITG *icompressible, ITG *istartset, ITG *iendset, ITG *ipkon, char *lakon, ITG *kon, ITG *ialset, char *prset, double *timef, ITG *nset, char *set, ITG *nprint, char *prlab, ITG *ielmat, ITG *mi, ITG *ithermal, ITG *nactdoh, ITG *icfd, double *time, double *stn))
 
void projectgradmain (ITG *nobject, char *objectset, double *dgdxglob, double *g0, ITG *ndesi, ITG *nodedesi, ITG *nk, ITG *isolver, ITG *nactive, ITG *nnlconst, ITG *ipoacti)
 
void FORTRAN (propertynet,(ITG *ieg, ITG *nflow, double *prop, ITG *ielprop, char *lakon, ITG *iin, double *prop_store, double *ttime, double *time, ITG *nam, char *amname, ITG *namta, double *amta))
 
int pthread_create (pthread_t *thread_id, const pthread_attr_t *attributes, void *(*thread_function)(void *), void *arguments)
 
int pthread_join (pthread_t thread, void **status_ptr)
 
void radcyc (ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, double *cs, ITG *mcs, ITG *nkon, ITG *ialset, ITG *istartset, ITG *iendset, ITG **kontrip, ITG *ntri, double **cop, double **voldp, ITG *ntrit, ITG *inocs, ITG *mi)
 
void radflowload (ITG *itg, ITG *ieg, ITG *ntg, ITG *ntr, double *adrad, double *aurad, double *bcr, ITG *ipivr, double *ac, double *bc, ITG *nload, char *sideload, ITG *nelemload, double *xloadact, char *lakon, ITG *ipiv, ITG *ntmat_, double *vold, double *shcon, ITG *nshcon, ITG *ipkon, ITG *kon, double *co, ITG *kontri, ITG *ntri, ITG *nloadtr, double *tarea, double *tenv, double *physcon, double *erad, double **adviewp, double **auviewp, ITG *nflow, ITG *ikboun, double *xboun, ITG *nboun, ITG *ithermal, ITG *iinc, ITG *iit, double *cs, ITG *mcs, ITG *inocs, ITG *ntrit, ITG *nk, double *fenv, ITG *istep, double *dtime, double *ttime, double *time, ITG *ilboun, ITG *ikforc, ITG *ilforc, double *xforc, ITG *nforc, double *cam, ITG *ielmat, ITG *nteq, double *prop, ITG *ielprop, ITG *nactdog, ITG *nacteq, ITG *nodeboun, ITG *ndirboun, ITG *network, double *rhcon, ITG *nrhcon, ITG *ipobody, ITG *ibody, double *xbody, ITG *nbody, ITG *iviewfile, char *jobnamef, double *ctrl, double *xloadold, double *reltime, ITG *nmethod, char *set, ITG *mi, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nset, ITG *ineighe, ITG *nmpc, ITG *nodempc, ITG *ipompc, double *coefmpc, char *labmpc, ITG *iemchange, ITG *nam, ITG *iamload, ITG *jqrad, ITG *irowrad, ITG *nzsrad, ITG *icolrad, ITG *ne, ITG *iaxial, double *qa, double *cocon, ITG *ncocon, ITG *iponoel, ITG *inoel, ITG *nprop, char *amname, ITG *namta, double *amta)
 
void FORTRAN (radmatrix,(ITG *ntr, double *adrad, double *aurad, double *bcr, char *sideload, ITG *nelemload, double *xloadact, char *lakon, double *vold, ITG *ipkon, ITG *kon, double *co, ITG *nloadtr, double *tarea, double *tenv, double *physcon, double *erad, double *adview, double *auview, ITG *ithermal, ITG *iinc, ITG *iit, double *fenv, ITG *istep, double *dtime, double *ttime, double *time, ITG *iviewfile, double *xloadold, double *reltime, ITG *nmethod, ITG *mi, ITG *iemchange, ITG *nam, ITG *iamload, ITG *jqrad, ITG *irowrad, ITG *nzsrad))
 
void FORTRAN (radresult,(ITG *ntr, double *xloadact, double *bcr, ITG *nloadtr, double *tarea, double *tenv, double *physcon, double *erad, double *auview, double *fenv, ITG *irowrad, ITG *jqrad, ITG *nzsrad, double *q))
 
void randomfieldmain (ITG *kon, ITG *ipkon, char *lakon, ITG *ne, ITG *nmpc, ITG *nactdof, ITG *mi, ITG *nodedesi, ITG *ndesi, ITG *istartdesi, ITG *ialdesi, double *co, double *physcon, ITG *isolver, ITG *ntrans, ITG *nk, ITG *inotr, double *trab, char *jobnamec, ITG *nboun, double *cs, ITG *mcs, ITG *inum, ITG *nmethod, ITG *kode, char *filab, ITG *nstate_, ITG *istep, char *description, char *set, ITG *nset, ITG *iendset, char *output, ITG *istartset, ITG *ialset, double *extnor)
 
void FORTRAN (randomval,(double *randval, ITG *nev))
 
void FORTRAN (readforce,(double *zc, ITG *neq, ITG *nev, ITG *nactdof, ITG *ikmpc, ITG *nmpc, ITG *ipompc, ITG *nodempc, ITG *mi, double *coefmpc, char *jobnamec, double *aa, ITG *igeneralizedforce))
 
void readinput (char *jobnamec, char **inpcp, ITG *nline, ITG *nset, ITG *ipoinp, ITG **inpp, ITG **ipoinpcp, ITG *ithermal, ITG *nuel_)
 
void FORTRAN (readview,(ITG *ntr, double *adview, double *auview, double *fenv, ITG *nzsrad, ITG *ithermal, char *jobnamef))
 
void FORTRAN (rearrange,(double *au, ITG *irow, ITG *icol, ITG *ndim, ITG *neq))
 
void FORTRAN (rectcyl,(double *co, double *v, double *fn, double *stn, double *qfn, double *een, double *cs, ITG *nk, ITG *icntrl, double *t, char *filab, ITG *imag, ITG *mi, double *emn))
 
void FORTRAN (rectcylexp,(double *co, double *v, double *fn, double *stn, double *qfn, double *een, double *cs, ITG *nkt, ITG *icntrl, double *t, char *filab, ITG *imag, ITG *mi, ITG *iznode, ITG *nznode, ITG *nsectors, ITG *nk, double *emn))
 
void FORTRAN (rectcyltrfm,(ITG *node, double *co, double *cs, ITG *cntrl, double *fin, double *fout))
 
void FORTRAN (rectcylvi,(double *co, double *v, double *fn, double *stn, double *qfn, double *een, double *cs, ITG *nk, ITG *icntrl, double *t, char *filab, ITG *imag, ITG *mi, double *emn))
 
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, ITG *network)
 
void remastructar (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, ITG *ithermal, ITG *iperturb, ITG *mass, ITG *mi, ITG *ics, double *cs, ITG *mcs, ITG *mortar, char *typeboun, ITG *iit, ITG *network)
 
void remastructem (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 *ielmat, double *elcon, ITG *ncmat_, ITG *ntmat_, ITG *inomat, ITG *network)
 
void FORTRAN (restartshort,(ITG *nset, ITG *nload, ITG *nbody, ITG *nforc, ITG *nboun, ITG *nk, ITG *ne, ITG *nmpc, ITG *nalset, ITG *nmat, ITG *ntmat, ITG *npmat, ITG *norien, ITG *nam, ITG *nprint, ITG *mint, ITG *ntrans, ITG *ncs, ITG *namtot, ITG *ncmat, ITG *memmpc, ITG *ne1d, ITG *ne2d, ITG *nflow, char *set, ITG *meminset, ITG *rmeminset, char *jobnamec, ITG *irestartstep, ITG *icntrl, ITG *ithermal, ITG *nener, ITG *nstate_, ITG *ntie, ITG *nslavs, ITG *nkon, ITG *mcs, ITG *nprop, ITG *mortar, ITG *ifacecount, ITG *nintpoint, ITG *infree))
 
void FORTRAN (restartwrite,(ITG *istep, ITG *nset, ITG *nload, ITG *nforc, ITG *nboun, ITG *nk, ITG *ne, ITG *nmpc, ITG *nalset, ITG *nmat, ITG *ntmat_, ITG *npmat_, ITG *norien, ITG *nam, ITG *nprint, ITG *mi, ITG *ntrans, ITG *ncs_, ITG *namtot_, ITG *ncmat_, ITG *mpcend, ITG *maxlenmpc, ITG *ne1d, ITG *ne2d, ITG *nflow, ITG *nlabel, ITG *iplas, ITG *nkon, ITG *ithermal, ITG *nmethod, ITG *iperturb, ITG *nstate_, ITG *nener, char *set, ITG *istartset, ITG *iendset, ITG *ialset, double *co, ITG *kon, ITG *ipkon, char *lakon, ITG *nodeboun, ITG *ndirboun, ITG *iamboun, double *xboun, ITG *ikboun, ITG *ilboun, ITG *ipompc, ITG *nodempc, double *coefmpc, char *labmpc, ITG *ikmpc, ITG *ilmpc, ITG *nodeforc, ITG *ndirforc, ITG *iamforc, double *xforc, ITG *ikforc, ITG *ilforc, ITG *nelemload, ITG *iamload, char *sideload, double *xload, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, char *orname, double *orab, ITG *ielorien, double *trab, ITG *inotr, char *amname, double *amta, ITG *namta, double *t0, double *t1, ITG *iamt1, double *veold, ITG *ielmat, char *matname, char *prlab, char *prset, char *filab, double *vold, ITG *nodebounold, ITG *ndirbounold, double *xbounold, double *xforcold, double *xloadold, double *t1old, double *eme, ITG *iponor, double *xnor, ITG *knor, double *thicke, double *offset, ITG *iponoel, ITG *inoel, ITG *rig, double *shcon, ITG *nshcon, double *cocon, ITG *ncocon, ITG *ics, double *sti, double *ener, double *xstate, char *jobnamec, ITG *infree, double *prestr, ITG *iprestr, char *cbody, ITG *ibody, double *xbody, ITG *nbody, double *xbodyold, double *ttime, double *qaold, double *cs, ITG *mcs, char *output, double *physcon, double *ctrl, char *typeboun, double *fmpc, char *tieset, ITG *ntie, double *tietol, ITG *nslavs, double *t0g, double *t1g, ITG *nprop, ITG *ielprop, double *prop, ITG *mortar, ITG *nintpoint, ITG *ifacecount, ITG *islavsurf, double *pslavsurf, double *clearini))
 
void FORTRAN (resultnet,(ITG *itg, ITG *ieg, ITG *ntg, double *bc, ITG *nload, char *sideload, ITG *nelemload, double *xloadact, char *lakon, ITG *ntmat_, double *v, double *shcon, ITG *nshcon, ITG *ipkon, ITG *kon, double *co, ITG *nflow, ITG *iinc, ITG *istep, double *dtime, double *ttime, double *time, ITG *ikforc, ITG *ilforc, double *xforcact, ITG *nforc, ITG *ielmat, ITG *nteq, double *prop, ITG *ielprop, ITG *nactdog, ITG *nacteq, ITG *iin, double *physcon, double *camt, double *camf, double *camp, double *rhcon, ITG *nrhcon, ITG *ipobody, ITG *ibody, double *xbody, ITG *nbody, double *dtheta, double *vold, double *xloadold, double *reltime, ITG *nmethod, char *set, ITG *mi, ITG *ineighe, double *cama, double *vamt, double *vamf, double *vamp, double *vama, ITG *nmpc, ITG *nodempc, ITG *ipompc, double *coefmpc, char *labmpc, ITG *iaxial, double *qat, double *qaf, double *ramt, double *ramf, double *ramp, double *cocon, ITG *ncocon, ITG *iponoel, ITG *inoel, ITG *iplausi))
 
void results (double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, double *v, double *stn, ITG *inum, double *stx, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, double *prestr, ITG *iprestr, char *filab, double *eme, double *emn, double *een, ITG *iperturb, double *f, double *fn, ITG *nactdof, ITG *iout, double *qa, double *vold, double *b, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, char *labmpc, ITG *nmpc, ITG *nmethod, double *vmax, ITG *neq, double *veold, double *accold, double *beta, double *gamma, double *dtime, double *time, double *ttime, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstateini, double *xstiff, double *xstate, ITG *npmat_, double *epl, char *matname, ITG *mi, ITG *ielas, ITG *icmd, ITG *ncmat_, ITG *nstate_, double *stiini, double *vini, ITG *ikboun, ITG *ilboun, double *ener, double *enern, double *emeini, double *xstaten, double *eei, double *enerini, double *cocon, ITG *ncocon, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nprint, char *prlab, char *prset, double *qfx, double *qfn, double *trab, ITG *inotr, ITG *ntrans, double *fmpc, ITG *nelemload, ITG *nload, ITG *ikmpc, ITG *ilmpc, ITG *istep, ITG *iinc, double *springarea, double *reltime, ITG *ne0, double *xforc, ITG *nforc, double *thicke, double *shcon, ITG *nshcon, char *sideload, double *xload, double *xloadold, ITG *icfd, ITG *inomat, double *pslavsurf, double *pmastsurf, ITG *mortar, ITG *islavact, double *cdn, ITG *islavnode, ITG *nslavnode, ITG *ntie, double *clearini, ITG *islavsurf, ITG *ielprop, double *prop, double *energyini, double *energy, ITG *kscale, ITG *iponoel, ITG *inoel, ITG *nener, char *orname, ITG *network, ITG *ipobody, double *xbodyact, ITG *ibody)
 
void FORTRAN (resultsem,(double *co, ITG *kon, ITG *ipkon, char *lakon, double *v, double *elcon, ITG *nelcon, ITG *ielmat, ITG *ntmat_, double *vold, double *dtime, char *matname, ITG *mi, ITG *ncmat_, ITG *nea, ITG *neb, double *sti, double *alcon, ITG *nalcon, double *h0, ITG *istartset, ITG *iendset, ITG *ialset, ITG *iactive, double *fn))
 
void * resultsemmt (ITG *i)
 
void FORTRAN (resultsforc,(ITG *nk, double *f, double *fn, ITG *nactdof, ITG *ipompc, ITG *nodempc, double *coefmpc, char *labmpc, ITG *nmpc, ITG *mi, double *fmpc, ITG *calcul_fn, ITG *calcul_f))
 
void FORTRAN (resultsforc_em,(ITG *nk, double *f, double *fn, ITG *nactdof, ITG *ipompc, ITG *nodempc, double *coefmpc, char *labmpc, ITG *nmpc, ITG *mi, double *fmpc, ITG *calcul_fn, ITG *calcul_f, ITG *inomat))
 
void FORTRAN (resultsforc_se,(ITG *nk, double *dfn, ITG *nactdof, ITG *ipompc, ITG *nodempc, double *coefmpc, ITG *nmpc, ITG *mi, double *fmpc, ITG *calcul_fn, ITG *calcul_f, ITG *idesvar, double *df, ITG *jqs, ITG *irows, double *distmin))
 
void FORTRAN (resultsini,(ITG *nk, double *v, ITG *ithermal, char *filab, ITG *iperturb, double *f, double *fn, ITG *nactdof, ITG *iout, double *qa, double *vold, double *b, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, char *labmpc, ITG *nmpc, ITG *nmethod, double *cam, ITG *neq, double *veold, double *accold, double *bet, double *gam, double *dtime, ITG *mi, double *vini, ITG *nprint, char *prlab, ITG *intpointvar, ITG *calcul_fn, ITG *calcul_f, ITG *calcul_qa, ITG *calcul_cauchy, ITG *iener, ITG *ikin, ITG *intpointvart, double *xforc, ITG *nforc))
 
void FORTRAN (resultsini_em,(ITG *nk, double *v, ITG *ithermal, char *filab, ITG *iperturb, double *f, double *fn, ITG *nactdof, ITG *iout, double *qa, double *b, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, char *labmpc, ITG *nmpc, ITG *nmethod, double *cam, ITG *neq, double *veold, double *dtime, ITG *mi, double *vini, ITG *nprint, char *prlab, ITG *intpointvar, ITG *calcul_fn, ITG *calcul_f, ITG *calcul_qa, ITG *calcul_cauchy, ITG *iener, ITG *ikin, ITG *intpointvart, double *xforc, ITG *nforc))
 
void FORTRAN (resultsmech,(double *co, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, double *v, double *stx, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, double *prestr, ITG *iprestr, double *eme, ITG *iperturb, double *fn, ITG *iout, double *qa, double *vold, ITG *nmethod, double *veold, double *dtime, double *time, double *ttime, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstateini, double *xstiff, double *xstate, ITG *npmat_, char *matname, ITG *mi, ITG *ielas, ITG *icmd, ITG *ncmat_, ITG *nstate_, double *stiini, double *vini, double *ener, double *eei, double *enerini, ITG *istep, ITG *iinc, double *springarea, double *reltime, ITG *calcul_fn, ITG *calcul_qa, ITG *calcul_cauchy, ITG *iener, ITG *ikin, ITG *nal, ITG *ne0, double *thicke, double *emeini, double *pslavsurf, double *pmastsurf, ITG *mortar, double *clearini, ITG *nea, ITG *neb, ITG *ielprop, double *prop, ITG *kscale))
 
void * resultsmechmt (ITG *i)
 
void * resultsmechmtstr (ITG *i)
 
void * resultsmechmt_se (ITG *i)
 
void FORTRAN (resultsmech_se,(double *co, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, double *v, double *stx, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, double *prestr, ITG *iprestr, double *eme, ITG *iperturb, double *fn, ITG *iout, double *vold, ITG *nmethod, double *veold, double *dtime, double *time, double *ttime, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstateini, double *xstiff, double *xstate, ITG *npmat_, char *matname, ITG *mi, ITG *ielas, ITG *icmd, ITG *ncmat_, ITG *nstate_, double *stiini, double *vini, double *ener, double *eei, double *enerini, ITG *istep, ITG *iinc, double *springarea, double *reltime, ITG *calcul_fn, ITG *calcul_cauchy, ITG *iener, ITG *ikin, ITG *ne0, double *thicke, double *emeini, double *pslavsurf, double *pmastsurf, ITG *mortar, double *clearini, ITG *nea, ITG *neb, ITG *ielprop, double *prop, double *dfn, ITG *idesvar, ITG *nodedesi, double *fn0, double *sti, ITG *icoordinate, double *dxstiff, ITG *ialdesi, double *xdesi))
 
void FORTRAN (resultsnoddir,(ITG *nk, double *v, ITG *nactdof, double *b, ITG *ipompc, ITG *nodempc, double *coefmpc, ITG *nmpc, ITG *mi))
 
void FORTRAN (resultsprint,(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, double *v, double *stn, ITG *inum, double *stx, ITG *ielorien, ITG *norien, double *orab, double *t1, ITG *ithermal, char *filab, double *een, ITG *iperturb, double *fn, ITG *nactdof, ITG *iout, double *vold, ITG *nodeboun, ITG *ndirboun, ITG *nboun, ITG *nmethod, double *ttime, double *xstate, double *epn, ITG *mi, ITG *nstate_, double *ener, double *enern, double *xstaten, double *eei, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nprint, char *prlab, char *prset, double *qfx, double *qfn, double *trab, ITG *inotr, ITG *ntrans, ITG *nelemload, ITG *nload, ITG *ikin, ITG *ielmat, double *thicke, double *eme, double *emn, double *rhcon, ITG *nrhcon, double *shcon, ITG *nshcon, double *cocon, ITG *ncocon, ITG *ntmat_, char *sideload, ITG *icfd, ITG *inomat, double *pslavsurf, ITG *islavact, double *cdn, ITG *mortar, ITG *islavnode, ITG *nslavnode, ITG *ntie, ITG *islavsurf, double *time, ITG *ielprop, double *prop, double *veold, ITG *ne0, ITG *nmpc, ITG *ipompc, ITG *nodempc, char *labmpc, double *energyini, double *energy, char *orname, double *xload))
 
void resultsstr (double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, double *v, double *stn, ITG *inum, double *stx, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, double *prestr, ITG *iprestr, char *filab, double *eme, double *emn, double *een, ITG *iperturb, double *f, double *fn, ITG *nactdof, ITG *iout, double *qa, double *vold, double *b, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, char *labmpc, ITG *nmpc, ITG *nmethod, double *vmax, ITG *neq, double *veold, double *accold, double *beta, double *gamma, double *dtime, double *time, double *ttime, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstateini, double *xstiff, double *xstate, ITG *npmat_, double *epl, char *matname, ITG *mi, ITG *ielas, ITG *icmd, ITG *ncmat_, ITG *nstate_, double *stiini, double *vini, ITG *ikboun, ITG *ilboun, double *ener, double *enern, double *emeini, double *xstaten, double *eei, double *enerini, double *cocon, ITG *ncocon, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nprint, char *prlab, char *prset, double *qfx, double *qfn, double *trab, ITG *inotr, ITG *ntrans, double *fmpc, ITG *nelemload, ITG *nload, ITG *ikmpc, ITG *ilmpc, ITG *istep, ITG *iinc, double *springarea, double *reltime, ITG *ne0, double *xforc, ITG *nforc, double *thicke, double *shcon, ITG *nshcon, char *sideload, double *xload, double *xloadold, ITG *icfd, ITG *inomat, double *pslavsurf, double *pmastsurf, ITG *mortar, ITG *islavact, double *cdn, ITG *islavnode, ITG *nslavnode, ITG *ntie, double *clearini, ITG *islavsurf, ITG *ielprop, double *prop, double *energyini, double *energy, ITG *kscale, ITG *nener, char *orname, ITG *network, ITG *neapar, ITG *nebpar)
 
void results_se (double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, double *v, double *stn, ITG *inum, double *stx, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, double *prestr, ITG *iprestr, char *filab, double *eme, double *emn, double *een, ITG *iperturb, double *f, double *fn, ITG *nactdof, ITG *iout, double *qa, double *vold, double *b, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, char *labmpc, ITG *nmpc, ITG *nmethod, double *vmax, ITG *neq, double *veold, double *accold, double *beta, double *gamma, double *dtime, double *time, double *ttime, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstateini, double *xstiff, double *xstate, ITG *npmat_, double *epl, char *matname, ITG *mi, ITG *ielas, ITG *icmd, ITG *ncmat_, ITG *nstate_, double *stiini, double *vini, ITG *ikboun, ITG *ilboun, double *ener, double *enern, double *emeini, double *xstaten, double *eei, double *enerini, double *cocon, ITG *ncocon, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nprint, char *prlab, char *prset, double *qfx, double *qfn, double *trab, ITG *inotr, ITG *ntrans, double *fmpc, ITG *nelemload, ITG *nload, ITG *ikmpc, ITG *ilmpc, ITG *istep, ITG *iinc, double *springarea, double *reltime, ITG *ne0, double *xforc, ITG *nforc, double *thicke, double *shcon, ITG *nshcon, char *sideload, double *xload, double *xloadold, ITG *icfd, ITG *inomat, double *pslavsurf, double *pmastsurf, ITG *mortar, ITG *islavact, double *cdn, ITG *islavnode, ITG *nslavnode, ITG *ntie, double *clearini, ITG *islavsurf, ITG *ielprop, double *prop, double *energyini, double *energy, double *df, double *distmin, ITG *ndesi, ITG *nodedesi, double *sti, ITG *nkon, ITG *jqs, ITG *irows, ITG *nactdofinv, ITG *icoordinate, double *dxstiff, ITG *istartdesi, ITG *ialdesi, double *xdesi, ITG *ieigenfrequency, double *fint, ITG *ishapeenergy)
 
void FORTRAN (resultstherm,(double *co, ITG *kon, ITG *ipkon, char *lakon, double *v, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, ITG *iperturb, double *fn, double *shcon, ITG *nshcon, ITG *iout, double *qa, double *vold, ITG *ipompc, ITG *nodempc, double *coefmpc, ITG *nmpc, double *dtime, double *time, double *ttime, double *plkcon, ITG *nplkcon, double *xstateini, double *xstiff, double *xstate, ITG *npmat_, char *matname, ITG *mi, ITG *ncmat_, ITG *nstate_, double *cocon, ITG *ncocon, double *qfx, ITG *ikmpc, ITG *ilmpc, ITG *istep, ITG *iinc, double *springarea, ITG *calcul_fn, ITG *calcul_qa, ITG *nal, ITG *nea, ITG *neb, ITG *ithermal, ITG *nelemload, ITG *nload, ITG *nmethod, double *reltime, char *sideload, double *xload, double *xloadold, double *pslavsurf, double *pmastsurf, ITG *mortar, double *clearini, double *plicon, ITG *nplicon, ITG *ielprop, double *prop, ITG *iponoel, ITG *inoel, ITG *network, ITG *ipobody, double *xbodyact, ITG *ibody))
 
void * resultsthermemmt (ITG *i)
 
void * resultsthermmt (ITG *i)
 
void * resultsthermmt_se (ITG *i)
 
void resultsinduction (double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, double *v, double *stn, ITG *inum, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, double *prestr, ITG *iprestr, char *filab, double *eme, double *emn, double *een, ITG *iperturb, double *f, double *fn, ITG *nactdof, ITG *iout, double *qa, double *vold, double *b, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, char *labmpc, ITG *nmpc, ITG *nmethod, double *vmax, ITG *neq, double *veold, double *accold, double *beta, double *gamma, double *dtime, double *time, double *ttime, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstateini, double *xstiff, double *xstate, ITG *npmat_, double *epl, char *matname, ITG *mi, ITG *ielas, ITG *icmd, ITG *ncmat_, ITG *nstate_, double *sti, double *vini, ITG *ikboun, ITG *ilboun, double *ener, double *enern, double *emeini, double *xstaten, double *eei, double *enerini, double *cocon, ITG *ncocon, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nprint, char *prlab, char *prset, double *qfx, double *qfn, double *trab, ITG *inotr, ITG *ntrans, double *fmpc, ITG *nelemload, ITG *nload, ITG *ikmpc, ITG *ilmpc, ITG *istep, ITG *iinc, double *springarea, double *reltime, ITG *ne0, double *xforc, ITG *nforc, double *thicke, double *shcon, ITG *nshcon, char *sideload, double *xload, double *xloadold, ITG *icfd, ITG *inomat, double *h0, ITG *islavnode, ITG *nslavnode, ITG *ntie, ITG *ielprop, double *prop, ITG *iactive, double *energyini, double *energy, ITG *iponoel, ITG *inoel, char *orname, ITG *network, ITG *ipobody, double *xbody, ITG *ibody)
 
void FORTRAN (rhs,(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, ITG *ipompc, ITG *nodempc, double *coefmpc, ITG *nmpc, ITG *nodeforc, ITG *ndirforc, double *xforc, ITG *nforc, ITG *nelemload, char *sideload, double *xload, ITG *nload, double *xbody, ITG *ipobody, ITG *nbody, double *cgr, double *bb, ITG *nactdof, ITG *neq, ITG *nmethod, ITG *ikmpc, ITG *ilmpc, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, ITG *iprestr, double *vold, ITG *iperturb, ITG *iexpl, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, ITG *npmat_, double *ttime, double *time, ITG *istep, ITG *iinc, double *dtime, double *physcon, ITG *ibody, double *xbodyold, double *reltime, double *veold, char *matname, ITG *mi, ITG *ikactmech, ITG *nactmech, ITG *ielprop, double *prop, double *sti, double *xstateini, double *xstate, ITG *nstate_))
 
void FORTRAN (rhsp,(ITG *ne, char *lakon, ITG *ipnei, ITG *neifa, ITG *neiel, double *vfa, double *area, double *adfa, double *xlet, double *cosa, double *volume, double *au, double *ad, ITG *jq, ITG *irow, double *ap, ITG *ielfa, ITG *ifabou, double *xle, double *b, double *xxn, ITG *neq, ITG *nzs, double *hfa, double *gradpel, double *bp, double *xxi, ITG *neij, double *xlen, ITG *nefa, ITG *nefb, double *xxicn))
 
void rhspmain (ITG *ne, char *lakon, ITG *ipnei, ITG *neifa, ITG *neiel, double *vfa, double *area, double *adfa, double *xlet, double *cosa, double *volume, double *au, double *ad, ITG *jq, ITG *irow, double *ap, ITG *ielfa, ITG *ifabou, double *xle, double *b, double *xxn, ITG *neq, ITG *nzs, double *hfa, double *gradpel, double *bp, double *xxi, ITG *neij, double *xlen, ITG *iatleastonepressurebc, double *xxicn)
 
void * rhspmt (ITG *i)
 
void sensitivity (double *co, ITG *nk, ITG **konp, ITG **ipkonp, char **lakonp, ITG *ne, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, char *labmpc, ITG *nmpc, ITG *nodeforc, ITG *ndirforc, double *xforc, ITG *nforc, ITG *nelemload, char *sideload, double *xload, ITG *nload, ITG *nactdof, ITG *icol, ITG *jq, ITG **irowp, ITG *neq, ITG *nzl, ITG *nmethod, ITG *ikmpc, ITG *ilmpc, ITG *ikboun, ITG *ilboun, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG **ielmatp, ITG **ielorienp, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, double *t1old, ITG *ithermal, double *prestr, ITG *iprestr, double *vold, ITG *iperturb, double *sti, ITG *nzs, ITG *kode, char *filab, double *eme, ITG *iexpl, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double **xstatep, ITG *npmat_, char *matname, ITG *isolver, ITG *mi, ITG *ncmat_, ITG *nstate_, double *cs, ITG *mcs, ITG *nkon, double **enerp, double *xbounold, double *xforcold, double *xloadold, char *amname, double *amta, ITG *namta, ITG *nam, ITG *iamforc, ITG *iamload, ITG *iamt1, ITG *iamboun, double *ttime, char *output, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nprint, char *prlab, char *prset, ITG *nener, double *trab, ITG *inotr, ITG *ntrans, double *fmpc, char *cbody, ITG *ibody, double *xbody, ITG *nbody, double *xbodyold, double *timepar, double *thicke, char *jobnamec, char *tieset, ITG *ntie, ITG *istep, ITG *nmat, ITG *ielprop, double *prop, char *typeboun, ITG *mortar, ITG *mpcinfo, double *tietol, ITG *ics, ITG *icontact, ITG *nobject, char **objectsetp, ITG *istat, char *orname, ITG *nzsfreq, ITG *nlabel, double *physcon, char *jobnamef)
 
void FORTRAN (sensitivity_glob,(double *dgdxtot, double *dgdxtotglob, ITG *nobject, ITG *ndesi, ITG *nodedesi, ITG *nk))
 
void sensitivity_out (char *jobnamec, double *dgdxtotglob, ITG *neq, ITG *nobject, double *g0)
 
void FORTRAN (shape3tri,(double *xi, double *et, double *xl, double *xsj, double *xs, double *shp, ITG *iflag))
 
void FORTRAN (shape4q,(double *xi, double *et, double *xl, double *xsj, double *xs, double *shp, ITG *iflag))
 
void FORTRAN (shape4tet,(double *xi, double *et, double *ze, double *xl, double *xsj, double *shp, ITG *iflag))
 
void FORTRAN (shape6tri,(double *xi, double *et, double *xl, double *xsj, double *xs, double *shp, ITG *iflag))
 
void FORTRAN (shape6w,(double *xi, double *et, double *ze, double *xl, double *xsj, double *shp, ITG *iflag))
 
void FORTRAN (shape8h,(double *xi, double *et, double *ze, double *xl, double *xsj, double *shp, ITG *iflag))
 
void FORTRAN (shape8q,(double *xi, double *et, double *xl, double *xsj, double *xs, double *shp, ITG *iflag))
 
void FORTRAN (shape10tet,(double *xi, double *et, double *ze, double *xl, double *xsj, double *shp, ITG *iflag))
 
void FORTRAN (shape15w,(double *xi, double *et, double *ze, double *xl, double *xsj, double *shp, ITG *iflag))
 
void FORTRAN (shape20h,(double *xi, double *et, double *ze, double *xl, double *xsj, double *shp, ITG *iflag))
 
void FORTRAN (slavintpoints,(ITG *ntie, ITG *itietri, ITG *ipkon, ITG *kon, char *lakon, double *straight, ITG *nintpoint, ITG *koncont, double *co, double *vold, double *xo, double *yo, double *zo, double *x, double *y, double *z, ITG *nx, ITG *ny, ITG *nz, ITG *islavsurf, ITG *islavnode, ITG *nslavnode, ITG *imastop, ITG *mi, ITG *ncont, ITG *ipe, ITG *ime, double *pslavsurf, ITG *i, ITG *l, ITG *ntri))
 
void FORTRAN (smalldist,(double *co, double *distmin, char *lakon, ITG *ipkon, ITG *kon, ITG *ne))
 
void FORTRAN (sortev,(ITG *nev, ITG *nmd, double *eigxx, ITG *cyclicsymmetry, double *xx, double *eigxr, ITG *pev, ITG *istartnmd, ITG *iendnmd, double *aa, double *bb))
 
void FORTRAN (spcmatch,(double *xboun, ITG *nodeboun, ITG *ndirboun, ITG *nboun, double *xbounold, ITG *nodebounold, ITG *ndirbounold, ITG *nbounold, ITG *ikboun, ITG *ilboun, double *vold, double *reorder, ITG *nreorder, ITG *mi))
 
void FORTRAN (splitline,(char *text, char *textpart, ITG *n))
 
void spooles (double *ad, double *au, double *adb, double *aub, double *sigma, double *b, ITG *icol, ITG *irow, ITG *neq, ITG *nzs, ITG *symmtryflag, ITG *inputformat, ITG *nzs3)
 
void FORTRAN (springforc_n2f,(double *xl, ITG *konl, double *vl, ITG *imat, double *elcon, ITG *nelcon, double *elas, double *fnl, ITG *ncmat_, ITG *ntmat_, ITG *nope, char *lakonl, double *t1l, ITG *kode, double *elconloc, double *plicon, ITG *nplicon, ITG *npmat_, double *senergy, ITG *iener, double *cstr, ITG *mi, double *springarea, ITG *nmethod, ITG *ne0, ITG *nstate_, double *xstateini, double *xstate, double *reltime, ITG *ielas, double *venergy, ITG *ielorien, double *orab, ITG *norien, ITG *nelem))
 
void FORTRAN (springstiff_n2f,(double *xl, double *elas, ITG *konl, double *voldl, double *s, ITG *imat, double *elcon, ITG *nelcon, ITG *ncmat_, ITG *ntmat_, ITG *nope, char *lakonl, double *t1l, ITG *kode, double *elconloc, double *plicon, ITG *nplicon, ITG *npmat_, ITG *iperturb, double *springarea, ITG *nmethod, ITG *mi, ITG *ne0, ITG *nstate_, double *xstateini, double *xstate, double *reltime, ITG *nasym, ITG *ielorien, double *orab, ITG *norien, ITG *nelem))
 
void steadystate (double **co, ITG *nk, ITG **kon, ITG **ipkon, char **lakon, ITG *ne, ITG **nodeboun, ITG **ndirboun, double **xboun, ITG *nboun, ITG **ipompcp, ITG **nodempcp, double **coefmpcp, char **labmpcp, ITG *nmpc, ITG *nodeforc, ITG *ndirforc, double *xforc, ITG *nforc, ITG *nelemload, char *sideload, double *xload, ITG *nload, ITG **nactdof, ITG *neq, ITG *nzl, ITG *icol, ITG *irow, ITG *nmethod, ITG **ikmpcp, ITG **ilmpcp, ITG **ikboun, ITG **ilboun, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *cocon, ITG *ncocon, double *alcon, ITG *nalcon, double *alzero, ITG **ielmat, ITG **ielorien, ITG *norien, double *orab, ITG *ntmat_, double **t0, double **t1, ITG *ithermal, double *prestr, ITG *iprestr, double **voldp, ITG *iperturb, double *sti, ITG *nzs, double *timepar, double *xmodal, double **veoldp, char *amname, double *amta, ITG *namta, ITG *nam, ITG *iamforc, ITG *iamload, ITG **iamt1, ITG *jout, ITG *kode, char *filab, double **emep, double *xforcold, double *xloadold, double **t1old, ITG **iamboun, double **xbounold, ITG *iexpl, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstate, ITG *npmat_, char *matname, ITG *mi, ITG *ncmat_, ITG *nstate_, double **enerp, char *jobnamec, double *ttime, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nprint, char *prlab, char *prset, ITG *nener, double *trab, ITG **inotr, ITG *ntrans, double **fmpcp, char *cbody, ITG *ibody, double *xbody, ITG *nbody, double *xbodyold, ITG *istep, ITG *isolver, ITG *jq, char *output, ITG *mcs, ITG *nkon, ITG *ics, double *cs, ITG *mpcend, double *ctrl, ITG *ikforc, ITG *ilforc, double *thicke, ITG *nmat, char *typeboun, ITG *ielprop, double *prop, char *orname)
 
void FORTRAN (stop,())
 
void storecontactdof (ITG *nope, ITG *nactdof, ITG *mt, ITG *konl, ITG **ikactcontp, ITG *nactcont, ITG *nactcont_, double *bcont, double *fnl, ITG *ikmpc, ITG *nmpc, ITG *ilmpc, ITG *ipompc, ITG *nodempc, double *coefmpc)
 
void FORTRAN (storeresidual,(ITG *nactdof, double *b, double *fn, char *filab, ITG *ithermal, ITG *nk, double *sti, double *stn, ITG *ipkon, ITG *inum, ITG *kon, char *lakon, ITG *ne, ITG *mi, double *orab, ITG *ielorien, double *co, ITG *itg, ITG *ntg, double *vold, ITG *ielmat, double *thicke, ITG *ielprop, double *prop))
 
void FORTRAN (storecontactprop,(ITG *ne, ITG *ne0, char *lakon, ITG *kon, ITG *ipkon, ITG *mi, ITG *ielmat, double *elcon, ITG *mortar, double *adb, ITG *nactdof, double *springarea, ITG *ncmat_, ITG *ntmat_, double *stx, double *temax))
 
ITG strcmp1 (const char *s1, const char *s2)
 
ITG strcmp2 (const char *s1, const char *s2, ITG length)
 
ITG strcpy1 (char *s1, const char *s2, ITG length)
 
void stress_sen (double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, double *stn, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, double *prestr, ITG *iprestr, char *filab, double *emn, double *een, ITG *iperturb, double *f, ITG *nactdof, double *vold, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, char *labmpc, ITG *nmpc, ITG *nmethod, double *cam, ITG *neq, double *veold, double *accold, double *bet, double *gam, double *dtime, double *time, double *ttime, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstateini, double *xstate, ITG *npmat_, double *epn, char *matname, ITG *mi, ITG *ielas, ITG *ncmat_, ITG *nstate_, double *stiini, double *vini, ITG *ikboun, ITG *ilboun, double *enern, double *emeini, double *xstaten, double *enerini, double *cocon, ITG *ncocon, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nprint, char *prlab, char *prset, double *qfx, double *qfn, double *trab, ITG *inotr, ITG *ntrans, double *fmpc, ITG *nelemload, ITG *nload, ITG *ikmpc, ITG *ilmpc, ITG *istep, ITG *iinc, double *springarea, double *reltime, ITG *ne0, double *xforc, ITG *nforc, double *thicke, double *shcon, ITG *nshcon, char *sideload, double *xload, double *xloadold, ITG *icfd, ITG *inomat, double *pslavsurf, double *pmastsurf, ITG *mortar, ITG *islavact, double *cdn, ITG *islavnode, ITG *nslavnode, ITG *ntie, double *clearini, ITG *islavsurf, ITG *ielprop, double *prop, double *energyini, double *energy, ITG *kscale, char *orname, ITG *network, ITG *nestart, ITG *neend, ITG *jqs, ITG *irows, ITG *nodedesi, double *xdesi, ITG *ndesi, ITG *iobject, ITG *nobject, char *objectset, double *g0, double *dgdx, ITG *idesvara, ITG *idesvarb, ITG *nasym, ITG *isolver, double *distmin, ITG *nodeset, double *b)
 
void * stress_senmt (ITG *i)
 
void FORTRAN (subspace,(double *d, double *aa, double *bb, double *cc, double *alpham, double *betam, ITG *nev, double *xini, double *cd, double *cv, double *time, double *rwork, ITG *lrw, ITG *k, ITG *jout, double *rpar, double *bj, ITG *iwork, ITG *liw, ITG *iddebdf, double *bjp))
 
void FORTRAN (tempload,(double *xforcold, double *xforc, double *xforcact, ITG *iamforc, ITG *nforc, double *xloadold, double *xload, double *xloadact, ITG *iamload, ITG *nload, ITG *ibody, double *xbody, ITG *nbody, double *xbodyold, double *xbodyact, double *t1old, double *t1, double *t1act, ITG *iamt1, ITG *nk, double *amta, ITG *namta, ITG *nam, double *ampli, double *time, double *reltime, double *ttime, double *dtime, ITG *ithermal, ITG *nmethod, double *xbounold, double *xboun, double *xbounact, ITG *iamboun, ITG *nboun, ITG *nodeboun, ITG *ndirboun, ITG *nodeforc, ITG *ndirforc, ITG *istep, ITG *iint, double *co, double *vold, ITG *itg, ITG *ntg, char *amname, ITG *ikboun, ITG *ilboun, ITG *nelemload, char *sideload, ITG *mi, ITG *ntrans, double *trab, ITG *inotr, double *veold, ITG *integerglob, double *doubleglob, char *tieset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *ntie, ITG *nmpc, ITG *ipompc, ITG *ikmpc, ITG *ilmpc, ITG *nodempc, double *coefmpc, ITG *ipobody, ITG *iponoel, ITG *inoel))
 
void FORTRAN (tempload_em,(double *xforcold, double *xforc, double *xforcact, ITG *iamforc, ITG *nforc, double *xloadold, double *xload, double *xloadact, ITG *iamload, ITG *nload, ITG *ibody, double *xbody, ITG *nbody, double *xbodyold, double *xbodyact, double *t1old, double *t1, double *t1act, ITG *iamt1, ITG *nk, double *amta, ITG *namta, ITG *nam, double *ampli, double *time, double *reltime, double *ttime, double *dtime, ITG *ithermal, ITG *nmethod, double *xbounold, double *xboun, double *xbounact, ITG *iamboun, ITG *nboun, ITG *nodeboun, ITG *ndirboun, ITG *nodeforc, ITG *ndirforc, ITG *istep, ITG *iint, double *co, double *vold, ITG *itg, ITG *ntg, char *amname, ITG *ikboun, ITG *ilboun, ITG *nelemload, char *sideload, ITG *mi, ITG *ntrans, double *trab, ITG *inotr, double *veold, ITG *integerglob, double *doubleglob, char *tieset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *ntie, ITG *nmpc, ITG *ipompc, ITG *ikmpc, ITG *ilmpc, ITG *nodempc, double *coefmpc, double *h0scale, ITG *inomat, ITG *ipobody, ITG *iponoel, ITG *inoel))
 
void FORTRAN (temploaddiff,(double *xforcold, double *xforc, double *xforcact, ITG *iamforc, ITG *nforc, double *xloadold, double *xload, double *xloadact, ITG *iamload, ITG *nload, ITG *ibody, double *xbody, ITG *nbody, double *xbodyold, double *xbodyact, double *t1old, double *t1, double *t1act, ITG *iamt1, ITG *nk, double *amta, ITG *namta, ITG *nam, double *ampli, double *time, double *reltime, double *ttime, double *dtime, ITG *ithermal, ITG *nmethod, double *xbounold, double *xboun, double *xbounact, ITG *iamboun, ITG *nboun, ITG *nodeboun, ITG *ndirboun, ITG *nodeforc, ITG *ndirforc, ITG *istep, ITG *iint, double *co, double *vold, ITG *itg, ITG *ntg, char *amname, ITG *ikboun, ITG *ilboun, ITG *nelemload, char *sideload, ITG *mi, double *xforcdiff, double *xloaddiff, double *xbodydiff, double *t1diff, double *xboundiff, ITG *icorrect, ITG *iprescribedboundary, ITG *ntrans, double *trab, ITG *inotr, double *veold, ITG *nactdof, double *bcont, double *fn, ITG *ipobody, ITG *iponoel, ITG *inoel))
 
void FORTRAN (temploadmodal,(double *amta, ITG *namta, ITG *nam, double *ampli, double *timemin, double *ttimemin, double *dtime, double *xbounold, double *xboun, double *xbounmin, ITG *iamboun, ITG *nboun, ITG *nodeboun, ITG *ndirboun, char *amname))
 
void * thicknessmt (ITG *i)
 
void FORTRAN (tiefaccont,(char *lakon, ITG *ipkon, ITG *kon, ITG *ntie, char *tieset, ITG *nset, char *set, ITG *istartset, ITG *iendset, ITG *ialset, ITG *itiefac, ITG *islavsurf, ITG *islavnode, ITG *imastnode, ITG *nslavnode, ITG *nmastnode, ITG *nslavs, ITG *nmasts, ITG *ifacecount, ITG *iponoels, ITG *inoels, ITG *ifreenoels, ITG *mortar, ITG *ipoface, ITG *nodface, ITG *nk, double *xnoels))
 
void tiedcontact (ITG *ntie, char *tieset, ITG *nset, char *set, ITG *istartset, ITG *iendset, ITG *ialset, char *lakon, ITG *ipkon, ITG *kon, double *tietol, ITG *nmpc, ITG *mpcfree, ITG *memmpc_, ITG **ipompcp, char **labmpcp, ITG **ikmpcp, ITG **ilmpcp, double **fmpcp, ITG **nodempcp, double **coefmpcp, ITG *ithermal, double *co, double *vold, ITG *cfd, ITG *nmpc_, ITG *mi, ITG *nk, ITG *istep, ITG *ikboun, ITG *nboun, char *kind1, char *kind2)
 
void FORTRAN (transformatrix,(double *xab, double *p, double *a))
 
void FORTRAN (transition,(double *dgdxglob, ITG *nobject, ITG *nk, ITG *nodedesi, ITG *ndesi, char *objectset, double *xo, double *yo, double *zo, double *x, double *y, double *z, ITG *nx, ITG *ny, ITG *nz, double *co, ITG *ifree, ITG *ndesia, ITG *ndesib))
 
void transitionmain (double *co, double *dgdxglob, ITG *nobject, ITG *nk, ITG *nodedesi, ITG *ndesi, char *objectset, ITG *ipkon, ITG *kon, char *lakon, ITG *ipoface, ITG *nodface, ITG *nodedesiinv)
 
void * transitionmt (ITG *i)
 
void FORTRAN (trianeighbor,(ITG *ipe, ITG *ime, ITG *imastop, ITG *ncont, ITG *koncont, ITG *ifreeme))
 
void FORTRAN (triangucont,(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, char *kind1, char *kind2, double *co, ITG *nk))
 
void FORTRAN (tridiagonal_nrhs,(double *a, double *b, ITG *n, ITG *m, ITG *nrhs))
 
void FORTRAN (ufaceload,(double *co, ITG *ipkon, ITG *kon, char *lakon, ITG *nboun, ITG *nodeboun, ITG *nelemload, char *sideload, ITG *nload, ITG *ne, ITG *nk))
 
void FORTRAN (uinit,())
 
void FORTRAN (uiter,(ITG *iit))
 
void FORTRAN (uout,(double *v, ITG *mi, ITG *ithermal, char *filab))
 
void FORTRAN (updatecont,(ITG *koncont, ITG *ncont, double *co, double *vold, double *cg, double *straight, ITG *mi))
 
void FORTRAN (updatecontpen,(ITG *koncont, ITG *ncont, double *co, double *vold, double *cg, double *straight, ITG *mi, ITG *imastnode, ITG *nmastnode, double *xmastnor, ITG *ntie, char *tieset, ITG *nset, char *set, ITG *istartset, ITG *iendset, ITG *ialset, ITG *ipkon, char *lakon, ITG *kon, double *cs, ITG *mcs, ITG *ics))
 
void * u_calloc (size_t num, size_t size, const char *file, const int line, const char *ptr_name)
 
void * u_free (void *num, const char *file, const int line, const char *ptr_name)
 
void * u_realloc (void *num, size_t size, const char *file, const int line, const char *ptr_name)
 
void writeBasisParameter (FILE *f, ITG *istep, ITG *iinc)
 
void FORTRAN (writeboun,(ITG *nodeboun, ITG *ndirboun, double *xboun, char *typeboun, ITG *nboun))
 
void FORTRAN (writebv,(double *, ITG *))
 
void FORTRAN (writecvg,(ITG *itep, ITG *iinc, ITG *icutb, ITG *iit, ITG *ne, ITG *ne0, double *ram, double *qam, double *cam, double *uam, ITG *ithermal))
 
void FORTRAN (writedeigdx,(ITG *iev, double *d, ITG *ndesi, char *orname, double *dgdx))
 
void FORTRAN (writedesi,(ITG *norien, char *orname))
 
void FORTRAN (writeev,(double *, ITG *, double *, double *))
 
void FORTRAN (writeevcomplex,(double *eigxx, ITG *nev, double *fmin, double *fmax))
 
void FORTRAN (writeevcs,(double *, ITG *, ITG *, double *, double *))
 
void FORTRAN (writeevcscomplex,(double *eigxx, ITG *nev, ITG *nm, double *fmin, double *fmax))
 
void FORTRAN (writehe,(ITG *))
 
void writeheading (char *jobnamec, char *heading, ITG *nheading)
 
void FORTRAN (writeim,())
 
void FORTRAN (writeinput,(char *inpc, ITG *ipoinp, ITG *inp, ITG *nline, ITG *ninp, ITG *ipoinpc))
 
void FORTRAN (writemac,(double *mac, ITG *nev))
 
void FORTRAN (writemaccs,(double *mac, ITG *nev, ITG *nm))
 
void FORTRAN (writempc,(ITG *, ITG *, double *, char *, ITG *))
 
void FORTRAN (writeobj,(char *objectset, ITG *iobject, double *g0))
 
void FORTRAN (writepf,(double *d, double *bjr, double *bji, double *freq, ITG *nev, ITG *mode, ITG *nherm))
 
void FORTRAN (writerandomfield,(double *d, ITG *nev, double *abserr, double *relerr))
 
void FORTRAN (writere,())
 
void FORTRAN (writesubmatrix,(double *submatrix, ITG *noderetain, ITG *ndirretain, ITG *nretain, char *jobnamec))
 
void FORTRAN (writesummary,(ITG *istep, ITG *j, ITG *icutb, ITG *l, double *ttime, double *time, double *dtime))
 
void FORTRAN (writesummarydiv,(ITG *istep, ITG *j, ITG *icutb, ITG *l, double *ttime, double *time, double *dtime))
 
void FORTRAN (writetetmesh,(ITG *kontet, ITG *netet_, double *cotet, ITG *nktet, double *field, ITG *nfield))
 
void FORTRAN (writeview,(ITG *ntr, double *adview, double *auview, double *fenv, ITG *nzsrad, char *jobnamef))
 
void FORTRAN (zienzhu,(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, double *stn, ITG *ipneigh, ITG *neigh, double *sti, ITG *mi))
 
void FORTRAN (znaupd,(ITG *ido, char *bmat, ITG *n, char *which, ITG *nev, double *tol, double *resid, ITG *ncv, double *z, ITG *ldz, ITG *iparam, ITG *ipntr, double *workd, double *workl, ITG *lworkl, double *rwork, ITG *info))
 
void FORTRAN (zneupd,(ITG *rvec, char *howmny, ITG *select, double *d, double *z, ITG *ldz, double *sigma, double *workev, char *bmat, ITG *neq, char *which, ITG *nev, double *tol, double *resid, ITG *ncv, double *v, ITG *ldv, ITG *iparam, ITG *ipntr, double *workd, double *workl, ITG *lworkl, double *rwork, ITG *info))
 

Macro Definition Documentation

◆ DMEMSET

#define DMEMSET (   a,
  b,
  c,
 
)    for(im=b;im<c;im++)a[im]=d

◆ HP

#define HP   4

◆ IRIX

#define IRIX   2

◆ IRIX64

#define IRIX64   3

◆ ITG

#define ITG   int

◆ ITGFORMAT

#define ITGFORMAT   "d"

◆ Linux

#define Linux   1

◆ NNEW

#define NNEW (   a,
  b,
 
)    a=(b *)u_calloc((c),sizeof(b),__FILE__,__LINE__,#a)

◆ RENEW

#define RENEW (   a,
  b,
 
)    a=(b *)u_realloc((b *)(a),(c)*sizeof(b),__FILE__,__LINE__,#a)

◆ SFREE

#define SFREE (   a)    u_free(a,__FILE__,__LINE__,#a)

Function Documentation

◆ arpack()

void arpack ( double *  co,
ITG nk,
ITG **  konp,
ITG **  ipkonp,
char **  lakonp,
ITG ne,
ITG nodeboun,
ITG ndirboun,
double *  xboun,
ITG nboun,
ITG ipompc,
ITG nodempc,
double *  coefmpc,
char *  labmpc,
ITG nmpc,
ITG nodeforc,
ITG ndirforc,
double *  xforc,
ITG nforc,
ITG nelemload,
char *  sideload,
double *  xload,
ITG nload,
ITG nactdof,
ITG icol,
ITG jq,
ITG **  irowp,
ITG neq,
ITG nzl,
ITG nmethod,
ITG ikmpc,
ITG ilmpc,
ITG ikboun,
ITG ilboun,
double *  elcon,
ITG nelcon,
double *  rhcon,
ITG nrhcon,
double *  shcon,
ITG nshcon,
double *  cocon,
ITG ncocon,
double *  alcon,
ITG nalcon,
double *  alzero,
ITG **  ielmatp,
ITG **  ielorienp,
ITG norien,
double *  orab,
ITG ntmat_,
double *  t0,
double *  t1,
double *  t1old,
ITG ithermal,
double *  prestr,
ITG iprestr,
double *  vold,
ITG iperturb,
double *  sti,
ITG nzs,
ITG kode,
ITG mei,
double *  fei,
char *  filab,
double *  eme,
ITG iexpl,
double *  plicon,
ITG nplicon,
double *  plkcon,
ITG nplkcon,
double **  xstatep,
ITG npmat_,
char *  matname,
ITG mi,
ITG ncmat_,
ITG nstate_,
double **  enerp,
char *  jobnamec,
char *  output,
char *  set,
ITG nset,
ITG istartset,
ITG iendset,
ITG ialset,
ITG nprint,
char *  prlab,
char *  prset,
ITG nener,
ITG isolver,
double *  trab,
ITG inotr,
ITG ntrans,
double *  ttime,
double *  fmpc,
char *  cbody,
ITG ibody,
double *  xbody,
ITG nbody,
double *  thicke,
ITG nslavs,
double *  tietol,
ITG nkon,
ITG mpcinfo,
ITG ntie,
ITG istep,
ITG mcs,
ITG ics,
char *  tieset,
double *  cs,
ITG nintpoint,
ITG mortar,
ITG ifacecount,
ITG **  islavsurfp,
double **  pslavsurfp,
double **  clearinip,
ITG nmat,
char *  typeboun,
ITG ielprop,
double *  prop,
char *  orname 
)

◆ arpackbu()

void arpackbu ( double *  co,
ITG nk,
ITG kon,
ITG ipkon,
char *  lakon,
ITG ne,
ITG nodeboun,
ITG ndirboun,
double *  xboun,
ITG nboun,
ITG ipompc,
ITG nodempc,
double *  coefmpc,
char *  labmpc,
ITG nmpc,
ITG nodeforc,
ITG ndirforc,
double *  xforc,
ITG nforc,
ITG nelemload,
char *  sideload,
double *  xload,
ITG nload,
ITG nactdof,
ITG icol,
ITG jq,
ITG irow,
ITG neq,
ITG nzl,
ITG nmethod,
ITG ikmpc,
ITG ilmpc,
ITG ikboun,
ITG ilboun,
double *  elcon,
ITG nelcon,
double *  rhcon,
ITG nrhcon,
double *  alcon,
ITG nalcon,
double *  alzero,
ITG ielmat,
ITG ielorien,
ITG norien,
double *  orab,
ITG ntmat_,
double *  t0,
double *  t1,
double *  t1old,
ITG ithermal,
double *  prestr,
ITG iprestr,
double *  vold,
ITG iperturb,
double *  sti,
ITG nzs,
ITG kode,
ITG mei,
double *  fei,
char *  filab,
double *  eme,
ITG iexpl,
double *  plicon,
ITG nplicon,
double *  plkcon,
ITG nplkcon,
double *  xstate,
ITG npmat_,
char *  matname,
ITG mi,
ITG ncmat_,
ITG nstate_,
double *  ener,
char *  output,
char *  set,
ITG nset,
ITG istartset,
ITG iendset,
ITG ialset,
ITG nprint,
char *  prlab,
char *  prset,
ITG nener,
ITG isolver,
double *  trab,
ITG inotr,
ITG ntrans,
double *  ttime,
double *  fmpc,
char *  cbody,
ITG ibody,
double *  xbody,
ITG nbody,
double *  thicke,
char *  jobnamec,
ITG nmat,
ITG ielprop,
double *  prop,
char *  orname 
)

◆ arpackcs()

void arpackcs ( double *  co,
ITG nk,
ITG **  konp,
ITG **  ipkonp,
char **  lakonp,
ITG ne,
ITG nodeboun,
ITG ndirboun,
double *  xboun,
ITG nboun,
ITG ipompc,
ITG nodempc,
double *  coefmpc,
char *  labmpc,
ITG nmpc,
ITG nodeforc,
ITG ndirforc,
double *  xforc,
ITG nforc,
ITG nelemload,
char *  sideload,
double *  xload,
ITG nload,
ITG nactdof,
ITG icol,
ITG jq,
ITG **  irowp,
ITG neq,
ITG nzl,
ITG nmethod,
ITG ikmpc,
ITG ilmpc,
ITG ikboun,
ITG ilboun,
double *  elcon,
ITG nelcon,
double *  rhcon,
ITG nrhcon,
double *  alcon,
ITG nalcon,
double *  alzero,
ITG **  ielmatp,
ITG **  ielorienp,
ITG norien,
double *  orab,
ITG ntmat_,
double *  t0,
double *  t1,
double *  t1old,
ITG ithermal,
double *  prestr,
ITG iprestr,
double *  vold,
ITG iperturb,
double *  sti,
ITG nzs,
ITG kode,
ITG mei,
double *  fei,
char *  filab,
double *  eme,
ITG iexpl,
double *  plicon,
ITG nplicon,
double *  plkcon,
ITG nplkcon,
double **  xstatep,
ITG npmat_,
char *  matname,
ITG mi,
ITG ics,
double *  cs,
ITG mpcend,
ITG ncmat_,
ITG nstate_,
ITG mcs,
ITG nkon,
double **  enerp,
char *  jobnamec,
char *  output,
char *  set,
ITG nset,
ITG istartset,
ITG iendset,
ITG ialset,
ITG nprint,
char *  prlab,
char *  prset,
ITG nener,
ITG isolver,
double *  trab,
ITG inotr,
ITG ntrans,
double *  ttime,
double *  fmpc,
char *  cbody,
ITG ibody,
double *  xbody,
ITG nbody,
ITG nevtot,
double *  thicke,
ITG nslavs,
double *  tietol,
ITG mpcinfo,
ITG ntie,
ITG istep,
char *  tieset,
ITG nintpoint,
ITG mortar,
ITG ifacecount,
ITG **  islavsurfp,
double **  pslavsurfp,
double **  clearinip,
ITG nmat,
char *  typeboun,
ITG ielprop,
double *  prop,
char *  orname 
)

◆ biosav()

void biosav ( ITG ipkon,
ITG kon,
char *  lakon,
ITG ne,
double *  co,
double *  qfx,
double *  h0,
ITG mi,
ITG inomat,
ITG nk 
)
32  {
33 
34  ITG i,j,*ithread=NULL,nkphi,idelta,isum;
35 
36  /* calculates the magnetic intensity due to currents in the phi-
37  domain of an electromagnetic calculation */
38 
39  /* variables for multithreading procedure */
40 
41  ITG sys_cpus;
42  char *env,*envloc,*envsys;
43 
44  num_cpus = 0;
45  sys_cpus=0;
46 
47  /* explicit user declaration prevails */
48 
49  envsys=getenv("NUMBER_OF_CPUS");
50  if(envsys){
51  sys_cpus=atoi(envsys);
52  if(sys_cpus<0) sys_cpus=0;
53  }
54 
55  /* automatic detection of available number of processors */
56 
57  if(sys_cpus==0){
58  sys_cpus = getSystemCPUs();
59  if(sys_cpus<1) sys_cpus=1;
60  }
61 
62  /* local declaration prevails, if strictly positive */
63 
64  envloc = getenv("CCX_NPROC_BIOTSAVART");
65  if(envloc){
66  num_cpus=atoi(envloc);
67  if(num_cpus<0){
68  num_cpus=0;
69  }else if(num_cpus>sys_cpus){
70  num_cpus=sys_cpus;
71  }
72  }
73 
74  /* else global declaration, if any, applies */
75 
76  env = getenv("OMP_NUM_THREADS");
77  if(num_cpus==0){
78  if (env)
79  num_cpus = atoi(env);
80  if (num_cpus < 1) {
81  num_cpus=1;
82  }else if(num_cpus>sys_cpus){
83  num_cpus=sys_cpus;
84  }
85  }
86 
87  /* determining the nodal bounds in each thread */
88 
91 
92  /* n1 is the number of nodes in the phi(magnetostatic)-domain in
93  an electromagnetic calculation */
94 
95  nkphi=0;
96  for(i=0;i<*nk;i++){
97  if(inomat[i]==1) nkphi++;
98  }
99  if(nkphi<num_cpus) num_cpus=nkphi;
100 
101  idelta=nkphi/num_cpus;
102 
103  /* dividing the range from 1 to the number of phi-nodes */
104 
105  isum=0;
106  for(i=0;i<num_cpus;i++){
107  nkapar[i]=isum;
108  if(i!=num_cpus-1){
109  isum+=idelta;
110  }else{
111  isum=nkphi;
112  }
113  nkepar[i]=isum-1;
114  }
115 
116  /* translating the bounds of the ranges to real node numbers */
117 
118 // i=0;
119  i=-1;
120  j=0;
121  nkphi=-1;
122 
123  do{
124  if(j==num_cpus) break;
125  do{
126  if(nkapar[j]==nkphi){
127  nkapar[j]=i;
128  break;
129  }else{
130  do{
131  i++;
132  if(inomat[i]==1){
133  nkphi++;
134  break;
135  }
136  }while(1);
137  }
138  }while(1);
139 
140  do{
141  if(nkepar[j]==nkphi){
142  nkepar[j]=i;
143  j++;
144  break;
145  }else{
146  do{
147  i++;
148  if(inomat[i]==1){
149  nkphi++;
150  break;
151  }
152  }while(1);
153  }
154  }while(1);
155  }while(1);
156 
157  ipkon1=ipkon;kon1=kon;lakon1=lakon;ne1=ne;co1=co;qfx1=qfx;
158  h01=h0;mi1=mi;
159 
160  printf(" Using up to %" ITGFORMAT " cpu(s) for the Biot-Savart calculation.\n\n", num_cpus);
161 
162  /* create threads and wait */
163 
164  pthread_t tid[num_cpus];
165 
166  NNEW(ithread,ITG,num_cpus);
167  for(i=0;i<num_cpus;i++){
168  ithread[i]=i;
169  pthread_create(&tid[i],NULL,(void *)biotsavartmt,(void *)&ithread[i]);
170  }
171  for(i=0;i<num_cpus;i++)pthread_join(tid[i], NULL);
172 
173  SFREE(ithread);SFREE(nkapar);SFREE(nkepar);
174 
175  return;
176 
177 }
#define ITGFORMAT
Definition: CalculiX.h:52
int pthread_create(pthread_t *thread_id, const pthread_attr_t *attributes, void *(*thread_function)(void *), void *arguments)
static ITG num_cpus
Definition: biosav.c:27
static ITG * ne1
Definition: biosav.c:27
static char * lakon1
Definition: biosav.c:25
static ITG * mi1
Definition: biosav.c:27
void * biotsavartmt(ITG *i)
Definition: biosav.c:181
static ITG * ipkon1
Definition: biosav.c:27
ITG getSystemCPUs()
Definition: getSystemCPUs.c:40
static double * qfx1
Definition: biosav.c:29
static double * co1
Definition: biosav.c:29
static ITG * nkapar
Definition: biosav.c:27
#define SFREE(a)
Definition: CalculiX.h:41
int pthread_join(pthread_t thread, void **status_ptr)
#define ITG
Definition: CalculiX.h:51
static ITG * kon1
Definition: biosav.c:27
static ITG * nkepar
Definition: biosav.c:27
#define NNEW(a, b, c)
Definition: CalculiX.h:39
static double * h01
Definition: biosav.c:29

◆ biotsavartmt()

void* biotsavartmt ( ITG i)
181  {
182 
183  ITG nka,nkb;
184 
185  nka=nkapar[*i]+1;
186  nkb=nkepar[*i]+1;
187 
189  &nkb));
190 
191  return NULL;
192 }
subroutine biotsavart(ipkon, kon, lakon, ne, co, qfx, h0, mi, nka, nkb)
Definition: biotsavart.f:20
static ITG * ne1
Definition: biosav.c:27
static char * lakon1
Definition: biosav.c:25
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
static ITG * mi1
Definition: biosav.c:27
static ITG * ipkon1
Definition: biosav.c:27
static double * qfx1
Definition: biosav.c:29
static double * co1
Definition: biosav.c:29
static ITG * nkapar
Definition: biosav.c:27
#define ITG
Definition: CalculiX.h:51
static ITG * kon1
Definition: biosav.c:27
static ITG * nkepar
Definition: biosav.c:27
static double * h01
Definition: biosav.c:29

◆ calcresidual()

void calcresidual ( ITG nmethod,
ITG neq,
double *  b,
double *  fext,
double *  f,
ITG iexpl,
ITG nactdof,
double *  aux2,
double *  vold,
double *  vini,
double *  dtime,
double *  accold,
ITG nk,
double *  adb,
double *  aub,
ITG icol,
ITG irow,
ITG nzl,
double *  alpha,
double *  fextini,
double *  fini,
ITG islavnode,
ITG nslavnode,
ITG mortar,
ITG ntie,
double *  f_cm,
double *  f_cs,
ITG mi,
ITG nzs,
ITG nasym,
ITG idamping,
double *  veold,
double *  adc,
double *  auc,
double *  cvini,
double *  cv 
)
40  {
41 
42  ITG j,k,mt=mi[1]+1;
43  double scal1;
44 
45  /* residual for a static analysis */
46 
47  if(*nmethod!=4){
48  for(k=0;k<neq[1];++k){
49  b[k]=fext[k]-f[k];
50  }
51  }
52 
53  /* residual for implicit dynamics */
54 
55  else if(*iexpl<=1){
56  for(k=0;k<*nk;++k){
57  if(nactdof[mt*k]>0){
58  aux2[nactdof[mt*k]-1]=(vold[mt*k]-vini[mt*k])/(*dtime);}
59  for(j=1;j<mt;++j){
60  if(nactdof[mt*k+j]>0){aux2[nactdof[mt*k+j]-1]=accold[mt*k+j];}
61  }
62  }
63  if(*nasym==0){
64  FORTRAN(op,(&neq[1],aux2,b,adb,aub,jq,irow));
65  }else{
66  FORTRAN(opas,(&neq[1],aux2,b,adb,aub,jq,irow,nzs));
67  }
68  scal1=1.+*alpha;
69  for(k=0;k<neq[0];++k){
70  b[k]=scal1*(fext[k]-f[k])-*alpha*(fextini[k]-fini[k])-b[k];
71  }
72  for(k=neq[0];k<neq[1];++k){
73  b[k]=fext[k]-f[k]-b[k];
74  }
75 
76  /* correction for damping */
77 
78  if(*idamping==1){
79  for(k=0;k<*nk;++k){
80  if(nactdof[mt*k]>0){aux2[nactdof[mt*k]-1]=0.;}
81  for(j=1;j<mt;++j){
82  if(nactdof[mt*k+j]>0){
83  aux2[nactdof[mt*k+j]-1]=veold[mt*k+j];}
84  }
85  }
86  if(*nasym==0){
87  FORTRAN(op,(&neq[1],aux2,cv,adc,auc,jq,irow));
88  }else{
89  FORTRAN(opas,(&neq[1],aux2,cv,adc,auc,jq,irow,nzs));
90  }
91  for(k=0;k<neq[0];++k){
92  b[k]-=scal1*cv[k]-*alpha*cvini[k];
93  }
94  }
95  }
96 
97  /* residual for explicit dynamics */
98 
99  else{
100  for(k=0;k<*nk;++k){
101  if(nactdof[mt*k]>0){
102  aux2[nactdof[mt*k]-1]=(vold[mt*k]-vini[mt*k])/(*dtime);}
103  for(j=1;j<mt;++j){
104  if(nactdof[mt*k+j]>0){aux2[nactdof[mt*k+j]-1]=accold[mt*k+j];}
105  }
106  }
107  scal1=1.+*alpha;
108  for(k=0;k<neq[0];++k){
109  b[k]=scal1*(fext[k]-f[k])-*alpha*(fextini[k]-fini[k])
110  -adb[k]*aux2[k];
111  }
112  for(k=neq[0];k<neq[1];++k){
113  b[k]=fext[k]-f[k]-adb[k]*aux2[k];
114  }
115  }
116 
117  return;
118 }
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
subroutine op(n, x, y, ad, au, jq, irow)
Definition: op.f:26
subroutine opas(n, x, y, ad, au, jq, irow, nzs)
Definition: opas.f:26
#define ITG
Definition: CalculiX.h:51

◆ calcresidual_em()

void calcresidual_em ( ITG nmethod,
ITG neq,
double *  b,
double *  fext,
double *  f,
ITG iexpl,
ITG nactdof,
double *  aux1,
double *  aux2,
double *  vold,
double *  vini,
double *  dtime,
double *  accold,
ITG nk,
double *  adb,
double *  aub,
ITG icol,
ITG irow,
ITG nzl,
double *  alpha,
double *  fextini,
double *  fini,
ITG islavnode,
ITG nslavnode,
ITG mortar,
ITG ntie,
double *  f_cm,
double *  f_cs,
ITG mi,
ITG nzs,
ITG nasym,
ITG ithermal 
)
39  {
40 
41  ITG j,k,mt=mi[1]+1,jstart;
42 
43  /* residual for a static analysis */
44 
45  if(*nmethod!=4){
46  for(k=0;k<neq[1];++k){
47  b[k]=fext[k]-f[k];
48  }
49  }
50 
51  /* residual for implicit dynamics */
52 
53  else{
54 
55  if(*ithermal<2){
56  jstart=1;
57  }else{
58  jstart=0;
59  }
60 
61  /* calculating a pseudo-velocity */
62 
63 /* for(k=0;k<*nk;++k){
64  for(j=jstart;j<mt;++j){
65  if(nactdof[mt*k+j]>0){aux2[nactdof[mt*k+j]-1]=(vold[mt*k+j]-vini[mt*k+j])/(*dtime);}
66  }
67  }*/
68 
69  for(k=0;k<*nk;++k){
70  for(j=jstart;j<1;++j){
71  if(nactdof[mt*k+j]>0){aux2[nactdof[mt*k+j]-1]=(vold[mt*k+j]-vini[mt*k+j])/(*dtime);}
72  }
73  }
74 
75  for(k=0;k<*nk;++k){
76  for(j=1;j<mt;++j){
77  if(nactdof[mt*k+j]>0){aux2[nactdof[mt*k+j]-1]=(-vini[mt*k+j])/(*dtime);}
78  }
79  }
80 
81  /* calculating "capacity"-matrix times pseudo-velocity */
82 
83  if(*nasym==0){
84  FORTRAN(op,(&neq[1],aux2,b,adb,aub,jq,irow));
85  }else{
86  FORTRAN(opas,(&neq[1],aux2,b,adb,aub,jq,irow,nzs));
87  }
88 
89  for(k=0;k<neq[1];++k){
90  b[k]=fext[k]-f[k]-b[k];
91  }
92  }
93 
94  return;
95 }
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
subroutine op(n, x, y, ad, au, jq, irow)
Definition: op.f:26
subroutine opas(n, x, y, ad, au, jq, irow, nzs)
Definition: opas.f:26
#define ITG
Definition: CalculiX.h:51

◆ calcviewmt()

void* calcviewmt ( ITG i)
633  {
634 
635  ITG indexad,indexau,indexdi,ntria,ntrib,nedelta,indexcovered;
636 
637  indexad=*i**ntr1;
638  indexau=*i*2**nzsrad1;
639  indexdi=*i**ntrit1;
640  indexcovered=*i*ng1*ng1;
641 
642  nedelta=(ITG)ceil(*ntri1/(double)num_cpus);
643  ntria=*i*nedelta+1;
644  ntrib=(*i+1)*nedelta;
645  if(ntrib>*ntri1) ntrib=*ntri1;
646 
647 // printf("i=%" ITGFORMAT ",ntria=%" ITGFORMAT ",ntrib=%" ITGFORMAT "\n",i,ntria,ntrib);
648 // printf("indexad=%" ITGFORMAT ",indexau=%" ITGFORMAT ",indexdi=%" ITGFORMAT "\n",indexad,indexau,indexdi);
649 
651  kontri1,nloadtr1,&adview[indexad],
652  &auview[indexau],&dist[indexdi],&idist[indexdi],area1,
653  ntrit1,mi1,jqrad1,irowrad1,nzsrad1,&sidemean1,
654  &ntria,&ntrib,&covered1[indexcovered],&ng1));
655 
656  return NULL;
657 }
static ITG * mi1
Definition: radflowload.c:39
static double * co1
Definition: radflowload.c:42
static ITG ng1
Definition: radflowload.c:39
static double * pmid1
Definition: radflowload.c:42
static ITG * ntri1
Definition: radflowload.c:39
static char * covered1
Definition: radflowload.c:37
static ITG * ntrit1
Definition: radflowload.c:39
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
static ITG * nloadtr1
Definition: radflowload.c:39
static ITG * ntr1
Definition: radflowload.c:39
static double * e31
Definition: radflowload.c:42
static ITG * idist
Definition: radflowload.c:39
static double sidemean1
Definition: radflowload.c:42
static char * sideload1
Definition: radflowload.c:37
static double * dist
Definition: radflowload.c:42
static double * area1
Definition: radflowload.c:42
static double * vold1
Definition: radflowload.c:42
static double * e21
Definition: radflowload.c:42
subroutine calcview(sideload, vold, co, pmid, e1, e2, e3, kontri, nloadtr, adview, auview, dist, idist, area, ntrit, mi, jqrad, irowrad, nzsrad, sidemean, ntria, ntrib, covered, ng)
Definition: calcview.f:30
static double * adview
Definition: radflowload.c:42
static ITG * jqrad1
Definition: radflowload.c:39
static double * e11
Definition: radflowload.c:42
static ITG * nzsrad1
Definition: radflowload.c:39
static ITG * kontri1
Definition: radflowload.c:39
static ITG num_cpus
Definition: radflowload.c:39
#define ITG
Definition: CalculiX.h:51
static ITG * irowrad1
Definition: radflowload.c:39
static double * auview
Definition: radflowload.c:42

◆ cascade()

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,
char *  labmpc,
ITG nk,
ITG memmpc_,
ITG icascade,
ITG maxlenmpc,
ITG callfrommain,
ITG iperturb,
ITG ithermal 
)
38  {
39 
40  /* detects cascaded mpc's and decascades them; checks multiple
41  occurrence of the same dependent DOF's in different mpc/spc's
42 
43  data structure of ipompc,coefmpc,nodempc:
44  for each mpc, e.g. i,
45  -the nodes are stored in nodempc(1,ipompc(i)),
46  nodempc(1,nodempc(3,ipompc(i))),
47  nodempc(1,nodempc(3,nodempc(3,ipompc(i))))... till
48  nodempc(3,nodempc(3,nodempc(3,.......))))))=0;
49  -the corresponding directions in nodempc(2,ipompc(i)),
50  nodempc(2,nodempc(3,ipompc(i))),.....
51  -the corresponding coefficient in coefmpc(ipompc(i)),
52  coefmpc(nodempc(3,ipompc(i))),.....
53  the mpc is written as a(1)u(i1,j1)+a(2)u(i2,j2)+...
54  +....a(k)u(ik,jk)=0, the first term is the dependent term,
55  the others are independent, at least after execution of the
56  present routine. The mpc's must be homogeneous, otherwise a
57  error message is generated and the program stops. */
58 
59  ITG i,j,index,id,idof,nterm,idepend,*nodempc=NULL,
60  ispooles,iexpand,ichange,indexold,ifluidmpc,
61  mpc,indexnew,index1,index2,index1old,index2old,*jmpc=NULL,nl;
62 
63  double coef,*coefmpc=NULL;
64 
65 #ifdef SPOOLES
66 
67  ITG irow,icolumn,node,idir,irownl,icolnl,*ipointer=NULL,*icoef=NULL,
68  ifree,*indepdof=NULL,nindep;
69 
70  double *xcoef=NULL,b;
71 
72  DenseMtx *mtxB, *mtxX ;
73  Chv *rootchv ;
74  ChvManager *chvmanager ;
75  SubMtxManager *mtxmanager ;
76  FrontMtx *frontmtx ;
77  InpMtx *mtxA ;
78  double tau = 100.;
79  double cpus[10] ;
80  ETree *frontETree ;
81  FILE *msgFile ;
82  Graph *graph ;
83  ITG jrhs, msglvl=0, nedges,error,
84  nent, neqns, nrhs, pivotingflag=1, seed=389,
85  symmetryflag=2, type=1,maxdomainsize,maxzeros,maxsize;
86  ITG *oldToNew ;
87  ITG stats[20] ;
88  IV *newToOldIV, *oldToNewIV ;
89  IVL *adjIVL, *symbfacIVL ;
90 #endif
91 
92  nodempc=*nodempcp;
93  coefmpc=*coefmpcp;
94 
95  /* for(i=0;i<*nmpc;i++){
96  j=i+1;
97  FORTRAN(writempc,(ipompc,nodempc,coefmpc,labmpc,&j));
98  }*/
99 
100  NNEW(jmpc,ITG,*nmpc);
101  idepend=0;
102 
103 /* check whether a node is used as a dependent node in a MPC
104  and in a SPC */
105 
106  for(i=0;i<*nmpc;i++){
107  if(*nboun>0){
108  FORTRAN(nident,(ikboun,&ikmpc[i],nboun,&id));}
109  else{id=0;}
110  if(id>0){
111  if(ikboun[id-1]==ikmpc[i]){
112  if(strcmp1(&labmpc[20*i],"FLUID")!=0){
113  printf("*ERROR in cascade: the DOF corresponding to \n node %" ITGFORMAT " in direction %" ITGFORMAT " is detected on the \n dependent side of a MPC and a SPC\n",
114  (ikmpc[i])/8+1,ikmpc[i]-8*((ikmpc[i])/8));
115  }else{
116  printf("*ERROR in cascade: the DOF corresponding to \n face %" ITGFORMAT " in direction %" ITGFORMAT " is detected on the \n dependent side of a MPC and a SPC\n",
117  (-ikmpc[i])/8+1,-ikmpc[i]-8*((-ikmpc[i])/8));
118  }
119  FORTRAN(stop,());
120  }
121  }
122  }
123 
124 /* check whether there are user mpc's: in user MPC's the
125  dependent DOF can change, however, the number of terms
126  cannot change */
127 
128  for(i=0;i<*nmpc;i++){
129 
130  /* linear mpc */
131 
132  /* because of the next line the size of field labmpc
133  has to be defined as 20*nmpc+1: without "+1" an
134  undefined field is accessed */
135 
136  if((strcmp1(&labmpc[20*i]," ")==0) ||
137  (strcmp1(&labmpc[20*i],"CYCLIC")==0) ||
138  (strcmp1(&labmpc[20*i],"SUBCYCLIC")==0)||
139  (strcmp1(&labmpc[20*i],"PRETENSION")==0)||
140  (strcmp1(&labmpc[20*i],"THERMALPRET")==0)||
141 // (strcmp1(&labmpc[20*i],"CONTACT")==0)||
142  (strcmp1(&labmpc[20*i],"FLUID")==0)||
143  (*iperturb<2)) jmpc[i]=0;
144 
145  /* nonlinear mpc */
146 
147  else if((strcmp1(&labmpc[20*i],"RIGID")==0) ||
148  (strcmp1(&labmpc[20*i],"KNOT")==0) ||
149  (strcmp1(&labmpc[20*i],"PLANE")==0) ||
150  (strcmp1(&labmpc[20*i],"BEAM")==0) ||
151  (strcmp1(&labmpc[20*i],"STRAIGHT")==0)) jmpc[i]=1;
152 
153  /* user mpc */
154 
155  else{
156  jmpc[i]=1;
157  if(*icascade==0) *icascade=1;
158  }
159  }
160 
161 /* decascading */
162 
163  ispooles=0;
164 
165  /* decascading using simple substitution */
166 
167  do{
168  ichange=0;
169  for(i=0;i<*nmpc;i++){
170 
171  if(strcmp1(&labmpc[20*i],"FLUID")!=0){
172  ifluidmpc=0;
173  }else{
174  ifluidmpc=1;
175  }
176 
177  if(jmpc[i]==1) nl=1;
178  else nl=0;
179  iexpand=0;
180  index=nodempc[3*ipompc[i]-1];
181  if(index==0) continue;
182  do{
183  if(ifluidmpc==0){
184  /* MPC on node */
185  idof=(nodempc[3*index-3]-1)*8+nodempc[3*index-2];
186  }else{
187  if(nodempc[3*index-3]>0){
188  /* MPC on face */
189  idof=-((nodempc[3*index-3]-1)*8+nodempc[3*index-2]);
190  }else{
191  /* MPC on node
192  SPC number: -nodempc[3*index-3]
193  node: nodeboun[-nodempc[3*index-3]-1] */
194 
195  idof=(nodeboun[-nodempc[3*index-3]-1]-1)*8+nodempc[3*index-2];
196  }
197  }
198 
199  FORTRAN(nident,(ikmpc,&idof,nmpc,&id));
200  if((id>0)&&(ikmpc[id-1]==idof)){
201 
202  /* a term on the independent side of the MPC is
203  detected as dependent node in another MPC */
204 
205  indexold=nodempc[3*index-1];
206  coef=coefmpc[index-1];
207  mpc=ilmpc[id-1];
208 
209  /* no expansion if there is a dependence of a
210  nonlinear MPC on another linear or nonlinear MPC
211  and the call is from main */
212 
213  if((jmpc[mpc-1]==1)||(nl==1)){
214  *icascade=2;
215  if(idepend==0){
216  printf("*INFO in cascade: linear MPCs and\n");
217  printf(" nonlinear MPCs depend on each other\n");
218  printf(" common node: %" ITGFORMAT " in direction %" ITGFORMAT "\n\n",nodempc[3*index-3],nodempc[3*index-2]);
219  idepend=1;}
220  if(*callfrommain==1){
221  index=nodempc[3*index-1];
222  if(index!=0) continue;
223  else break;}
224  }
225 
226 /* printf("*INFO in cascade: DOF %" ITGFORMAT " of node %" ITGFORMAT " is expanded\n",
227  nodempc[3*index-2],nodempc[3*index-3]);*/
228 
229  /* collecting terms corresponding to the same DOF */
230 
231  index1=ipompc[i];
232  do{
233  index2old=index1;
234  index2=nodempc[3*index1-1];
235  if(index2==0) break;
236  do{
237  if((nodempc[3*index1-3]==nodempc[3*index2-3])&&
238  (nodempc[3*index1-2]==nodempc[3*index2-2])){
239  coefmpc[index1-1]+=coefmpc[index2-1];
240  nodempc[3*index2old-1]=nodempc[3*index2-1];
241  nodempc[3*index2-1]=*mpcfree;
242  *mpcfree=index2;
243  index2=nodempc[3*index2old-1];
244  if(index2==0) break;
245  }
246  else{
247  index2old=index2;
248  index2=nodempc[3*index2-1];
249  if(index2==0) break;
250  }
251  }while(1);
252  index1=nodempc[3*index1-1];
253  if(index1==0) break;
254  }while(1);
255 
256  /* check for zero coefficients on the dependent side */
257 
258  index1=ipompc[i];
259  if(fabs(coefmpc[index1-1])<1.e-10){
260  printf("*ERROR in cascade: zero coefficient on the\n");
261  printf(" dependent side of an equation\n");
262  printf(" dependent node: %" ITGFORMAT "",nodempc[3*index1-3]);
263  printf(" direction: %" ITGFORMAT "",nodempc[3*index1-2]);
264  FORTRAN(stop,());
265  }
266 
267  ichange=1;iexpand=1;
268  if((strcmp1(&labmpc[20*i]," ")==0)&&
269  (strcmp1(&labmpc[20*(mpc-1)],"CYCLIC")==0))
270  strcpy1(&labmpc[20*i],"SUBCYCLIC",9);
271  indexnew=ipompc[mpc-1];
272  coef=-coef/coefmpc[indexnew-1];
273  indexnew=nodempc[3*indexnew-1];
274  if(indexnew!=0){
275  do{
276  coefmpc[index-1]=coef*coefmpc[indexnew-1];
277  nodempc[3*index-3]=nodempc[3*indexnew-3];
278  nodempc[3*index-2]=nodempc[3*indexnew-2];
279  indexnew=nodempc[3*indexnew-1];
280  if(indexnew!=0){
281  nodempc[3*index-1]=*mpcfree;
282  index=*mpcfree;
283  *mpcfree=nodempc[3**mpcfree-1];
284  if(*mpcfree==0){
285  *mpcfree=*memmpc_+1;
286  nodempc[3*index-1]=*mpcfree;
287  *memmpc_=(ITG)(1.1**memmpc_);
288  printf("*INFO in cascade: reallocating nodempc; new size = %" ITGFORMAT "\n\n",*memmpc_);
289  RENEW(nodempc,ITG,3**memmpc_);
290  RENEW(coefmpc,double,*memmpc_);
291  for(j=*mpcfree;j<*memmpc_;j++){
292  nodempc[3*j-1]=j+1;
293  }
294  nodempc[3**memmpc_-1]=0;
295  }
296  continue;
297  }
298  else{
299  nodempc[3*index-1]=indexold;
300  break;
301  }
302  }while(1);
303  }else{
304  coefmpc[index-1]=0.;
305  }
306  break;
307  }
308  else{
309  index=nodempc[3*index-1];
310  if(index!=0) continue;
311  else break;
312  }
313  }while(1);
314  if(iexpand==0) continue;
315 
316  /* one term of the mpc was expanded
317  collecting terms corresponding to the same DOF */
318 
319  index1=ipompc[i];
320  do{
321  index2old=index1;
322  index2=nodempc[3*index1-1];
323  if(index2==0) break;
324  do{
325  if((nodempc[3*index1-3]==nodempc[3*index2-3])&&
326  (nodempc[3*index1-2]==nodempc[3*index2-2])){
327  coefmpc[index1-1]+=coefmpc[index2-1];
328  nodempc[3*index2old-1]=nodempc[3*index2-1];
329  nodempc[3*index2-1]=*mpcfree;
330  *mpcfree=index2;
331  index2=nodempc[3*index2old-1];
332  if(index2==0) break;
333  }
334  else{
335  index2old=index2;
336  index2=nodempc[3*index2-1];
337  if(index2==0) break;
338  }
339  }while(1);
340  index1=nodempc[3*index1-1];
341  if(index1==0) break;
342  }while(1);
343 
344  /* check for zero coefficients on the dependent and
345  independent side */
346 
347  index1=ipompc[i];
348  index1old=0;
349  do {
350  if(fabs(coefmpc[index1-1])<1.e-10){
351  if(index1old==0){
352  printf("*ERROR in cascade: zero coefficient on the\n");
353  printf(" dependent side of an equation\n");
354  printf(" dependent node: %" ITGFORMAT "",nodempc[3*index1-3]);
355  printf(" direction: %" ITGFORMAT "",nodempc[3*index1-2]);
356  FORTRAN(stop,());
357  }
358  else{
359  nodempc[3*index1old-1]=nodempc[3*index1-1];
360  nodempc[3*index1-1]=*mpcfree;
361  *mpcfree=index1;
362  index1=nodempc[3*index1old-1];
363  }
364  }
365  else{
366  index1old=index1;
367  index1=nodempc[3*index1-1];
368  }
369  if(index1==0) break;
370  }while(1);
371  }
372  if(ichange==0) break;
373  }while(1);
374 
375  /* decascading using spooles */
376 
377 #ifdef SPOOLES
378  if((*icascade==1)&&(ispooles==1)){
379  if ( (msgFile = fopen("spooles.out", "a")) == NULL ) {
380  fprintf(stderr, "\n fatal error in spooles.c"
381  "\n unable to open file spooles.out\n") ;
382  }
383  NNEW(ipointer,ITG,7**nk);
384  NNEW(indepdof,ITG,7**nk);
385  NNEW(icoef,ITG,2**memmpc_);
386  NNEW(xcoef,double,*memmpc_);
387  ifree=0;
388  nindep=0;
389 
390  for(i=*nmpc-1;i>-1;i--){
391  index=ipompc[i];
392  while(1){
393  idof=8*(nodempc[3*index-3]-1)+nodempc[3*index-2]-1;
394 
395 /* check whether idof is a independent dof which has not yet been
396  stored in indepdof */
397 
398  FORTRAN(nident,(ikmpc,&idof,nmpc,&id));
399  if((id==0)||(ikmpc[id-1]!=idof)){
400  FORTRAN(nident,(indepdof,&idof,&nindep,&id));
401  if((id==0)||(indepdof[id-1]!=idof)){
402  for(j=nindep;j>id;j--){
403  indepdof[j]=indepdof[j-1];
404  }
405  indepdof[id]=idof;
406  nindep++;
407  }
408  }
409 
410  icoef[2*ifree]=i+1;
411  icoef[2*ifree+1]=ipointer[idof];
412  xcoef[ifree]=coefmpc[index-1];
413  ipointer[idof]=++ifree;
414  index=nodempc[3*index-1];
415  if(index==0) break;
416  }
417  }
418 
419 /* filling the left hand side */
420 
421  nent=*memmpc_;
422  neqns=*nmpc;
423  mtxA = InpMtx_new() ;
424  InpMtx_init(mtxA, INPMTX_BY_ROWS, type, nent, neqns) ;
425 
426  for(i=0;i<*nmpc;i++){
427  idof=ikmpc[i];
428  icolumn=ilmpc[i]-1;
429  if(strcmp1(&labmpc[20*icolumn],"RIGID")==0) icolnl=1;
430  else icolnl=0;
431  index=ipointer[idof-1];
432  while(1){
433  irow=icoef[2*index-2]-1;
434  if(irow!=icolumn){
435  if(strcmp1(&labmpc[20*irow],"RIGID")==0)irownl=1;
436  else irownl=0;
437  if((irownl==1)||(icolnl==1)){
438  *icascade=2;
439  InpMtx_free(mtxA);
440  printf("*ERROR in cascade: linear and nonlinear MPCs depend on each other");
441  FORTRAN(stop,());
442  }
443  }
444  if((strcmp1(&labmpc[20*irow]," ")==0)&&
445  (strcmp1(&labmpc[20*icolumn],"CYCLIC")==0)){
446  strcpy1(&labmpc[20*irow],"SUBCYCLIC",9);}
447  coef=xcoef[index-1];
448  InpMtx_inputRealEntry(mtxA,irow,icolumn,coef);
449  index=icoef[2*index-1];
450  if(index==0) break;
451  }
452  ipointer[idof-1]=0;
453  }
454 
455  InpMtx_changeStorageMode(mtxA, INPMTX_BY_VECTORS) ;
456  if ( msglvl > 1 ) {
457  fprintf(msgFile, "\n\n input matrix") ;
458  InpMtx_writeForHumanEye(mtxA, msgFile) ;
459  fflush(msgFile) ;
460  }
461 /*--------------------------------------------------------------------*/
462 /*
463  -------------------------------------------------
464  STEP 2 : find a low-fill ordering
465  (1) create the Graph object
466  (2) order the graph using multiple minimum degree
467  -------------------------------------------------
468 */
469  graph = Graph_new() ;
470  adjIVL = InpMtx_fullAdjacency(mtxA) ;
471  nedges = IVL_tsize(adjIVL) ;
472  Graph_init2(graph, 0, neqns, 0, nedges, neqns, nedges, adjIVL,
473  NULL, NULL) ;
474  if ( msglvl > 1 ) {
475  fprintf(msgFile, "\n\n graph of the input matrix") ;
476  Graph_writeForHumanEye(graph, msgFile) ;
477  fflush(msgFile) ;
478  }
479  maxdomainsize=800;maxzeros=1000;maxsize=64;
480  /*maxdomainsize=neqns/100;*/
481  /*frontETree = orderViaMMD(graph, seed, msglvl, msgFile) ;*/
482  /*frontETree = orderViaND(graph,maxdomainsize,seed,msglvl,msgFile); */
483  /*frontETree = orderViaMS(graph,maxdomainsize,seed,msglvl,msgFile);*/
484  frontETree=orderViaBestOfNDandMS(graph,maxdomainsize,maxzeros,
485  maxsize,seed,msglvl,msgFile);
486  if ( msglvl > 1 ) {
487  fprintf(msgFile, "\n\n front tree from ordering") ;
488  ETree_writeForHumanEye(frontETree, msgFile) ;
489  fflush(msgFile) ;
490  }
491 /*--------------------------------------------------------------------*/
492 /*
493  -----------------------------------------------------
494  STEP 3: get the permutation, permute the matrix and
495  front tree and get the symbolic factorization
496  -----------------------------------------------------
497 */
498  oldToNewIV = ETree_oldToNewVtxPerm(frontETree) ;
499  oldToNew = IV_entries(oldToNewIV) ;
500  newToOldIV = ETree_newToOldVtxPerm(frontETree) ;
501  ETree_permuteVertices(frontETree, oldToNewIV) ;
502  InpMtx_permute(mtxA, oldToNew, oldToNew) ;
503 /* InpMtx_mapToUpperTriangle(mtxA) ;*/
504  InpMtx_changeCoordType(mtxA,INPMTX_BY_CHEVRONS);
505  InpMtx_changeStorageMode(mtxA,INPMTX_BY_VECTORS);
506  symbfacIVL = SymbFac_initFromInpMtx(frontETree, mtxA) ;
507  if ( msglvl > 1 ) {
508  fprintf(msgFile, "\n\n old-to-new permutation vector") ;
509  IV_writeForHumanEye(oldToNewIV, msgFile) ;
510  fprintf(msgFile, "\n\n new-to-old permutation vector") ;
511  IV_writeForHumanEye(newToOldIV, msgFile) ;
512  fprintf(msgFile, "\n\n front tree after permutation") ;
513  ETree_writeForHumanEye(frontETree, msgFile) ;
514  fprintf(msgFile, "\n\n input matrix after permutation") ;
515  InpMtx_writeForHumanEye(mtxA, msgFile) ;
516  fprintf(msgFile, "\n\n symbolic factorization") ;
517  IVL_writeForHumanEye(symbfacIVL, msgFile) ;
518  fflush(msgFile) ;
519  }
520 /*--------------------------------------------------------------------*/
521 /*
522  ------------------------------------------
523  STEP 4: initialize the front matrix object
524  ------------------------------------------
525 */
526  frontmtx = FrontMtx_new() ;
527  mtxmanager = SubMtxManager_new() ;
528  SubMtxManager_init(mtxmanager, NO_LOCK, 0) ;
529  FrontMtx_init(frontmtx, frontETree, symbfacIVL, type, symmetryflag,
530  FRONTMTX_DENSE_FRONTS, pivotingflag, NO_LOCK, 0, NULL,
531  mtxmanager, msglvl, msgFile) ;
532 /*--------------------------------------------------------------------*/
533 /*
534  -----------------------------------------
535  STEP 5: compute the numeric factorization
536  -----------------------------------------
537 */
538  chvmanager = ChvManager_new() ;
539  ChvManager_init(chvmanager, NO_LOCK, 1) ;
540  DVfill(10, cpus, 0.0) ;
541  IVfill(20, stats, 0) ;
542  rootchv = FrontMtx_factorInpMtx(frontmtx, mtxA, tau, 0.0, chvmanager,
543  &error,cpus, stats, msglvl, msgFile) ;
544  ChvManager_free(chvmanager) ;
545  if ( msglvl > 1 ) {
546  fprintf(msgFile, "\n\n factor matrix") ;
547  FrontMtx_writeForHumanEye(frontmtx, msgFile) ;
548  fflush(msgFile) ;
549  }
550  if ( rootchv != NULL ) {
551  fprintf(msgFile, "\n\n matrix found to be singular\n") ;
552  exit(-1) ;
553  }
554  if(error>=0){
555  fprintf(msgFile,"\n\nerror encountered at front %" ITGFORMAT "",error);
556  exit(-1);
557  }
558 /*--------------------------------------------------------------------*/
559 /*
560  --------------------------------------
561  STEP 6: post-process the factorization
562  --------------------------------------
563 */
564  FrontMtx_postProcess(frontmtx, msglvl, msgFile) ;
565  if ( msglvl > 1 ) {
566  fprintf(msgFile, "\n\n factor matrix after post-processing") ;
567  FrontMtx_writeForHumanEye(frontmtx, msgFile) ;
568  fflush(msgFile) ;
569  }
570 
571 /* reinitialize nodempc */
572 
573  *mpcfree=1;
574  for(j=0;j<*nmpc;j++){
575  ipompc[j]=0;}
576 
577 /* filling the RHS */
578 
579  jrhs=0;
580  nrhs=1;
581  mtxB=DenseMtx_new();
582  mtxX=DenseMtx_new();
583 
584  for(i=nindep;i>0;i--){
585  idof=indepdof[i-1];
586  if(ipointer[idof]>0){
587 
588 /* new RHS column */
589 
590  DenseMtx_init(mtxB, type, 0, 0, neqns, nrhs, 1, neqns) ;
591  DenseMtx_zero(mtxB) ;
592 
593  index=ipointer[idof];
594  while(1){
595  irow=icoef[2*index-2]-1;
596  coef=xcoef[index-1];
597  DenseMtx_setRealEntry(mtxB,irow,jrhs,coef);
598  index=icoef[2*index-1];
599  if(index==0) break;
600  }
601 
602  if ( msglvl > 1 ) {
603  fprintf(msgFile, "\n\n rhs matrix in original ordering") ;
604  DenseMtx_writeForHumanEye(mtxB, msgFile) ;
605  fflush(msgFile) ;
606  }
607 
608 /*--------------------------------------------------------------------*/
609 /*
610  ---------------------------------------------------------
611  STEP 8: permute the right hand side into the new ordering
612  ---------------------------------------------------------
613 */
614  DenseMtx_permuteRows(mtxB, oldToNewIV) ;
615  if ( msglvl > 1 ) {
616  fprintf(msgFile, "\n\n right hand side matrix in new ordering") ;
617  DenseMtx_writeForHumanEye(mtxB, msgFile) ;
618  fflush(msgFile) ;
619  }
620 /*--------------------------------------------------------------------*/
621 /*
622  -------------------------------
623  STEP 9: solve the linear system
624  -------------------------------
625 */
626  DenseMtx_init(mtxX, type, 0, 0, neqns, nrhs, 1, neqns) ;
627  DenseMtx_zero(mtxX) ;
628  FrontMtx_solve(frontmtx, mtxX, mtxB, mtxmanager,cpus, msglvl, msgFile) ;
629  if ( msglvl > 1 ) {
630  fprintf(msgFile, "\n\n solution matrix in new ordering") ;
631  DenseMtx_writeForHumanEye(mtxX, msgFile) ;
632  fflush(msgFile) ;
633  }
634 /*--------------------------------------------------------------------*/
635 /*
636  --------------------------------------------------------
637  STEP 10: permute the solution into the original ordering
638  --------------------------------------------------------
639 */
640  DenseMtx_permuteRows(mtxX, newToOldIV) ;
641  if ( msglvl > 1 ) {
642  fprintf(msgFile, "\n\n solution matrix in original ordering") ;
643  DenseMtx_writeForHumanEye(mtxX, msgFile) ;
644  fflush(msgFile) ;
645  }
646 
647 
648  for(j=0;j<*nmpc;j++){
649  b=DenseMtx_entries(mtxX)[j];
650  if(fabs(b)>1.e-10){
651  nodempc[3**mpcfree-1]=ipompc[j];
652  node=(ITG)((idof+8)/8);
653  idir=idof+1-8*(node-1);
654  nodempc[3**mpcfree-3]=node;
655  nodempc[3**mpcfree-2]=idir;
656  coefmpc[*mpcfree-1]=b;
657  ipompc[j]=(*mpcfree)++;
658  if(*mpcfree>*memmpc_){
659  *memmpc_=(ITG)(1.1**memmpc_);
660  RENEW(nodempc,ITG,3**memmpc_);
661  RENEW(coefmpc,double,*memmpc_);
662  }
663  }
664  }
665  }
666  }
667 /*--------------------------------------------------------------------*/
668 /*
669  -----------
670  free memory
671  -----------
672 */
673  FrontMtx_free(frontmtx) ;
674  DenseMtx_free(mtxB) ;
675  DenseMtx_free(mtxX) ;
676  IV_free(newToOldIV) ;
677  IV_free(oldToNewIV) ;
678  InpMtx_free(mtxA) ;
679  ETree_free(frontETree) ;
680  IVL_free(symbfacIVL) ;
681  SubMtxManager_free(mtxmanager) ;
682  Graph_free(graph) ;
683 
684 /* diagonal terms */
685 
686  for(i=0;i<*nmpc;i++){
687  j=ilmpc[i]-1;
688  idof=ikmpc[i];
689  node=(ITG)((idof+7)/8);
690  idir=idof-8*(node-1);
691  nodempc[3**mpcfree-1]=ipompc[j];
692  nodempc[3**mpcfree-3]=node;
693  nodempc[3**mpcfree-2]=idir;
694  coefmpc[*mpcfree-1]=1.;
695  ipompc[j]=(*mpcfree)++;
696  if(*mpcfree>*memmpc_){
697  *memmpc_=(ITG)(1.1**memmpc_);
698  RENEW(nodempc,ITG,3**memmpc_);
699  RENEW(coefmpc,double,*memmpc_);
700  }
701  }
702 
703  SFREE(ipointer);SFREE(indepdof);SFREE(icoef);SFREE(xcoef);
704 
705  fclose(msgFile);
706 
707  }
708 #endif
709 
710 /* determining the effective size of nodempc and coefmpc for
711  the reallocation*/
712 
713  *mpcend=0;
714  *maxlenmpc=0;
715  for(i=0;i<*nmpc;i++){
716  index=ipompc[i];
717  *mpcend=max(*mpcend,index);
718  nterm=1;
719  while(1){
720  index=nodempc[3*index-1];
721  if(index==0){
722  *maxlenmpc=max(*maxlenmpc,nterm);
723  break;
724  }
725  *mpcend=max(*mpcend,index);
726  nterm++;
727  }
728  }
729 
730  SFREE(jmpc);
731 
732  *nodempcp=nodempc;
733  *coefmpcp=coefmpc;
734 
735  /* for(i=0;i<*nmpc;i++){
736  j=i+1;
737  FORTRAN(writempc,(ipompc,nodempc,coefmpc,labmpc,&j));
738  }*/
739 
740  return;
741 }
#define ITGFORMAT
Definition: CalculiX.h:52
#define max(a, b)
Definition: cascade.c:32
ITG strcpy1(char *s1, const char *s2, ITG length)
Definition: strcpy1.c:24
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
ITG strcmp1(const char *s1, const char *s2)
Definition: strcmp1.c:24
subroutine stop()
Definition: stop.f:20
void tau(double *ad, double **aup, double *adb, double *aubp, double *sigma, double *b, ITG *icol, ITG **irowp, ITG *neq, ITG *nzs)
#define RENEW(a, b, c)
Definition: CalculiX.h:40
#define SFREE(a)
Definition: CalculiX.h:41
subroutine nident(x, px, n, id)
Definition: nident.f:26
#define ITG
Definition: CalculiX.h:51
#define NNEW(a, b, c)
Definition: CalculiX.h:39

◆ CEE()

void CEE ( ddotc  ,
(ITG *n, double *dx, ITG *incx, double *dy, ITG *incy, double *funcddot)   
)

◆ cgsolver()

ITG cgsolver ( double *  A,
double *  x,
double *  b,
ITG  neq,
ITG  len,
ITG ia,
ITG iz,
double *  eps,
ITG niter,
ITG  precFlg 
)
73 {
74  ITG i=0;
75  double *Factor=NULL,*r=NULL,*p=NULL,*z=NULL,*C=NULL,*g=NULL,*rho=NULL;
76 
77  /* reduce row and column indices by 1 (FORTRAN->C) */
78 
79  for (i=0; i<neq; i++) --iz[i];
80  for (i=0; i<len; i++) --ia[i];
81 
82  /* Scaling the equation system A x + b = 0 */
83 
84  NNEW(Factor,double,neq);
85  Scaling(A,b,neq,ia,iz,Factor);
86 
87  /* SOLVER/PRECONDITIONING TYPE */
88 
89  /* Conjugate gradient solver without preconditioning */
90 
91  if (!precFlg)
92  {
93  NNEW(r,double,neq);
94  NNEW(p,double,neq);
95  NNEW(z,double,neq);
96  CG(A,x,b,neq,len,ia,iz,eps,niter,r,p,z);
97  SFREE(r);SFREE(p);SFREE(z);
98  }
99 
100  /* Conjugate gradient solver with incomplete Cholesky preconditioning on
101  full matrix */
102 
103  else if (precFlg==3)
104  {
105  NNEW(rho,double,neq);
106  NNEW(r,double,neq);
107  NNEW(g,double,neq);
108  NNEW(C,double,len);
109  NNEW(z,double,neq);
110  PCG(A,x,b,neq,len,ia,iz,eps,niter,precFlg,rho,r,g,C,z);
111  SFREE(rho);SFREE(r);SFREE(g);SFREE(C);SFREE(z);
112  }
113 
114  /* Backscaling of the solution vector */
115 
116  for (i=0; i<neq; i++) x[i] *= Factor[i];
117 
118  /* That's it */
119 
120  SFREE(Factor);
121  return GOOD;
122 }
#define GOOD
Definition: pcgsolver.c:25
void CG(double *A, double *x, double *b, ITG neq, ITG len, ITG *ia, ITG *iz, double *eps, ITG *niter, double *r, double *p, double *z)
Definition: pcgsolver.c:504
void Scaling(double *A, double *b, ITG neq, ITG *ia, ITG *iz, double *d)
Definition: pcgsolver.c:281
#define SFREE(a)
Definition: CalculiX.h:41
#define ITG
Definition: CalculiX.h:51
#define NNEW(a, b, c)
Definition: CalculiX.h:39
void PCG(double *A, double *x, double *b, ITG neq, ITG len, ITG *ia, ITG *iz, double *eps, ITG *niter, ITG precFlg, double *rho, double *r, double *g, double *C, double *z)
Definition: pcgsolver.c:147

◆ checkconvergence()

void checkconvergence ( double *  co,
ITG nk,
ITG kon,
ITG ipkon,
char *  lakon,
ITG ne,
double *  stn,
ITG nmethod,
ITG kode,
char *  filab,
double *  een,
double *  t1act,
double *  time,
double *  epn,
ITG ielmat,
char *  matname,
double *  enern,
double *  xstaten,
ITG nstate_,
ITG istep,
ITG iinc,
ITG iperturb,
double *  ener,
ITG mi,
char *  output,
ITG ithermal,
double *  qfn,
ITG mode,
ITG noddiam,
double *  trab,
ITG inotr,
ITG ntrans,
double *  orab,
ITG ielorien,
ITG norien,
char *  description,
double *  sti,
ITG icutb,
ITG iit,
double *  dtime,
double *  qa,
double *  vold,
double *  qam,
double *  ram1,
double *  ram2,
double *  ram,
double *  cam,
double *  uam,
ITG ntg,
double *  ttime,
ITG icntrl,
double *  theta,
double *  dtheta,
double *  veold,
double *  vini,
ITG idrct,
double *  tper,
ITG istab,
double *  tmax,
ITG nactdof,
double *  b,
double *  tmin,
double *  ctrl,
double *  amta,
ITG namta,
ITG itpamp,
ITG inext,
double *  dthetaref,
ITG itp,
ITG jprint,
ITG jout,
ITG uncoupled,
double *  t1,
ITG iitterm,
ITG nelemload,
ITG nload,
ITG nodeboun,
ITG nboun,
ITG itg,
ITG ndirboun,
double *  deltmx,
ITG iflagact,
char *  set,
ITG nset,
ITG istartset,
ITG iendset,
ITG ialset,
double *  emn,
double *  thicke,
char *  jobnamec,
ITG mortar,
ITG nmat,
ITG ielprop,
double *  prop,
ITG ialeatoric,
ITG kscale,
double *  energy,
double *  allwk,
double *  energyref,
double *  emax,
double *  enres,
double *  enetoll,
double *  energyini,
double *  allwkini,
double *  temax,
double *  reswk,
ITG ne0,
ITG neini,
double *  dampwk,
double *  dampwkini,
double *  energystartstep 
)
59  {
60 
61  ITG i0,ir,ip,ic,il,ig,ia,iest,iest1=0,iest2=0,iconvergence,idivergence,
62  ngraph=1,k,*ipneigh=NULL,*neigh=NULL,*inum=NULL,id,istart,iend,inew,
63  i,j,mt=mi[1]+1,iexceed,
64  iforceincsize=0;
65 
66  double df,dc,db,dd,ran,can,rap,ea,cae,ral,da,*vr=NULL,*vi=NULL,*stnr=NULL,
67  *stni=NULL,*vmax=NULL,*stnmax=NULL,*cs=NULL,c1[2],c2[2],reftime,
68  *fn=NULL,*eenmax=NULL,*fnr=NULL,*fni=NULL,*qfx=NULL,*cdn=NULL,
69  *cdnr=NULL,*cdni=NULL,tmp, maxdecay=0.0, r_rel,cetol;
70 
71  /* reset ialeatoric to zero */
72 
73  *ialeatoric=0;
74 
75  cetol=ctrl[39];
76 
77  /* next lines are active if the number of contact elements was
78  changed in the present increment */
79 
80  if ((*iflagact==1)&&(*mortar!=1)){
81  if(ctrl[0]<*iit+4)ctrl[0]=*iit+4;
82  if(ctrl[1]<*iit+8)ctrl[1]=*iit+8;
83  ctrl[3]+=1;
84  }
85 
86  i0=ctrl[0];ir=ctrl[1];ip=ctrl[2];ic=ctrl[3];il=ctrl[4];ig=ctrl[5];
87  ia=ctrl[7];df=ctrl[10];dc=ctrl[11];db=ctrl[12];da=ctrl[13];dd=ctrl[16];
88  ran=ctrl[18];can=ctrl[19];rap=ctrl[22];
89  ea=ctrl[23];cae=ctrl[24];ral=ctrl[25];
90 
91  /* for face-to-face penalty contact: increase the number of iterations
92  in two subsequent increments in order to increase the increment size */
93 
94  if(*mortar==1){ig+=12;il+=12;}
95 
96  /* if iconvergence=0 the increment did not yet converge, iterations are
97  continued
98  if idivergence=1 the increment diverged and has to be reiterated
99  with a smaller size */
100 
101  idivergence=0;
102 
103  /* check for forced divergence (due to divergence of a user material
104  routine */
105 
106  if(qa[2]>0.){idivergence=1;}
107 
108  if(*ithermal!=2){
109  if(qa[0]>ea*qam[0]){
110  if(*iit<=ip){c1[0]=ran;}
111  else{c1[0]=rap;}
112  c2[0]=can;
113  }
114  else{
115  c1[0]=ea;
116  c2[0]=cae;
117  }
118  if(ram1[0]<ram2[0]){ram2[0]=ram1[0];}
119  }
120  if(*ithermal>1){
121  if(qa[1]>ea*qam[1]){
122  if(*iit<=ip){c1[1]=ran;}
123  else{c1[1]=rap;}
124  c2[1]=can;
125  }
126  else{
127  c1[1]=ea;
128  c2[1]=cae;
129  }
130  if(ram1[1]<ram2[1]){ram2[1]=ram1[1];}
131  }
132 
133  iconvergence=0;
134 
135  /* mechanical */
136 
137  if(*ithermal<2){
138  if((*iit>1)&&(ram[0]<=c1[0]*qam[0])&&(*iflagact==0)&&
139  ((*nmethod!=-1)||(qa[3]<=cetol))&&
140  ((cam[0]<=c2[0]*uam[0])||
141  (((ram[0]*cam[0]<c2[0]*uam[0]*ram2[0])||(ram[0]<=ral*qam[0])||
142  (qa[0]<=ea*qam[0]))&&(*ntg==0))||
143  (cam[0]<1.e-8))) iconvergence=1;
144  }
145 
146  /* thermal */
147 
148  if(*ithermal==2){
149  if((ram[1]<=c1[1]*qam[1])&&
150  (cam[2]<*deltmx)&&
151  ((cam[1]<=c2[1]*uam[1])||
152  (((ram[1]*cam[1]<c2[1]*uam[1]*ram2[1])||(ram[1]<=ral*qam[1])||
153  (qa[1]<=ea*qam[1]))&&(*ntg==0))||
154  (cam[1]<1.e-8)))iconvergence=1;
155  }
156 
157  /* thermomechanical */
158 
159  if(*ithermal==3){
160  if(((*iit>1)&&(ram[0]<=c1[0]*qam[0])&&
161  ((*nmethod!=-1)||(qa[3]<=cetol))&&
162  ((cam[0]<=c2[0]*uam[0])||
163  (((ram[0]*cam[0]<c2[0]*uam[0]*ram2[0])||(ram[0]<=ral*qam[0])||
164  (qa[0]<=ea*qam[0]))&&(*ntg==0))||
165  (cam[0]<1.e-8)))&&
166  ((ram[1]<=c1[1]*qam[1])&&
167  (cam[2]<*deltmx)&&
168  ((cam[1]<=c2[1]*uam[1])||
169  (((ram[1]*cam[1]<c2[1]*uam[1]*ram2[1])||(ram[1]<=ral*qam[1])||
170  (qa[1]<=ea*qam[1]))&&(*ntg==0))||
171  (cam[1]<1.e-8))))iconvergence=1;
172  }
173 
174  /* reset kscale */
175 
176  if(iconvergence==1){
177  if(*kscale>1){
178  *kscale=1;
179  iconvergence=0;
180  printf("\n restoring the elastic contact stifnesses to their original values \n\n");
181  }
182  }
183 
184 // # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
185 // MPADD start
186  /*
187  Energy conservation convergence: only for implicit dynamic calculations
188  (convergence is not checked in explicit dynamics)
189 
190  Main variables and meaning
191 
192  r_rel : modified energy conservation criterion
193  emax : maximum value of the energy over the time history
194  r : energy residual (Eint + K + Econt - Wext - Wdamp -Eref)
195  enetoll : energy conservation tolerance
196  tmp : auxiliary temporary variable
197  maxdecay : \hat(r)^{max}(\theta) -> value of the decay boundary
198  for r_hat.
199 
200  Proposed by Matteo Pacher */
201 
202  if((*nmethod==4)&&(*ithermal<2)&&(*uncoupled==0)&&(iconvergence==1)&&(*ne==*ne0)&&(*neini==*ne0)&&(*idrct==0)) {
203 
204  /* Update the value of the maximum energy of the system emax
205  (contact energy is not taken into account because small) */
206 
207  *emax=max(*emax,fabs(energy[0]-energystartstep[0]));
208  *emax=max(*emax,fabs(energy[1]));
209  *emax=max(*emax,fabs(*allwk));
210 
211  // energy residual (only calculated in the absence of contact);
212  // if <=0: loss of energy
213 
214  *r_abs=energy[0]+energy[1]+energy[2]+energy[3]-*energyref-*allwk-*dampwk;
215 
216  // Absolute tolerance check (when the error is really small --> beginning of simulation)
217 
218  if(fabs(*r_abs)>=*enetoll/4) {
219 
220  // Normal strategy: Relative error
221 
222  /* Compute admissible decay*/
223 
224  maxdecay=*enetoll/2*(1+sqrt(*theta));
225 
226  /* modified r_hat criterion */
227 
228  r_rel=*r_abs/(*emax);
229  if(r_rel<=-maxdecay) {
230  idivergence=1;
231  }else{
232 
233  /* Check if the residual is too close to the boundary */
234 
235  if(r_rel<=-0.9*maxdecay) {
236  *istab=0; // keep the increment size
237  }
238  }
239  }
240  }
241 
242  /* Contact Strategy: limit jumps and time increment during contact based
243  on the natural frequency of oscillation of contact elements
244  Implicit dynamic calculations only */
245 
246  if((*nmethod==4)&&(*ithermal<2)&&(*uncoupled==0)&&(iconvergence==1)&&((*ne!=*ne0)||(*neini!=*ne0))){
247 
248  /* store temporarly the value of emax: in case of forced divergence
249  emax has to be reset. */
250 
251  tmp=*emax;
252 
253  /* Update the value of the maximum energy of the system emax
254  (contact energy is not taken into account because small) */
255 
256  *emax=max(*emax,fabs(energy[0]-energystartstep[0]));
257  *emax=max(*emax,fabs(energy[1]));
258  *emax=max(*emax,fabs(*allwk));
259 
260  /* maximum decay boundary */
261 
262  maxdecay=*enetoll/2*(1+sqrt(*theta));
263 
264  FORTRAN(checkimpacts,(ne,neini,temax,sizemaxinc,energyref,
265  tmin,tper,&idivergence,
266  &iforceincsize,istab,dtheta,r_abs,energy,energyini,
267  allwk,allwkini,dampwk,dampwkini,emax,mortar,
268  &maxdecay,enetoll));
269 
270  /* reset emax in case of forced divergence */
271 
272  if(idivergence==1){
273  *emax=tmp;
274  }
275 
276  /* Adaption of the energy tolerance in case of violation due to
277  contact jumps (rebounds).
278  The user is aware of it via the output string. */
279 
280  if((*ne==*ne0)&&(*neini>*ne0)&&(idivergence==0)){
281  *r_abs=fabs(energy[0]+energy[1]+energy[2]+energy[3]-*energyref-*allwk-*dampwk);
282  tmp=1.3*(2.0*(*r_abs)/(*emax))/(1.0+sqrt(*theta));
283  *enetoll=max(*enetoll,tmp);
284  printf("\n Adaption of the max-decay boundary, enetoll = %f \n",*enetoll);
285  }
286 
287  /*
288  Adaption of the energy residual during long periods of persistent contact.
289  Take care of the general (increasing) trend of the residual to avoid code stucks.
290  */
291 
292  if((iconvergence==1)&&(*ne<=*neini)){
293  tmp=energy[0]+energy[1]+energy[2]+energy[3]-*energyref-*allwk-*dampwk;
294  if(tmp>*r_abs){
295  *r_abs=tmp;
296  printf("\n Adaption of the energy residual in persistent contact, \n");
297  printf(" an increasing trend has been detected.\n");
298  }
299  }
300  } else {
301  *sizemaxinc=*tmax;
302  }
303 // MPADD end
304 // # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
305 
306  /* increment convergence reached */
307 
308  if((iconvergence==1)&&(idivergence==0)){
309 
310  FORTRAN(writesummary,(istep,iinc,icutb,iit,ttime,time,dtime));
311  if(*uncoupled){
312  if(*ithermal==2){
313  *iitterm=*iit;
314  *ithermal=1;
315  for(k=0;k<*nk;++k){t1[k]=vold[mt*k];}
316  *iit=1;
317  (ctrl[0])*=4;
318  printf(" thermal convergence\n\n");
319  *iflagact=0;
320  return;
321  }else{
322  *ithermal=3;
323  *iit=*iitterm;
324  (ctrl[0])/=4;
325  }
326  }
327 
328  *icntrl=1;
329  *icutb=0;
330  *theta=*theta+*dtheta;
331 
332  /* defining a mean "velocity" for static calculations: is used to
333  extrapolate the present results for next increment */
334 
335  if(*nmethod != 4){
336  for(i=0;i<*nk;i++){
337  for(j=1;j<mt;j++){
338  veold[mt*i+j]=(vold[mt*i+j]-vini[mt*i+j])/(*dtime);
339  }
340  }
341  }
342 
343  /* check whether size is to be set to a fixed value */
344 
345  if(iforceincsize==1){
346  *dtheta=*sizemaxinc;
347  *dthetaref=*sizemaxinc;
348  printf(" convergence; new increment size is forced to %e\n\n",*dtheta**tper);
349  }
350 
351  /* check whether next increment size must be decreased */
352 
353  else if((*iit>il)&&(*idrct==0)){
354  if(*mortar==0){
355  *dtheta=*dthetaref*db;
356  *dthetaref=*dtheta;
357  printf(" convergence; the increment size is decreased to %e\n\n",*dtheta**tper);
358  if(*dtheta<*tmin){
359  printf("\n *ERROR: increment size smaller than minimum\n");
360  printf(" best solution and residuals are in the frd file\n\n");
361  NNEW(fn,double,mt**nk);
362  NNEW(inum,ITG,*nk);for(k=0;k<*nk;k++) inum[k]=1;
363  FORTRAN(storeresidual,(nactdof,b,fn,filab,ithermal,
364  nk,sti,stn,ipkon,inum,kon,lakon,ne,mi,orab,
365  ielorien,co,itg,ntg,vold,ielmat,thicke,ielprop,prop));
366  ++*kode;
367 
368  (*ttime)+=(*time);
369  frd(co,nk,kon,ipkon,lakon,ne,vold,stn,inum,nmethod,
370  kode,filab,een,t1act,fn,ttime,epn,ielmat,matname,enern,
371  xstaten,nstate_,istep,iinc,ithermal,qfn,mode,noddiam,
372  trab,inotr,ntrans,orab,ielorien,norien,description,
373  ipneigh,neigh,mi,sti,vr,vi,stnr,stni,vmax,stnmax,
374  &ngraph,veold,ener,ne,cs,set,nset,istartset,iendset,
375  ialset,eenmax,fnr,fni,emn,thicke,jobnamec,output,qfx,
376  cdn,mortar,cdnr,cdni,nmat);
377 
378  FORTRAN(stop,());
379  }
380  }
381  else{
382  printf("convergence\n\n");}
383  }
384 
385  /* check whether next increment size can be increased */
386 
387  else if(*iit<=ig){
388  if((*istab==1)&&(*idrct==0)){
389  *dtheta=*dthetaref*dd;
390  *dthetaref=*dtheta;
391  printf(" convergence; the increment size is increased to %e\n\n",*dtheta**tper);
392  }
393  else{
394  *istab=1;
395  printf(" convergence\n\n");
396  *dtheta=*dthetaref;
397  }
398  }
399  else{
400  *istab=0;
401  printf(" convergence\n\n");
402  *dtheta=*dthetaref;
403  }
404 
405  /* check whether new increment size exceeds maximum increment
406  size allowed (by the user) */
407 
408  if((*dtheta>*sizemaxinc)&&(*idrct==0)){
409  *dtheta=*sizemaxinc;
410  *dthetaref=*dtheta;
411  printf(" the increment size exceeds thetamax and is decreased to %e\n\n",*dtheta**tper);
412  }
413 
414  /* check whether new time point exceeds end of step */
415 
416  if(*dtheta>=1.-*theta){
417  if(*dtheta>1.-*theta){iexceed=1;}else{iexceed=0;}
418  *dtheta=1.-*theta;
419  *dthetaref=*dtheta;
420  if(iexceed==1)
421  printf(" the increment size exceeds the remainder of the step and is decreased to %e\n\n",*dtheta**tper);
422  }
423 
424  /* check whether the end of the new increment exceeds a time point;
425  if itp=1 the increment just finished ends at a time point */
426 
427  if((*itpamp>0)&&(*idrct==0)){
428  if(*itp==1){
429  *jprint=*jout;
430  }else{
431  *jprint=*jout+1;
432  }
433  if(namta[3**itpamp-1]<0){
434  reftime=*ttime+*time+*dtheta**tper;
435  }else{
436  reftime=*time+*dtheta**tper;
437  }
438  istart=namta[3**itpamp-3];
439  iend=namta[3**itpamp-2];
440  FORTRAN(identamta,(amta,&reftime,&istart,&iend,&id));
441  if(id<istart){
442  inew=istart;
443  }else{
444  inew=id+1;
445  }
446 
447  /* if the end of the new increment is less than a time
448  point by less than 1.e-6 (theta-value) dtheta is
449  enlarged up to this time point */
450 
451  if((*inext==inew)&&(inew<=iend)){
452  if(amta[2*inew-2]-reftime<1.e-6**tper){inew++;}
453  }
454 
455  /* inew: smallest time point exceeding time+dtheta*tper
456  inext: smallest time point exceeding time */
457 
458  if(*inext<inew){
459  if(namta[3**itpamp-1]<0){
460  *dtheta=(amta[2**inext-2]-*ttime-*time)/(*tper);
461  }else{
462  *dtheta=(amta[2**inext-2]-*time)/(*tper);
463  }
464  (*inext)++;
465  *itp=1;
466  printf(" the increment size exceeds a time point and is decreased to %e\n\n",*dtheta**tper);
467  }else{*itp=0;}
468  }
469  }
470  else{
471 
472  /* no convergence */
473 
474  /* check for the amount of iterations */
475 
476  if(((*iit>ic)&&(*mortar==0))||((*mortar>1)&&(*iit>200))){
477  printf("\n *ERROR: too many iterations needed\n");
478  printf(" best solution and residuals are in the frd file\n\n");
479 
480  FORTRAN(writesummarydiv,(istep,iinc,icutb,iit,ttime,time,dtime));
481 
482  NNEW(fn,double,mt**nk);
483  NNEW(inum,ITG,*nk);for(k=0;k<*nk;k++) inum[k]=1;
484  FORTRAN(storeresidual,(nactdof,b,fn,filab,ithermal,nk,sti,stn,
485  ipkon,inum,kon,lakon,ne,mi,orab,ielorien,co,itg,ntg,vold,
486  ielmat,thicke,ielprop,prop));
487  ++*kode;
488 
489  (*ttime)+=(*time);
490  frd(co,nk,kon,ipkon,lakon,ne,vold,stn,inum,nmethod,
491  kode,filab,een,t1act,fn,ttime,epn,ielmat,matname,enern,
492  xstaten,nstate_,istep,iinc,ithermal,qfn,mode,noddiam,
493  trab,inotr,ntrans,orab,ielorien,norien,description,
494  ipneigh,neigh,mi,sti,vr,vi,stnr,stni,vmax,stnmax,
495  &ngraph,veold,ener,ne,cs,set,nset,istartset,iendset,
496  ialset,eenmax,fnr,fni,emn,thicke,jobnamec,output,qfx,cdn,
497  mortar,cdnr,cdni,nmat);
498 
499  FORTRAN(stop,());
500  }
501 
502  /* check for diverging residuals */
503 
504  /* if the user has not defined deltmx on the *HEAT
505  TRANSFER card it is set to a large value (1.e30,
506  cf. CalculiX.c); therefore, a comparison of cam[2]
507  with deltmx only makes sense for cam[2]<1.e30 */
508 
509  if((*iit>=i0)||(fabs(ram[0])>1.e20)||(fabs(cam[0])>1.e20)||
510  (fabs(ram[1])>1.e20)||(fabs(cam[1])>1.e20)||
511  ((cam[2]<1.e30)&&(cam[2]>*deltmx))||(idivergence==1)||
512  (iforceincsize==1)){
513  if((*ithermal!=2)&&(*mortar!=1)){
514  if((ram1[0]>ram2[0])&&(ram[0]>ram2[0])&&(ram[0]>c1[0]*qam[0]))
515  idivergence=1;
516  }
517 
518  if((*ithermal!=2)&&(*mortar==1)){
519 
520  if(ram[0]>1.e9){
521  printf("divergence allowed: residual force too large\n");
522  if((ram1[0]>ram2[0])&&(ram[0]>ram2[0])&&(ram[0]>c1[0]*qam[0]))
523  idivergence=1;
524  }
525 
526  /* number of contact elements does not change */
527 
528  if(*iflagact==0){
529  printf("divergence allowed: number of contact elements stabilized\n");
530  if((ram1[0]>ram2[0])&&(ram[0]>ram2[0])&&(ram[0]>c1[0]*qam[0])){
531  if(cam[0]<=c2[0]*uam[0]){
532  *ialeatoric=1;
533  }
534  }
535  }
536 
537  /* rate of number of contact elements is increasing */
538 
539  if(((ITG)ram[6]*(ITG)ram1[6]<0)&&((ITG)ram1[6]*(ITG)ram2[6]<0)){
540 
541  if(((ram[4]>0.98*ram1[4])&&(ram[4]<1.02*ram1[4]))&&
542  ((ram[4]>0.98*ram2[4])&&(ram[4]<1.02*ram2[4]))){
543  printf("divergence allowed: repetitive pattern detected\n");
544  if((ram1[0]>ram2[0])&&(ram[0]>ram2[0])&&(ram[0]>c1[0]*qam[0]))
545  idivergence=1;
546  }
547  }
548  }
549 
550  /* check whether in a viscous step the allowable increase in viscous
551  strain has been exceeded */
552 
553  if((idivergence==0)&&((*nmethod==-1)&&(qa[3]>cetol))) idivergence=2;
554 
555 
556  /* for thermal calculations the maximum temperature change
557  is checked as well */
558 
559  if(*ithermal>1){
560  if((ram1[1]>ram2[1])&&(ram[1]>ram2[1])&&(ram[1]>c1[1]*qam[1]))
561  idivergence=1;
562 
563  /* if the user has not defined deltmx on the *HEAT
564  TRANSFER card it is set to a large value (1.e30,
565  cf. CalculiX.c); therefore, a comparison of cam[2]
566  with deltmx only makes sense for cam[2]<1.e30 */
567 
568  if((cam[2]<1.e30)&&(cam[2]>*deltmx)) idivergence=2;
569  }
570 
571  if(idivergence>0){
572  if(*idrct==1){
573  if((*mortar<=1)||((*mortar>1)&&(*iit>200))) {
574 
575  /* fixed time increments */
576 
577  printf("\n *ERROR: solution seems to diverge; please try \n");
578  printf(" automatic incrementation; program stops\n");
579  printf(" best solution and residuals are in the frd file\n\n");
580 
581  FORTRAN(writesummarydiv,(istep,iinc,icutb,iit,ttime,time,
582  dtime));
583 
584  NNEW(fn,double,mt**nk);
585  NNEW(inum,ITG,*nk);for(k=0;k<*nk;k++) inum[k]=1;
586  FORTRAN(storeresidual,(nactdof,b,fn,filab,ithermal,nk,
587  sti,stn,ipkon,inum,kon,lakon,ne,mi,orab,
588  ielorien,co,itg,ntg,vold,ielmat,thicke,ielprop,prop));
589  ++*kode;
590 
591  (*ttime)+=(*time);
592  frd(co,nk,kon,ipkon,lakon,ne,vold,stn,inum,nmethod,
593  kode,filab,een,t1act,fn,ttime,epn,ielmat,matname,enern,
594  xstaten,nstate_,istep,iinc,ithermal,qfn,mode,noddiam,
595  trab,inotr,ntrans,orab,ielorien,norien,description,
596  ipneigh,neigh,mi,sti,vr,vi,stnr,stni,vmax,stnmax,
597  &ngraph,veold,ener,ne,cs,set,nset,istartset,iendset,
598  ialset,eenmax,fnr,fni,emn,thicke,jobnamec,output,qfx,cdn,
599  mortar,cdnr,cdni,nmat);
600 
601  FORTRAN(stop,());
602  }
603  }
604  else {
605 
606  /* variable time increments */
607 
608  if(qa[2]>0.){
609  *dtheta=*dtheta*qa[2];
610  printf("increment size decrease requested by a material user routine (through pnewdt)\n\n");
611  }else{
612  if(idivergence==1){
613  if((*mortar!=1)||(*icutb!=0)){ // MPADD
614  if(iforceincsize != 1){ // MPADD
615  *dtheta=*dtheta*df; // MPADD
616  }else{ // MPADD
617  *dtheta=*sizemaxinc; // MPADD
618  } // MPADD
619  } // MPADD
620  }else{
621  if(*nmethod==-1){
622  *dtheta=*dtheta*cetol/qa[3]*da;
623  }else{
624  *dtheta=*dtheta**deltmx/cam[2]*da;
625  }
626  }
627  }
628  *dthetaref=*dtheta;
629  printf(" divergence; the increment size is decreased to %e\n",*dtheta**tper);
630  printf(" the increment is reattempted\n\n");
631 
632  FORTRAN(writesummarydiv,(istep,iinc,icutb,iit,ttime,time,
633  dtime));
634 
635  *istab=0;
636  if(*itp==1){
637  *itp=0;
638  (*inext)--;
639  }
640 
641  /* check whether new increment size is smaller than minimum */
642 
643  if(*dtheta<*tmin){
644  printf("\n *ERROR: increment size smaller than minimum\n");
645  printf(" best solution and residuals are in the frd file\n\n");
646  NNEW(fn,double,mt**nk);
647  NNEW(inum,ITG,*nk);for(k=0;k<*nk;k++) inum[k]=1;
648  FORTRAN(storeresidual,(nactdof,b,fn,filab,ithermal,
649  nk,sti,stn,ipkon,inum,kon,lakon,ne,mi,orab,
650  ielorien,co,itg,ntg,vold,ielmat,thicke,ielprop,prop));
651  ++*kode;
652 
653  (*ttime)+=(*time);
654  frd(co,nk,kon,ipkon,lakon,ne,vold,stn,inum,nmethod,
655  kode,filab,een,t1act,fn,ttime,epn,ielmat,matname,enern,
656  xstaten,nstate_,istep,iinc,ithermal,qfn,mode,noddiam,
657  trab,inotr,ntrans,orab,ielorien,norien,description,
658  ipneigh,neigh,mi,sti,vr,vi,stnr,stni,vmax,stnmax,
659  &ngraph,veold,ener,ne,cs,set,nset,istartset,iendset,
660  ialset,eenmax,fnr,fni,emn,thicke,jobnamec,output,qfx,cdn,
661  mortar,cdnr,cdni,nmat);
662 
663  FORTRAN(stop,());
664  }
665  *icntrl=1;
666  (*icutb)++;
667  if(*mortar==1){
668  *kscale=100;
669  printf("\n reducing the constant stiffnesses by a factor of 100 \n\n");
670  }
671 
672  /* check whether too many cutbacks */
673 
674  if(*icutb>ia){
675  printf("\n *ERROR: too many cutbacks\n");
676  printf(" best solution and residuals are in the frd file\n\n");
677  NNEW(fn,double,mt**nk);
678  NNEW(inum,ITG,*nk);for(k=0;k<*nk;k++) inum[k]=1;
679  FORTRAN(storeresidual,(nactdof,b,fn,filab,ithermal,
680  nk,sti,stn,ipkon,inum,kon,lakon,ne,mi,orab,
681  ielorien,co,itg,ntg,vold,ielmat,thicke,ielprop,prop));
682  ++*kode;
683 
684  (*ttime)+=(*time);
685  frd(co,nk,kon,ipkon,lakon,ne,vold,stn,inum,nmethod,
686  kode,filab,een,t1act,fn,ttime,epn,ielmat,matname,enern,
687  xstaten,nstate_,istep,iinc,ithermal,qfn,mode,noddiam,
688  trab,inotr,ntrans,orab,ielorien,norien,description,
689  ipneigh,neigh,mi,sti,vr,vi,stnr,stni,vmax,stnmax,
690  &ngraph,veold,ener,ne,cs,set,nset,istartset,iendset,
691  ialset,eenmax,fnr,fni,emn,thicke,jobnamec,output,qfx,cdn,
692  mortar,cdnr,cdni,nmat);
693 
694  FORTRAN(stop,());
695  }
696  if(*uncoupled){
697  if(*ithermal==1){
698  (ctrl[0])/=4;
699  }
700  *ithermal=3;
701  }
702 
703  /* default value for qa[2] */
704 
705  qa[2]=-1.;
706 
707  *iflagact=0;
708  return;
709  }
710  }
711  }
712 
713  /* check for too slow convergence */
714 
715  if(*iit>=ir){
716  if(*ithermal!=2){
717  iest1=(ITG)ceil(*iit+log(ran*qam[0]/(ram[0]))/
718  log(ram[0]/(ram1[0])));
719  }
720  if(*ithermal>1){
721  iest2=(ITG)ceil(*iit+log(ran*qam[1]/(ram[1]))/
722  log(ram[1]/(ram1[1])));
723  }
724  if(iest1>iest2){iest=iest1;}else{iest=iest2;}
725  if((iest>0)&&(*mortar!=1)){
726  printf(" estimated number of iterations till convergence = %" ITGFORMAT "\n",
727  iest);
728  }
729  if((((iest>ic)||(*iit==ic))&&(*mortar!=1))||((*mortar==1)&&(*iit==60))){
730 
731  if(*idrct!=1){
732  if((*mortar!=1)||(*icutb!=0)) *dtheta=*dtheta*dc;
733  *dthetaref=*dtheta;
734  printf(" too slow convergence; the increment size is decreased to %e\n",*dtheta**tper);
735  printf(" the increment is reattempted\n\n");
736 
737  FORTRAN(writesummarydiv,(istep,iinc,icutb,iit,ttime,
738  time,dtime));
739  *istab=0;
740  if(*itp==1){
741  *itp=0;
742  (*inext)--;
743  }
744 
745  /* check whether new increment size is smaller than minimum */
746 
747  if(*dtheta<*tmin){
748  printf("\n *ERROR: increment size smaller than minimum\n");
749  printf(" best solution and residuals are in the frd file\n\n");
750  NNEW(fn,double,mt**nk);
751  NNEW(inum,ITG,*nk);for(k=0;k<*nk;k++) inum[k]=1;
752  FORTRAN(storeresidual,(nactdof,b,fn,filab,ithermal,
753  nk,sti,stn,ipkon,inum,kon,lakon,ne,mi,orab,
754  ielorien,co,itg,ntg,vold,ielmat,thicke,ielprop,prop));
755  ++*kode;
756 
757  (*ttime)+=(*time);
758  frd(co,nk,kon,ipkon,lakon,ne,vold,stn,inum,nmethod,
759  kode,filab,een,t1act,fn,ttime,epn,ielmat,matname,enern,
760  xstaten,nstate_,istep,iinc,ithermal,qfn,mode,noddiam,
761  trab,inotr,ntrans,orab,ielorien,norien,description,
762  ipneigh,neigh,mi,sti,vr,vi,stnr,stni,vmax,stnmax,
763  &ngraph,veold,ener,ne,cs,set,nset,istartset,iendset,
764  ialset,eenmax,fnr,fni,emn,thicke,jobnamec,output,qfx,cdn,
765  mortar,cdnr,cdni,nmat);
766 
767  FORTRAN(stop,());
768  }
769  *icntrl=1;
770  (*icutb)++;
771  if(*mortar==1){
772  *kscale=100;
773  printf("\n reducing the constant stiffnesses by a factor of 100 \n\n");
774  }
775 // if(*mortar==1) *kscale=100;
776 
777  if(*icutb>ia){
778  printf("\n *ERROR: too many cutbacks\n");
779  printf(" best solution and residuals are in the frd file\n\n");
780  NNEW(fn,double,mt**nk);
781  NNEW(inum,ITG,*nk);for(k=0;k<*nk;k++) inum[k]=1;
782  FORTRAN(storeresidual,(nactdof,b,fn,filab,ithermal,
783  nk,sti,stn,ipkon,inum,kon,lakon,ne,mi,orab,
784  ielorien,co,itg,ntg,vold,ielmat,thicke,ielprop,prop));
785  ++*kode;
786 
787  (*ttime)+=(*time);
788  frd(co,nk,kon,ipkon,lakon,ne,vold,stn,inum,nmethod,
789  kode,filab,een,t1act,fn,ttime,epn,ielmat,matname,enern,
790  xstaten,nstate_,istep,iinc,ithermal,qfn,mode,noddiam,
791  trab,inotr,ntrans,orab,ielorien,norien,description,
792  ipneigh,neigh,mi,sti,vr,vi,stnr,stni,vmax,stnmax,
793  &ngraph,veold,ener,ne,cs,set,nset,istartset,iendset,
794  ialset,eenmax,fnr,fni,emn,thicke,jobnamec,output,qfx,cdn,
795  mortar,cdnr,cdni,nmat);
796 
797  FORTRAN(stop,());
798  }
799  if(*uncoupled){
800  if(*ithermal==1){
801  (ctrl[0])/=4;
802  }
803  *ithermal=3;
804  }
805 
806  /* default value for qa[2] */
807 
808  qa[2]=-1.;
809 
810  *iflagact=0;
811  return;
812  }
813  }
814  }
815 
816  printf(" no convergence\n\n");
817 
818  (*iit)++;
819 
820  }
821 
822  *iflagact=0;
823  return;
824 }
subroutine checkimpacts(ne, neini, temax, sizemaxinc, energyref, tmin, tper, idivergence, iforceincsize, istab, dtheta, r_abs, energy, energyini, allwk, allwkini, dampwk, dampwkini, emax, mortar, maxdecay, enetoll)
Definition: checkimpacts.f:23
#define ITGFORMAT
Definition: CalculiX.h:52
void frd(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne0, double *v, double *stn, ITG *inum, ITG *nmethod, ITG *kode, char *filab, double *een, double *t1, double *fn, double *time, double *epn, ITG *ielmat, char *matname, double *enern, double *xstaten, ITG *nstate_, ITG *istep, ITG *iinc, ITG *ithermal, double *qfn, ITG *mode, ITG *noddiam, double *trab, ITG *inotr, ITG *ntrans, double *orab, ITG *ielorien, ITG *norien, char *description, ITG *ipneigh, ITG *neigh, ITG *mi, double *stx, double *vr, double *vi, double *stnr, double *stni, double *vmax, double *stnmax, ITG *ngraph, double *veold, double *ener, ITG *ne, double *cs, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, double *eenmax, double *fnr, double *fni, double *emn, double *thicke, char *jobnamec, char *output, double *qfx, double *cdn, ITG *mortar, double *cdnr, double *cdni, ITG *nmat)
Definition: frd.c:32
subroutine df(x, u, uprime, rpar, nev)
Definition: subspace.f:133
subroutine writesummary(istep, j, icutb, l, ttime, time, dtime)
Definition: writesummary.f:20
subroutine storeresidual(nactdof, b, fn, filab, ithermal, nk, sti, stn, ipkon, inum, kon, lakon, ne, mi, orab, ielorien, co, itg, ntg, vold, ielmat, thicke, ielprop, prop)
Definition: storeresidual.f:22
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
static double * c1
Definition: mafillvcompmain.c:30
subroutine stop()
Definition: stop.f:20
subroutine writesummarydiv(istep, j, icutb, l, ttime, time, dtime)
Definition: writesummarydiv.f:20
subroutine identamta(amta, reftime, istart, iend, id)
Definition: identamta.f:26
#define ITG
Definition: CalculiX.h:51
#define max(a, b)
Definition: checkconvergence.c:32
#define NNEW(a, b, c)
Definition: CalculiX.h:39

◆ checkconvnet()

void checkconvnet ( ITG icutb,
ITG iin,
double *  cam1t,
double *  cam1f,
double *  cam1p,
double *  cam2t,
double *  cam2f,
double *  cam2p,
double *  camt,
double *  camf,
double *  camp,
ITG icntrl,
double *  dtheta,
double *  ctrl,
double *  cam1a,
double *  cam2a,
double *  cama,
double *  vamt,
double *  vamf,
double *  vamp,
double *  vama,
double *  qa,
double *  qamt,
double *  qamf,
double *  ramt,
double *  ramf,
double *  ramp,
ITG iplausi 
)
40  {
41 
42  ITG i0,ir,ip,ic,il,ig,ia,idivergence;
43 
44  double c2t,c2f,c2p,c2a,c1t,c1f,c1p,qamp=1.,
45  df,dc,db,dd,ran,can,rap,ea,cae,ral;
46 
47  i0=ctrl[0];ir=ctrl[1];ip=ctrl[2];ic=ctrl[3];il=ctrl[4];ig=ctrl[5];ia=ctrl[7];
48  df=ctrl[10];dc=ctrl[11];db=ctrl[12];dd=ctrl[16];ran=ctrl[18];can=ctrl[19];
49  rap=ctrl[22];ea=ctrl[23];cae=ctrl[24];ral=ctrl[25];c1t=ctrl[32];c1f=ctrl[33];
50  c1p=ctrl[34];c2t=ctrl[35];c2f=ctrl[36];c2p=ctrl[37];c2a=ctrl[38];
51 
52  /* temperature */
53 
54  if(*iin<=ip){c2t=0.0001*ran;}
55  else{c2t=0.0001*rap;}
56 
57  if(*iin<=ip){c1t=0.0001*ran;}
58  else{c1t=0.0001*rap;}
59 
60  /* mass flow */
61 
62  if(*iin<=ip){c2f=0.0001*ran;}
63  else{c2f=0.0001*rap;}
64 
65  if(*iin<=ip){c1f=0.0001*ran;}
66  else{c1f=0.0001*rap;}
67 
68  /* pressure */
69 
70  if(*iin<=ip){c2p=0.0001*ran;}
71  else{c2p=0.0001*rap;}
72 
73  if(*iin<=ip){c1p=0.0001*ran;}
74  else{c1p=0.0001*rap;}
75 
76  /* geometry */
77 
78  if(*iin<=ip){c2a=0.0001*ran;}
79  else{c2a=0.0001*rap;}
80 
81  if(*cam1t<*cam2t) {*cam2t=*cam1t;}
82  if(*cam1f<*cam2f) {*cam2f=*cam1f;}
83  if(*cam1p<*cam2p) {*cam2p=*cam1p;}
84  if(*cam1a<*cam2a) {*cam2a=*cam1a;}
85 
86  /* check for convergence or divergence;
87  the convergence check consists of
88  - a comparison of the correction in
89  the latest network iteration with the change since the
90  start of the network calculations
91  - a comparison of the residual in the latest network
92  iteration with mean typical values of the equation terms */
93 
94  *ramt=0.;*ramf=0.;*ramp=0.;
95  if((*camt<=c2t**vamt)&&(*ramt<c1t**qamt)&&
96  (*camf<=c2f**vamf)&&(*ramf<c1f**qamf)&&
97  (*camp<=c2p**vamp)&&(*ramp<c1p*qamp)&&
98  (*cama<=c2a**vama)&&
99 // (*cama<=c2a**vama)&&(*iplausi==1)&&
100  (*iin>3)){
101 
102  /* increment convergence reached */
103 
104  printf(" flow network: convergence in gas iteration %" ITGFORMAT " \n\n",*iin);
105  *icntrl=1;
106  *icutb=0;
107  }
108 
109  else {
110 
111  idivergence=0;
112 
113  /* divergence based on temperatures */
114 
115  if((*iin>=20*i0)||(fabs(*camt)>1.e20)){
116  if((*cam1t>=*cam2t)&&(*camt>=*cam2t)&&(*camt>c2t**vamt)){
117  idivergence=1;
118  }
119  }
120 
121  /* divergence based on the mass flux */
122 
123  if((*iin>=20*i0)||(fabs(*camf)>1.e20)){
124  if((*cam1f>=*cam2f)&&(*camf>=*cam2f)&&(*camf>c2f**vamf)){
125  idivergence=1;
126  }
127  }
128 
129  /* divergence based on pressures */
130 
131  if((*iin>=20*i0)||(fabs(*camp)>1.e20)){
132  if((*cam1p>=*cam2p)&&(*camp>=*cam2p)&&(*camp>c2p**vamp)){
133  idivergence=1;
134  }
135  }
136 
137  /* divergence based on geometry */
138 
139  if((*iin>=20*i0)||(fabs(*cama)>1.e20)){
140  if((*cam1a>=*cam2a)&&(*cama>=*cam2a)&&(*cama>c2a**vama)){
141  idivergence=1;
142  }
143  }
144 
145  /* divergence based on the number of iterations */
146 
147  if(*iin>20*ic) idivergence=1;
148 
149  /* divergence based on singular matrix or negative pressures */
150 
151  if(*iin==0) idivergence=1;
152 
153  if(idivergence==1){
154  *dtheta=*dtheta*df;
155  printf("\n network divergence; the under-relaxation parameter is decreased to %e\n",*dtheta);
156  printf(" the network iteration for the increment is reattempted\n\n");
157  *iin=0;
158  (*icutb)++;
159  if(*icutb>ia){
160  qa[2]=0.25;
161  *icntrl=1;
162 // printf("\n *ERROR: too many cutbacks\n");
163 // FORTRAN(stop,());
164  }
165  }else{
166  printf(" no convergence\n\n");
167  }
168  }
169  return;
170 }
#define ITGFORMAT
Definition: CalculiX.h:52
subroutine df(x, u, uprime, rpar, nev)
Definition: subspace.f:133
#define ITG
Definition: CalculiX.h:51

◆ checkdivergence()

void checkdivergence ( double *  co,
ITG nk,
ITG kon,
ITG ipkon,
char *  lakon,
ITG ne,
double *  stn,
ITG nmethod,
ITG kode,
char *  filab,
double *  een,
double *  t1act,
double *  time,
double *  epn,
ITG ielmat,
char *  matname,
double *  enern,
double *  xstaten,
ITG nstate_,
ITG istep,
ITG iinc,
ITG iperturb,
double *  ener,
ITG mi,
char *  output,
ITG ithermal,
double *  qfn,
ITG mode,
ITG noddiam,
double *  trab,
ITG inotr,
ITG ntrans,
double *  orab,
ITG ielorien,
ITG norien,
char *  description,
double *  sti,
ITG icutb,
ITG iit,
double *  dtime,
double *  qa,
double *  vold,
double *  qam,
double *  ram1,
double *  ram2,
double *  ram,
double *  cam,
double *  uam,
ITG ntg,
double *  ttime,
ITG icntrl,
double *  theta,
double *  dtheta,
double *  veold,
double *  vini,
ITG idrct,
double *  tper,
ITG istab,
double *  tmax,
ITG nactdof,
double *  b,
double *  tmin,
double *  ctrl,
double *  amta,
ITG namta,
ITG itpamp,
ITG inext,
double *  dthetaref,
ITG itp,
ITG jprint,
ITG jout,
ITG uncoupled,
double *  t1,
ITG iitterm,
ITG nelemload,
ITG nload,
ITG nodeboun,
ITG nboun,
ITG itg,
ITG ndirboun,
double *  deltmx,
ITG iflagact,
char *  set,
ITG nset,
ITG istartset,
ITG iendset,
ITG ialset,
double *  emn,
double *  thicke,
char *  jobnamec,
ITG mortar,
ITG nmat,
ITG ielprop,
double *  prop,
ITG ialeatoric,
ITG kscale,
double *  energy,
double *  allwk,
double *  energyref,
double *  emax,
double *  enres,
double *  enetoll,
double *  energyini,
double *  allwkini,
double *  temax,
double *  reswk,
ITG ne0,
ITG neini,
double *  dampwk,
double *  dampwkini,
double *  energystartstep 
)
57  {
58 
59  ITG ia,ngraph=1,k,*ipneigh=NULL,*neigh=NULL,*inum=NULL,mt=mi[1]+1;
60 
61  double *vr=NULL,*vi=NULL,*stnr=NULL,
62  *stni=NULL,*vmax=NULL,*stnmax=NULL,*cs=NULL,
63  *fn=NULL,*eenmax=NULL,*fnr=NULL,*fni=NULL,*qfx=NULL,*cdn=NULL,
64  *cdnr=NULL,*cdni=NULL;
65 
66  ia=ctrl[7];
67 
68  /* check whether divergence was signaled in radflowload.c
69  => repeat the increment with a smaller size */
70 
71  *dtheta=*dtheta*qa[2];
72  printf("increment size decrease requested by the network\n\n");
73  *dthetaref=*dtheta;
74  printf(" divergence; the increment size is decreased to %e\n",*dtheta**tper);
75  printf(" the increment is reattempted\n\n");
76 
77  FORTRAN(writesummarydiv,(istep,iinc,icutb,iit,ttime,time,
78  dtime));
79 
80  *istab=0;
81  if(*itp==1){
82  *itp=0;
83  (*inext)--;
84  }
85 
86  /* check whether new increment size is smaller than minimum */
87 
88  if(*dtheta<*tmin){
89  printf("\n *ERROR: increment size smaller than minimum\n");
90  printf(" best solution and residuals are in the frd file\n\n");
91  NNEW(fn,double,mt**nk);
92  NNEW(inum,ITG,*nk);for(k=0;k<*nk;k++) inum[k]=1;
93  FORTRAN(storeresidual,(nactdof,b,fn,filab,ithermal,
94  nk,sti,stn,ipkon,inum,kon,lakon,ne,mi,orab,
95  ielorien,co,itg,ntg,vold,ielmat,thicke,ielprop,prop));
96  ++*kode;
97 
98  (*ttime)+=(*time);
99  frd(co,nk,kon,ipkon,lakon,ne,vold,stn,inum,nmethod,
100  kode,filab,een,t1act,fn,ttime,epn,ielmat,matname,enern,
101  xstaten,nstate_,istep,iinc,ithermal,qfn,mode,noddiam,
102  trab,inotr,ntrans,orab,ielorien,norien,description,
103  ipneigh,neigh,mi,sti,vr,vi,stnr,stni,vmax,stnmax,
104  &ngraph,veold,ener,ne,cs,set,nset,istartset,iendset,
105  ialset,eenmax,fnr,fni,emn,thicke,jobnamec,output,qfx,cdn,
106  mortar,cdnr,cdni,nmat);
107 
108  FORTRAN(stop,());
109  }
110  *icntrl=1;
111  (*icutb)++;
112  if(*mortar==1){
113  *kscale=100;
114  printf("\n reducing the constant stiffnesses by a factor of 100 \n\n");
115  }
116 
117  /* check whether too many cutbacks */
118 
119  if(*icutb>ia){
120  printf("\n *ERROR: too many cutbacks\n");
121  printf(" best solution and residuals are in the frd file\n\n");
122  NNEW(fn,double,mt**nk);
123  NNEW(inum,ITG,*nk);for(k=0;k<*nk;k++) inum[k]=1;
124  FORTRAN(storeresidual,(nactdof,b,fn,filab,ithermal,
125  nk,sti,stn,ipkon,inum,kon,lakon,ne,mi,orab,
126  ielorien,co,itg,ntg,vold,ielmat,thicke,ielprop,prop));
127  ++*kode;
128 
129  (*ttime)+=(*time);
130  frd(co,nk,kon,ipkon,lakon,ne,vold,stn,inum,nmethod,
131  kode,filab,een,t1act,fn,ttime,epn,ielmat,matname,enern,
132  xstaten,nstate_,istep,iinc,ithermal,qfn,mode,noddiam,
133  trab,inotr,ntrans,orab,ielorien,norien,description,
134  ipneigh,neigh,mi,sti,vr,vi,stnr,stni,vmax,stnmax,
135  &ngraph,veold,ener,ne,cs,set,nset,istartset,iendset,
136  ialset,eenmax,fnr,fni,emn,thicke,jobnamec,output,qfx,cdn,
137  mortar,cdnr,cdni,nmat);
138 
139  FORTRAN(stop,());
140  }
141  if(*uncoupled){
142  if(*ithermal==1){
143  (ctrl[0])/=4;
144  }
145  *ithermal=3;
146  }
147 
148  /* default value for qa[2] */
149 
150  qa[2]=-1.;
151 
152  *iflagact=0;
153 
154 return;
155 }
void frd(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne0, double *v, double *stn, ITG *inum, ITG *nmethod, ITG *kode, char *filab, double *een, double *t1, double *fn, double *time, double *epn, ITG *ielmat, char *matname, double *enern, double *xstaten, ITG *nstate_, ITG *istep, ITG *iinc, ITG *ithermal, double *qfn, ITG *mode, ITG *noddiam, double *trab, ITG *inotr, ITG *ntrans, double *orab, ITG *ielorien, ITG *norien, char *description, ITG *ipneigh, ITG *neigh, ITG *mi, double *stx, double *vr, double *vi, double *stnr, double *stni, double *vmax, double *stnmax, ITG *ngraph, double *veold, double *ener, ITG *ne, double *cs, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, double *eenmax, double *fnr, double *fni, double *emn, double *thicke, char *jobnamec, char *output, double *qfx, double *cdn, ITG *mortar, double *cdnr, double *cdni, ITG *nmat)
Definition: frd.c:32
subroutine storeresidual(nactdof, b, fn, filab, ithermal, nk, sti, stn, ipkon, inum, kon, lakon, ne, mi, orab, ielorien, co, itg, ntg, vold, ielmat, thicke, ielprop, prop)
Definition: storeresidual.f:22
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
subroutine stop()
Definition: stop.f:20
subroutine writesummarydiv(istep, j, icutb, l, ttime, time, dtime)
Definition: writesummarydiv.f:20
#define ITG
Definition: CalculiX.h:51
#define NNEW(a, b, c)
Definition: CalculiX.h:39

◆ checkinclength()

void checkinclength ( double *  time,
double *  ttime,
double *  theta,
double *  dtheta,
ITG idrct,
double *  tper,
double *  tmax,
double *  tmin,
double *  ctrl,
double *  amta,
ITG namta,
ITG itpamp,
ITG inext,
double *  dthetaref,
ITG itp,
ITG jprint,
ITG jout 
)
35  {
36 
37  ITG id,istart,iend,inew,ireduceincrement;
38  double reftime;
39 
40  ITG i0,ir,ip,ic,il,ig,ia;
41  double df,dc,db,dd,ran,can,rap,ea,cae,ral,da;
42  i0=ctrl[0];ir=ctrl[1];ip=ctrl[2];ic=ctrl[3];il=ctrl[4];ig=ctrl[5];ia=ctrl[7];
43  df=ctrl[10];dc=ctrl[11];db=ctrl[12];da=ctrl[13];dd=ctrl[16];
44  ran=ctrl[18];can=ctrl[19];rap=ctrl[22];
45  ea=ctrl[23];cae=ctrl[24];ral=ctrl[25];
46 
47  /* check whether the new increment size is not too big */
48 
49  if(*dtheta>*tmax){
50  *dtheta=*tmax;
51 // printf(" the increment size exceeds thetamax and is decreased to %e\n\n",*dtheta**tper);
52  }
53 
54  /* if itp=1 the increment just finished ends at a time point */
55 
56  if((*itpamp>0)&&(*idrct==0)){
57  if(namta[3**itpamp-1]<0){
58  reftime=*ttime+*time+(*dtheta)**tper;
59  }else{
60  reftime=*time+(*dtheta)**tper;
61  }
62  istart=namta[3**itpamp-3];
63  iend=namta[3**itpamp-2];
64  FORTRAN(identamta,(amta,&reftime,&istart,&iend,&id));
65  if(id<istart){
66  inew=istart;
67  }else{
68  inew=id+1;
69  }
70 // printf("istart=%" ITGFORMAT ",iend=%" ITGFORMAT ",inext=%" ITGFORMAT ",inew=%" ITGFORMAT "\n",istart,iend,*inext,inew);
71 
72  /* inew: smallest time point exceeding time+dtheta*tper
73  inext: smallest time point exceeding time */
74 
75  /* the check with *tmin
76  was introduced to circumvent the following problem: if the new data point is
77  smaller than the next data point, but the distance is very small, the next *dheta
78  calculated a few lines below may be zero due to the subtraction of two nearly equal
79  numbers; a zero *dtheta leads to a fatal error */
80 
81  ireduceincrement=0;
82  if(*inext<iend){
83  if(fabs((amta[2**inext-2]-reftime)/(*tper))<*tmin){
84  ireduceincrement=1;
85  }
86  }
87 
88  if((*inext<inew)||(ireduceincrement==1)){
89 // if((*inext<inew)||(fabs((amta[2**inext-2]-reftime)/(*tper))<*tmin)){
90  // if((*inext<inew)||(fabs((amta[2**inext-2]-reftime))<1.e-10)){
91 
92  if(namta[3**itpamp-1]<0){
93  *dtheta=(amta[2**inext-2]-*ttime-*time)/(*tper);
94  }else{
95  *dtheta=(amta[2**inext-2]-*time)/(*tper);
96  }
97  (*inext)++;
98  *itp=1;
99 // printf(" the increment size exceeds a time point and is decreased to %e\n\n",*dtheta**tper);
100  }else{*itp=0;}
101  }
102 
103  /* check whether the step length is not exceeded */
104 
105  if(*dtheta>1.-*theta){
106  *dtheta=1.-*theta;
107  *dthetaref=*dtheta;
108  printf(" the increment size exceeds the remainder of the step and is decreased to %e\n\n",*dtheta**tper);
109 // if(*dtheta<=1.e-6){(*ttime)+=(*dtheta**tper);}
110  }
111 
112  return;
113 }
subroutine df(x, u, uprime, rpar, nev)
Definition: subspace.f:133
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
subroutine identamta(amta, reftime, istart, iend, id)
Definition: identamta.f:26
#define ITG
Definition: CalculiX.h:51

◆ compfluid()

void compfluid ( double **  cop,
ITG nk,
ITG **  ipkonp,
ITG konf,
char **  lakonp,
char **  sideface,
ITG ifreestream,
ITG nfreestream,
ITG isolidsurf,
ITG neighsolidsurf,
ITG nsolidsurf,
ITG nshcon,
double *  shcon,
ITG nrhcon,
double *  rhcon,
double **  voldp,
ITG ntmat_,
ITG nodeboun,
ITG ndirboun,
ITG nboun,
ITG ipompc,
ITG nodempc,
ITG nmpc,
ITG ikmpc,
ITG ilmpc,
ITG ithermal,
ITG ikboun,
ITG ilboun,
ITG turbulent,
ITG isolver,
ITG iexpl,
double *  ttime,
double *  time,
double *  dtime,
ITG nodeforc,
ITG ndirforc,
double *  xforc,
ITG nforc,
ITG nelemload,
char *  sideload,
double *  xload,
ITG nload,
double *  xbody,
ITG ipobody,
ITG nbody,
ITG ielmatf,
char *  matname,
ITG mi,
ITG ncmat_,
double *  physcon,
ITG istep,
ITG iinc,
ITG ibody,
double *  xloadold,
double *  xboun,
double *  coefmpc,
ITG nmethod,
double *  xforcold,
double *  xforcact,
ITG iamforc,
ITG iamload,
double *  xbodyold,
double *  xbodyact,
double *  t1old,
double *  t1,
double *  t1act,
ITG iamt1,
double *  amta,
ITG namta,
ITG nam,
double *  ampli,
double *  xbounold,
double *  xbounact,
ITG iamboun,
ITG itg,
ITG ntg,
char *  amname,
double *  t0,
ITG **  nelemface,
ITG nface,
double *  cocon,
ITG ncocon,
double *  xloadact,
double *  tper,
ITG jmax,
ITG jout,
char *  set,
ITG nset,
ITG istartset,
ITG iendset,
ITG ialset,
char *  prset,
char *  prlab,
ITG nprint,
double *  trab,
ITG inotr,
ITG ntrans,
char *  filab,
char *  labmpc,
double *  sti,
ITG norien,
double *  orab,
char *  jobnamef,
char *  tieset,
ITG ntie,
ITG mcs,
ITG ics,
double *  cs,
ITG nkon,
ITG mpcfree,
ITG memmpc_,
double *  fmpc,
ITG nef,
ITG **  inomat,
double *  qfx,
ITG neifa,
ITG neiel,
ITG ielfa,
ITG ifaext,
double *  vfa,
double *  vel,
ITG ipnei,
ITG nflnei,
ITG nfaext,
char *  typeboun,
ITG neij,
double *  tincf,
ITG nactdoh,
ITG nactdohinv,
ITG ielorien,
char *  jobnamec,
ITG ifatie,
ITG nstate_,
double *  xstate,
char *  orname,
ITG nblk,
ITG ielblk,
ITG istartblk,
ITG iendblk,
ITG nblket,
ITG nblkze,
ITG kon 
)
70  {
71 
72  /* main computational fluid dynamics routine */
73 
74  char cflag[1],*lakonf=NULL,*sideface=NULL,fncvg[132]="";
75 
76  ITG *ipointer=NULL,*mast1=NULL,*irow=NULL,*icol=NULL,*jq=NULL,
77  nzs=20000000,kode,compressible,*ifabou=NULL,*ja=NULL,
78  nfabou,im,
79  *ipkonf=NULL,*nelemface=NULL,last=0,icyclic,*iau6=NULL,
80  *inomat=NULL,ithermalref,*integerglob=NULL,iincf,
81  iconvergence=0,i,*inum=NULL,iitf,ifreefa,*neielcp=NULL,
82  *iponofa=NULL,*inofa=NULL,is,ie,*ia=NULL,*ielpropf=NULL,
83  icent=0,isti=0,iqfx=0,nfield,ndim,iorienglob,force=0,icfd=1,
84  imach=0,ikappa=0,iit,jit,iatleastonepressurebc,iturb=0,
85  *inoel=NULL,*iponoel=NULL;
86 
87  ITG nelt,isym,itol,itmax,iunit,lrgw,*igwk=NULL,ligw,ierr,*iwork=NULL,iter,
88  nsave,lenw,leniw;
89 
90  double *umfa=NULL,reltime,*doubleglob=NULL,
91  *co=NULL,*vold=NULL,*coel=NULL,*cosa=NULL,*gradvel=NULL,*gradvfa=NULL,
92  *xxn=NULL,*xxi=NULL,*xle=NULL,*xlen=NULL,*xlet=NULL,timef,dtimef,
93  *cofa=NULL,*area=NULL,*xrlfa=NULL,reltimef,ttimef,*hcfa=NULL,*cvel=NULL,
94  *au=NULL,*ad=NULL,*b=NULL,*volume=NULL,*body=NULL,*dy=NULL,
95  *advfa=NULL,*ap=NULL,*bp=NULL,*xxj=NULL,*gradkel=NULL,*gradoel=NULL,
96  *v=NULL,*velo=NULL,*veloo=NULL,*cosb=NULL,dmin,tincfguess,
97  *hel=NULL,*hfa=NULL,*auv=NULL,*adv=NULL,*bv=NULL,*sel=NULL,*gamma=NULL,
98  *gradtfa=NULL,*gradtel=NULL,*umel=NULL,*cvfa=NULL,*gradpel=NULL,
99  *eei=NULL,*ener=NULL,*thicke=NULL,*eme=NULL,c[9],*gradkfa=NULL,
100  ptimef,*stn=NULL,*qfn=NULL,*hcel=NULL,*aua=NULL,a1,a2,a3,beta,
101  *prop=NULL,*dp=NULL,*xxni=NULL,*xxnj=NULL,*xxicn=NULL,*xturb=NULL,
102  *xmach=NULL,*xkappa=NULL,urelax,*flux=NULL,velnormo[5],velnorm[5],
103  relnormt,relnormv,relnormp,relnormmax=1.e30,*temp=NULL,*auv6=NULL,
104  *adv6=NULL,*auv3=NULL,*bv3=NULL,*vela=NULL,*velaa=NULL,
105  *gradofa=NULL,betam=0.1,*gradpfa=NULL;
106 
107  double tol,*rgwk=NULL,err,*sb=NULL,*sx=NULL,*rwork=NULL,*rf=NULL;
108 
109  FILE *f1;
110 
111  co=*cop;
112  ipkonf=*ipkonfp;lakonf=*lakonfp;
113  nelemface=*nelemfacep;sideface=*sidefacep;
114  vold=*voldp;inomat=*inomatp;
115 
116 #ifdef SGI
117  ITG token;
118 #endif
119 
120  strcpy(fncvg,jobnamec);
121  strcat(fncvg,"f.cvg");
122 
123  if((f1=fopen(fncvg,"w"))==NULL){
124 // if((f1=fopen("fluidconvergence","w"))==NULL){
125  printf("*ERROR in compfluid: cannot open cvg file for writing...");
126  exit(0);
127  }
128  fprintf(f1,"temperature velocity pressure\n\n");
129 
130  urelax=.2;
131 
132  /* relative time at the end of the mechanical increment */
133 
134  reltime=(*time)/(*tper);
135 
136  /* open frd-file for fluids */
137 
138  FORTRAN(openfilefluid,(jobnamef));
139 
140  /* variables for multithreading procedure */
141 
142  ITG sys_cpus;
143  char *env,*envloc,*envsys;
144 
145  num_cpus = 0;
146  sys_cpus=0;
147 
148  /* explicit user declaration prevails */
149 
150  envsys=getenv("NUMBER_OF_CPUS");
151  if(envsys){
152  sys_cpus=atoi(envsys);
153  if(sys_cpus<0) sys_cpus=0;
154  }
155 
156  /* automatic detection of available number of processors */
157 
158  if(sys_cpus==0){
159  sys_cpus = getSystemCPUs();
160  if(sys_cpus<1) sys_cpus=1;
161  }
162 
163  /* local declaration prevails, if strictly positive */
164 
165  envloc = getenv("CCX_NPROC_CFD");
166  if(envloc){
167  num_cpus=atoi(envloc);
168  if(num_cpus<0){
169  num_cpus=0;
170  }else if(num_cpus>sys_cpus){
171  num_cpus=sys_cpus;
172  }
173  }
174 
175  /* else global declaration, if any, applies */
176 
177  env = getenv("OMP_NUM_THREADS");
178  if(num_cpus==0){
179  if (env)
180  num_cpus = atoi(env);
181  if (num_cpus < 1) {
182  num_cpus=1;
183  }else if(num_cpus>sys_cpus){
184  num_cpus=sys_cpus;
185  }
186  }
187 
188 // next line is to be inserted in a similar way for all other paralell parts
189 
190  if(*nef<num_cpus) num_cpus=*nef;
191 
192  printf(" Using up to %" ITGFORMAT " cpu(s) for CFD.\n", num_cpus);
193 
194  pthread_t tid[num_cpus];
195 
196 
197  kode=0;
198 
199  /* *iexpl==0: structure:implicit, fluid:incompressible
200  *iexpl==1: structure:implicit, fluid:compressible
201  *iexpl==2: structure:explicit, fluid:incompressible
202  *iexpl==3: structure:explicit, fluid:compressible */
203 
204  if((*iexpl==1)||(*iexpl==3)){
205  compressible=1;
206  }else{
207  compressible=0;
208  }
209 
210  /* if initial conditions are specified for the temperature,
211  it is assumed that the temperature is an unknown */
212 
213  ithermalref=*ithermal;
214  if(*ithermal==1){
215  *ithermal=2;
216  }
217 
218  /* determining the matrix structure */
219 
220  NNEW(ipointer,ITG,*nef);
221  NNEW(mast1,ITG,nzs);
222  NNEW(irow,ITG,nzs);
223  NNEW(icol,ITG,*nef);
224  NNEW(jq,ITG,*nef+1);
225 
226  mastructf(nk,konf,ipkonf,lakonf,nef,icol,jq,&mast1,&irow,
227  isolver,ipointer,&nzs,ipnei,neiel,mi);
228 
229  SFREE(ipointer);SFREE(mast1);
230 
231  NNEW(iau6,ITG,6**nef);
232  FORTRAN(create_iau6,(nef,ipnei,neiel,jq,irow,&nzs,iau6,lakonf));
233 
234  NNEW(neielcp,ITG,*nflnei);
235  FORTRAN(fill_neiel,(nef,ipnei,neiel,neielcp));
236 
237  if(compressible!=1){
238  NNEW(ia,ITG,nzs+*nef);
239  NNEW(ja,ITG,*nef+1);
240  NNEW(aua,double,nzs+*nef);
241  FORTRAN(preconvert2slapcol,(irow,ia,jq,ja,&nzs,nef));
242  }
243 
244  /* calculation geometric data */
245 
246  NNEW(coel,double,3**nef);
247  NNEW(volume,double,*nef);
248  NNEW(cosa,double,*nflnei);
249  NNEW(cosb,double,*nflnei);
250  NNEW(xxn,double,3**nflnei);
251  NNEW(xxi,double,3**nflnei);
252  NNEW(xxj,double,3**nflnei);
253  NNEW(xxni,double,3**nflnei);
254  NNEW(xxicn,double,3**nflnei);
255  NNEW(xxnj,double,3**nflnei);
256  NNEW(xle,double,*nflnei);
257  NNEW(xlen,double,*nflnei);
258  NNEW(xlet,double,*nflnei);
259  NNEW(cofa,double,3**nface);
260  NNEW(area,double,*nface);
261  NNEW(xrlfa,double,3**nface);
262  NNEW(rf,double,3**nface);
263  if(*iturbulent>0) NNEW(dy,double,*nsolidsurf);
264 
265  FORTRAN(initialcfd,(nef,ipkonf,konf,lakonf,co,coel,cofa,nface,
266  ielfa,area,ipnei,neiel,xxn,xxi,xle,xlen,xlet,xrlfa,cosa,
267  volume,neifa,xxj,cosb,&dmin,ifatie,cs,tieset,&icyclic,c,
268  neij,physcon,isolidsurf,nsolidsurf,dy,xxni,xxnj,xxicn,
269  nflnei,iturbulent,rf));
270 
271 // SFREE(xxj);
272 
273  /* storing pointers to the boundary conditions in ielfa */
274 
275  NNEW(ifabou,ITG,7**nfaext);
276  FORTRAN(applyboun,(ifaext,nfaext,ielfa,ikboun,ilboun,
277  nboun,typeboun,nelemload,nload,sideload,isolidsurf,nsolidsurf,
278  ifabou,&nfabou,nface,nodeboun,ndirboun,ikmpc,ilmpc,labmpc,nmpc,
279  nactdohinv,&compressible,&iatleastonepressurebc,ipkonf,kon,konf,
280  nblk));
281  RENEW(ifabou,ITG,nfabou);
282 
283  /* catalogueing the nodes for output purposes (interpolation at
284  the nodes */
285 
286  NNEW(iponofa,ITG,*nk);
287  NNEW(inofa,ITG,2**nface*4);
288 
289  FORTRAN(cataloguenodes,(iponofa,inofa,&ifreefa,ielfa,ifabou,ipkonf,
290  konf,lakonf,nface,nk));
291 
292  RENEW(inofa,ITG,2*ifreefa);
293 
294  /* material properties for athermal calculations
295  = calculation for which no initial thermal conditions
296  were defined */
297 
298  NNEW(umfa,double,*nface);
299  NNEW(umel,double,*nef);
300 
301  if(*ithermal==0){
302 
303  /* athermal incompressible calculations */
304 
305  /* calculating the dynamic viscosity at the element centers */
306 
307  FORTRAN(calcumel,(nef,vel,shcon,nshcon,ielmatf,ntmat_,
308  ithermal,mi,umel));
309 
310  }
311 
312 
313  if(*ithermal!=0){
314  NNEW(hcfa,double,*nface);
315  NNEW(cvel,double,*nef);
316  NNEW(cvfa,double,*nface);
317  }
318 
319  if(*nbody>0) NNEW(body,double,4**nef);
320 
321  /* v is a auxiliary field: set to zero for the calls to
322  tempload */
323 
324  NNEW(v,double,5**nk);
325 
326  /* next section is for stationary calculations */
327 
328  if(*nmethod==1){
329 
330  /* boundary conditions at the end of the mechanical
331  increment */
332 
333  FORTRAN(tempload,(xforcold,xforc,xforcact,iamforc,nforc,
334  xloadold,xload,xloadact,iamload,nload,ibody,xbody,nbody,
335  xbodyold,xbodyact,t1old,t1,t1act,iamt1,nk,amta,
336  namta,nam,ampli,time,&reltime,ttime,dtime,ithermal,nmethod,
337  xbounold,xboun,xbounact,iamboun,nboun,
338  nodeboun,ndirboun,nodeforc,ndirforc,istep,iinc,
339  co,v,itg,ntg,amname,ikboun,ilboun,nelemload,sideload,mi,
340  ntrans,trab,inotr,vold,integerglob,doubleglob,tieset,istartset,
341  iendset,ialset,ntie,nmpc,ipompc,ikmpc,ilmpc,nodempc,coefmpc,
342  ipobody,iponoel,inoel));
343 
344  /* body forces (gravity, centrifugal and Coriolis forces */
345 
346  if(*nbody>0){
347  FORTRAN(inicalcbody,(nef,body,ipobody,ibody,xbody,coel,vel,lakonf,
348  nactdohinv,&icent));
349  }
350  }
351 
352  /* extrapolating the velocity from the elements centers to the face
353  centers, thereby taking the boundary conditions into account */
354 
355  NNEW(gradvel,double,9**nef);
356  NNEW(gradvfa,double,9**nface);
357 
358  FORTRAN(extrapol_vel,(nface,ielfa,xrlfa,vel,vfa,
359  ifabou,xbounact,ipnei,nef,&icyclic,c,ifatie,xxn,gradvel,
360  gradvfa,neifa,rf,area,volume,xle,xxi,xxj,xlet,
361  coefmpc,nmpc,labmpc,ipompc,nodempc,ifaext,nfaext,nactdoh));
362 
363  /* extrapolation of the pressure at the element centers
364  to the face centers */
365 
366  NNEW(gradpel,double,3**nef);
367  NNEW(gradpfa,double,3**nface);
368 
369  FORTRAN(extrapol_pel,(nface,ielfa,xrlfa,vel,vfa,
370  ifabou,xbounact,nef,gradpel,gradpfa,neifa,rf,area,volume,
371  xle,xxi,&icyclic,xxn,ipnei,ifatie,
372  coefmpc,nmpc,labmpc,ipompc,nodempc,ifaext,nfaext,nactdoh));
373 
374  /* extrapolation of the temperature at the element centers
375  to the face centers */
376 
377  if(*ithermal>0){
378 
379  NNEW(gradtel,double,3**nef);
380  NNEW(gradtfa,double,3**nface);
381 
382  FORTRAN(extrapol_tel,(nface,ielfa,xrlfa,vel,vfa,
383  ifabou,xbounact,nef,gradtel,gradtfa,neifa,rf,area,volume,
384  xle,xxi,&icyclic,xxn,ipnei,ifatie,xload,xlet,xxj,
385  coefmpc,nmpc,labmpc,ipompc,nodempc,ifaext,nfaext,nactdoh));
386 
387  /* calculating the heat conduction at the face centers */
388 
389  FORTRAN(calchcfa,(nface,vfa,cocon,ncocon,ielmatf,ntmat_,
390  mi,ielfa,hcfa));
391 
392  if(compressible!=1){
393 
394  /* calculating the specific heat at constant volume at the
395  face centers (secant value) */
396 
397  FORTRAN(calccvfa,(nface,vfa,shcon,nshcon,ielmatf,ntmat_,
398  mi,ielfa,cvfa,physcon));
399  }else{
400 
401  /* calculating the specific heat at constant volume at the
402  face centers (secant value) */
403 
404  FORTRAN(calccvfacomp,(nface,vfa,shcon,nshcon,ielmatf,ntmat_,
405  mi,ielfa,cvfa,physcon));
406  }
407  }
408 
409  NNEW(flux,double,6**nef);
410 
411  if(compressible!=1){
412 
413  /* calculating the density at the element centers */
414 
415  FORTRAN(calcrhoel,(nef,vel,rhcon,nrhcon,ielmatf,ntmat_,
416  ithermal,mi));
417 
418  /* calculating the density at the face centers */
419 
420  FORTRAN(calcrhofa,(nface,vfa,rhcon,nrhcon,ielmatf,ntmat_,
421  ithermal,mi,ielfa));
422 
423  }else{
424 
425  /* calculating the density at the element centers */
426 
427  FORTRAN(calcrhoelcomp,(nef,vel,shcon,ielmatf,ntmat_,
428  mi));
429 
430  /* calculating the density at the face centers */
431 
432  FORTRAN(calcrhofacomp,(nface,vfa,shcon,ielmatf,ntmat_,
433  mi,ielfa,ipnei,vel,nef,flux,gradpel,gradtel,xxj,
434  &betam,xlet));
435 
436  }
437 
438  /* calculating the initial mass flux */
439 
440  FORTRAN(calcinitialflux,(area,vfa,xxn,ipnei,nef,neifa,lakonf,flux));
441 
442  /* calculating the dynamic viscosity at the face centers */
443 
444  FORTRAN(calcumfa,(nface,vfa,shcon,nshcon,ielmatf,ntmat_,
445  ithermal,mi,ielfa,umfa));
446 
447  /* extrapolation of the turbulence variables at the element centers
448  to the face centers */
449 
450  if(*iturbulent>0){
451 
452  NNEW(gradkel,double,3**nef);
453  NNEW(gradkfa,double,3**nface);
454  NNEW(gradoel,double,3**nef);
455  NNEW(gradofa,double,3**nface);
456 
457  DMEMSET(vel,7**nef,8**nef,1.);
458 
459  FORTRAN(extrapol_kel,(nface,ielfa,xrlfa,vel,vfa,
460  ifabou,xbounact,nef,gradkel,gradkfa,neifa,rf,area,volume,
461  xle,xxi,&icyclic,xxn,ipnei,ifatie,xlet,xxj,
462  coefmpc,nmpc,labmpc,ipompc,nodempc,ifaext,nfaext,nactdoh,
463  umfa,physcon));
464 
465  FORTRAN(extrapol_oel,(nface,ielfa,xrlfa,vel,vfa,
466  ifabou,xbounact,nef,gradoel,gradofa,neifa,rf,area,volume,
467  xle,xxi,&icyclic,xxn,ipnei,ifatie,xlet,xxj,
468  coefmpc,nmpc,labmpc,ipompc,nodempc,ifaext,nfaext,nactdoh,
469  umfa,physcon,dy));
470 
471  }
472 
473  /* calculating the time increment */
474 
475  FORTRAN(calcguesstincf,(nface,&dmin,vfa,umfa,cvfa,hcfa,ithermal,&tincfguess,
476  &compressible));
477 
478  /* start of the major loop */
479 
480  NNEW(advfa,double,*nface);
481  NNEW(hfa,double,3**nface);
482 
483  NNEW(ap,double,*nface);
484  NNEW(bp,double,*nface);
485 
486  NNEW(au,double,*nflnei+*nef);
487  NNEW(ad,double,*nef);
488  NNEW(b,double,*nef);
489 
490  if(*nblk!=0){
491  NNEW(auv6,double,6**nef);
492  NNEW(adv6,double,6**nef);
493  NNEW(auv3,double,3**nef);
494  NNEW(bv3,double,3**nef);
495  NNEW(vela,double,8**nef);
496  NNEW(velaa,double,8**nef);
497  }else{
498  NNEW(auv,double,*nflnei+*nef);
499  }
500 
501  NNEW(bv,double,3**nef);
502  NNEW(hel,double,3**nef);
503  NNEW(sel,double,3**nef);
504 
505  NNEW(rwork,double,*nef);
506 
507  NNEW(inum,ITG,*nk);
508 
509  NNEW(velo,double,8**nef);
510  if((compressible==0)&&(*nblk==0)) NNEW(veloo,double,8**nef);
511 
512  /* initializing velo and veloo */
513 
514  if((compressible==0)&&(*nblk==0)) memcpy(&veloo[0],&vel[0],sizeof(double)*8**nef);
515  memcpy(&velo[0],&vel[0],sizeof(double)*8**nef);
516 
517  /* check output requests */
518 
519  if((strcmp1(&filab[1914],"MACH")==0)||
520  (strcmp1(&filab[3132],"PTF")==0)||
521  (strcmp1(&filab[3219],"TTF")==0)){
522  imach=1;
523  }
524 
525  if((strcmp1(&filab[3132],"PTF")==0)||
526  (strcmp1(&filab[3219],"TTF")==0)){
527  ikappa=1;
528  }
529 
530  if(strcmp1(&filab[2088],"TURB")==0){
531  iturb=1;
532  }
533 
534  for(i=0;i<*nprint;i++){
535  if(imach==0){
536  if((strcmp1(&prlab[6*i],"MACH")==0)||
537  (strcmp1(&prlab[6*i],"PTF")==0)||
538  (strcmp1(&prlab[6*i],"TTF")==0)){
539  imach=1;
540  }
541  }
542  if(ikappa==0){
543  if((strcmp1(&prlab[6*i],"PTF")==0)||
544  (strcmp1(&prlab[6*i],"TTF")==0)){
545  ikappa=1;
546  }
547  }
548  if(iturb==0){
549  if(strcmp1(&prlab[6*i],"TURB")==0){
550  iturb=1;
551  }
552  }
553  }
554 
555  iincf=0;
556 
557  if(*tincf<=0.) *tincf=tincfguess;
558  printf("time increment for the CFD-calculations = %e\n\n",*tincf);
559 
560  ttimef=*ttime;
561  timef=*time-*dtime;
562  dtimef=*tincf;
563 
564  if(*nblk==0){
565  a1=1.5/dtimef;
566  a2=-2./dtimef;
567  a3=0.5/dtimef;
568  }else{
569  a1=1./dtimef;
570  a2=-a1;
571  }
572 
573  NNEW(temp,double,6**nef);
574  NNEW(gamma,double,*nface);
575 
576  do{
577 
578  iincf++;
579 
580  printf("fluid increment = %d\n",iincf);
581 
582  timef+=dtimef;
583  if((*time<timef)&&(*nmethod==4)){
584  dtimef-=(timef-*time);
585  timef=*time;
586  last=1;
587  beta=dtimef/(*tincf);
588  a1=(2.+beta)/(1.+beta);
589  a2=-(1.+beta)/beta;
590  a3=1./(beta*(1.+beta));
591  }
592 
593  /* starting iterations till convergence of the fluid increment */
594 
595  iit=0;
596  for(i=0;i<5;i++){velnormo[i]=0;}
597  FORTRAN(norm,(vel,velnormo,nef));
598 
599  do{
600  iit++;
601 
602  printf(" iteration = %d\n",iit);
603 
604  /* conditions for transient calculations */
605 
606  if(*nmethod==4){
607 
608  /* boundary conditions at end of fluid increment */
609 
610  FORTRAN(tempload,(xforcold,xforc,xforcact,iamforc,nforc,
611  xloadold,xload,xloadact,iamload,nload,ibody,xbody,nbody,
612  xbodyold,xbodyact,t1old,t1,t1act,iamt1,nk,amta,
613  namta,nam,ampli,&timef,&reltimef,&ttimef,&dtimef,ithermal,nmethod,
614  xbounold,xboun,xbounact,iamboun,nboun,
615  nodeboun,ndirboun,nodeforc,ndirforc,istep,iinc,
616  co,v,itg,ntg,amname,ikboun,ilboun,nelemload,sideload,mi,
617  ntrans,trab,inotr,vold,integerglob,doubleglob,tieset,istartset,
618  iendset,ialset,ntie,nmpc,ipompc,ikmpc,ilmpc,nodempc,coefmpc,
619  ipobody,iponoel,inoel));
620 
621  /* body forces (gravity, centrifugal and Coriolis forces) */
622 
623  if(*nbody>0){
624  FORTRAN(calcbody,(nef,body,ipobody,ibody,xbody,coel,vel,lakonf,
625  nactdohinv));
626  }
627 
628  }else if(icent==1){
629 
630  /* body forces (gravity, centrifugal and Coriolis forces;
631  only if centrifugal forces are active => the ensuing
632  Coriolis forces depend on the actual velocity) */
633 
634  FORTRAN(calcbody,(nef,body,ipobody,ibody,xbody,coel,vel,lakonf,
635  nactdohinv));
636  }
637 
638  /* updating of the material properties */
639 
640  if(*ithermal>0){
641 
642 
643  if(compressible!=1){
644 
645  /* calculating material data
646  density (elements+faces)
647  heat capacity at constant volume (elements+faces)
648  dynamic viscosity (elements+faces)
649  heat conduction (faces) */
650 
651  FORTRAN(materialdata_cfd,(nef,vel,shcon,nshcon,ielmatf,
652  ntmat_,mi,cvel,vfa,cocon,ncocon,physcon,cvfa,
653  ithermal,nface,umel,umfa,ielfa,hcfa,rhcon,nrhcon));
654 
655  }else{
656 
657  /* calculating material data
658  heat capacity at constant volume (elements+faces)
659  dynamic viscosity (elements+faces)
660  heat conduction (faces) */
661 
662  FORTRAN(materialdata_cfd_comp,(nef,vel,shcon,nshcon,ielmatf,
663  ntmat_,mi,cvel,vfa,cocon,ncocon,physcon,cvfa,
664  ithermal,nface,umel,umfa,ielfa,hcfa));
665  }
666 
667  }
668 
669  if(*nblk==0){
670 
671  /* filling the lhs and rhs's for the balance of momentum
672  equations */
673 
674  DMEMSET(auv,0,*nflnei+*nef,0.);
675  DMEMSET(bv,0,3**nef,0.);
676 
677  if(compressible==0){
678 
679  /* calculate gamma (Ph.D. Thesis Jasak) */
680 
681  FORTRAN(calcgamma,(nface,ielfa,vel,gradvel,gamma,xlet,xxn,xxj,
682  ipnei,&betam,nef,flux));
683 
684  mafillvmain(nef,ipnei,neifa,neiel,vfa,xxn,area,
685  auv,&auv[*nflnei],jq,irow,&nzs,bv,vel,cosa,umfa,
686  xlet,xle,gradvfa,xxi,
687  body,volume,ielfa,lakonf,ifabou,nbody,
688  &dtimef,velo,veloo,sel,xrlfa,gamma,xxj,nactdohinv,&a1,
689  &a2,&a3,flux,&icyclic,c,ifatie,iau6,xxni,xxnj,
690  iturbulent,gradvel);
691 
692  }else{
693 
694  /* calculate gamma (Ph.D. Thesis Jasak) */
695 
696 // FORTRAN(calcgamma,(nface,ielfa,vel,gradvel,gamma,xlet,xxn,xxj,
697 // ipnei,&betam,nef,flux));
698 
699  mafillvcompmain(nef,ipnei,neifa,neiel,vfa,xxn,area,
700  auv,&auv[*nflnei],jq,irow,&nzs,bv,vel,cosa,umfa,
701  xlet,xle,gradvfa,xxi,
702  body,volume,ielfa,lakonf,ifabou,nbody,
703  &dtimef,velo,veloo,sel,xrlfa,gamma,xxj,nactdohinv,&a1,
704  &a2,&a3,flux,&icyclic,c,ifatie,iau6,xxni,xxnj);
705  }
706 
707  isym=0;
708  nelt=*nflnei+*nef;
709  lrgw=131+16**nef;
710  NNEW(rgwk,double,lrgw);
711  NNEW(igwk,ITG,20);
712  for(i=0;i<*nef;i++){rwork[i]=1./auv[*nflnei+i];}
713 
714 // if(compressible==0) memcpy(&temp[*nef],&vel[*nef],sizeof(double)*3**nef);
715  memcpy(&temp[*nef],&vel[*nef],sizeof(double)*3**nef);
716 
717  /* estimate of new solution */
718 
719  FORTRAN(predgmres,(nef,&bv[0],&vel[*nef],&nelt,neielcp,ipnei,auv,
720  &isym,&itol,&tol,&itmax,&iter,
721  &err,&ierr,&iunit,sb,sx,rgwk,&lrgw,igwk,
722  &ligw,rwork,iwork));
723  if(ierr>0){
724  printf("*WARNING in compfluid: error message from predgmres (v_x)=%d\n",ierr);
725  }
726  FORTRAN(predgmres,(nef,&bv[*nef],&vel[2**nef],&nelt,neielcp,ipnei,auv,
727  &isym,&itol,&tol,&itmax,&iter,
728  &err,&ierr,&iunit,sb,sx,rgwk,&lrgw,igwk,
729  &ligw,rwork,iwork));
730  if(ierr>0){
731  printf("*WARNING in compfluid: error message from predgmres (v_y)=%d\n",ierr);
732  }
733  FORTRAN(predgmres,(nef,&bv[2**nef],&vel[3**nef],&nelt,neielcp,ipnei,auv,
734  &isym,&itol,&tol,&itmax,&iter,
735  &err,&ierr,&iunit,sb,sx,rgwk,&lrgw,igwk,
736  &ligw,rwork,iwork));
737  if(ierr>0){
738  printf("*WARNING in compfluid: error message from predgmres (v_z)=%d\n",ierr);
739  }
740  SFREE(rgwk);SFREE(igwk);
741 
742 // if(compressible==0)for(i=*nef;i<4**nef;i++){vel[i]=0.8*vel[i]+0.2*temp[i];}
743  for(i=*nef;i<4**nef;i++){vel[i]=0.8*vel[i]+0.2*temp[i];}
744 
745  }else{
746 
747  /* BLOCK structure */
748 
749  }
750 
751  /* calculating the pressure gradient at the element
752  centers */
753 
754  if(compressible==1){
755 // jit=100;
756  jit=4;
757  }else{
758 // jit=1;
759  jit=2;
760  }
761 
762  for(iitf=0;iitf<jit;iitf++){
763 
764  memcpy(&hel[0],&sel[0],sizeof(double)*(3**nef));
765 
766  /* completing hel with the neighboring velocity contributions */
767 
768  if(*nblk==0){
769  if(icyclic==0){
770  FORTRAN(complete_hel,(nef,&vel[*nef],hel,&auv[*nflnei],auv,ipnei,neiel,&nzs));
771  }else{
772  FORTRAN(complete_hel_cyclic,(nef,&vel[*nef],hel,&auv[*nflnei],auv,jq,
773  irow,ipnei,neiel,ifatie,c,lakonf,neifa,&nzs));
774  }
775  }else{
776  if(icyclic==0){
777  FORTRAN(complete_hel_blk,(vel,hel,auv6,ipnei,neiel,nef,nactdohinv));
778  }else{
779  FORTRAN(complete_hel_cyclic_blk,(vel,hel,auv6,c,ipnei,neiel,
780  neifa,ifatie,nef));
781  }
782  }
783 
784  /* generating ad and h at the face centers (advfa and hfa) */
785 
786  if(compressible!=1){
787  FORTRAN(extrapolate_ad_h,(nface,ielfa,xrlfa,&auv[*nflnei],advfa,hel,hfa,
788  &icyclic,c,ifatie));
789  }else{
790  FORTRAN(extrapolate_ad_h_comp,(nface,ielfa,xrlfa,&auv[*nflnei],advfa,hel,
791  hfa,&icyclic,c,ifatie));
792  }
793 
794  /* calculating the lhs and rhs of the equation system to determine
795  p (balance of mass) */
796 
797  DMEMSET(b,0,*nef,0.);
798 
799  if(compressible!=1){
800 
801  /* incompressible media */
802 
803  if(iitf==0){
804 
805  /* first iteration: calculating both lhs and rhs */
806 
807  DMEMSET(ad,0,*nef,0.);
808  DMEMSET(au,0,nzs,0.);
809 
810  mafillpmain(nef,lakonf,ipnei,neifa,neiel,vfa,area,
811  advfa,xlet,cosa,volume,au,ad,jq,irow,ap,
812  ielfa,ifabou,xle,b,xxn,nef,
813  &nzs,hfa,gradpel,bp,xxi,neij,xlen,cosb,
814  &iatleastonepressurebc,iau6,xxicn);
815 
816  FORTRAN(convert2slapcol,(au,ad,jq,&nzs,nef,aua));
817 
818  }else{
819 
820  /* second, third.. iteration: calculate the rhs only */
821 
822  rhspmain(nef,lakonf,ipnei,neifa,neiel,vfa,area,
823  advfa,xlet,cosa,volume,au,ad,jq,irow,ap,ielfa,ifabou,xle,
824  b,xxn,nef,&nzs,hfa,gradpel,bp,xxi,neij,xlen,
825  &iatleastonepressurebc,xxicn);
826 
827  }
828 
829 
830  nelt=nzs+*nef;
831  isym=1;
832 
833  /* next line was changed from 10 to 3 on 22.12.2016 */
834 
835  nsave=3;
836  itol=0;
837  tol=1.e-6;
838 
839  /* next line was changed from 110 to 10 on 22.12.2016 */
840 
841  itmax=10;
842  iunit=0;
843  lenw=131+17**nef+2*nelt;
844  NNEW(rgwk,double,lenw);
845  leniw=32+4**nef+2*nelt;
846  NNEW(igwk,ITG,leniw);
847 
848  memcpy(&temp[4**nef],&vel[4**nef],sizeof(double)**nef);
849 
850  FORTRAN(dslugm,(nef,&b[0],&vel[4**nef],&nelt,ia,ja,aua,
851  &isym,&nsave,&itol,&tol,&itmax,&iter,
852  &err,&ierr,&iunit,rgwk,&lenw,igwk,&leniw));
853  SFREE(rgwk);SFREE(igwk);
854 
855  for(i=4**nef;i<5**nef;i++){vel[i]=0.3*vel[i]+0.7*temp[i];}
856 
857  /* extrapolation of the pressure at the element centers
858  to the face centers */
859 
860  }else{
861 
862  /* compressible media */
863 
864  DMEMSET(au,0,*nflnei+*nef,0.);
865 
866  /* calculate gamma (Ph.D. Thesis Jasak) */
867 
868 // FORTRAN(calcgammap,(nface,ielfa,vel,gradtel,gamma,xlet,xxn,xxj,
869 // ipnei,&betam,nef,flux));
870 
871  mafillpcompmain(nef,lakonf,ipnei,neifa,neiel,vfa,area,
872  advfa,xlet,cosa,volume,au,&au[*nflnei],jq,irow,ap,
873  ielfa,ifabou,xle,b,xxn,nef,
874  &nzs,hfa,gradpel,bp,xxi,neij,xlen,cosb,
875  ielmatf,mi,&a1,&a2,&a3,velo,veloo,&dtimef,shcon,
876  ntmat_,vel,nactdohinv,xrlfa,flux,iau6,xxicn,
877  gamma);
878 
879  isym=0;
880  nelt=*nflnei+*nef;
881  lrgw=131+16**nef;
882  NNEW(rgwk,double,lrgw);
883  NNEW(igwk,ITG,20);
884  for(i=0;i<*nef;i++){rwork[i]=1./au[*nflnei+i];}
885 
886  NNEW(dp,double,*nef);
887  FORTRAN(predgmres,(nef,&b[0],dp,&nelt,neielcp,ipnei,au,
888  &isym,&itol,&tol,&itmax,&iter,
889  &err,&ierr,&iunit,sb,sx,rgwk,&lrgw,igwk,
890  &ligw,rwork,iwork));
891 
892  for(i=0;i<*nef;i++){
893 // vel[4**nef+i]+=0.2*dp[i];
894  vel[4**nef+i]+=0.3*dp[i];
895  }
896  SFREE(dp);
897 
898  SFREE(rgwk);SFREE(igwk);
899  if(ierr>0){
900  printf("*WARNING in compfluid: error message from predgmres (p)=%d\n",ierr);
901  }
902 
903  }
904 
905  FORTRAN(extrapol_pel,(nface,ielfa,xrlfa,vel,vfa,
906  ifabou,xbounact,nef,gradpel,gradpfa,neifa,rf,area,volume,
907  xle,xxi,&icyclic,xxn,ipnei,ifatie,
908  coefmpc,nmpc,labmpc,ipompc,nodempc,ifaext,nfaext,nactdoh));
909 
910  /* correction of the velocity at the element centers due
911  to the pressure change */
912 
913  FORTRAN(correctvel,(hel,&auv[*nflnei],vfa,ipnei,area,&vel[*nef],xxn,neifa,
914  lakonf,nef,nef));
915 
916  if(compressible!=0){
917  if((iitf<jit-1)&&((relnormmax>=1.e-5)||(iitf<1))){
918 
919  FORTRAN(correctvfa,(nface,ielfa,area,vfa,ap,bp,xxn,
920  ifabou,ipnei,nef,neifa,hfa,vel,xbounact,lakonf,
921  flux));
922 
923  /* calculating the lhs and rhs of the energy equation */
924 
925  DMEMSET(au,0,*nflnei+*nef,0.);
926  DMEMSET(b,0,*nef,0.);
927 
928  /* calculate gamma (Ph.D. Thesis Jasak) */
929 
930 // FORTRAN(calcgammat,(nface,ielfa,vel,gradtel,gamma,xlet,xxn,xxj,
931 // ipnei,&betam,nef,flux));
932 
933  mafilltcompmain(nef,ipnei,neifa,neiel,vfa,xxn,area,
934  au,&au[*nflnei],jq,irow,&nzs,b,vel,umel,xlet,
935  xle,gradtfa,xxi,
936  body,volume,ielfa,lakonf,ifabou,nbody,nef,
937  &dtimef,velo,veloo,cvfa,hcfa,cvel,gradvel,
938  xload,gamma,
939  xrlfa,xxj,nactdohinv,&a1,&a2,&a3,flux,iau6,
940  xxni,xxnj);
941 
942  nelt=*nflnei+*nef;
943  isym=0;
944  lrgw=131+16**nef;
945  NNEW(rgwk,double,lrgw);
946  NNEW(igwk,ITG,20);
947  for(i=0;i<*nef;i++){rwork[i]=1./au[*nflnei+i];}
948  FORTRAN(predgmres,(nef,&b[0],&vel[0],&nelt,neielcp,ipnei,au,
949  &isym,&itol,&tol,&itmax,&iter,
950  &err,&ierr,&iunit,sb,sx,rgwk,&lrgw,igwk,
951  &ligw,rwork,iwork));
952  SFREE(rgwk);SFREE(igwk);
953  if(ierr>0){
954  printf("*WARNING in compfluid: error message from predgmres (T)=%d\n",ierr);
955  }
956 
957  FORTRAN(extrapol_tel,(nface,ielfa,xrlfa,vel,vfa,
958  ifabou,xbounact,nef,gradtel,gradtfa,neifa,rf,area,volume,
959  xle,xxi,&icyclic,xxn,ipnei,ifatie,xload,xlet,xxj,
960  coefmpc,nmpc,labmpc,ipompc,nodempc,ifaext,nfaext,nactdoh));
961 
962  /* calculating the density at the element centers */
963 
964  FORTRAN(calcrhoelcomp,(nef,vel,shcon,ielmatf,ntmat_,
965  mi));
966 
967  /* calculating the density at the face centers
968  (gamma method) */
969 
970  FORTRAN(calcrhofacomp,(nface,vfa,shcon,ielmatf,ntmat_,
971  mi,ielfa,ipnei,vel,nef,flux,gradpel,gradtel,xxj,
972  &betam,xlet));
973 
974  for(i=0;i<5;i++){velnorm[i]=0;}
975  FORTRAN(norm,(vel,velnorm,nef));
976 
977  relnormt=0.;
978  relnormv=0.;
979  relnormp=0.;
980  relnormmax=0.;
981 
982  if(*ithermal!=0){
983  if(velnorm[0]/(*nef)>1.e-10){
984  relnormt=fabs(velnorm[0]-velnormo[0])/(velnormo[0]);
985  if(relnormt>relnormmax) relnormmax=relnormt;
986  }
987  }
988  if((velnorm[1]+velnorm[2]+velnorm[3])/(*nef)>1.e-10){
989  relnormv=fabs(velnorm[1]+velnorm[2]+velnorm[3]-velnormo[1]-velnormo[2]-velnormo[3])/(velnormo[1]+velnormo[2]+velnormo[3]);
990  if(relnormv>relnormmax) relnormmax=relnormv;
991  }
992  if(velnorm[4]/(*nef)>1.e-10){
993  relnormp=fabs(velnorm[4]-velnormo[4])/(velnormo[4]);
994  if(relnormp>relnormmax) relnormmax=relnormp;
995  }
996  printf("%d %11.4e %11.4e %11.4e\n",iitf,relnormt,relnormv,relnormp);
997 
998  memcpy(velnormo,velnorm,sizeof(double)*5);
999 
1000  }
1001  else{break;}
1002  }
1003 
1004  }
1005 
1006  /* adding the velocity correction at the face centers
1007  due to the balance of mass =>
1008  the resulting mass flux is correct,
1009  the face velocity vectors are not necessarily
1010  needed for energy balance, balance of momentum and
1011  the turbulence equations
1012  */
1013 
1014  FORTRAN(correctvfa,(nface,ielfa,area,vfa,ap,bp,xxn,
1015  ifabou,ipnei,nef,neifa,hfa,vel,xbounact,lakonf,
1016  flux));
1017 
1018  if(*ithermal>0){
1019 
1020  /* calculating the lhs and rhs of the energy equation */
1021 
1022  DMEMSET(ad,0,*nef,0.);
1023  DMEMSET(au,0,*nflnei+*nef,0.);
1024  DMEMSET(b,0,*nef,0.);
1025 
1026  if(compressible==0){
1027 
1028  /* calculate gamma (Ph.D. Thesis Jasak) */
1029 
1030  FORTRAN(calcgammat,(nface,ielfa,vel,gradtel,gamma,xlet,xxn,xxj,
1031  ipnei,&betam,nef,flux));
1032 
1033  mafilltmain(nef,ipnei,neifa,neiel,vfa,xxn,area,
1034  au,&au[*nflnei],jq,irow,&nzs,b,vel,umel,xlet,xle,gradtfa,xxi,
1035  body,volume,ielfa,lakonf,ifabou,nbody,nef,
1036  &dtimef,velo,veloo,cvfa,hcfa,cvel,gradvel,xload,gamma,
1037  xrlfa,xxj,nactdohinv,&a1,&a2,&a3,flux,iau6,xxni,xxnj,
1038  iturbulent);
1039 
1040  }else{
1041 
1042  /* calculate gamma (Ph.D. Thesis Jasak) */
1043 
1044 // FORTRAN(calcgammat,(nface,ielfa,vel,gradtel,gamma,xlet,xxn,xxj,
1045 // ipnei,&betam,nef,flux));
1046 
1047  mafilltcompmain(nef,ipnei,neifa,neiel,vfa,xxn,area,
1048  au,&au[*nflnei],jq,irow,&nzs,b,vel,umel,xlet,xle,gradtfa,xxi,
1049  body,volume,ielfa,lakonf,ifabou,nbody,nef,
1050  &dtimef,velo,veloo,cvfa,hcfa,cvel,gradvel,xload,gamma,
1051  xrlfa,xxj,nactdohinv,&a1,&a2,&a3,flux,iau6,xxni,xxnj);
1052  }
1053 
1054  isym=0;
1055  nelt=*nflnei+*nef;
1056  lrgw=131+16**nef;
1057  NNEW(rgwk,double,lrgw);
1058  NNEW(igwk,ITG,20);
1059  for(i=0;i<*nef;i++){rwork[i]=1./au[*nflnei+i];}
1060  FORTRAN(predgmres,(nef,&b[0],&vel[0],&nelt,neielcp,ipnei,au,
1061  &isym,&itol,&tol,&itmax,&iter,
1062  &err,&ierr,&iunit,sb,sx,rgwk,&lrgw,igwk,
1063  &ligw,rwork,iwork));
1064  SFREE(rgwk);SFREE(igwk);
1065  if(ierr>0){
1066  printf("*WARNING in compfluid: error message from predgmres (T)=%d\n",ierr);
1067  }
1068 
1069  /* extrapolation of the temperature at the element centers
1070  to the face centers */
1071 
1072  FORTRAN(extrapol_tel,(nface,ielfa,xrlfa,vel,vfa,
1073  ifabou,xbounact,nef,gradtel,gradtfa,neifa,rf,area,volume,
1074  xle,xxi,&icyclic,xxn,ipnei,ifatie,xload,xlet,xxj,
1075  coefmpc,nmpc,labmpc,ipompc,nodempc,ifaext,nfaext,nactdoh));
1076 
1077  /* recalculating the density for compressible materials */
1078 
1079  if(compressible!=0){
1080 
1081  /* calculating the density at the element centers */
1082 
1083  FORTRAN(calcrhoelcomp,(nef,vel,shcon,ielmatf,ntmat_,
1084  mi));
1085 
1086  /* calculating the density at the face centers
1087  (gamma method) */
1088 
1089  FORTRAN(calcrhofacomp,(nface,vfa,shcon,ielmatf,ntmat_,
1090  mi,ielfa,ipnei,vel,nef,flux,gradpel,gradtel,xxj,
1091  &betam,xlet));
1092 
1093  }
1094 
1095  }
1096 
1097  if(*iturbulent>0){
1098 
1099  /* calculating the lhs and rhs of the k-equation */
1100 
1101  DMEMSET(au,0,*nflnei+*nef,0.);
1102  DMEMSET(b,0,*nef,0.);
1103 
1104  /* calculate gamma (Ph.D. Thesis Jasak) */
1105 
1106  FORTRAN(calcgammak,(nface,ielfa,vel,gradkel,gamma,xlet,xxn,xxj,
1107  ipnei,&betam,nef,flux));
1108 
1109  if(compressible==0){
1110  mafillkmain(nef,ipnei,neifa,neiel,vfa,xxn,area,
1111  au,&au[*nflnei],jq,irow,&nzs,b,vel,umfa,xlet,xle,gradkfa,xxi,
1112  body,volume,ielfa,lakonf,ifabou,nbody,nef,
1113  &dtimef,velo,veloo,cvfa,hcfa,cvel,gradvel,xload,gamma,
1114  xrlfa,xxj,nactdohinv,&a1,&a2,&a3,flux,iau6,xxni,xxnj,
1115  iturbulent);
1116  }else{
1117  mafilltcompmain(nef,ipnei,neifa,neiel,vfa,xxn,area,
1118  au,&au[*nflnei],jq,irow,&nzs,b,vel,umel,xlet,xle,gradtfa,xxi,
1119  body,volume,ielfa,lakonf,ifabou,nbody,nef,
1120  &dtimef,velo,veloo,cvfa,hcfa,cvel,gradvel,xload,gamma,
1121  xrlfa,xxj,nactdohinv,&a1,&a2,&a3,flux,iau6,xxni,xxnj);
1122  }
1123 
1124  isym=0;
1125  nelt=*nflnei+*nef;
1126  lrgw=131+16**nef;
1127  NNEW(rgwk,double,lrgw);
1128  NNEW(igwk,ITG,20);
1129  for(i=0;i<*nef;i++){rwork[i]=1./au[*nflnei+i];}
1130  memcpy(&temp[0],&vel[6**nef],sizeof(double)**nef);
1131  FORTRAN(predgmres,(nef,&b[0],&temp[0],&nelt,neielcp,ipnei,au,
1132  &isym,&itol,&tol,&itmax,&iter,
1133  &err,&ierr,&iunit,sb,sx,rgwk,&lrgw,igwk,
1134  &ligw,rwork,iwork));
1135  SFREE(rgwk);SFREE(igwk);
1136  if(ierr>0){
1137  printf("*WARNING in compfluid: error message from predgmres (k)=%d\n",ierr);
1138  }
1139 
1140  /* calculating the lhs and rhs of the omega-equation */
1141 
1142  DMEMSET(au,0,*nflnei+*nef,0.);
1143  DMEMSET(b,0,*nef,0.);
1144 
1145  /* calculate gamma (Ph.D. Thesis Jasak) */
1146 
1147  FORTRAN(calcgammao,(nface,ielfa,vel,gradoel,gamma,xlet,xxn,xxj,
1148  ipnei,&betam,nef,flux));
1149 
1150  if(compressible==0){
1151  mafillomain(nef,ipnei,neifa,neiel,vfa,xxn,area,
1152  au,&au[*nflnei],jq,irow,&nzs,b,vel,umfa,xlet,xle,gradofa,xxi,
1153  body,volume,ielfa,lakonf,ifabou,nbody,nef,
1154  &dtimef,velo,veloo,cvfa,hcfa,cvel,gradvel,xload,gamma,
1155  xrlfa,xxj,nactdohinv,&a1,&a2,&a3,flux,iau6,xxni,xxnj,
1156  iturbulent,gradkel,gradoel);
1157  }else{
1158  mafilltcompmain(nef,ipnei,neifa,neiel,vfa,xxn,area,
1159  au,&au[*nflnei],jq,irow,&nzs,b,vel,umel,xlet,xle,gradtfa,xxi,
1160  body,volume,ielfa,lakonf,ifabou,nbody,nef,
1161  &dtimef,velo,veloo,cvfa,hcfa,cvel,gradvel,xload,gamma,
1162  xrlfa,xxj,nactdohinv,&a1,&a2,&a3,flux,iau6,xxni,xxnj);
1163  }
1164 
1165  isym=0;
1166  nelt=*nflnei+*nef;
1167  lrgw=131+16**nef;
1168  NNEW(rgwk,double,lrgw);
1169  NNEW(igwk,ITG,20);
1170  for(i=0;i<*nef;i++){rwork[i]=1./au[*nflnei+i];}
1171  FORTRAN(predgmres,(nef,&b[0],&vel[7**nef],&nelt,neielcp,ipnei,au,
1172  &isym,&itol,&tol,&itmax,&iter,
1173  &err,&ierr,&iunit,sb,sx,rgwk,&lrgw,igwk,
1174  &ligw,rwork,iwork));
1175  SFREE(rgwk);SFREE(igwk);
1176  if(ierr>0){
1177  printf("*WARNING in compfluid: error message from predgmres (om)=%d\n",ierr);
1178  }
1179 
1180  /* storing the updated k-values into vel */
1181 
1182  memcpy(&vel[6**nef],&temp[0],sizeof(double)**nef);
1183 
1184  /* extrapolation of the turbulence variables at the element centers
1185  to the face centers */
1186 
1187  FORTRAN(extrapol_kel,(nface,ielfa,xrlfa,vel,vfa,
1188  ifabou,xbounact,nef,gradkel,gradkfa,neifa,rf,area,volume,
1189  xle,xxi,&icyclic,xxn,ipnei,ifatie,xlet,xxj,
1190  coefmpc,nmpc,labmpc,ipompc,nodempc,ifaext,nfaext,nactdoh,
1191  umfa,physcon));
1192 
1193  FORTRAN(extrapol_oel,(nface,ielfa,xrlfa,vel,vfa,
1194  ifabou,xbounact,nef,gradoel,gradofa,neifa,rf,area,volume,
1195  xle,xxi,&icyclic,xxn,ipnei,ifatie,xlet,xxj,
1196  coefmpc,nmpc,labmpc,ipompc,nodempc,ifaext,nfaext,nactdoh,
1197  umfa,physcon,dy));
1198 
1199  }
1200 
1201  /* extrapolating the velocity from the elements centers to the face
1202  centers, thereby taking the boundary conditions into account */
1203 
1204  FORTRAN(extrapol_vel,(nface,ielfa,xrlfa,vel,vfa,
1205  ifabou,xbounact,ipnei,nef,&icyclic,c,ifatie,xxn,gradvel,
1206  gradvfa,neifa,rf,area,volume,xle,xxi,xxj,xlet,
1207  coefmpc,nmpc,labmpc,ipompc,nodempc,ifaext,nfaext,nactdoh));
1208 
1209 // FORTRAN(writevfa,(vfa,nface,nactdohinv,ielfa));
1210 
1211  /* end subiterations */
1212 
1213  for(i=0;i<5;i++){velnorm[i]=0;}
1214  FORTRAN(norm,(vel,velnorm,nef));
1215 
1216  relnormt=0.;
1217  relnormv=0.;
1218  relnormp=0.;
1219  relnormmax=0.;
1220 
1221  if(*ithermal!=0){
1222  if(velnorm[0]/(*nef)>1.e-10){
1223  relnormt=fabs(velnorm[0]-velnormo[0])/(velnormo[0]);
1224  if(relnormt>relnormmax) relnormmax=relnormt;
1225  }
1226  }
1227  if((velnorm[1]+velnorm[2]+velnorm[3])/(*nef)>1.e-10){
1228  relnormv=fabs(velnorm[1]+velnorm[2]+velnorm[3]-velnormo[1]-velnormo[2]-velnormo[3])/(velnormo[1]+velnormo[2]+velnormo[3]);
1229  if(relnormv>relnormmax) relnormmax=relnormv;
1230  }
1231  if(velnorm[4]/(*nef)>1.e-10){
1232  relnormp=fabs(velnorm[4]-velnormo[4])/(velnormo[4]);
1233  if(relnormp>relnormmax) relnormmax=relnormp;
1234  }
1235  if(iit==1){
1236  fprintf(f1,"%11.4e %11.4e %11.4e\n",relnormt,relnormv,relnormp);
1237  }
1238 
1239  memcpy(velnormo,velnorm,sizeof(double)*5);
1240 
1241  if((*nmethod==1)&&(compressible!=1)){
1242 
1243  /* steady state incompressible flow:
1244  calculate the velocity only once in each increment */
1245 
1246  if(relnormmax<1.e-10) iconvergence=1;
1247 // if(relnormmax<1.e-5) iconvergence=1;
1248  break;
1249  }else{
1250 
1251  /* compressible flow:
1252  calculate the velocity only once in each increment */
1253 
1254  if((compressible==1)&&(iit==1))break;
1255 
1256  /* incompressible transient flow:
1257  calculate the velocity repeatedly in each increment */
1258 
1259  if(relnormmax<1.e-3)break;
1260  }
1261 
1262  }while(1);
1263 
1264  if(((iincf/jout[1])*jout[1]==iincf)||(iconvergence==1)||
1265  (iincf==jmax[1])){
1266 
1267  /* calculating the stress and the heat flow at the
1268  integration points, if requested */
1269 
1270  if((strcmp1(&filab[3306],"SF ")==0)||
1271  (strcmp1(&filab[3480],"SVF ")==0))isti=1;
1272  if(strcmp1(&filab[3393],"HFLF")==0)iqfx=1;
1273  for(i=0;i<*nprint;i++){
1274  if(strcmp1(&prlab[6*i],"SVF")==0) isti=1;
1275  if(strcmp1(&prlab[6*i],"HFLF")==0)iqfx=1;
1276  }
1277 
1278  /* calculating the heat conduction at the element centers */
1279 
1280  if(iqfx==1){
1281  NNEW(hcel,double,*nef);
1282  FORTRAN(calchcel,(vel,cocon,ncocon,ielmatf,ntmat_,mi,
1283  hcel,nef));
1284  }
1285 
1286  /* calculating the stress and/or the heat flux at the
1287  element centers */
1288 
1289  if((isti==1)||(iqfx==1)){
1290  FORTRAN(calcstressheatflux,(sti,umel,gradvel,qfx,hcel,
1291  gradtel,nef,&isti,&iqfx,mi));
1292  if(iqfx==1)SFREE(hcel);
1293  }
1294 
1295  /* extrapolating the stresses */
1296 
1297  if((strcmp1(&filab[3306],"SF ")==0)||
1298  (strcmp1(&filab[3480],"SVF ")==0)){
1299  nfield=6;
1300  ndim=6;
1301  if((*norien>0)&&
1302  ((strcmp1(&filab[3311],"L")==0)||(strcmp1(&filab[3485],"L")==0))){
1303  iorienglob=1;
1304  }else{
1305  iorienglob=0;
1306  }
1307  strcpy1(&cflag[0],&filab[2962],1);
1308  NNEW(stn,double,6**nk);
1309  FORTRAN(extrapolate,(sti,stn,ipkonf,inum,konf,lakonf,
1310  &nfield,nk,nef,mi,&ndim,orab,ielorienf,co,&iorienglob,
1311  cflag,vold,&force,ielmatf,thicke,ielpropf,prop));
1312  }
1313 
1314  /* extrapolating the heat flow */
1315 
1316 
1317  if(strcmp1(&filab[3393],"HFLF")==0){
1318  nfield=3;
1319  ndim=3;
1320  if((*norien>0)&&(strcmp1(&filab[3398],"L")==0)){
1321  iorienglob=1;
1322  }else{
1323  iorienglob=0;
1324  }
1325  strcpy1(&cflag[0],&filab[3049],1);
1326  NNEW(qfn,double,3**nk);
1327  FORTRAN(extrapolate,(qfx,qfn,ipkonf,inum,konf,lakonf,
1328  &nfield,nk,nef,mi,&ndim,orab,ielorienf,co,&iorienglob,
1329  cflag,vold,&force,ielmatf,thicke,ielpropf,prop));
1330  }
1331 
1332  /* extrapolating the facial values of the static temperature
1333  and/or the velocity and/or the static pressure to the nodes */
1334 
1335  if(imach){NNEW(xmach,double,*nk);}
1336  if(ikappa){NNEW(xkappa,double,*nk);}
1337  if(iturb){NNEW(xturb,double,2**nk);}
1338 
1339  FORTRAN(extrapolatefluid,(nk,iponofa,inofa,inum,vfa,vold,ielfa,
1340  ithermal,&imach,&ikappa,xmach,xkappa,shcon,nshcon,ntmat_,
1341  ielmatf,physcon,mi,&iturb,xturb));
1342 
1343  /* storing the results in dat-format */
1344 
1345  ptimef=ttimef+timef;
1346  FORTRAN(printoutfluid,(set,nset,istartset,iendset,ialset,nprint,
1347  prlab,prset,ipkonf,lakonf,sti,eei,
1348  xstate,ener,mi,nstate_,co,konf,qfx,
1349  &ptimef,trab,inotr,ntrans,orab,ielorienf,
1350  norien,vold,ielmatf,
1351  thicke,eme,xturb,physcon,nactdoh,
1352  ielpropf,prop,xkappa,xmach,ithermal,
1353  orname));
1354 
1355  /* thermal flux and drag: storage in dat-format */
1356 
1357  FORTRAN(printoutface,(co,rhcon,nrhcon,ntmat_,vold,shcon,nshcon,
1358  cocon,ncocon,&compressible,istartset,iendset,ipkonf,
1359  lakonf,konf,
1360  ialset,prset,&ptimef,nset,set,nprint,prlab,ielmatf,mi,
1361  ithermal,nactdoh,&icfd,time,stn));
1362 
1363  /* storing the results in frd-format */
1364 
1365  FORTRAN(frdfluid,(co,nk,konf,ipkonf,lakonf,nef,vold,&kode,&timef,ielmatf,
1366  matname,filab,inum,ntrans,inotr,trab,mi,istep,
1367  stn,qfn,nactdohinv,xmach,xkappa,physcon,xturb));
1368 
1369 // FORTRAN(writevfa,(vfa,nface,nactdohinv,ielfa));
1370 
1371  if((strcmp1(&filab[3306],"SF ")==0)||
1372  (strcmp1(&filab[3480],"SVF ")==0)){SFREE(stn);}
1373  if(strcmp1(&filab[3393],"HFLF")==0){SFREE(qfn);}
1374 
1375  if(imach){SFREE(xmach);}
1376  if(ikappa){SFREE(xkappa);}
1377  if(iturb){SFREE(xturb);}
1378 
1379  }
1380 
1381  if(iincf==jmax[1]){
1382  printf("*INFO: maximum number of fluid increments reached\n\n");
1383  fclose(f1);
1384  FORTRAN(stop,());
1385  }
1386  if(last==1){
1387  printf("*INFO: mechanical time increment reached: time=%e\n\n",*dtime);
1388  fclose(f1);
1389  FORTRAN(stop,());
1390  }
1391  if(iconvergence==1){
1392  printf("*INFO: steady state reached\n\n");
1393  fclose(f1);
1394  FORTRAN(stop,());
1395  }
1396 
1397 
1398  if((compressible==0)&&(*nblk==0)) memcpy(&veloo[0],&velo[0],sizeof(double)*8**nef);
1399  memcpy(&velo[0],&vel[0],sizeof(double)*8**nef);
1400 
1401  }while(1);
1402 
1403  FORTRAN(closefilefluid,());
1404 
1405  SFREE(flux);
1406 
1407  if(compressible!=1){SFREE(ia);SFREE(ja);SFREE(aua);}
1408 
1409  SFREE(irow);SFREE(icol);SFREE(jq);SFREE(iau6);SFREE(neielcp);
1410 
1411  SFREE(coel);SFREE(cosa);SFREE(xxn);SFREE(xxi);SFREE(xle);SFREE(xlen);
1412  SFREE(xlet);SFREE(cofa);SFREE(area);SFREE(xrlfa);SFREE(volume);
1413  SFREE(cosb);SFREE(xxni);SFREE(xxnj);SFREE(xxicn);SFREE(xxj);
1414  SFREE(rf);
1415  if(*iturbulent>0) SFREE(dy);
1416 
1417  SFREE(ifabou);SFREE(umfa);SFREE(umel);
1418 
1419  SFREE(gradvel);SFREE(gradvfa);SFREE(au);SFREE(ad);SFREE(b);SFREE(advfa);
1420  SFREE(ap);SFREE(bp);SFREE(gradpel);SFREE(rwork);
1421  SFREE(hfa);SFREE(hel);SFREE(adv);SFREE(bv);SFREE(sel);
1422  if(*nblk!=0){
1423  SFREE(auv6);SFREE(adv6);SFREE(auv3);SFREE(bv3);
1424  SFREE(vela);SFREE(velaa);
1425  }else{
1426  SFREE(auv);
1427  }
1428 
1429  if(*ithermal>0){
1430  SFREE(gradtel);SFREE(gradtfa);SFREE(hcfa);SFREE(cvel);SFREE(cvfa);
1431  }
1432 
1433  if(*iturbulent>0){
1434  SFREE(gradkel);SFREE(gradkfa);SFREE(gradoel);SFREE(gradofa);
1435  }
1436 
1437  SFREE(inum);SFREE(v);SFREE(velo);
1438  if((compressible==0)&&(*nblk==0)) SFREE(veloo);
1439 
1440  SFREE(iponofa);SFREE(inofa);
1441 
1442  if(*nbody>0) SFREE(body);
1443 
1444  *ithermal=ithermalref;
1445 
1446  SFREE(temp);SFREE(gamma);
1447 
1448  SFREE(gradpfa);
1449 
1450  return;
1451 
1452 }
#define ITGFORMAT
Definition: CalculiX.h:52
subroutine calchcel(vel, cocon, ncocon, ielmat, ntmat_, mi, hcel, nef)
Definition: calchcel.f:21
subroutine extrapolate_ad_h_comp(nface, ielfa, xrlfa, adv, advfa, hel, hfa, icyclic, c, ifatie)
Definition: extrapolate_ad_h_comp.f:21
subroutine convert2slapcol(au, ad, jq, nzs, nef, aua)
Definition: convert2slapcol.f:26
void mafilltmain(ITG *nef, ITG *ipnei, ITG *neifa, ITG *neiel, double *vfa, double *xxn, double *area, double *au, double *ad, ITG *jq, ITG *irow, ITG *nzs, double *b, double *vel, double *umel, double *xlet, double *xle, double *gradtfa, double *xxi, double *body, double *volume, ITG *ielfa, char *lakonf, ITG *ifabou, ITG *nbody, ITG *neq, double *dtimef, double *velo, double *veloo, double *cpfa, double *hcfa, double *cvel, double *gradvel, double *xload, double *gammat, double *xrlfa, double *xxj, ITG *nactdohinv, double *a1, double *a2, double *a3, double *flux, ITG *iau6, double *xxni, double *xxnj, ITG *iturbulent)
Definition: mafilltmain.c:35
subroutine calcguesstincf(nface, dmin, vfa, umfa, cvfa, hcfa, ithermal, tincfguess, compressible)
Definition: calcguesstincf.f:21
subroutine extrapolatefluid(nk, iponofa, inofa, inum, vfa, v, ielfa, ithermal, imach, ikappa, xmach, xkappa, shcon, nshcon, ntmat_, ielmat, physcon, mi, iturb, xturb)
Definition: extrapolatefluid.f:22
subroutine calccvfa(nface, vfa, shcon, nshcon, ielmat, ntmat_, mi, ielfa, cvfa, physcon)
Definition: calccvfa.f:21
subroutine complete_hel(nef, bv, hel, adv, auv, ipnei, neiel, nzs)
Definition: complete_hel.f:26
subroutine calcbody(nef, body, ipobody, ibody, xbody, coel, vel, lakon, nactdohinv)
Definition: calcbody.f:21
subroutine extrapol_oel(nface, ielfa, xrlfa, vel, vfa, ifabou, xbounact, nef, gradoel, gradofa, neifa, rf, area, volume, xle, xxi, icyclic, xxn, ipnei, ifatie, xlet, xxj, coefmpc, nmpc, labmpc, ipompc, nodempc, ifaext, nfaext, nactdoh, umfa, physcon, dy)
Definition: extrapol_oel.f:24
subroutine inicalcbody(nef, body, ipobody, ibody, xbody, coel, vel, lakon, nactdohinv, icent)
Definition: inicalcbody.f:21
subroutine extrapol_vel(nface, ielfa, xrlfa, vel, vfa, ifabou, xbounact, ipnei, nef, icyclic, c, ifatie, xxn, gradvel, gradvfa, neifa, rf, area, volume, xle, xxi, xxj, xlet, coefmpc, nmpc, labmpc, ipompc, nodempc, ifaext, nfaext, nactdoh)
Definition: extrapol_vel.f:23
subroutine printoutfluid(set, nset, istartset, iendset, ialset, nprint, prlab, prset, ipkonf, lakonf, sti, eei, xstate, ener, mi, nstate_, co, konf, qfx, ttime, trab, inotr, ntrans, orab, ielorienf, norien, vold, ielmatf, thicke, eme, xturb, physcon, nactdoh, ielpropf, prop, xkappa, xmach, ithermal, orname)
Definition: printoutfluid.f:25
subroutine cataloguenodes(iponofa, inofa, ifreefa, ielfa, ifabou, ipkon, konf, lakon, nface, nk)
Definition: cataloguenodes.f:21
subroutine calcgammat(nface, ielfa, vel, gradtel, gamma, xlet, xxn, xxj, ipnei, betam, nef, flux)
Definition: calcgammat.f:21
subroutine calcumel(nef, vel, shcon, nshcon, ielmat, ntmat_, ithermal, mi, umel)
Definition: calcumel.f:21
subroutine calcrhofa(nface, vfa, rhcon, nrhcon, ielmat, ntmat_, ithermal, mi, ielfa)
Definition: calcrhofa.f:21
void mafillpcompmain(ITG *ne, char *lakonf, ITG *ipnei, ITG *neifa, ITG *neiel, double *vfa, double *area, double *adfa, double *xlet, double *cosa, double *volume, double *au, double *ad, ITG *jq, ITG *irow, double *ap, ITG *ielfa, ITG *ifabou, double *xle, double *b, double *xxn, ITG *neq, ITG *nzs, double *hfa, double *gradpel, double *bp, double *xxi, ITG *neij, double *xlen, double *cosb, ITG *ielmatf, ITG *mi, double *a1, double *a2, double *a3, double *velo, double *veloo, double *dtimef, double *shcon, ITG *ntmat_, double *vel, ITG *nactdohinv, double *xrlfa, double *flux, ITG *iau6, double *xxicn, double *gamma)
Definition: mafillpcompmain.c:36
subroutine complete_hel_blk(vel, hel, auv6, ipnei, neiel, nef, nactdohinv)
Definition: complete_hel_blk.f:27
ITG strcpy1(char *s1, const char *s2, ITG length)
Definition: strcpy1.c:24
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
subroutine flux(node1, node2, nodem, nelem, lakon, kon, ipkon, nactdog, identity, ielprop, prop, kflag, v, xflow, f, nodef, idirf, df, cp, R, rho, physcon, g, co, dvi, numf, vold, set, shcon, nshcon, rhcon, nrhcon, ntmat_, mi, ider, ttime, time, iaxial)
Definition: flux.f:24
void mafillkmain(ITG *nef, ITG *ipnei, ITG *neifa, ITG *neiel, double *vfa, double *xxn, double *area, double *au, double *ad, ITG *jq, ITG *irow, ITG *nzs, double *b, double *vel, double *umel, double *xlet, double *xle, double *gradkfa, double *xxi, double *body, double *volume, ITG *ielfa, char *lakonf, ITG *ifabou, ITG *nbody, ITG *neq, double *dtimef, double *velo, double *veloo, double *cpfa, double *hcfa, double *cvel, double *gradvel, double *xload, double *gammat, double *xrlfa, double *xxj, ITG *nactdohinv, double *a1, double *a2, double *a3, double *flux, ITG *iau6, double *xxni, double *xxnj, ITG *iturbulent)
Definition: mafillkmain.c:35
ITG strcmp1(const char *s1, const char *s2)
Definition: strcmp1.c:24
subroutine calcinitialflux(area, vfa, xxn, ipnei, nef, neifa, lakonf, flux)
Definition: calcinitialflux.f:21
subroutine frdfluid(co, nk, konf, ipkonf, lakonf, nef, vold, kode, time, ielmat, matname, filab, inum, ntrans, inotr, trab, mi, istep, stn, qfn, nactdohinv, xmach, xkappa, physcon, xturb)
Definition: frdfluid.f:22
subroutine norm(vel, velnorm, nef)
Definition: norm.f:20
subroutine openfilefluid(jobname)
Definition: openfilefluid.f:20
ITG getSystemCPUs()
Definition: getSystemCPUs.c:40
subroutine tempload(xforcold, xforc, xforcact, iamforc, nforc, xloadold, xload, xloadact, iamload, nload, ibody, xbody, nbody, xbodyold, xbodyact, t1old, t1, t1act, iamt1, nk, amta, namta, nam, ampli, time, reltime, ttime, dtime, ithermal, nmethod, xbounold, xboun, xbounact, iamboun, nboun, nodeboun, ndirboun, nodeforc, ndirforc, istep, iinc, co, vold, itg, ntg, amname, ikboun, ilboun, nelemload, sideload, mi, ntrans, trab, inotr, veold, integerglob, doubleglob, tieset, istartset, iendset, ialset, ntie, nmpc, ipompc, ikmpc, ilmpc, nodempc, coefmpc, ipobody, iponoel, inoel)
Definition: tempload.f:29
#define DMEMSET(a, b, c, d)
Definition: CalculiX.h:45
subroutine extrapolate_ad_h(nface, ielfa, xrlfa, adv, advfa, hel, hfa, icyclic, c, ifatie)
Definition: extrapolate_ad_h.f:21
subroutine stop()
Definition: stop.f:20
subroutine preconvert2slapcol(irow, ia, jq, ja, nzs, nef)
Definition: preconvert2slapcol.f:26
subroutine dslugm(N, B, X, NELT, IA, JA, A, ISYM, NSAVE, ITOL, TOL, ITMAX, ITER, ERR, IERR, IUNIT, RWORK, LENW, IWORK, LENIW)
Definition: dslugm.f:4
subroutine extrapolate(yi, yn, ipkon, inum, kon, lakon, nfield, nk, ne, mi, ndim, orab, ielorien, co, iorienloc, cflag, vold, force, ielmat, thicke, ielprop, prop)
Definition: extrapolate.f:22
subroutine correctvel(hel, adv, vfa, ipnei, area, bv, xxn, neifa, lakonf, nef, neq)
Definition: correctvel.f:21
subroutine closefilefluid()
Definition: closefilefluid.f:20
subroutine calchcfa(nface, vfa, cocon, ncocon, ielmat, ntmat_, mi, ielfa, hcfa)
Definition: calchcfa.f:21
subroutine calcgamma(nface, ielfa, vel, gradvel, gamma, xlet, xxn, xxj, ipnei, betam, nef, flux)
Definition: calcgamma.f:21
subroutine calcstressheatflux(sti, umel, gradvel, qfx, hcel, gradtel, nef, isti, iqfx, mi)
Definition: calcstressheatflux.f:21
subroutine calcumfa(nface, vfa, shcon, nshcon, ielmat, ntmat_, ithermal, mi, ielfa, umfa)
Definition: calcumfa.f:21
subroutine predgmres(n, b, x, nelt, ia, ja, a, isym, itol, tol, itmax, iter, err, ierr, iunit, sb, sx, rgwk, lrgw, igwk, ligw, rwork, iwork)
Definition: predgmres.f:28
subroutine complete_hel_cyclic_blk(vel, hel, auv6, c, ipnei, neiel, neifa, ifatie, nef)
Definition: complete_hel_cyclic_blk.f:27
#define RENEW(a, b, c)
Definition: CalculiX.h:40
subroutine materialdata_cfd_comp(nef, vel, shcon, nshcon, ielmatf, ntmat_, mi, cvel, vfa, cocon, ncocon, physcon, cvfa, ithermal, nface, umel, umfa, ielfa, hcfa)
Definition: materialdata_cfd_comp.f:22
#define SFREE(a)
Definition: CalculiX.h:41
subroutine extrapol_pel(nface, ielfa, xrlfa, vel, vfa, ifabou, xbounact, nef, gradpel, gradpfa, neifa, rf, area, volume, xle, xxi, icyclic, xxn, ipnei, ifatie, coefmpc, nmpc, labmpc, ipompc, nodempc, ifaext, nfaext, nactdoh)
Definition: extrapol_pel.f:23
subroutine extrapol_kel(nface, ielfa, xrlfa, vel, vfa, ifabou, xbounact, nef, gradkel, gradkfa, neifa, rf, area, volume, xle, xxi, icyclic, xxn, ipnei, ifatie, xlet, xxj, coefmpc, nmpc, labmpc, ipompc, nodempc, ifaext, nfaext, nactdoh, umfa, physcon)
Definition: extrapol_kel.f:24
subroutine calcgammak(nface, ielfa, vel, gradkel, gamma, xlet, xxn, xxj, ipnei, betam, nef, flux)
Definition: calcgammak.f:21
subroutine calcrhoelcomp(nef, vel, shcon, ielmat, ntmat_, mi)
Definition: calcrhoelcomp.f:21
subroutine create_iau6(nef, ipnei, neiel, jq, irow, nzs, iau6, lakonf)
Definition: create_iau6.f:20
void mafillomain(ITG *nef, ITG *ipnei, ITG *neifa, ITG *neiel, double *vfa, double *xxn, double *area, double *au, double *ad, ITG *jq, ITG *irow, ITG *nzs, double *b, double *vel, double *umel, double *xlet, double *xle, double *gradofa, double *xxi, double *body, double *volume, ITG *ielfa, char *lakonf, ITG *ifabou, ITG *nbody, ITG *neq, double *dtimef, double *velo, double *veloo, double *cpfa, double *hcfa, double *cvel, double *gradvel, double *xload, double *gammat, double *xrlfa, double *xxj, ITG *nactdohinv, double *a1, double *a2, double *a3, double *flux, ITG *iau6, double *xxni, double *xxnj, ITG *iturbulent, double *gradkel, double *gradoel)
Definition: mafillomain.c:35
static double * f1
Definition: objectivemain_se.c:47
subroutine materialdata_cfd(nef, vel, shcon, nshcon, ielmatf, ntmat_, mi, cvel, vfa, cocon, ncocon, physcon, cvfa, ithermal, nface, umel, umfa, ielfa, hcfa, rhcon, nrhcon)
Definition: materialdata_cfd.f:22
subroutine extrapol_tel(nface, ielfa, xrlfa, vel, vfa, ifabou, xbounact, nef, gradtel, gradtfa, neifa, rf, area, volume, xle, xxi, icyclic, xxn, ipnei, ifatie, xload, xlet, xxj, coefmpc, nmpc, labmpc, ipompc, nodempc, ifaext, nfaext, nactdoh)
Definition: extrapol_tel.f:23
void mafillpmain(ITG *ne, char *lakonf, ITG *ipnei, ITG *neifa, ITG *neiel, double *vfa, double *area, double *adfa, double *xlet, double *cosa, double *volume, double *au, double *ad, ITG *jq, ITG *irow, double *ap, ITG *ielfa, ITG *ifabou, double *xle, double *b, double *xxn, ITG *neq, ITG *nzs, double *hfa, double *gradpel, double *bp, double *xxi, ITG *neij, double *xlen, double *cosb, ITG *iatleastonepressurebc, ITG *iau6, double *xxicn)
Definition: mafillpmain.c:33
void mafilltcompmain(ITG *nef, ITG *ipnei, ITG *neifa, ITG *neiel, double *vfa, double *xxn, double *area, double *au, double *ad, ITG *jq, ITG *irow, ITG *nzs, double *b, double *vel, double *umel, double *xlet, double *xle, double *gradtfa, double *xxi, double *body, double *volume, ITG *ielfa, char *lakonf, ITG *ifabou, ITG *nbody, ITG *neq, double *dtimef, double *velo, double *veloo, double *cpfa, double *hcfa, double *cvel, double *gradvel, double *xload, double *gammat, double *xrlfa, double *xxj, ITG *nactdohinv, double *a1, double *a2, double *a3, double *flux, ITG *iau6, double *xxni, double *xxnj)
Definition: mafilltcompmain.c:35
static ITG num_cpus
Definition: compfluid.c:37
subroutine complete_hel_cyclic(nef, bv, hel, adv, auv, jq, irow, ipnei, neiel, ifatie, c, lakonf, neifa, nzs)
Definition: complete_hel_cyclic.f:27
subroutine applyboun(ifaext, nfaext, ielfa, ikboun, ilboun, nboun, typeboun, nelemload, nload, sideload, isolidsurf, nsolidsurf, ifabou, nfabou, nface, nodeboun, ndirboun, ikmpc, ilmpc, labmpc, nmpc, nactdohinv, compressible, iatleastonepressurebc, ipkonf, kon, konf, nblk)
Definition: applyboun.f:24
subroutine printoutface(co, rhcon, nrhcon, ntmat_, vold, shcon, nshcon, cocon, ncocon, icompressible, istartset, iendset, ipkonf, lakonf, konf, ialset, prset, ttime, nset, set, nprint, prlab, ielmat, mi, ithermal, nactdoh, icfd, time, stn)
Definition: printoutface.f:23
void mastructf(ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, ITG *icol, ITG *jq, ITG **mast1p, ITG **irowp, ITG *isolver, ITG *ipointer, ITG *nzs, ITG *ipnei, ITG *ineiel, ITG *mi)
Definition: mastructf.c:27
subroutine calcrhoel(nef, vel, rhcon, nrhcon, ielmat, ntmat_, ithermal, mi)
Definition: calcrhoel.f:21
subroutine correctvfa(nface, ielfa, area, vfa, ap, bp, xxn, ifabou, ipnei, nef, neifa, hfa, vel, xboun, lakonf, flux)
Definition: correctvfa.f:21
subroutine calcrhofacomp(nface, vfa, shcon, ielmat, ntmat_, mi, ielfa, ipnei, vel, nef, flux, gradpel, gradtel, xxj, betam, xlet)
Definition: calcrhofacomp.f:22
subroutine calccvfacomp(nface, vfa, shcon, nshcon, ielmat, ntmat_, mi, ielfa, cvfa, physcon)
Definition: calccvfacomp.f:21
void rhspmain(ITG *ne, char *lakon, ITG *ipnei, ITG *neifa, ITG *neiel, double *vfa, double *area, double *adfa, double *xlet, double *cosa, double *volume, double *au, double *ad, ITG *jq, ITG *irow, double *ap, ITG *ielfa, ITG *ifabou, double *xle, double *b, double *xxn, ITG *neq, ITG *nzs, double *hfa, double *gradpel, double *bp, double *xxi, ITG *neij, double *xlen, ITG *iatleastonepressurebc, double *xxicn)
Definition: rhspmain.c:34
void mafillvcompmain(ITG *nef, ITG *ipnei, ITG *neifa, ITG *neiel, double *vfa, double *xxn, double *area, double *au, double *ad, ITG *jq, ITG *irow, ITG *nzs, double *b, double *vel, double *cosa, double *umfa, double *xlet, double *xle, double *gradvfa, double *xxi, double *body, double *volume, ITG *ielfa, char *lakonf, ITG *ifabou, ITG *nbody, double *dtimef, double *velo, double *veloo, double *sel, double *xrlfa, double *gamma, double *xxj, ITG *nactdohinv, double *a1, double *a2, double *a3, double *flux, ITG *icyclic, double *c, ITG *ifatie, ITG *iau6, double *xxni, double *xxnj)
Definition: mafillvcompmain.c:35
subroutine calcgammao(nface, ielfa, vel, gradoel, gamma, xlet, xxn, xxj, ipnei, betam, nef, flux)
Definition: calcgammao.f:21
#define ITG
Definition: CalculiX.h:51
void mafillvmain(ITG *nef, ITG *ipnei, ITG *neifa, ITG *neiel, double *vfa, double *xxn, double *area, double *au, double *ad, ITG *jq, ITG *irow, ITG *nzs, double *b, double *vel, double *cosa, double *umfa, double *xlet, double *xle, double *gradvfa, double *xxi, double *body, double *volume, ITG *ielfa, char *lakonf, ITG *ifabou, ITG *nbody, double *dtimef, double *velo, double *veloo, double *sel, double *xrlfa, double *gamma, double *xxj, ITG *nactdohinv, double *a1, double *a2, double *a3, double *flux, ITG *icyclic, double *c, ITG *ifatie, ITG *iau6, double *xxni, double *xxnj, ITG *iturbulent, double *gradvel)
Definition: mafillvmain.c:35
subroutine initialcfd(nef, ipkonf, konf, lakonf, co, coel, cofa, nface, ielfa, area, ipnei, neiel, xxn, xxi, xle, xlen, xlet, xrlfa, cosa, volume, neifa, xxj, cosb, dmin, ifatie, cs, tieset, icyclic, c, neij, physcon, isolidsurf, nsolidsurf, dy, xxni, xxnj, xxicn, nflnei, iturbulent, rf)
Definition: initialcfd.f:24
#define NNEW(a, b, c)
Definition: CalculiX.h:39
subroutine fill_neiel(nef, ipnei, neiel, neielcp)
Definition: fill_neiel.f:20

◆ complete_hel_blk_main()

void complete_hel_blk_main ( double *  vel,
double *  hel,
double *  auv6,
double *  c,
ITG ipnei,
ITG neiel,
ITG neifa,
ITG ifatie,
ITG nef 
)

◆ complexfreq()

void complexfreq ( double **  cop,
ITG nk,
ITG **  konp,
ITG **  ipkonp,
char **  lakonp,
ITG ne,
ITG **  nodebounp,
ITG **  ndirbounp,
double **  xbounp,
ITG nboun,
ITG **  ipompcp,
ITG **  nodempcp,
double **  coefmpcp,
char **  labmpcp,
ITG nmpc,
ITG nodeforc,
ITG ndirforc,
double *  xforc,
ITG nforc,
ITG nelemload,
char *  sideload,
double *  xload,
ITG nload,
ITG **  nactdofp,
ITG neq,
ITG nzl,
ITG icol,
ITG irow,
ITG nmethod,
ITG **  ikmpcp,
ITG **  ilmpcp,
ITG **  ikbounp,
ITG **  ilbounp,
double *  elcon,
ITG nelcon,
double *  rhcon,
ITG nrhcon,
double *  cocon,
ITG ncocon,
double *  alcon,
ITG nalcon,
double *  alzero,
ITG **  ielmatp,
ITG **  ielorienp,
ITG norien,
double *  orab,
ITG ntmat_,
double **  t0p,
double **  t1p,
ITG ithermal,
double *  prestr,
ITG iprestr,
double **  voldp,
ITG iperturb,
double **  stip,
ITG nzs,
double *  timepar,
double *  xmodal,
double **  veoldp,
char *  amname,
double *  amta,
ITG namta,
ITG nam,
ITG iamforc,
ITG iamload,
ITG **  iamt1p,
ITG jout,
ITG kode,
char *  filab,
double **  emep,
double *  xforcold,
double *  xloadold,
double **  t1oldp,
ITG **  iambounp,
double **  xbounoldp,
ITG iexpl,
double *  plicon,
ITG nplicon,
double *  plkcon,
ITG nplkcon,
double *  xstate,
ITG npmat_,
char *  matname,
ITG mi,
ITG ncmat_,
ITG nstate_,
double **  enerp,
char *  jobnamec,
double *  ttime,
char *  set,
ITG nset,
ITG istartset,
ITG iendset,
ITG **  ialsetp,
ITG nprint,
char *  prlab,
char *  prset,
ITG nener,
double *  trab,
ITG **  inotrp,
ITG ntrans,
double **  fmpcp,
char *  cbody,
ITG ibody,
double *  xbody,
ITG nbody,
double *  xbodyold,
ITG istep,
ITG isolver,
ITG jq,
char *  output,
ITG mcs,
ITG nkon,
ITG mpcend,
ITG ics,
double *  cs,
ITG ntie,
char *  tieset,
ITG idrct,
ITG jmax,
double *  ctrl,
ITG itpamp,
double *  tietol,
ITG nalset,
ITG ikforc,
ITG ilforc,
double *  thicke,
char *  jobnamef,
ITG mei,
ITG nmat,
ITG ielprop,
double *  prop,
char *  orname 
)
73  {
74 
75  char fneig[132]="",description[13]=" ",*lakon=NULL,*labmpc=NULL,
76  *lakont=NULL;
77 
78  ITG nev,i,j,k,idof,*inum=NULL,*ipobody=NULL,inewton=0,id,
79  iinc=0,l,iout=1,ielas,icmd=3,ifreebody,mode,m,nherm,
80  *kon=NULL,*ipkon=NULL,*ielmat=NULL,*ielorien=NULL,*islavact=NULL,
81  *inotr=NULL,*nodeboun=NULL,*ndirboun=NULL,*iamboun=NULL,*ikboun=NULL,
82  *ilboun=NULL,*nactdof=NULL,*ipompc=NULL,*nodempc=NULL,*ikmpc=NULL,
83  *ilmpc=NULL,nsectors,nmd,nevd,*nm=NULL,*iamt1=NULL,*islavnode=NULL,
84  ngraph=1,nkg,neg,ne0,ij,lprev,nope,indexe,ilength,*nslavnode=NULL,
85  *ipneigh=NULL,*neigh=NULL,index,im,cyclicsymmetry,inode,
86  *ialset=*ialsetp,mt=mi[1]+1,kmin,kmax,i1,iit=-1,network=0,
87  *iter=NULL,lint,lfin,kk,kkv,kk6,kkx,icomplex,igeneralizedforce,
88  idir,*inumt=NULL,icntrl,imag,jj,is,l1,*inocs=NULL,ml1,l2,nkt,net,
89  *ipkont=NULL,*ielmatt=NULL,*inotrt=NULL,*kont=NULL,node,iel,*ielcs=NULL,
90  ielset,*istartnmd=NULL,*iendnmd=NULL,inmd,neqact,*nshcon=NULL,
91  *ipev=NULL,icfd=0,*inomat=NULL,mortar=0,*islavsurf=NULL,
92  *iponoel=NULL,*inoel=NULL;
93 
94  long long i2;
95 
96  double *d=NULL, *z=NULL,*stiini=NULL,*cc=NULL,*v=NULL,*zz=NULL,*emn=NULL,
97  *stn=NULL, *stx=NULL, *een=NULL, *adb=NULL,*xstiff=NULL,*cdn=NULL,
98  *aub=NULL,*f=NULL, *fn=NULL,*epn=NULL,*xstateini=NULL,
99  *enern=NULL,*xstaten=NULL,*eei=NULL,*enerini=NULL,*qfn=NULL,
100  *qfx=NULL, *cgr=NULL, *au=NULL,dtime,reltime,*t0=NULL,*t1=NULL,*t1old=NULL,
101  sum,qa[4],cam[5],accold[1],bet,gam,*ad=NULL,alpham,betam,
102  *co=NULL,*xboun=NULL,*xbounold=NULL,*vold=NULL,*emeini=NULL,
103  *eme=NULL,*ener=NULL,*coefmpc=NULL,*fmpc=NULL,*veold=NULL,
104  *adc=NULL,*auc=NULL,*zc=NULL,*fnr=NULL,*fni=NULL,setnull,deltmx,dd,
105  theta,*vini=NULL,*vr=NULL,*vi=NULL,*stnr=NULL,*stni=NULL,*vmax=NULL,
106  *stnmax=NULL,*cstr=NULL,*sti=*stip,time0=0.0,time=0.0,zero=0.0,
107  *springarea=NULL,*eenmax=NULL,*aa=NULL,*bb=NULL,*xx=NULL,
108  *eiga=NULL,*eigb=NULL,*eigxx=NULL,*temp=NULL,*coefmpcnew=NULL,xreal,
109  ximag,t[3],*vt=NULL,*t1t=NULL,*stnt=NULL,*eent=NULL,*fnt=NULL,*enernt=NULL,
110  *stxt=NULL,pi,ctl,stl,*cot=NULL,*qfnt=NULL,vreal,vimag,constant,stnreal,
111  stnimag,freq,*emnt=NULL,*shcon=NULL,*eig=NULL,*clearini=NULL,
112  *eigxr=NULL,*eigxi=NULL,*xmac=NULL,*bett=NULL,*betm=NULL,*xmaccpx=NULL,
113  fmin=0.,fmax=1.e30,*xmr=NULL,*xmi=NULL,*zi=NULL,*eigx=NULL,
114  *pslavsurf=NULL,*pmastsurf=NULL,*cdnr=NULL,*cdni=NULL,*tinc,*tper,
115  *tmin,*tmax,*energyini=NULL,*energy=NULL;
116 
117  FILE *f1;
118 
119 #ifdef SGI
120  ITG token;
121 #endif
122 
123  pi=4.*atan(1.);
124  constant=180./pi;
125 
126  co=*cop;kon=*konp;ipkon=*ipkonp;lakon=*lakonp;ielmat=*ielmatp;
127  ielorien=*ielorienp;inotr=*inotrp;nodeboun=*nodebounp;
128  ndirboun=*ndirbounp;iamboun=*iambounp;xboun=*xbounp;
129  xbounold=*xbounoldp;ikboun=*ikbounp;ilboun=*ilbounp;nactdof=*nactdofp;
130  vold=*voldp;eme=*emep;ener=*enerp;ipompc=*ipompcp;nodempc=*nodempcp;
131  coefmpc=*coefmpcp;labmpc=*labmpcp;ikmpc=*ikmpcp;ilmpc=*ilmpcp;
132  fmpc=*fmpcp;veold=*veoldp;iamt1=*iamt1p;t0=*t0p;t1=*t1p;t1old=*t1oldp;
133 
134  tinc=&timepar[0];
135  tper=&timepar[1];
136  tmin=&timepar[2];
137  tmax=&timepar[3];
138 
139  if(ithermal[0]<=1){
140  kmin=1;kmax=3;
141  }else if(ithermal[0]==2){
142  kmin=0;kmax=mi[1];if(kmax>2)kmax=2;
143  }else{
144  kmin=0;kmax=3;
145  }
146 
147  NNEW(xstiff,double,(long long)27*mi[0]**ne);
148 
149  dtime=*tinc;
150 
151  alpham=xmodal[0];
152  betam=xmodal[1];
153 
154  dd=ctrl[16];deltmx=ctrl[26];
155 
156  /* determining nzl */
157 
158  *nzl=0;
159  for(i=neq[1];i>0;i--){
160  if(icol[i-1]>0){
161  *nzl=i;
162  break;
163  }
164  }
165 
166  /* opening the eigenvalue file and checking for cyclic symmetry */
167 
168  strcpy(fneig,jobnamec);
169  strcat(fneig,".eig");
170 
171  if((f1=fopen(fneig,"rb"))==NULL){
172  printf("*ERROR in complexfreq: cannot open eigenvalue file for reading");
173  exit(0);
174  }
175 
176  printf(" *INFO in complexfreq: if there are problems reading the .eig file this may be due to:\n");
177  printf(" 1) the nonexistence of the .eig file\n");
178  printf(" 2) other boundary conditions than in the input deck\n");
179  printf(" which created the .eig file\n\n");
180 
181  if(fread(&cyclicsymmetry,sizeof(ITG),1,f1)!=1){
182  printf("*ERROR in complexfreq reading the cyclic symmetry flag in the eigenvalue file");
183  exit(0);
184  }
185 
186  if(fread(&nherm,sizeof(ITG),1,f1)!=1){
187  printf("*ERROR in complexfreq reading the Hermitian flag in the eigenvalue file");
188  exit(0);
189  }
190 
191  if(nherm!=1){
192  printf("*ERROR in complexfreq: the eigenvectors in the .eig-file result\n");
193  printf(" from a non-Hermitian eigenvalue problem. The complex\n");
194  printf(" frequency procedure cannot handle that yet\n\n");
195  FORTRAN(stop,());
196  }
197 
198  nsectors=1;
199 
200  if(!cyclicsymmetry){
201 
202  nkg=*nk;
203  neg=*ne;
204 
205  if(fread(&nev,sizeof(ITG),1,f1)!=1){
206  printf("*ERROR in complexfreq reading the number of eigenvalues in the eigenvalue file...");
207  exit(0);
208  }
209 
210 
211  if(nherm==1){
212  NNEW(d,double,nev);
213  if(fread(d,sizeof(double),nev,f1)!=nev){
214  printf("*ERROR in complexfreq reading the eigenvalues in the eigenvalue file...");
215  exit(0);
216  }
217  }else{
218  NNEW(d,double,2*nev);
219  if(fread(d,sizeof(double),2*nev,f1)!=2*nev){
220  printf("*ERROR in complexfreq reading the eigenvalues in the eigenvalue file...");
221  exit(0);
222  }
223  }
224 
225  NNEW(ad,double,neq[1]);
226  NNEW(adb,double,neq[1]);
227  NNEW(au,double,nzs[2]);
228  NNEW(aub,double,nzs[1]);
229 
230  /* reading the stiffness matrix */
231 
232  if(fread(ad,sizeof(double),neq[1],f1)!=neq[1]){
233  printf("*ERROR in complexfreq reading the diagonal of the stiffness matrix in the eigenvalue file...");
234  exit(0);
235  }
236 
237  if(fread(au,sizeof(double),nzs[2],f1)!=nzs[2]){
238  printf("*ERROR in complexfreq reading the off-diagonal terms of the stiffness matrix in the eigenvalue file...");
239  exit(0);
240  }
241 
242  /* reading the mass matrix */
243 
244  if(fread(adb,sizeof(double),neq[1],f1)!=neq[1]){
245  printf("*ERROR in complexfreq reading the diagonal of the mass matrix in eigenvalue file...");
246  exit(0);
247  }
248 
249  if(fread(aub,sizeof(double),nzs[1],f1)!=nzs[1]){
250  printf("*ERROR in complexfreq reading the off-diagonals of the mass matrix in the eigenvalue file...");
251  exit(0);
252  }
253 
254  /* reading the eigenvectors */
255 
256  if(nherm==1){
257  NNEW(z,double,neq[1]*nev);
258  if(fread(z,sizeof(double),neq[1]*nev,f1)!=neq[1]*nev){
259  printf("*ERROR in complexfreq reading the eigenvectors in the eigenvalue file...");
260  exit(0);
261  }
262  }else{
263  NNEW(z,double,2*neq[1]*nev);
264  if(fread(z,sizeof(double),2*neq[1]*nev,f1)!=2*neq[1]*nev){
265  printf("*ERROR in complexfreq reading the eigenvectors in the eigenvalue file...");
266  exit(0);
267  }
268  }
269 
270  NNEW(nm,ITG,nev);
271  for(i=0;i<nev;i++){nm[i]=-1;}
272  }
273  else{
274 
275  if(*nmethod==6){
276  printf("*ERROR in complexfreq: Coriolis forces cannot\n");
277  printf(" be combined with cyclic symmetry\n\n");
278  FORTRAN(stop,());
279  }
280 
281  nev=0;
282  do{
283  if(fread(&nmd,sizeof(ITG),1,f1)!=1){
284  break;
285  }
286  if(fread(&nevd,sizeof(ITG),1,f1)!=1){
287  printf("*ERROR in complexfreq reading the number of eigenvalues in the eigenvalue file...");
288  exit(0);
289  }
290  if(nev==0){
291  if(nherm==1){NNEW(d,double,nevd);
292  }else{NNEW(d,double,2*nevd);}
293  NNEW(nm,ITG,nevd);
294  }else{
295  printf("*ERROR in complexfreq: flutter forces cannot\n");
296  printf(" be combined with multiple modal diameters\n");
297  printf(" in cyclic symmetry calculations\n\n");
298  FORTRAN(stop,());
299  }
300 
301  if(nherm==1){
302  if(fread(&d[nev],sizeof(double),nevd,f1)!=nevd){
303  printf("*ERROR in complexfreq reading the eigenvalues in the eigenvalue file...");
304  exit(0);
305  }
306  }else{
307  if(fread(&d[nev],sizeof(double),2*nevd,f1)!=2*nevd){
308  printf("*ERROR in complexfreq reading the eigenvalues in the eigenvalue file...");
309  exit(0);
310  }
311  }
312  for(i=nev;i<nev+nevd;i++){nm[i]=nmd;}
313 
314  if(nev==0){
315  NNEW(adb,double,neq[1]);
316  NNEW(aub,double,nzs[1]);
317 
318  if(fread(adb,sizeof(double),neq[1],f1)!=neq[1]){
319  printf("*ERROR in complexfreq reading the diagonal of the mass matrix in the eigenvalue file...");
320  exit(0);
321  }
322 
323  if(fread(aub,sizeof(double),nzs[1],f1)!=nzs[1]){
324  printf("*ERROR in complexfreq reading the off-diagonals of the mass matrix in the eigenvalue file...");
325  exit(0);
326  }
327  }
328 
329  if(nev==0){
330  NNEW(z,double,neq[1]*nevd);
331  }else{
332  RENEW(z,double,(long long)neq[1]*(nev+nevd));
333  }
334 
335  if(fread(&z[neq[1]*nev],sizeof(double),neq[1]*nevd,f1)!=neq[1]*nevd){
336  printf("*ERROR in complexfreq reading eigenvectors in the eigenvalue file...");
337  exit(0);
338  }
339  nev+=nevd;
340  }while(1);
341 
342  /* removing double eigenmodes */
343 
344  j=-1;
345  for(i=0;i<nev;i++){
346  if((i/2)*2==i){
347  j++;
348  if(nherm==1){
349  d[j]=d[i];
350  }else{
351  d[2*j]=d[2*i];d[2*j+1]=d[2*i+1];
352  }
353  nm[j]=nm[i];
354  for(k=0;k<neq[1];k++){
355  z[j*neq[1]+k]=z[i*neq[1]+k];
356  }
357  }
358  }
359  nev=j+1;
360  if(nherm==1){RENEW(d,double,nev);}else{RENEW(d,double,2*nev);}
361  RENEW(nm,ITG,nev);
362  RENEW(z,double,neq[1]*nev);
363 
364  /* determining the maximum amount of segments */
365 
366  for(i=0;i<*mcs;i++){
367  if(cs[17*i]>nsectors) nsectors=(ITG)(cs[17*i]+0.5);
368  }
369 
370  /* determining the maximum number of sectors to be plotted */
371 
372  for(j=0;j<*mcs;j++){
373  if(cs[17*j+4]>ngraph) ngraph=(ITG)cs[17*j+4];
374  }
375  nkg=*nk*ngraph;
376  neg=*ne*ngraph;
377 
378  }
379 
380  fclose(f1);
381 
382  /* assigning nodes and elements to sectors */
383 
384  if(cyclicsymmetry){
385  NNEW(inocs,ITG,*nk);
386  NNEW(ielcs,ITG,*ne);
387  ielset=cs[12];
388  if((*mcs!=1)||(ielset!=0)){
389  for(i=0;i<*nk;i++) inocs[i]=-1;
390  for(i=0;i<*ne;i++) ielcs[i]=-1;
391  }
392 
393  for(i=0;i<*mcs;i++){
394  is=cs[17*i+4];
395  if((is==1)&&(*mcs==1)) continue;
396  ielset=cs[17*i+12];
397  if(ielset==0) continue;
398  for(i1=istartset[ielset-1]-1;i1<iendset[ielset-1];i1++){
399  if(ialset[i1]>0){
400  iel=ialset[i1]-1;
401  if(ipkon[iel]<0) continue;
402  ielcs[iel]=i;
403  indexe=ipkon[iel];
404  if(strcmp1(&lakon[8*iel+3],"2")==0)nope=20;
405  else if (strcmp1(&lakon[8*iel+3],"8")==0)nope=8;
406  else if (strcmp1(&lakon[8*iel+3],"10")==0)nope=10;
407  else if (strcmp1(&lakon[8*iel+3],"4")==0)nope=4;
408  else if (strcmp1(&lakon[8*iel+3],"15")==0)nope=15;
409  else {nope=6;}
410  for(i2=0;i2<nope;++i2){
411  node=kon[indexe+i2]-1;
412  inocs[node]=i;
413  }
414  }
415  else{
416  iel=ialset[i1-2]-1;
417  do{
418  iel=iel-ialset[i1];
419  if(iel>=ialset[i1-1]-1) break;
420  if(ipkon[iel]<0) continue;
421  ielcs[iel]=i;
422  indexe=ipkon[iel];
423  if(strcmp1(&lakon[8*iel+3],"2")==0)nope=20;
424  else if (strcmp1(&lakon[8*iel+3],"8")==0)nope=8;
425  else if (strcmp1(&lakon[8*iel+3],"10")==0)nope=10;
426  else if (strcmp1(&lakon[8*iel+3],"4")==0)nope=4;
427  else if (strcmp1(&lakon[8*iel+3],"15")==0)nope=15;
428  else {nope=6;}
429  for(i2=0;i2<nope;++i2){
430  node=kon[indexe+i2]-1;
431  inocs[node]=i;
432  }
433  }while(1);
434  }
435  }
436  }
437  }
438 
439  /* check for rigid body modes
440  if there is a jump of 1.e4 in two subsequent eigenvalues
441  all eigenvalues preceding the jump are considered to
442  be rigid body modes and their frequency is set to zero */
443 
444  if(nherm==1){
445  setnull=1.;
446  for(i=nev-2;i>-1;i--){
447  if(fabs(d[i])<0.0001*fabs(d[i+1])) setnull=0.;
448  d[i]*=setnull;
449  }
450  }else{
451  setnull=1.;
452  for(i=nev-2;i>-1;i--){
453  if(sqrt(d[2*i]*d[2*i]+d[2*i+1]*d[2*i+1])<
454  0.0001*sqrt(d[2*i+2]*d[2*i+2]+d[2*i+3]*d[2*i+3])) setnull=0.;
455  d[2*i]*=setnull;
456  d[2*i+1]*=setnull;
457  }
458  }
459 
460  /* determining the frequency ranges corresponding to one
461  and the same nodal diameter */
462 
463  if(cyclicsymmetry){
464  NNEW(istartnmd,ITG,nev);
465  NNEW(iendnmd,ITG,nev);
466  nmd=0;
467  inmd=nm[0];
468  istartnmd[0]=1;
469  for(i=1;i<nev;i++){
470  if(nm[i]==inmd) continue;
471  iendnmd[nmd]=i;
472  nmd++;
473  istartnmd[nmd]=i+1;
474  inmd=nm[i];
475  }
476  iendnmd[nmd]=nev;
477  nmd++;
478  RENEW(istartnmd,ITG,nmd);
479  RENEW(iendnmd,ITG,nmd);
480  }
481 
482  if(*nmethod==6){
483 
484  /* Coriolis */
485 
486  neqact=neq[1];
487 
488  /* assigning the body forces to the elements */
489 
490  ifreebody=*ne+1;
491  NNEW(ipobody,ITG,2**ne);
492  for(k=1;k<=*nbody;k++){
493  FORTRAN(bodyforce,(cbody,ibody,ipobody,nbody,set,istartset,
494  iendset,ialset,&inewton,nset,&ifreebody,&k));
495  RENEW(ipobody,ITG,2*(*ne+ifreebody));
496  }
497  RENEW(ipobody,ITG,2*(ifreebody-1));
498 
499  if(cyclicsymmetry){
500  printf("*ERROR in complexfreq: dashpots are not allowed in combination with cyclic symmetry\n");
501  FORTRAN(stop,());
502  }
503 
504  NNEW(adc,double,neq[1]);
505  NNEW(auc,double,nzs[1]);
506  FORTRAN(mafillcorio,(co,nk,kon,ipkon,lakon,ne,nodeboun,ndirboun,
507  xboun,nboun,
508  ipompc,nodempc,coefmpc,nmpc,nodeforc,ndirforc,xforc,
509  nforc,nelemload,sideload,xload,nload,xbody,ipobody,nbody,cgr,
510  adc,auc,nactdof,icol,jq,irow,neq,nzl,nmethod,
511  ikmpc,ilmpc,ikboun,ilboun,
512  elcon,nelcon,rhcon,nrhcon,alcon,nalcon,alzero,ielmat,
513  ielorien,norien,orab,ntmat_,
514  t0,t0,ithermal,prestr,iprestr,vold,iperturb,sti,
515  nzs,stx,adb,aub,iexpl,plicon,nplicon,plkcon,nplkcon,
516  xstiff,npmat_,&dtime,matname,mi,ncmat_,
517  ttime,&time0,istep,&iinc,ibody,ielprop,prop));
518 
519  /* zc = damping matrix * eigenmodes */
520 
521  NNEW(zc,double,neq[1]*nev);
522  for(i=0;i<nev;i++){
523  FORTRAN(op_corio,(&neq[1],&z[i*neq[1]],&zc[i*neq[1]],adc,auc,
524  jq,irow));
525  }
526  SFREE(adc);SFREE(auc);
527 
528  /* cc is the reduced damping matrix (damping matrix mapped onto
529  space spanned by eigenmodes) */
530 
531  NNEW(cc,double,nev*nev);
532  for(i=0;i<nev;i++){
533  for(j=0;j<=i;j++){
534  for(k=0;k<neq[1];k++){
535  cc[i*nev+j]+=z[j*neq[1]+k]*zc[i*neq[1]+k];
536  }
537  }
538  }
539 
540  /* symmetric part of cc matrix */
541 
542  for(i=0;i<nev;i++){
543  for(j=i+1;j<nev;j++){
544  cc[i*nev+j]=-cc[j*nev+i];
545  }
546  }
547  SFREE(zc);
548 
549  /* solving for the complex eigenvalues */
550 
551  NNEW(aa,double,4*nev*nev);
552  NNEW(bb,double,4*nev*nev);
553  NNEW(xx,double,4*nev*nev);
554  NNEW(temp,double,4*nev*nev);
555  NNEW(eiga,double,2*nev);
556  NNEW(eigb,double,2*nev);
557  NNEW(eigxx,double,2*nev);
558  NNEW(iter,ITG,nev);
559 
560  FORTRAN(coriolissolve,(cc,&nev,aa,bb,xx,eiga,eigb,eigxx,
561  iter,d,temp));
562 
563  SFREE(aa);SFREE(bb);SFREE(temp);SFREE(eiga);SFREE(eigb);SFREE(iter);SFREE(cc);
564 
565  }else{
566 
567  /* flutter */
568 
569  /* complex force is being read (e.g. due to fluid flow) */
570 
571  if(cyclicsymmetry){
572  neqact=neq[1]/2;
573  }else{
574  neqact=neq[1];
575  }
576  NNEW(zc,double,2*neqact*nev);
577  NNEW(aa,double,4*nev*nev);
578 
579  FORTRAN(readforce,(zc,&neqact,&nev,nactdof,ikmpc,nmpc,
580  ipompc,nodempc,mi,coefmpc,jobnamef,
581  aa,&igeneralizedforce));
582 
583  NNEW(bb,double,4*nev*nev);
584  NNEW(xx,double,4*nev*nev);
585  NNEW(eiga,double,2*nev);
586  NNEW(eigb,double,2*nev);
587  NNEW(eigxx,double,2*nev);
588  NNEW(iter,ITG,nev);
589  FORTRAN(forcesolve,(zc,&nev,aa,bb,xx,eiga,eigb,eigxx,iter,d,
590  &neq[1],z,istartnmd,iendnmd,&nmd,&cyclicsymmetry,
591  &neqact,&igeneralizedforce));
592  SFREE(aa);SFREE(bb);SFREE(eiga);SFREE(eigb);SFREE(iter);SFREE(zc);
593 
594  }
595 
596 /* sorting the eigenvalues and eigenmodes according to the size of the
597  eigenvalues */
598 
599  NNEW(ipev,ITG,nev);
600  NNEW(eigxr,double,nev);
601  NNEW(aa,double,2*nev);
602  NNEW(bb,double,4*nev*nev);
603 
604  FORTRAN(sortev,(&nev,&nmd,eigxx,&cyclicsymmetry,xx,
605  eigxr,ipev,istartnmd,iendnmd,aa,bb));
606 
607  SFREE(ipev);SFREE(eigxr);SFREE(aa);SFREE(bb);
608 
609  /* storing the eigenvalues in the .dat file */
610 
611  if(cyclicsymmetry){
612  FORTRAN(writeevcscomplex,(eigxx,&nev,nm,&fmin,&fmax));
613  }else{
614  FORTRAN(writeevcomplex,(eigxx,&nev,&fmin,&fmax));
615  }
616 
617  /* storing the participation factors */
618 
619  NNEW(eigxr,double,nev);
620  NNEW(eigxi,double,nev);
621  if(nherm==1){
622  NNEW(eig,double,nev);
623  for(l=0;l<nev;l++){
624  if(d[l]<0.){
625  eig[l]=0.;
626  }else{
627  eig[l]=sqrt(d[l]);
628  }
629  }
630  }else{
631 
632  NNEW(eig,double,2*nev);
633  for(l=0;l<nev;l++){
634  eig[2*l]=sqrt(sqrt(d[2*l]*d[2*l]+d[2*l+1]*d[2*l+1])+d[2*l])/sqrt(2.);
635  eig[2*l+1]=sqrt(sqrt(d[2*l]*d[2*l]+d[2*l+1]*d[2*l+1])-d[2*l])/sqrt(2.);
636  if(d[2*l+1]<0.) eig[2*l+1]=-eig[2*l+1];
637  }
638  }
639  for(l=0;l<nev;l++){
640  mode=l+1;
641  for(k=0;k<nev;k++){
642  eigxr[k]=xx[2*l*nev+2*k];
643  eigxi[k]=xx[2*l*nev+2*k+1];
644  }
645  FORTRAN(writepf,(eig,eigxr,eigxi,&zero,&nev,&mode,&nherm));
646  }
647  SFREE(eigxr);SFREE(eigxi);SFREE(eig);SFREE(d);
648 
649  if(cyclicsymmetry){
650 
651  /* assembling the new eigenmodes */
652 
653  /* storage in zz: per eigenmode first the complete real part of
654  the eigenvector, then the complete imaginary part */
655 
656  NNEW(zz,double,(long long)2*nev*neqact);
657  for(l=0;l<nev;l++){
658  for(i=0;i<neqact;i++){
659  for(k=0;k<nev;k++){
660 
661  /* real part */
662 
663  zz[(long long)2*l*neqact+i]+=
664  (xx[2*l*nev+2*k]*z[(long long)2*k*neqact+i]
665  -xx[2*l*nev+2*k+1]*z[(long long)(2*k+1)*neqact+i]);
666 
667  /* imaginary part */
668 
669  zz[(long long)(2*l+1)*neqact+i]+=
670  (xx[2*l*nev+2*k]*z[(long long)(2*k+1)*neqact+i]
671  +xx[2*l*nev+2*k+1]*z[(long long)2*k*neqact+i]);
672  }
673  }
674  }
675 
676  /* calculating the scalar product of all old eigenmodes with
677  all new eigenmodes => nev x nev matrix */
678 
679  NNEW(xmac,double,nev*nev);
680  NNEW(xmaccpx,double,4*nev*nev);
681  NNEW(bett,double,nev);
682  NNEW(betm,double,nev);
683  FORTRAN(calcmac,(&neq[1],z,zz,&nev,xmac,xmaccpx,istartnmd,
684  iendnmd,&nmd,&cyclicsymmetry,&neqact,bett,betm));
685  FORTRAN(writemaccs,(xmac,&nev,nm));
686 
687  SFREE(xmac);SFREE(bett);SFREE(betm);SFREE(xmaccpx);
688  SFREE(z);
689 
690  /* normalizing the eigenmodes */
691 
692  NNEW(z,double,neq[1]);
693  for(l=0;l<nev;l++){
694  sum=0.;
695  DMEMSET(z,0,neq[1],0.);
696  FORTRAN(op,(&neq[1],&zz[l*neq[1]],z,adb,aub,jq,irow));
697  for(k=0;k<neq[1];k++){
698  sum+=zz[l*neq[1]+k]*z[k];
699  }
700 
701  sum=sqrt(sum);
702  for(k=0;k<neq[1];k++){
703  zz[l*neq[1]+k]/=sum;
704  }
705  }
706  SFREE(z);
707 
708  /* calculating the mass-weighted internal products (eigenvectors are not
709  necessarily orthogonal, since the matrix of the eigenvalue problem is
710  not necessarily Hermitian)
711  = orthogonality matrices */
712 
713  if(mei[3]==1){
714 
715  NNEW(xmr,double,nev*nev);
716  NNEW(xmi,double,nev*nev);
717  NNEW(z,double,neq[1]);
718  NNEW(zi,double,neq[1]);
719 
720  for(l=0;l<nev;l++){
721  DMEMSET(z,0,neq[1],0.);
722  FORTRAN(op,(&neq[1],&zz[l*neq[1]],z,adb,aub,jq,irow));
723  for(m=l;m<nev;m++){
724  for(k=0;k<neq[1];k++){
725  xmr[l*nev+m]+=zz[m*neq[1]+k]*z[k];
726  }
727  }
728 
729  memcpy(&zi[0],&zz[(2*l+1)*neqact],sizeof(double)*neqact);
730  for(k=0;k<neqact;k++){zi[neqact+k]=-zz[2*l*neqact+k];}
731  DMEMSET(z,0,neq[1],0.);
732  FORTRAN(op,(&neq[1],zi,z,adb,aub,jq,irow));
733  for(m=l;m<nev;m++){
734  for(k=0;k<neq[1];k++){
735  xmi[l*nev+m]+=zz[m*neq[1]+k]*z[k];
736  }
737  }
738  }
739 
740  /* Hermitian part of the matrix */
741 
742  for(l=0;l<nev;l++){
743  for(m=0;m<l;m++){
744  xmr[l*nev+m]=xmr[m*nev+l];
745  xmi[l*nev+m]=-xmi[m*nev+l];
746  }
747  }
748 
749  for(l=0;l<nev;l++){
750  for(m=0;m<nev;m++){
751  printf(" %f",xmr[m*nev+l]);
752  }
753  printf("\n");
754  }
755  printf("\n");
756  for(l=0;l<nev;l++){
757  for(m=0;m<nev;m++){
758  printf(" %f",xmi[m*nev+l]);
759  }
760  printf("\n");
761  }
762  SFREE(z);SFREE(zi);
763  }
764 
765  }else{
766 
767  /* no cyclic symmmetry */
768 
769  /* assembling the new eigenmodes */
770 
771  NNEW(zz,double,2*nev*neq[1]);
772  for(l=0;l<nev;l++){
773  for(j=0;j<2;j++){
774  for(i=0;i<neq[1];i++){
775  for(k=0;k<nev;k++){
776  zz[(2*l+j)*neq[1]+i]+=xx[2*l*nev+2*k+j]*
777  z[(long long)k*neq[1]+i];
778  }
779  }
780  }
781  }
782 
783  /* calculating the scalar product of all old eigenmodes with
784  all new eigenmodes => nev x nev matrix */
785 
786  NNEW(xmac,double,nev*nev);
787  NNEW(xmaccpx,double,4*nev*nev);
788  NNEW(bett,double,nev);
789  NNEW(betm,double,nev);
790  FORTRAN(calcmac,(&neq[1],z,zz,&nev,xmac,xmaccpx,istartnmd,
791  iendnmd,&nmd,&cyclicsymmetry,&neqact,bett,betm));
792  FORTRAN(writemac,(xmac,&nev));
793  SFREE(xmac);SFREE(bett);SFREE(betm);SFREE(xmaccpx);
794 
795  SFREE(z);
796 
797  /* normalizing the eigenmodes */
798 
799  NNEW(z,double,neq[1]);
800  for(l=0;l<nev;l++){
801  sum=0.;
802 
803  /* Ureal^T*M*Ureal */
804 
805  DMEMSET(z,0,neq[1],0.);
806  FORTRAN(op,(&neq[1],&zz[2*l*neq[1]],z,adb,aub,jq,irow));
807  for(k=0;k<neq[1];k++){
808  sum+=zz[2*l*neq[1]+k]*z[k];
809  }
810 
811  /* Uimag^T*M*Uimag */
812 
813  DMEMSET(z,0,neq[1],0.);
814  FORTRAN(op,(&neq[1],&zz[(2*l+1)*neq[1]],z,adb,aub,jq,irow));
815  for(k=0;k<neq[1];k++){
816  sum+=zz[(2*l+1)*neq[1]+k]*z[k];
817  }
818 
819  sum=sqrt(sum);
820  for(k=0;k<2*neq[1];k++){
821  zz[2*l*neq[1]+k]/=sum;
822  }
823  }
824  SFREE(z);
825 
826  /* calculating the mass-weighted internal products (eigenvectors are not
827  necessarily orthogonal, since the matrix of the eigenvalue problem is
828  not necessarily symmetric)
829  = orthogonality matrices */
830 
831  if(mei[3]==1){
832 
833  NNEW(xmr,double,nev*nev);
834  NNEW(xmi,double,nev*nev);
835  NNEW(z,double,neq[1]);
836 
837  for(l=0;l<nev;l++){
838  sum=0.;
839 
840  /* M*Ureal */
841 
842  DMEMSET(z,0,neq[1],0.);
843  FORTRAN(op,(&neq[1],&zz[2*l*neq[1]],z,adb,aub,jq,irow));
844 
845  /* Ureal^T*M*Ureal and Uimag^T*M*Ureal */
846 
847  for(m=l;m<nev;m++){
848  for(k=0;k<neq[1];k++){
849  xmr[l*nev+m]+=zz[2*m*neq[1]+k]*z[k];
850  }
851  for(k=0;k<neq[1];k++){
852  xmi[l*nev+m]-=zz[(2*m+1)*neq[1]+k]*z[k];
853  }
854  }
855 
856  /* M*Uimag */
857 
858  DMEMSET(z,0,neq[1],0.);
859  FORTRAN(op,(&neq[1],&zz[(2*l+1)*neq[1]],z,adb,aub,jq,irow));
860 
861  /* Ureal^T*M*Uimag and Uimag^T*M*Uimag */
862 
863  for(m=l;m<nev;m++){
864  for(k=0;k<neq[1];k++){
865  xmr[l*nev+m]+=zz[(2*m+1)*neq[1]+k]*z[k];
866  }
867  for(k=0;k<neq[1];k++){
868  xmi[l*nev+m]+=zz[2*m*neq[1]+k]*z[k];
869  }
870  }
871  }
872 
873  /* Hermitian part of the matrix */
874 
875  for(l=0;l<nev;l++){
876  for(m=0;m<l;m++){
877  xmr[l*nev+m]=xmr[m*nev+l];
878  xmi[l*nev+m]=-xmi[m*nev+l];
879  }
880  }
881 
882  for(l=0;l<nev;l++){
883  for(m=0;m<nev;m++){
884  printf(" %f",xmr[m*nev+l]);
885  }
886  printf("\n");
887  }
888  printf("\n");
889  for(l=0;l<nev;l++){
890  for(m=0;m<nev;m++){
891  printf(" %f",xmi[m*nev+l]);
892  }
893  printf("\n");
894  }
895  SFREE(z);
896  }
897 
898  }
899 
900  /*storing new eigenmodes and eigenvalues to *.eig-file for later use in
901  steady states dynamic analysis*/
902 
903  if(mei[3]==1){
904 
905  nherm=0;
906 
907  if(!cyclicsymmetry){
908  if((f1=fopen(fneig,"wb"))==NULL){
909  printf("*ERROR in complexfreq: cannot open eigenvalue file for writing...");
910  exit(0);
911  }
912 
913  /* storing a zero as indication that this was not a
914  cyclic symmetry calculation */
915 
916  if(fwrite(&cyclicsymmetry,sizeof(ITG),1,f1)!=1){
917  printf("*ERROR in complexfreq saving the cyclic symmetry flag to the eigenvalue file...");
918  exit(0);
919  }
920 
921  /* not Hermitian */
922 
923  if(fwrite(&nherm,sizeof(ITG),1,f1)!=1){
924  printf("*ERROR in complexfreq saving the Hermitian flag to the eigenvalue file...");
925  exit(0);
926  }
927 
928  /* storing the number of eigenvalues */
929 
930  if(fwrite(&nev,sizeof(ITG),1,f1)!=1){
931  printf("*ERROR in complexfreq saving the number of eigenfrequencies to the eigenvalue file...");
932  exit(0);
933  }
934 
935  /* the eigenfrequencies are stored as (radians/time)**2
936  squaring the complexe eigenvalues first */
937 
938  NNEW(eigx,double,2*nev);
939  for(i=0;i<nev;i++){
940  eigx[2*i]=eigxx[2*i]*eigxx[2*i]-eigxx[2*i+1]*eigxx[2*i+1];
941  eigx[2*i+1]=2.*eigxx[2*i]*eigxx[2*i+1];
942  }
943 
944  if(fwrite(eigx,sizeof(double),2*nev,f1)!=2*nev){
945  printf("*ERROR in complexfreq saving the eigenfrequencies to the eigenvalue file...");
946  exit(0);
947  }
948 
949  SFREE(eigx);
950 
951  /* storing the stiffness matrix */
952 
953  if(fwrite(ad,sizeof(double),neq[1],f1)!=neq[1]){
954  printf("*ERROR in complexfreq saving the diagonal of the stiffness matrix to the eigenvalue file...");
955  exit(0);
956  }
957  if(fwrite(au,sizeof(double),nzs[2],f1)!=nzs[2]){
958  printf("*ERROR in complexfreq saving the off-diagonal entries of the stiffness matrix to the eigenvalue file...");
959  exit(0);
960  }
961 
962  /* storing the mass matrix */
963 
964  if(fwrite(adb,sizeof(double),neq[1],f1)!=neq[1]){
965  printf("*ERROR in complexfreq saving the diagonal of the mass matrix to the eigenvalue file...");
966  exit(0);
967  }
968  if(fwrite(aub,sizeof(double),nzs[1],f1)!=nzs[1]){
969  printf("*ERROR in complexfreq saving the off-diagonal entries of the mass matrix to the eigenvalue file...");
970  exit(0);
971  }
972 
973  /* storing the eigenvectors */
974 
975  lfin=0;
976  lint=0;
977  for(j=0;j<nev;++j){
978  lint=lfin;
979  lfin=lfin+2*neq[1];
980  if(fwrite(&zz[lint],sizeof(double),2*neq[1],f1)!=2*neq[1]){
981  printf("*ERROR in complexfreq saving the eigenvectors to the eigenvalue file...");
982  exit(0);
983  }
984  }
985 
986  /* storing the orthogonality matrices */
987 
988  if(fwrite(xmr,sizeof(double),nev*nev,f1)!=nev*nev){
989  printf("*ERROR in complexfreq saving the real orthogonality matrix to the eigenvalue file...");
990  exit(0);
991  }
992 
993  if(fwrite(xmi,sizeof(double),nev*nev,f1)!=nev*nev){
994  printf("*ERROR in complexfreq saving the imaginary orthogonality matrix to the eigenvalue file...");
995  exit(0);
996  }
997 
998  }else{
999 
1000  /* opening .eig file for writing */
1001 
1002  if((f1=fopen(fneig,"wb"))==NULL){
1003  printf("*ERROR in complexfreq: cannot open eigenvalue file for writing...");
1004  exit(0);
1005  }
1006  /* storing a one as indication that this was a
1007  cyclic symmetry calculation */
1008 
1009  if(fwrite(&cyclicsymmetry,sizeof(ITG),1,f1)!=1){
1010  printf("*ERROR in complexfreq saving the cyclic symmetry flag to the eigenvalue file...");
1011  exit(0);
1012  }
1013 
1014  /* not Hermitian */
1015 
1016  if(fwrite(&nherm,sizeof(ITG),1,f1)!=1){
1017  printf("*ERROR in complexfreq saving the Hermitian flag to the eigenvalue file...");
1018  exit(0);
1019  }
1020 
1021  if(fwrite(&nm[0],sizeof(ITG),1,f1)!=1){
1022  printf("*ERROR in complexfreq saving the nodal diameter to the eigenvalue file...");
1023  exit(0);
1024  }
1025  if(fwrite(&nev,sizeof(ITG),1,f1)!=1){
1026  printf("*ERROR in complexfreq saving the number of eigenvalues to the eigenvalue file...");
1027  exit(0);
1028  }
1029 
1030  /* the eigenfrequencies are stored as (radians/time)**2
1031  squaring the complexe eigenvalues first */
1032 
1033  NNEW(eigx,double,2*nev);
1034  for(i=0;i<nev;i++){
1035  eigx[2*i]=eigxx[2*i]*eigxx[2*i]-eigxx[2*i+1]*eigxx[2*i+1];
1036  eigx[2*i+1]=2.*eigxx[2*i]*eigxx[2*i+1];
1037  }
1038 
1039  if(fwrite(eigx,sizeof(double),2*nev,f1)!=2*nev){
1040  printf("*ERROR in complexfreq saving the eigenfrequencies to the eigenvalue file...");
1041  exit(0);
1042  }
1043 
1044  SFREE(eigx);
1045 
1046  /* storing the mass matrix */
1047 
1048  if(fwrite(adb,sizeof(double),*neq,f1)!=*neq){
1049  printf("*ERROR in complexfreq saving the diagonal of the mass matrix to the eigenvalue file...");
1050  exit(0);
1051  }
1052  if(fwrite(aub,sizeof(double),*nzs,f1)!=*nzs){
1053  printf("*ERROR in complexfreq saving the off-diagonal terms of the mass matrix to the eigenvalue file...");
1054  exit(0);
1055  }
1056 
1057  /* storing the eigenvectors */
1058 
1059  lfin=0;
1060  for(j=0;j<nev;++j){
1061  lint=lfin;
1062  lfin=lfin+neq[1];
1063  if(fwrite(&zz[lint],sizeof(double),neq[1],f1)!=neq[1]){
1064  printf("*ERROR in complexfreq saving the eigenvectors to the eigenvalue file...");
1065  exit(0);
1066  }
1067  }
1068 
1069  /* storing the orthogonality matrices */
1070 
1071  if(fwrite(xmr,sizeof(double),nev*nev,f1)!=nev*nev){
1072  printf("*ERROR in complexfreq saving the real orthogonality matrix to the eigenvalue file...");
1073  exit(0);
1074  }
1075 
1076  if(fwrite(xmi,sizeof(double),nev*nev,f1)!=nev*nev){
1077  printf("*ERROR in complexfreq saving the imaginary orthogonality matrix to the eigenvalue file...");
1078  exit(0);
1079  }
1080  }
1081  SFREE(xmr);SFREE(xmi);
1082 
1083  fclose(f1);
1084  }
1085 
1086  SFREE(adb);SFREE(aub);
1087  if(!cyclicsymmetry){SFREE(ad);SFREE(au);}
1088 
1089  /* calculating the displacements and the stresses and storing */
1090  /* the results in frd format for each valid eigenmode */
1091 
1092  NNEW(v,double,2*mt**nk);
1093  NNEW(fn,double,2*mt**nk);
1094  if((strcmp1(&filab[174],"S ")==0)||(strcmp1(&filab[1653],"MAXS")==0)||
1095  (strcmp1(&filab[1479],"PHS ")==0)||(strcmp1(&filab[1044],"ZZS ")==0)||
1096  (strcmp1(&filab[1044],"ERR ")==0))
1097  NNEW(stn,double,12**nk);
1098 
1099  if((strcmp1(&filab[261],"E ")==0)||(strcmp1(&filab[2523],"MAXE")==0))
1100  NNEW(een,double,12**nk);
1101  if(strcmp1(&filab[522],"ENER")==0) NNEW(enern,double,2**nk);
1102  if(strcmp1(&filab[2697],"ME ")==0) NNEW(emn,double,12**nk);
1103 
1104  NNEW(inum,ITG,*nk);
1105  NNEW(stx,double,2*6*mi[0]**ne);
1106 
1107  NNEW(coefmpcnew,double,*mpcend);
1108 
1109  NNEW(cot,double,3**nk*ngraph);
1110  if(*ntrans>0){NNEW(inotrt,ITG,2**nk*ngraph);}
1111  if((strcmp1(&filab[0],"U ")==0)||(strcmp1(&filab[870],"PU ")==0))
1112 
1113 // real and imaginary part of the displacements
1114 
1115  NNEW(vt,double,2*mt**nk*ngraph);
1116  if(strcmp1(&filab[87],"NT ")==0)
1117  NNEW(t1t,double,*nk*ngraph);
1118  if((strcmp1(&filab[174],"S ")==0)||(strcmp1(&filab[1479],"PHS ")==0)||
1119  (strcmp1(&filab[1044],"ZZS ")==0)||(strcmp1(&filab[1044],"ERR ")==0))
1120 
1121 // real and imaginary part of the stresses
1122 
1123  NNEW(stnt,double,2*6**nk*ngraph);
1124  if(strcmp1(&filab[261],"E ")==0)
1125  NNEW(eent,double,2*6**nk*ngraph);
1126  if((strcmp1(&filab[348],"RF ")==0)||(strcmp1(&filab[2610],"PRF ")==0))
1127 
1128 // real and imaginary part of the forces
1129 
1130  NNEW(fnt,double,2*mt**nk*ngraph);
1131  if(strcmp1(&filab[522],"ENER")==0)
1132  NNEW(enernt,double,*nk*ngraph);
1133  if((strcmp1(&filab[1044],"ZZS ")==0)||(strcmp1(&filab[1044],"ERR ")==0))
1134  NNEW(stxt,double,2*6*mi[0]**ne*ngraph);
1135  if(strcmp1(&filab[2697],"ME ")==0)
1136  NNEW(emnt,double,2*6**nk*ngraph);
1137 
1138  NNEW(kont,ITG,*nkon*ngraph);
1139  NNEW(ipkont,ITG,*ne*ngraph);
1140  for(l=0;l<*ne*ngraph;l++)ipkont[l]=-1;
1141  NNEW(lakont,char,8**ne*ngraph);
1142  NNEW(inumt,ITG,*nk*ngraph);
1143  NNEW(ielmatt,ITG,mi[2]**ne*ngraph);
1144 
1145  nkt=ngraph**nk;
1146  net=ngraph**ne;
1147 
1148  /* copying the coordinates of the first sector */
1149 
1150  for(l=0;l<3**nk;l++){cot[l]=co[l];}
1151  if(*ntrans>0){for(l=0;l<*nk;l++){inotrt[2*l]=inotr[2*l];}}
1152  for(l=0;l<*nkon;l++){kont[l]=kon[l];}
1153  for(l=0;l<*ne;l++){ipkont[l]=ipkon[l];}
1154  for(l=0;l<8**ne;l++){lakont[l]=lakon[l];}
1155  for(l=0;l<*ne;l++){ielmatt[mi[2]*l]=ielmat[mi[2]*l];}
1156 
1157  /* generating the coordinates for the other sectors */
1158 
1159  if(cyclicsymmetry){
1160 
1161  icntrl=1;
1162 
1163  FORTRAN(rectcyl,(cot,v,fn,stn,qfn,een,cs,nk,&icntrl,t,filab,&imag,mi,emn));
1164 
1165  for(jj=0;jj<*mcs;jj++){
1166  is=cs[17*jj+4];
1167  for(i=1;i<is;i++){
1168 
1169  theta=i*2.*pi/cs[17*jj];
1170 
1171  for(l=0;l<*nk;l++){
1172  if(inocs[l]==jj){
1173  cot[3*l+i*3**nk]=cot[3*l];
1174  cot[1+3*l+i*3**nk]=cot[1+3*l]+theta;
1175  cot[2+3*l+i*3**nk]=cot[2+3*l];
1176  if(*ntrans>0){inotrt[2*l+i*2**nk]=inotrt[2*l];}
1177  }
1178  }
1179  for(l=0;l<*nkon;l++){kont[l+i**nkon]=kon[l]+i**nk;}
1180  for(l=0;l<*ne;l++){
1181  if(ielcs[l]==jj){
1182  if(ipkon[l]>=0){
1183  ipkont[l+i**ne]=ipkon[l]+i**nkon;
1184  ielmatt[mi[2]*(l+i**ne)]=ielmat[mi[2]*l];
1185  for(l1=0;l1<8;l1++){
1186  l2=8*l+l1;
1187  lakont[l2+i*8**ne]=lakon[l2];
1188  }
1189  }
1190  }
1191  }
1192  }
1193  }
1194 
1195  icntrl=-1;
1196 
1197  FORTRAN(rectcyl,(cot,vt,fnt,stnt,qfnt,eent,cs,&nkt,&icntrl,t,filab,
1198  &imag,mi,emnt));
1199  }
1200 
1201  /* check that the tensor fields which are extrapolated from the
1202  integration points are requested in global coordinates */
1203 
1204  if(strcmp1(&filab[174],"S ")==0){
1205  if((strcmp1(&filab[179],"L")==0)&&(*norien>0)){
1206  printf("\n*WARNING in complexfreq: element fields in cyclic symmetry calculations\n cannot be requested in local orientations;\n the global orientation will be used \n\n");
1207  strcpy1(&filab[179],"G",1);
1208  }
1209  }
1210 
1211  if(strcmp1(&filab[261],"E ")==0){
1212  if((strcmp1(&filab[266],"L")==0)&&(*norien>0)){
1213  printf("\n*WARNING in complexfreq: element fields in cyclic symmetry calculation\n cannot be requested in local orientations;\n the global orientation will be used \n\n");
1214  strcpy1(&filab[266],"G",1);
1215  }
1216  }
1217 
1218  if(strcmp1(&filab[1479],"PHS ")==0){
1219  if((strcmp1(&filab[1484],"L")==0)&&(*norien>0)){
1220  printf("\n*WARNING in complexfreq: element fields in cyclic symmetry calculation\n cannot be requested in local orientations;\n the global orientation will be used \n\n");
1221  strcpy1(&filab[1484],"G",1);
1222  }
1223  }
1224 
1225  if(strcmp1(&filab[1653],"MAXS")==0){
1226  if((strcmp1(&filab[1658],"L")==0)&&(*norien>0)){
1227  printf("\n*WARNING in complexfreq: element fields in cyclic symmetry calculation\n cannot be requested in local orientations;\n the global orientation will be used \n\n");
1228  strcpy1(&filab[1658],"G",1);
1229  }
1230  }
1231 
1232  if(strcmp1(&filab[2523],"MAXE")==0){
1233  if((strcmp1(&filab[2528],"L")==0)&&(*norien>0)){
1234  printf("\n*WARNING in complexfreq: element fields in cyclic symmetry calculation\n cannot be requested in local orientations;\n the global orientation will be used \n\n");
1235  strcpy1(&filab[1658],"G",1);
1236  }
1237  }
1238 
1239  /* allocating fields for magnitude and phase information of
1240  displacements and stresses */
1241 
1242  if(strcmp1(&filab[870],"PU")==0){
1243  NNEW(vr,double,mt*nkt);
1244  NNEW(vi,double,mt*nkt);
1245  }
1246 
1247  if(strcmp1(&filab[1479],"PHS")==0){
1248  NNEW(stnr,double,6*nkt);
1249  NNEW(stni,double,6*nkt);
1250  }
1251 
1252  if(strcmp1(&filab[1566],"MAXU")==0){
1253  NNEW(vmax,double,4*nkt);
1254  }
1255 
1256  if(strcmp1(&filab[1653],"MAXS")==0){
1257  NNEW(stnmax,double,7*nkt);
1258  }
1259 
1260  if(strcmp1(&filab[2523],"MAXE")==0){
1261  NNEW(eenmax,double,7*nkt);
1262  }
1263 
1264  /* storing the results */
1265 
1266  if(!cyclicsymmetry) (neq[1])*=2;
1267 
1268  lfin=0;
1269  for(j=0;j<nev;++j){
1270  lint=lfin;
1271  lfin=lfin+neq[1];
1272 
1273  /* calculating the cosine and sine */
1274 
1275  for(k=0;k<*mcs;k++){
1276  theta=nm[j]*2.*pi/cs[17*k];
1277  cs[17*k+14]=cos(theta);
1278  cs[17*k+15]=sin(theta);
1279  }
1280 
1281  if(*nprint>0)FORTRAN(writehe,(&j));
1282 
1283  NNEW(eei,double,6*mi[0]**ne);
1284  if(*nener==1){
1285  NNEW(stiini,double,6*mi[0]**ne);
1286  NNEW(emeini,double,6*mi[0]**ne);
1287  NNEW(enerini,double,mi[0]**ne);}
1288 
1289  DMEMSET(v,0,2*mt**nk,0.);
1290 
1291  for(k=0;k<neq[1];k+=neq[1]/2){
1292 
1293  for(i=0;i<6*mi[0]**ne;i++){eme[i]=0.;}
1294 
1295  if(k==0) {kk=0;kkv=0;kk6=0;kkx=0;if(*nprint>0)FORTRAN(writere,());}
1296  else {kk=*nk;kkv=mt**nk;kk6=6**nk;kkx=6*mi[0]**ne;
1297  if(*nprint>0)FORTRAN(writeim,());}
1298 
1299  /* generating the cyclic MPC's (needed for nodal diameters
1300  different from 0 */
1301 
1302  for(i=0;i<*nmpc;i++){
1303  index=ipompc[i]-1;
1304  /* check whether thermal mpc */
1305  if(nodempc[3*index+1]==0) continue;
1306  coefmpcnew[index]=coefmpc[index];
1307  while(1){
1308  index=nodempc[3*index+2];
1309  if(index==0) break;
1310  index--;
1311 
1312  icomplex=0;
1313  inode=nodempc[3*index];
1314  if(strcmp1(&labmpc[20*i],"CYCLIC")==0){
1315  icomplex=atoi(&labmpc[20*i+6]);}
1316  else if(strcmp1(&labmpc[20*i],"SUBCYCLIC")==0){
1317  for(ij=0;ij<*mcs;ij++){
1318  lprev=cs[ij*17+13];
1319  ilength=cs[ij*17+3];
1320  FORTRAN(nident,(&ics[lprev],&inode,&ilength,&id));
1321  if(id!=0){
1322  if(ics[lprev+id-1]==inode){icomplex=ij+1;break;}
1323  }
1324  }
1325  }
1326 
1327  if(icomplex!=0){
1328  idir=nodempc[3*index+1];
1329  idof=nactdof[mt*(inode-1)+idir]-1;
1330  if(idof<=-1){xreal=1.;ximag=1.;}
1331  else{xreal=zz[lint+idof];ximag=zz[lint+idof+neq[1]/2];}
1332  if(k==0) {
1333  if(fabs(xreal)<1.e-30)xreal=1.e-30;
1334  coefmpcnew[index]=coefmpc[index]*
1335  (cs[17*(icomplex-1)+14]+ximag/xreal*cs[17*(icomplex-1)+15]);}
1336  else {
1337  if(fabs(ximag)<1.e-30)ximag=1.e-30;
1338  coefmpcnew[index]=coefmpc[index]*
1339  (cs[17*(icomplex-1)+14]-xreal/ximag*cs[17*(icomplex-1)+15]);}
1340  }
1341  else{coefmpcnew[index]=coefmpc[index];}
1342  }
1343  }
1344 
1345  if(*iperturb==0){
1346  results(co,nk,kon,ipkon,lakon,ne,&v[kkv],&stn[kk6],inum,
1347  &stx[kkx],elcon,
1348  nelcon,rhcon,nrhcon,alcon,nalcon,alzero,ielmat,ielorien,
1349  norien,orab,ntmat_,t0,t0,ithermal,
1350  prestr,iprestr,filab,eme,&emn[kk6],&een[kk6],iperturb,
1351  f,&fn[kkv],nactdof,&iout,qa,vold,&zz[lint+k],
1352  nodeboun,ndirboun,xboun,nboun,ipompc,
1353  nodempc,coefmpcnew,labmpc,nmpc,nmethod,cam,&neq[1],veold,accold,
1354  &bet,&gam,&dtime,&time,ttime,plicon,nplicon,plkcon,nplkcon,
1355  xstateini,xstiff,xstate,npmat_,epn,matname,mi,&ielas,&icmd,
1356  ncmat_,nstate_,stiini,vini,ikboun,ilboun,ener,&enern[kk],emeini,
1357  xstaten,eei,enerini,cocon,ncocon,set,nset,istartset,iendset,
1358  ialset,nprint,prlab,prset,qfx,qfn,trab,inotr,ntrans,fmpc,
1359  nelemload,nload,ikmpc,ilmpc,istep,&iinc,springarea,&reltime,
1360  &ne0,xforc,nforc,thicke,shcon,nshcon,
1361  sideload,xload,xloadold,&icfd,inomat,pslavsurf,pmastsurf,
1362  &mortar,islavact,cdn,islavnode,nslavnode,ntie,clearini,
1363  islavsurf,ielprop,prop,energyini,energy,&iit,iponoel,
1364  inoel,nener,orname,&network,ipobody,xbody,ibody);}
1365  else{
1366  results(co,nk,kon,ipkon,lakon,ne,&v[kkv],&stn[kk6],inum,
1367  &stx[kkx],elcon,
1368  nelcon,rhcon,nrhcon,alcon,nalcon,alzero,ielmat,ielorien,
1369  norien,orab,ntmat_,t0,t1old,ithermal,
1370  prestr,iprestr,filab,eme,&emn[kk6],&een[kk6],iperturb,
1371  f,&fn[kkv],nactdof,&iout,qa,vold,&zz[lint+k],
1372  nodeboun,ndirboun,xboun,nboun,ipompc,
1373  nodempc,coefmpcnew,labmpc,nmpc,nmethod,cam,&neq[1],veold,accold,
1374  &bet,&gam,&dtime,&time,ttime,plicon,nplicon,plkcon,nplkcon,
1375  xstateini,xstiff,xstate,npmat_,epn,matname,mi,&ielas,&icmd,
1376  ncmat_,nstate_,stiini,vini,ikboun,ilboun,ener,&enern[kk],emeini,
1377  xstaten,eei,enerini,cocon,ncocon,set,nset,istartset,iendset,
1378  ialset,nprint,prlab,prset,qfx,qfn,trab,inotr,ntrans,fmpc,
1379  nelemload,nload,ikmpc,ilmpc,istep,&iinc,springarea,&reltime,
1380  &ne0,xforc,nforc,thicke,shcon,nshcon,
1381  sideload,xload,xloadold,&icfd,inomat,pslavsurf,pmastsurf,
1382  &mortar,islavact,cdn,islavnode,nslavnode,ntie,clearini,
1383  islavsurf,ielprop,prop,energyini,energy,&iit,iponoel,
1384  inoel,nener,orname,&network,ipobody,xbody,ibody);
1385  }
1386 
1387  }
1388  SFREE(eei);
1389  if(*nener==1){SFREE(stiini);SFREE(emeini);SFREE(enerini);}
1390 
1391  /* changing the basic results into cylindrical coordinates
1392  (only for cyclic symmetry structures */
1393 
1394  for(l=0;l<*nk;l++){inumt[l]=inum[l];}
1395 
1396  if(cyclicsymmetry){
1397  icntrl=2;imag=1;
1398  FORTRAN(rectcyl,(co,v,fn,stn,qfn,een,cs,nk,&icntrl,t,filab,&imag,mi,emn));
1399  }
1400 
1401  /* copying the basis results (real and imaginary) into
1402  a new field */
1403 
1404  if((strcmp1(&filab[0],"U ")==0)||(strcmp1(&filab[870],"PU ")==0)){
1405  for(l=0;l<mt**nk;l++){vt[l]=v[l];}
1406  for(l=0;l<mt**nk;l++){vt[l+mt**nk*ngraph]=v[l+mt**nk];}}
1407  if(strcmp1(&filab[87],"NT ")==0)
1408  for(l=0;l<*nk;l++){t1t[l]=t1[l];};
1409  if((strcmp1(&filab[174],"S ")==0)||(strcmp1(&filab[1479],"PHS ")==0)){
1410  for(l=0;l<6**nk;l++){stnt[l]=stn[l];}
1411  for(l=0;l<6**nk;l++){stnt[l+6**nk*ngraph]=stn[l+6**nk];}}
1412  if(strcmp1(&filab[261],"E ")==0){
1413  for(l=0;l<6**nk;l++){eent[l]=een[l];};
1414  for(l=0;l<6**nk;l++){eent[l+6**nk*ngraph]=een[l+6**nk];}}
1415  if((strcmp1(&filab[348],"RF ")==0)||(strcmp1(&filab[2610],"PRF ")==0)){
1416  for(l=0;l<mt**nk;l++){fnt[l]=fn[l];}
1417  for(l=0;l<mt**nk;l++){fnt[l+mt**nk*ngraph]=fn[l+mt**nk];}}
1418  if(strcmp1(&filab[522],"ENER")==0)
1419  for(l=0;l<*nk;l++){enernt[l]=enern[l];};
1420  if((strcmp1(&filab[1044],"ZZS ")==0)||(strcmp1(&filab[1044],"ERR ")==0)){
1421  for(l=0;l<6*mi[0]**ne;l++){stxt[l]=stx[l];}
1422  for(l=0;l<6*mi[0]**ne;l++){stxt[l+6*mi[0]**ne*ngraph]=stx[l+6*mi[0]**ne];}}
1423  if(strcmp1(&filab[2697],"ME ")==0){
1424  for(l=0;l<6**nk;l++){emnt[l]=emn[l];};
1425  for(l=0;l<6**nk;l++){emnt[l+6**nk*ngraph]=emn[l+6**nk];}}
1426 
1427  /* mapping the results to the other sectors
1428  (only for cyclic symmetric structures */
1429 
1430  if(cyclicsymmetry){
1431 
1432  for(jj=0;jj<*mcs;jj++){
1433  ilength=cs[17*jj+3];
1434  is=cs[17*jj+4];
1435  lprev=cs[17*jj+13];
1436  for(i=1;i<is;i++){
1437 
1438  for(l=0;l<*nk;l++){inumt[l+i**nk]=inum[l];}
1439 
1440  theta=i*nm[j]*2.*pi/cs[17*jj];
1441  ctl=cos(theta);
1442  stl=sin(theta);
1443 
1444  if((strcmp1(&filab[0],"U ")==0)||(strcmp1(&filab[870],"PU ")==0)){
1445  for(l1=0;l1<*nk;l1++){
1446  if(inocs[l1]==jj){
1447 
1448  /* check whether node lies on axis */
1449 
1450  ml1=-l1-1;
1451  FORTRAN(nident,(&ics[lprev],&ml1,&ilength,&id));
1452  if(id!=0){
1453  if(ics[lprev+id-1]==ml1){
1454  for(l2=0;l2<4;l2++){
1455  l=mt*l1+l2;
1456  vt[l+mt**nk*i]=v[l];
1457  }
1458  continue;
1459  }
1460  }
1461  for(l2=0;l2<4;l2++){
1462  l=mt*l1+l2;
1463  vt[l+mt**nk*i]=ctl*v[l]-stl*v[l+mt**nk];
1464  }
1465 
1466  }
1467  }
1468  }
1469 
1470  /* imaginary part of the displacements in cylindrical
1471  coordinates */
1472 
1473  if((strcmp1(&filab[0],"U ")==0)||(strcmp1(&filab[870],"PU ")==0)){
1474  for(l1=0;l1<*nk;l1++){
1475  if(inocs[l1]==jj){
1476 
1477  /* check whether node lies on axis */
1478 
1479  ml1=-l1-1;
1480  FORTRAN(nident,(&ics[lprev],&ml1,&ilength,&id));
1481  if(id!=0){
1482  if(ics[lprev+id-1]==ml1){
1483  for(l2=0;l2<4;l2++){
1484  l=mt*l1+l2;
1485  vt[l+mt**nk*(i+ngraph)]=v[l+mt**nk];
1486  }
1487  continue;
1488  }
1489  }
1490  for(l2=0;l2<4;l2++){
1491  l=mt*l1+l2;
1492  vt[l+mt**nk*(i+ngraph)]=stl*v[l]+ctl*v[l+mt**nk];
1493  }
1494  }
1495  }
1496  }
1497 
1498  if(strcmp1(&filab[87],"NT ")==0){
1499  for(l=0;l<*nk;l++){
1500  if(inocs[l]==jj) t1t[l+*nk*i]=t1[l];
1501  }
1502  }
1503 
1504  if((strcmp1(&filab[174],"S ")==0)||(strcmp1(&filab[1479],"PHS ")==0)){
1505  for(l1=0;l1<*nk;l1++){
1506  if(inocs[l1]==jj){
1507 
1508  /* check whether node lies on axis */
1509 
1510  ml1=-l1-1;
1511  FORTRAN(nident,(&ics[lprev],&ml1,&ilength,&id));
1512  if(id!=0){
1513  if(ics[lprev+id-1]==ml1){
1514  for(l2=0;l2<6;l2++){
1515  l=6*l1+l2;
1516  stnt[l+6**nk*i]=stn[l];
1517  }
1518  continue;
1519  }
1520  }
1521  for(l2=0;l2<6;l2++){
1522  l=6*l1+l2;
1523  stnt[l+6**nk*i]=ctl*stn[l]-stl*stn[l+6**nk];
1524  }
1525  }
1526  }
1527  }
1528 
1529  /* imaginary part of the stresses in cylindrical
1530  coordinates */
1531 
1532  if((strcmp1(&filab[174],"S ")==0)||(strcmp1(&filab[1479],"PHS ")==0)){
1533  for(l1=0;l1<*nk;l1++){
1534  if(inocs[l1]==jj){
1535 
1536  /* check whether node lies on axis */
1537 
1538  ml1=-l1-1;
1539  FORTRAN(nident,(&ics[lprev],&ml1,&ilength,&id));
1540  if(id!=0){
1541  if(ics[lprev+id-1]==ml1){
1542  for(l2=0;l2<6;l2++){
1543  l=6*l1+l2;
1544  stnt[l+6**nk*(i+ngraph)]=stn[l+6**nk];
1545  }
1546  continue;
1547  }
1548  }
1549  for(l2=0;l2<6;l2++){
1550  l=6*l1+l2;
1551  stnt[l+6**nk*(i+ngraph)]=stl*stn[l]+ctl*stn[l+6**nk];
1552  }
1553  }
1554  }
1555  }
1556 
1557  if(strcmp1(&filab[261],"E ")==0){
1558  for(l1=0;l1<*nk;l1++){
1559  if(inocs[l1]==jj){
1560 
1561  /* check whether node lies on axis */
1562 
1563  ml1=-l1-1;
1564  FORTRAN(nident,(&ics[lprev],&ml1,&ilength,&id));
1565  if(id!=0){
1566  if(ics[lprev+id-1]==ml1){
1567  for(l2=0;l2<6;l2++){
1568  l=6*l1+l2;
1569  eent[l+6**nk*i]=een[l];
1570  }
1571  continue;
1572  }
1573  }
1574  for(l2=0;l2<6;l2++){
1575  l=6*l1+l2;
1576  eent[l+6**nk*i]=ctl*een[l]-stl*een[l+6**nk];
1577  }
1578  }
1579  }
1580  }
1581 
1582  /* imaginary part of the strains in cylindrical
1583  coordinates */
1584 
1585  if(strcmp1(&filab[261],"E ")==0){
1586  for(l1=0;l1<*nk;l1++){
1587  if(inocs[l1]==jj){
1588 
1589  /* check whether node lies on axis */
1590 
1591  ml1=-l1-1;
1592  FORTRAN(nident,(&ics[lprev],&ml1,&ilength,&id));
1593  if(id!=0){
1594  if(ics[lprev+id-1]==ml1){
1595  for(l2=0;l2<6;l2++){
1596  l=6*l1+l2;
1597  eent[l+6**nk*(i+ngraph)]=een[l+6**nk];
1598  }
1599  continue;
1600  }
1601  }
1602  for(l2=0;l2<6;l2++){
1603  l=6*l1+l2;
1604  eent[l+6**nk*(i+ngraph)]=stl*een[l]+ctl*een[l+6**nk];
1605  }
1606  }
1607  }
1608  }
1609 
1610  if(strcmp1(&filab[2697],"ME ")==0){
1611  for(l1=0;l1<*nk;l1++){
1612  if(inocs[l1]==jj){
1613 
1614  /* check whether node lies on axis */
1615 
1616  ml1=-l1-1;
1617  FORTRAN(nident,(&ics[lprev],&ml1,&ilength,&id));
1618  if(id!=0){
1619  if(ics[lprev+id-1]==ml1){
1620  for(l2=0;l2<6;l2++){
1621  l=6*l1+l2;
1622  emnt[l+6**nk*i]=emn[l];
1623  }
1624  continue;
1625  }
1626  }
1627  for(l2=0;l2<6;l2++){
1628  l=6*l1+l2;
1629  emnt[l+6**nk*i]=ctl*emn[l]-stl*emn[l+6**nk];
1630  }
1631  }
1632  }
1633  }
1634 
1635  /* imaginary part of the mechanical strains in cylindrical
1636  coordinates */
1637 
1638  if(strcmp1(&filab[2697],"ME ")==0){
1639  for(l1=0;l1<*nk;l1++){
1640  if(inocs[l1]==jj){
1641 
1642  /* check whether node lies on axis */
1643 
1644  ml1=-l1-1;
1645  FORTRAN(nident,(&ics[lprev],&ml1,&ilength,&id));
1646  if(id!=0){
1647  if(ics[lprev+id-1]==ml1){
1648  for(l2=0;l2<6;l2++){
1649  l=6*l1+l2;
1650  emnt[l+6**nk*(i+ngraph)]=emn[l+6**nk];
1651  }
1652  continue;
1653  }
1654  }
1655  for(l2=0;l2<6;l2++){
1656  l=6*l1+l2;
1657  emnt[l+6**nk*(i+ngraph)]=stl*emn[l]+ctl*emn[l+6**nk];
1658  }
1659  }
1660  }
1661  }
1662 
1663  if((strcmp1(&filab[348],"RF ")==0)||(strcmp1(&filab[2610],"PRF ")==0)){
1664  for(l1=0;l1<*nk;l1++){
1665  if(inocs[l1]==jj){
1666 
1667  /* check whether node lies on axis */
1668 
1669  ml1=-l1-1;
1670  FORTRAN(nident,(&ics[lprev],&ml1,&ilength,&id));
1671  if(id!=0){
1672  if(ics[lprev+id-1]==ml1){
1673  for(l2=0;l2<4;l2++){
1674  l=mt*l1+l2;
1675  fnt[l+mt**nk*i]=fn[l];
1676  }
1677  continue;
1678  }
1679  }
1680  for(l2=0;l2<4;l2++){
1681  l=mt*l1+l2;
1682  fnt[l+mt**nk*i]=ctl*fn[l]-stl*fn[l+mt**nk];
1683  }
1684  }
1685  }
1686  }
1687 
1688  /* imaginary part of the forces in cylindrical
1689  coordinates */
1690 
1691  if((strcmp1(&filab[348],"RF ")==0)||(strcmp1(&filab[2610],"PRF ")==0)){
1692  for(l1=0;l1<*nk;l1++){
1693  if(inocs[l1]==jj){
1694 
1695  /* check whether node lies on axis */
1696 
1697  ml1=-l1-1;
1698  FORTRAN(nident,(&ics[lprev],&ml1,&ilength,&id));
1699  if(id!=0){
1700  if(ics[lprev+id-1]==ml1){
1701  for(l2=0;l2<4;l2++){
1702  l=mt*l1+l2;
1703  fnt[l+mt**nk*(i+ngraph)]=fn[l+mt**nk];
1704  }
1705  continue;
1706  }
1707  }
1708  for(l2=0;l2<4;l2++){
1709  l=mt*l1+l2;
1710  fnt[l+mt**nk*(i+ngraph)]=stl*fn[l]+ctl*fn[l+mt**nk];
1711  }
1712  }
1713  }
1714  }
1715 
1716  if(strcmp1(&filab[522],"ENER")==0){
1717  for(l=0;l<*nk;l++){
1718  if(inocs[l]==jj) enernt[l+*nk*i]=0.;
1719  }
1720  }
1721  }
1722  }
1723 
1724  icntrl=-2;imag=0;
1725 
1726  FORTRAN(rectcyl,(cot,vt,fnt,stnt,qfnt,eent,cs,&nkt,&icntrl,t,filab,
1727  &imag,mi,emnt));
1728 
1729  FORTRAN(rectcylvi,(cot,&vt[mt**nk*ngraph],&fnt[mt**nk*ngraph],
1730  &stnt[6**nk*ngraph],qfnt,&eent[6**nk*ngraph],
1731  cs,&nkt,&icntrl,t,filab,&imag,mi,&emnt[6**nk*ngraph]));
1732 
1733  }
1734 
1735  /* determining magnitude and phase angle for the displacements */
1736 
1737  if(strcmp1(&filab[870],"PU")==0){
1738  for(l1=0;l1<nkt;l1++){
1739  for(l2=0;l2<4;l2++){
1740  l=mt*l1+l2;
1741  vreal=vt[l];
1742  vimag=vt[l+mt**nk*ngraph];
1743  vr[l]=sqrt(vreal*vreal+vimag*vimag);
1744  if(fabs(vreal)<1.e-10){
1745  if(vimag>0){vi[l]=90.;}
1746  else{vi[l]=-90.;}
1747  }
1748  else{
1749  vi[l]=atan(vimag/vreal)*constant;
1750  if(vreal<0) vi[l]+=180.;
1751  }
1752  }
1753  }
1754  }
1755 
1756  /* determining magnitude and phase for the stress */
1757 
1758  if(strcmp1(&filab[1479],"PHS")==0){
1759  for(l1=0;l1<nkt;l1++){
1760  for(l2=0;l2<6;l2++){
1761  l=6*l1+l2;
1762  stnreal=stnt[l];
1763  stnimag=stnt[l+6**nk*ngraph];
1764  stnr[l]=sqrt(stnreal*stnreal+stnimag*stnimag);
1765  if(fabs(stnreal)<1.e-10){
1766  if(stnimag>0){stni[l]=90.;}
1767  else{stni[l]=-90.;}
1768  }
1769  else{
1770  stni[l]=atan(stnimag/stnreal)*constant;
1771  if(stnreal<0) stni[l]+=180.;
1772  }
1773  }
1774  }
1775  }
1776 
1777  ++*kode;
1778 
1779  /* storing the real part of the eigenfrequencies in freq */
1780 
1781  freq=eigxx[2*j]/6.283185308;
1782  if(strcmp1(&filab[1044],"ZZS")==0){
1783  NNEW(neigh,ITG,40*net);
1784  NNEW(ipneigh,ITG,nkt);
1785  }
1786  frd(cot,&nkt,kont,ipkont,lakont,&net,vt,stnt,inumt,nmethod,
1787  kode,filab,eent,t1t,fnt,&freq,epn,ielmatt,matname,enernt,xstaten,
1788  nstate_,istep,&iinc,ithermal,qfn,&j,&nm[j],trab,inotrt,
1789  ntrans,orab,ielorien,norien,description,ipneigh,neigh,
1790  mi,stxt,vr,vi,stnr,stni,vmax,stnmax,&ngraph,veold,ener,&net,
1791  cs,set,nset,istartset,iendset,ialset,eenmax,fnr,fni,emnt,
1792  thicke,jobnamec,output,qfx,cdn,&mortar,cdnr,cdni,nmat);
1793  if(strcmp1(&filab[1044],"ZZS")==0){SFREE(ipneigh);SFREE(neigh);}
1794  }
1795 
1796  SFREE(xstiff);if(*nbody>0) SFREE(ipobody);
1797  SFREE(cstr);SFREE(zz);SFREE(eigxx);SFREE(xx);
1798 
1799  if(cyclicsymmetry){
1800  SFREE(istartnmd);SFREE(iendnmd);
1801  }else{
1802  (neq[1])/=2;
1803  }
1804 
1805  SFREE(nm);SFREE(coefmpcnew);
1806 
1807  if((strcmp1(&filab[174],"S ")==0)||(strcmp1(&filab[1653],"MAXS")==0)||
1808  (strcmp1(&filab[1479],"PHS ")==0)||(strcmp1(&filab[1044],"ZZS ")==0)||
1809  (strcmp1(&filab[1044],"ERR ")==0))
1810  SFREE(stn);
1811 
1812  SFREE(v);SFREE(fn);SFREE(inum);SFREE(stx);
1813 
1814  if((strcmp1(&filab[261],"E ")==0)||(strcmp1(&filab[2523],"MAXE")==0)) SFREE(een);
1815  if(strcmp1(&filab[522],"ENER")==0) SFREE(enern);
1816  if(strcmp1(&filab[2697],"ME ")==0) SFREE(emn);
1817 
1818  if((strcmp1(&filab[0],"U ")==0)||(strcmp1(&filab[870],"PU ")==0)) SFREE(vt);
1819  if(strcmp1(&filab[87],"NT ")==0) SFREE(t1t);
1820  if((strcmp1(&filab[174],"S ")==0)||(strcmp1(&filab[1479],"PHS ")==0)||
1821  (strcmp1(&filab[1044],"ZZS ")==0)||(strcmp1(&filab[1044],"ERR ")==0)) SFREE(stnt);
1822  if(strcmp1(&filab[261],"E ")==0) SFREE(eent);
1823  if((strcmp1(&filab[348],"RF ")==0)||(strcmp1(&filab[2610],"PRF ")==0)) SFREE(fnt);
1824  if(strcmp1(&filab[522],"ENER")==0) SFREE(enernt);
1825  if((strcmp1(&filab[1044],"ZZS ")==0)||(strcmp1(&filab[1044],"ERR ")==0)) SFREE(stxt);
1826  if(strcmp1(&filab[2697],"ME ")==0) SFREE(emnt);
1827 
1828  SFREE(cot);SFREE(kont);SFREE(ipkont);SFREE(lakont);SFREE(inumt);SFREE(ielmatt);
1829  if(*ntrans>0){SFREE(inotrt);}
1830 
1831  *ialsetp=ialset;
1832  *cop=co;*konp=kon;*ipkonp=ipkon;*lakonp=lakon;*ielmatp=ielmat;
1833  *ielorienp=ielorien;*inotrp=inotr;*nodebounp=nodeboun;
1834  *ndirbounp=ndirboun;*iambounp=iamboun;*xbounp=xboun;
1835  *xbounoldp=xbounold;*ikbounp=ikboun;*ilbounp=ilboun;*nactdofp=nactdof;
1836  *voldp=vold;*emep=eme;*enerp=ener;*ipompcp=ipompc;*nodempcp=nodempc;
1837  *coefmpcp=coefmpc;*labmpcp=labmpc;*ikmpcp=ikmpc;*ilmpcp=ilmpc;
1838  *fmpcp=fmpc;*veoldp=veold;*iamt1p=iamt1;*t0p=t0;*t1oldp=t1old;*t1p=t1;
1839  *stip=sti;
1840 
1841  return;
1842 }
void frd(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne0, double *v, double *stn, ITG *inum, ITG *nmethod, ITG *kode, char *filab, double *een, double *t1, double *fn, double *time, double *epn, ITG *ielmat, char *matname, double *enern, double *xstaten, ITG *nstate_, ITG *istep, ITG *iinc, ITG *ithermal, double *qfn, ITG *mode, ITG *noddiam, double *trab, ITG *inotr, ITG *ntrans, double *orab, ITG *ielorien, ITG *norien, char *description, ITG *ipneigh, ITG *neigh, ITG *mi, double *stx, double *vr, double *vi, double *stnr, double *stni, double *vmax, double *stnmax, ITG *ngraph, double *veold, double *ener, ITG *ne, double *cs, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, double *eenmax, double *fnr, double *fni, double *emn, double *thicke, char *jobnamec, char *output, double *qfx, double *cdn, ITG *mortar, double *cdnr, double *cdni, ITG *nmat)
Definition: frd.c:32
subroutine writemac(mac, nev)
Definition: writemac.f:20
subroutine coriolissolve(cc, nev, a, b, x, eiga, eigb, eigcorio, iter, d, temp)
Definition: coriolissolve.f:21
ITG strcpy1(char *s1, const char *s2, ITG length)
Definition: strcpy1.c:24
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
subroutine op_corio(n, x, y, ad, au, jq, irow)
Definition: op_corio.f:27
subroutine op(n, x, y, ad, au, jq, irow)
Definition: op.f:26
ITG strcmp1(const char *s1, const char *s2)
Definition: strcmp1.c:24
subroutine writehe(j)
Definition: writehe.f:20
#define DMEMSET(a, b, c, d)
Definition: CalculiX.h:45
subroutine stop()
Definition: stop.f:20
subroutine rectcylvi(co, v, fn, stn, qfn, een, cs, n, icntrl, t, filab, imag, mi, emn)
Definition: rectcylvi.f:21
subroutine writemaccs(mac, nev, nm)
Definition: writemaccs.f:20
subroutine writepf(d, bjr, bji, freq, nev, mode, nherm)
Definition: writepf.f:20
subroutine writere()
Definition: writere.f:20
#define RENEW(a, b, c)
Definition: CalculiX.h:40
#define SFREE(a)
Definition: CalculiX.h:41
subroutine sortev(nev, nmd, eigxx, cyclicsymmetry, x, eigxr, ipev, istartnmd, iendnmd, a, b)
Definition: sortev.f:27
static double * f1
Definition: objectivemain_se.c:47
subroutine writeim()
Definition: writeim.f:20
subroutine nident(x, px, n, id)
Definition: nident.f:26
subroutine forcesolve(zc, nev, a, b, x, eiga, eigb, eigxx, iter, d, neq, z, istartnmd, iendnmd, nmd, cyclicsymmetry, neqact, igeneralizedforce)
Definition: forcesolve.f:22
subroutine readforce(zc, neq, nev, nactdof, ikmpc, nmpc, ipompc, nodempc, mi, coefmpc, jobnamef, a, igeneralizedforce)
Definition: readforce.f:21
subroutine calcmac(neq, z, zz, nev, xmac, xmaccpx, istartnmd, iendnmd, nmd, cyclicsymmetry, neqact, bett, betm)
Definition: calcmac.f:47
subroutine mafillcorio(co, nk, kon, ipkon, lakon, ne, nodeboun, ndirboun, xboun, nboun, ipompc, nodempc, coefmpc, nmpc, nodeforc, ndirforc, xforc, nforc, nelemload, sideload, xload, nload, xbody, ipobody, nbody, cgr, ad, au, nactdof, icol, jq, irow, neq, nzl, nmethod, ikmpc, ilmpc, ikboun, ilboun, elcon, nelcon, rhcon, nrhcon, alcon, nalcon, alzero, ielmat, ielorien, norien, orab, ntmat_, t0, t1, ithermal, prestr, iprestr, vold, iperturb, sti, nzs, stx, adb, aub, iexpl, plicon, nplicon, plkcon, nplkcon, xstiff, npmat_, dtime, matname, mi, ncmat_, ttime, time, istep, iinc, ibody, ielprop, prop)
Definition: mafillcorio.f:30
subroutine writeevcscomplex(x, nx, nm, fmin, fmax)
Definition: writeevcscomplex.f:20
#define ITG
Definition: CalculiX.h:51
void results(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, double *v, double *stn, ITG *inum, double *stx, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, double *prestr, ITG *iprestr, char *filab, double *eme, double *emn, double *een, ITG *iperturb, double *f, double *fn, ITG *nactdof, ITG *iout, double *qa, double *vold, double *b, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, char *labmpc, ITG *nmpc, ITG *nmethod, double *vmax, ITG *neq, double *veold, double *accold, double *beta, double *gamma, double *dtime, double *time, double *ttime, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstateini, double *xstiff, double *xstate, ITG *npmat_, double *epl, char *matname, ITG *mi, ITG *ielas, ITG *icmd, ITG *ncmat_, ITG *nstate_, double *stiini, double *vini, ITG *ikboun, ITG *ilboun, double *ener, double *enern, double *emeini, double *xstaten, double *eei, double *enerini, double *cocon, ITG *ncocon, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nprint, char *prlab, char *prset, double *qfx, double *qfn, double *trab, ITG *inotr, ITG *ntrans, double *fmpc, ITG *nelemload, ITG *nload, ITG *ikmpc, ITG *ilmpc, ITG *istep, ITG *iinc, double *springarea, double *reltime, ITG *ne0, double *xforc, ITG *nforc, double *thicke, double *shcon, ITG *nshcon, char *sideload, double *xload, double *xloadold, ITG *icfd, ITG *inomat, double *pslavsurf, double *pmastsurf, ITG *mortar, ITG *islavact, double *cdn, ITG *islavnode, ITG *nslavnode, ITG *ntie, double *clearini, ITG *islavsurf, ITG *ielprop, double *prop, double *energyini, double *energy, ITG *kscale, ITG *iponoel, ITG *inoel, ITG *nener, char *orname, ITG *network, ITG *ipobody, double *xbodyact, ITG *ibody)
Definition: results.c:42
#define NNEW(a, b, c)
Definition: CalculiX.h:39
subroutine bodyforce(cbody, ibody, ipobody, nbody, set, istartset, iendset, ialset, inewton, nset, ifreebody, k)
Definition: bodyforce.f:21
subroutine writeevcomplex(x, nx, fmin, fmax)
Definition: writeevcomplex.f:20
subroutine rectcyl(co, v, fn, stn, qfn, een, cs, n, icntrl, t, filab, imag, mi, emn)
Definition: rectcyl.f:21

◆ contact()

void contact ( 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,
ITG ifree,
double *  co,
double *  vold,
ITG ielmat,
double *  cs,
double *  elcon,
ITG istep,
ITG iinc,
ITG iit,
ITG ncmat_,
ITG ntmat_,
ITG ne0,
double *  vini,
ITG nmethod,
ITG iperturb,
ITG ikboun,
ITG nboun,
ITG mi,
ITG imastop,
ITG nslavnode,
ITG islavnode,
ITG islavsurf,
ITG itiefac,
double *  areaslav,
ITG iponoels,
ITG inoels,
double *  springarea,
double *  tietol,
double *  reltime,
ITG imastnode,
ITG nmastnode,
double *  xmastnor,
char *  filab,
ITG mcs,
ITG ics,
ITG nasym,
double *  xnoels,
ITG mortar,
double *  pslavsurf,
double *  pmastsurf,
double *  clearini,
double *  theta,
double *  xstateini,
double *  xstate,
ITG nstate_,
ITG icutb,
ITG ialeatoric,
char *  jobnamef 
)
40  {
41 
42  ITG i,ntrimax,*nx=NULL,*ny=NULL,*nz=NULL,im;
43 
44  double *xo=NULL,*yo=NULL,*zo=NULL,*x=NULL,*y=NULL,*z=NULL;
45 
46  /* next call is only for node-to-face penalty contact
47  setting up bordering planes for the master triangles;
48  these planes are common between neighboring traingles */
49 
50  if(*mortar==0){
51 
52  DMEMSET(xmastnor,0,3*nmastnode[*ntie],0.);
53 
54  FORTRAN(updatecontpen,(koncont,ncont,co,vold,
55  cg,straight,mi,imastnode,nmastnode,xmastnor,
56  ntie,tieset,nset,set,istartset,
57  iendset,ialset,ipkon,lakon,kon,cs,mcs,ics));
58  }
59 
60  /* determining the size of the auxiliary fields */
61 
62  ntrimax=0;
63  for(i=0;i<*ntie;i++){
64  if(itietri[2*i+1]-itietri[2*i]+1>ntrimax)
65  ntrimax=itietri[2*i+1]-itietri[2*i]+1;
66  }
67  NNEW(xo,double,ntrimax);
68  NNEW(yo,double,ntrimax);
69  NNEW(zo,double,ntrimax);
70  NNEW(x,double,ntrimax);
71  NNEW(y,double,ntrimax);
72  NNEW(z,double,ntrimax);
73  NNEW(nx,ITG,ntrimax);
74  NNEW(ny,ITG,ntrimax);
75  NNEW(nz,ITG,ntrimax);
76 
77  if(*mortar==0){
78 
79  FORTRAN(gencontelem_n2f,(tieset,ntie,itietri,ne,ipkon,kon,lakon,
80  cg,straight,ifree,koncont,
81  co,vold,xo,yo,zo,x,y,z,nx,ny,nz,ielmat,elcon,istep,
82  iinc,iit,ncmat_,ntmat_,nmethod,mi,
83  imastop,nslavnode,islavnode,islavsurf,itiefac,areaslav,iponoels,
84  inoels,springarea,
85  set,nset,istartset,iendset,ialset,tietol,reltime,
86  filab,nasym,xnoels,icutb,ne0,jobnamef));
87 
88  }else if(*mortar==1){
89 
90  FORTRAN(gencontelem_f2f,(tieset,ntie,itietri,ne,ipkon,kon,
91  lakon,cg,straight,ifree,koncont,co,vold,xo,yo,zo,x,y,z,nx,ny,nz,
92  ielmat,elcon,istep,iinc,iit,ncmat_,ntmat_,mi,imastop,islavsurf,
93  itiefac,springarea,tietol,reltime,filab,nasym,pslavsurf,pmastsurf,
94  clearini,theta,xstateini,xstate,nstate_,ne0,icutb,ialeatoric,
95  nmethod,jobnamef));
96 
97  }
98 
99  SFREE(xo);SFREE(yo);SFREE(zo);SFREE(x);SFREE(y);SFREE(z);SFREE(nx);
100  SFREE(ny);SFREE(nz);
101 
102  return;
103 }
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:23
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
#define DMEMSET(a, b, c, d)
Definition: CalculiX.h:45
subroutine gencontelem_f2f(tieset, ntie, itietri, ne, ipkon, kon, lakon, cg, straight, ifree, koncont, co, vold, xo, yo, zo, x, y, z, nx, ny, nz, ielmat, elcon, istep, iinc, iit, ncmat_, ntmat_, mi, imastop, islavsurf, itiefac, springarea, tietol, reltime, filab, nasym, pslavsurf, pmastsurf, clearini, theta, xstateini, xstate, nstate_, ne0, icutb, ialeatoric, nmethod, jobnamef)
Definition: gencontelem_f2f.f:25
#define SFREE(a)
Definition: CalculiX.h:41
subroutine gencontelem_n2f(tieset, ntie, itietri, ne, ipkon, kon, lakon, cg, straight, ifree, koncont, co, vold, xo, yo, zo, x, y, z, nx, ny, nz, ielmat, elcon, istep, iinc, iit, ncmat_, ntmat_, nmethod, mi, imastop, nslavnode, islavnode, islavsurf, itiefac, areaslav, iponoels, inoels, springarea, set, nset, istartset, iendset, ialset, tietol, reltime, filab, nasym, xnoels, icutb, ne0, jobnamef)
Definition: gencontelem_n2f.f:27
#define ITG
Definition: CalculiX.h:51
#define NNEW(a, b, c)
Definition: CalculiX.h:39

◆ ddotc1mt()

void* ddotc1mt ( ITG i)

◆ dfdbj()

void dfdbj ( double *  bcont,
double **  dbcontp,
ITG neq,
ITG nope,
ITG konl,
ITG nactdof,
double *  s,
double *  z,
ITG ikmpc,
ITG ilmpc,
ITG ipompc,
ITG nodempc,
ITG nmpc,
double *  coefmpc,
double *  fnl,
ITG nev,
ITG **  ikactcontp,
ITG **  ilactcontp,
ITG nactcont,
ITG nactcont_,
ITG mi,
ITG cyclicsymmetry,
ITG izdof,
ITG nzdof 
)
33  {
34 
35  ITG j,j1,jdof,kdof,k,k1,l,id,index,ist,id1,ist1,index1,id2,ist2,index2,
36  jdbcontcol,i1,i3,i4,mt=mi[1]+1,im,*ikactcont=*ikactcontp,
37  *ilactcont=*ilactcontp,kdofm1;
38 
39  double d1,sl,*dbcont=*dbcontp;
40 
41  for(j=0; j<*nope; j++){
42  i1=mt*(konl[j]-1)+1;
43  for(j1=0; j1<3; j1++){
44  jdof=nactdof[i1+j1];
45  if(jdof>0){
46  jdof--;
47  FORTRAN(nident,(ikactcont,&jdof,nactcont,&id));
48  do{
49  if(id>0){
50  if(ikactcont[id-1]==jdof){
51  jdbcontcol=ilactcont[id-1];
52  break;
53  }
54  }
55  (*nactcont)++;
56  if(*nactcont>*nactcont_){
57  *nactcont_=(ITG)(1.1**nactcont_);
58  RENEW(ikactcont,ITG,*nactcont_);
59  RENEW(ilactcont,ITG,*nactcont_);
60  RENEW(dbcont,double,*nev**nactcont_);
61  }
62  k=*nactcont-1;
63  l=k-1;
64  while(k>id){
65  ikactcont[k]=ikactcont[l];
66  ilactcont[k--]=ilactcont[l--];
67  }
68  jdbcontcol=*nactcont;
69  ikactcont[id]=jdof;
70  ilactcont[id]=*nactcont;
71 // memset(&dbcont[(*nactcont-1)**nev],0,sizeof(double)**nev);
72  DMEMSET(dbcont,(*nactcont-1)**nev,*nactcont**nev,0.);
73  break;
74  }while(1);
75  bcont[jdof]-=fnl[j*3+j1];
76  i4=(jdbcontcol-1)**nev;
77  i3=(3*j+j1);
78  for(k=0; k<*nope; k++){
79  for(k1=0; k1<3; k1++){
80  sl=s[(3*k+k1)*60+i3];
81  kdof=nactdof[mt*(konl[k]-1)+k1+1];
82  if(kdof>0){
83  if(!(*cyclicsymmetry)){
84  for(l=0; l<*nev; l++){
85  dbcont[i4+l]-=sl*z[(long long)l**neq+kdof-1];
86  }
87  }else{
88  kdofm1=kdof-1;
89  FORTRAN(nident,(izdof,&kdofm1,nzdof,&id));
90  if(id!=0){
91  if(izdof[id-1]==kdofm1){
92  for(l=0; l<*nev; l++){
93  dbcont[i4+l]-=sl*z[l**nzdof+id-1];
94  }
95  }else{printf("*ERROR in dfdbj\n");FORTRAN(stop,());}
96  }else{printf("*ERROR in dfdbj\n");FORTRAN(stop,());}
97  }
98  }
99  else{
100  kdof=8*(konl[k]-1)+k1+1;
101  FORTRAN(nident,(ikmpc,&kdof,nmpc,&id));
102  if(id>0){
103  id--;
104  if(ikmpc[id]==kdof){
105  id=ilmpc[id];
106  ist=ipompc[id-1];
107  ist--;
108  index=nodempc[ist*3+2];
109  if(index==0) continue;
110  index--;
111  do{
112  kdof=nactdof[mt*(nodempc[index*3]-1)+nodempc[index*3+1]];
113  d1=sl*coefmpc[index]/coefmpc[ist];
114  if(kdof>0){
115  if(!(*cyclicsymmetry)){
116  for(l=0; l<*nev; l++){
117  dbcont[i4+l]+=d1*z[(long long)l**neq+kdof-1];
118  }
119  }
120  }else{
121  kdofm1=kdof-1;
122  FORTRAN(nident,(izdof,&kdofm1,nzdof,&id));
123  if(id!=0){
124  if(izdof[id-1]==kdofm1){
125  for(l=0; l<*nev; l++){
126  dbcont[i4+l]+=d1*z[l**nzdof+id-1];
127  }
128  }else{printf("*ERROR in dfdbj\n");FORTRAN(stop,());}
129  }else{printf("*ERROR in dfdbj\n");FORTRAN(stop,());}
130  }
131  index=nodempc[index*3+2];
132  if(index==0) break;
133  index--;
134  }while(1);
135  }
136  }
137  }
138  }
139  }
140  }
141  else{
142  jdof=8*(konl[j]-1)+j1+1;
143  FORTRAN(nident,(ikmpc,&jdof,nmpc,&id1));
144  if(id1>0){
145  id1--;
146  if(ikmpc[id1]==jdof){
147  id1=ilmpc[id1];
148  ist1=ipompc[id1-1];
149  ist1--;
150  index1=nodempc[ist1*3+2];
151  if(index1==0) continue;
152  index1--;
153  do{
154  jdof=nactdof[mt*(nodempc[index1*3]-1)+nodempc[index1*3+1]];
155  if(jdof>0){
156  jdof--;
157  FORTRAN(nident,(ikactcont,&jdof,nactcont,&id));
158  do{
159  if(id>0){
160  if(ikactcont[id-1]==jdof){
161  jdbcontcol=ilactcont[id-1];
162  }
163  }
164  (*nactcont)++;
165  if(*nactcont>*nactcont_){
166  *nactcont_=(ITG)(1.1**nactcont_);
167  RENEW(ikactcont,ITG,*nactcont_);
168  RENEW(ilactcont,ITG,*nactcont_);
169  RENEW(dbcont,double,*nev**nactcont_);
170  }
171  k=*nactcont-1;
172  l=k-1;
173  do{
174  ikactcont[k]=ikactcont[l];
175  ilactcont[k--]=ilactcont[l--];
176  }while(k>id);
177  jdbcontcol=*nactcont;
178  ikactcont[id]=jdof;
179  ilactcont[id]=*nactcont;
180 // memset(&dbcont[(*nactcont-1)**nev],0,sizeof(double)**nev);
181  DMEMSET(dbcont,(*nactcont-1)**nev,*nactcont**nev,0.);
182  break;
183  }while(1);
184  bcont[jdof]+=coefmpc[index1]*fnl[j*3+j1]/coefmpc[ist1];
185  i4=(jdbcontcol-1)**nev;
186  i3=(3*j+j1);
187  for(k=0; k<*nope; k++){
188  for(k1=0; k1<3; k1++){
189  sl=s[(3*k+k1)*60+i3];
190  kdof=nactdof[mt*(konl[k]-1)+k1+1];
191  if(kdof>0){
192  d1=sl*coefmpc[index1]/coefmpc[ist1];
193  if(!(*cyclicsymmetry)){
194  for(l=0; l<*nev; l++){
195  dbcont[i4+l]+=d1*z[(long long)l**neq+kdof-1];
196  }
197  }else{
198  kdofm1=kdof-1;
199  FORTRAN(nident,(izdof,&kdofm1,nzdof,&id));
200  if(id!=0){
201  if(izdof[id-1]==kdofm1){
202  for(l=0; l<*nev; l++){
203  dbcont[i4+l]+=d1*z[l**nzdof+id-1];
204  }
205  }else{printf("*ERROR in dfdbj\n");FORTRAN(stop,());}
206  }else{printf("*ERROR in dfdbj\n");FORTRAN(stop,());}
207  }
208  }
209  else{
210  kdof=8*(konl[k]-1)+k1+1;
211  FORTRAN(nident,(ikmpc,&kdof,nmpc,&id2));
212  if(id2>0){
213  id2--;
214  if(ikmpc[id2]==kdof){
215  id2=ilmpc[id2];
216  ist2=ipompc[id2-1];
217  ist2--;
218  index2=nodempc[ist2*3+2];
219  if(index2==0) continue;
220  index2--;
221  do{
222  kdof=nactdof[mt*(nodempc[index2*3]-1)+nodempc[index2*3+1]];
223  if(kdof>0){
224  d1=sl*coefmpc[index1]*coefmpc[index2]/(coefmpc[ist1]*coefmpc[ist2]);
225  if(!(*cyclicsymmetry)){
226  for(l=0; l<*nev; l++){
227  dbcont[i4+l]-=d1*z[(long long)l**neq+kdof-1];
228  }
229  }else{
230  kdofm1=kdof-1;
231  FORTRAN(nident,(izdof,&kdofm1,nzdof,&id));
232  if(id!=0){
233  if(izdof[id-1]==kdofm1){
234  for(l=0; l<*nev; l++){
235  dbcont[i4+l]-=d1*z[l**nzdof+id-1];
236  }
237  }else{printf("*ERROR in dfdbj\n");FORTRAN(stop,());}
238  }else{printf("*ERROR in dfdbj\n");FORTRAN(stop,());}
239  }
240  }
241  index2=nodempc[index2*3+2];
242  if(index2==0) break;
243  index2--;
244  }while(1);
245  }
246  }
247  }
248  }
249  }
250  }
251  index1=nodempc[index1*3+2];
252  if(index1==0) break;
253  index1--;
254  }while(1);
255  }
256  }
257  }
258  }
259  }
260  *dbcontp=dbcont;
261  *ikactcontp=ikactcont;
262  *ilactcontp=ilactcont;
263 }
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
#define DMEMSET(a, b, c, d)
Definition: CalculiX.h:45
subroutine stop()
Definition: stop.f:20
#define RENEW(a, b, c)
Definition: CalculiX.h:40
subroutine nident(x, px, n, id)
Definition: nident.f:26
#define ITG
Definition: CalculiX.h:51

◆ dyna()

void dyna ( double **  cop,
ITG nk,
ITG **  konp,
ITG **  ipkonp,
char **  lakonp,
ITG ne,
ITG **  nodebounp,
ITG **  ndirbounp,
double **  xbounp,
ITG nboun,
ITG **  ipompcp,
ITG **  nodempcp,
double **  coefmpcp,
char **  labmpcp,
ITG nmpc,
ITG nodeforc,
ITG ndirforc,
double *  xforc,
ITG nforc,
ITG nelemload,
char *  sideload,
double *  xload,
ITG nload,
ITG **  nactdofp,
ITG neq,
ITG nzl,
ITG icol,
ITG irow,
ITG nmethod,
ITG **  ikmpcp,
ITG **  ilmpcp,
ITG **  ikbounp,
ITG **  ilbounp,
double *  elcon,
ITG nelcon,
double *  rhcon,
ITG nrhcon,
double *  cocon,
ITG ncocon,
double *  alcon,
ITG nalcon,
double *  alzero,
ITG **  ielmatp,
ITG **  ielorienp,
ITG norien,
double *  orab,
ITG ntmat_,
double **  t0p,
double **  t1p,
ITG ithermal,
double *  prestr,
ITG iprestr,
double **  voldp,
ITG iperturb,
double **  stip,
ITG nzs,
double *  timepar,
double *  xmodal,
double **  veoldp,
char *  amname,
double *  amta,
ITG namta,
ITG nam,
ITG iamforc,
ITG iamload,
ITG **  iamt1p,
ITG jout,
ITG kode,
char *  filab,
double **  emep,
double *  xforcold,
double *  xloadold,
double **  t1oldp,
ITG **  iambounp,
double **  xbounoldp,
ITG iexpl,
double *  plicon,
ITG nplicon,
double *  plkcon,
ITG nplkcon,
double **  xstatep,
ITG npmat_,
char *  matname,
ITG mi,
ITG ncmat_,
ITG nstate_,
double **  enerp,
char *  jobnamec,
double *  ttime,
char *  set,
ITG nset,
ITG istartset,
ITG iendset,
ITG **  ialsetp,
ITG nprint,
char *  prlab,
char *  prset,
ITG nener,
double *  trab,
ITG **  inotrp,
ITG ntrans,
double **  fmpcp,
char *  cbody,
ITG ibody,
double *  xbody,
ITG nbody,
double *  xbodyold,
ITG istep,
ITG isolver,
ITG jq,
char *  output,
ITG mcs,
ITG nkon,
ITG mpcend,
ITG ics,
double *  cs,
ITG ntie,
char *  tieset,
ITG idrct,
ITG jmax,
double *  ctrl,
ITG itpamp,
double *  tietol,
ITG nalset,
ITG ikforc,
ITG ilforc,
double *  thicke,
ITG nslavs,
ITG nmat,
char *  typeboun,
ITG ielprop,
double *  prop,
char *  orname 
)
71  {
72 
73  char fneig[132]="",description[13]=" ",*lakon=NULL,*labmpc=NULL,
74  *labmpcold=NULL,lakonl[9]=" \0",*tchar1=NULL,*tchar2=NULL,
75  *tchar3=NULL,cflag[1]=" ",jobnamef[396]="";
76 
77  ITG nev,i,j,k,idof,*inum=NULL,*ipobody=NULL,inewton=0,id,
78  iinc=0,jprint=0,l,iout,ielas=0,icmd=3,iprescribedboundary,init,ifreebody,
79  mode=-1,noddiam=-1,*kon=NULL,*ipkon=NULL,*ielmat=NULL,*ielorien=NULL,
80  *inotr=NULL,*nodeboun=NULL,*ndirboun=NULL,*iamboun=NULL,*ikboun=NULL,
81  *ilboun=NULL,*nactdof=NULL,*ipompc=NULL,*nodempc=NULL,*ikmpc=NULL,
82  *ilmpc=NULL,nsectors,nmpcold,mpcendold,*ipompcold=NULL,*nodempcold=NULL,
83  *ikmpcold=NULL,*ilmpcold=NULL,kflag=2,nmd,nevd,*nm=NULL,*iamt1=NULL,
84  *itg=NULL,ntg=0,symmetryflag=0,inputformat=0,dashpot,lrw,liw,iddebdf=0,
85  *iwork=NULL,ngraph=1,nkg,neg,ncont,ne0,nkon0, *itietri=NULL,
86  *koncont=NULL,konl[20],imat,nope,kodem,indexe,j1,jdof,icutb=0,
87  *ipneigh=NULL,*neigh=NULL,inext,itp=0,*islavact=NULL,
88  ismallsliding=0,isteadystate,mpcfree,im,cyclicsymmetry,
89  memmpc_,imax,*icole=NULL,*irowe=NULL,*jqe=NULL,nzse[3],
90  nalset_=*nalset,*ialset=*ialsetp,*istartset_=NULL,*iendset_=NULL,
91  *itiefac=NULL,*islavsurf=NULL,*islavnode=NULL,mt=mi[1]+1,
92  *imastnode=NULL,*nslavnode=NULL,*nmastnode=NULL,mortar=0,*imastop=NULL,
93  *iponoels=NULL,*inoels=NULL,*imddof=NULL,nmddof,inoelsize,
94  *ikactcont=NULL,nactcont,nactcont_=100,*ikactmech=NULL,nactmech,
95  iabsload=0,*ipe=NULL,*ime=NULL,iprev=1,inonlinmpc=0,ielem,
96  *imdnode=NULL,nmdnode,*imdboun=NULL,nmdboun,*imdmpc=NULL,
97  nmdmpc,intpointvar,kmin,kmax,i1,ifacecount,*izdof=NULL,
98  nzdof,iload,iforc,*iponoel=NULL,*inoel=NULL,*imdelem=NULL,nmdelem,
99  irenewxstate,nasym=0,*nshcon=NULL,nherm,icfd=0,*inomat=NULL,
100  ialeatoric=0,network=0;
101 
102  long long i2;
103 
104  double *d=NULL, *z=NULL, *b=NULL, *zeta=NULL,*stiini=NULL,
105  *cd=NULL, *cv=NULL, *xforcact=NULL, *xloadact=NULL,*cc=NULL,
106  *t1act=NULL, *ampli=NULL, *aa=NULL, *bb=NULL, *aanew=NULL, *bj=NULL,
107  *v=NULL,*aamech=NULL,*emn=NULL,*cdn=NULL,ptime,
108  *stn=NULL, *stx=NULL, *een=NULL, *adb=NULL,*xstiff=NULL,*bjp=NULL,
109  *aub=NULL, *temp_array1=NULL, *temp_array2=NULL, *aux=NULL,
110  *f=NULL, *fn=NULL, *xbounact=NULL,*epn=NULL,*xstateini=NULL,
111  *enern=NULL,*xstaten=NULL,*eei=NULL,*enerini=NULL,*qfn=NULL,
112  *qfx=NULL, *xbodyact=NULL, *cgr=NULL, *au=NULL, *vbounact=NULL,
113  *abounact=NULL,dtime,reltime,*t0=NULL,*t1=NULL,*t1old=NULL,
114  physcon[1],zetaj,dj,ddj,h1,h2,h3,h4,h5,h6,sum,aai,bbi,tstart,tend,
115  qa[4],cam[5],accold[1],bet,gam,*ad=NULL,sigma=0.,alpham,betam,
116  *bact=NULL,*bmin=NULL,*co=NULL,*xboun=NULL,*xbounold=NULL,*vold=NULL,
117  *eme=NULL,*ener=NULL,*coefmpc=NULL,*fmpc=NULL,*coefmpcold,*veold=NULL,
118  *xini=NULL,*rwork=NULL,*adc=NULL,*auc=NULL,*zc=NULL, *rpar=NULL,
119  *cg=NULL,*straight=NULL,xl[27],voldl[mt*9],elas[21],fnl[27],t0l,t1l,
120  elconloc[21],veoldl[mt*9],setnull,deltmx,bbmax,dd,dtheta,dthetaref,
121  theta,*vini=NULL,dthetaold,*bcont=NULL,*vr=NULL,*vi=NULL,*bcontini=NULL,
122  *stnr=NULL,*stni=NULL,*vmax=NULL,*stnmax=NULL,precision,resultmaxprev,
123  resultmax,func,funcp,fexp,fexm,fcos,fsin,sump,*bp=NULL,h14,senergy=0.0,
124  *bv=NULL,*cstr=NULL,*aube=NULL,*adbe=NULL,*sti=*stip,time0=0.0,
125  time=0.0,*xforcdiff=NULL,*xloaddiff=NULL,*xbodydiff=NULL,*t1diff=NULL,
126  *xboundiff=NULL,*bprev=NULL,*bdiff=NULL,*areaslav=NULL,venergy=0.0,
127  *springarea=NULL, *bold=NULL,*eenmax=NULL,*fnr=NULL,*fni=NULL,
128  *xmastnor=NULL,*emeini=NULL,*xstate=NULL,*clearini=NULL,
129  *shcon=NULL,*xmr=NULL,*xmi=NULL,*xnoels=NULL,*pslavsurf=NULL,
130  *pmastsurf=NULL,*cdnr=NULL,*cdni=NULL,*tinc,*tper,*tmin,*tmax,
131  *energyini=NULL,*energy=NULL;
132 
133  FILE *f1;
134 
135  /* dummy variables for nonlinmpc */
136 
137  ITG *iaux=NULL,maxlenmpc,icascade=0,newstep=0,iit=-1,idiscon;
138 
139 #ifdef SGI
140  ITG token;
141 #endif
142 
143  /* if iabsload=0: aamech is modified by the present incremental
144  contribution of b
145  iabsload=1: the last incremental contribution is
146  subtracted before the new one is added to b;
147  this latter incremental contribution is used
148  to update aamech
149  iabsload=2: aamech is determined by the absolute
150  contribution of b (no incremental procedure
151  for the load; this is necessary if
152  - nonlinear MPC's are applied or
153  - user dloads are applied */
154 
155  co=*cop;kon=*konp;ipkon=*ipkonp;lakon=*lakonp;ielmat=*ielmatp;
156  ielorien=*ielorienp;inotr=*inotrp;nodeboun=*nodebounp;
157  ndirboun=*ndirbounp;iamboun=*iambounp;xboun=*xbounp;xstate=*xstatep;
158  xbounold=*xbounoldp;ikboun=*ikbounp;ilboun=*ilbounp;nactdof=*nactdofp;
159  vold=*voldp;eme=*emep;ener=*enerp;ipompc=*ipompcp;nodempc=*nodempcp;
160  coefmpc=*coefmpcp;labmpc=*labmpcp;ikmpc=*ikmpcp;ilmpc=*ilmpcp;
161  fmpc=*fmpcp;veold=*veoldp;iamt1=*iamt1p;t0=*t0p;t1=*t1p;t1old=*t1oldp;
162 
163  for(k=0;k<3;k++){
164  strcpy1(&jobnamef[k*132],&jobnamec[k*132],132);
165  }
166 
167  tinc=&timepar[0];
168  tper=&timepar[1];
169  tmin=&timepar[2];
170  tmax=&timepar[3];
171 
172  if(ithermal[0]<=1){
173  kmin=1;kmax=3;
174  }else if(ithermal[0]==2){
175  kmin=0;kmax=mi[1];if(kmax>2)kmax=2;
176  }else{
177  kmin=0;kmax=3;
178  }
179 
180 //NNEW(xstiff,double,(long long)27*mi[0]**ne);
181 
182  dtime=*tinc;
183 
184  alpham=xmodal[0];
185  betam=xmodal[1];
186 
187  dd=ctrl[16];deltmx=ctrl[26];
188 
189  /* determining nzl */
190 
191  *nzl=0;
192  for(i=neq[1];i>0;i--){
193  if(icol[i-1]>0){
194  *nzl=i;
195  break;
196  }
197  }
198 
199  /* opening the eigenvalue file and checking for cyclic symmetry */
200 
201  strcpy(fneig,jobnamec);
202  strcat(fneig,".eig");
203 
204  if((f1=fopen(fneig,"rb"))==NULL){
205  printf(" *ERROR in dyna: cannot open eigenvalue file for reading");
206  printf(" *INFO in dyna: if there are problems reading the .eig file this may be due to:\n");
207  printf(" 1) the nonexistence of the .eig file\n");
208  printf(" 2) other boundary conditions than in the input deck\n");
209  printf(" which created the .eig file\n\n");
210  exit(0);
211  }
212 
213  if(fread(&cyclicsymmetry,sizeof(ITG),1,f1)!=1){
214  printf(" *ERROR in dyna reading the cyclic symmetry flag in the eigenvalue file");
215  printf(" *INFO in dyna: if there are problems reading the .eig file this may be due to:\n");
216  printf(" 1) the nonexistence of the .eig file\n");
217  printf(" 2) other boundary conditions than in the input deck\n");
218  printf(" which created the .eig file\n\n");
219  exit(0);
220  }
221 
222  if(fread(&nherm,sizeof(ITG),1,f1)!=1){
223  printf(" *ERROR in dyna reading the Hermitian flag in the eigenvalue file");
224  printf(" *INFO in dyna: if there are problems reading the .eig file this may be due to:\n");
225  printf(" 1) the nonexistence of the .eig file\n");
226  printf(" 2) other boundary conditions than in the input deck\n");
227  printf(" which created the .eig file\n\n");
228  exit(0);
229  }
230 
231  if(nherm!=1){
232  printf(" *ERROR in dyna: the eigenvectors in the .eig-file result\n");
233  printf(" from a non-Hermitian eigenvalue problem. The modal\n");
234  printf(" dynamic procedure cannot handle that yet\n\n");
235  FORTRAN(stop,());
236  }
237 
238  /* creating imddof containing the degrees of freedom
239  retained by the user and imdnode containing the nodes */
240 
241  nmddof=0;nmdnode=0;nmdboun=0;nmdmpc=0;nmdelem=0;
242 
243  NNEW(imddof,ITG,*nk*3);
244  NNEW(imdnode,ITG,*nk);
245  NNEW(imdboun,ITG,*nboun);
246  NNEW(imdmpc,ITG,*nmpc);
247  FORTRAN(createmddof,(imddof,&nmddof,istartset,iendset,
248  ialset,nactdof,ithermal,mi,imdnode,&nmdnode,
249  ikmpc,ilmpc,ipompc,nodempc,nmpc,
250  imdmpc,&nmdmpc,imdboun,&nmdboun,ikboun,
251  nboun,nset,ntie,tieset,set,lakon,kon,ipkon,labmpc,
252  ilboun,filab,prlab,prset,nprint,ne,&cyclicsymmetry));
253 
254  /* if results are requested in too many nodes, it is faster to
255  calculate the results in all nodes */
256 
257  if((nmdnode>*nk/2)&&(!cyclicsymmetry)){
258  nmdnode=0;nmddof=0;nmdboun=0;nmdmpc=0;
259  }
260 
261  if(nmdnode!=0){
262  if(!cyclicsymmetry){
263  for(i=0;i<*nload;i++){
264  iload=i+1;
265  FORTRAN(addimdnodedload,(nelemload,sideload,ipkon,kon,lakon,
266  &iload,imdnode,&nmdnode,ikmpc,ilmpc,ipompc,nodempc,nmpc,
267  imddof,&nmddof,nactdof,mi,imdmpc,&nmdmpc,imdboun,&nmdboun,
268  ikboun,nboun,ilboun,ithermal));
269  }
270  for(i=0;i<*nforc;i++){
271  iforc=i+1;
272  FORTRAN(addimdnodecload,(nodeforc,&iforc,imdnode,&nmdnode,xforc,
273  ikmpc,ilmpc,ipompc,nodempc,nmpc,imddof,&nmddof,
274  nactdof,mi,imdmpc,&nmdmpc,imdboun,&nmdboun,
275  ikboun,nboun,ilboun,ithermal));
276  }
277  }
278 
279  /* determining the elements belonging to a given node */
280 
281  NNEW(iponoel,ITG,*nk);
282  NNEW(inoel,ITG,2**nkon);
283  FORTRAN(elementpernode,(iponoel,inoel,lakon,ipkon,kon,ne,&inoelsize));
284  NNEW(imdelem,ITG,*ne);
285 
286  /* storing the elements in which integration point results
287  are needed; storing the nodes which are needed to
288  calculate these results */
289 
290  FORTRAN(createmdelem,(imdnode,&nmdnode,xforc,
291  ikmpc,ilmpc,ipompc,nodempc,nmpc,imddof,&nmddof,
292  nactdof,mi,imdmpc,&nmdmpc,imdboun,&nmdboun,
293  ikboun,nboun,ilboun,ithermal,imdelem,&nmdelem,
294  iponoel,inoel,prlab,prset,nprint,lakon,set,nset,
295  ialset,ipkon,kon,istartset,iendset,nforc,
296  ikforc,ilforc));
297 
298  RENEW(imdelem,ITG,nmdelem);
299  SFREE(iponoel);SFREE(inoel);
300  }
301 
302  /* if results are requested in too many nodes, it is faster to
303  calculate the results in all nodes */
304 
305  if((nmdnode>*nk/2)&&(!cyclicsymmetry)){
306  nmdnode=0;nmddof=0;nmdboun=0;nmdmpc=0;
307  }
308 
309  /* subtracting 1 to comply with the C-convention */
310 
311  for(i=0;i<nmddof;i++){imddof[i]-=1;}
312  RENEW(imddof,ITG,nmddof);
313  RENEW(imdnode,ITG,nmdnode);
314  RENEW(imdboun,ITG,nmdboun);
315  RENEW(imdmpc,ITG,nmdmpc);
316 
317  nsectors=1;
318 
319  /* reading the eigenvalues / eigenmodes */
320 
321  if(!cyclicsymmetry){
322 
323  nkg=*nk;
324  neg=*ne;
325 
326  if(fread(&nev,sizeof(ITG),1,f1)!=1){
327  printf(" *ERROR in dyna reading the number of eigenvalues in the eigenvalue file");
328  printf(" *INFO in dyna: if there are problems reading the .eig file this may be due to:\n");
329  printf(" 1) the nonexistence of the .eig file\n");
330  printf(" 2) other boundary conditions than in the input deck\n");
331  printf(" which created the .eig file\n\n");
332  exit(0);
333  }
334 
335  NNEW(d,double,nev);
336 
337  if(fread(d,sizeof(double),nev,f1)!=nev){
338  printf(" *ERROR in dyna reading the eigenvalues in the eigenvalue file");
339  printf(" *INFO in dyna: if there are problems reading the .eig file this may be due to:\n");
340  printf(" 1) the nonexistence of the .eig file\n");
341  printf(" 2) other boundary conditions than in the input deck\n");
342  printf(" which created the .eig file\n\n");
343  exit(0);
344  }
345 
346  for(i=0;i<nev;i++){
347  if(d[i]>0){d[i]=sqrt(d[i]);}else{d[i]=0.;}
348  }
349 
350  NNEW(ad,double,neq[1]);
351  NNEW(adb,double,neq[1]);
352  NNEW(au,double,nzs[2]);
353  NNEW(aub,double,nzs[1]);
354 
355  if(fread(ad,sizeof(double),neq[1],f1)!=neq[1]){
356  printf(" *ERROR in dyna reading the diagonal of the stiffness matrix in the eigenvalue file");
357  printf(" *INFO in dyna: if there are problems reading the .eig file this may be due to:\n");
358  printf(" 1) the nonexistence of the .eig file\n");
359  printf(" 2) other boundary conditions than in the input deck\n");
360  printf(" which created the .eig file\n\n");
361  exit(0);
362  }
363 
364  if(fread(au,sizeof(double),nzs[2],f1)!=nzs[2]){
365  printf(" *ERROR in dyna reading the off-diagonals of the stiffness matrix in the eigenvalue file");
366  printf(" *INFO in dyna: if there are problems reading the .eig file this may be due to:\n");
367  printf(" 1) the nonexistence of the .eig file\n");
368  printf(" 2) other boundary conditions than in the input deck\n");
369  printf(" which created the .eig file\n\n");
370  exit(0);
371  }
372 
373  if(fread(adb,sizeof(double),neq[1],f1)!=neq[1]){
374  printf(" *ERROR in dyna reading the diagonal of the mass matrix in the eigenvalue file");
375  printf(" *INFO in dyna: if there are problems reading the .eig file this may be due to:\n");
376  printf(" 1) the nonexistence of the .eig file\n");
377  printf(" 2) other boundary conditions than in the input deck\n");
378  printf(" which created the .eig file\n\n");
379  exit(0);
380  }
381 
382  if(fread(aub,sizeof(double),nzs[1],f1)!=nzs[1]){
383  printf(" *ERROR in dyna reading the off-diagonals of the mass matrix in the eigenvalue file");
384  printf(" *INFO in dyna: if there are problems reading the .eig file this may be due to:\n");
385  printf(" 1) the nonexistence of the .eig file\n");
386  printf(" 2) other boundary conditions than in the input deck\n");
387  printf(" which created the .eig file\n\n");
388  exit(0);
389  }
390 
391  NNEW(z,double,neq[1]*nev);
392 
393  if(fread(z,sizeof(double),neq[1]*nev,f1)!=neq[1]*nev){
394  printf(" *ERROR in dyna reading the eigenvectors in the eigenvalue file");
395  printf(" *INFO in dyna: if there are problems reading the .eig file this may be due to:\n");
396  printf(" 1) the nonexistence of the .eig file\n");
397  printf(" 2) other boundary conditions than in the input deck\n");
398  printf(" which created the .eig file\n\n");
399  exit(0);
400  }
401  }
402  else{
403  nev=0;
404  do{
405  if(fread(&nmd,sizeof(ITG),1,f1)!=1){
406  break;
407  }
408  if(fread(&nevd,sizeof(ITG),1,f1)!=1){
409  printf(" *ERROR in dyna reading the number of eigenvalues for nodal diameter %" ITGFORMAT " in the eigenvalue file",nmd);
410  printf(" *INFO in dyna: if there are problems reading the .eig file this may be due to:\n");
411  printf(" 1) the nonexistence of the .eig file\n");
412  printf(" 2) other boundary conditions than in the input deck\n");
413  printf(" which created the .eig file\n\n");
414  exit(0);
415  }
416  if(nev==0){
417  NNEW(d,double,nevd);
418  NNEW(nm,ITG,nevd);
419  }else{
420  RENEW(d,double,nev+nevd);
421  RENEW(nm,ITG,nev+nevd);
422  }
423 
424  if(fread(&d[nev],sizeof(double),nevd,f1)!=nevd){
425  printf(" *ERROR in dyna reading the eigenvalues for nodal diameter %" ITGFORMAT " in the eigenvalue file",nmd);
426  printf(" *INFO in dyna: if there are problems reading the .eig file this may be due to:\n");
427  printf(" 1) the nonexistence of the .eig file\n");
428  printf(" 2) other boundary conditions than in the input deck\n");
429  printf(" which created the .eig file\n\n");
430  exit(0);
431  }
432 
433  for(i=nev;i<nev+nevd;i++){
434  if(d[i]>0){d[i]=sqrt(d[i]);}else{d[i]=0.;}
435  }
436 
437  for(i=nev;i<nev+nevd;i++){nm[i]=nmd;}
438 
439  if(nev==0){
440  NNEW(adb,double,neq[1]);
441  NNEW(aub,double,nzs[1]);
442 
443  if(fread(adb,sizeof(double),neq[1],f1)!=neq[1]){
444  printf(" *ERROR in dyna reading the diagonal of the mass matrix in the eigenvalue file");
445  printf(" *INFO in dyna: if there are problems reading the .eig file this may be due to:\n");
446  printf(" 1) the nonexistence of the .eig file\n");
447  printf(" 2) other boundary conditions than in the input deck\n");
448  printf(" which created the .eig file\n\n");
449  exit(0);
450  }
451 
452  if(fread(aub,sizeof(double),nzs[1],f1)!=nzs[1]){
453  printf(" *ERROR in dyna reading the off-diagonals of the mass matrix in the eigenvalue file");
454  printf(" *INFO in dyna: if there are problems reading the .eig file this may be due to:\n");
455  printf(" 1) the nonexistence of the .eig file\n");
456  printf(" 2) other boundary conditions than in the input deck\n");
457  printf(" which created the .eig file\n\n");
458  exit(0);
459  }
460  }
461 
462  if(nev==0){
463  NNEW(z,double,neq[1]*nevd);
464  }else{
465  RENEW(z,double,(long long)neq[1]*(nev+nevd));
466  }
467 
468  if(fread(&z[(long long)neq[1]*nev],sizeof(double),neq[1]*nevd,f1)!=neq[1]*nevd){
469  printf(" *ERROR in dyna reading the eigenvectors for nodal diameter %" ITGFORMAT " in the eigenvalue file",nmd);
470  printf(" *INFO in dyna: if there are problems reading the .eig file this may be due to:\n");
471  printf(" 1) the nonexistence of the .eig file\n");
472  printf(" 2) other boundary conditions than in the input deck\n");
473  printf(" which created the .eig file\n\n");
474  exit(0);
475  }
476  nev+=nevd;
477  }while(1);
478 
479  /* determining the maximum amount of segments */
480 
481  for(i=0;i<*mcs;i++){
482 // if(cs[17*i]>nsectors) nsectors=cs[17*i];
483  if(cs[17*i]>nsectors) nsectors=(ITG)(cs[17*i]+0.5);
484  }
485 
486  /* determining the maximum number of sectors to be plotted */
487 
488  for(j=0;j<*mcs;j++){
489  if(cs[17*j+4]>ngraph) ngraph=(ITG)cs[17*j+4];
490  }
491  nkg=*nk*ngraph;
492  neg=*ne*ngraph;
493 
494  /* allocating field for the expanded structure */
495 
496  RENEW(co,double,3**nk*nsectors);
497 
498  /* next line is necessary for multiple cyclic symmetry
499  conditions */
500 
501  for(i=3**nk;i<3**nk*nsectors;i++){co[i]=0.;}
502  if(*ithermal!=0){
503  RENEW(t0,double,*nk*nsectors);
504  RENEW(t1old,double,*nk*nsectors);
505  RENEW(t1,double,*nk*nsectors);
506  if(*nam>0) RENEW(iamt1,ITG,*nk*nsectors);
507  }
508  RENEW(nactdof,ITG,mt**nk*nsectors);
509  if(*ntrans>0) RENEW(inotr,ITG,2**nk*nsectors);
510  RENEW(kon,ITG,*nkon*nsectors);
511  RENEW(ipkon,ITG,*ne*nsectors);
512  for(i=*ne;i<*ne*nsectors;i++){ipkon[i]=-1;}
513  RENEW(lakon,char,8**ne*nsectors);
514  RENEW(ielmat,ITG,mi[2]**ne*nsectors);
515  if(*norien>0) RENEW(ielorien,ITG,mi[2]**ne*nsectors);
516 // RENEW(z,double,(long long)neq[1]*nev*nsectors/2);
517 
518  RENEW(nodeboun,ITG,*nboun*nsectors);
519  RENEW(ndirboun,ITG,*nboun*nsectors);
520  if(*nam>0) RENEW(iamboun,ITG,*nboun*nsectors);
521  RENEW(xboun,double,*nboun*nsectors);
522  RENEW(xbounold,double,*nboun*nsectors);
523  RENEW(ikboun,ITG,*nboun*nsectors);
524  RENEW(ilboun,ITG,*nboun*nsectors);
525 
526  NNEW(ipompcold,ITG,*nmpc);
527  NNEW(nodempcold,ITG,3**mpcend);
528  NNEW(coefmpcold,double,*mpcend);
529  NNEW(labmpcold,char,20**nmpc);
530  NNEW(ikmpcold,ITG,*nmpc);
531  NNEW(ilmpcold,ITG,*nmpc);
532 
533  for(i=0;i<*nmpc;i++){ipompcold[i]=ipompc[i];}
534  for(i=0;i<3**mpcend;i++){nodempcold[i]=nodempc[i];}
535  for(i=0;i<*mpcend;i++){coefmpcold[i]=coefmpc[i];}
536  for(i=0;i<20**nmpc;i++){labmpcold[i]=labmpc[i];}
537  for(i=0;i<*nmpc;i++){ikmpcold[i]=ikmpc[i];}
538  for(i=0;i<*nmpc;i++){ilmpcold[i]=ilmpc[i];}
539  nmpcold=*nmpc;
540  mpcendold=*mpcend;
541 
542  RENEW(ipompc,ITG,*nmpc*nsectors);
543  RENEW(nodempc,ITG,3**mpcend*nsectors);
544  RENEW(coefmpc,double,*mpcend*nsectors);
545  RENEW(labmpc,char,20**nmpc*nsectors+1);
546  RENEW(ikmpc,ITG,*nmpc*nsectors);
547  RENEW(ilmpc,ITG,*nmpc*nsectors);
548  RENEW(fmpc,double,*nmpc*nsectors);
549 
550  /* determining the space needed to expand the
551  contact surfaces */
552 
553  NNEW(tchar1,char,81);
554  NNEW(tchar2,char,81);
555  NNEW(tchar3,char,81);
556  for(i=0; i<*ntie; i++){
557  if(tieset[i*(81*3)+80]=='C'){
558 
559  //a contact constraint was found, so increase nalset
560 
561  memcpy(tchar2,&tieset[i*(81*3)+81],81);
562  tchar2[80]='\0';
563  memcpy(tchar3,&tieset[i*(81*3)+81+81],81);
564  tchar3[80]='\0';
565  for(j=0; j<*nset; j++){
566  memcpy(tchar1,&set[j*81],81);
567  tchar1[80]='\0';
568  if(strcmp(tchar1,tchar2)==0){
569 
570  //dependent nodal surface was found
571 
572  (*nalset)+=(iendset[j]-istartset[j]+1)*(nsectors);
573  }
574  else if(strcmp(tchar1,tchar3)==0){
575 
576  //independent element face surface was found
577 
578  (*nalset)+=(iendset[j]-istartset[j]+1)*(nsectors);
579  }
580  }
581  }
582  }
583  SFREE(tchar1);
584  SFREE(tchar2);
585  SFREE(tchar3);
586 
587  RENEW(ialset,ITG,*nalset);
588 
589  /* save the information in istarset and isendset */
590 
591  NNEW(istartset_,ITG,*nset);
592  NNEW(iendset_,ITG,*nset);
593  for(j=0; j<*nset; j++){
594  istartset_[j]=istartset[j];
595  iendset_[j]=iendset[j];
596  }
597 
598  /* reallocating the fields for the nodes in which the
599  solution has to be calculated */
600 
601  RENEW(imddof,ITG,neq[1]/2*nsectors);
602  RENEW(imdnode,ITG,*nk*nsectors);
603  RENEW(imdboun,ITG,*nboun*nsectors);
604  RENEW(imdmpc,ITG,*nmpc*nsectors);
605 
606 //izdofNNEW(// izdof,ITG,1);
607 
608  expand(co,nk,kon,ipkon,lakon,ne,nodeboun,ndirboun,xboun,nboun,
609  ipompc,nodempc,coefmpc,labmpc,nmpc,nodeforc,ndirforc,xforc,
610  nforc,nelemload,sideload,xload,nload,nactdof,neq,
611  nmethod,ikmpc,ilmpc,ikboun,ilboun,elcon,nelcon,rhcon,nrhcon,
612  alcon,nalcon,alzero,ielmat,ielorien,norien,orab,ntmat_,
613  t0,ithermal,prestr,iprestr,vold,iperturb,sti,nzs,
614  adb,aub,filab,eme,plicon,nplicon,plkcon,nplkcon,
615  xstate,npmat_,matname,mi,ics,cs,mpcend,ncmat_,
616  nstate_,mcs,nkon,ener,jobnamec,output,set,nset,istartset,
617  iendset,ialset,nprint,prlab,prset,nener,trab,
618  inotr,ntrans,ttime,fmpc,&nev,&z,iamboun,xbounold,
619  &nsectors,nm,icol,irow,nzl,nam,ipompcold,nodempcold,coefmpcold,
620  labmpcold,&nmpcold,xloadold,iamload,t1old,t1,iamt1,xstiff,
621  &icole,&jqe,&irowe,isolver,nzse,&adbe,&aube,iexpl,
622  ibody,xbody,nbody,cocon,ncocon,tieset,ntie,imddof,&nmddof,
623  imdnode,&nmdnode,imdboun,&nmdboun,imdmpc,&nmdmpc,&izdof,&nzdof,
624  &nherm,xmr,xmi,typeboun,ielprop,prop,orname);
625 
626  RENEW(imddof,ITG,nmddof);
627  RENEW(imdnode,ITG,nmdnode);
628  RENEW(imdboun,ITG,nmdboun);
629  RENEW(imdmpc,ITG,nmdmpc);
630 
631  SFREE(vold);
632  NNEW(vold,double,mt**nk);
633  SFREE(veold);
634  NNEW(veold,double,mt**nk);
635  RENEW(eme,double,6*mi[0]**ne);
636  RENEW(sti,double,6*mi[0]**ne);
637 
638 // RENEW(xstiff,double,(long long)27*mi[0]**ne);
639  if(*nener==1) RENEW(ener,double,mi[0]**ne*2);
640  }
641 
642  fclose(f1);
643 
644  /* checking for steadystate calculations */
645 
646  if(*tper<0){
647  precision=-*tper;
648  *tper=1.e10;
649  isteadystate=1;
650  }else{
651  isteadystate=0;
652  }
653 
654  /* checking for nonlinear MPC's */
655 
656  for(i=0;i<*nmpc;i++){
657  if((strcmp1(&labmpc[20*i]," ")!=0)&&
658 // (strcmp1(&labmpc[20*i],"CONTACT")!=0)&&
659  (strcmp1(&labmpc[20*i],"CYCLIC")!=0)&&
660  (strcmp1(&labmpc[20*i],"SUBCYCLIC")!=0)){
661  inonlinmpc=1;
662  iabsload=2;
663  break;
664  }
665  }
666 
667 
668  /* normalizing the time */
669 
670  FORTRAN(checktime,(itpamp,namta,tinc,ttime,amta,tmin,&inext,&itp,istep,tper));
671  dtheta=(*tinc)/(*tper);
672  dthetaref=dtheta;
673  dthetaold=dtheta;
674 
675  *tmin=*tmin/(*tper);
676  *tmax=*tmax/(*tper);
677  theta=0.;
678 
679  /* check for rigid body modes
680  if there is a jump of 1.e4 in two subsequent eigenvalues
681  all eigenvalues preceding the jump are considered to
682  be rigid body modes and their frequency is set to zero */
683 
684  setnull=1.;
685  for(i=nev-2;i>-1;i--){
686  if(fabs(d[i])<0.0001*fabs(d[i+1])) setnull=0.;
687  d[i]*=setnull;
688  }
689 
690  /* check whether there are dashpot elements */
691 
692  dashpot=0;
693  for(i=0;i<*ne;i++){
694  if(ipkon[i]<0) continue;
695  if(strcmp1(&lakon[i*8],"ED")==0){
696  dashpot=1;break;}
697  }
698 
699  if(dashpot){
700 
701  if(cyclicsymmetry){
702  printf(" *ERROR in dyna: dashpots are not allowed in combination with cyclic symmetry\n");
703  FORTRAN(stop,());
704  }
705 
706  liw=51;
707  NNEW(iwork,ITG,liw);
708  lrw=130+42*nev;
709  NNEW(rwork,double,lrw);
710  NNEW(xini,double,2*nev);
711  NNEW(adc,double,neq[1]);
712  NNEW(auc,double,nzs[1]);
713  FORTRAN(mafilldm,(co,nk,kon,ipkon,lakon,ne,nodeboun,ndirboun,xboun,nboun,
714  ipompc,nodempc,coefmpc,nmpc,nodeforc,ndirforc,xforc,
715  nforc,nelemload,sideload,xload,nload,xbody,ipobody,nbody,cgr,
716  adc,auc,nactdof,icol,jq,irow,neq,nzl,nmethod,
717  ikmpc,ilmpc,ikboun,ilboun,
718  elcon,nelcon,rhcon,nrhcon,alcon,nalcon,alzero,ielmat,
719  ielorien,norien,orab,ntmat_,
720  t0,t0,ithermal,prestr,iprestr,vold,iperturb,sti,
721  nzs,stx,adb,aub,iexpl,plicon,nplicon,plkcon,nplkcon,
722  xstiff,npmat_,&dtime,matname,mi,ncmat_,
723  ttime,&time0,istep,&iinc,ibody,clearini,&mortar,springarea,
724  pslavsurf,pmastsurf,&reltime,&nasym));
725 
726  /* zc = damping matrix * eigenmodes */
727 
728  NNEW(zc,double,neq[1]*nev);
729  for(i=0;i<nev;i++){
730  FORTRAN(op,(&neq[1],&z[i*neq[1]],&zc[i*neq[1]],adc,auc,
731  jq,irow));
732  }
733 
734  /* cc is the reduced damping matrix (damping matrix mapped onto
735  space spanned by eigenmodes) */
736 
737  NNEW(cc,double,nev*nev);
738  for(i=0;i<nev;i++){
739  for(j=0;j<=i;j++){
740  for(k=0;k<neq[1];k++){
741  cc[i*nev+j]+=z[j*neq[1]+k]*zc[i*neq[1]+k];
742  }
743  }
744  }
745 
746  /* symmetric part of cc matrix */
747 
748  for(i=0;i<nev;i++){
749  for(j=i;j<nev;j++){
750  cc[i*nev+j]=cc[j*nev+i];
751  }
752  }
753  SFREE(zc);
754  }
755 
756  /* contact conditions */
757 
758  if(*nslavs==0){irenewxstate=1;}else{irenewxstate=0;}
759  inicont(nk,&ncont,ntie,tieset,nset,set,istartset,iendset,ialset,&itietri,
760  lakon,ipkon,kon,&koncont,nslavs,tietol,&ismallsliding,&itiefac,
761  &islavsurf,&islavnode,&imastnode,&nslavnode,&nmastnode,
762  &mortar,&imastop,nkon,&iponoels,&inoels,&ipe,&ime,ne,&ifacecount,
763  iperturb,ikboun,nboun,co,istep,&xnoels);
764 
765  if(ncont!=0){
766 
767  if(mortar>0){
768  printf(" *ERROR in dyna: modal dynamics cannot be combined with\n");
769  printf(" face-to-face penalty contact\n\n");
770  FORTRAN(stop,());
771  }
772 
773  if(dashpot){
774  printf(" *ERROR in dyna: contact is not allowed in combination with dashpots\n");
775  FORTRAN(stop,());
776  }
777  RENEW(ipkon,ITG,*ne+*nslavs);
778  RENEW(lakon,char,8*(*ne+*nslavs));
779  if(*nener==1){
780  RENEW(ener,double,mi[0]*(*ne+*nslavs)*2);
781  }
782 
783  /* 11 instead of 10: last position is reserved for how
784  many dependent nodes are paired to this face */
785 
786  RENEW(kon,ITG,*nkon+11**nslavs);
787  if(*norien>0){
788  RENEW(ielorien,ITG,mi[2]*(*ne+*nslavs));
789  for(k=mi[2]**ne;k<mi[2]*(*ne+*nslavs);k++) ielorien[k]=0;
790  }
791  RENEW(ielmat,ITG,mi[2]*(*ne+*nslavs));
792  for(k=mi[2]**ne;k<mi[2]*(*ne+*nslavs);k++) ielmat[k]=1;
793  NNEW(cg,double,3*ncont);
794  NNEW(straight,double,16*ncont);
795 
796  /* internal state variables for contact */
797 
798  if((irenewxstate==1)&&(*nslavs!=0)&&(*nstate_>0)){
799  RENEW(xstate,double,*nstate_*mi[0]*(*ne+*nslavs));
800  for(k=*nstate_*mi[0]**ne;k<*nstate_*mi[0]*(*ne+*nslavs);k++){
801  xstate[k]=0.;
802  }
803  }
804  if(*nstate_>0){
805  NNEW(xstateini,double,*nstate_*mi[0]*(*ne+*nslavs));
806  for(k=0;k<*nstate_*mi[0]*(*ne+*nslavs);++k){
807  xstateini[k]=xstate[k];
808  }
809  }
810 
811  NNEW(xmastnor,double,3*nmastnode[*ntie]);
812  NNEW(areaslav,double,ifacecount);
813  NNEW(springarea,double,2**nslavs);
814  NNEW(vini,double,mt**nk);
815  NNEW(bcontini,double,neq[1]);
816  NNEW(bcont,double,neq[1]);
817  NNEW(ikactcont,ITG,nactcont_);
818  }
819 
820  /* storing the element and topology information before introducing
821  contact elements */
822 
823  ne0=*ne;nkon0=*nkon;
824 
825  NNEW(zeta,double,nev);
826  NNEW(cstr,double,6);
827 
828  /* calculating the damping coefficients*/
829 
830  if(xmodal[10]<0){
831  for(i=0;i<nev;i++){
832  if(fabs(d[i])>(1.e-10)){
833  zeta[i]=(alpham+betam*d[i]*d[i])/(2.*d[i]);
834  }
835  else {
836  printf("*WARNING in dyna: one of the frequencies is zero\n");
837  printf(" no Rayleigh mass damping allowed\n");
838  zeta[i]=0.;
839  }
840 
841  /* if the nodal diameter exceeds half the number of sectors
842  the sign of the damping has to be reversed (omega is negative) */
843 
844 /* if(cyclicsymmetry){
845  if(nm[i]>nsectors/2) zeta[i]*=-1.;
846  }*/
847  }
848  }
849  else{
850 
851  /*copy the damping coefficients for every eigenfrequency from xmodal[11....] */
852 
853  if(nev<(ITG)xmodal[10]){
854  imax=nev;
855  printf("*WARNING in dyna: too many modal damping coefficients applied\n");
856  printf(" damping coefficients corresponding to nonexisting eigenvalues are ignored\n");
857  }
858  else{
859  imax=(ITG)xmodal[10];
860  }
861  for(i=0; i<imax; i++){
862  zeta[i]=xmodal[11+i];
863 
864  /* if the nodal diameter exceeds half the number of sectors
865  the sign of the damping has to be reversed (omega is negative) */
866 
867  /* if(cyclicsymmetry){
868  if(nm[i]>nsectors/2) zeta[i]*=-1.;
869  }*/
870  }
871 
872  }
873 
874  /* modal decomposition of the initial conditions */
875  /* for cyclic symmetric structures the initial conditions
876  are assumed to be zero */
877 
878  NNEW(cd,double,nev);
879  NNEW(cv,double,nev);
880 
881  if(!cyclicsymmetry){
882  NNEW(temp_array1,double,neq[1]);
883  NNEW(temp_array2,double,neq[1]);
884  for(i=0;i<neq[1];i++){temp_array1[i]=0;temp_array2[i]=0;}
885 
886  /* displacement initial conditions */
887 
888  for(i=0;i<*nk;i++){
889  for(j=0;j<mt;j++){
890  if(nactdof[mt*i+j]>0){
891  idof=nactdof[mt*i+j]-1;
892  temp_array1[idof]=vold[mt*i+j];
893  }
894  }
895  }
896 
897  FORTRAN(op,(&neq[1],temp_array1,temp_array2,adb,aub,jq,irow));
898 
899  for(i=0;i<neq[1];i++){
900  for(k=0;k<nev;k++){
901  cd[k]+=z[k*neq[1]+i]*temp_array2[i];
902  }
903  }
904 
905  /* velocity initial conditions */
906 
907  for(i=0;i<neq[1];i++){temp_array1[i]=0;temp_array2[i]=0;}
908  for(i=0;i<*nk;i++){
909  for(j=0;j<mt;j++){
910  if(nactdof[mt*i+j]>0){
911  idof=nactdof[mt*i+j]-1;
912  temp_array1[idof]=veold[mt*i+j];
913  }
914  }
915  }
916 
917  FORTRAN(op,(&neq[1],temp_array1,temp_array2,adb,aub,jq,irow));
918 
919  for(i=0;i<neq[1];i++){
920  for(k=0;k<nev;k++){
921  cv[k]+=z[k*neq[1]+i]*temp_array2[i];
922  }
923  }
924 
925  SFREE(temp_array1);SFREE(temp_array2);
926 
927  }
928  NNEW(xforcact,double,*nforc);
929  NNEW(xforcdiff,double,*nforc);
930  NNEW(xloadact,double,2**nload);
931  NNEW(xloaddiff,double,2**nload);
932  NNEW(xbodyact,double,7**nbody);
933  NNEW(xbodydiff,double,7**nbody);
934 
935  /* copying the rotation axis and/or acceleration vector */
936 
937  for(k=0;k<7**nbody;k++){xbodyact[k]=xbody[k];}
938  for(k=0;k<7**nbody;k++){xbodydiff[k]=xbody[k];}
939  NNEW(xbounact,double,*nboun);
940  NNEW(xboundiff,double,*nboun);
941  if(*ithermal==1) {NNEW(t1act,double,*nk);
942  NNEW(t1diff,double,*nk);}
943 
944  /* assigning the body forces to the elements */
945 
946  if(*nbody>0){
947  ifreebody=*ne+1;
948  NNEW(ipobody,ITG,2**ne);
949  for(k=1;k<=*nbody;k++){
950  FORTRAN(bodyforce,(cbody,ibody,ipobody,nbody,set,istartset,
951  iendset,ialset,&inewton,nset,&ifreebody,&k));
952  RENEW(ipobody,ITG,2*(*ne+ifreebody));
953  }
954  RENEW(ipobody,ITG,2*(ifreebody-1));
955  }
956 
957  NNEW(b,double,neq[1]); /* load rhs vector and displacement solution vector */
958  NNEW(bp,double,neq[1]); /* velocity solution vector */
959  NNEW(bj,double,nev); /* response modal decomposition */
960  NNEW(bjp,double,nev); /* derivative of the response modal decomposition */
961  NNEW(ampli,double,*nam); /* instantaneous amplitude */
962 
963  /* constant coefficient of the linear amplitude function */
964 
965  NNEW(aa,double,nev);
966  NNEW(aanew,double,nev);
967  NNEW(aamech,double,nev);
968 
969  /* linear coefficient of the linear amplitude function */
970 
971  NNEW(bb,double,nev);
972 
973  NNEW(v,double,mt**nk);
974  NNEW(fn,double,mt**nk);
975  NNEW(stn,double,6**nk);
976  NNEW(inum,ITG,*nk);
977  strcpy1(&cflag[0],&filab[4],1);
978  FORTRAN(createinum,(ipkon,inum,kon,lakon,nk,ne,&cflag[0],nelemload,
979  nload,nodeboun,nboun,ndirboun,ithermal,co,vold,mi,ielmat));
980 
981  if(*ithermal>1) {NNEW(qfn,double,3**nk);
982  NNEW(qfx,double,3*mi[0]**ne);}
983 
984  if(strcmp1(&filab[261],"E ")==0) NNEW(een,double,6**nk);
985  if(strcmp1(&filab[522],"ENER")==0) NNEW(enern,double,*nk);
986  if(strcmp1(&filab[609],"SDV ")==0) NNEW(xstaten,double,*nstate_**nk);
987  if(strcmp1(&filab[2697],"ME ")==0) NNEW(emn,double,6**nk);
988 
989  NNEW(eei,double,6*mi[0]**ne);
990  if(*nener==1){
991  NNEW(stiini,double,6*mi[0]**ne);
992  NNEW(emeini,double,6*mi[0]**ne);
993  NNEW(enerini,double,mi[0]**ne);}
994 
995  /* check for nonzero SPC's */
996 
997  iprescribedboundary=0;
998  for(i=0;i<*nboun;i++){
999  if(fabs(xboun[i])>1.e-10){
1000  iprescribedboundary=1;
1001  nmdnode=0;nmddof=0;nmdboun=0;nmdmpc=0;
1002  break;
1003  }
1004  }
1005 
1006 /* calculating the instantaneous loads (forces, surface loading,
1007  centrifugal and gravity loading or temperature) at time 0
1008  setting iabsload to 2 if user subroutine dload is used */
1009 
1010 /* FORTRAN(tempload,(xforcold,xforc,xforcact,iamforc,nforc,xloadold,
1011  xload,xloadact,iamload,nload,ibody,xbody,nbody,xbodyold,
1012  xbodyact,t1old,t1,t1act,iamt1,nk,
1013  amta,namta,nam,ampli,&time0,&reltime,ttime,&dtime,ithermal,nmethod,
1014  xbounold,xboun,xbounact,iamboun,nboun,
1015  nodeboun,ndirboun,nodeforc,ndirforc,istep,&iinc,
1016  co,vold,itg,&ntg,amname,ikboun,ilboun,nelemload,sideload,mi));*/
1017 
1018  FORTRAN(temploaddiff,(xforcold,xforc,xforcact,iamforc,nforc,
1019  xloadold,xload,xloadact,iamload,nload,ibody,xbody,
1020  nbody,xbodyold,xbodyact,t1old,t1,t1act,iamt1,nk,amta,
1021  namta,nam,ampli,&time,&reltime,ttime,&dtime,ithermal,
1022  nmethod,xbounold,xboun,xbounact,iamboun,nboun,nodeboun,
1023  ndirboun,nodeforc,
1024  ndirforc,istep,&iinc,co,vold,itg,&ntg,amname,ikboun,ilboun,
1025  nelemload,sideload,mi,
1026  xforcdiff,xloaddiff,xbodydiff,t1diff,xboundiff,&iabsload,
1027  &iprescribedboundary,ntrans,trab,inotr,veold,nactdof,bcont,
1028  fn,ipobody,iponoel,inoel));
1029 
1030  if(iabsload==2) NNEW(bold,double,neq[1]);
1031 
1032  /* calculating the instantaneous loading vector at time 0 */
1033 
1034  NNEW(ikactmech,ITG,neq[1]);
1035  nactmech=0;
1036  FORTRAN(rhs,(co,nk,kon,ipkon,lakon,ne,
1037  ipompc,nodempc,coefmpc,nmpc,nodeforc,ndirforc,xforcact,
1038  nforc,nelemload,sideload,xloadact,nload,xbodyact,ipobody,nbody,
1039  cgr,b,nactdof,&neq[1],nmethod,
1040  ikmpc,ilmpc,elcon,nelcon,rhcon,nrhcon,alcon,
1041  nalcon,alzero,ielmat,ielorien,norien,orab,ntmat_,t0,t1act,
1042  ithermal,iprestr,vold,iperturb,iexpl,plicon,
1043  nplicon,plkcon,nplkcon,npmat_,ttime,&time0,istep,&iinc,&dtime,
1044  physcon,ibody,xbodyold,&reltime,veold,matname,mi,ikactmech,
1045  &nactmech,ielprop,prop,sti,xstateini,xstate,nstate_));
1046 
1047  /* correction for nonzero SPC's */
1048 
1049  if(iprescribedboundary){
1050 
1051  if(cyclicsymmetry){
1052  printf(" *ERROR in dyna: prescribed boundaries are not allowed in combination with cyclic symmetry\n");
1053  FORTRAN(stop,());
1054  }
1055 
1056  if(*idrct!=1){
1057  printf(" *ERROR in dyna: variable increment length is not allwed in combination with prescribed boundaries\n");
1058  FORTRAN(stop,());
1059  }
1060 
1061  /* LU decomposition of the stiffness matrix */
1062 
1063  if(*isolver==0){
1064 #ifdef SPOOLES
1065  spooles_factor(ad,au,adb,aub,&sigma,icol,irow,&neq[1],&nzs[1],
1066  &symmetryflag,&inputformat,&nzs[2]);
1067 #else
1068  printf(" *ERROR in dyna: the SPOOLES library is not linked\n\n");
1069  FORTRAN(stop,());
1070 #endif
1071  }
1072  else if(*isolver==4){
1073 #ifdef SGI
1074  token=1;
1075  sgi_factor(ad,au,adb,aub,&sigma,icol,irow,&neq[1],&nzs[1],token);
1076 #else
1077  printf(" *ERROR in dyna: the SGI library is not linked\n\n");
1078  FORTRAN(stop,());
1079 #endif
1080  }
1081  else if(*isolver==5){
1082 #ifdef TAUCS
1083  tau_factor(ad,&au,adb,aub,&sigma,icol,&irow,&neq[1],&nzs[1]);
1084 #else
1085  printf(" *ERROR in dyna: the TAUCS library is not linked\n\n");
1086  FORTRAN(stop,());
1087 #endif
1088  }
1089  else if(*isolver==7){
1090 #ifdef PARDISO
1091  pardiso_factor(ad,au,adb,aub,&sigma,icol,irow,&neq[1],&nzs[1],
1092  &symmetryflag,&inputformat,jq,&nzs[2]);
1093 #else
1094  printf(" *ERROR in dyna: the PARDISO library is not linked\n\n");
1095  FORTRAN(stop,());
1096 #endif
1097  }
1098 
1099  NNEW(bact,double,neq[1]);
1100  NNEW(bmin,double,neq[1]);
1101  NNEW(bv,double,neq[1]);
1102  NNEW(bprev,double,neq[1]);
1103  NNEW(bdiff,double,neq[1]);
1104 
1105  init=1;
1106  dynboun(amta,namta,nam,ampli,&time0,ttime,&dtime,xbounold,xboun,
1107  xbounact,iamboun,nboun,nodeboun,ndirboun,ad,au,adb,
1108  aub,icol,irow,neq,nzs,&sigma,b,isolver,
1109  &alpham,&betam,nzl,&init,bact,bmin,jq,amname,bv,
1110  bprev,bdiff,&nactmech,&iabsload,&iprev);
1111  init=0;
1112  }
1113 
1114 /* creating contact elements and calculating the contact forces
1115  (normal and shear) */
1116 
1117  if(ncont!=0){
1118  DMEMSET(bcont,0,neq[1],0.);
1119  contact(&ncont,ntie,tieset,nset,set,istartset,iendset,
1120  ialset,itietri,lakon,ipkon,kon,koncont,ne,cg,straight,nkon,
1121  co,vold,ielmat,cs,elcon,istep,&iinc,&iit,ncmat_,ntmat_,
1122  &ne0,vini,nmethod,iperturb,
1123  ikboun,nboun,mi,imastop,nslavnode,islavnode,islavsurf,
1124  itiefac,areaslav,iponoels,inoels,springarea,tietol,&reltime,
1125  imastnode,nmastnode,xmastnor,filab,mcs,ics,
1126  &nasym,xnoels,&mortar,pslavsurf,pmastsurf,clearini,&theta,
1127  xstateini,xstate,nstate_,&icutb,&ialeatoric,jobnamef);
1128 
1129  RENEW(ikactcont,ITG,nactcont_);
1130  DMEMSET(ikactcont,0,nactcont_,0.);
1131  nactcont=0;
1132 
1133  for(i=ne0;i<*ne;i++){
1134  indexe=ipkon[i];
1135  imat=ielmat[mi[2]*i];
1136  kodem=nelcon[2*imat-2];
1137  for(j=0;j<8;j++){lakonl[j]=lakon[8*i+j];}
1138  nope=atoi(&lakonl[7])+1;
1139  for(j=0;j<nope;j++){
1140  konl[j]=kon[indexe+j];
1141  for(j1=0;j1<3;j1++){
1142  xl[j*3+j1]=co[3*(konl[j]-1)+j1];
1143  voldl[mt*j+j1+1]=vold[mt*(konl[j]-1)+j1+1];
1144  veoldl[mt*j+j1+1]=veold[mt*(konl[j]-1)+j1+1];
1145  }
1146  }
1147  konl[nope]=kon[indexe+nope];
1148 
1149  FORTRAN(springforc_n2f,(xl,konl,voldl,&imat,elcon,nelcon,elas,
1150  fnl,ncmat_,ntmat_,&nope,lakonl,&t1l,&kodem,elconloc,
1151  plicon,nplicon,npmat_,&senergy,nener,cstr,mi,
1152  &springarea[2*(konl[nope]-1)],nmethod,&ne0,nstate_,
1153  xstateini,xstate,&reltime,&ielas,&venergy,ielorien,orab,
1154  norien,&i));
1155 
1156  storecontactdof(&nope,nactdof,&mt,konl,&ikactcont,&nactcont,
1157  &nactcont_,bcont,fnl,ikmpc,nmpc,ilmpc,ipompc,nodempc,
1158  coefmpc);
1159 
1160  }
1161  if(nactcont>100){nactcont_=nactcont;}else{nactcont_=100;}
1162  RENEW(ikactcont,ITG,nactcont_);
1163 
1164  }
1165 
1166  iit=1;
1167 
1168  /* load at the start of a new step:
1169  mechanical loading without contact */
1170 
1171  if(!cyclicsymmetry){
1172  for(i=0;i<nev;i++){
1173  i2=(long long)i*neq[1];
1174  aamech[i]=0.;
1175  if(nactmech<neq[1]/2){
1176  for(j=0;j<nactmech;j++){
1177  aamech[i]+=z[i2+ikactmech[j]]*b[ikactmech[j]];
1178  }
1179  }else{
1180  for(j=0;j<neq[1];j++){
1181  aamech[i]+=z[i2+j]*b[j];
1182  }
1183  }
1184  aanew[i]=aamech[i];
1185  if(ncont!=0){
1186  for(j=0;j<nactcont;j++){
1187  aanew[i]+=z[i2+ikactcont[j]]*bcont[ikactcont[j]];
1188  }
1189  }
1190  }
1191  }else{
1192  for(i=0;i<nev;i++){aamech[i]=0.;}
1193  for(j=0;j<nactmech;j++){
1194  FORTRAN(nident,(izdof,&ikactmech[j],&nzdof,&id));
1195  if(id!=0){
1196  if(izdof[id-1]==ikactmech[j]){
1197  for(i=0;i<nev;i++){
1198  aamech[i]+=z[(long long)i*nzdof+id-1]*b[ikactmech[j]];
1199  }
1200  }else{printf(" *ERROR in dyna\n");FORTRAN(stop,());}
1201  }else{printf(" *ERROR in dyna\n");FORTRAN(stop,());}
1202  }
1203  memcpy(&aanew[0],&aamech[0],sizeof(double)*nev);
1204  if(ncont!=0){
1205  for(j=0;j<nactcont;j++){
1206  FORTRAN(nident,(izdof,&ikactcont[j],&nzdof,&id));
1207  if(id!=0){
1208  if(izdof[id-1]==ikactcont[j]){
1209  for(i=0;i<nev;i++){
1210  aanew[i]+=z[(long long)i*nzdof+id-1]*bcont[ikactcont[j]];
1211  }
1212  }else{printf(" *ERROR in dyna\n");FORTRAN(stop,());}
1213  }else{printf(" *ERROR in dyna\n");FORTRAN(stop,());}
1214  }
1215  }
1216  }
1217 
1218  /* check whether integration point values are requested; if not,
1219  the stress fields do not have to be allocated */
1220 
1221  intpointvar=0;
1222  if(*ithermal<=1){
1223 
1224  /* mechanical */
1225 
1226  if((strcmp1(&filab[174],"S")==0)||
1227  (strcmp1(&filab[261],"E")==0)||
1228  (strcmp1(&filab[348],"RF")==0)||
1229  (strcmp1(&filab[435],"PEEQ")==0)||
1230  (strcmp1(&filab[522],"ENER")==0)||
1231  (strcmp1(&filab[609],"SDV")==0)||
1232  (strcmp1(&filab[1044],"ZZS")==0)||
1233  (strcmp1(&filab[1044],"ERR")==0)||
1234  (strcmp1(&filab[1479],"PHS")==0)||
1235  (strcmp1(&filab[1653],"MAXS")==0)||
1236  (strcmp1(&filab[2175],"CONT")==0)||
1237  (strcmp1(&filab[2262],"CELS")==0)) intpointvar=1;
1238  for(i=0;i<*nprint;i++){
1239  if((strcmp1(&prlab[6*i],"S")==0)||
1240  (strcmp1(&prlab[6*i],"E")==0)||
1241  (strcmp1(&prlab[6*i],"PEEQ")==0)||
1242  (strcmp1(&prlab[6*i],"ENER")==0)||
1243  (strcmp1(&prlab[6*i],"SDV")==0)||
1244  (strcmp1(&prlab[6*i],"CDIS")==0)||
1245  (strcmp1(&prlab[6*i],"CSTR")==0)||
1246  (strcmp1(&prlab[6*i],"CELS")==0)||
1247  (strcmp1(&prlab[6*i],"RF")==0)) {intpointvar=1;break;}
1248  }
1249  }else{
1250 
1251  /* thermal */
1252 
1253  if((strcmp1(&filab[696],"HFL")==0)||
1254  (strcmp1(&filab[783],"RFL")==0)) intpointvar=1;
1255  for(i=0;i<*nprint;i++){
1256  if((strcmp1(&prlab[6*i],"HFL")==0)||
1257  (strcmp1(&prlab[6*i],"RFL")==0)) {intpointvar=1;break;}
1258  }
1259  }
1260 
1261  if((intpointvar==1)) NNEW(stx,double,6*mi[0]**ne);
1262 
1263  /* major loop */
1264 
1265  resultmaxprev=0.;
1266  resultmax=0.;
1267 
1268  while(1.-theta>1.e-6){
1269 
1270  time0=time;
1271 
1272 // printf("\nnew increment\n");
1273 
1274  if(*nener==1){
1275  memcpy(&enerini[0],&ener[0],sizeof(double)*mi[0]*ne0);
1276  if(*ithermal!=2){
1277  memcpy(&stiini[0],&sti[0],sizeof(double)*6*mi[0]*ne0);
1278  memcpy(&emeini[0],&eme[0],sizeof(double)*6*mi[0]*ne0);
1279  }
1280  }
1281 
1282  if(ncont!=0){
1283  if(nmdnode!=0){
1284  for(i=0;i<nmdnode;i++){
1285  i1=mt*(imdnode[i]-1);
1286  for(j=kmin;j<=kmax;j++){
1287  vini[i1+j]=vold[i1+j];
1288  }
1289  }
1290  }else{
1291  memcpy(&vini[0],&vold[0],sizeof(double)*mt**nk);
1292  }
1293  if(*nstate_>0){
1294  for(k=0;k<*nstate_*mi[0]*(ne0+*nslavs);++k){
1295  xstateini[k]=xstate[k];
1296  }
1297  }
1298  }
1299  iinc++;
1300  jprint++;
1301 
1302  if(dashpot)RENEW(rpar,double,4+nev*(3+nev));
1303 
1304  /* check for max. # of increments */
1305 
1306  if(iinc>*jmax){
1307  printf(" *ERROR in dyna: max. # of increments reached\n\n");
1308  FORTRAN(stop,());
1309  }
1310 
1311  if(iinc>1){
1312  memcpy(&cd[0],&bj[0],sizeof(double)*nev);
1313  memcpy(&cv[0],&bjp[0],sizeof(double)*nev);
1314  }
1315 
1316 
1317  if((*idrct!=1)&&(iinc!=1)){
1318 
1319  /* increasing the increment size */
1320 
1321  dthetaold=dtheta;
1322  dtheta=dthetaref*dd;
1323 
1324  /* check increment length whether
1325  - it does not exceed tmax
1326  - the step length is not exceeded
1327  - a time point is not exceeded */
1328 
1329  dthetaref=dtheta;
1330  checkinclength(&time0,ttime,&theta,&dtheta,idrct,tper,tmax,
1331  tmin,ctrl, amta,namta,itpamp,&inext,&dthetaref,&itp,
1332  &jprint,jout);
1333  }
1334 
1335  reltime=theta+dtheta;
1336  time=reltime**tper;
1337  dtime=dtheta**tper;
1338 
1339  /* calculating the instantaneous loads (forces, surface loading,
1340  centrifugal and gravity loading or temperature) */
1341 
1342  FORTRAN(temploaddiff,(xforcold,xforc,xforcact,iamforc,nforc,
1343  xloadold,xload,xloadact,iamload,nload,ibody,xbody,
1344  nbody,xbodyold,xbodyact,t1old,t1,t1act,iamt1,nk,amta,
1345  namta,nam,ampli,&time,&reltime,ttime,&dtime,ithermal,
1346  nmethod,xbounold,xboun,xbounact,iamboun,nboun,nodeboun,
1347  ndirboun,nodeforc,
1348  ndirforc,istep,&iinc,co,vold,itg,&ntg,amname,ikboun,ilboun,
1349  nelemload,sideload,mi,
1350  xforcdiff,xloaddiff,xbodydiff,t1diff,xboundiff,&iabsload,
1351  &iprescribedboundary,ntrans,trab,inotr,veold,nactdof,bcont,
1352  fn,ipobody,iponoel,inoel));
1353 
1354  /* calculating the instantaneous loading vector */
1355 
1356  if(iabsload!=2){
1357  FORTRAN(rhs,(co,nk,kon,ipkon,lakon,ne,
1358  ipompc,nodempc,coefmpc,nmpc,nodeforc,ndirforc,xforcdiff,
1359  nforc,nelemload,sideload,xloaddiff,nload,xbodydiff,
1360  ipobody,nbody,cgr,b,nactdof,&neq[1],nmethod,
1361  ikmpc,ilmpc,elcon,nelcon,rhcon,nrhcon,
1362  alcon,nalcon,alzero,ielmat,ielorien,norien,orab,ntmat_,
1363  t0,t1diff,ithermal,iprestr,vold,iperturb,iexpl,plicon,
1364  nplicon,plkcon,nplkcon,
1365  npmat_,ttime,&time,istep,&iinc,&dtime,physcon,ibody,
1366  xbodyold,&reltime,veold,matname,mi,ikactmech,&nactmech,
1367  ielprop,prop,sti,xstateini,xstate,nstate_));
1368  }else{
1369  FORTRAN(rhs,(co,nk,kon,ipkon,lakon,ne,
1370  ipompc,nodempc,coefmpc,nmpc,nodeforc,ndirforc,xforcact,
1371  nforc,nelemload,sideload,xloadact,nload,xbodyact,
1372  ipobody,nbody,cgr,b,nactdof,&neq[1],nmethod,
1373  ikmpc,ilmpc,elcon,nelcon,rhcon,nrhcon,
1374  alcon,nalcon,alzero,ielmat,ielorien,norien,orab,ntmat_,
1375  t0,t1act,ithermal,iprestr,vold,iperturb,iexpl,plicon,
1376  nplicon,plkcon,nplkcon,
1377  npmat_,ttime,&time,istep,&iinc,&dtime,physcon,ibody,
1378  xbodyold,&reltime,veold,matname,mi,ikactmech,&nactmech,
1379  ielprop,prop,sti,xstateini,xstate,nstate_));
1380  }
1381 
1382  /* correction for nonzero SPC's */
1383 
1384  if(iprescribedboundary){
1385  dynboun(amta,namta,nam,ampli,&time,ttime,&dtime,
1386  xbounold,xboun,
1387  xbounact,iamboun,nboun,nodeboun,ndirboun,ad,au,adb,
1388  aub,icol,irow,neq,nzs,&sigma,b,isolver,
1389  &alpham,&betam,nzl,&init,bact,bmin,jq,amname,bv,
1390  bprev,bdiff,&nactmech,&iabsload,&iprev);
1391  }
1392 
1393  if(*idrct==0){
1394  bbmax=0.;
1395  if(iabsload!=2){
1396  if(nactmech<neq[1]/2){
1397  for(i=0;i<nactmech;i++){
1398  if(fabs(b[ikactmech[i]])>bbmax) bbmax=fabs(b[ikactmech[i]]);
1399  }
1400  }else{
1401  for(i=0;i<neq[1];i++){
1402  if(fabs(b[i])>bbmax) bbmax=fabs(b[i]);
1403  }
1404  }
1405  }else{
1406 
1407  /* bbmax is to be calculated from the difference of b and bold */
1408 
1409  if(nactmech<neq[1]/2){
1410  for(i=0;i<nactmech;i++){
1411  if(fabs(b[ikactmech[i]]-bold[ikactmech[i]])>bbmax)
1412  bbmax=fabs(b[ikactmech[i]]-bold[ikactmech[i]]);
1413  }
1414  }else{
1415  for(i=0;i<neq[1];i++){
1416  if(fabs(b[i])>bbmax) bbmax=fabs(b[i]-bold[i]);
1417  }
1418  }
1419 
1420  /* copy b into bold */
1421 
1422  if(nactmech<neq[1]/2){
1423  for(i=0;i<nactmech;i++){
1424  bold[ikactmech[i]]=b[ikactmech[i]];
1425  }
1426  }else{
1427  memcpy(&bold[0],&b[0],sizeof(double)*neq[1]);
1428  }
1429  }
1430 
1431  /* check for size of mechanical force */
1432 
1433  if((bbmax>deltmx)&&(((itp==1)&&(dtheta>*tmin))||(itp==0))){
1434 
1435  /* force increase too big: increment size is decreased */
1436 
1437  if(iabsload==0) iabsload=1;
1438  dtheta=dtheta*deltmx/bbmax;
1439  dthetaref=dtheta;
1440  if(itp==1){
1441  inext--;
1442  itp=0;
1443  }
1444 
1445  /* check whether the new increment size is not too small */
1446 
1447  if(dtheta<*tmin){
1448  dtheta=*tmin;
1449  }
1450 
1451  reltime=theta+dtheta;
1452  time=reltime**tper;
1453  dtime=dtheta**tper;
1454 
1455  /* calculating the instantaneous loads (forces, surface loading,
1456  centrifugal and gravity loading or temperature) */
1457 
1458  FORTRAN(temploaddiff,(xforcold,xforc,xforcact,iamforc,nforc,
1459  xloadold,xload,xloadact,iamload,nload,ibody,xbody,
1460  nbody,xbodyold,xbodyact,t1old,t1,t1act,iamt1,nk,amta,
1461  namta,nam,ampli,&time,&reltime,ttime,&dtime,ithermal,
1462  nmethod,xbounold,xboun,xbounact,iamboun,nboun,nodeboun,
1463  ndirboun,nodeforc,
1464  ndirforc,istep,&iinc,co,vold,itg,&ntg,amname,ikboun,ilboun,
1465  nelemload,sideload,mi,
1466  xforcdiff,xloaddiff,xbodydiff,t1diff,xboundiff,&iabsload,
1467  &iprescribedboundary,ntrans,trab,inotr,veold,nactdof,bcont,
1468  fn,ipobody,iponoel,inoel));
1469 
1470  /* calculating the instantaneous loading vector */
1471 
1472  if(iabsload!=2){
1473  FORTRAN(rhs,(co,nk,kon,ipkon,lakon,ne,
1474  ipompc,nodempc,coefmpc,nmpc,nodeforc,ndirforc,xforcdiff,
1475  nforc,nelemload,sideload,xloaddiff,nload,xbodydiff,
1476  ipobody,nbody,cgr,b,nactdof,&neq[1],nmethod,
1477  ikmpc,ilmpc,elcon,nelcon,rhcon,nrhcon,
1478  alcon,nalcon,alzero,ielmat,ielorien,norien,orab,ntmat_,
1479  t0,t1diff,ithermal,iprestr,vold,iperturb,iexpl,plicon,
1480  nplicon,plkcon,nplkcon,
1481  npmat_,ttime,&time,istep,&iinc,&dtime,physcon,ibody,
1482  xbodyold,&reltime,veold,matname,mi,ikactmech,&nactmech,
1483  ielprop,prop,sti,xstateini,xstate,nstate_));
1484  }else{
1485  FORTRAN(rhs,(co,nk,kon,ipkon,lakon,ne,
1486  ipompc,nodempc,coefmpc,nmpc,nodeforc,ndirforc,xforcact,
1487  nforc,nelemload,sideload,xloadact,nload,xbodyact,
1488  ipobody,nbody,cgr,b,nactdof,&neq[1],nmethod,
1489  ikmpc,ilmpc,elcon,nelcon,rhcon,nrhcon,
1490  alcon,nalcon,alzero,ielmat,ielorien,norien,orab,ntmat_,
1491  t0,t1act,ithermal,iprestr,vold,iperturb,iexpl,plicon,
1492  nplicon,plkcon,nplkcon,
1493  npmat_,ttime,&time,istep,&iinc,&dtime,physcon,ibody,
1494  xbodyold,&reltime,veold,matname,mi,ikactmech,&nactmech,
1495  ielprop,prop,sti,xstateini,xstate,nstate_));
1496  }
1497 
1498  /* correction for nonzero SPC's */
1499 
1500  if(iprescribedboundary){
1501  dynboun(amta,namta,nam,ampli,&time,ttime,&dtime,
1502  xbounold,xboun,
1503  xbounact,iamboun,nboun,nodeboun,ndirboun,ad,au,adb,
1504  aub,icol,irow,neq,nzs,&sigma,b,isolver,
1505  &alpham,&betam,nzl,&init,bact,bmin,jq,amname,bv,
1506  bprev,bdiff,&nactmech,&iabsload,&iprev);
1507  }
1508  if(iabsload==1) iabsload=0;
1509  }
1510 
1511  if(ncont!=0){
1512  for(i=0;i<nactcont;i++){
1513  jdof=ikactcont[i];
1514  bcontini[jdof]=bcont[jdof];
1515  }
1516  }
1517 
1518  }
1519 
1520  /* step length is OK for mechanical load
1521  calculating equation for linearized loading */
1522 
1523  /* load: actual mechanical load +
1524  contact from last increment */
1525 
1526  if(!cyclicsymmetry){
1527  for(i=0;i<nev;i++){
1528  i2=(long long)i*neq[1];
1529  aa[i]=aanew[i];
1530  if(iabsload==2){aamech[i]=0.;}
1531  if(nactmech<neq[1]/2){
1532  for(j=0;j<nactmech;j++){
1533  aamech[i]+=z[i2+ikactmech[j]]*b[ikactmech[j]];
1534  }
1535  }else{
1536  for(j=0;j<neq[1];j++){
1537  aamech[i]+=z[i2+j]*b[j];
1538  }
1539  }
1540 
1541  aanew[i]=aamech[i];
1542  if(ncont!=0){
1543  for(j=0;j<nactcont;j++){
1544  aanew[i]+=z[i2+ikactcont[j]]*bcont[ikactcont[j]];
1545  }
1546  }
1547 
1548  bb[i]=(aanew[i]-aa[i])/dtime;
1549  aa[i]=aanew[i]-bb[i]*time;
1550  }
1551  }else{
1552  for(i=0;i<nev;i++){
1553  memcpy(&aa[0],&aanew[0],sizeof(double)*nev);
1554  if(iabsload==2){aamech[i]=0.;}
1555  }
1556  for(j=0;j<nactmech;j++){
1557  FORTRAN(nident,(izdof,&ikactmech[j],&nzdof,&id));
1558  if(id!=0){
1559  if(izdof[id-1]==ikactmech[j]){
1560  for(i=0;i<nev;i++){
1561  aamech[i]+=z[(long long)i*nzdof+id-1]*b[ikactmech[j]];
1562  }
1563  }else{printf(" *ERROR in dyna\n");FORTRAN(stop,());}
1564  }else{printf(" *ERROR in dyna\n");FORTRAN(stop,());}
1565  }
1566  memcpy(&aanew[0],&aamech[0],sizeof(double)*nev);
1567  if(ncont!=0){
1568  for(j=0;j<nactcont;j++){
1569  FORTRAN(nident,(izdof,&ikactcont[j],&nzdof,&id));
1570  if(id!=0){
1571  if(izdof[id-1]==ikactcont[j]){
1572  for(i=0;i<nev;i++){
1573  aanew[i]+=z[(long long)i*nzdof+id-1]*bcont[ikactcont[j]];
1574  }
1575  }else{printf(" *ERROR in dyna\n");FORTRAN(stop,());}
1576  }else{printf(" *ERROR in dyna\n");FORTRAN(stop,());}
1577  }
1578  }
1579  for(i=0;i<nev;i++){
1580  bb[i]=(aanew[i]-aa[i])/(dtime);
1581  aa[i]=aanew[i]-bb[i]*time;
1582  }
1583  }
1584 
1585  /* calculating the response due to unchanged contact force during
1586  the increment */
1587 
1588  if(dashpot){
1589  FORTRAN(subspace,(d,aa,bb,cc,&alpham,&betam,&nev,xini,
1590  cd,cv,&time,rwork,&lrw,&iinc,jout,rpar,bj,
1591  iwork,&liw,&iddebdf,bjp));
1592  if(iddebdf==2){
1593  liw=56+2*nev;
1594  RENEW(iwork,ITG,liw);
1595  for(i=0;i<liw;i++){iwork[i]=0;}
1596  lrw=250+20*nev+4*nev*nev;
1597  RENEW(rwork,double,lrw);
1598  for(i=0;i<lrw;i++){rwork[i]=0.;}
1599  iddebdf=1;
1600  FORTRAN(subspace,(d,aa,bb,cc,&alpham,&betam,&nev,xini,
1601  cd,cv,&time,rwork,&lrw,&iinc,jout,rpar,bj,
1602  iwork,&liw,&iddebdf,bjp));
1603  }
1604  }
1605  else{
1606  for(l=0;l<nev;l++){
1607  zetaj=zeta[l];
1608  dj=d[l];
1609 
1610  /* zero eigenfrequency: rigid body mode */
1611 
1612  if(fabs(d[l])<=1.e-10){
1613  aai=aa[l];
1614  bbi=bb[l];
1615  tstart=time0;
1616  tend=time;
1617  sum=tend*(aai*time+
1618  tend*((bbi*time-aai)/2.-bbi*tend/3.))-
1619  tstart*(aai*time+
1620  tstart*((bbi*time-aai)/2.-bbi*tstart/3.));
1621  sump=tend*(aai+bbi*tend/2.)-tstart*(aai+bbi*tstart/2.);
1622  bj[l]=sum+cd[l]+dtime*cv[l];
1623  bjp[l]=sump+cv[l];
1624  }
1625 
1626  /* subcritical damping */
1627 
1628  else if(zetaj<1.-1.e-6){
1629  ddj=dj*sqrt(1.-zetaj*zetaj);
1630  h1=zetaj*dj;
1631  h2=h1*h1+ddj*ddj;
1632  h3=h1*h1-ddj*ddj;
1633  h4=2.*h1*ddj/h2;
1634  h14=h1/ddj;
1635  tstart=0.;
1636  FORTRAN(fsub,(&time,&dtime,&aa[l],&bb[l],&ddj,
1637  &h1,&h2,&h3,&h4,&func,&funcp));
1638  sum=func;sump=funcp;
1639  FORTRAN(fsub,(&time,&tstart,&aa[l],&bb[l],&ddj,
1640  &h1,&h2,&h3,&h4,&func,&funcp));
1641  sum-=func;sump-=funcp;
1642  fexp=exp(-h1*dtime);
1643  fsin=sin(ddj*dtime);
1644  fcos=cos(ddj*dtime);
1645 
1646  bj[l]=sum/ddj+fexp*(fcos+zetaj/sqrt(1.-zetaj*zetaj)*fsin)*cd[l]+
1647  fexp*fsin*cv[l]/ddj;
1648  bjp[l]=sump/ddj+fexp*((-h1+ddj*h14)*fcos+(-ddj-h1*h14)*fsin)*cd[l]
1649  +fexp*(-h1*fsin+ddj*fcos)*cv[l]/ddj;
1650 
1651  }
1652 
1653  /* supercritical damping */
1654 
1655  else if(zetaj>1.+1.e-6){
1656  ddj=dj*sqrt(zetaj*zetaj-1.);
1657  h1=ddj-zetaj*dj;
1658  h2=ddj+zetaj*dj;
1659  h3=1./h1;
1660  h4=1./h2;
1661  h5=h3*h3;
1662  h6=h4*h4;
1663  tstart=0.;
1664  FORTRAN(fsuper,(&time,&dtime,&aa[l],&bb[l],
1665  &h1,&h2,&h3,&h4,&h5,&h6,&func,&funcp));
1666  sum=func;sump=funcp;
1667  FORTRAN(fsuper,(&time,&tstart,&aa[l],&bb[l],
1668  &h1,&h2,&h3,&h4,&h5,&h6,&func,&funcp));
1669  sum-=func;sump-=funcp;
1670 
1671  fexm=exp(h1*dtime);
1672  fexp=exp(-h2*dtime);
1673  h14=zetaj*dj/ddj;
1674  bj[l]=sum/(2.*ddj)+(fexm+fexp)*cd[l]/2.+zetaj*(fexm-fexp)/(2.*
1675  sqrt(zetaj*zetaj-1.))*cd[l]+(fexm-fexp)*cv[l]/(2.*ddj);
1676  bjp[l]=sump/(2.*ddj)+(h1*fexm-h2*fexp)*cd[l]/2.
1677  +(h14*cd[l]+cv[l]/ddj)*(h1*fexm+h2*fexp)/2.;
1678  }
1679 
1680  /* critical damping */
1681 
1682  else{
1683  h1=zetaj*dj;
1684  h2=1./h1;
1685  h3=h2*h2;
1686  h4=h2*h3;
1687  tstart=0.;
1688  FORTRAN(fcrit,(&time,&dtime,&aa[l],&bb[l],&zetaj,&dj,
1689  &ddj,&h1,&h2,&h3,&h4,&func,&funcp));
1690  sum=func;sump=funcp;
1691  FORTRAN(fcrit,(&time,&tstart,&aa[l],&bb[l],&zetaj,&dj,
1692  &ddj,&h1,&h2,&h3,&h4,&func,&funcp));
1693  sum-=func;sump-=funcp;
1694  fexp=exp(-h1*dtime);
1695  bj[l]=sum+fexp*((1.+h1*dtime)*cd[l]+dtime*cv[l]);
1696  bjp[l]=sump+fexp*(-h1*h1*dtime*cd[l]+
1697  (1.-h1*dtime)*cv[l]);
1698  }
1699  }
1700  }
1701 
1702  /* composing the response */
1703 
1704  if(iprescribedboundary){
1705  if(nmdnode==0){
1706  memcpy(&b[0],&bmin[0],sizeof(double)*neq[1]);
1707  memcpy(&bp[0],&bv[0],sizeof(double)*neq[1]);
1708  }else{
1709  for(i=0;i<nmddof;i++){
1710  b[imddof[i]]=bmin[imddof[i]];
1711  bp[imddof[i]]=bv[imddof[i]];
1712  }
1713  }
1714  }
1715  else{
1716  if(nmdnode==0){
1717  DMEMSET(b,0,neq[1],0.);
1718  DMEMSET(bp,0,neq[1],0.);
1719  }else{
1720  for(i=0;i<nmddof;i++){
1721  b[imddof[i]]=0.;
1722  bp[imddof[i]]=0.;
1723  }
1724  }
1725  }
1726 
1727  if(!cyclicsymmetry){
1728  if(nmdnode==0){
1729  for(i=0;i<neq[1];i++){
1730  for(j=0;j<nev;j++){
1731  b[i]+=bj[j]*z[(long long)j*neq[1]+i];
1732  bp[i]+=bjp[j]*z[(long long)j*neq[1]+i];
1733  }
1734  }
1735  }else{
1736  for(i=0;i<nmddof;i++){
1737  for(j=0;j<nev;j++){
1738  b[imddof[i]]+=bj[j]*z[(long long)j*neq[1]+imddof[i]];
1739  bp[imddof[i]]+=bjp[j]*z[(long long)j*neq[1]+imddof[i]];
1740  }
1741  }
1742  }
1743  }else{
1744  for(i=0;i<nmddof;i++){
1745  FORTRAN(nident,(izdof,&imddof[i],&nzdof,&id));
1746  if(id!=0){
1747  if(izdof[id-1]==imddof[i]){
1748  for(j=0;j<nev;j++){
1749  b[imddof[i]]+=bj[j]*z[(long long)j*nzdof+id-1];
1750  bp[imddof[i]]+=bjp[j]*z[(long long)j*nzdof+id-1];
1751  }
1752  }else{printf(" *ERROR in dyna\n");FORTRAN(stop,());}
1753  }else{printf(" *ERROR in dyna\n");FORTRAN(stop,());}
1754  }
1755  }
1756 
1757  /* update nonlinear MPC-coefficients (e.g. for rigid
1758  body MPC's */
1759 
1760  if(inonlinmpc==1){
1761  FORTRAN(nonlinmpc,(co,vold,ipompc,nodempc,coefmpc,labmpc,
1762  nmpc,ikboun,ilboun,nboun,xbounact,aux,iaux,
1763  &maxlenmpc,ikmpc,ilmpc,&icascade,
1764  kon,ipkon,lakon,ne,&reltime,&newstep,xboun,fmpc,
1765  &iit,&idiscon,&ncont,trab,ntrans,ithermal,mi));
1766  }
1767 
1768  /* calculating displacements/temperatures */
1769 
1770  FORTRAN(dynresults,(nk,v,ithermal,nactdof,vold,nodeboun,
1771  ndirboun,xbounact,nboun,ipompc,nodempc,coefmpc,labmpc,nmpc,
1772  b,bp,veold,&dtime,mi,imdnode,&nmdnode,imdboun,&nmdboun,
1773  imdmpc,&nmdmpc,nmethod,&time));
1774 
1775  /* creating contact elements and calculating the contact forces
1776  based on the displacements at the end of the present increment */
1777 
1778  if(ncont!=0){
1779  dynacont(co,nk,kon,ipkon,lakon,ne,nodeboun,ndirboun,xboun,nboun,
1780  ipompc,nodempc,coefmpc,labmpc,nmpc,nodeforc,ndirforc,xforc,
1781  nforc,nelemload,sideload,xload,nload,nactdof,neq,nzl,icol,
1782  irow,
1783  nmethod,ikmpc,ilmpc,ikboun,ilboun,elcon,nelcon,rhcon,
1784  nrhcon,cocon,ncocon,alcon,nalcon,alzero,ielmat,ielorien,
1785  norien,orab,ntmat_,t0,t1,ithermal,prestr,iprestr,
1786  vold,iperturb,sti,nzs,tinc,tper,xmodal,veold,amname,amta,
1787  namta,nam,iamforc,iamload,iamt1,jout,filab,eme,xforcold,
1788  xloadold,t1old,iamboun,xbounold,iexpl,plicon,nplicon,plkcon,
1789  nplkcon,xstate,npmat_,matname,mi,ncmat_,nstate_,ener,jobnamec,
1790  ttime,set,nset,istartset,iendset,ialset,nprint,prlab,
1791  prset,nener,trab,inotr,ntrans,fmpc,cbody,ibody,xbody,nbody,
1792  xbodyold,istep,isolver,jq,output,mcs,nkon,mpcend,ics,cs,ntie,
1793  tieset,idrct,jmax,tmin,tmax,ctrl,itpamp,tietol,&iit,
1794  &ncont,&ne0,&reltime,&dtime,bcontini,bj,aux,iaux,bcont,
1795  &nev,v,&nkon0,&deltmx,&dtheta,&theta,&iprescribedboundary,
1796  &mpcfree,&memmpc_,itietri,koncont,cg,straight,&iinc,
1797  vini,aa,bb,aanew,d,z,zeta,b,&time0,&time,ipobody,
1798  xforcact,xloadact,t1act,xbounact,xbodyact,cd,cv,ampli,
1799  &dthetaref,bjp,bp,cstr,imddof,&nmddof,
1800  &ikactcont,&nactcont,&nactcont_,aamech,bprev,&iprev,&inonlinmpc,
1801  &ikactmech,&nactmech,imdnode,&nmdnode,imdboun,&nmdboun,
1802  imdmpc,&nmdmpc,&itp,&inext,imastop,
1803  nslavnode,islavnode,islavsurf,itiefac,areaslav,iponoels,
1804  inoels,springarea,izdof,&nzdof,fn,imastnode,nmastnode,xmastnor,
1805  xstateini,nslavs,&cyclicsymmetry,xnoels,&ielas,ielprop,prop);
1806  }
1807 
1808  theta+=dtheta;
1809 // (*ttime)+=dtime;
1810 
1811  /* check whether a time point was reached */
1812 
1813  if((*itpamp>0)&&(*idrct==0)){
1814  if(itp==1){
1815  jprint=*jout;
1816  }else{
1817  jprint=*jout+1;
1818  }
1819  }
1820 
1821  /* check whether output is needed */
1822 
1823  if((*jout==jprint)||(1.-theta<=1.e-6)){
1824  iout=2;
1825  jprint=0;
1826  }else if((*nener==1)){
1827  iout=-2;
1828  }else{
1829  iout=0;
1830  }
1831 
1832  if((iout==2)||(iout==-2)){
1833 
1834  /* deactivating the elements for which the stresses are not
1835  needed */
1836 
1837  if(nmdnode>0){
1838  if((intpointvar==1)){
1839  for(k=0;k<ne0;k++){
1840  if(ipkon[k]<-1){
1841  printf(" *ERROR in dyna: contact remeshing of quadratic elements is not allowed\n\n");
1842  FORTRAN(stop,());
1843  }else if(ipkon[k]!=-1){
1844  ipkon[k]=-ipkon[k]-2;
1845  }
1846  }
1847  for(k=0;k<nmdelem;k++){
1848  ielem=imdelem[k]-1;
1849  ipkon[ielem]=-2-ipkon[ielem];
1850  }
1851  }
1852  }
1853 
1854  results(co,nk,kon,ipkon,lakon,ne,v,stn,inum,
1855  stx,elcon,nelcon,rhcon,nrhcon,alcon,nalcon,alzero,
1856  ielmat,ielorien,norien,orab,ntmat_,t0,t1,
1857  ithermal,prestr,iprestr,filab,eme,emn,een,
1858  iperturb,f,fn,nactdof,&iout,qa,
1859  vold,b,nodeboun,ndirboun,xbounact,nboun,
1860  ipompc,nodempc,coefmpc,labmpc,nmpc,nmethod,cam,&neq[1],
1861  veold,accold,&bet,&gam,&dtime,&time,ttime,
1862  plicon,nplicon,plkcon,nplkcon,
1863  xstateini,xstiff,xstate,npmat_,epn,matname,mi,&ielas,
1864  &icmd,ncmat_,nstate_,stiini,vini,ikboun,ilboun,ener,
1865  enern,emeini,xstaten,eei,enerini,cocon,ncocon,
1866  set,nset,istartset,iendset,ialset,nprint,prlab,prset,
1867  qfx,qfn,trab,inotr,ntrans,fmpc,nelemload,nload,ikmpc,
1868  ilmpc,istep,&iinc,springarea,&reltime,&ne0,xforc,nforc,
1869  thicke,shcon,nshcon,
1870  sideload,xload,xloadold,&icfd,inomat,pslavsurf,pmastsurf,
1871  &mortar,islavact,cdn,islavnode,nslavnode,ntie,clearini,
1872  islavsurf,ielprop,prop,energyini,energy,&iit,iponoel,
1873  inoel,nener,orname,&network,ipobody,xbodyact,ibody);
1874 
1875  /* restoring */
1876 
1877  if(nmdnode>0){
1878  if((intpointvar==1)){
1879  for(k=0;k<ne0;k++){
1880  if(ipkon[k]<-1){ipkon[k]=-2-ipkon[k];}
1881  }
1882  }
1883  }
1884 
1885  if((*ithermal!=2)&&(intpointvar==1)){
1886  for(k=0;k<6*mi[0]*ne0;++k){
1887  sti[k]=stx[k];
1888  }
1889  }
1890  }
1891  if(iout==2){
1892  (*kode)++;
1893  if(strcmp1(&filab[1044],"ZZS")==0){
1894  NNEW(neigh,ITG,40**ne);
1895  NNEW(ipneigh,ITG,*nk);
1896  }
1897 
1898  ptime=*ttime+time;
1899  frd(co,&nkg,kon,ipkon,lakon,&neg,v,stn,inum,nmethod,
1900  kode,filab,een,t1,fn,&ptime,epn,ielmat,matname,enern,xstaten,
1901  nstate_,istep,&iinc,ithermal,qfn,&mode,&noddiam,trab,inotr,
1902  ntrans,orab,ielorien,norien,description,ipneigh,neigh,
1903  mi,stx,vr,vi,stnr,stni,vmax,stnmax,&ngraph,veold,ener,ne,
1904  cs,set,nset,istartset,iendset,ialset,eenmax,fnr,fni,emn,
1905  thicke,jobnamec,output,qfx,cdn,&mortar,cdnr,cdni,nmat);
1906 
1907  if(strcmp1(&filab[1044],"ZZS")==0){SFREE(ipneigh);SFREE(neigh);}
1908  }
1909 
1910  if(isteadystate==1){
1911 
1912  /* calculate maximum displacement/temperature */
1913 
1914  resultmax=0.;
1915  if(*ithermal<2){
1916  for(i=1;i<mt**nk;i=i+mt){
1917  if(fabs(v[i])>resultmax) resultmax=fabs(v[i]);}
1918  for(i=2;i<mt**nk;i=i+mt){
1919  if(fabs(v[i])>resultmax) resultmax=fabs(v[i]);}
1920  for(i=3;i<mt**nk;i=i+mt){
1921  if(fabs(v[i])>resultmax) resultmax=fabs(v[i]);}
1922  }else if(*ithermal==2){
1923  for(i=0;i<mt**nk;i=i+mt){
1924  if(fabs(v[i])>resultmax) resultmax=fabs(v[i]);}
1925  }else{
1926  printf(" *ERROR in dyna: coupled temperature-displacement calculations are not allowed\n");
1927  }
1928  if(fabs((resultmax-resultmaxprev)/resultmax)<precision){
1929  break;
1930  }else{resultmaxprev=resultmax;}
1931  }
1932 
1933  }
1934 
1935  if((intpointvar==1)) SFREE(stx);
1936 
1937  /* calculating the displacements and velocities in all nodes as
1938  initial condition for the next step; only needed if
1939  - nonzero initial conditions are allowed (-> no cyclic symmetry)
1940  - the output was restricted (-> nmdnode nonzero) */
1941 
1942  if((nmdnode!=0)&&(!cyclicsymmetry)){
1943 
1944  /* determining the solution in the independent nodes */
1945 
1946  DMEMSET(b,0,neq[1],0.);
1947  DMEMSET(bp,0,neq[1],0.);
1948 
1949  for(i=0;i<neq[1];i++){
1950  for(j=0;j<nev;j++){
1951  b[i]+=bj[j]*z[(long long)j*neq[1]+i];
1952  bp[i]+=bjp[j]*z[(long long)j*neq[1]+i];
1953  }
1954  }
1955 
1956  /* update nonlinear MPC-coefficients (e.g. for rigid
1957  body MPC's */
1958 
1959  if(inonlinmpc==1){
1960  FORTRAN(nonlinmpc,(co,vold,ipompc,nodempc,coefmpc,labmpc,
1961  nmpc,ikboun,ilboun,nboun,xbounact,aux,iaux,
1962  &maxlenmpc,ikmpc,ilmpc,&icascade,
1963  kon,ipkon,lakon,ne,&reltime,&newstep,xboun,fmpc,
1964  &iit,&idiscon,&ncont,trab,ntrans,ithermal,mi));
1965  }
1966 
1967  /* calculating displacements/temperatures */
1968 
1969  nmdnode=0;
1970  FORTRAN(dynresults,(nk,v,ithermal,nactdof,vold,nodeboun,
1971  ndirboun,xbounact,nboun,ipompc,nodempc,coefmpc,labmpc,nmpc,
1972  b,bp,veold,&dtime,mi,imdnode,&nmdnode,imdboun,&nmdboun,
1973  imdmpc,&nmdmpc,nmethod,&time));
1974  }
1975 
1976  SFREE(eei);
1977  SFREE(vbounact);
1978  SFREE(abounact);
1979 
1980  if(*nener==1){SFREE(stiini);SFREE(emeini);SFREE(enerini);}
1981 
1982  if(strcmp1(&filab[261],"E ")==0) SFREE(een);
1983  if(strcmp1(&filab[522],"ENER")==0) SFREE(enern);
1984  if(strcmp1(&filab[609],"SDV ")==0) SFREE(xstaten);
1985  if(strcmp1(&filab[2697],"ME ")==0) SFREE(emn);
1986  if(*ithermal>1) {SFREE(qfn);SFREE(qfx);}
1987 
1988  /* updating the loading at the end of the step;
1989  important in case the amplitude at the end of the step
1990  is not equal to one */
1991 
1992  for(k=0;k<*nboun;++k){xboun[k]=xbounact[k];}
1993  for(k=0;k<*nforc;++k){xforc[k]=xforcact[k];}
1994  for(k=0;k<2**nload;++k){xload[k]=xloadact[k];}
1995  for(k=0;k<7**nbody;k=k+7){xbody[k]=xbodyact[k];}
1996  if(*ithermal==1){
1997  for(k=0;k<*nk;++k){t1[k]=t1act[k];}
1998  }
1999 
2000  SFREE(v);SFREE(fn);SFREE(stn);SFREE(inum);SFREE(adb);SFREE(d);
2001  SFREE(aub);SFREE(z);SFREE(b);SFREE(zeta);SFREE(bj);SFREE(cd);SFREE(cv);
2002  SFREE(xforcact);SFREE(xloadact);SFREE(xbounact);SFREE(aa);SFREE(bb);SFREE(aanew);
2003  SFREE(ampli);SFREE(xbodyact);SFREE(bjp);SFREE(bp);SFREE(aamech);SFREE(ikactmech);
2004  SFREE(xforcdiff);SFREE(xloaddiff);SFREE(xboundiff),SFREE(xbodydiff);
2005 
2006  if(*ithermal==1) {SFREE(t1act);SFREE(t1diff);}
2007 
2008  if(iprescribedboundary){
2009  if(*isolver==0){
2010 #ifdef SPOOLES
2011  spooles_cleanup();
2012 #endif
2013  }
2014  else if(*isolver==4){
2015 #ifdef SGI
2016  sgi_cleanup(token);
2017 #endif
2018  }
2019  else if(*isolver==5){
2020 #ifdef TAUCS
2021  tau_cleanup();
2022 #endif
2023  }
2024  else if(*isolver==7){
2025 #ifdef PARDISO
2026  pardiso_cleanup(&neq[1],&symmetryflag);
2027 #endif
2028  }
2029  SFREE(bact);SFREE(bmin);SFREE(bv);SFREE(bprev);SFREE(bdiff);
2030  }
2031 
2032  /* deleting the contact information */
2033 
2034 // *ne=ne0; *nkon=nkon0;
2035  if(ncont!=0){
2036  *ne=ne0; *nkon=nkon0;
2037  if(*nener==1){
2038  RENEW(ener,double,mi[0]**ne*2);
2039  }
2040  RENEW(ipkon,ITG,*ne);
2041  RENEW(lakon,char,8**ne);
2042  RENEW(kon,ITG,*nkon);
2043  if(*norien>0){
2044  RENEW(ielorien,ITG,mi[2]**ne);
2045  }
2046  RENEW(ielmat,ITG,mi[2]**ne);
2047  SFREE(cg);SFREE(straight);
2048 
2049  SFREE(vini);SFREE(bcont);SFREE(bcontini);SFREE(ikactcont);
2050 
2051  SFREE(imastop);SFREE(itiefac);SFREE(islavsurf);SFREE(islavnode);
2052  SFREE(nslavnode);SFREE(iponoels);SFREE(inoels);SFREE(imastnode);
2053  SFREE(nmastnode);SFREE(itietri);SFREE(koncont);SFREE(xnoels);
2054  SFREE(springarea);SFREE(xmastnor);
2055 
2056  SFREE(areaslav);
2057 
2058  if(*nstate_>0){SFREE(xstateini);}
2059 
2060  }
2061 
2062  if(!cyclicsymmetry){
2063  SFREE(ad);SFREE(au);
2064  }else{
2065  SFREE(adbe); SFREE(aube);SFREE(icole); SFREE(irowe); SFREE(jqe);SFREE(izdof);
2066  SFREE(nm);
2067 
2068  *nk/=nsectors;
2069  *ne/=nsectors;
2070  *nkon/=nsectors;
2071  *nboun/=nsectors;
2072  neq[1]=neq[1]*2/nsectors;
2073 
2074  RENEW(ialset,ITG,nalset_);
2075 
2076  /* restore the infomration in istartset and iendset */
2077 
2078  for(j=0; j<*nset; j++){
2079  istartset[j]=istartset_[j];
2080  iendset[j]=iendset_[j];
2081  }
2082  SFREE(istartset_);
2083  SFREE(iendset_);
2084 
2085  RENEW(co,double,3**nk);
2086  if((*ithermal!=0)&&(*nam>0)) RENEW(iamt1,ITG,*nk);
2087  RENEW(nactdof,ITG,mt**nk);
2088  if(*ntrans>0) RENEW(inotr,ITG,2**nk);
2089  RENEW(kon,ITG,*nkon);
2090  RENEW(ipkon,ITG,*ne);
2091  RENEW(lakon,char,8**ne);
2092  RENEW(ielmat,ITG,mi[2]**ne);
2093  if(*norien>0) RENEW(ielorien,ITG,mi[2]**ne);
2094  RENEW(nodeboun,ITG,*nboun);
2095  RENEW(ndirboun,ITG,*nboun);
2096  if(*nam>0) RENEW(iamboun,ITG,*nboun);
2097  RENEW(xboun,double,*nboun);
2098  RENEW(xbounold,double,*nboun);
2099  RENEW(ikboun,ITG,*nboun);
2100  RENEW(ilboun,ITG,*nboun);
2101 
2102  /* recovering the original multiple point constraints */
2103 
2104  RENEW(ipompc,ITG,*nmpc);
2105  RENEW(nodempc,ITG,3**mpcend);
2106  RENEW(coefmpc,double,*mpcend);
2107  RENEW(labmpc,char,20**nmpc+1);
2108  RENEW(ikmpc,ITG,*nmpc);
2109  RENEW(ilmpc,ITG,*nmpc);
2110  RENEW(fmpc,double,*nmpc);
2111 
2112  *nmpc=nmpcold;
2113  *mpcend=mpcendold;
2114  for(i=0;i<*nmpc;i++){ipompc[i]=ipompcold[i];}
2115  for(i=0;i<3**mpcend;i++){nodempc[i]=nodempcold[i];}
2116  for(i=0;i<*mpcend;i++){coefmpc[i]=coefmpcold[i];}
2117  for(i=0;i<20**nmpc;i++){labmpc[i]=labmpcold[i];}
2118  for(i=0;i<*nmpc;i++){ikmpc[i]=ikmpcold[i];}
2119  for(i=0;i<*nmpc;i++){ilmpc[i]=ilmpcold[i];}
2120  SFREE(ipompcold);SFREE(nodempcold);SFREE(coefmpcold);
2121  SFREE(labmpcold);SFREE(ikmpcold);SFREE(ilmpcold);
2122 
2123  RENEW(vold,double,mt**nk);
2124  RENEW(veold,double,mt**nk);
2125  RENEW(eme,double,6*mi[0]**ne);
2126  RENEW(sti,double,6*mi[0]**ne);
2127  if(*nener==1)RENEW(ener,double,mi[0]**ne*2);
2128 
2129 /* distributed loads */
2130 
2131  for(i=0;i<*nload;i++){
2132  if(nelemload[2*i+1]<nsectors){
2133  nelemload[2*i]-=*ne*nelemload[2*i+1];
2134  }else{
2135  nelemload[2*i]-=*ne*(nelemload[2*i+1]-nsectors);
2136  }
2137  }
2138 
2139  /* sorting the elements with distributed loads */
2140 
2141  if(*nload>0){
2142  if(*nam>0){
2143  FORTRAN(isortiiddc,(nelemload,iamload,xload,xloadold,sideload,nload,&kflag));
2144  }else{
2145  FORTRAN(isortiddc,(nelemload,xload,xloadold,sideload,nload,&kflag));
2146  }
2147  }
2148 
2149 /* point loads */
2150 
2151  for(i=0;i<*nforc;i++){
2152  if(nodeforc[2*i+1]<nsectors){
2153  nodeforc[2*i]-=*nk*nodeforc[2*i+1];
2154  }else{
2155  nodeforc[2*i]-=*nk*(nodeforc[2*i+1]-nsectors);
2156  }
2157  }
2158  }
2159 
2160 // SFREE(xstiff);
2161  if(*nbody>0) SFREE(ipobody);
2162 
2163  if(dashpot){
2164  SFREE(xini);SFREE(rwork);SFREE(adc);SFREE(auc);SFREE(cc);
2165  SFREE(rpar);SFREE(iwork);}
2166 
2167  SFREE(cstr);
2168 
2169  SFREE(imddof);SFREE(imdnode);SFREE(imdboun);SFREE(imdmpc);SFREE(imdelem);
2170 
2171  if(iabsload==2) SFREE(bold);
2172 
2173  *ialsetp=ialset;
2174  *cop=co;*konp=kon;*ipkonp=ipkon;*lakonp=lakon;*ielmatp=ielmat;
2175  *ielorienp=ielorien;*inotrp=inotr;*nodebounp=nodeboun;
2176  *ndirbounp=ndirboun;*iambounp=iamboun;*xbounp=xboun;
2177  *xbounoldp=xbounold;*ikbounp=ikboun;*ilbounp=ilboun;*nactdofp=nactdof;
2178  *voldp=vold;*emep=eme;*enerp=ener;*ipompcp=ipompc;*nodempcp=nodempc;
2179  *coefmpcp=coefmpc;*labmpcp=labmpc;*ikmpcp=ikmpc;*ilmpcp=ilmpc;
2180  *fmpcp=fmpc;*veoldp=veold;*iamt1p=iamt1;*t0p=t0;*t1oldp=t1old;*t1p=t1;
2181  *stip=sti;*xstatep=xstate;
2182 
2183  (*ttime)+=(*tper);
2184 
2185  return;
2186 }
subroutine checktime(itpamp, namta, tinc, ttime, amta, tmin, inext, itp, istep, tper)
Definition: checktime.f:21
void storecontactdof(ITG *nope, ITG *nactdof, ITG *mt, ITG *konl, ITG **ikactcontp, ITG *nactcont, ITG *nactcont_, double *bcont, double *fnl, ITG *ikmpc, ITG *nmpc, ITG *ilmpc, ITG *ipompc, ITG *nodempc, double *coefmpc)
Definition: storecontactdof.c:36
#define ITGFORMAT
Definition: CalculiX.h:52
subroutine subspace(d, aa, bb, cc, alpham, betam, nev, xini, cd, cv, time, rwork, lrw, m, jout, rpar, bj, iwork, liw, iddebdf, bjp)
Definition: subspace.f:21
subroutine init(nktet, inodfa, ipofa, netet_)
Definition: init.f:20
subroutine springforc_n2f(xl, konl, vl, imat, elcon, nelcon, elas, fnl, ncmat_, ntmat_, nope, lakonl, t1l, kode, elconloc, plicon, nplicon, npmat_, senergy, nener, cstr, mi, springarea, nmethod, ne0, nstate_, xstateini, xstate, reltime, ielas, venergy, ielorien, orab, norien, nelem)
Definition: springforc_n2f.f:24
void frd(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne0, double *v, double *stn, ITG *inum, ITG *nmethod, ITG *kode, char *filab, double *een, double *t1, double *fn, double *time, double *epn, ITG *ielmat, char *matname, double *enern, double *xstaten, ITG *nstate_, ITG *istep, ITG *iinc, ITG *ithermal, double *qfn, ITG *mode, ITG *noddiam, double *trab, ITG *inotr, ITG *ntrans, double *orab, ITG *ielorien, ITG *norien, char *description, ITG *ipneigh, ITG *neigh, ITG *mi, double *stx, double *vr, double *vi, double *stnr, double *stni, double *vmax, double *stnmax, ITG *ngraph, double *veold, double *ener, ITG *ne, double *cs, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, double *eenmax, double *fnr, double *fni, double *emn, double *thicke, char *jobnamec, char *output, double *qfx, double *cdn, ITG *mortar, double *cdnr, double *cdni, ITG *nmat)
Definition: frd.c:32
void inicont(ITG *nk, ITG *ncont, ITG *ntie, char *tieset, ITG *nset, char *set, ITG *istartset, ITG *iendset, ITG *ialset, ITG **itietrip, char *lakon, ITG *ipkon, ITG *kon, ITG **koncontp, ITG *ncone, double *tietol, ITG *ismallsliding, ITG **itiefacp, ITG **islavsurfp, ITG **islavnodep, ITG **imastnodep, ITG **nslavnodep, ITG **nmastnodep, ITG *mortar, ITG **imastopp, ITG *nkon, ITG **iponoels, ITG **inoelsp, ITG **ipep, ITG **imep, ITG *ne, ITG *ifacecount, ITG *iperturb, ITG *ikboun, ITG *nboun, double *co, ITG *istep, double **xnoelsp)
Definition: inicont.c:24
subroutine mafilldm(co, nk, kon, ipkon, lakon, ne, nodeboun, ndirboun, xboun, nboun, ipompc, nodempc, coefmpc, nmpc, nodeforc, ndirforc, xforc, nforc, nelemload, sideload, xload, nload, xbody, ipobody, nbody, cgr, ad, au, nactdof, icol, jq, irow, neq, nzl, nmethod, ikmpc, ilmpc, ikboun, ilboun, elcon, nelcon, rhcon, nrhcon, alcon, nalcon, alzero, ielmat, ielorien, norien, orab, ntmat_, t0, t1, ithermal, prestr, iprestr, vold, iperturb, sti, nzs, stx, adb, aub, iexpl, plicon, nplicon, plkcon, nplkcon, xstiff, npmat_, dtime, matname, mi, ncmat_, ttime, time, istep, iinc, ibody, clearini, mortar, springarea, pslavsurf, pmastsurf, reltime, nasym)
Definition: mafilldm.f:31
ITG strcpy1(char *s1, const char *s2, ITG length)
Definition: strcpy1.c:24
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
subroutine elementpernode(iponoel, inoel, lakon, ipkon, kon, ne, inoelsize)
Definition: elementpernode.f:21
subroutine op(n, x, y, ad, au, jq, irow)
Definition: op.f:26
ITG strcmp1(const char *s1, const char *s2)
Definition: strcmp1.c:24
subroutine fsub(time, t, a, b, dd, h1, h2, h3, h4, func, funcp)
Definition: fsub.f:20
void pardiso_cleanup(ITG *neq, ITG *symmetryflag)
void dynacont(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, char *labmpc, ITG *nmpc, ITG *nodeforc, ITG *ndirforc, double *xforc, ITG *nforc, ITG *nelemload, char *sideload, double *xload, ITG *nload, ITG *nactdof, ITG *neq, ITG *nzl, ITG *icol, ITG *irow, ITG *nmethod, ITG *ikmpc, ITG *ilmpc, ITG *ikboun, ITG *ilboun, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *cocon, ITG *ncocon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, double *prestr, ITG *iprestr, double *vold, ITG *iperturb, double *sti, ITG *nzs, double *tinc, double *tper, double *xmodal, double *veold, char *amname, double *amta, ITG *namta, ITG *nam, ITG *iamforc, ITG *iamload, ITG *iamt1, ITG *jout, char *filab, double *eme, double *xforcold, double *xloadold, double *t1old, ITG *iamboun, double *xbounold, ITG *iexpl, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstate, ITG *npmat_, char *matname, ITG *mi, ITG *ncmat_, ITG *nstate_, double *ener, char *jobnamec, double *ttime, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nprint, char *prlab, char *prset, ITG *nener, double *trab, ITG *inotr, ITG *ntrans, double *fmpc, char *cbody, ITG *ibody, double *xbody, ITG *nbody, double *xbodyold, ITG *istep, ITG *isolver, ITG *jq, char *output, ITG *mcs, ITG *nkon, ITG *mpcend, ITG *ics, double *cs, ITG *ntie, char *tieset, ITG *idrct, ITG *jmax, double *tmin, double *tmax, double *ctrl, ITG *itpamp, double *tietol, ITG *iit, ITG *ncont, ITG *ne0, double *reltime, double *dtime, double *bcontini, double *bj, double *aux, ITG *iaux, double *bcont, ITG *nev, double *v, ITG *nkon0, double *deltmx, double *dtheta, double *theta, ITG *iprescribedboundary, ITG *mpcfree, ITG *memmpc_, ITG *itietri, ITG *koncont, double *cg, double *straight, ITG *iinc, double *vini, double *aa, double *bb, double *aanew, double *d, double *z, double *zeta, double *b, double *time0, double *time1, ITG *ipobody, double *xforcact, double *xloadact, double *t1act, double *xbounact, double *xbodyact, double *cd, double *cv, double *ampli, double *dthetaref, double *bjp, double *bp, double *cstr, ITG *imddof, ITG *nmddof, ITG **ikactcontp, ITG *nactcont, ITG *nactcont_, double *aamech, double *bprev, ITG *iprev, ITG *inonlinmpc, ITG **ikactmechp, ITG *nactmech, ITG *imdnode, ITG *nmdnode, ITG *imdboun, ITG *nmdboun, ITG *imdmpc, ITG *nmdmpc, ITG *itp, ITG *inext, ITG *imastop, ITG *nslavnode, ITG *islavnode, ITG *islavsurf, ITG *itiefac, double *areaslav, ITG *iponoels, ITG *inoels, double *springarea, ITG *izdof, ITG *nzdof, double *fn, ITG *imastnode, ITG *nmastnode, double *xmastnor, double *xstateini, ITG *nslavs, ITG *cyclicsymmetry, double *xnoels, ITG *ielas, ITG *ielprop, double *prop)
Definition: dynacont.c:38
#define DMEMSET(a, b, c, d)
Definition: CalculiX.h:45
subroutine fsuper(time, t, a, b, h1, h2, h3, h4, h5, h6, func, funcp)
Definition: fsuper.f:20
subroutine addimdnodedload(nelemload, sideload, ipkon, kon, lakon, iload, imdnode, nmdnode, ikmpc, ilmpc, ipompc, nodempc, nmpc, imddof, nmddof, nactdof, mi, imdmpc, nmdmpc, imdboun, nmdboun, ikboun, nboun, ilboun, ithermal)
Definition: addimdnodedload.f:23
subroutine stop()
Definition: stop.f:20
void sgi_cleanup(ITG token)
void tau_cleanup()
void sgi_factor(double *ad, double *au, double *adb, double *aub, double *sigma, ITG *icol, ITG *irow, ITG *neq, ITG *nzs, ITG token)
void pardiso_factor(double *ad, double *au, double *adb, double *aub, double *sigma, ITG *icol, ITG *irow, ITG *neq, ITG *nzs, ITG *symmetryflag, ITG *inputformat, ITG *jq, ITG *nzs3)
subroutine temploaddiff(xforcold, xforc, xforcact, iamforc, nforc, xloadold, xload, xloadact, iamload, nload, ibody, xbody, nbody, xbodyold, xbodyact, t1old, t1, t1act, iamt1, nk, amta, namta, nam, ampli, time, reltime, ttime, dtime, ithermal, nmethod, xbounold, xboun, xbounact, iamboun, nboun, nodeboun, ndirboun, nodeforc, ndirforc, istep, iinc, co, vold, itg, ntg, amname, ikboun, ilboun, nelemload, sideload, mi, xforcdiff, xloaddiff, xbodydiff, t1diff, xboundiff, iabsload, iprescribedboundary, ntrans, trab, inotr, veold, nactdof, bcont, fn, ipobody, iponoel, inoel)
Definition: temploaddiff.f:29
void contact(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, ITG *ifree, double *co, double *vold, ITG *ielmat, double *cs, double *elcon, ITG *istep, ITG *iinc, ITG *iit, ITG *ncmat_, ITG *ntmat_, ITG *ne0, double *vini, ITG *nmethod, ITG *iperturb, ITG *ikboun, ITG *nboun, ITG *mi, ITG *imastop, ITG *nslavnode, ITG *islavnode, ITG *islavsurf, ITG *itiefac, double *areaslav, ITG *iponoels, ITG *inoels, double *springarea, double *tietol, double *reltime, ITG *imastnode, ITG *nmastnode, double *xmastnor, char *filab, ITG *mcs, ITG *ics, ITG *nasym, double *xnoels, ITG *mortar, double *pslavsurf, double *pmastsurf, double *clearini, double *theta, double *xstateini, double *xstate, ITG *nstate_, ITG *icutb, ITG *ialeatoric, char *jobnamef)
Definition: contact.c:23
subroutine createmdelem(imdnode, nmdnode, xforc, ikmpc, ilmpc, ipompc, nodempc, nmpc, imddof, nmddof, nactdof, mi, imdmpc, nmdmpc, imdboun, nmdboun, ikboun, nboun, ilboun, ithermal, imdelem, nmdelem, iponoel, inoel, prlab, prset, nprint, lakon, set, nset, ialset, ipkon, kon, istartset, iendset, nforc, ikforc, ilforc)
Definition: createmdelem.f:26
#define RENEW(a, b, c)
Definition: CalculiX.h:40
#define SFREE(a)
Definition: CalculiX.h:41
static double * f1
Definition: objectivemain_se.c:47
void checkinclength(double *time, double *ttime, double *theta, double *dtheta, ITG *idrct, double *tper, double *tmax, double *tmin, double *ctrl, double *amta, ITG *namta, ITG *itpamp, ITG *inext, double *dthetaref, ITG *itp, ITG *jprint, ITG *jout)
Definition: checkinclength.c:32
subroutine nident(x, px, n, id)
Definition: nident.f:26
subroutine fcrit(time, t, a, b, ze, d, dd, h1, h2, h3, h4, func, funcp)
Definition: fcrit.f:20
subroutine isortiiddc(ix1, ix2, dy1, dy2, cy, n, kflag)
Definition: isortiiddc.f:6
subroutine nonlinmpc(co, vold, ipompc, nodempc, coefmpc, labmpc, nmpc, ikboun, ilboun, nboun, xbounact, aux, iaux, maxlenmpc, ikmpc, ilmpc, icascade, kon, ipkon, lakon, ne, reltime, newstep, xboun, fmpc, iit, idiscon, ncont, trab, ntrans, ithermal, mi)
Definition: nonlinmpc.f:23
subroutine isortiddc(ix, dy1, dy2, cy, n, kflag)
Definition: isortiddc.f:6
subroutine createinum(ipkon, inum, kon, lakon, nk, ne, cflag, nelemload, nload, nodeboun, nboun, ndirboun, ithermal, co, vold, mi, ielmat)
Definition: createinum.f:21
void spooles_factor(double *ad, double *au, double *adb, double *aub, double *sigma, ITG *icol, ITG *irow, ITG *neq, ITG *nzs, ITG *symmetryflag, ITG *inputformat, ITG *nzs3)
subroutine addimdnodecload(nodeforc, iforc, imdnode, nmdnode, xforc, ikmpc, ilmpc, ipompc, nodempc, nmpc, imddof, nmddof, nactdof, mi, imdmpc, nmdmpc, imdboun, nmdboun, ikboun, nboun, ilboun, ithermal)
Definition: addimdnodecload.f:24
void spooles_cleanup()
void expand(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, char *labmpc, ITG *nmpc, ITG *nodeforc, ITG *ndirforc, double *xforc, ITG *nforc, ITG *nelemload, char *sideload, double *xload, ITG *nload, ITG *nactdof, ITG *neq, ITG *nmethod, ITG *ikmpc, ITG *ilmpc, ITG *ikboun, ITG *ilboun, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, ITG *ithermal, double *prestr, ITG *iprestr, double *vold, ITG *iperturb, double *sti, ITG *nzs, double *adb, double *aub, char *filab, double *eme, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstate, ITG *npmat_, char *matname, ITG *mi, ITG *ics, double *cs, ITG *mpcend, ITG *ncmat_, ITG *nstate_, ITG *mcs, ITG *nkon, double *ener, char *jobnamec, char *output, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nprint, char *prlab, char *prset, ITG *nener, double *trab, ITG *inotr, ITG *ntrans, double *ttime, double *fmpc, ITG *nev, double **z, ITG *iamboun, double *xbounold, ITG *nsectors, ITG *nm, ITG *icol, ITG *irow, ITG *nzl, ITG *nam, ITG *ipompcold, ITG *nodempcold, double *coefmpcold, char *labmpcold, ITG *nmpcold, double *xloadold, ITG *iamload, double *t1old, double *t1, ITG *iamt1, double *xstiff, ITG **icolep, ITG **jqep, ITG **irowep, ITG *isolver, ITG *nzse, double **adbep, double **aubep, ITG *iexpl, ITG *ibody, double *xbody, ITG *nbody, double *cocon, ITG *ncocon, char *tieset, ITG *ntie, ITG *imddof, ITG *nmddof, ITG *imdnode, ITG *nmdnode, ITG *imdboun, ITG *nmdboun, ITG *imdmpc, ITG *nmdmpc, ITG **izdofp, ITG *nzdof, ITG *nherm, double *xmr, double *xmi, char *typeboun, ITG *ielprop, double *prop, char *orname)
Definition: expand.c:33
subroutine rhs(co, nk, kon, ipkon, lakon, ne, ipompc, nodempc, coefmpc, nmpc, nodeforc, ndirforc, xforc, nforc, nelemload, sideload, xload, nload, xbody, ipobody, nbody, cgr, fext, nactdof, neq, nmethod, ikmpc, ilmpc, elcon, nelcon, rhcon, nrhcon, alcon, nalcon, alzero, ielmat, ielorien, norien, orab, ntmat_, t0, t1, ithermal, iprestr, vold, iperturb, iexpl, plicon, nplicon, plkcon, nplkcon, npmat_, ttime, time, istep, iinc, dtime, physcon, ibody, xloadold, reltime, veold, matname, mi, ikactmech, nactmech, ielprop, prop, sti, xstateini, xstate, nstate_)
Definition: rhs.f:29
#define ITG
Definition: CalculiX.h:51
void results(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, double *v, double *stn, ITG *inum, double *stx, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, double *prestr, ITG *iprestr, char *filab, double *eme, double *emn, double *een, ITG *iperturb, double *f, double *fn, ITG *nactdof, ITG *iout, double *qa, double *vold, double *b, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, char *labmpc, ITG *nmpc, ITG *nmethod, double *vmax, ITG *neq, double *veold, double *accold, double *beta, double *gamma, double *dtime, double *time, double *ttime, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstateini, double *xstiff, double *xstate, ITG *npmat_, double *epl, char *matname, ITG *mi, ITG *ielas, ITG *icmd, ITG *ncmat_, ITG *nstate_, double *stiini, double *vini, ITG *ikboun, ITG *ilboun, double *ener, double *enern, double *emeini, double *xstaten, double *eei, double *enerini, double *cocon, ITG *ncocon, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nprint, char *prlab, char *prset, double *qfx, double *qfn, double *trab, ITG *inotr, ITG *ntrans, double *fmpc, ITG *nelemload, ITG *nload, ITG *ikmpc, ITG *ilmpc, ITG *istep, ITG *iinc, double *springarea, double *reltime, ITG *ne0, double *xforc, ITG *nforc, double *thicke, double *shcon, ITG *nshcon, char *sideload, double *xload, double *xloadold, ITG *icfd, ITG *inomat, double *pslavsurf, double *pmastsurf, ITG *mortar, ITG *islavact, double *cdn, ITG *islavnode, ITG *nslavnode, ITG *ntie, double *clearini, ITG *islavsurf, ITG *ielprop, double *prop, double *energyini, double *energy, ITG *kscale, ITG *iponoel, ITG *inoel, ITG *nener, char *orname, ITG *network, ITG *ipobody, double *xbodyact, ITG *ibody)
Definition: results.c:42
void tau_factor(double *ad, double **aup, double *adb, double *aub, double *sigma, ITG *icol, ITG **irowp, ITG *neq, ITG *nzs)
void dynboun(double *amta, ITG *namta, ITG *nam, double *ampli, double *time, double *ttime, double *dtime, double *xbounold, double *xboun, double *xbounact, ITG *iamboun, ITG *nboun, ITG *nodeboun, ITG *ndirboun, double *ad, double *au, double *adb, double *aub, ITG *icol, ITG *irow, ITG *neq, ITG *nzs, double *sigma, double *b, ITG *isolver, double *alpham, double *betam, ITG *nzl, ITG *init, double *bact, double *bmin, ITG *jq, char *amname, double *bv, double *bprev, double *bdiff, ITG *nactmech, ITG *icorrect, ITG *iprev)
Definition: dynboun.c:37
subroutine createmddof(imddof, nmddof, istartset, iendset, ialset, nactdof, ithermal, mi, imdnode, nmdnode, ikmpc, ilmpc, ipompc, nodempc, nmpc, imdmpc, nmdmpc, imdboun, nmdboun, ikboun, nboun, nset, ntie, tieset, set, lakon, kon, ipkon, labmpc, ilboun, filab, prlab, prset, nprint, ne, cyclicsymmetry)
Definition: createmddof.f:25
#define NNEW(a, b, c)
Definition: CalculiX.h:39
subroutine bodyforce(cbody, ibody, ipobody, nbody, set, istartset, iendset, ialset, inewton, nset, ifreebody, k)
Definition: bodyforce.f:21
subroutine dynresults(nk, v, ithermal, nactdof, vold, nodeboun, ndirboun, xboun, nboun, ipompc, nodempc, coefmpc, labmpc, nmpc, b, bp, veold, dtime, mi, imdnode, nmdnode, imdboun, nmdboun, imdmpc, nmdmpc, nmethod, time)
Definition: dynresults.f:23

◆ dynacont()

void dynacont ( double *  co,
ITG nk,
ITG kon,
ITG ipkon,
char *  lakon,
ITG ne,
ITG nodeboun,
ITG ndirboun,
double *  xboun,
ITG nboun,
ITG ipompc,
ITG nodempc,
double *  coefmpc,
char *  labmpc,
ITG nmpc,
ITG nodeforc,
ITG ndirforc,
double *  xforc,
ITG nforc,
ITG nelemload,
char *  sideload,
double *  xload,
ITG nload,
ITG nactdof,
ITG neq,
ITG nzl,
ITG icol,
ITG irow,
ITG nmethod,
ITG ikmpc,
ITG ilmpc,
ITG ikboun,
ITG ilboun,
double *  elcon,
ITG nelcon,
double *  rhcon,
ITG nrhcon,
double *  cocon,
ITG ncocon,
double *  alcon,
ITG nalcon,
double *  alzero,
ITG ielmat,
ITG ielorien,
ITG norien,
double *  orab,
ITG ntmat_,
double *  t0,
double *  t1,
ITG ithermal,
double *  prestr,
ITG iprestr,
double *  vold,
ITG iperturb,
double *  sti,
ITG nzs,
double *  tinc,
double *  tper,
double *  xmodal,
double *  veold,
char *  amname,
double *  amta,
ITG namta,
ITG nam,
ITG iamforc,
ITG iamload,
ITG iamt1,
ITG jout,
char *  filab,
double *  eme,
double *  xforcold,
double *  xloadold,
double *  t1old,
ITG iamboun,
double *  xbounold,
ITG iexpl,
double *  plicon,
ITG nplicon,
double *  plkcon,
ITG nplkcon,
double *  xstate,
ITG npmat_,
char *  matname,
ITG mi,
ITG ncmat_,
ITG nstate_,
double *  ener,
char *  jobnamec,
double *  ttime,
char *  set,
ITG nset,
ITG istartset,
ITG iendset,
ITG ialset,
ITG nprint,
char *  prlab,
char *  prset,
ITG nener,
double *  trab,
ITG inotr,
ITG ntrans,
double *  fmpc,
char *  cbody,
ITG ibody,
double *  xbody,
ITG nbody,
double *  xbodyold,
ITG istep,
ITG isolver,
ITG jq,
char *  output,
ITG mcs,
ITG nkon,
ITG mpcend,
ITG ics,
double *  cs,
ITG ntie,
char *  tieset,
ITG idrct,
ITG jmax,
double *  tmin,
double *  tmax,
double *  ctrl,
ITG itpamp,
double *  tietol,
ITG iit,
ITG ncont,
ITG ne0,
double *  reltime,
double *  dtime,
double *  bcontini,
double *  bj,
double *  aux,
ITG iaux,
double *  bcont,
ITG nev,
double *  v,
ITG nkon0,
double *  deltmx,
double *  dtheta,
double *  theta,
ITG iprescribedboundary,
ITG mpcfree,
ITG memmpc_,
ITG itietri,
ITG koncont,
double *  cg,
double *  straight,
ITG iinc,
double *  vini,
double *  aa,
double *  bb,
double *  aanew,
double *  d,
double *  z,
double *  zeta,
double *  b,
double *  time0,
double *  time1,
ITG ipobody,
double *  xforcact,
double *  xloadact,
double *  t1act,
double *  xbounact,
double *  xbodyact,
double *  cd,
double *  cv,
double *  ampli,
double *  dthetaref,
double *  bjp,
double *  bp,
double *  cstr,
ITG imddof,
ITG nmddof,
ITG **  ikactcontp,
ITG nactcont,
ITG nactcont_,
double *  aamech,
double *  bprev,
ITG iprev,
ITG inonlinmpc,
ITG **  ikactmechp,
ITG nactmech,
ITG imdnode,
ITG nmdnode,
ITG imdboun,
ITG nmdboun,
ITG imdmpc,
ITG nmdmpc,
ITG itp,
ITG inext,
ITG imastop,
ITG nslavnode,
ITG islavnode,
ITG islavsurf,
ITG itiefac,
double *  areaslav,
ITG iponoels,
ITG inoels,
double *  springarea,
ITG izdof,
ITG nzdof,
double *  fn,
ITG imastnode,
ITG nmastnode,
double *  xmastnor,
double *  xstateini,
ITG nslavs,
ITG cyclicsymmetry,
double *  xnoels,
ITG ielas,
ITG ielprop,
double *  prop 
)
96  {
97 
98  char lakonl[9]=" \0",jobnamef[396]="";
99 
100  ITG i,j,k,l,init,*itg=NULL,ntg=0,maxlenmpc,icascade=0,loop,
101  konl[20],imat,nope,kodem,indexe,j1,jdof,kmin,kmax,
102  id,newstep=0,idiscon,*ipiv=NULL,info,nrhs=1,kode,
103  *ikactcont=NULL,*ilactcont=NULL,*ikactcont1=NULL,nactcont1=0,
104  i1,icutb=0,iconvergence=0,idivergence=0,mt=mi[1]+1,
105  nactcont1_=100,*ikactmech=NULL,iabsload=0,im,nasym=0,mortar=0,
106  ialeatoric=0,*iponoel=NULL,*inoel=NULL;
107 
108  long long i2;
109 
110  double *adb=NULL,*aub=NULL,*cgr=NULL, *au=NULL,fexp,fcos,fsin,fexm,
111  physcon[1],zetaj,dj,ddj,h1,h2,h3,h4,h5,h6,sum,aai,bbi,tstart,tend,
112  *ad=NULL,sigma=0.,alpham,betam,*bact=NULL,*bmin=NULL,*bv=NULL,
113  xl[27],voldl[mt*9],elas[21],fnl[27],t1l,elconloc[21],veoldl[mt*9],
114  bbmax,s[3600],*aaa=NULL,*bbb=NULL,func,funcp,*bjbasp=NULL,
115  *bjbas=NULL, *bjinc=NULL, *dbj=NULL, *lhs=NULL,dbjmax,bjmax,
116  *bjincp=NULL,sump,h14,*dbjp=NULL,senergy=0.0,*xforcdiff=NULL,
117  df,i0,ic,ia,dbjmaxOLD1,dbjmaxOLD2,*xloaddiff=NULL,*dbcont=NULL,
118  zl=0.0,*xbodydiff=NULL,*t1diff=NULL,*xboundiff=NULL,*bdiff=NULL,
119  *pslavsurf=NULL,*pmastsurf=NULL,*clearini=NULL,venergy=0.0;
120 
121  ikactcont=*ikactcontp;ikactmech=*ikactmechp;
122 
123  for(k=0;k<3;k++){
124  strcpy1(&jobnamef[k*132],&jobnamec[k*132],132);
125  }
126 
127  if(*inonlinmpc==1) iabsload=2;
128 
129  if(ithermal[0]<=1){
130  kmin=1;kmax=3;
131  }else if(ithermal[0]==2){
132  kmin=0;kmax=mi[1];if(kmax>2)kmax=2;
133  }else{
134  kmin=0;kmax=3;
135  }
136 
137  NNEW(xforcdiff,double,*nforc);
138  NNEW(xloaddiff,double,2**nload);
139  NNEW(xbodydiff,double,7**nbody);
140 
141  /* copying the rotation axis and/or acceleration vector */
142 
143  for(k=0;k<7**nbody;k++){xbodydiff[k]=xbody[k];}
144  NNEW(xboundiff,double,*nboun);
145  if(*ithermal==1) NNEW(t1diff,double,*nk);
146 
147  /* load the convergence constants from ctrl*/
148 
149  i0=ctrl[0];ic=ctrl[3];ia=ctrl[7];df=ctrl[10];
150 
151  /* set the convergence parameters*/
152 
153  dbjmaxOLD1=0.0;
154  dbjmaxOLD2=0.0;
155 
156  /* calculating the contact forces */
157 
158  for(j=0;j<*nactcont;j++){bcont[ikactcont[j]]=0.;}
159 
160  *ne=*ne0;*nkon=*nkon0;
161 
162  contact(ncont,ntie,tieset,nset,set,istartset,iendset,
163  ialset,itietri,lakon,ipkon,kon,koncont,ne,cg,
164  straight,nkon,co,vold,ielmat,cs,elcon,istep,
165  iinc,iit,ncmat_,ntmat_,ne0,
166  vini,nmethod,
167  iperturb,ikboun,nboun,mi,imastop,nslavnode,islavnode,islavsurf,
168  itiefac,areaslav,iponoels,inoels,springarea,tietol,reltime,
169  imastnode,nmastnode,xmastnor,filab,mcs,ics,&nasym,
170  xnoels,&mortar,pslavsurf,pmastsurf,clearini,theta,
171  xstateini,xstate,nstate_,&icutb,&ialeatoric,jobnamef);
172 
173  NNEW(ikactcont1,ITG,nactcont1_);
174 
175  for(i=*ne0;i<*ne;i++){
176  indexe=ipkon[i];
177  imat=ielmat[mi[2]*i];
178  kodem=nelcon[2*imat-2];
179  for(j=0;j<8;j++){lakonl[j]=lakon[8*i+j];}
180  nope=atoi(&lakonl[7])+1;
181  for(j=0;j<nope;j++){
182  konl[j]=kon[indexe+j];
183  for(j1=0;j1<3;j1++){
184  xl[j*3+j1]=co[3*(konl[j]-1)+j1];
185  voldl[mt*j+j1+1]=vold[mt*(konl[j]-1)+j1+1];
186  veoldl[mt*j+j1+1]=veold[mt*(konl[j]-1)+j1+1];
187  }
188  }
189  konl[nope]=kon[indexe+nope];
190 
191  FORTRAN(springforc_n2f,(xl,konl,voldl,&imat,elcon,nelcon,elas,
192  fnl,ncmat_,ntmat_,&nope,lakonl,
193  &t1l,&kodem,elconloc,plicon,nplicon,npmat_,
194  &senergy,nener,cstr,mi,
195  &springarea[2*(konl[nope]-1)],nmethod,ne0,
196  nstate_,xstateini,xstate,reltime,ielas,
197  &venergy,ielorien,orab,norien,&i));
198 
199  storecontactdof(&nope,nactdof,&mt,konl,&ikactcont1,&nactcont1,
200  &nactcont1_,bcont,fnl,ikmpc,nmpc,ilmpc,ipompc,nodempc,
201  coefmpc);
202 
203  }
204  RENEW(ikactcont1,ITG,nactcont1);
205 
206  /* merging ikactcont with ikactcont1; the result ist
207  stored in ikactcont */
208 
209  for(i=0;i<nactcont1;i++){
210  jdof=ikactcont1[i];
211  FORTRAN(nident,(ikactcont,&jdof,nactcont,&id));
212  do{
213  if(id>0){
214  if(ikactcont[id-1]==jdof){
215  break;
216  }
217  }
218  (*nactcont)++;
219  if(*nactcont>*nactcont_){
220  *nactcont_=(ITG)(1.1**nactcont_);
221  RENEW(ikactcont,ITG,*nactcont_);
222  }
223  k=*nactcont-1;
224  l=k-1;
225  while(k>id){
226  ikactcont[k--]=ikactcont[l--];
227  }
228  ikactcont[id]=jdof;
229  break;
230  }while(1);
231  }
232 
233  /* calculate the change in contact force */
234 
235  bbmax=0.;
236  if(icutb==0){
237  for(i=0;i<*nactcont;i++){
238  jdof=ikactcont[i];
239  if(fabs(bcont[jdof]-bcontini[jdof])>bbmax){
240  bbmax=fabs(bcont[jdof]-bcontini[jdof]);
241  }
242  }
243  }
244 
245  /* removing entries in bcont */
246 
247  for(j=0;j<nactcont1;j++){bcont[ikactcont1[j]]=0.;}
248  SFREE(ikactcont1);
249  *nactcont=0;
250 
251  /* major loop to calculate the correction of bj due to contact */
252 
253  NNEW(ilactcont,ITG,*nactcont_);
254  NNEW(dbcont,double,*nactcont_**nev);
255 
256  icutb=0;
257 
258  do{
259 
260  /* restoring initial values */
261 
262  if(*nmdnode>0){
263  for(i=0;i<*nmdnode;i++){
264  i1=mt*(imdnode[i]-1);
265  for(j=kmin;j<=kmax;j++){
266  vold[i1+j]=vini[i1+j];
267  }
268  }
269  }else{
270  memcpy(&vold[0],&vini[0],sizeof(double)*mt**nk);
271  }
272 
273  if(*nstate_!=0){
274  for(k=0;k<*nstate_*mi[0]*(*ne0+*nslavs);++k){
275  xstate[k]=xstateini[k];
276  }
277  }
278 
279  /* restoring aa[(iinc-1)*nev+i] (before change of *dtime) */
280 
281  for(i=0;i<*nev;i++){
282  aa[i]+=bb[i]*(*time-*dtime);
283  }
284 
285  /* increment size is reduced if:
286  - the contact force change is too large (only in first iteration)
287  - or the increment did not converge */
288 
289  if((bbmax>*deltmx || icutb>0)&&(((*itp==1)&&(*dtheta>*tmin))||(*itp==0))){
290 
291  /* force increase too big: increment size is decreased */
292 
293  if(icutb>0){
294  *dtheta=*dtheta*df;
295  }
296  else{
297  *dtheta=*dtheta**deltmx/bbmax;
298  }
299  *dthetaref=*dtheta;
300  if(*itp==1){
301  (*inext)--;
302  *itp=0;
303  }
304 
305  /* check whether the new increment size is not too small */
306 
307  if(*dtheta<*tmin){
308  *dtheta=*tmin;
309  *dthetaref=*dtheta;
310  }
311 
312  *reltime=*theta+(*dtheta);
313  *time=*reltime**tper;
314  *dtime=*dtheta**tper;
315 
316  /* calculating the instantaneous loads (forces, surface loading,
317  centrifugal and gravity loading or temperature) */
318 
319  FORTRAN(temploaddiff,(xforcold,xforc,xforcact,iamforc,nforc,
320  xloadold,xload,xloadact,iamload,nload,ibody,xbody,
321  nbody,xbodyold,xbodyact,t1old,t1,t1act,iamt1,nk,amta,
322  namta,nam,ampli,time,reltime,ttime,dtime,ithermal,
323  nmethod,xbounold,xboun,xbounact,iamboun,nboun,nodeboun,
324  ndirboun,nodeforc,
325  ndirforc,istep,iinc,co,vold,itg,&ntg,amname,ikboun,ilboun,
326  nelemload,sideload,mi,
327  xforcdiff,xloaddiff,xbodydiff,t1diff,xboundiff,&iabsload,
328  iprescribedboundary,ntrans,trab,inotr,veold,nactdof,bcont,
329  fn,ipobody,iponoel,inoel));
330 
331  /* calculating the instantaneous loading vector */
332 
333  if(iabsload!=2){
334  FORTRAN(rhs,(co,nk,kon,ipkon,lakon,ne,
335  ipompc,nodempc,coefmpc,nmpc,nodeforc,ndirforc,xforcdiff,
336  nforc,nelemload,sideload,xloaddiff,nload,xbodydiff,
337  ipobody,nbody,cgr,b,nactdof,&neq[1],nmethod,
338  ikmpc,ilmpc,elcon,nelcon,rhcon,nrhcon,
339  alcon,nalcon,alzero,ielmat,ielorien,norien,orab,ntmat_,
340  t0,t1diff,ithermal,iprestr,vold,iperturb,iexpl,plicon,
341  nplicon,plkcon,nplkcon,
342  npmat_,ttime,time,istep,iinc,dtime,physcon,ibody,
343  xbodyold,reltime,veold,matname,mi,ikactmech,nactmech,
344  ielprop,prop,sti,xstateini,xstate,nstate_));
345  }else{
346  FORTRAN(rhs,(co,nk,kon,ipkon,lakon,ne,
347  ipompc,nodempc,coefmpc,nmpc,nodeforc,ndirforc,xforcact,
348  nforc,nelemload,sideload,xloadact,nload,xbodyact,
349  ipobody,nbody,cgr,b,nactdof,&neq[1],nmethod,
350  ikmpc,ilmpc,elcon,nelcon,rhcon,nrhcon,
351  alcon,nalcon,alzero,ielmat,ielorien,norien,orab,ntmat_,
352  t0,t1act,ithermal,iprestr,vold,iperturb,iexpl,plicon,
353  nplicon,plkcon,nplkcon,
354  npmat_,ttime,time,istep,iinc,dtime,physcon,ibody,
355  xbodyold,reltime,veold,matname,mi,ikactmech,nactmech,
356  ielprop,prop,sti,xstateini,xstate,nstate_));
357  }
358 
359  /* correction for nonzero SPC's */
360 
361  if(*iprescribedboundary){
362  dynboun(amta,namta,nam,ampli,time,ttime,dtime,
363  xbounold,xboun,
364  xbounact,iamboun,nboun,nodeboun,ndirboun,ad,au,adb,
365  aub,icol,irow,neq,nzs,&sigma,b,isolver,
366  &alpham,&betam,nzl,&init,bact,bmin,jq,amname,bv,
367  bprev,bdiff,nactmech,&iabsload,iprev);
368  }
369 
370  /* correcting aamech */
371 
372  if(!(*cyclicsymmetry)){
373  for(i=0;i<*nev;i++){
374  i2=(long long)i*neq[1];
375 
376  if(iabsload==2){aamech[i]=0.;}
377  if(*nactmech<neq[1]/2){
378  for(j=0;j<*nactmech;j++){
379  aamech[i]+=z[i2+ikactmech[j]]*b[ikactmech[j]];
380  }
381  }else{
382  for(j=0;j<neq[1];j++){
383  aamech[i]+=z[i2+j]*b[j];
384  }
385  }
386  }
387  }else{
388  for(i=0;i<*nev;i++){
389  if(iabsload==2){aamech[i]=0.;}
390  }
391  for(j=0;j<*nactmech;j++){
392  FORTRAN(nident,(izdof,&ikactmech[j],nzdof,&id));
393  if(id!=0){
394  if(izdof[id-1]==ikactmech[j]){
395  for(i=0;i<*nev;i++){
396  aamech[i]+=z[i**nzdof+id-1]*b[ikactmech[j]];
397  }
398  }else{printf("*ERROR in dynacont\n");FORTRAN(stop,());}
399  }else{printf("*ERROR in dynacont\n");FORTRAN(stop,());}
400  }
401  }
402 
403  }
404 
405  bbmax=0.;
406 
407  /* calculating the linearized force function connecting the
408  mechanical+contact load at the start of the increment with
409  the mechanical load at the end of the increment
410  = base load */
411 
412  for(i=0;i<*nev;i++){
413 
414  aanew[i]=aamech[i];
415 
416  bb[i]=(aanew[i]-aa[i])/(*dtime);
417  aa[i]=aanew[i]-bb[i]**time;
418  }
419 
420  /* calculating the base response */
421 
422  NNEW(bjbas,double,*nev); /* basis response modal decomposition */
423  NNEW(bjbasp,double,*nev);
424  for(l=0;l<*nev;l++){
425  zetaj=zeta[l];
426  dj=d[l];
427 
428  /* zero eigenfrequency: rigid body mode */
429 
430  if(fabs(d[l])<=1.e-10){
431  aai=aa[l];
432  bbi=bb[l];
433  tstart=*time0;
434  tend=*time;
435  sum=tend*(aai**time+
436  tend*((bbi**time-aai)/2.-bbi*tend/3.))-
437  tstart*(aai**time+
438  tstart*((bbi**time-aai)/2.-bbi*tstart/3.));
439  sump=tend*(aai+bbi*tend/2.)-tstart*(aai+bbi*tstart/2.);
440  bjbas[l]=sum+cd[l]+*dtime*cv[l];
441  bjbasp[l]=sump+cv[l];
442  }
443 
444  /* subcritical damping */
445 
446  else if(zetaj<1.-1.e-6){
447  ddj=dj*sqrt(1.-zetaj*zetaj);
448  h1=zetaj*dj;
449  h2=h1*h1+ddj*ddj;
450  h3=h1*h1-ddj*ddj;
451  h4=2.*h1*ddj/h2;
452  h14=zetaj*dj/ddj;
453  tstart=0;
454  FORTRAN(fsub,(time,dtime,&aa[l],&bb[l],&ddj,
455  &h1,&h2,&h3,&h4,&func,&funcp));
456  sum=func;sump=funcp;
457  FORTRAN(fsub,(time,&tstart,&aa[l],&bb[l],&ddj,
458  &h1,&h2,&h3,&h4,&func,&funcp));
459  sum-=func;sump-=funcp;
460  fexp=exp(-h1**dtime);
461  fsin=sin(ddj**dtime);
462  fcos=cos(ddj**dtime);
463 
464  bjbas[l]=sum/ddj+fexp*(fcos+zetaj/sqrt(1.-zetaj*zetaj)*fsin)*cd[l]+
465  fexp*fsin*cv[l]/ddj;
466  bjbasp[l]=sump/ddj+fexp*((-h1+ddj*h14)*fcos+(-ddj-h1*h14)*fsin)*cd[l]
467  +fexp*(-h1*fsin+ddj*fcos)*cv[l]/ddj;
468 
469  }
470 
471  /* supercritical damping */
472 
473  else if(zetaj>1.+1.e-6){
474  ddj=dj*sqrt(zetaj*zetaj-1.);
475  h1=ddj-zetaj*dj;
476  h2=ddj+zetaj*dj;
477  h3=1./h1;
478  h4=1./h2;
479  h5=h3*h3;
480  h6=h4*h4;
481  tstart=0;
482  FORTRAN(fsuper,(time,dtime,&aa[l],&bb[l],
483  &h1,&h2,&h3,&h4,&h5,&h6,&func,&funcp));
484  sum=func;sump=funcp;
485  FORTRAN(fsuper,(time,&tstart,&aa[l],&bb[l],
486  &h1,&h2,&h3,&h4,&h5,&h6,&func,&funcp));
487  sum-=func;sump-=funcp;
488  fexm=exp(h1**dtime);
489  fexp=exp(-h2**dtime);
490  h14=zetaj*dj/ddj;
491 
492  bjbas[l]=sum/(2.*ddj)+(fexm+fexp)*cd[l]/2.+zetaj*(fexm-fexp)/(2.*sqrt(zetaj*zetaj-1.))*cd[l]+(fexm-fexp)*cv[l]/(2.*ddj);
493  bjbasp[l]=sump/(2.*ddj)+(h1*fexm-h2*fexp)*cd[l]/2.+(h14*cd[l]+cv[l]/ddj)*(h1*fexm+h2*fexp)/2.;
494  }
495 
496  /* critical damping */
497 
498  else{
499  h1=zetaj*dj;
500  h2=1./h1;
501  h3=h2*h2;
502  h4=h2*h3;
503  tstart=0;
504  FORTRAN(fcrit,(time,dtime,&aa[l],&bb[l],&zetaj,&dj,
505  &ddj,&h1,&h2,&h3,&h4,&func,&funcp));
506  sum=func;sump=funcp;
507  FORTRAN(fcrit,(time,&tstart,&aa[l],&bb[l],&zetaj,&dj,
508  &ddj,&h1,&h2,&h3,&h4,&func,&funcp));
509  sum-=func;sump+=funcp;
510  fexp=exp(-h1**dtime);
511  bjbas[l]=sum+fexp*((1.+h1**dtime)*cd[l]+*dtime*cv[l]);
512  bjbasp[l]=sump+fexp*(-h1*h1**dtime*cd[l]+(1.-h1**dtime)*cv[l]);
513  }
514  }
515 
516  /* calculating the incremental response due to contact */
517 
518  aai=-(*time-*dtime)/(*dtime);
519  bbi=1./(*dtime);
520 
521  NNEW(bjinc,double,*nev); /* incremental response modal decomposition */
522  NNEW(bjincp,double,*nev);
523  for(l=0;l<*nev;l++){
524  zetaj=zeta[l];
525  dj=d[l];
526 
527  /* zero eigenfrequency: rigid body mode */
528 
529  if(fabs(d[l])<=1.e-10){
530  tstart=*time0;
531  tend=*time;
532  sum=tend*(aai**time+
533  tend*((bbi**time-aai)/2.-bbi*tend/3.))-
534  tstart*(aai**time+
535  tstart*((bbi**time-aai)/2.-bbi*tstart/3.));
536  sump=tend*(aai+bbi*tend/2.)-tstart*(aai+bbi*tstart/2.);
537 
538  bjinc[l]=sum;
539  bjincp[l]=sump;
540  }
541 
542  /* subcritical damping */
543 
544  else if(zetaj<1.-1.e-6){
545  ddj=dj*sqrt(1.-zetaj*zetaj);
546  h1=zetaj*dj;
547  h2=h1*h1+ddj*ddj;
548  h3=h1*h1-ddj*ddj;
549  h4=2.*h1*ddj/h2;
550  tstart=0.;
551  FORTRAN(fsub,(time,dtime,&aai,&bbi,&ddj,
552  &h1,&h2,&h3,&h4,&func,&funcp));
553  sum=func;sump=funcp;
554  FORTRAN(fsub,(time,&tstart,&aai,&bbi,&ddj,
555  &h1,&h2,&h3,&h4,&func,&funcp));
556  sum-=func;sump-=funcp;
557 
558  bjinc[l]=sum/ddj;
559  bjincp[l]=sump/ddj;
560 
561  }
562 
563  /* supercritical damping */
564 
565  else if(zetaj>1.+1.e-6){
566  ddj=dj*sqrt(zetaj*zetaj-1.);
567  h1=ddj-zetaj*dj;
568  h2=ddj+zetaj*dj;
569  h3=1./h1;
570  h4=1./h2;
571  h5=h3*h3;
572  h6=h4*h4;
573  tstart=0.;
574  FORTRAN(fsuper,(time,dtime,&aai,&bbi,
575  &h1,&h2,&h3,&h4,&h5,&h6,&func,&funcp));
576  sum=func;sump=funcp;
577  FORTRAN(fsuper,(time,&tstart,&aai,&bbi,
578  &h1,&h2,&h3,&h4,&h5,&h6,&func,&funcp));
579  sum-=func;sump-=funcp;
580 
581  bjinc[l]=sum/(2.*ddj);
582  bjincp[l]=sump/(2.*ddj);
583 
584  }
585 
586  /* critical damping */
587 
588  else{
589  h1=zetaj*dj;
590  h2=1./h1;
591  h3=h2*h2;
592  h4=h2*h3;
593  tstart=0.;
594  FORTRAN(fcrit,(time,dtime,&aai,&bbi,&zetaj,&dj,
595  &ddj,&h1,&h2,&h3,&h4,&func,&funcp));
596  sum=func;sump=funcp;
597  FORTRAN(fcrit,(time,&tstart,&aai,&bbi,&zetaj,&dj,
598  &ddj,&h1,&h2,&h3,&h4,&func,&funcp));
599  sum-=func;sump-=funcp;
600 
601  bjinc[l]=sum;
602  bjincp[l]=sump;
603 
604  }
605  }
606 
607  NNEW(aaa,double,*nev);
608  NNEW(bbb,double,*nev**nev);
609  NNEW(lhs,double,*nev**nev);
610  NNEW(ipiv,ITG,*nev);
611  NNEW(dbj,double,*nev); /* change in bj */
612  NNEW(dbjp,double,*nev); /* change in djp */
613 
614  /* starting solution for the iteration loop = base solution */
615 
616  memcpy(&bj[0],&bjbas[0],sizeof(double)**nev);
617  memcpy(&bjp[0],&bjbasp[0],sizeof(double)**nev);
618 
619  /* major iteration loop for the contact response */
620 
621  loop=0;
622  do{
623  loop++;
624 
625  /* composing the response */
626 
627  if(*iprescribedboundary){
628  if(*nmdnode==0){
629  memcpy(&b[0],&bmin[0],sizeof(double)*neq[1]);
630  memcpy(&bp[0],&bv[0],sizeof(double)*neq[1]);
631  }else{
632  for(i=0;i<*nmddof;i++){
633  b[imddof[i]]=bmin[imddof[i]];
634  bp[imddof[i]]=bv[imddof[i]];
635  }
636  }
637  }
638  else{
639  if(*nmdnode==0){
640  DMEMSET(b,0,neq[1],0.);
641  DMEMSET(bp,0,neq[1],0.);
642  }else{
643  for(i=0;i<*nmddof;i++){
644  b[imddof[i]]=0.;
645  bp[imddof[i]]=0.;
646  }
647  }
648  }
649 
650  if(!(*cyclicsymmetry)){
651  if(*nmdnode==0){
652  for(i=0;i<neq[1];i++){
653  for(j=0;j<*nev;j++){
654  b[i]+=bj[j]*z[(long long)j*neq[1]+i];
655  bp[i]+=bjp[j]*z[(long long)j*neq[1]+i];
656  }
657  }
658  }else{
659  for(i=0;i<*nmddof;i++){
660  for(j=0;j<*nev;j++){
661  b[imddof[i]]+=bj[j]*z[(long long)j*neq[1]+imddof[i]];
662  bp[imddof[i]]+=bjp[j]*z[(long long)j*neq[1]+imddof[i]];
663  }
664  }
665  }
666  }else{
667  for(i=0;i<*nmddof;i++){
668  FORTRAN(nident,(izdof,&imddof[i],nzdof,&id));
669  if(id!=0){
670  if(izdof[id-1]==imddof[i]){
671  for(j=0;j<*nev;j++){
672  b[imddof[i]]+=bj[j]*z[j**nzdof+id-1];
673  bp[imddof[i]]+=bjp[j]*z[j**nzdof+id-1];
674  }
675  }else{printf("*ERROR in dynacont\n");FORTRAN(stop,());}
676  }else{printf("*ERROR in dynacont\n");FORTRAN(stop,());}
677  }
678  }
679 
680  /* update nonlinear MPC-coefficients (e.g. for rigid
681  body MPC's */
682 
683  if(*inonlinmpc==1){
684  FORTRAN(nonlinmpc,(co,vold,ipompc,nodempc,coefmpc,labmpc,
685  nmpc,ikboun,ilboun,nboun,xbounact,aux,iaux,
686  &maxlenmpc,ikmpc,ilmpc,&icascade,
687  kon,ipkon,lakon,ne,reltime,&newstep,xboun,fmpc,
688  iit,&idiscon,ncont,trab,ntrans,ithermal,mi));
689  }
690 
691  /* calculating displacements/temperatures */
692 
693  FORTRAN(dynresults,(nk,v,ithermal,nactdof,vold,nodeboun,
694  ndirboun,xbounact,nboun,ipompc,nodempc,coefmpc,labmpc,nmpc,
695  b,bp,veold,dtime,mi,imdnode,nmdnode,imdboun,nmdboun,
696  imdmpc,nmdmpc,nmethod,time));
697 
698  if((iconvergence==1)||((*idrct==1)&&(loop>1))){
699  break;
700  }
701 
702  /* creating contact elements and calculating the contact forces
703  based on the displacements at the end of the present increment */
704 
705  for(j=0;j<*nactcont;j++){bcont[ikactcont[j]]=0.;}
706 
707  RENEW(dbcont,double,*nactcont_**nev);
708  RENEW(ikactcont,ITG,*nactcont_);
709  RENEW(ilactcont,ITG,*nactcont_);
710  *nactcont=0;
711 
712  DMEMSET(dbcont,0,*nactcont_**nev,0.);
713  DMEMSET(ikactcont,0,*nactcont_,0.);
714 
715  *ne=*ne0;*nkon=*nkon0;
716  contact(ncont,ntie,tieset,nset,set,istartset,iendset,
717  ialset,itietri,lakon,ipkon,kon,koncont,ne,cg,
718  straight,nkon,co,vold,ielmat,cs,elcon,istep,
719  iinc,iit,ncmat_,ntmat_,ne0,
720  vini,nmethod,
721  iperturb,ikboun,nboun,mi,imastop,nslavnode,islavnode,islavsurf,
722  itiefac,areaslav,iponoels,inoels,springarea,tietol,reltime,
723  imastnode,nmastnode,xmastnor,filab,mcs,ics,&nasym,
724  xnoels,&mortar,pslavsurf,pmastsurf,clearini,theta,
725  xstateini,xstate,nstate_,&icutb,&ialeatoric,jobnamef);
726 
727  for(i=*ne0;i<*ne;i++){
728  indexe=ipkon[i];
729  imat=ielmat[mi[2]*i];
730  kodem=nelcon[2*imat-2];
731  for(j=0;j<8;j++){lakonl[j]=lakon[8*i+j];}
732  nope=atoi(&lakonl[7])+1;
733  for(j=0;j<nope;j++){
734  konl[j]=kon[indexe+j];
735  for(j1=0;j1<3;j1++){
736  xl[j*3+j1]=co[3*(konl[j]-1)+j1];
737  voldl[mt*j+j1+1]=vold[mt*(konl[j]-1)+j1+1];
738  veoldl[mt*j+j1+1]=veold[mt*(konl[j]-1)+j1+1];
739  }
740  }
741  konl[nope]=kon[indexe+nope];
742 
743  FORTRAN(springforc_n2f,(xl,konl,voldl,&imat,elcon,nelcon,elas,
744  fnl,ncmat_,ntmat_,&nope,lakonl,
745  &t1l,&kodem,elconloc,plicon,nplicon,npmat_,
746  &senergy,nener,cstr,mi,
747  &springarea[2*(konl[nope]-1)],nmethod,ne0,
748  nstate_,xstateini,xstate,reltime,ielas,
749  &venergy,ielorien,orab,norien,&i));
750 
751  FORTRAN(springstiff_n2f,(xl,elas,konl,voldl,s,&imat,elcon,nelcon,
752  ncmat_,ntmat_,&nope,lakonl,&t1l,&kode,elconloc,
753  plicon,nplicon,npmat_,iperturb,&springarea[2*(konl[nope]-1)],
754  nmethod,mi,ne0,nstate_,xstateini,xstate,reltime,&nasym,
755  ielorien,orab,norien,&i));
756 
757  dfdbj(bcont,&dbcont,&neq[1],&nope,konl,nactdof,
758  s,z,ikmpc,ilmpc,ipompc,nodempc,nmpc,coefmpc,
759  fnl,nev,&ikactcont,&ilactcont,nactcont,nactcont_,mi,
760  cyclicsymmetry,izdof,nzdof);
761  }
762 
763  if(*nactcont>100){*nactcont_=*nactcont;}else{*nactcont_=100;}
764  RENEW(ikactcont,ITG,*nactcont_);
765  RENEW(ilactcont,ITG,*nactcont_);
766  RENEW(dbcont,double,*nactcont_**nev);
767 
768  /* aaa(i) is the internal product of the contact force at the end of the
769  increment with eigenmode i
770  bbb(i,j) is the internal product of the change of the contact force with
771  respect to modal coordinate j with the eigenmode i */
772 
773  DMEMSET(bbb,0,*nev**nev,0.);
774  DMEMSET(aaa,0,*nev,0.);
775 
776  if(!(*cyclicsymmetry)){
777  for(k=0; k<*nactcont; k++){
778  i1=ikactcont[k];
779  i2=(ilactcont[k]-1)**nev;
780  for(j=0; j<*nev; j++){
781  zl=z[(long long)j*neq[1]+i1];
782  aaa[j]+=zl*bcont[i1];
783  for(l=0; l<*nev; l++){
784  bbb[l**nev+j]+=zl*dbcont[i2+l];
785  }
786  }
787  }
788  }else{
789  for(k=0; k<*nactcont; k++){
790  i1=ikactcont[k];
791  i2=(ilactcont[k]-1)**nev;
792  FORTRAN(nident,(izdof,&i1,nzdof,&id));
793  if(id!=0){
794  if(izdof[id-1]==i1){
795  for(j=0; j<*nev; j++){
796  zl=z[j**nzdof+id-1];
797  aaa[j]+=zl*bcont[i1];
798  for(l=0; l<*nev; l++){
799  bbb[l**nev+j]+=zl*dbcont[i2+l];
800  }
801  }
802  }else{printf("*ERROR in dynacont\n");FORTRAN(stop,());}
803  }else{printf("*ERROR in dynacont\n");FORTRAN(stop,());}
804  }
805  }
806 
807  for(l=0;l<*nev;l++){
808  i1=l**nev;
809  for(j=0;j<*nev;j++){
810  if(j==l){lhs[i1+j]=1.;}else{lhs[i1+j]=0.;}
811  lhs[i1+j]-=bjinc[j]*bbb[i1+j];
812  }
813  dbj[l]=bjbas[l]+bjinc[l]*aaa[l]-bj[l];
814  }
815 
816  /* solve the system of equations; determine dbj */
817 
818  FORTRAN(dgesv,(nev,&nrhs,lhs,nev,ipiv,dbj,nev,&info));
819 
820  /* check the size of dbj */
821 
822  bjmax=0.;
823  dbjmaxOLD2=dbjmaxOLD1;
824  dbjmaxOLD1=dbjmax;
825  dbjmax=0.;
826  for(i=0;i<*nev;i++){
827  if(fabs(bj[i])>bjmax) bjmax=fabs(bj[i]);
828  if(fabs(dbj[i])>dbjmax) dbjmax=fabs(dbj[i]);
829  }
830 
831  iconvergence=0;
832  idivergence=0;
833 
834  if(dbjmax<=0.005*bjmax){
835 
836  //calculate bjp: the derivative of bj w.r.t. time
837 
838  for(j=0; j<*nev; j++){
839  bjp[j]=bjbasp[j]+bjincp[j]*aaa[j];
840  }
841  FORTRAN(dgetrs,("No transpose",nev,&nrhs,lhs,nev,ipiv,bjp,nev,&info));
842  iconvergence=1;
843  }
844  else{
845  if(loop>=i0 && loop<=ic){
846 
847  /* check for divergence */
848 
849  if((dbjmax>dbjmaxOLD1) && (dbjmax>dbjmaxOLD2)){
850 
851  /* divergence --> cutback */
852 
853  idivergence=1;
854  icutb++;
855  break;
856  }
857  }
858  else{
859  if(loop>ic){
860 
861  /* cutback after ic iterations*/
862 
863  idivergence=1;
864  icutb++;
865  break;
866  }
867  }
868  }
869 
870  /* add dbj to db */
871 
872  for(j=0;j<*nev;j++){
873  bj[j]+=dbj[j];
874  }
875 
876  }while(1);
877  }while(idivergence==1 && icutb<10 && *idrct==0);
878 
879  if(icutb>=10){
880 
881  //no convergence, stop all
882 
883  printf("*ERROR: Contact did not converge.\n");
884  FORTRAN(stop,());
885  }
886 
887  /* convergence has been reached */
888  /* restoring aa[(*iinc-1)*nev+i] */
889 
890  for(i=0;i<*nev;i++){
891  aa[i]+=bb[i]*(*time-*dtime);
892  }
893 
894  /* calculating the linearized force function connecting the
895  mechanical+contact load at the start of the increment with
896  the mechanical+contact load at the end of the increment */
897 
898  if(!(*cyclicsymmetry)){
899  for(i=0;i<*nev;i++){
900  i2=(long long)i*neq[1];
901 
902  aanew[i]=aamech[i];
903  for(j=0;j<*nactcont;j++){
904  aanew[i]+=z[i2+ikactcont[j]]*bcont[ikactcont[j]];
905  }
906 
907  bb[i]=(aanew[i]-aa[i])/(*dtime);
908  aa[i]=aanew[i]-bb[i]**time;
909  }
910  }else{
911  memcpy(&aanew[0],&aamech[0],sizeof(double)**nev);
912  for(j=0;j<*nactcont;j++){
913  FORTRAN(nident,(izdof,&ikactcont[j],nzdof,&id));
914  if(id!=0){
915  if(izdof[id-1]==ikactcont[j]){
916  for(i=0;i<*nev;i++){
917  aanew[i]+=z[i**nzdof+id-1]*bcont[ikactcont[j]];
918  }
919  }else{printf("*ERROR in dynacont\n");FORTRAN(stop,());}
920  }else{printf("*ERROR in dynacont\n");FORTRAN(stop,());}
921  }
922  for(i=0;i<*nev;i++){
923  bb[i]=(aanew[i]-aa[i])/(*dtime);
924  aa[i]=aanew[i]-bb[i]**time;
925  }
926  }
927 
928  SFREE(aaa);SFREE(bbb);SFREE(bjbas);SFREE(bjinc);SFREE(dbj);SFREE(lhs);
929  SFREE(ipiv);SFREE(bjbasp);SFREE(bjincp);SFREE(dbjp);SFREE(ilactcont);
930  SFREE(dbcont);
931  SFREE(xforcdiff);SFREE(xloaddiff);SFREE(xboundiff),SFREE(xbodydiff);
932 
933  if(*ithermal==1) SFREE(t1diff);
934 
935  *ikactcontp=ikactcont;*ikactmechp=ikactmech;
936 
937  return;
938 }
void storecontactdof(ITG *nope, ITG *nactdof, ITG *mt, ITG *konl, ITG **ikactcontp, ITG *nactcont, ITG *nactcont_, double *bcont, double *fnl, ITG *ikmpc, ITG *nmpc, ITG *ilmpc, ITG *ipompc, ITG *nodempc, double *coefmpc)
Definition: storecontactdof.c:36
subroutine init(nktet, inodfa, ipofa, netet_)
Definition: init.f:20
subroutine springforc_n2f(xl, konl, vl, imat, elcon, nelcon, elas, fnl, ncmat_, ntmat_, nope, lakonl, t1l, kode, elconloc, plicon, nplicon, npmat_, senergy, nener, cstr, mi, springarea, nmethod, ne0, nstate_, xstateini, xstate, reltime, ielas, venergy, ielorien, orab, norien, nelem)
Definition: springforc_n2f.f:24
subroutine df(x, u, uprime, rpar, nev)
Definition: subspace.f:133
ITG strcpy1(char *s1, const char *s2, ITG length)
Definition: strcpy1.c:24
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
subroutine fsub(time, t, a, b, dd, h1, h2, h3, h4, func, funcp)
Definition: fsub.f:20
void dfdbj(double *bcont, double **dbcontp, ITG *neq, ITG *nope, ITG *konl, ITG *nactdof, double *s, double *z, ITG *ikmpc, ITG *ilmpc, ITG *ipompc, ITG *nodempc, ITG *nmpc, double *coefmpc, double *fnl, ITG *nev, ITG **ikactcontp, ITG **ilactcontp, ITG *nactcont, ITG *nactcont_, ITG *mi, ITG *cyclicsymmetry, ITG *izdof, ITG *nzdof)
Definition: dfdbj.c:28
subroutine dgetrs(TRANS, N, NRHS, A, LDA, IPIV, B, LDB, INFO)
Definition: dgesv.f:461
#define DMEMSET(a, b, c, d)
Definition: CalculiX.h:45
subroutine fsuper(time, t, a, b, h1, h2, h3, h4, h5, h6, func, funcp)
Definition: fsuper.f:20
subroutine dgesv(N, NRHS, A, LDA, IPIV, B, LDB, INFO)
Definition: dgesv.f:58
subroutine stop()
Definition: stop.f:20
subroutine temploaddiff(xforcold, xforc, xforcact, iamforc, nforc, xloadold, xload, xloadact, iamload, nload, ibody, xbody, nbody, xbodyold, xbodyact, t1old, t1, t1act, iamt1, nk, amta, namta, nam, ampli, time, reltime, ttime, dtime, ithermal, nmethod, xbounold, xboun, xbounact, iamboun, nboun, nodeboun, ndirboun, nodeforc, ndirforc, istep, iinc, co, vold, itg, ntg, amname, ikboun, ilboun, nelemload, sideload, mi, xforcdiff, xloaddiff, xbodydiff, t1diff, xboundiff, iabsload, iprescribedboundary, ntrans, trab, inotr, veold, nactdof, bcont, fn, ipobody, iponoel, inoel)
Definition: temploaddiff.f:29
void contact(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, ITG *ifree, double *co, double *vold, ITG *ielmat, double *cs, double *elcon, ITG *istep, ITG *iinc, ITG *iit, ITG *ncmat_, ITG *ntmat_, ITG *ne0, double *vini, ITG *nmethod, ITG *iperturb, ITG *ikboun, ITG *nboun, ITG *mi, ITG *imastop, ITG *nslavnode, ITG *islavnode, ITG *islavsurf, ITG *itiefac, double *areaslav, ITG *iponoels, ITG *inoels, double *springarea, double *tietol, double *reltime, ITG *imastnode, ITG *nmastnode, double *xmastnor, char *filab, ITG *mcs, ITG *ics, ITG *nasym, double *xnoels, ITG *mortar, double *pslavsurf, double *pmastsurf, double *clearini, double *theta, double *xstateini, double *xstate, ITG *nstate_, ITG *icutb, ITG *ialeatoric, char *jobnamef)
Definition: contact.c:23
#define RENEW(a, b, c)
Definition: CalculiX.h:40
#define SFREE(a)
Definition: CalculiX.h:41
subroutine nident(x, px, n, id)
Definition: nident.f:26
subroutine fcrit(time, t, a, b, ze, d, dd, h1, h2, h3, h4, func, funcp)
Definition: fcrit.f:20
subroutine nonlinmpc(co, vold, ipompc, nodempc, coefmpc, labmpc, nmpc, ikboun, ilboun, nboun, xbounact, aux, iaux, maxlenmpc, ikmpc, ilmpc, icascade, kon, ipkon, lakon, ne, reltime, newstep, xboun, fmpc, iit, idiscon, ncont, trab, ntrans, ithermal, mi)
Definition: nonlinmpc.f:23
subroutine rhs(co, nk, kon, ipkon, lakon, ne, ipompc, nodempc, coefmpc, nmpc, nodeforc, ndirforc, xforc, nforc, nelemload, sideload, xload, nload, xbody, ipobody, nbody, cgr, fext, nactdof, neq, nmethod, ikmpc, ilmpc, elcon, nelcon, rhcon, nrhcon, alcon, nalcon, alzero, ielmat, ielorien, norien, orab, ntmat_, t0, t1, ithermal, iprestr, vold, iperturb, iexpl, plicon, nplicon, plkcon, nplkcon, npmat_, ttime, time, istep, iinc, dtime, physcon, ibody, xloadold, reltime, veold, matname, mi, ikactmech, nactmech, ielprop, prop, sti, xstateini, xstate, nstate_)
Definition: rhs.f:29
#define ITG
Definition: CalculiX.h:51
subroutine springstiff_n2f(xl, elas, konl, voldl, s, imat, elcon, nelcon, ncmat_, ntmat_, nope, lakonl, t1l, kode, elconloc, plicon, nplicon, npmat_, iperturb, springarea, nmethod, mi, ne0, nstate_, xstateini, xstate, reltime, nasym, ielorien, orab, norien, nelem)
Definition: springstiff_n2f.f:24
void dynboun(double *amta, ITG *namta, ITG *nam, double *ampli, double *time, double *ttime, double *dtime, double *xbounold, double *xboun, double *xbounact, ITG *iamboun, ITG *nboun, ITG *nodeboun, ITG *ndirboun, double *ad, double *au, double *adb, double *aub, ITG *icol, ITG *irow, ITG *neq, ITG *nzs, double *sigma, double *b, ITG *isolver, double *alpham, double *betam, ITG *nzl, ITG *init, double *bact, double *bmin, ITG *jq, char *amname, double *bv, double *bprev, double *bdiff, ITG *nactmech, ITG *icorrect, ITG *iprev)
Definition: dynboun.c:37
#define NNEW(a, b, c)
Definition: CalculiX.h:39
subroutine dynresults(nk, v, ithermal, nactdof, vold, nodeboun, ndirboun, xboun, nboun, ipompc, nodempc, coefmpc, labmpc, nmpc, b, bp, veold, dtime, mi, imdnode, nmdnode, imdboun, nmdboun, imdmpc, nmdmpc, nmethod, time)
Definition: dynresults.f:23

◆ dynboun()

void dynboun ( double *  amta,
ITG namta,
ITG nam,
double *  ampli,
double *  time,
double *  ttime,
double *  dtime,
double *  xbounold,
double *  xboun,
double *  xbounact,
ITG iamboun,
ITG nboun,
ITG nodeboun,
ITG ndirboun,
double *  ad,
double *  au,
double *  adb,
double *  aub,
ITG icol,
ITG irow,
ITG neq,
ITG nzs,
double *  sigma,
double *  b,
ITG isolver,
double *  alpham,
double *  betam,
ITG nzl,
ITG init,
double *  bact,
double *  bmin,
ITG jq,
char *  amname,
double *  bv,
double *  bprev,
double *  bdiff,
ITG nactmech,
ITG icorrect,
ITG iprev 
)
46  {
47 
48  ITG idiff[3],i,j,ic,ir,im,symmetryflag=0;
49 
50  double *xbounmin=NULL,*xbounplus=NULL,*bplus=NULL,
51  *ba=NULL,deltatime,deltatime2,deltatimesq,timemin,ttimemin,
52  timeplus,ttimeplus,*aux=NULL,*b1=NULL,*b2=NULL,*bnew=NULL;
53 
54 #ifdef SGI
55  ITG token=1;
56 #endif
57 
58  NNEW(xbounmin,double,*nboun);
59  NNEW(xbounplus,double,*nboun);
60 
61  /* time increment for the calculation of the change of the
62  particular solution (needed to account for nonzero
63  SPC's) */
64 
65  deltatime=*dtime;
66  deltatime2=2.*deltatime;
67  deltatimesq=deltatime*deltatime;
68 
69  /* the SPC value at timemin is stored in xbounmin */
70 
71  if(*init==1){
72 
73  /* at the start of a new step it is assumed that the previous step
74  has reached steady state (at least for the SPC conditions) */
75 
76  for(i=0;i<*nboun;i++){
77  xbounmin[i]=xbounold[i];
78  xbounact[i]=xbounold[i];
79  }
80  }
81  else{
82  timemin=*time-deltatime;
83  ttimemin=*ttime-deltatime;
84  FORTRAN(temploadmodal,(amta,namta,nam,ampli,&timemin,&ttimemin,dtime,
85  xbounold,xboun,xbounmin,iamboun,nboun,nodeboun,ndirboun,
86  amname));
87  }
88 
89  /* the SPC value at timeplus is stored in xbounplus */
90 
91  timeplus=*time+deltatime;
92  ttimeplus=*ttime+deltatime;
93  FORTRAN(temploadmodal,(amta,namta,nam,ampli,&timeplus,&ttimeplus,dtime,
94  xbounold,xboun,xbounplus,iamboun,nboun,nodeboun,ndirboun,
95  amname));
96 
97  NNEW(bplus,double,neq[1]);
98  NNEW(ba,double,neq[1]);
99  NNEW(b1,double,neq[1]);
100  NNEW(b2,double,neq[1]);
101 
102  /* check whether boundary conditions changed
103  comparision of min with prev */
104 
105  if(*init==1){
106  for(i=0;i<*nboun;i++){
107  ic=neq[1]+i;
108  for(j=jq[ic]-1;j<jq[ic+1]-1;j++){
109  ir=irow[j]-1;
110  bmin[ir]=bmin[ir]-au[j]*xbounmin[i];
111  }
112  }
113  if(*isolver==0){
114 #ifdef SPOOLES
115  spooles_solve(bmin,&neq[1]);
116 #endif
117  }
118  else if(*isolver==4){
119 #ifdef SGI
120  sgi_solve(bmin,token);
121 #endif
122  }
123  else if(*isolver==5){
124 #ifdef TAUCS
125  tau_solve(bmin,&neq[1]);
126 #endif
127  }
128  if(*isolver==7){
129 #ifdef PARDISO
130  pardiso_solve(bmin,&neq[1],&symmetryflag);
131 #endif
132  }
133  }
134 
135  /* check whether boundary conditions changed
136  comparision of act with min */
137 
138  idiff[1]=0;
139  for(i=0;i<*nboun;i++){
140  if(fabs(xbounact[i]-xbounmin[i])>1.e-10){
141  idiff[1]=1;
142  break;
143  }
144  }
145  if(*init==1){
146  for(i=0;i<*nboun;i++){
147  ic=neq[1]+i;
148  for(j=jq[ic]-1;j<jq[ic+1]-1;j++){
149  ir=irow[j]-1;
150  bact[ir]=bact[ir]-au[j]*xbounact[i];
151  }
152  }
153  if(*isolver==0){
154 #ifdef SPOOLES
155  spooles_solve(bact,&neq[1]);
156 #endif
157  }
158  else if(*isolver==4){
159 #ifdef SGI
160  sgi_solve(bact,token);
161 #endif
162  }
163  else if(*isolver==5){
164 #ifdef TAUCS
165  tau_solve(bact,&neq[1]);
166 #endif
167  }
168  if(*isolver==7){
169 #ifdef PARDISO
170  pardiso_solve(bact,&neq[1],&symmetryflag);
171 #endif
172  }
173  }
174 
175  /* check whether boundary conditions changed
176  comparision of plus with act */
177 
178  idiff[2]=0;
179  for(i=0;i<*nboun;i++){
180  if(fabs(xbounplus[i]-xbounact[i])>1.e-10){
181  idiff[2]=1;
182  break;
183  }
184  }
185  if(idiff[2]==1){
186  for(i=0;i<*nboun;i++){
187  ic=neq[1]+i;
188  for(j=jq[ic]-1;j<jq[ic+1]-1;j++){
189  ir=irow[j]-1;
190  bplus[ir]=bplus[ir]-au[j]*xbounplus[i];
191  }
192  }
193  if(*isolver==0){
194 #ifdef SPOOLES
195  spooles_solve(bplus,&neq[1]);
196 #endif
197  }
198  else if(*isolver==4){
199 #ifdef SGI
200  sgi_solve(bplus,token);
201 #endif
202  }
203  else if(*isolver==5){
204 #ifdef TAUCS
205  tau_solve(bplus,&neq[1]);
206 #endif
207  }
208  if(*isolver==7){
209 #ifdef PARDISO
210  pardiso_solve(bplus,&neq[1],&symmetryflag);
211 #endif
212  }
213  }
214 
215  if((idiff[1]!=0)||(idiff[2]!=0)){
216 
217  /* present value is not zero */
218 
219  if(idiff[2]==0){
220  for(i=0;i<neq[1];i++){bplus[i]=bact[i];}
221  }
222  for(i=0;i<neq[1];i++){
223 
224  /* bv is the velocity */
225 
226  bv[i]=(bplus[i]-bmin[i])/deltatime2;
227 
228  /* ba is the acceleration */
229 
230  ba[i]=(bmin[i]-2.*bact[i]+bplus[i])/deltatimesq;
231 
232  b1[i]=ba[i]+*alpham*bv[i];
233  b2[i]=*betam*bv[i];
234 
235  bmin[i]=bact[i];
236  bact[i]=bplus[i];
237  }
238  NNEW(bnew,double,neq[1]);
239  FORTRAN(op,(&neq[1],b1,bplus,adb,aub,jq,irow));
240  for(i=0;i<neq[1];i++){bnew[i]=-bplus[i];}
241  FORTRAN(op,(&neq[1],b2,bplus,ad,au,jq,irow));
242  if(*icorrect==2){
243  for(i=0;i<neq[1];i++){
244  bnew[i]-=bplus[i];
245  b[i]+=bnew[i];
246  }
247  }else if(*icorrect==0){
248  for(i=0;i<neq[1];i++){
249  bnew[i]-=bplus[i];
250  bdiff[i]=bnew[i]-bprev[i];
251  b[i]+=bdiff[i];
252 // printf("dynboun %e,%e,%e,%e\n",bprev[i],bnew[i],bdiff[i],b[i]);
253  }
254  memcpy(&bprev[0],&bnew[0],sizeof(double)*neq[1]);
255  }else{
256  for(i=0;i<neq[1];i++){
257  bnew[i]-=bplus[i];
258  bdiff[i]+=bnew[i]-bprev[i];
259  b[i]+=bdiff[i];
260  }
261  memcpy(&bprev[0],&bnew[0],sizeof(double)*neq[1]);
262  }
263  SFREE(bnew);
264  *nactmech=neq[1];
265  *iprev=1;
266  }else if((*iprev!=0)&&(*icorrect!=2)){
267 
268  /* present value of b is zero, previous value was not zero */
269 
270  if(*icorrect==0){
271  for(i=0;i<neq[1];i++){
272  bdiff[i]=-bprev[i];
273  b[i]+=bdiff[i];
274 // printf("dynboun %e,%e,%e,%e\n",bprev[i],bdiff[i],b[i]);
275  }
276 // memset(&bprev[0],0.,sizeof(double)*neq[1]);
277  DMEMSET(bprev,0,neq[1],0.);
278  }else{
279  for(i=0;i<neq[1];i++){
280  bdiff[i]+=-bprev[i];
281  b[i]+=bdiff[i];
282  }
283 // memset(&bprev[0],0.,sizeof(double)*neq[1]);
284  DMEMSET(bprev,0,neq[1],0.);
285  }
286  *nactmech=neq[1];
287  *iprev=0;
288  }
289 
290  SFREE(xbounmin);SFREE(xbounplus);
291  SFREE(bplus);SFREE(ba);SFREE(b1);SFREE(b2);
292 
293  return;
294 }
void spooles_solve(double *b, ITG *neq)
subroutine init(nktet, inodfa, ipofa, netet_)
Definition: init.f:20
void sgi_solve(double *b, ITG token)
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
subroutine op(n, x, y, ad, au, jq, irow)
Definition: op.f:26
#define DMEMSET(a, b, c, d)
Definition: CalculiX.h:45
subroutine temploadmodal(amta, namta, nam, ampli, time, ttime, dtime, xbounold, xboun, xbounact, iamboun, nboun, nodeboun, ndirboun, amname)
Definition: temploadmodal.f:22
#define SFREE(a)
Definition: CalculiX.h:41
void tau_solve(double *b, ITG *neq)
static double * b1
Definition: mafillkmain.c:30
#define ITG
Definition: CalculiX.h:51
void pardiso_solve(double *b, ITG *neq, ITG *symmetryflag)
#define NNEW(a, b, c)
Definition: CalculiX.h:39

◆ electromagnetics()

void electromagnetics ( double **  co,
ITG nk,
ITG **  konp,
ITG **  ipkonp,
char **  lakonp,
ITG ne,
ITG nodeboun,
ITG ndirboun,
double *  xboun,
ITG nboun,
ITG **  ipompcp,
ITG **  nodempcp,
double **  coefmpcp,
char **  labmpcp,
ITG nmpc,
ITG nodeforc,
ITG ndirforc,
double *  xforc,
ITG nforc,
ITG **  nelemloadp,
char **  sideloadp,
double *  xload,
ITG nload,
ITG nactdof,
ITG **  icolp,
ITG jq,
ITG **  irowp,
ITG neq,
ITG nzl,
ITG nmethod,
ITG **  ikmpcp,
ITG **  ilmpcp,
ITG ikboun,
ITG ilboun,
double *  elcon,
ITG nelcon,
double *  rhcon,
ITG nrhcon,
double *  alcon,
ITG nalcon,
double *  alzero,
ITG **  ielmatp,
ITG **  ielorienp,
ITG norien,
double *  orab,
ITG ntmat_,
double *  t0,
double *  t1,
double *  t1old,
ITG ithermal,
double *  prestr,
ITG iprestr,
double **  vold,
ITG iperturb,
double *  sti,
ITG nzs,
ITG kode,
char *  filab,
ITG idrct,
ITG jmax,
ITG jout,
double *  timepar,
double *  eme,
double *  xbounold,
double *  xforcold,
double *  xloadold,
double *  veold,
double *  accold,
char *  amname,
double *  amta,
ITG namta,
ITG nam,
ITG iamforc,
ITG **  iamloadp,
ITG iamt1,
double *  alpha,
ITG iexpl,
ITG iamboun,
double *  plicon,
ITG nplicon,
double *  plkcon,
ITG nplkcon,
double **  xstatep,
ITG npmat_,
ITG istep,
double *  ttime,
char *  matname,
double *  qaold,
ITG mi,
ITG isolver,
ITG ncmat_,
ITG nstate_,
ITG iumat,
double *  cs,
ITG mcs,
ITG nkon,
double **  ener,
ITG mpcinfo,
char *  output,
double *  shcon,
ITG nshcon,
double *  cocon,
ITG ncocon,
double *  physcon,
ITG nflow,
double *  ctrl,
char **  setp,
ITG nset,
ITG **  istartsetp,
ITG **  iendsetp,
ITG **  ialsetp,
ITG nprint,
char *  prlab,
char *  prset,
ITG nener,
ITG ikforc,
ITG ilforc,
double *  trab,
ITG inotr,
ITG ntrans,
double **  fmpcp,
char *  cbody,
ITG ibody,
double *  xbody,
ITG nbody,
double *  xbodyold,
ITG ielprop,
double *  prop,
ITG ntie,
char **  tiesetp,
ITG itpamp,
ITG iviewfile,
char *  jobnamec,
double **  tietolp,
ITG nslavs,
double *  thicke,
ITG ics,
ITG nalset,
ITG nmpc_,
ITG nmat,
char *  typeboun,
ITG iaxial,
ITG nload_,
ITG nprop,
ITG network,
char *  orname 
)
79  {
80 
81  char description[13]=" ",*lakon=NULL,jobnamef[396]="",
82  *labmpc=NULL,kind1[2]="E",kind2[2]="E",*set=NULL,*tieset=NULL,
83  cflag[1]=" ",*sideloadref=NULL,*sideload=NULL;
84 
85  ITG *inum=NULL,k,iout=0,icntrl,iinc=0,jprint=0,iit=-1,jnz=0,
86  icutb=0,istab=0,ifreebody,uncoupled=0,maxfaces,indexe,nope,
87  iperturb_sav[2],*icol=NULL,*irow=NULL,ielas=0,icmd=0,j,
88  memmpc_,mpcfree,icascade,maxlenmpc,*nodempc=NULL,*iaux=NULL,
89  *itg=NULL,*ineighe=NULL,null=0,iactive[3],neqterms,ntflag,
90  *ieg=NULL,ntg=0,ntr,*kontri=NULL,*nloadtr=NULL,index,
91  *ipiv=NULL,ntri,newstep,mode=-1,noddiam=-1,nasym=0,
92  ntrit,*inocs=NULL,inewton=0,*ipobody=NULL,*nacteq=NULL,
93  *nactdog=NULL,nteq,nmastnode,imast,massact[2],
94  *ipkon=NULL,*kon=NULL,*ielorien=NULL,nmethodact,ne2=0,
95  *ielmat=NULL,inext,itp=0,symmetryflag=0,inputformat=0,
96  iitterm=0,ngraph=1,ithermalact=2,*islavact=NULL,neini,
97  *ipompc=NULL,*ikmpc=NULL,*ilmpc=NULL,i0ref,irref,icref,
98  *islavnode=NULL,*imastnode=NULL,*nslavnode=NULL,mortar=0,
99  mt=mi[1]+1,*nactdofinv=NULL, inode,idir,*islavsurf=NULL,
100  iemchange=0,nzsrad,*mast1rad=NULL,*irowrad=NULL,*icolrad=NULL,
101  *jqrad=NULL,*ipointerrad=NULL,*integerglob=NULL,im,ne0,
102  mass[2]={0,0}, stiffness=1, buckling=0, rhsi=1, intscheme=0,idiscon=0,
103  coriolis=0,*ipneigh=NULL,*neigh=NULL,i,icfd=0,id,node,networknode,
104  iflagact=0,*nodorig=NULL,*ipivr=NULL,*inomat=NULL,*nodface=NULL,
105  *ipoface=NULL,*istartset=NULL,*iendset=NULL,*ialset=NULL,
106  *nelemloadref=NULL,*iamloadref=NULL,nloadref,kscale=1,
107  *nelemload=NULL,*iamload=NULL,*idefload=NULL,ialeatoric=0,
108  *iponoel=NULL,*inoel=NULL,inoelsize;
109 
110  double *stn=NULL,*v=NULL,*een=NULL,cam[5],*epn=NULL,*cdn=NULL,
111  *f=NULL,*fn=NULL,qa[4]={0.,0.,-1.,0.},qam[2]={0.,0.},dtheta,theta,
112  err,ram[4]={0.,0.,0.,0.},*springarea=NULL,*h0=NULL,
113  ram1[2]={0.,0.},ram2[2]={0.,0.},deltmx,*clearini=NULL,
114  uam[2]={0.,0.},*vini=NULL,*ac=NULL,qa0,qau,ea,ptime,
115  *t1act=NULL,qamold[2],*xbounact=NULL,*bc=NULL,
116  *xforcact=NULL,*xloadact=NULL,*fext=NULL,h0scale=1.,
117  reltime,time,bet=0.,gam=0.,*aux1=NULL,*aux2=NULL,dtime,*fini=NULL,
118  *fextini=NULL,*veini=NULL,*xstateini=NULL,*h0ref=NULL,
119  *ampli=NULL,*eei=NULL,*t1ini=NULL,*tinc,*tper,*tmin,*tmax,
120  *xbounini=NULL,*xstiff=NULL,*stx=NULL,*cv=NULL,*cvini=NULL,
121  *enern=NULL,*coefmpc=NULL,*aux=NULL,*xstaten=NULL,
122  *enerini=NULL,*emn=NULL,*xmastnor=NULL,*fnext=NULL,
123  *tarea=NULL,*tenv=NULL,*erad=NULL,*fnr=NULL,*fni=NULL,
124  *adview=NULL,*auview=NULL,*qfx=NULL,*adaux=NULL,
125  *qfn=NULL,*co=NULL,*vold=NULL,*fenv=NULL,sigma=0.,
126  *xbodyact=NULL,*cgr=NULL,dthetaref,*vr=NULL,*vi=NULL,
127  *stnr=NULL,*stni=NULL,*vmax=NULL,*stnmax=NULL,*fmpc=NULL,*ener=NULL,
128  *f_cm=NULL,*f_cs=NULL,*tietol=NULL,
129  *xstate=NULL,*eenmax=NULL,*adrad=NULL,*aurad=NULL,*bcr=NULL,
130  *emeini=NULL,*doubleglob=NULL,*au=NULL,
131  *ad=NULL,*b=NULL,*aub=NULL,*adb=NULL,*pslavsurf=NULL,*pmastsurf=NULL,
132  *cdnr=NULL,*cdni=NULL,*energyini=NULL,*energy=NULL;
133 
134 #ifdef SGI
135  ITG token;
136 #endif
137 
138  ne0=*ne;
139 
140  /* next line is needed to avoid that elements with negative ipkon
141  are taken into account in extrapolate.f */
142 
143  strcpy1(&filab[2],"C",1);
144 
145  if(*nmethod==8){
146  *nmethod=1;
147  }else if(*nmethod==9){
148  *nmethod=4;
149  }else if(*nmethod==10){
150  *nmethod=2;
151  }
152 
153  for(k=0;k<3;k++){
154  strcpy1(&jobnamef[k*132],&jobnamec[k*132],132);
155  }
156 
157  qa0=ctrl[20];qau=ctrl[21];ea=ctrl[23];deltmx=ctrl[26];
158  i0ref=ctrl[0];irref=ctrl[1];icref=ctrl[3];
159 
160  memmpc_=mpcinfo[0];mpcfree=mpcinfo[1];icascade=mpcinfo[2];
161  maxlenmpc=mpcinfo[3];
162 
163  icol=*icolp;irow=*irowp;co=*cop;vold=*voldp;
164  ipkon=*ipkonp;lakon=*lakonp;kon=*konp;ielorien=*ielorienp;
165  ielmat=*ielmatp;ener=*enerp;xstate=*xstatep;
166 
167  ipompc=*ipompcp;labmpc=*labmpcp;ikmpc=*ikmpcp;ilmpc=*ilmpcp;
168  fmpc=*fmpcp;nodempc=*nodempcp;coefmpc=*coefmpcp;
169 
170  set=*setp;istartset=*istartsetp;iendset=*iendsetp;ialset=*ialsetp;
171  tieset=*tiesetp;tietol=*tietolp;
172 
173  nelemload=*nelemloadp;iamload=*iamloadp;
174  sideload=*sideloadp;
175 
176  tinc=&timepar[0];
177  tper=&timepar[1];
178  tmin=&timepar[2];
179  tmax=&timepar[3];
180 
181  /* invert nactdof */
182 
183  NNEW(nactdofinv,ITG,mt**nk);
184  NNEW(nodorig,ITG,*nk);
185  FORTRAN(gennactdofinv,(nactdof,nactdofinv,nk,mi,nodorig,
186  ipkon,lakon,kon,ne));
187  SFREE(nodorig);
188 
189  /* allocating a field for the stiffness matrix */
190 
191  NNEW(xstiff,double,(long long)27*mi[0]**ne);
192 
193  /* allocating force fields */
194 
195  NNEW(f,double,neq[1]);
196  NNEW(fext,double,neq[1]);
197 
198  NNEW(b,double,neq[1]);
199  NNEW(vini,double,mt**nk);
200 
201  NNEW(aux,double,7*maxlenmpc);
202  NNEW(iaux,ITG,maxlenmpc);
203 
204  /* allocating fields for the actual external loading */
205 
206  NNEW(xbounact,double,*nboun);
207  NNEW(xbounini,double,*nboun);
208  for(k=0;k<*nboun;++k){xbounact[k]=xbounold[k];}
209  NNEW(xforcact,double,*nforc);
210  NNEW(xloadact,double,2**nload);
211  NNEW(xbodyact,double,7**nbody);
212  /* copying the rotation axis and/or acceleration vector */
213  for(k=0;k<7**nbody;k++){xbodyact[k]=xbody[k];}
214 
215  /* assigning the body forces to the elements */
216 
217  if(*nbody>0){
218  ifreebody=*ne+1;
219  NNEW(ipobody,ITG,2*ifreebody**nbody);
220  for(k=1;k<=*nbody;k++){
221  FORTRAN(bodyforce,(cbody,ibody,ipobody,nbody,set,istartset,
222  iendset,ialset,&inewton,nset,&ifreebody,&k));
223  RENEW(ipobody,ITG,2*(*ne+ifreebody));
224  }
225  RENEW(ipobody,ITG,2*(ifreebody-1));
226  }
227 
228  /* for thermal calculations: forced convection and cavity
229  radiation*/
230 
231  if(*ithermal>1){
232  NNEW(itg,ITG,*nload+3**nflow);
233  NNEW(ieg,ITG,*nflow);
234  /* max 6 triangles per face, 4 entries per triangle */
235  NNEW(kontri,ITG,24**nload);
236  NNEW(nloadtr,ITG,*nload);
237  NNEW(nacteq,ITG,4**nk);
238  NNEW(nactdog,ITG,4**nk);
239  NNEW(v,double,mt**nk);
240  FORTRAN(envtemp,(itg,ieg,&ntg,&ntr,sideload,nelemload,
241  ipkon,kon,lakon,ielmat,ne,nload,
242  kontri,&ntri,nloadtr,nflow,ndirboun,nactdog,
243  nodeboun,nacteq,nboun,ielprop,prop,&nteq,
244  v,network,physcon,shcon,ntmat_,co,
245  vold,set,nshcon,rhcon,nrhcon,mi,nmpc,nodempc,
246  ipompc,labmpc,ikboun,&nasym,ttime,&time,iaxial));
247  SFREE(v);
248 
249  if((*mcs>0)&&(ntr>0)){
250  NNEW(inocs,ITG,*nk);
251  radcyc(nk,kon,ipkon,lakon,ne,cs,mcs,nkon,ialset,istartset,
252  iendset,&kontri,&ntri,&co,&vold,&ntrit,inocs,mi);
253  }
254  else{ntrit=ntri;}
255 
256  nzsrad=100*ntr;
257  NNEW(mast1rad,ITG,nzsrad);
258  NNEW(irowrad,ITG,nzsrad);
259  NNEW(icolrad,ITG,ntr);
260  NNEW(jqrad,ITG,ntr+1);
261  NNEW(ipointerrad,ITG,ntr);
262 
263  if(ntr>0){
264  mastructrad(&ntr,nloadtr,sideload,ipointerrad,
265  &mast1rad,&irowrad,&nzsrad,
266  jqrad,icolrad);
267  }
268 
269  /* determine the network elements belonging to a given node (for usage
270  in user subroutine film */
271 
272 // if(ntg>0){
273  if((*network>0)||(ntg>0)){
274  NNEW(iponoel,ITG,*nk);
275  NNEW(inoel,ITG,2**nkon);
276  if(*network>0){
277  FORTRAN(networkelementpernode,(iponoel,inoel,lakon,ipkon,kon,
278  &inoelsize,nflow,ieg,ne,network));
279  }
280  RENEW(inoel,ITG,2*inoelsize);
281  }
282 
283  SFREE(ipointerrad);SFREE(mast1rad);
284  RENEW(irowrad,ITG,nzsrad);
285 
286  RENEW(itg,ITG,ntg);
287  NNEW(ineighe,ITG,ntg);
288  RENEW(kontri,ITG,4*ntrit);
289  RENEW(nloadtr,ITG,ntr);
290 
291  NNEW(adview,double,ntr);
292  NNEW(auview,double,2*nzsrad);
293  NNEW(tarea,double,ntr);
294  NNEW(tenv,double,ntr);
295  NNEW(fenv,double,ntr);
296  NNEW(erad,double,ntr);
297 
298  NNEW(ac,double,nteq*nteq);
299  NNEW(bc,double,nteq);
300  NNEW(ipiv,ITG,nteq);
301  NNEW(adrad,double,ntr);
302  NNEW(aurad,double,2*nzsrad);
303  NNEW(bcr,double,ntr);
304  NNEW(ipivr,ITG,ntr);
305  }
306  if(*ithermal>1){NNEW(qfx,double,3*mi[0]**ne);}
307 
308  /* allocating a field for the instantaneous amplitude */
309 
310  NNEW(ampli,double,*nam);
311 
312  NNEW(fini,double,neq[1]);
313 
314  /* allocating fields for nonlinear dynamics */
315 
316  if(*nmethod==4){
317  mass[0]=1;
318  mass[1]=1;
319  NNEW(aux2,double,neq[1]);
320  NNEW(fextini,double,neq[1]);
321  NNEW(cv,double,neq[1]);
322  NNEW(cvini,double,neq[1]);
323  NNEW(veini,double,mt**nk);
324  NNEW(adb,double,neq[1]);
325  NNEW(aub,double,nzs[1]);
326  }
327 
328  qa[0]=qaold[0];
329  qa[1]=qaold[1];
330 
331  /* normalizing the time */
332 
333  FORTRAN(checktime,(itpamp,namta,tinc,ttime,amta,tmin,&inext,&itp,istep,tper));
334  dtheta=(*tinc)/(*tper);
335  dthetaref=dtheta;
336  if(dtheta<=1.e-6){
337  printf("\n *ERROR in nonlingeo\n");
338  printf(" increment size smaller than one millionth of step size\n");
339  printf(" increase increment size\n\n");
340  }
341  *tmin=*tmin/(*tper);
342  *tmax=*tmax/(*tper);
343  theta=0.;
344 
345  /* calculating an initial flux norm */
346 
347  if(*ithermal!=2){
348  if(qau>1.e-10){qam[0]=qau;}
349  else if(qa0>1.e-10){qam[0]=qa0;}
350  else if(qa[0]>1.e-10){qam[0]=qa[0];}
351  else {qam[0]=1.e-2;}
352  }
353  if(*ithermal>1){
354  if(qau>1.e-10){qam[1]=qau;}
355  else if(qa0>1.e-10){qam[1]=qa0;}
356  else if(qa[1]>1.e-10){qam[1]=qa[1];}
357  else {qam[1]=1.e-2;}
358  }
359 
360 
361  /*********************************************************************/
362 
363  /* calculating the initial quasi-static magnetic intensity due to
364  the coil current */
365 
366  /*********************************************************************/
367 
368  /* calculate the current density in the coils
369 
370  in this section nload, nforc, nbody and nam are set to zero; the
371  electrical potential is supposed to be given (in the form of a
372  temperature), the current is calculated (in the form of heat
373  flux) by thermal analogy */
374 
375  reltime=1.;
376  time=0.;
377  dtime=0.;
378  ithermalact=2;
379 
380  nmethodact=1;
381  massact[0]=0;
382  massact[1]=0;
383 
384  if(*ithermal<=1){
385  NNEW(qfx,double,3*mi[0]**ne);
386  NNEW(t0,double,*nk);
387  }
388  if(strcmp1(&filab[3567],"ECD ")==0){NNEW(qfn,double,3**nk);}
389 
390  /* the coil current is assumed to be applied at once, i.e. as
391  step loading; the calculation, however, is a quasi-static
392  calculation */
393 
394  FORTRAN(tempload,(xforcold,xforc,xforcact,iamforc,&null,xloadold,xload,
395  xloadact,iamload,&null,ibody,xbody,&null,xbodyold,xbodyact,
396  t1old,t1,t1act,iamt1,nk,amta,
397  namta,&null,ampli,&time,&reltime,ttime,&dtime,&ithermalact,nmethod,
398  xbounold,xboun,xbounact,iamboun,nboun,
399  nodeboun,ndirboun,nodeforc,ndirforc,istep,&iinc,
400  co,vold,itg,&ntg,amname,ikboun,ilboun,nelemload,sideload,mi,
401  ntrans,trab,inotr,veold,integerglob,doubleglob,tieset,istartset,
402  iendset,ialset,ntie,nmpc,ipompc,ikmpc,ilmpc,nodempc,coefmpc,
403  ipobody,iponoel,inoel));
404 
405  cam[0]=0.;cam[1]=0.;
406 
407  /* deactivating all elements except the shells */
408 
409  for(i=0;i<*ne;i++){
410  if(strcmp1(&lakon[8*i+6],"L")!=0){
411  ipkon[i]=-ipkon[i]-2;
412  }
413  }
414 
415  remastruct(ipompc,&coefmpc,&nodempc,nmpc,
416  &mpcfree,nodeboun,ndirboun,nboun,ikmpc,ilmpc,ikboun,ilboun,
417  labmpc,nk,&memmpc_,&icascade,&maxlenmpc,
418  kon,ipkon,lakon,ne,nactdof,icol,jq,&irow,isolver,
419  neq,nzs,&nmethodact,&f,&fext,&b,&aux2,&fini,&fextini,
420  &adb,&aub,&ithermalact,iperturb,mass,mi,iexpl,&mortar,
421  typeboun,&cv,&cvini,&iit,network);
422 
423  /* invert nactdof */
424 
425  SFREE(nactdofinv);
426  NNEW(nactdofinv,ITG,mt**nk);
427  NNEW(nodorig,ITG,*nk);
428  FORTRAN(gennactdofinv,(nactdof,nactdofinv,nk,mi,nodorig,
429  ipkon,lakon,kon,ne));
430  SFREE(nodorig);
431 
432  iout=-1;
433 
434  NNEW(fn,double,mt**nk);
435  NNEW(inum,ITG,*nk);
436  NNEW(v,double,mt**nk);
437 
438  results(co,nk,kon,ipkon,lakon,ne,v,stn,inum,stx,
439  elcon,nelcon,rhcon,nrhcon,alcon,nalcon,alzero,ielmat,
440  ielorien,norien,orab,ntmat_,t0,t1act,&ithermalact,
441  prestr,iprestr,filab,eme,emn,een,iperturb,f,fn,nactdof,&iout,
442  qa,vold,b,nodeboun,ndirboun,xbounact,nboun,ipompc,nodempc,coefmpc,
443  labmpc,nmpc,&nmethodact,cam,&neq[1],veold,accold,&bet,
444  &gam,&dtime,&time,ttime,plicon,nplicon,plkcon,nplkcon,
445  xstateini,xstiff,xstate,npmat_,epn,matname,mi,&ielas,&icmd,
446  ncmat_,nstate_,sti,vini,ikboun,ilboun,ener,enern,emeini,xstaten,
447  eei,enerini,alcon,nalcon,set,nset,istartset,iendset,
448  ialset,nprint,prlab,prset,qfx,qfn,trab,inotr,ntrans,fmpc,
449  nelemload,&null,ikmpc,ilmpc,istep,&iinc,springarea,&reltime,
450  ne,xforc,&null,thicke,shcon,nshcon,
451  sideload,xloadact,xloadold,&icfd,inomat,pslavsurf,pmastsurf,
452  &mortar,islavact,cdn,islavnode,nslavnode,ntie,clearini,
453  islavsurf,ielprop,prop,energyini,energy,&kscale,iponoel,
454  inoel,nener,orname,network,ipobody,xbodyact,ibody);
455 
456  SFREE(fn);SFREE(inum);SFREE(v);
457 
458  iout=1;
459 
460  NNEW(ad,double,neq[1]);
461  NNEW(au,double,nzs[1]);
462 
463  mafillsmmain(co,nk,kon,ipkon,lakon,ne,nodeboun,ndirboun,xbounold,nboun,
464  ipompc,nodempc,coefmpc,nmpc,nodeforc,ndirforc,xforcact,
465  &null,nelemload,sideload,xloadact,&null,xbodyact,ipobody,
466  &null,cgr,ad,au,fext,nactdof,icol,jq,irow,neq,nzl,
467  &nmethodact,ikmpc,ilmpc,ikboun,ilboun,
468  elcon,nelcon,rhcon,nrhcon,alcon,nalcon,alzero,
469  ielmat,ielorien,norien,orab,ntmat_,
470  t0,t1act,&ithermalact,prestr,iprestr,vold,iperturb,sti,
471  nzs,stx,adb,aub,iexpl,plicon,nplicon,plkcon,nplkcon,
472  xstiff,npmat_,&dtime,matname,mi,
473  ncmat_,massact,&stiffness,&buckling,&rhsi,&intscheme,
474  physcon,shcon,nshcon,alcon,nalcon,ttime,&time,istep,&iinc,
475  &coriolis,ibody,xloadold,&reltime,veold,springarea,nstate_,
476  xstateini,xstate,thicke,integerglob,doubleglob,
477  tieset,istartset,iendset,ialset,ntie,&nasym,pslavsurf,
478  pmastsurf,&mortar,clearini,ielprop,prop,&ne0,fnext,&kscale,
479  iponoel,inoel,network);
480 
481  if(nmethodact==0){
482 
483  /* error occurred in mafill: storing the geometry in frd format */
484 
485  ++*kode;
486 
487  ptime=*ttime+time;
488  frd(co,nk,kon,ipkon,lakon,ne,v,stn,inum,&nmethodact,
489  kode,filab,een,t1,fn,&ptime,epn,ielmat,matname,enern,xstaten,
490  nstate_,istep,&iinc,&ithermalact,qfn,&mode,&noddiam,trab,inotr,
491  ntrans,orab,ielorien,norien,description,ipneigh,neigh,
492  mi,sti,vr,vi,stnr,stni,vmax,stnmax,&ngraph,veold,ener,ne,
493  cs,set,nset,istartset,iendset,ialset,eenmax,fnr,fni,emn,
494  thicke,jobnamec,output,qfx,cdn,&mortar,cdnr,cdni,nmat);
495 
496  FORTRAN(stop,());
497 
498  }
499 
500  for(k=0;k<neq[1];++k){
501  b[k]=fext[k]-f[k];
502  }
503 
504  if(*isolver==0){
505 #ifdef SPOOLES
506  spooles(ad,au,adb,aub,&sigma,b,icol,irow,&neq[1],&nzs[1],
507  &symmetryflag,&inputformat,&nzs[2]);
508 #else
509  printf("*ERROR in nonlingeo: the SPOOLES library is not linked\n\n");
510  FORTRAN(stop,());
511 #endif
512  }
513  else if((*isolver==2)||(*isolver==3)){
514  preiter(ad,&au,b,&icol,&irow,&neq[1],&nzs[1],isolver,iperturb);
515  }
516  else if(*isolver==4){
517 #ifdef SGI
518  token=1;
519  sgi_main(ad,au,adb,aub,&sigma,b,icol,irow,&neq[1],&nzs[1],token);
520 #else
521  printf("*ERROR in nonlingeo: the SGI library is not linked\n\n");
522  FORTRAN(stop,());
523 #endif
524  }
525  else if(*isolver==5){
526 #ifdef TAUCS
527  tau(ad,&au,adb,aub,&sigma,b,icol,&irow,&neq[1],&nzs[1]);
528 #else
529  printf("*ERROR in nonlingeo: the TAUCS library is not linked\n\n");
530  FORTRAN(stop,());
531 #endif
532  }
533  else if(*isolver==7){
534 #ifdef PARDISO
535  pardiso_main(ad,au,adb,aub,&sigma,b,icol,irow,&neq[1],&nzs[1],
536  &symmetryflag,&inputformat,jq,&nzs[2]);
537 #else
538  printf("*ERROR in nonlingeo: the PARDISO library is not linked\n\n");
539  FORTRAN(stop,());
540 #endif
541  }
542 
543  SFREE(au);SFREE(ad);
544 
545  NNEW(v,double,mt**nk);
546 // memcpy(&v[0],&vold[0],sizeof(double)*mt**nk);
547 
548  NNEW(fn,double,mt**nk);
549 
550  NNEW(inum,ITG,*nk);
551  results(co,nk,kon,ipkon,lakon,ne,v,stn,inum,stx,
552  elcon,nelcon,rhcon,nrhcon,alcon,nalcon,alzero,ielmat,
553  ielorien,norien,orab,ntmat_,t0,t1act,&ithermalact,
554  prestr,iprestr,filab,eme,emn,een,iperturb,
555  f,fn,nactdof,&iout,qa,vold,b,nodeboun,
556  ndirboun,xbounact,nboun,ipompc,
557  nodempc,coefmpc,labmpc,nmpc,&nmethodact,cam,&neq[1],veold,accold,
558  &bet,&gam,&dtime,&time,ttime,plicon,nplicon,plkcon,nplkcon,
559  xstateini,xstiff,xstate,npmat_,epn,matname,mi,&ielas,
560  &icmd,ncmat_,nstate_,sti,vini,ikboun,ilboun,ener,enern,
561  emeini,xstaten,eei,enerini,alcon,nalcon,set,nset,istartset,
562  iendset,ialset,nprint,prlab,prset,qfx,qfn,trab,inotr,ntrans,
563  fmpc,nelemload,&null,ikmpc,ilmpc,istep,&iinc,springarea,
564  &reltime,ne,xforc,&null,thicke,shcon,nshcon,
565  sideload,xloadact,xloadold,&icfd,inomat,pslavsurf,pmastsurf,
566  &mortar,islavact,cdn,islavnode,nslavnode,ntie,clearini,
567  islavsurf,ielprop,prop,energyini,energy,&kscale,iponoel,
568  inoel,nener,orname,network,ipobody,xbodyact,ibody);
569 
570 // memcpy(&vold[0],&v[0],sizeof(double)*mt**nk);
571 
572  /* reactivating the non-shell elements (for mesh output purposes)
573  deactivating the initial temperature for the non-shell nodes */
574 
575  for(i=0;i<*ne;i++){
576  if(strcmp1(&lakon[8*i+6],"L")!=0){
577  ipkon[i]=-ipkon[i]-2;
578  }else if(ipkon[i]!=-1){
579 
580  /* copy shell results */
581 
582  indexe=ipkon[i];
583  if(strcmp1(&lakon[8*i+3],"6")==0){nope=6;}
584  else if(strcmp1(&lakon[8*i+3],"8")==0){nope=8;}
585  else if(strcmp1(&lakon[8*i+3],"1")==0){nope=15;}
586  else{nope=20;}
587  for(j=0;j<nope;j++){
588  node=kon[indexe+j];
589  vold[mt*(node-1)]=v[mt*(node-1)];
590  }
591  }
592  }
593 
594  /* deactivating the output of temperatures */
595 
596  if(strcmp1(&filab[87],"NT ")==0){
597  ntflag=1;
598  strcpy1(&filab[87]," ",4);
599  }else{ntflag=0;}
600 
601  /* createinum is called in order to store the nodes and elements
602  of the complete structure, not only of the coil */
603 
604  FORTRAN(createinum,(ipkon,inum,kon,lakon,nk,ne,&cflag[0],nelemload,
605  nload,nodeboun,nboun,ndirboun,ithermal,co,vold,mi,ielmat));
606 
607  ++*kode;
608  if(*mcs!=0){
609  ptime=*ttime+time;
610  frdcyc(co,nk,kon,ipkon,lakon,ne,v,stn,inum,&nmethodact,kode,filab,een,
611  t1act,fn,&ptime,epn,ielmat,matname,cs,mcs,nkon,enern,xstaten,
612  nstate_,istep,&iinc,iperturb,ener,mi,output,&ithermalact,qfn,
613  ialset,istartset,iendset,trab,inotr,ntrans,orab,ielorien,
614  norien,stx,veold,&noddiam,set,nset,emn,thicke,jobnamec,ne,
615  cdn,&mortar,nmat,qfx);
616  }else{
617 
618  ptime=*ttime+time;
619  frd(co,nk,kon,ipkon,lakon,ne,v,stn,inum,&nmethodact,
620  kode,filab,een,t1act,fn,&ptime,epn,ielmat,matname,enern,xstaten,
621  nstate_,istep,&iinc,&ithermalact,qfn,&mode,&noddiam,trab,inotr,
622  ntrans,orab,ielorien,norien,description,ipneigh,neigh,
623  mi,stx,vr,vi,stnr,stni,vmax,stnmax,&ngraph,veold,ener,ne,
624  cs,set,nset,istartset,iendset,ialset,eenmax,fnr,fni,emn,
625  thicke,jobnamec,output,qfx,cdn,&mortar,cdnr,cdni,nmat);
626 
627  }
628  SFREE(inum);SFREE(v);SFREE(fn);
629 
630  /* reactivating the temperature output, if previously deactivated */
631 
632  if(ntflag==1){
633  strcpy1(&filab[87],"NT ",4);
634  }
635 
636  NNEW(inomat,ITG,*nk);
637 
638  /* calculating the magnetic intensity caused by the current */
639 
640  FORTRAN(assigndomtonodes,(ne,lakon,ipkon,kon,ielmat,inomat,
641  elcon,ncmat_,ntmat_,mi,&ne2));
642 
643  NNEW(h0ref,double,3**nk);
644  NNEW(h0,double,3**nk);
645 
646  biosav(ipkon,kon,lakon,ne,co,qfx,h0ref,mi,inomat,nk);
647 
648  if(*ithermal<=1){SFREE(qfx);SFREE(t0);}
649  if(strcmp1(&filab[3567],"ECD ")==0)SFREE(qfn);
650 
651  /* deactivating the shell elements */
652 
653  for(i=0;i<*ne;i++){
654  if(strcmp1(&lakon[8*i+6],"L")==0){
655  ipkon[i]=-ipkon[i]-2;
656  }
657  }
658 
659 /**************************************************************/
660 /* creating connecting MPC's between the domains */
661 /**************************************************************/
662 
663 /* creating contact ties between the domains */
664 
665  if(*istep==1){
666 
667  NNEW(nodface,ITG,5*6**ne);
668  NNEW(ipoface,ITG,*nk);
669 
670  RENEW(set,char,81*(*nset+3));
671  RENEW(istartset,ITG,*nset+3);
672  RENEW(iendset,ITG,*nset+3);
673  RENEW(ialset,ITG,*nalset+6**ne);
674  RENEW(tieset,char,243*(*ntie+5));
675  RENEW(tietol,double,3*(*ntie+5));
676 
677  FORTRAN(createtiedsurfs,(nodface,ipoface,set,istartset,
678  iendset,ialset,tieset,inomat,ne,ipkon,lakon,kon,ntie,
679  tietol,nalset,nk,nset,iactive));
680 
681  SFREE(nodface);SFREE(ipoface);
682  RENEW(set,char,81**nset);
683  RENEW(istartset,ITG,*nset);
684  RENEW(iendset,ITG,*nset);
685  RENEW(ialset,ITG,*nalset);
686  RENEW(tieset,char,243**ntie);
687  RENEW(tietol,double,3**ntie);
688 
689  /* tied contact constraints: generate appropriate MPC's */
690 
691  tiedcontact(ntie,tieset,nset,set,istartset,iendset,ialset,
692  lakon,ipkon,kon,tietol,nmpc, &mpcfree,&memmpc_,
693  &ipompc,&labmpc,&ikmpc,&ilmpc,&fmpc,&nodempc,&coefmpc,
694  ithermal,co,vold,&icfd,nmpc_,mi,nk,istep,ikboun,nboun,
695  kind1,kind2);
696 
697  /* mapping h0ref from the phi domain onto the border of
698  the A and A-V domains */
699 
700  FORTRAN(calch0interface,(nmpc,ipompc,nodempc,coefmpc,h0ref));
701 
702  }
703 
704 /**************************************************************/
705 /* creating the A.n MPC */
706 /**************************************************************/
707 
708  /* identifying the interfaces between the A and A-V domains
709  and the phi-domain */
710 
711  FORTRAN(generateeminterfaces,(istartset,iendset,
712  ialset,iactive,ipkon,lakon,kon,ikmpc,nmpc,&maxfaces));
713 
714  for(i=1;i<3;i++){
715  imast=iactive[i];
716  if(imast==0) continue;
717 
718  /* determining the normals on the face */
719 
720  NNEW(imastnode,ITG,8*maxfaces);
721  NNEW(xmastnor,double,3*8*maxfaces);
722 
723  FORTRAN(normalsoninterface,(istartset,iendset,
724  ialset,&imast,ipkon,kon,lakon,imastnode,&nmastnode,
725  xmastnor,co));
726 
727  /* enlarging the fields for MPC's */
728 
729  *nmpc_=*nmpc_+nmastnode;
730  RENEW(ipompc,ITG,*nmpc_);
731  RENEW(labmpc,char,20**nmpc_+1);
732  RENEW(ikmpc,ITG,*nmpc_);
733  RENEW(ilmpc,ITG,*nmpc_);
734  RENEW(fmpc,double,*nmpc_);
735 
736  /* determining the maximum number of terms;
737  expanding nodempc and coefmpc to accommodate
738  those terms */
739 
740  neqterms=3*nmastnode;
741  index=memmpc_;
742  (memmpc_)+=neqterms;
743  RENEW(nodempc,ITG,3*memmpc_);
744  RENEW(coefmpc,double,memmpc_);
745  for(k=index;k<memmpc_;k++){
746  nodempc[3*k-1]=k+1;
747  }
748  nodempc[3*memmpc_-1]=0;
749 
750  /* creating the A.n MPC's */
751 
752  FORTRAN(createinterfacempcs,(imastnode,xmastnor,&nmastnode,
753  ikmpc,ilmpc,nmpc,ipompc,nodempc,coefmpc,labmpc,&mpcfree,
754  ikboun,nboun));
755 
756  SFREE(imastnode);SFREE(xmastnor);
757  }
758 
759  /* determining the new matrix structure */
760 
761  remastructem(ipompc,&coefmpc,&nodempc,nmpc,
762  &mpcfree,nodeboun,ndirboun,nboun,ikmpc,ilmpc,ikboun,ilboun,
763  labmpc,nk,&memmpc_,&icascade,&maxlenmpc,
764  kon,ipkon,lakon,ne,nactdof,icol,jq,&irow,isolver,
765  neq,nzs,nmethod,&f,&fext,&b,&aux2,&fini,&fextini,
766  &adb,&aub,ithermal,iperturb,mass,mi,ielmat,elcon,
767  ncmat_,ntmat_,inomat,network);
768 
769 /**************************************************************/
770 /* starting the loop over the increments */
771 /**************************************************************/
772 
773  /* saving the distributed loads (volume heating will be
774  added because of Joule heating) */
775 
776  if(*ithermal==3){
777  nloadref=*nload;
778  NNEW(nelemloadref,ITG,2**nload);
779  if(*nam>0) NNEW(iamloadref,ITG,2**nload);
780  NNEW(sideloadref,char,20**nload);
781 
782  memcpy(&nelemloadref[0],&nelemload[0],sizeof(ITG)*2**nload);
783  if(*nam>0) memcpy(&iamloadref[0],&iamload[0],sizeof(ITG)*2**nload);
784  memcpy(&sideloadref[0],&sideload[0],sizeof(char)*20**nload);
785 
786  /* generating new fields; ne2 is the number of elements
787  in domain 2 = A,V-domain (the only domain with heating) */
788 
789  (*nload_)+=ne2;
790  RENEW(nelemload,ITG,2**nload_);
791  if(*nam>0) RENEW(iamload,ITG,2**nload_);
792  RENEW(xloadact,double,2**nload_);
793  RENEW(sideload,char,20**nload_);
794  }
795 
796  if((*ithermal==1)||(*ithermal>=3)){
797  NNEW(t1ini,double,*nk);
798  NNEW(t1act,double,*nk);
799  for(k=0;k<*nk;++k){t1act[k]=t1old[k];}
800  }
801 
802  newstep=1;
803 
804  while(1.-theta>1.e-6){
805 
806  if(icutb==0){
807 
808  /* previous increment converged: update the initial values */
809 
810  iinc++;
811  jprint++;
812 
813  /* vold is copied into vini */
814 
815  memcpy(&vini[0],&vold[0],sizeof(double)*mt**nk);
816 
817  for(k=0;k<*nboun;++k){xbounini[k]=xbounact[k];}
818  if((*ithermal==1)||(*ithermal>=3)){
819  for(k=0;k<*nk;++k){t1ini[k]=t1act[k];}
820  }
821  for(k=0;k<neq[1];++k){
822  fini[k]=f[k];
823  }
824  if(*nmethod==4){
825  for(k=0;k<mt**nk;++k){
826  veini[k]=veold[k];
827  }
828  for(k=0;k<neq[1];++k){
829  fextini[k]=fext[k];
830  }
831  }
832  }
833 
834  /* check for max. # of increments */
835 
836  if(iinc>*jmax){
837  printf(" *ERROR: max. # of increments reached\n\n");
838  FORTRAN(stop,());
839  }
840  printf(" increment %" ITGFORMAT " attempt %" ITGFORMAT " \n",iinc,icutb+1);
841  printf(" increment size= %e\n",dtheta**tper);
842  printf(" sum of previous increments=%e\n",theta**tper);
843  printf(" actual step time=%e\n",(theta+dtheta)**tper);
844  printf(" actual total time=%e\n\n",*ttime+(theta+dtheta)**tper);
845 
846  printf(" iteration 1\n\n");
847 
848  qamold[0]=qam[0];
849  qamold[1]=qam[1];
850 
851  /* determining the actual loads at the end of the new increment*/
852 
853  reltime=theta+dtheta;
854  time=reltime**tper;
855  dtime=dtheta**tper;
856 
857  /* restoring the distributed loading before adding the
858  Joule heating */
859 
860  if(*ithermal==3){
861  *nload=nloadref;
862  DMEMSET(nelemload,0,2**nload_,0);
863  memcpy(&nelemload[0],&nelemloadref[0],sizeof(ITG)*2**nload);
864  if(*nam>0){
865  DMEMSET(iamload,0,2**nload_,0);
866  memcpy(&iamload[0],&iamloadref[0],sizeof(ITG)*2**nload);
867  }
868  DMEMSET(xloadact,0,2**nload_,0.);
869  DMEMSET(sideload,0,'\0',0.);memcpy(&sideload[0],&sideloadref[0],sizeof(char)*20**nload);
870  }
871 
872  /* determining the actual loading */
873 
874 // for(i=0;i<3**nk;i++){h0[i]/=h0scale;}
875  FORTRAN(tempload_em,(xforcold,xforc,xforcact,iamforc,nforc,xloadold,xload,
876  xloadact,iamload,nload,ibody,xbody,nbody,xbodyold,xbodyact,
877  t1old,t1,t1act,iamt1,nk,amta,
878  namta,nam,ampli,&time,&reltime,ttime,&dtime,ithermal,nmethod,
879  xbounold,xboun,xbounact,iamboun,nboun,
880  nodeboun,ndirboun,nodeforc,ndirforc,istep,&iinc,
881  co,vold,itg,&ntg,amname,ikboun,ilboun,nelemload,sideload,mi,
882  ntrans,trab,inotr,veold,integerglob,doubleglob,tieset,istartset,
883  iendset,ialset,ntie,nmpc,ipompc,ikmpc,ilmpc,nodempc,coefmpc,
884  &h0scale,inomat,ipobody,iponoel,inoel));
885  for(i=0;i<3**nk;i++){h0[i]=h0ref[i]*h0scale;}
886 
887  for(i=0;i<3;i++){cam[i]=0.;}for(i=3;i<5;i++){cam[i]=0.5;}
888  if(*ithermal>1){radflowload(itg,ieg,&ntg,&ntr,adrad,aurad,bcr,ipivr,
889  ac,bc,nload,sideload,nelemload,xloadact,lakon,ipiv,ntmat_,vold,
890  shcon,nshcon,ipkon,kon,co,
891  kontri,&ntri,nloadtr,tarea,tenv,physcon,erad,&adview,&auview,
892  nflow,ikboun,xbounact,nboun,ithermal,&iinc,&iit,
893  cs,mcs,inocs,&ntrit,nk,fenv,istep,&dtime,ttime,&time,ilboun,
894  ikforc,ilforc,xforcact,nforc,cam,ielmat,&nteq,prop,ielprop,
895  nactdog,nacteq,nodeboun,ndirboun,network,
896  rhcon,nrhcon,ipobody,ibody,xbodyact,nbody,iviewfile,jobnamef,
897  ctrl,xloadold,&reltime,nmethod,set,mi,istartset,iendset,ialset,nset,
898  ineighe,nmpc,nodempc,ipompc,coefmpc,labmpc,&iemchange,nam,iamload,
899  jqrad,irowrad,&nzsrad,icolrad,ne,iaxial,qa,cocon,ncocon,iponoel,
900  inoel,nprop,amname,namta,amta);
901  }
902 
903  /* prediction of the next solution (only for temperature) */
904 
905  NNEW(v,double,mt**nk);
906 
907 // if(*ithermal>2){
908  prediction_em(uam,nmethod,&bet,&gam,&dtime,ithermal,nk,veold,v,
909  &iinc,&idiscon,vold,nactdof,mi);
910 // }
911 
912  NNEW(fn,double,mt**nk);
913 
914  iout=-1;
915  iperturb_sav[0]=iperturb[0];
916  iperturb_sav[1]=iperturb[1];
917 
918  /* first iteration in first increment: heat tangent */
919 
920  NNEW(inum,ITG,*nk);
921  resultsinduction(co,nk,kon,ipkon,lakon,ne,v,stn,inum,
922  elcon,nelcon,rhcon,nrhcon,alcon,nalcon,alzero,ielmat,
923  ielorien,norien,orab,ntmat_,t0,t1act,ithermal,
924  prestr,iprestr,filab,eme,emn,een,iperturb,
925  f,fn,nactdof,&iout,qa,vold,b,nodeboun,
926  ndirboun,xbounact,nboun,ipompc,
927  nodempc,coefmpc,labmpc,nmpc,nmethod,cam,&neq[1],veold,accold,
928  &bet,&gam,&dtime,&time,ttime,plicon,nplicon,plkcon,nplkcon,
929  xstateini,xstiff,xstate,npmat_,epn,matname,mi,&ielas,
930  &icmd,ncmat_,nstate_,sti,vini,ikboun,ilboun,ener,enern,
931  emeini,xstaten,eei,enerini,cocon,ncocon,set,nset,istartset,
932  iendset,ialset,nprint,prlab,prset,qfx,qfn,trab,inotr,ntrans,
933  fmpc,nelemload,nload,ikmpc,ilmpc,istep,&iinc,springarea,
934  &reltime,ne,xforc,nforc,thicke,shcon,nshcon,
935  sideload,xloadact,xloadold,&icfd,inomat,h0,islavnode,
936  nslavnode,ntie,ielprop,prop,iactive,energyini,energy,
937  iponoel,inoel,orname,network,ipobody,xbodyact,ibody);
938  SFREE(inum);
939 
940  /* the calculation of the electromagnetic fields is (quasi)linear,
941  i.e. the solution of the equations is the fields;
942  only the temperature calculation is nonlinear,
943  i.e. the solution of the equations is a differential temperature */
944 
945  memcpy(&vold[0],&v[0],sizeof(double)*mt**nk);
946 
947  iout=0;
948 
949  SFREE(fn);SFREE(v);
950 
951  /***************************************************************/
952  /* iteration counter and start of the loop over the iterations */
953  /***************************************************************/
954 
955  iit=1;
956  icntrl=0;
957  ctrl[0]=i0ref;ctrl[1]=irref;ctrl[3]=icref;
958 
959  while(icntrl==0){
960 
961  if(iit!=1){
962 
963  printf(" iteration %" ITGFORMAT "\n\n",iit);
964 
965  /* restoring the distributed loading before adding the
966  Joule heating */
967 
968  if(*ithermal==3){
969  *nload=nloadref;
970  DMEMSET(nelemload,0,2**nload_,0);
971  memcpy(&nelemload[0],&nelemloadref[0],sizeof(ITG)*2**nload);
972  if(*nam>0){
973  DMEMSET(iamload,0,2**nload_,0);
974  memcpy(&iamload[0],&iamloadref[0],sizeof(ITG)*2**nload);
975  }
976  DMEMSET(xloadact,0,2**nload_,0.);
977  DMEMSET(sideload,0,20**nload_,'\0');memcpy(&sideload[0],&sideloadref[0],sizeof(char)*20**nload);
978  }
979 
980  /* determining the actual loading */
981 
982 // for(i=0;i<3**nk;i++){h0[i]/=h0scale;}
983  FORTRAN(tempload_em,(xforcold,xforc,xforcact,iamforc,nforc,
984  xloadold,xload,
985  xloadact,iamload,nload,ibody,xbody,nbody,xbodyold,xbodyact,
986  t1old,t1,t1act,iamt1,nk,amta,
987  namta,nam,ampli,&time,&reltime,ttime,&dtime,ithermal,nmethod,
988  xbounold,xboun,xbounact,iamboun,nboun,
989  nodeboun,ndirboun,nodeforc,ndirforc,istep,&iinc,
990  co,vold,itg,&ntg,amname,ikboun,ilboun,nelemload,sideload,mi,
991  ntrans,trab,inotr,veold,integerglob,doubleglob,tieset,istartset,
992  iendset,ialset,ntie,nmpc,ipompc,ikmpc,ilmpc,nodempc,coefmpc,
993  &h0scale,inomat,ipobody,iponoel,inoel));
994  for(i=0;i<3**nk;i++){h0[i]=h0ref[i]*h0scale;}
995 
996  for(i=0;i<3;i++){cam[i]=0.;}for(i=3;i<5;i++){cam[i]=0.5;}
997  if(*ithermal>1){radflowload(itg,ieg,&ntg,&ntr,adrad,aurad,
998  bcr,ipivr,ac,bc,nload,sideload,nelemload,xloadact,lakon,ipiv,
999  ntmat_,vold,shcon,nshcon,ipkon,kon,co,
1000  kontri,&ntri,nloadtr,tarea,tenv,physcon,erad,&adview,&auview,
1001  nflow,ikboun,xbounact,nboun,ithermal,&iinc,&iit,
1002  cs,mcs,inocs,&ntrit,nk,fenv,istep,&dtime,ttime,&time,ilboun,
1003  ikforc,ilforc,xforcact,nforc,cam,ielmat,&nteq,prop,ielprop,
1004  nactdog,nacteq,nodeboun,ndirboun,network,
1005  rhcon,nrhcon,ipobody,ibody,xbodyact,nbody,iviewfile,jobnamef,
1006  ctrl,xloadold,&reltime,nmethod,set,mi,istartset,iendset,ialset,
1007  nset,ineighe,nmpc,nodempc,ipompc,coefmpc,labmpc,&iemchange,nam,
1008  iamload,jqrad,irowrad,&nzsrad,icolrad,ne,iaxial,qa,cocon,
1009  ncocon,iponoel,inoel,nprop,amname,namta,amta);
1010  }
1011 
1012  }
1013 
1014  /* add Joule heating */
1015 
1016  if(*ithermal==3){
1017  NNEW(idefload,ITG,*nload_);
1018  DMEMSET(idefload,0,*nload_,1);
1019  FORTRAN(jouleheating,(ipkon,lakon,kon,co,elcon,nelcon,
1020  mi,ne,sti,ielmat,nelemload,sideload,xloadact,nload,nload_,
1021  iamload,nam,idefload,ncmat_,ntmat_,
1022  alcon,nalcon,ithermal,vold,t1));
1023  SFREE(idefload);
1024  }
1025 
1026  if(*ithermal==3){
1027  for(k=0;k<*nk;++k){t1act[k]=vold[mt*k];}
1028  }
1029 
1030  /* calculating the local stiffness matrix and external loading */
1031 
1032  NNEW(ad,double,neq[1]);
1033  NNEW(au,double,nzs[1]);
1034 
1035  FORTRAN(mafillem,(co,nk,kon,ipkon,lakon,ne,nodeboun,ndirboun,
1036  xbounact,nboun,
1037  ipompc,nodempc,coefmpc,nmpc,nodeforc,ndirforc,xforcact,
1038  nforc,nelemload,sideload,xloadact,nload,xbodyact,ipobody,
1039  nbody,cgr,ad,au,fext,nactdof,icol,jq,irow,neq,nzl,
1040  nmethod,ikmpc,ilmpc,ikboun,ilboun,
1041  elcon,nelcon,rhcon,nrhcon,alcon,nalcon,alzero,
1042  ielmat,ielorien,norien,orab,ntmat_,
1043  t0,t1act,ithermal,prestr,iprestr,vold,iperturb,sti,
1044  nzs,stx,adb,aub,iexpl,plicon,nplicon,plkcon,nplkcon,
1045  xstiff,npmat_,&dtime,matname,mi,
1046  ncmat_,mass,&stiffness,&buckling,&rhsi,&intscheme,
1047  physcon,shcon,nshcon,cocon,ncocon,ttime,&time,istep,&iinc,
1048  &coriolis,ibody,xloadold,&reltime,veold,springarea,nstate_,
1049  xstateini,xstate,thicke,integerglob,doubleglob,
1050  tieset,istartset,iendset,ialset,ntie,&nasym,iactive,h0,
1051  pslavsurf,pmastsurf,&mortar,clearini,ielprop,prop,
1052  iponoel,inoel,network));
1053 
1054  iperturb[0]=iperturb_sav[0];
1055  iperturb[1]=iperturb_sav[1];
1056 
1057  /* calculating the residual (f is only for the temperature
1058  nonzero) */
1059 
1060  calcresidual_em(nmethod,neq,b,fext,f,iexpl,nactdof,aux1,aux2,vold,
1061  vini,&dtime,accold,nk,adb,aub,jq,irow,nzl,alpha,fextini,fini,
1062  islavnode,nslavnode,&mortar,ntie,f_cm,f_cs,mi,
1063  nzs,&nasym,ithermal);
1064 
1065  newstep=0;
1066 
1067  if(*nmethod==0){
1068 
1069  /* error occurred in mafill: storing the geometry in frd format */
1070 
1071  *nmethod=0;
1072  ++*kode;
1073  NNEW(inum,ITG,*nk);for(k=0;k<*nk;k++) inum[k]=1;
1074 
1075  ptime=*ttime+time;
1076  frd(co,nk,kon,ipkon,lakon,ne,v,stn,inum,nmethod,
1077  kode,filab,een,t1,fn,&ptime,epn,ielmat,matname,enern,xstaten,
1078  nstate_,istep,&iinc,ithermal,qfn,&mode,&noddiam,trab,inotr,
1079  ntrans,orab,ielorien,norien,description,ipneigh,neigh,
1080  mi,sti,vr,vi,stnr,stni,vmax,stnmax,&ngraph,veold,ener,ne,
1081  cs,set,nset,istartset,iendset,ialset,eenmax,fnr,fni,emn,
1082  thicke,jobnamec,output,qfx,cdn,&mortar,cdnr,cdni,nmat);
1083 
1084  }
1085 
1086  /* implicit step (static or dynamic */
1087 
1088  if(*nmethod==4){
1089 
1090  /* electromagnetic part */
1091 
1092  if(*ithermal!=2){
1093  for(k=0;k<neq[0];++k){
1094  ad[k]=adb[k]/dtime+ad[k];
1095  }
1096  for(k=0;k<nzs[0];++k){
1097  au[k]=aub[k]/dtime+au[k];
1098  }
1099 
1100  /* upper triangle of asymmetric matrix */
1101 
1102  if(nasym>0){
1103  for(k=nzs[2];k<nzs[2]+nzs[0];++k){
1104  au[k]=aub[k]/dtime+au[k];
1105  }
1106  }
1107  }
1108 
1109  /* thermal part */
1110 
1111  if(*ithermal>1){
1112  for(k=neq[0];k<neq[1];++k){
1113  ad[k]=adb[k]/dtime+ad[k];
1114  }
1115  for(k=nzs[0];k<nzs[1];++k){
1116  au[k]=aub[k]/dtime+au[k];
1117  }
1118 
1119  /* upper triangle of asymmetric matrix */
1120 
1121  if(nasym>0){
1122  for(k=nzs[2]+nzs[0];k<nzs[2]+nzs[1];++k){
1123  au[k]=aub[k]/dtime+au[k];
1124  }
1125  }
1126  }
1127  }
1128 
1129  NNEW(adaux,double,neq[2]);
1130  FORTRAN(preconditioning,(ad,au,b,&neq[1],irow,jq,adaux));
1131 
1132 
1133  if(*isolver==0){
1134 #ifdef SPOOLES
1135  if(*ithermal<2){
1136  spooles(ad,au,adb,aub,&sigma,b,icol,irow,&neq[0],&nzs[0],
1137  &symmetryflag,&inputformat,&nzs[2]);
1138  }else{
1139  spooles(ad,au,adb,aub,&sigma,b,icol,irow,&neq[1],&nzs[1],
1140  &symmetryflag,&inputformat,&nzs[2]);
1141  }
1142 #else
1143  printf(" *ERROR in nonlingeo: the SPOOLES library is not linked\n\n");
1144  FORTRAN(stop,());
1145 #endif
1146  }
1147  else if((*isolver==2)||(*isolver==3)){
1148  if(nasym>0){
1149  printf(" *ERROR in nonlingeo: the iterative solver cannot be used for asymmetric matrices\n\n");
1150  FORTRAN(stop,());
1151  }
1152  preiter(ad,&au,b,&icol,&irow,&neq[1],&nzs[1],isolver,iperturb);
1153  }
1154  else if(*isolver==4){
1155 #ifdef SGI
1156  if(nasym>0){
1157  printf(" *ERROR in nonlingeo: the SGI solver cannot be used for asymmetric matrices\n\n");
1158  FORTRAN(stop,());
1159  }
1160  token=1;
1161  if(*ithermal<2){
1162  sgi_main(ad,au,adb,aub,&sigma,b,icol,irow,&neq[0],&nzs[0],token);
1163  }else{
1164  sgi_main(ad,au,adb,aub,&sigma,b,icol,irow,&neq[1],&nzs[1],token);
1165  }
1166 #else
1167  printf(" *ERROR in nonlingeo: the SGI library is not linked\n\n");
1168  FORTRAN(stop,());
1169 #endif
1170  }
1171  else if(*isolver==5){
1172  if(nasym>0){
1173  printf(" *ERROR in nonlingeo: the TAUCS solver cannot be used for asymmetric matrices\n\n");
1174  FORTRAN(stop,());
1175  }
1176 #ifdef TAUCS
1177  tau(ad,&au,adb,aub,&sigma,b,icol,&irow,&neq[1],&nzs[1]);
1178 #else
1179  printf(" *ERROR in nonlingeo: the TAUCS library is not linked\n\n");
1180  FORTRAN(stop,());
1181 #endif
1182  }
1183  else if(*isolver==7){
1184 #ifdef PARDISO
1185  if(*ithermal<2){
1186  pardiso_main(ad,au,adb,aub,&sigma,b,icol,irow,&neq[0],&nzs[0],
1187  &symmetryflag,&inputformat,jq,&nzs[2]);
1188  }else{
1189  pardiso_main(ad,au,adb,aub,&sigma,b,icol,irow,&neq[1],&nzs[1],
1190  &symmetryflag,&inputformat,jq,&nzs[2]);
1191  }
1192 #else
1193  printf(" *ERROR in nonlingeo: the PARDISO library is not linked\n\n");
1194  FORTRAN(stop,());
1195 #endif
1196  }
1197 
1198  for(i=0;i<neq[1];i++){b[i]*=adaux[i];}
1199  SFREE(adaux);
1200 
1201  /* calculating the electromagnetic fields and temperatures
1202  only the temperature calculation is differential */
1203 
1204  NNEW(v,double,mt**nk);
1205  memcpy(&v[0],&vold[0],sizeof(double)*mt**nk);
1206 
1207  NNEW(fn,double,mt**nk);
1208 
1209  NNEW(inum,ITG,*nk);
1210  resultsinduction(co,nk,kon,ipkon,lakon,ne,v,stn,inum,
1211  elcon,nelcon,rhcon,nrhcon,alcon,nalcon,alzero,ielmat,
1212  ielorien,norien,orab,ntmat_,t0,t1act,ithermal,
1213  prestr,iprestr,filab,eme,emn,een,iperturb,
1214  f,fn,nactdof,&iout,qa,vold,b,nodeboun,
1215  ndirboun,xbounact,nboun,ipompc,
1216  nodempc,coefmpc,labmpc,nmpc,nmethod,cam,&neq[1],veold,accold,
1217  &bet,&gam,&dtime,&time,ttime,plicon,nplicon,plkcon,nplkcon,
1218  xstateini,xstiff,xstate,npmat_,epn,matname,mi,&ielas,
1219  &icmd,ncmat_,nstate_,sti,vini,ikboun,ilboun,ener,enern,
1220  emeini,xstaten,eei,enerini,cocon,ncocon,set,nset,istartset,
1221  iendset,ialset,nprint,prlab,prset,qfx,qfn,trab,inotr,ntrans,
1222  fmpc,nelemload,nload,ikmpc,ilmpc,istep,&iinc,springarea,
1223  &reltime,ne,xforc,nforc,thicke,shcon,nshcon,
1224  sideload,xloadact,xloadold,&icfd,inomat,h0,islavnode,
1225  nslavnode,ntie,ielprop,prop,iactive,energyini,energy,
1226  iponoel,inoel,orname,network,ipobody,xbodyact,ibody);
1227  SFREE(inum);
1228 
1229  SFREE(ad);SFREE(au);
1230 
1231  if(*ithermal!=2){
1232  if(cam[0]>uam[0]){uam[0]=cam[0];}
1233  if(qau<1.e-10){
1234  if(qa[0]>ea*qam[0]){qam[0]=(qamold[0]*jnz+qa[0])/(jnz+1);}
1235  else {qam[0]=qamold[0];}
1236  }
1237  }
1238  if(*ithermal>1){
1239  if(cam[1]>uam[1]){uam[1]=cam[1];}
1240  if(qau<1.e-10){
1241  if(qa[1]>ea*qam[1]){qam[1]=(qamold[1]*jnz+qa[1])/(jnz+1);}
1242  else {qam[1]=qamold[1];}
1243  }
1244  }
1245 
1246  memcpy(&vold[0],&v[0],sizeof(double)*mt**nk);
1247 
1248  SFREE(v);SFREE(fn);
1249 
1250  /* calculating the residual */
1251 
1252  calcresidual_em(nmethod,neq,b,fext,f,iexpl,nactdof,aux1,aux2,vold,
1253  vini,&dtime,accold,nk,adb,aub,jq,irow,nzl,alpha,fextini,fini,
1254  islavnode,nslavnode,&mortar,ntie,f_cm,f_cs,mi,
1255  nzs,&nasym,ithermal);
1256 
1257  /* calculating the maximum residual (only thermal part)*/
1258 
1259  for(k=0;k<2;++k){
1260  ram2[k]=ram1[k];
1261  ram1[k]=ram[k];
1262  ram[k]=0.;
1263  }
1264 
1265  if(*ithermal!=2) ram[0]=0.;
1266 
1267  if(*ithermal>1){
1268  for(k=neq[0];k<neq[1];++k){
1269  err=fabs(b[k]);
1270  if(err>ram[1]){ram[1]=err;ram[3]=k+0.5;}
1271  }
1272  }
1273 
1274  /* printing residuals */
1275 
1276  if(*ithermal>1){
1277  if(ram[1]<1.e-6) ram[1]=0.;
1278  printf(" average flux= %f\n",qa[1]);
1279  printf(" time avg. flux= %f\n",qam[1]);
1280  if((ITG)((double)nactdofinv[(ITG)ram[3]]/mt)+1==0){
1281  printf(" largest residual flux= %f\n",
1282  ram[1]);
1283  }else{
1284  inode=(ITG)((double)nactdofinv[(ITG)ram[3]]/mt)+1;
1285  idir=nactdofinv[(ITG)ram[3]]-mt*(inode-1);
1286  printf(" largest residual flux= %f in node %" ITGFORMAT " and dof %" ITGFORMAT "\n",ram[1],inode,idir);
1287  }
1288  printf(" largest increment of temp= %e\n",uam[1]);
1289  if((ITG)cam[4]==0){
1290  printf(" largest correction to temp= %e\n\n",
1291  cam[1]);
1292  }else{
1293  inode=(ITG)((double)nactdofinv[(ITG)cam[4]]/mt)+1;
1294  idir=nactdofinv[(ITG)cam[4]]-mt*(inode-1);
1295  printf(" largest correction to temp= %e in node %" ITGFORMAT " and dof %" ITGFORMAT "\n\n",cam[1],inode,idir);
1296  }
1297  }
1298 
1299  /* athermal electromagnetic calculations are linear:
1300  set iit=2 to force convergence */
1301 
1302  if(*ithermal<=1) iit=2;
1303 
1304  // MPADD: need for fake energy values!
1305  double energy[4] = {0, 0, 0, 0};
1306  double allwk = 0.0;
1307  double energyref = 0.0;
1308  double emax, enres,enetoll, reswk, dampwk, allwkini;
1309 
1310  neini=*ne;
1311  checkconvergence(co,nk,kon,ipkon,lakon,ne,stn,nmethod,
1312  kode,filab,een,t1act,&time,epn,ielmat,matname,enern,
1313  xstaten,nstate_,istep,&iinc,iperturb,ener,mi,output,
1314  ithermal,qfn,&mode,&noddiam,trab,inotr,ntrans,orab,
1315  ielorien,norien,description,sti,&icutb,&iit,&dtime,qa,
1316  vold,qam,ram1,ram2,ram,cam,uam,&ntg,ttime,&icntrl,
1317  &theta,&dtheta,veold,vini,idrct,tper,&istab,tmax,
1318  nactdof,b,tmin,ctrl,amta,namta,itpamp,&inext,&dthetaref,
1319  &itp,&jprint,jout,&uncoupled,t1,&iitterm,nelemload,
1320  nload,nodeboun,nboun,itg,ndirboun,&deltmx,&iflagact,
1321  set,nset,istartset,iendset,ialset,emn,thicke,jobnamec,
1322  &mortar,nmat,ielprop,prop,&ialeatoric,&kscale,
1323  energy, &allwk, &energyref,&emax, &enres, &enetoll, //MPADD
1324  energyini, &allwkini ,&allwk, &reswk, &ne0, &ne0, &dampwk, //MPADD
1325  &dampwk, energy); //MPADD
1326  }
1327 
1328  /*********************************************************/
1329  /* end of the iteration loop */
1330  /*********************************************************/
1331 
1332  /* icutb=0 means that the iterations in the increment converged,
1333  icutb!=0 indicates that the increment has to be reiterated with
1334  another increment size (dtheta) */
1335 
1336  if(((qa[0]>ea*qam[0])||(qa[1]>ea*qam[1]))&&(icutb==0)){jnz++;}
1337  iit=0;
1338 
1339  if(icutb!=0){
1340  memcpy(&vold[0],&vini[0],sizeof(double)*mt**nk);
1341 
1342  for(k=0;k<*nboun;++k){xbounact[k]=xbounini[k];}
1343  if((*ithermal==1)||(*ithermal>=3)){
1344  for(k=0;k<*nk;++k){t1act[k]=t1ini[k];}
1345  }
1346  for(k=0;k<neq[1];++k){
1347  f[k]=fini[k];
1348  }
1349  if(*nmethod==4){
1350  for(k=0;k<mt**nk;++k){
1351  veold[k]=veini[k];
1352  }
1353  for(k=0;k<neq[1];++k){
1354  fext[k]=fextini[k];
1355  }
1356  }
1357 
1358  qam[0]=qamold[0];
1359  qam[1]=qamold[1];
1360  }
1361 
1362  if((jout[0]==jprint)&&(icutb==0)){
1363 
1364  jprint=0;
1365 
1366  /* calculating the displacements and the stresses and storing */
1367  /* the results in frd format */
1368 
1369  NNEW(v,double,mt**nk);
1370  NNEW(fn,double,mt**nk);
1371  if(*ithermal>1) NNEW(qfn,double,3**nk);
1372  if((strcmp1(&filab[3741],"EMFE")==0)||
1373  (strcmp1(&filab[3828],"EMFB")==0)) NNEW(stn,double,6**nk);
1374  NNEW(inum,ITG,*nk);
1375 
1376  memcpy(&v[0],&vold[0],sizeof(double)*mt**nk);
1377 
1378  iout=2;
1379  icmd=3;
1380 
1381  resultsinduction(co,nk,kon,ipkon,lakon,ne,v,stn,inum,
1382  elcon,nelcon,rhcon,nrhcon,alcon,nalcon,alzero,ielmat,
1383  ielorien,norien,orab,ntmat_,t0,t1act,ithermal,
1384  prestr,iprestr,filab,eme,emn,een,iperturb,
1385  f,fn,nactdof,&iout,qa,vold,b,nodeboun,
1386  ndirboun,xbounact,nboun,ipompc,
1387  nodempc,coefmpc,labmpc,nmpc,nmethod,cam,&neq[1],veold,accold,
1388  &bet,&gam,&dtime,&time,ttime,plicon,nplicon,plkcon,nplkcon,
1389  xstateini,xstiff,xstate,npmat_,epn,matname,mi,&ielas,&icmd,
1390  ncmat_,nstate_,sti,vini,ikboun,ilboun,ener,enern,emeini,
1391  xstaten,eei,enerini,cocon,ncocon,set,nset,istartset,iendset,
1392  ialset,nprint,prlab,prset,qfx,qfn,trab,inotr,ntrans,fmpc,
1393  nelemload,nload,ikmpc,ilmpc,istep,&iinc,springarea,
1394  &reltime,ne,xforc,nforc,thicke,shcon,nshcon,
1395  sideload,xloadact,xloadold,&icfd,inomat,h0,islavnode,
1396  nslavnode,ntie,ielprop,prop,iactive,energyini,energy,
1397  iponoel,inoel,orname,network,ipobody,xbodyact,ibody);
1398 
1399  memcpy(&vold[0],&v[0],sizeof(double)*mt**nk);
1400 
1401  iout=0;
1402  icmd=0;
1403 // FORTRAN(networkinum,(ipkon,inum,kon,lakon,ne,itg,&ntg));
1404 
1405  ++*kode;
1406  if(*mcs!=0){
1407  ptime=*ttime+time;
1408  frdcyc(co,nk,kon,ipkon,lakon,ne,v,stn,inum,nmethod,kode,filab,een,
1409  t1act,fn,&ptime,epn,ielmat,matname,cs,mcs,nkon,enern,xstaten,
1410  nstate_,istep,&iinc,iperturb,ener,mi,output,ithermal,qfn,
1411  ialset,istartset,iendset,trab,inotr,ntrans,orab,ielorien,
1412  norien,stx,veold,&noddiam,set,nset,emn,thicke,jobnamec,ne,
1413  cdn,&mortar,nmat,qfx);
1414  }else{
1415 
1416  ptime=*ttime+time;
1417  frd(co,nk,kon,ipkon,lakon,ne,v,stn,inum,nmethod,
1418  kode,filab,een,t1act,fn,&ptime,epn,ielmat,matname,
1419  enern,xstaten,
1420  nstate_,istep,&iinc,ithermal,qfn,&mode,&noddiam,trab,inotr,
1421  ntrans,orab,ielorien,norien,description,ipneigh,neigh,
1422  mi,stx,vr,vi,stnr,stni,vmax,stnmax,&ngraph,veold,ener,ne,
1423  cs,set,nset,istartset,iendset,ialset,eenmax,fnr,fni,emn,
1424  thicke,jobnamec,output,qfx,cdn,&mortar,cdnr,cdni,nmat);
1425 
1426  }
1427 
1428  SFREE(v);SFREE(fn);SFREE(inum);
1429  if(*ithermal>1){SFREE(qfn);}
1430  if((strcmp1(&filab[3741],"EMFE")==0)||
1431  (strcmp1(&filab[3828],"EMFB")==0)) SFREE(stn);
1432 
1433  }
1434 
1435  }
1436 
1437  /*********************************************************/
1438  /* end of the increment loop */
1439  /*********************************************************/
1440 
1441  if(jprint!=0){
1442 
1443  /* calculating the displacements and the stresses and storing
1444  the results in frd format */
1445 
1446  NNEW(v,double,mt**nk);
1447  NNEW(fn,double,mt**nk);
1448  if(*ithermal>1) NNEW(qfn,double,3**nk);
1449  if(strcmp1(&filab[3741],"EMF ")==0) NNEW(stn,double,6**nk);
1450  NNEW(inum,ITG,*nk);
1451 
1452  memcpy(&v[0],&vold[0],sizeof(double)*mt**nk);
1453  iout=2;
1454  icmd=3;
1455 
1456  resultsinduction(co,nk,kon,ipkon,lakon,ne,v,stn,inum,
1457  elcon,nelcon,rhcon,nrhcon,alcon,nalcon,alzero,ielmat,
1458  ielorien,norien,orab,ntmat_,t0,t1act,ithermal,
1459  prestr,iprestr,filab,eme,emn,een,iperturb,
1460  f,fn,nactdof,&iout,qa,vold,b,nodeboun,
1461  ndirboun,xbounact,nboun,ipompc,
1462  nodempc,coefmpc,labmpc,nmpc,nmethod,cam,&neq[1],veold,accold,
1463  &bet,&gam,&dtime,&time,ttime,plicon,nplicon,plkcon,nplkcon,
1464  xstateini,xstiff,xstate,npmat_,epn,matname,mi,&ielas,&icmd,
1465  ncmat_,nstate_,sti,vini,ikboun,ilboun,ener,enern,emeini,
1466  xstaten,eei,enerini,cocon,ncocon,set,nset,istartset,iendset,
1467  ialset,nprint,prlab,prset,qfx,qfn,trab,inotr,ntrans,fmpc,
1468  nelemload,nload,ikmpc,ilmpc,istep,&iinc,springarea,
1469  &reltime,ne,xforc,nforc,thicke,shcon,nshcon,
1470  sideload,xloadact,xloadold,&icfd,inomat,h0,islavnode,
1471  nslavnode,ntie,ielprop,prop,iactive,energyini,energy,
1472  iponoel,inoel,orname,network,ipobody,xbodyact,ibody);
1473 
1474  memcpy(&vold[0],&v[0],sizeof(double)*mt**nk);
1475 
1476  iout=0;
1477  icmd=0;
1478 // FORTRAN(networkinum,(ipkon,inum,kon,lakon,ne,itg,&ntg));
1479 
1480  ++*kode;
1481  if(*mcs>0){
1482  ptime=*ttime+time;
1483  frdcyc(co,nk,kon,ipkon,lakon,ne,v,stn,inum,nmethod,kode,filab,een,
1484  t1act,fn,&ptime,epn,ielmat,matname,cs,mcs,nkon,enern,xstaten,
1485  nstate_,istep,&iinc,iperturb,ener,mi,output,ithermal,qfn,
1486  ialset,istartset,iendset,trab,inotr,ntrans,orab,ielorien,
1487  norien,stx,veold,&noddiam,set,nset,emn,thicke,jobnamec,ne,
1488  cdn,&mortar,nmat,qfx);
1489  }else{
1490 
1491  ptime=*ttime+time;
1492  frd(co,nk,kon,ipkon,lakon,ne,v,stn,inum,nmethod,
1493  kode,filab,een,t1act,fn,&ptime,epn,ielmat,matname,enern,xstaten,
1494  nstate_,istep,&iinc,ithermal,qfn,&mode,&noddiam,trab,inotr,
1495  ntrans,orab,ielorien,norien,description,ipneigh,neigh,
1496  mi,stx,vr,vi,stnr,stni,vmax,stnmax,&ngraph,veold,ener,ne,
1497  cs,set,nset,istartset,iendset,ialset,eenmax,fnr,fni,emn,
1498  thicke,jobnamec,output,qfx,cdn,&mortar,cdnr,cdni,nmat);
1499 
1500  }
1501 
1502  SFREE(v);SFREE(fn);SFREE(inum);
1503  if(*ithermal>1){SFREE(qfn);}
1504  if(strcmp1(&filab[3741],"EMF ")==0) SFREE(stn);
1505 
1506  }
1507 
1508  /* restoring the distributed loading */
1509 
1510  if(*ithermal==3){
1511  *nload=nloadref;
1512  (*nload_)-=ne2;
1513  RENEW(nelemload,ITG,2**nload);memcpy(&nelemload[0],&nelemloadref[0],sizeof(ITG)*2**nload);
1514  if(*nam>0){
1515  RENEW(iamload,ITG,2**nload);
1516  memcpy(&iamload[0],&iamloadref[0],sizeof(ITG)*2**nload);
1517  }
1518  RENEW(sideload,char,20**nload);memcpy(&sideload[0],&sideloadref[0],sizeof(char)*20**nload);
1519 
1520  /* freeing the temporary fields */
1521 
1522  SFREE(nelemloadref);if(*nam>0){SFREE(iamloadref);};
1523  SFREE(sideloadref);
1524  }
1525 
1526  /* setting the velocity to zero at the end of a quasistatic or stationary
1527  step */
1528 
1529  if(abs(*nmethod)==1){
1530  for(k=0;k<mt**nk;++k){veold[k]=0.;}
1531  }
1532 
1533  /* updating the loading at the end of the step;
1534  important in case the amplitude at the end of the step
1535  is not equal to one */
1536 
1537  for(k=0;k<*nboun;++k){
1538 
1539  /* thermal boundary conditions are updated only if the
1540  step was thermal or thermomechanical */
1541 
1542  if(ndirboun[k]==0){
1543  if(*ithermal<2) continue;
1544 
1545  /* mechanical boundary conditions are updated only
1546  if the step was not thermal or the node is a
1547  network node */
1548 
1549  }else if((ndirboun[k]>0)&&(ndirboun[k]<4)){
1550  node=nodeboun[k];
1551  FORTRAN(nident,(itg,&node,&ntg,&id));
1552  networknode=0;
1553  if(id>0){
1554  if(itg[id-1]==node) networknode=1;
1555  }
1556  if((*ithermal==2)&&(networknode==0)) continue;
1557  }
1558  xbounold[k]=xbounact[k];
1559  }
1560  for(k=0;k<*nforc;++k){xforcold[k]=xforcact[k];}
1561  for(k=0;k<2**nload;++k){xloadold[k]=xloadact[k];}
1562  for(k=0;k<7**nbody;k=k+7){xbodyold[k]=xbodyact[k];}
1563  if(*ithermal==1){
1564  for(k=0;k<*nk;++k){t1old[k]=t1act[k];}
1565  for(k=0;k<*nk;++k){vold[mt*k]=t1act[k];}
1566  }
1567  else if(*ithermal>1){
1568  for(k=0;k<*nk;++k){t1[k]=vold[mt*k];}
1569  if(*ithermal>=3){
1570  for(k=0;k<*nk;++k){t1old[k]=t1act[k];}
1571  }
1572  }
1573 
1574  qaold[0]=qa[0];
1575  qaold[1]=qa[1];
1576 
1577  SFREE(f);
1578  SFREE(b);
1579  SFREE(xbounact);SFREE(xforcact);SFREE(xloadact);SFREE(xbodyact);
1580  if(*nbody>0) SFREE(ipobody);
1581  SFREE(fext);SFREE(ampli);SFREE(xbounini);SFREE(xstiff);
1582  if((*ithermal==1)||(*ithermal>=3)){SFREE(t1act);SFREE(t1ini);}
1583 
1584  if(*ithermal>1){
1585  SFREE(itg);SFREE(ieg);SFREE(kontri);SFREE(nloadtr);
1586  SFREE(nactdog);SFREE(nacteq);SFREE(ineighe);
1587  SFREE(tarea);SFREE(tenv);SFREE(fenv);SFREE(qfx);
1588  SFREE(erad);SFREE(ac);SFREE(bc);SFREE(ipiv);
1589  SFREE(bcr);SFREE(ipivr);SFREE(adview);SFREE(auview);SFREE(adrad);
1590  SFREE(aurad);SFREE(irowrad);SFREE(jqrad);SFREE(icolrad);
1591  if((*mcs>0)&&(ntr>0)){SFREE(inocs);}
1592  if((*network>0)||(ntg>0)){SFREE(iponoel);SFREE(inoel);}
1593  }
1594 
1595  SFREE(fini);
1596  if(*nmethod==4){
1597  SFREE(aux2);SFREE(fextini);SFREE(veini);
1598  SFREE(adb);SFREE(aub);SFREE(cv);SFREE(cvini);
1599  }
1600 
1601  SFREE(aux);SFREE(iaux);SFREE(vini);SFREE(h0ref);SFREE(h0);SFREE(inomat);
1602 
1603  /* reset icascade */
1604 
1605  if(icascade==1){icascade=0;}
1606 
1607  mpcinfo[0]=memmpc_;mpcinfo[1]=mpcfree;mpcinfo[2]=icascade;
1608  mpcinfo[3]=maxlenmpc;
1609 
1610  *icolp=icol;*irowp=irow;*cop=co;*voldp=vold;
1611 
1612  *ipompcp=ipompc;*labmpcp=labmpc;*ikmpcp=ikmpc;*ilmpcp=ilmpc;
1613  *fmpcp=fmpc;*nodempcp=nodempc;*coefmpcp=coefmpc;
1614 
1615  *ipkonp=ipkon;*lakonp=lakon;*konp=kon;*ielorienp=ielorien;
1616  *ielmatp=ielmat;*enerp=ener;*xstatep=xstate;
1617 
1618  *setp=set;*istartsetp=istartset;*iendsetp=iendset;*ialsetp=ialset;
1619  *tiesetp=tieset;*tietolp=tietol;
1620 
1621  *nelemloadp=nelemload;*iamloadp=iamload;
1622  *sideloadp=sideload;
1623 
1624  (*tmin)*=(*tper);
1625  (*tmax)*=(*tper);
1626 
1627  SFREE(nactdofinv);
1628 
1629  if(*nmethod==1){
1630  *nmethod=8;
1631  }else if(*nmethod==4){
1632  *nmethod=9;
1633  }else if(*nmethod==2){
1634  *nmethod=10;
1635  }
1636 
1637  (*ttime)+=(*tper);
1638 
1639  return;
1640 }
subroutine checktime(itpamp, namta, tinc, ttime, amta, tmin, inext, itp, istep, tper)
Definition: checktime.f:21
#define ITGFORMAT
Definition: CalculiX.h:52
void pardiso_main(double *ad, double *au, double *adb, double *aub, double *sigma, double *b, ITG *icol, ITG *irow, ITG *neq, ITG *nzs, ITG *symmetryflag, ITG *inputformat, ITG *jq, ITG *nzs3)
subroutine assigndomtonodes(ne, lakon, ipkon, kon, ielmat, inomat, elcon, ncmat_, ntmat_, mi, ne2)
Definition: assigndomtonodes.f:21
subroutine createtiedsurfs(nodface, ipoface, set, istartset, iendset, ialset, tieset, inomat, ne, ipkon, lakon, kon, ntie, tietol, nalset, nk, nset, iactive)
Definition: createtiedsurfs.f:22
void frd(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne0, double *v, double *stn, ITG *inum, ITG *nmethod, ITG *kode, char *filab, double *een, double *t1, double *fn, double *time, double *epn, ITG *ielmat, char *matname, double *enern, double *xstaten, ITG *nstate_, ITG *istep, ITG *iinc, ITG *ithermal, double *qfn, ITG *mode, ITG *noddiam, double *trab, ITG *inotr, ITG *ntrans, double *orab, ITG *ielorien, ITG *norien, char *description, ITG *ipneigh, ITG *neigh, ITG *mi, double *stx, double *vr, double *vi, double *stnr, double *stni, double *vmax, double *stnmax, ITG *ngraph, double *veold, double *ener, ITG *ne, double *cs, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, double *eenmax, double *fnr, double *fni, double *emn, double *thicke, char *jobnamec, char *output, double *qfx, double *cdn, ITG *mortar, double *cdnr, double *cdni, ITG *nmat)
Definition: frd.c:32
void mafillsmmain(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, ITG *nmpc, ITG *nodeforc, ITG *ndirforc, double *xforc, ITG *nforc, ITG *nelemload, char *sideload, double *xload, ITG *nload, double *xbody, ITG *ipobody, ITG *nbody, double *cgr, double *ad, double *au, double *bb, ITG *nactdof, ITG *icol, ITG *jq, ITG *irow, ITG *neq, ITG *nzl, ITG *nmethod, ITG *ikmpc, ITG *ilmpc, ITG *ikboun, ITG *ilboun, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, double *prestr, ITG *iprestr, double *vold, ITG *iperturb, double *sti, ITG *nzs, double *stx, double *adb, double *aub, ITG *iexpl, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstiff, ITG *npmat_, double *dtime, char *matname, ITG *mi, ITG *ncmat_, ITG *mass, ITG *stiffness, ITG *buckling, ITG *rhs, ITG *intscheme, double *physcon, double *shcon, ITG *nshcon, double *cocon, ITG *ncocon, double *ttime, double *time, ITG *istep, ITG *kinc, ITG *coriolis, ITG *ibody, double *xloadold, double *reltime, double *veold, double *springarea, ITG *nstate_, double *xstateini, double *xstate, double *thicke, ITG *integerglob, double *doubleglob, char *tieset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *ntie, ITG *nasym, double *pslavsurf, double *pmastsurf, ITG *mortar, double *clearini, ITG *ielprop, double *prop, ITG *ne0, double *fnext, ITG *kscale, ITG *iponoel, ITG *inoel, ITG *network)
Definition: mafillsmmain.c:47
void preiter(double *ad, double **aup, double *b, ITG **icolp, ITG **irowp, ITG *neq, ITG *nzs, ITG *isolver, ITG *iperturb)
Definition: preiter.c:23
ITG strcpy1(char *s1, const char *s2, ITG length)
Definition: strcpy1.c:24
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
void prediction_em(double *uam, ITG *nmethod, double *bet, double *gam, double *dtime, ITG *ithermal, ITG *nk, double *veold, double *v, ITG *iinc, ITG *idiscon, double *vold, ITG *nactdof, ITG *mi)
Definition: prediction_em.c:33
void calcresidual_em(ITG *nmethod, ITG *neq, double *b, double *fext, double *f, ITG *iexpl, ITG *nactdof, double *aux1, double *aux2, double *vold, double *vini, double *dtime, double *accold, ITG *nk, double *adb, double *aub, ITG *jq, ITG *irow, ITG *nzl, double *alpha, double *fextini, double *fini, ITG *islavnode, ITG *nslavnode, ITG *mortar, ITG *ntie, double *f_cm, double *f_cs, ITG *mi, ITG *nzs, ITG *nasym, ITG *ithermal)
Definition: calcresidual_em.c:33
ITG strcmp1(const char *s1, const char *s2)
Definition: strcmp1.c:24
void tiedcontact(ITG *ntie, char *tieset, ITG *nset, char *set, ITG *istartset, ITG *iendset, ITG *ialset, char *lakon, ITG *ipkon, ITG *kon, double *tietol, ITG *nmpc, ITG *mpcfree, ITG *memmpc_, ITG **ipompcp, char **labmpcp, ITG **ikmpcp, ITG **ilmpcp, double **fmpcp, ITG **nodempcp, double **coefmpcp, ITG *ithermal, double *co, double *vold, ITG *cfd, ITG *nmpc_, ITG *mi, ITG *nk, ITG *istep, ITG *ikboun, ITG *nboun, char *kind1, char *kind2)
Definition: tiedcontact.c:23
void mastructrad(ITG *ntr, ITG *nloadtr, char *sideload, ITG *ipointerrad, ITG **mast1radp, ITG **irowradp, ITG *nzsrad, ITG *jqrad, ITG *icolrad)
Definition: mastructrad.c:24
subroutine preconditioning(ad, au, b, neq, irow, jq, adaux)
Definition: preconditioning.f:22
subroutine tempload(xforcold, xforc, xforcact, iamforc, nforc, xloadold, xload, xloadact, iamload, nload, ibody, xbody, nbody, xbodyold, xbodyact, t1old, t1, t1act, iamt1, nk, amta, namta, nam, ampli, time, reltime, ttime, dtime, ithermal, nmethod, xbounold, xboun, xbounact, iamboun, nboun, nodeboun, ndirboun, nodeforc, ndirforc, istep, iinc, co, vold, itg, ntg, amname, ikboun, ilboun, nelemload, sideload, mi, ntrans, trab, inotr, veold, integerglob, doubleglob, tieset, istartset, iendset, ialset, ntie, nmpc, ipompc, ikmpc, ilmpc, nodempc, coefmpc, ipobody, iponoel, inoel)
Definition: tempload.f:29
#define DMEMSET(a, b, c, d)
Definition: CalculiX.h:45
void spooles(double *ad, double *au, double *adb, double *aub, double *sigma, double *b, ITG *icol, ITG *irow, ITG *neq, ITG *nzs, ITG *symmtryflag, ITG *inputformat, ITG *nzs3)
subroutine stop()
Definition: stop.f:20
void radflowload(ITG *itg, ITG *ieg, ITG *ntg, ITG *ntr, double *adrad, double *aurad, double *bcr, ITG *ipivr, double *ac, double *bc, ITG *nload, char *sideload, ITG *nelemload, double *xloadact, char *lakon, ITG *ipiv, ITG *ntmat_, double *vold, double *shcon, ITG *nshcon, ITG *ipkon, ITG *kon, double *co, ITG *kontri, ITG *ntri, ITG *nloadtr, double *tarea, double *tenv, double *physcon, double *erad, double **adviewp, double **auviewp, ITG *nflow, ITG *ikboun, double *xboun, ITG *nboun, ITG *ithermal, ITG *iinc, ITG *iit, double *cs, ITG *mcs, ITG *inocs, ITG *ntrit, ITG *nk, double *fenv, ITG *istep, double *dtime, double *ttime, double *time, ITG *ilboun, ITG *ikforc, ITG *ilforc, double *xforc, ITG *nforc, double *cam, ITG *ielmat, ITG *nteq, double *prop, ITG *ielprop, ITG *nactdog, ITG *nacteq, ITG *nodeboun, ITG *ndirboun, ITG *network, double *rhcon, ITG *nrhcon, ITG *ipobody, ITG *ibody, double *xbody, ITG *nbody, ITG *iviewfile, char *jobnamef, double *ctrl, double *xloadold, double *reltime, ITG *nmethod, char *set, ITG *mi, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nset, ITG *ineighe, ITG *nmpc, ITG *nodempc, ITG *ipompc, double *coefmpc, char *labmpc, ITG *iemchange, ITG *nam, ITG *iamload, ITG *jqrad, ITG *irowrad, ITG *nzsrad, ITG *icolrad, ITG *ne, ITG *iaxial, double *qa, double *cocon, ITG *ncocon, ITG *iponoel, ITG *inoel, ITG *nprop, char *amname, ITG *namta, double *amta)
Definition: radflowload.c:45
void tau(double *ad, double **aup, double *adb, double *aubp, double *sigma, double *b, ITG *icol, ITG **irowp, ITG *neq, ITG *nzs)
subroutine createinterfacempcs(imastnode, xmastnor, nmastnode, ikmpc, ilmpc, nmpc, ipompc, nodempc, coefmpc, labmpc, mpcfree, ikboun, nboun)
Definition: createinterfacempcs.f:22
void radcyc(ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, double *cs, ITG *mcs, ITG *nkon, ITG *ialset, ITG *istartset, ITG *iendset, ITG **kontrip, ITG *ntri, double **cop, double **voldp, ITG *ntrit, ITG *inocs, ITG *mi)
Definition: radcyc.c:24
void sgi_main(double *ad, double *au, double *adb, double *aub, double *sigma, double *b, ITG *icol, ITG *irow, ITG *neq, ITG *nzs, ITG token)
#define RENEW(a, b, c)
Definition: CalculiX.h:40
subroutine tempload_em(xforcold, xforc, xforcact, iamforc, nforc, xloadold, xload, xloadact, iamload, nload, ibody, xbody, nbody, xbodyold, xbodyact, t1old, t1, t1act, iamt1, nk, amta, namta, nam, ampli, time, reltime, ttime, dtime, ithermal, nmethod, xbounold, xboun, xbounact, iamboun, nboun, nodeboun, ndirboun, nodeforc, ndirforc, istep, iinc, co, vold, itg, ntg, amname, ikboun, ilboun, nelemload, sideload, mi, ntrans, trab, inotr, veold, integerglob, doubleglob, tieset, istartset, iendset, ialset, ntie, nmpc, ipompc, ikmpc, ilmpc, nodempc, coefmpc, h0scale, inomat, ipobody, iponoel, inoel)
Definition: tempload_em.f:29
#define SFREE(a)
Definition: CalculiX.h:41
subroutine gennactdofinv(nactdof, nactdofinv, nk, mi, nodorig, ipkon, lakon, kon, ne)
Definition: gennactdofinv.f:21
subroutine calch0interface(nmpc, ipompc, nodempc, coefmpc, h0)
Definition: calch0interface.f:27
void frdcyc(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, double *v, double *stn, ITG *inum, ITG *nmethod, ITG *kode, char *filab, double *een, double *t1, double *fn, double *time, double *epn, ITG *ielmat, char *matname, double *cs, ITG *mcs, ITG *nkon, double *enern, double *xstaten, ITG *nstate_, ITG *istep, ITG *iinc, ITG *iperturb, double *ener, ITG *mi, char *output, ITG *ithermal, double *qfn, ITG *ialset, ITG *istartset, ITG *iendset, double *trab, ITG *inotr, ITG *ntrans, double *orab, ITG *ielorien, ITG *norien, double *sti, double *veold, ITG *noddiam, char *set, ITG *nset, double *emn, double *thicke, char *jobnamec, ITG *ne0, double *cdn, ITG *mortar, ITG *nmat, double *qfx)
Definition: frdcyc.c:24
void resultsinduction(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, double *v, double *stn, ITG *inum, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, double *prestr, ITG *iprestr, char *filab, double *eme, double *emn, double *een, ITG *iperturb, double *f, double *fn, ITG *nactdof, ITG *iout, double *qa, double *vold, double *b, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, char *labmpc, ITG *nmpc, ITG *nmethod, double *vmax, ITG *neq, double *veold, double *accold, double *beta, double *gamma, double *dtime, double *time, double *ttime, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstateini, double *xstiff, double *xstate, ITG *npmat_, double *epl, char *matname, ITG *mi, ITG *ielas, ITG *icmd, ITG *ncmat_, ITG *nstate_, double *sti, double *vini, ITG *ikboun, ITG *ilboun, double *ener, double *enern, double *emeini, double *xstaten, double *eei, double *enerini, double *cocon, ITG *ncocon, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nprint, char *prlab, char *prset, double *qfx, double *qfn, double *trab, ITG *inotr, ITG *ntrans, double *fmpc, ITG *nelemload, ITG *nload, ITG *ikmpc, ITG *ilmpc, ITG *istep, ITG *iinc, double *springarea, double *reltime, ITG *ne0, double *xforc, ITG *nforc, double *thicke, double *shcon, ITG *nshcon, char *sideload, double *xload, double *xloadold, ITG *icfd, ITG *inomat, double *h0, ITG *islavnode, ITG *nslavnode, ITG *ntie, ITG *ielprop, double *prop, ITG *iactive, double *energyini, double *energy, ITG *iponoel, ITG *inoel, char *orname, ITG *network, ITG *ipobody, double *xbody, ITG *ibody)
Definition: resultsinduction.c:42
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, ITG *network)
Definition: remastruct.c:24
static double * adview
Definition: radflowload.c:42
subroutine nident(x, px, n, id)
Definition: nident.f:26
real *8 function f_cm(x, phi, lambda1, zk0, Pup, Tup, rurd, xflow, kup)
Definition: moehring.f:582
subroutine envtemp(itg, ieg, ntg, ntr, sideload, nelemload, ipkon, kon, lakon, ielmat, ne, nload, kontri, ntri, nloadtr, nflow, ndirboun, nactdog, nodeboun, nacteq, nboun, ielprop, prop, nteq, v, network, physcon, shcon, ntmat_, co, vold, set, nshcon, rhcon, nrhcon, mi, nmpc, nodempc, ipompc, labmpc, ikboun, nasym, ttime, time, iaxial)
Definition: envtemp.f:25
void remastructem(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 *ielmat, double *elcon, ITG *ncmat_, ITG *ntmat_, ITG *inomat, ITG *network)
Definition: remastructem.c:24
subroutine createinum(ipkon, inum, kon, lakon, nk, ne, cflag, nelemload, nload, nodeboun, nboun, ndirboun, ithermal, co, vold, mi, ielmat)
Definition: createinum.f:21
subroutine jouleheating(ipkon, lakon, kon, co, elcon, nelcon, mi, ne, sti, ielmat, nelemload, sideload, xload, nload, nload_, iamload, nam, idefload, ncmat_, ntmat_, alcon, nalcon, ithermal, vold, t1)
Definition: jouleheating.f:23
void biosav(ITG *ipkon, ITG *kon, char *lakon, ITG *ne, double *co, double *qfx, double *h0, ITG *mi, ITG *inomat, ITG *nk)
Definition: biosav.c:31
subroutine networkelementpernode(iponoel, inoel, lakon, ipkon, kon, inoelsize, nflow, ieg, ne, network)
Definition: networkelementpernode.f:21
subroutine generateeminterfaces(istartset, iendset, ialset, iactive, ipkon, lakon, kon, ikmpc, nmpc, nafaces)
Definition: generateeminterfaces.f:21
void checkconvergence(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, double *stn, ITG *nmethod, ITG *kode, char *filab, double *een, double *t1act, double *time, double *epn, ITG *ielmat, char *matname, double *enern, double *xstaten, ITG *nstate_, ITG *istep, ITG *iinc, ITG *iperturb, double *ener, ITG *mi, char *output, ITG *ithermal, double *qfn, ITG *mode, ITG *noddiam, double *trab, ITG *inotr, ITG *ntrans, double *orab, ITG *ielorien, ITG *norien, char *description, double *sti, ITG *icutb, ITG *iit, double *dtime, double *qa, double *vold, double *qam, double *ram1, double *ram2, double *ram, double *cam, double *uam, ITG *ntg, double *ttime, ITG *icntrl, double *theta, double *dtheta, double *veold, double *vini, ITG *idrct, double *tper, ITG *istab, double *tmax, ITG *nactdof, double *b, double *tmin, double *ctrl, double *amta, ITG *namta, ITG *itpamp, ITG *inext, double *dthetaref, ITG *itp, ITG *jprint, ITG *jout, ITG *uncoupled, double *t1, ITG *iitterm, ITG *nelemload, ITG *nload, ITG *nodeboun, ITG *nboun, ITG *itg, ITG *ndirboun, double *deltmx, ITG *iflagact, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, double *emn, double *thicke, char *jobnamec, ITG *mortar, ITG *nmat, ITG *ielprop, double *prop, ITG *ialeatoric, ITG *kscale, double *energy, double *allwk, double *energyref, double *emax, double *enres, double *enetoll, double *energyini, double *allwkini, double *temax, double *reswk, ITG *ne0, ITG *neini, double *dampwk, double *dampwkini, double *energystartstep)
Definition: checkconvergence.c:34
#define ITG
Definition: CalculiX.h:51
void results(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, double *v, double *stn, ITG *inum, double *stx, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, double *prestr, ITG *iprestr, char *filab, double *eme, double *emn, double *een, ITG *iperturb, double *f, double *fn, ITG *nactdof, ITG *iout, double *qa, double *vold, double *b, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, char *labmpc, ITG *nmpc, ITG *nmethod, double *vmax, ITG *neq, double *veold, double *accold, double *beta, double *gamma, double *dtime, double *time, double *ttime, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstateini, double *xstiff, double *xstate, ITG *npmat_, double *epl, char *matname, ITG *mi, ITG *ielas, ITG *icmd, ITG *ncmat_, ITG *nstate_, double *stiini, double *vini, ITG *ikboun, ITG *ilboun, double *ener, double *enern, double *emeini, double *xstaten, double *eei, double *enerini, double *cocon, ITG *ncocon, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nprint, char *prlab, char *prset, double *qfx, double *qfn, double *trab, ITG *inotr, ITG *ntrans, double *fmpc, ITG *nelemload, ITG *nload, ITG *ikmpc, ITG *ilmpc, ITG *istep, ITG *iinc, double *springarea, double *reltime, ITG *ne0, double *xforc, ITG *nforc, double *thicke, double *shcon, ITG *nshcon, char *sideload, double *xload, double *xloadold, ITG *icfd, ITG *inomat, double *pslavsurf, double *pmastsurf, ITG *mortar, ITG *islavact, double *cdn, ITG *islavnode, ITG *nslavnode, ITG *ntie, double *clearini, ITG *islavsurf, ITG *ielprop, double *prop, double *energyini, double *energy, ITG *kscale, ITG *iponoel, ITG *inoel, ITG *nener, char *orname, ITG *network, ITG *ipobody, double *xbodyact, ITG *ibody)
Definition: results.c:42
subroutine mafillem(co, nk, kon, ipkon, lakon, ne, nodeboun, ndirboun, xboun, nboun, ipompc, nodempc, coefmpc, nmpc, nodeforc, ndirforc, xforc, nforc, nelemload, sideload, xload, nload, xbody, ipobody, nbody, cgr, ad, au, fext, nactdof, icol, jq, irow, neq, nzl, nmethod, ikmpc, ilmpc, ikboun, ilboun, elcon, nelcon, rhcon, nrhcon, alcon, nalcon, alzero, ielmat, ielorien, norien, orab, ntmat_, t0, t1, ithermal, prestr, iprestr, vold, iperturb, sti, nzs, stx, adb, aub, iexpl, plicon, nplicon, plkcon, nplkcon, xstiff, npmat_, dtime, matname, mi, ncmat_, mass, stiffness, buckling, rhsi, intscheme, physcon, shcon, nshcon, cocon, ncocon, ttime, time, istep, iinc, coriolis, ibody, xloadold, reltime, veold, springarea, nstate_, xstateini, xstate, thicke, integerglob, doubleglob, tieset, istartset, iendset, ialset, ntie, nasym, iactive, h0, pslavsurf, pmastsurf, mortar, clearini, ielprop, prop, iponoel, inoel, network)
Definition: mafillem.f:36
#define NNEW(a, b, c)
Definition: CalculiX.h:39
subroutine bodyforce(cbody, ibody, ipobody, nbody, set, istartset, iendset, ialset, inewton, nset, ifreebody, k)
Definition: bodyforce.f:21
static double * auview
Definition: radflowload.c:42
subroutine normalsoninterface(istartset, iendset, ialset, imast, ipkon, kon, lakon, imastnode, nmastnode, xmastnor, co)
Definition: normalsoninterface.f:22

◆ expand()

void expand ( double *  co,
ITG nk,
ITG kon,
ITG ipkon,
char *  lakon,
ITG ne,
ITG nodeboun,
ITG ndirboun,
double *  xboun,
ITG nboun,
ITG ipompc,
ITG nodempc,
double *  coefmpc,
char *  labmpc,
ITG nmpc,
ITG nodeforc,
ITG ndirforc,
double *  xforc,
ITG nforc,
ITG nelemload,
char *  sideload,
double *  xload,
ITG nload,
ITG nactdof,
ITG neq,
ITG nmethod,
ITG ikmpc,
ITG ilmpc,
ITG ikboun,
ITG ilboun,
double *  elcon,
ITG nelcon,
double *  rhcon,
ITG nrhcon,
double *  alcon,
ITG nalcon,
double *  alzero,
ITG ielmat,
ITG ielorien,
ITG norien,
double *  orab,
ITG ntmat_,
double *  t0,
ITG ithermal,
double *  prestr,
ITG iprestr,
double *  vold,
ITG iperturb,
double *  sti,
ITG nzs,
double *  adb,
double *  aub,
char *  filab,
double *  eme,
double *  plicon,
ITG nplicon,
double *  plkcon,
ITG nplkcon,
double *  xstate,
ITG npmat_,
char *  matname,
ITG mi,
ITG ics,
double *  cs,
ITG mpcend,
ITG ncmat_,
ITG nstate_,
ITG mcs,
ITG nkon,
double *  ener,
char *  jobnamec,
char *  output,
char *  set,
ITG nset,
ITG istartset,
ITG iendset,
ITG ialset,
ITG nprint,
char *  prlab,
char *  prset,
ITG nener,
double *  trab,
ITG inotr,
ITG ntrans,
double *  ttime,
double *  fmpc,
ITG nev,
double **  z,
ITG iamboun,
double *  xbounold,
ITG nsectors,
ITG nm,
ITG icol,
ITG irow,
ITG nzl,
ITG nam,
ITG ipompcold,
ITG nodempcold,
double *  coefmpcold,
char *  labmpcold,
ITG nmpcold,
double *  xloadold,
ITG iamload,
double *  t1old,
double *  t1,
ITG iamt1,
double *  xstiff,
ITG **  icolep,
ITG **  jqep,
ITG **  irowep,
ITG isolver,
ITG nzse,
double **  adbep,
double **  aubep,
ITG iexpl,
ITG ibody,
double *  xbody,
ITG nbody,
double *  cocon,
ITG ncocon,
char *  tieset,
ITG ntie,
ITG imddof,
ITG nmddof,
ITG imdnode,
ITG nmdnode,
ITG imdboun,
ITG nmdboun,
ITG imdmpc,
ITG nmdmpc,
ITG **  izdofp,
ITG nzdof,
ITG nherm,
double *  xmr,
double *  xmi,
char *  typeboun,
ITG ielprop,
double *  prop,
char *  orname 
)
66  {
67 
68  /* calls the Arnoldi Package (ARPACK) for cyclic symmetry calculations */
69 
70  char *filabt,*tchar1=NULL,*tchar2=NULL,*tchar3=NULL,lakonl[2]=" \0";
71 
72  ITG *inum=NULL,k,idir,lfin,j,iout=0,index,inode,id,i,idof,im,
73  ielas,icmd,kk,l,nkt,icntrl,imag=1,icomplex,kkv,kk6,iterm,
74  lprev,ilength,ij,i1,i2,iel,ielset,node,indexe,nope,ml1,nelem,
75  *inocs=NULL,*ielcs=NULL,jj,l1,l2,is,nlabel,*nshcon=NULL,
76  nodeleft,*noderight=NULL,numnodes,ileft,kflag=2,itr,locdir,
77  neqh,j1,nodenew,mt=mi[1]+1,istep=1,iinc=1,iit=-1,
78  tint=-1,tnstart=-1,tnend=-1,tint2=-1,network=0,
79  noderight_,*izdof=*izdofp,iload,iforc,*iznode=NULL,nznode,ll,ne0,
80  icfd=0,*inomat=NULL,mortar=0,*islavact=NULL,*ipobody=NULL,
81  *islavnode=NULL,*nslavnode=NULL,*islavsurf=NULL,
82  *iponoel=NULL,*inoel=NULL;
83 
84  long long lint;
85 
86  double *stn=NULL,*v=NULL,*temp_array=NULL,*vini=NULL,*csmass=NULL,
87  *een=NULL,cam[5],*f=NULL,*fn=NULL,qa[4],*epn=NULL,summass,
88  *stiini=NULL,*emn=NULL,*emeini=NULL,*clearini=NULL,
89  *xstateini=NULL,theta,pi,*coefmpcnew=NULL,t[3],ctl,stl,
90  *stx=NULL,*enern=NULL,*xstaten=NULL,*eei=NULL,*enerini=NULL,
91  *qfx=NULL,*qfn=NULL,xreal,ximag,*vt=NULL,sum,
92  *coefright=NULL,coef,a[9],ratio,reltime,
93  *shcon=NULL,*springarea=NULL,*z=*zp, *zdof=NULL, *thicke=NULL,
94  atrab[9],acs[9],diff,fin[3],fout[3],*sumi=NULL,
95  *vti=NULL,*pslavsurf=NULL,*pmastsurf=NULL,*cdn=NULL,
96  *energyini=NULL,*energy=NULL;
97 
98  /* dummy arguments for the results call */
99 
100  double *veold=NULL,*accold=NULL,bet,gam,dtime,time;
101 
102  pi=4.*atan(1.);
103  neqh=neq[1]/2;
104 
105  noderight_=10;
106  NNEW(noderight,ITG,noderight_);
107  NNEW(coefright,double,noderight_);
108 
109  NNEW(v,double,2*mt**nk);
110  NNEW(vt,double,mt**nk**nsectors);
111 
112  NNEW(fn,double,2*mt**nk);
113  NNEW(stn,double,12**nk);
114  NNEW(inum,ITG,*nk);
115  NNEW(stx,double,6*mi[0]**ne);
116 
117  nlabel=47;
118  NNEW(filabt,char,87*nlabel);
119  for(i=1;i<87*nlabel;i++) filabt[i]=' ';
120  filabt[0]='U';
121 
122  NNEW(temp_array,double,neq[1]);
123  NNEW(coefmpcnew,double,*mpcend);
124 
125  nkt=*nsectors**nk;
126 
127  /* assigning nodes and elements to sectors */
128 
129  NNEW(inocs,ITG,*nk);
130  NNEW(ielcs,ITG,*ne);
131  ielset=cs[12];
132  if((*mcs!=1)||(ielset!=0)){
133  for(i=0;i<*nk;i++) inocs[i]=-1;
134  for(i=0;i<*ne;i++) ielcs[i]=-1;
135  }
136  NNEW(csmass,double,*mcs);
137  if(*mcs==1) csmass[0]=1.;
138 
139  for(i=0;i<*mcs;i++){
140  is=cs[17*i];
141  // if(is==1) continue;
142  ielset=cs[17*i+12];
143  if(ielset==0) continue;
144  for(i1=istartset[ielset-1]-1;i1<iendset[ielset-1];i1++){
145  if(ialset[i1]>0){
146  iel=ialset[i1]-1;
147  if(ipkon[iel]<0) continue;
148  ielcs[iel]=i;
149  indexe=ipkon[iel];
150  if(*mcs==1){
151  if(strcmp1(&lakon[8*iel+3],"2")==0)nope=20;
152  else if (strcmp1(&lakon[8*iel+3],"8")==0)nope=8;
153  else if (strcmp1(&lakon[8*iel+3],"10")==0)nope=10;
154  else if (strcmp1(&lakon[8*iel+3],"4")==0)nope=4;
155  else if (strcmp1(&lakon[8*iel+3],"15")==0)nope=15;
156  else if (strcmp1(&lakon[8*iel+3],"6")==0)nope=6;
157  else if (strcmp1(&lakon[8*iel],"ES")==0){
158  lakonl[0]=lakon[8*iel+7];
159  nope=atoi(lakonl)+1;}
160  else continue;
161  }else{
162  nelem=iel+1;
163  FORTRAN(calcmass,(ipkon,lakon,kon,co,mi,&nelem,ne,thicke,
164  ielmat,&nope,t0,t1,rhcon,nrhcon,ntmat_,
165  ithermal,&csmass[i],ielprop,prop));
166  }
167  for(i2=0;i2<nope;++i2){
168  node=kon[indexe+i2]-1;
169  inocs[node]=i;
170  }
171  }
172  else{
173  iel=ialset[i1-2]-1;
174  do{
175  iel=iel-ialset[i1];
176  if(iel>=ialset[i1-1]-1) break;
177  if(ipkon[iel]<0) continue;
178  ielcs[iel]=i;
179  indexe=ipkon[iel];
180  if(*mcs==1){
181  if(strcmp1(&lakon[8*iel+3],"2")==0)nope=20;
182  else if (strcmp1(&lakon[8*iel+3],"8")==0)nope=8;
183  else if (strcmp1(&lakon[8*iel+3],"10")==0)nope=10;
184  else if (strcmp1(&lakon[8*iel+3],"4")==0)nope=4;
185  else if (strcmp1(&lakon[8*iel+3],"15")==0)nope=15;
186  else {nope=6;}
187  }else{
188  nelem=iel+1;
189  FORTRAN(calcmass,(ipkon,lakon,kon,co,mi,&nelem,ne,thicke,
190  ielmat,&nope,t0,t1,rhcon,nrhcon,ntmat_,
191  ithermal,&csmass[i],ielprop,prop));
192  }
193  for(i2=0;i2<nope;++i2){
194  node=kon[indexe+i2]-1;
195  inocs[node]=i;
196  }
197  }while(1);
198  }
199  }
200 // printf("expand.c mass = %" ITGFORMAT ",%e\n",i,csmass[i]);
201  }
202 
203  /* copying imdnode into iznode
204  iznode contains the nodes in which output is requested and
205  the nodes in which loading is applied */
206 
207  NNEW(iznode,ITG,*nk);
208  for(j=0;j<*nmdnode;j++){iznode[j]=imdnode[j];}
209  nznode=*nmdnode;
210 
211 /* expanding imddof, imdnode, imdboun and imdmpc */
212 
213  for(i=1;i<*nsectors;i++){
214  for(j=0;j<*nmddof;j++){
215  imddof[i**nmddof+j]=imddof[j]+i*neqh;
216  }
217  for(j=0;j<*nmdnode;j++){
218  imdnode[i**nmdnode+j]=imdnode[j]+i**nk;
219  }
220  for(j=0;j<*nmdboun;j++){
221  imdboun[i**nmdboun+j]=imdboun[j]+i**nboun;
222  }
223  for(j=0;j<*nmdmpc;j++){
224  imdmpc[i**nmdmpc+j]=imdmpc[j]+i**nmpc;
225  }
226  }
227  (*nmddof)*=(*nsectors);
228  (*nmdnode)*=(*nsectors);
229  (*nmdboun)*=(*nsectors);
230  (*nmdmpc)*=(*nsectors);
231 
232 /* creating a field with the degrees of freedom in which the eigenmodes
233  are needed:
234  1. all dofs in which the solution is needed (=imddof)
235  2. all dofs in which loading was applied
236  */
237 
238  NNEW(izdof,ITG,neqh**nsectors);
239  for(j=0;j<*nmddof;j++){izdof[j]=imddof[j];}
240  *nzdof=*nmddof;
241 
242  /* generating the coordinates for the other sectors */
243 
244  icntrl=1;
245 
246  FORTRAN(rectcyl,(co,v,fn,stn,qfn,een,cs,nk,&icntrl,t,filabt,&imag,mi,emn));
247 
248  for(jj=0;jj<*mcs;jj++){
249  is=(ITG)(cs[17*jj]+0.5);
250  for(i=1;i<is;i++){
251 
252  theta=i*2.*pi/cs[17*jj];
253 
254  for(l=0;l<*nk;l++){
255  if(inocs[l]==jj){
256  co[3*l+i*3**nk]=co[3*l];
257  co[1+3*l+i*3**nk]=co[1+3*l]+theta;
258  co[2+3*l+i*3**nk]=co[2+3*l];
259  if(*ntrans>0) inotr[2*l+i*2**nk]=inotr[2*l];
260  }
261  }
262  for(l=0;l<*nkon;l++){kon[l+i**nkon]=kon[l]+i**nk;}
263  for(l=0;l<*ne;l++){
264  if(ielcs[l]==jj){
265  if(ipkon[l]>=0){
266  ipkon[l+i**ne]=ipkon[l]+i**nkon;
267  ielmat[mi[2]*(l+i**ne)]=ielmat[mi[2]*l];
268  if(*norien>0) ielorien[l+i**ne]=ielorien[l];
269  for(l1=0;l1<8;l1++){
270  l2=8*l+l1;
271  lakon[l2+i*8**ne]=lakon[l2];
272  }
273  }else{
274  ipkon[l+i**ne]=ipkon[l];
275  }
276  }
277  }
278  }
279  }
280 
281  icntrl=-1;
282 
283  FORTRAN(rectcyl,(co,vt,fn,stn,qfn,een,cs,&nkt,&icntrl,t,filabt,&imag,mi,emn));
284 
285 /* expand nactdof */
286 
287  for(i=1;i<*nsectors;i++){
288  lint=i*mt**nk;
289  for(j=0;j<mt**nk;j++){
290  if(nactdof[j]>0){
291  nactdof[lint+j]=nactdof[j]+i*neqh;
292  }else{
293  nactdof[lint+j]=0;
294  }
295  }
296  }
297 
298 /* copying the boundary conditions
299  (SPC's must be defined in cylindrical coordinates) */
300 
301  for(i=1;i<*nsectors;i++){
302  for(j=0;j<*nboun;j++){
303  nodeboun[i**nboun+j]=nodeboun[j]+i**nk;
304  ndirboun[i**nboun+j]=ndirboun[j];
305  xboun[i**nboun+j]=xboun[j];
306  xbounold[i**nboun+j]=xbounold[j];
307  if(*nam>0) iamboun[i**nboun+j]=iamboun[j];
308  ikboun[i**nboun+j]=ikboun[j]+8*i**nk;
309  ilboun[i**nboun+j]=ilboun[j]+i**nboun;
310  }
311  }
312 
313  /* distributed loads */
314 
315  for(i=0;i<*nload;i++){
316  if(nelemload[2*i+1]<*nsectors){
317  nelemload[2*i]+=*ne*nelemload[2*i+1];
318  }else{
319  nelemload[2*i]+=*ne*(nelemload[2*i+1]-(*nsectors));
320  }
321  iload=i+1;
322  FORTRAN(addizdofdload,(nelemload,sideload,ipkon,kon,lakon,
323  nactdof,izdof,nzdof,mi,&iload,iznode,&nznode,nk,
324  imdnode,nmdnode));
325  }
326 
327  /* body loads */
328 
329  if(*nbody>0){
330  printf("*ERROR in expand: body loads are not allowed for modal dynamics\n and steady state dynamics calculations in cyclic symmetric structures\n\n");
331  FORTRAN(stop,());
332  }
333 
334  /* sorting the elements with distributed loads */
335 
336  if(*nload>0){
337  if(*nam>0){
338  FORTRAN(isortiiddc,(nelemload,iamload,xload,xloadold,sideload,nload,&kflag));
339  }else{
340  FORTRAN(isortiddc,(nelemload,xload,xloadold,sideload,nload,&kflag));
341  }
342  }
343 
344  /* point loads */
345 
346 /* for(i=0;i<*nforc;i++){
347  if(nodeforc[2*i+1]<*nsectors){
348  nodeforc[2*i]+=*nk*nodeforc[2*i+1];
349  }else{
350  nodeforc[2*i]+=*nk*(nodeforc[2*i+1]-(*nsectors));
351  }
352  iforc=i+1;
353  FORTRAN(addizdofcload,(nodeforc,ndirforc,nactdof,mi,izdof,
354  nzdof,&iforc,iznode,&nznode,nk,imdnode,nmdnode,xforc));
355  }*/
356 
357  i=0;
358  while(i<*nforc){
359  node=nodeforc[2*i];
360 
361  /* checking for a cylindrical transformation;
362  comparison with the cyclic symmetry system */
363 
364  itr=inotr[2*node-2];
365 
366  if(itr==0){
367 
368  /* carthesian coordinate system */
369 
370  if(nodeforc[2*i+1]<*nsectors){
371  nodeforc[2*i]+=*nk*nodeforc[2*i+1];
372  }else{
373  nodeforc[2*i]+=*nk*(nodeforc[2*i+1]-(*nsectors));
374  }
375  i++;iforc=i;
376  FORTRAN(addizdofcload,(nodeforc,ndirforc,nactdof,mi,izdof,
377  nzdof,&iforc,iznode,&nznode,nk,imdnode,nmdnode,xforc));
378  }else{
379 
380  /* cylindrical coordinate system */
381 
382  FORTRAN(transformatrix,(&trab[7*(itr-1)],&co[3*(node-1)],atrab));
383  FORTRAN(transformatrix,(&cs[5],&co[3*(node-1)],acs));
384  diff=0.; for(j=0;j<9;j++) diff+=(atrab[j]-acs[j])*(atrab[j]-acs[j]);
385 
386  if((ndirforc[i]!=1)||
387  (nodeforc[2*i+2]!=node)||(ndirforc[i+1]!=2)||
388  (nodeforc[2*i+4]!=node)||(ndirforc[i+2]!=3)||
389  ((diff>1.e-10)&&(fabs(diff-8.)>1.e-10))){
390  printf("*ERROR: forces in a modal dynamic or steady state dynamics\n");
391  printf(" calculation with cyclic symmetry must be defined in\n");
392  printf(" the cyclic symmetric cylindrical coordinate system\n");
393  printf(" force at fault is applied in node %" ITGFORMAT "\n",node);
394  FORTRAN(stop,());
395  }
396 
397  /* changing the complete force in the node in the basis sector from
398  the global rectangular system into the cylindrical system */
399 
400  fin[0]=xforc[i];
401  fin[1]=xforc[i+1];
402  fin[2]=xforc[i+2];
403  icntrl=2;
404  FORTRAN(rectcyltrfm,(&node,co,cs,&icntrl,fin,fout));
405 
406  /* new node number (= node number in the target sector) */
407 
408  if(nodeforc[2*i+1]<*nsectors){
409  nodeforc[2*i]+=*nk*nodeforc[2*i+1];
410  }else{
411  nodeforc[2*i]+=*nk*(nodeforc[2*i+1]-(*nsectors));
412  }
413  nodeforc[2*i+2]=nodeforc[2*i];
414  nodeforc[2*i+4]=nodeforc[2*i];
415 
416  /* changing the complete force in the node in the target sector from
417  the cylindrical system into the global rectangular system */
418 
419  node=nodeforc[2*i];
420  fin[0]=fout[0];
421  fin[1]=fout[1];
422  fin[2]=fout[2];
423  icntrl=-2;
424  FORTRAN(rectcyltrfm,(&node,co,cs,&icntrl,fin,fout));
425  xforc[i]=fout[0];
426  xforc[i+1]=fout[1];
427  xforc[i+2]=fout[2];
428 
429  /* storing the node and the dof into iznode and izdof */
430 
431  for(j=0;j<3;j++){
432  i++;iforc=i;
433  FORTRAN(addizdofcload,(nodeforc,ndirforc,nactdof,mi,izdof,
434  nzdof,&iforc,iznode,&nznode,nk,imdnode,nmdnode,xforc));
435  }
436  }
437  }
438 
439  /* loop over all eigenvalues; the loop starts from the highest eigenvalue
440  so that the reuse of z is not a problem
441  z before: real and imaginary part for a segment for all eigenvalues
442  z after: real part for all segments for all eigenvalues */
443 
444  if(*nherm==1){
445  NNEW(zdof,double,(long long)*nev**nzdof);
446  }else{
447  NNEW(zdof,double,(long long)2**nev**nzdof);
448  NNEW(sumi,double,*nev);
449  }
450 
451  lfin=0;
452  for(j=*nev-1;j>-1;--j){
453  lint=2*j*neqh;
454 
455  /* calculating the cosine and sine of the phase angle */
456 
457  for(jj=0;jj<*mcs;jj++){
458  theta=nm[j]*2.*pi/cs[17*jj];
459  cs[17*jj+14]=cos(theta);
460  cs[17*jj+15]=sin(theta);
461  }
462 
463  /* generating the cyclic MPC's (needed for nodal diameters
464  different from 0 */
465 
466  NNEW(eei,double,6*mi[0]**ne);
467 
468  DMEMSET(v,0,2*mt**nk,0.);
469 
470  for(k=0;k<2*neqh;k+=neqh){
471 
472  for(i=0;i<6*mi[0]**ne;i++){eme[i]=0.;}
473 
474  if(k==0) {kk=0;kkv=0;kk6=0;}
475  else {kk=*nk;kkv=mt**nk;kk6=6**nk;}
476  for(i=0;i<*nmpc;i++){
477  index=ipompc[i]-1;
478  /* check whether thermal mpc */
479  if(nodempc[3*index+1]==0) continue;
480  coefmpcnew[index]=coefmpc[index];
481  while(1){
482  index=nodempc[3*index+2];
483  if(index==0) break;
484  index--;
485 
486  icomplex=0;
487  inode=nodempc[3*index];
488  if(strcmp1(&labmpc[20*i],"CYCLIC")==0){
489  icomplex=atoi(&labmpc[20*i+6]);}
490  else if(strcmp1(&labmpc[20*i],"SUBCYCLIC")==0){
491  for(ij=0;ij<*mcs;ij++){
492  lprev=cs[ij*17+13];
493  ilength=cs[ij*17+3];
494  FORTRAN(nident,(&ics[lprev],&inode,&ilength,&id));
495  if(id!=0){
496  if(ics[lprev+id-1]==inode){icomplex=ij+1;break;}
497  }
498  }
499  }
500 
501  if(icomplex!=0){
502  idir=nodempc[3*index+1];
503  idof=nactdof[mt*(inode-1)+idir]-1;
504  if(idof<=-1){xreal=1.;ximag=1.;}
505  else{xreal=z[lint+idof];ximag=z[lint+idof+neqh];}
506  if(k==0) {
507  if(fabs(xreal)<1.e-30)xreal=1.e-30;
508  coefmpcnew[index]=coefmpc[index]*
509  (cs[17*(icomplex-1)+14]+
510  ximag/xreal*cs[17*(icomplex-1)+15]);}
511  else {
512  if(fabs(ximag)<1.e-30)ximag=1.e-30;
513  coefmpcnew[index]=coefmpc[index]*
514  (cs[17*(icomplex-1)+14]-
515  xreal/ximag*cs[17*(icomplex-1)+15]);}
516  }
517  else{coefmpcnew[index]=coefmpc[index];}
518  }
519  }
520 
521  results(co,nk,kon,ipkon,lakon,ne,&v[kkv],&stn[kk6],inum,
522  stx,elcon,
523  nelcon,rhcon,nrhcon,alcon,nalcon,alzero,ielmat,ielorien,
524  norien,orab,ntmat_,t0,t0,ithermal,
525  prestr,iprestr,filab,eme,&emn[kk6],&een[kk6],iperturb,
526  f,&fn[kkv],nactdof,&iout,qa,vold,&z[lint+k],
527  nodeboun,ndirboun,xboun,nboun,ipompc,
528  nodempc,coefmpcnew,labmpc,nmpc,nmethod,cam,&neqh,veold,accold,
529  &bet,&gam,&dtime,&time,ttime,plicon,nplicon,plkcon,nplkcon,
530  xstateini,xstiff,xstate,npmat_,epn,matname,mi,&ielas,&icmd,
531  ncmat_,nstate_,stiini,vini,ikboun,ilboun,ener,&enern[kk],emeini,
532  xstaten,eei,enerini,cocon,ncocon,set,nset,istartset,iendset,
533  ialset,nprint,prlab,prset,qfx,qfn,trab,inotr,ntrans,fmpc,
534  nelemload,nload,ikmpc,ilmpc,&istep,&iinc,springarea,&reltime,
535  &ne0,xforc,nforc,thicke,shcon,nshcon,
536  sideload,xload,xloadold,&icfd,inomat,pslavsurf,pmastsurf,
537  &mortar,islavact,cdn,islavnode,nslavnode,ntie,clearini,
538  islavsurf,ielprop,prop,energyini,energy,&iit,iponoel,
539  inoel,nener,orname,&network,ipobody,xbody,ibody);
540 
541  }
542  SFREE(eei);
543 
544  /* mapping the results to the other sectors */
545 
546  if(*nherm!=1)NNEW(vti,double,mt**nk**nsectors);
547 
548  icntrl=2;imag=1;
549 
550  FORTRAN(rectcylexp,(co,v,fn,stn,qfn,een,cs,nk,&icntrl,t,filabt,&imag,mi,
551  iznode,&nznode,nsectors,nk,emn));
552 
553  /* basis sector */
554 
555  for(ll=0;ll<nznode;ll++){
556  l1=iznode[ll]-1;
557  for(l2=0;l2<mt;l2++){
558  l=mt*l1+l2;
559  vt[l]=v[l];
560  if(*nherm!=1)vti[l]=v[l+mt**nk];
561  }
562  }
563 
564  /* other sectors */
565 
566  for(jj=0;jj<*mcs;jj++){
567  ilength=cs[17*jj+3];
568  lprev=cs[17*jj+13];
569  for(i=1;i<*nsectors;i++){
570 
571  theta=i*nm[j]*2.*pi/cs[17*jj];
572  ctl=cos(theta);
573  stl=sin(theta);
574 
575  for(ll=0;ll<nznode;ll++){
576  l1=iznode[ll]-1;
577  if(inocs[l1]==jj){
578 
579  /* check whether node lies on axis */
580 
581  ml1=-l1-1;
582  FORTRAN(nident,(&ics[lprev],&ml1,&ilength,&id));
583  if(id!=0){
584  if(ics[lprev+id-1]==ml1){
585  for(l2=0;l2<mt;l2++){
586  l=mt*l1+l2;
587  vt[l+mt**nk*i]=v[l];
588  if(*nherm!=1)vti[l+mt**nk*i]=v[l+mt**nk];
589  }
590  continue;
591  }
592  }
593  for(l2=0;l2<mt;l2++){
594  l=mt*l1+l2;
595  vt[l+mt**nk*i]=ctl*v[l]-stl*v[l+mt**nk];
596  if(*nherm!=1)vti[l+mt**nk*i]=stl*v[l]+ctl*v[l+mt**nk];
597  }
598  }
599  }
600  }
601  }
602 
603  icntrl=-2;imag=0;
604 
605  FORTRAN(rectcylexp,(co,vt,fn,stn,qfn,een,cs,&nkt,&icntrl,t,filabt,
606  &imag,mi,iznode,&nznode,nsectors,nk,emn));
607 
608 /* storing the displacements into the expanded eigenvectors */
609 
610  for(ll=0;ll<nznode;ll++){
611  i=iznode[ll]-1;
612 // for(i=0;i<*nk;i++){
613  for(j1=0;j1<mt;j1++){
614 
615  for(k=0;k<*nsectors;k++){
616  /* C-convention */
617  idof=nactdof[mt*(k**nk+i)+j1]-1;
618  if(idof>-1){
619  FORTRAN(nident,(izdof,&idof,nzdof,&id));
620  if(id!=0){
621  if(izdof[id-1]==idof){
622  if(*nherm==1){
623  zdof[(long long)j**nzdof+id-1]=vt[k*mt**nk+mt*i+j1];
624  }else{
625  zdof[(long long)2*j**nzdof+id-1]=vt[k*mt**nk+mt*i+j1];
626  zdof[(long long)(2*j+1)**nzdof+id-1]=vti[k*mt**nk+mt*i+j1];
627  }
628  }
629  }
630  }
631  }
632  }
633  }
634 
635  if(*nherm!=1) SFREE(vti);
636 
637 /* normalizing the eigenvectors with the mass */
638 
639 /* if (nm[j]==0||(nm[j]==(ITG)((cs[0]/2))&&(fmod(cs[0],2.)==0.)))
640  {sum=sqrt(cs[0]);}
641  else{sum=sqrt(cs[0]/2);}*/
642 
643  sum=0.;
644  summass=0.;
645  for(i=0;i<*mcs;i++){
646  if (nm[j]==0||(nm[j]==(ITG)((cs[17*i]/2))&&(fmod(cs[17*i],2.)==0.))){
647  sum+=cs[17*i]*csmass[i];
648  }else{
649  sum+=cs[17*i]*csmass[i]/2.;
650  }
651  summass+=csmass[i];
652  }
653  if(fabs(summass)>1.e-20){
654  sum=sqrt(sum/summass);
655  }else{
656  printf("*ERROR in expand.c: total mass of structure is zero\n");
657  printf(" maybe no element sets were specified for the\n");
658  printf(" cyclic symmetry ties\n");
659  FORTRAN(stop,());
660  }
661 
662  if(*nherm==1){
663  for(i=0;i<*nzdof;i++){zdof[(long long)j**nzdof+i]/=sum;}
664  }else{
665  for(i=0;i<*nzdof;i++){zdof[(long long)(2*j)**nzdof+i]/=sum;}
666  for(i=0;i<*nzdof;i++){zdof[(long long)(2*j+1)**nzdof+i]/=sum;}
667  sumi[j]=sqrt(sum);
668  }
669  }
670 
671 /* copying zdof into z */
672 
673  if(*nherm==1){
674  RENEW(z,double,(long long)*nev**nzdof);
675  memcpy(&z[0],&zdof[0],(long long)sizeof(double)**nev**nzdof);
676  }else{
677  RENEW(z,double,(long long)2**nev**nzdof);
678  memcpy(&z[0],&zdof[0],(long long)sizeof(double)*2**nev**nzdof);
679  for(i=0;i<*nev;i++){
680  for(j=0;j<*nev;j++){
681  xmr[i**nev+j]/=(sumi[i]*sumi[j]);
682  xmi[i**nev+j]/=(sumi[i]*sumi[j]);
683  }
684  }
685  SFREE(sumi);
686  }
687  SFREE(zdof);
688 
689 /* copying the multiple point constraints */
690 
691  *nmpc=0;
692  *mpcend=0;
693  for(i=0;i<*nsectors;i++){
694  if(i==0){
695  ileft=*nsectors-1;
696  }else{
697  ileft=i-1;
698  }
699  for(j=0;j<*nmpcold;j++){
700  if(noderight_>10){
701  noderight_=10;
702  RENEW(noderight,ITG,noderight_);
703  RENEW(coefright,double,noderight_);
704  }
705  ipompc[*nmpc]=*mpcend+1;
706  ikmpc[*nmpc]=ikmpc[j]+8*i**nk;
707  ilmpc[*nmpc]=ilmpc[j]+i**nmpcold;
708  strcpy1(&labmpc[20**nmpc],&labmpcold[20*j],20);
709  if(strcmp1(&labmpcold[20*j],"CYCLIC")==0){
710  index=ipompcold[j]-1;
711  nodeleft=nodempcold[3*index];
712  idir=nodempcold[3*index+1];
713  index=nodempcold[3*index+2]-1;
714  numnodes=0;
715  do{
716  node=nodempcold[3*index];
717  if(nodempcold[3*index+1]==idir){
718  noderight[numnodes]=node;
719  coefright[numnodes]=coefmpcold[index];
720  numnodes++;
721  if(numnodes>=noderight_){
722  noderight_=(ITG)(1.5*noderight_);
723  RENEW(noderight,ITG,noderight_);
724  RENEW(coefright,double,noderight_);
725  }
726  }
727  index=nodempcold[3*index+2]-1;
728  if(index==-1) break;
729  }while(1);
730  if(numnodes>0){
731  sum=0.;
732  for(k=0;k<numnodes;k++){
733  sum+=coefright[k];
734  }
735  for(k=0;k<numnodes;k++){
736  coefright[k]/=sum;
737  }
738  }else{coefright[0]=1.;}
739  nodempc[3**mpcend]=nodeleft+i**nk;
740  nodempc[3**mpcend+1]=idir;
741  nodempc[3**mpcend+2]=*mpcend+2;
742  coefmpc[*mpcend]=1.;
743  for(k=0;k<numnodes;k++){
744  (*mpcend)++;
745  nodempc[3**mpcend]=noderight[k]+ileft**nk;
746  nodempc[3**mpcend+1]=idir;
747  nodempc[3**mpcend+2]=*mpcend+2;
748  coefmpc[*mpcend]=-coefright[k];
749  }
750  nodempc[3**mpcend+2]=0;
751  (*mpcend)++;
752  }else{
753  index=ipompcold[j]-1;
754  iterm=0;
755  do{
756  iterm++;
757  node=nodempcold[3*index];
758  idir=nodempcold[3*index+1];
759  coef=coefmpcold[index];
760 
761  /* check whether SUBCYCLIC MPC: if the current node
762  is an independent node of a CYCLIC MPC, the
763  node in the new MPC should be the cylic previous
764  one */
765 
766  nodenew=node+i**nk;
767  if(strcmp1(&labmpcold[20*j],"SUBCYCLIC")==0){
768  for(ij=0;ij<*mcs;ij++){
769  lprev=cs[ij*17+13];
770  ilength=cs[ij*17+3];
771  FORTRAN(nident,(&ics[lprev],&node,&ilength,&id));
772  if(id!=0){
773  if(ics[lprev+id-1]==node){
774  nodenew=node+ileft**nk;
775  break;
776  }
777  }
778  }
779  }
780 
781  /* modification of the MPC coefficients if
782  cylindrical coordinate system is active
783  it is assumed that all terms in the MPC are
784  either in the radial, the circumferential
785  or axial direction */
786 
787  if(*ntrans<=0){itr=0;}
788  else if(inotr[2*node-2]==0){itr=0;}
789  else{itr=inotr[2*node-2];}
790 
791  if(iterm==1) locdir=-1;
792 
793  if((itr!=0)&&(idir!=0)){
794  if(trab[7*itr-1]<0){
795  FORTRAN(transformatrix,(&trab[7*itr-7],
796  &co[3*node-3],a));
797  if(iterm==1){
798  for(k=0;k<3;k++){
799  if(fabs(a[3*k+idir-1]-coef)<1.e-10){
800  FORTRAN(transformatrix,(&trab[7*itr-7],
801  &co[3*nodenew-3],a));
802  coef=a[3*k+idir-1];
803  locdir=k;
804  break;
805  }
806  if(fabs(a[3*k+idir-1]+coef)<1.e-10){
807  FORTRAN(transformatrix,(&trab[7*itr-7],
808  &co[3*nodenew-3],a));
809  coef=-a[3*k+idir-1];
810  locdir=k;
811  break;
812  }
813  }
814  }else{
815  if(locdir!=-1){
816  if(fabs(a[3*locdir+idir-1])>1.e-10){
817  ratio=coef/a[3*locdir+idir-1];
818  }else{ratio=0.;}
819  FORTRAN(transformatrix,(&trab[7*itr-7],
820  &co[3*nodenew-3],a));
821  coef=ratio*a[3*locdir+idir-1];
822  }
823  }
824  }
825  }
826 
827  nodempc[3**mpcend]=nodenew;
828  nodempc[3**mpcend+1]=idir;
829  coefmpc[*mpcend]=coef;
830  index=nodempcold[3*index+2]-1;
831  if(index==-1) break;
832  nodempc[3**mpcend+2]=*mpcend+2;
833  (*mpcend)++;
834  }while(1);
835  nodempc[3**mpcend+2]=0;
836  (*mpcend)++;
837  }
838  (*nmpc)++;
839  }
840  }
841 
842  /* copying the temperatures */
843 
844  if(*ithermal!=0){
845  for(i=1;i<*nsectors;i++){
846  lint=i**nk;
847  for(j=0;j<*nk;j++){
848  t0[lint+j]=t0[j];
849  t1old[lint+j]=t1old[j];
850  t1[lint+j]=t1[j];
851  }
852  }
853  if(*nam>0){
854  for(i=1;i<*nsectors;i++){
855  lint=i**nk;
856  for(j=0;j<*nk;j++){
857  iamt1[lint+j]=iamt1[j];
858  }
859  }
860  }
861  }
862 
863  /* copying the contact definition */
864 
865  if(*nmethod==4){
866 
867  /* first find the startposition to append the expanded contact fields*/
868 
869  for(j=0; j<*nset; j++){
870  if(iendset[j]>tint){
871  tint=iendset[j];
872  }
873  }
874  tint++;
875  /* now append and expand the contact definitons*/
876  NNEW(tchar1,char,81);
877  NNEW(tchar2,char,81);
878  NNEW(tchar3,char,81);
879  for(i=0; i<*ntie; i++){
880  if(tieset[i*(81*3)+80]=='C'){
881  memcpy(tchar2,&tieset[i*(81*3)+81],81);
882  tchar2[80]='\0';
883  memcpy(tchar3,&tieset[i*(81*3)+81+81],81);
884  tchar3[80]='\0';
885  //a contact constraint was found, so append and expand the information
886  for(j=0; j<*nset; j++){
887  memcpy(tchar1,&set[j*81],81);
888  tchar1[80]='\0';
889  if(strcmp(tchar1,tchar2)==0){
890  /* dependent nodal surface was found,copy the original information first */
891  tnstart=tint;
892  for(k=0; k<iendset[j]-istartset[j]+1; k++){
893  ialset[tint-1]=ialset[istartset[j]-1+k];
894  tint++;
895  }
896  /* now append the expanded information */
897  for(l=1; l<*nsectors; l++){
898  for(k=0; k<iendset[j]-istartset[j]+1; k++){
899  ialset[tint-1]=(ialset[istartset[j]-1+k]!=-1)?ialset[istartset[j]-1+k]+*nk*l:-1;
900  tint++;
901  }
902  }
903  tnend=tint-1;
904  /* now replace the information in istartset and iendset*/
905  istartset[j]=tnstart;
906  iendset[j]=tnend;
907  }
908  else if(strcmp(tchar1,tchar3)==0){
909  /* independent element face surface was found */
910  tnstart=tint;
911  for(k=0; k<iendset[j]-istartset[j]+1; k++){
912  ialset[tint-1]=ialset[istartset[j]-1+k];
913  tint++;
914  }
915  /* now append the expanded information*/
916  for(l=1; l<*nsectors; l++){
917  for(k=0; k<iendset[j]-istartset[j]+1; k++){
918  tint2=((ITG)(ialset[istartset[j]-1+k]))/10;
919  ialset[tint-1]=(ialset[istartset[j]-1+k]!=-1)?(tint2+*ne*l)*10+(ialset[istartset[j]-1+k]-(tint2*10)):-1;
920  tint++;
921  }
922  }
923  tnend=tint-1;
924  /* now replace the information in istartset and iendset*/
925  istartset[j]=tnstart;
926  iendset[j]=tnend;
927  }
928  }
929  }
930  }
931  SFREE(tchar1);
932  SFREE(tchar2);
933  SFREE(tchar3);
934  }
935 
936  *nk=nkt;
937  (*ne)*=(*nsectors);
938  (*nkon)*=(*nsectors);
939  (*nboun)*=(*nsectors);
940  neq[1]=neqh**nsectors;
941 
942  *zp=z;*izdofp=izdof;
943 
944  SFREE(temp_array);SFREE(coefmpcnew);SFREE(noderight);SFREE(coefright);
945  SFREE(v);SFREE(vt);SFREE(fn);SFREE(stn);SFREE(inum);SFREE(stx);
946  SFREE(inocs);SFREE(ielcs);SFREE(filabt);SFREE(iznode);SFREE(csmass);
947 
948  return;
949 }
#define ITGFORMAT
Definition: CalculiX.h:52
subroutine calcmass(ipkon, lakon, kon, co, mi, nelem, ne, thicke, ielmat, nope, t0, t1, rhcon, nrhcon, ntmat_, ithermal, csmasstot, ielprop, prop)
Definition: calcmass.f:22
ITG strcpy1(char *s1, const char *s2, ITG length)
Definition: strcpy1.c:24
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
ITG strcmp1(const char *s1, const char *s2)
Definition: strcmp1.c:24
#define DMEMSET(a, b, c, d)
Definition: CalculiX.h:45
subroutine stop()
Definition: stop.f:20
subroutine transformatrix(xab, p, a)
Definition: transformatrix.f:20
subroutine rectcylexp(co, v, fn, stn, qfn, een, cs, nkt, icntrl, t, filab, imag, mi, iznode, nznode, nsectors, nk, emn)
Definition: rectcylexp.f:21
#define RENEW(a, b, c)
Definition: CalculiX.h:40
#define SFREE(a)
Definition: CalculiX.h:41
subroutine addizdofcload(nodeforc, ndirforc, nactdof, mi, izdof, nzdof, iforc, iznode, nznode, nk, imdnode, nmdnode, xforc)
Definition: addizdofcload.f:21
subroutine nident(x, px, n, id)
Definition: nident.f:26
subroutine isortiiddc(ix1, ix2, dy1, dy2, cy, n, kflag)
Definition: isortiiddc.f:6
subroutine isortiddc(ix, dy1, dy2, cy, n, kflag)
Definition: isortiddc.f:6
subroutine rectcyltrfm(node, co, cs, icntrl, fin, fout)
Definition: rectcyltrfm.f:20
#define ITG
Definition: CalculiX.h:51
void results(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, double *v, double *stn, ITG *inum, double *stx, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, double *prestr, ITG *iprestr, char *filab, double *eme, double *emn, double *een, ITG *iperturb, double *f, double *fn, ITG *nactdof, ITG *iout, double *qa, double *vold, double *b, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, char *labmpc, ITG *nmpc, ITG *nmethod, double *vmax, ITG *neq, double *veold, double *accold, double *beta, double *gamma, double *dtime, double *time, double *ttime, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstateini, double *xstiff, double *xstate, ITG *npmat_, double *epl, char *matname, ITG *mi, ITG *ielas, ITG *icmd, ITG *ncmat_, ITG *nstate_, double *stiini, double *vini, ITG *ikboun, ITG *ilboun, double *ener, double *enern, double *emeini, double *xstaten, double *eei, double *enerini, double *cocon, ITG *ncocon, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nprint, char *prlab, char *prset, double *qfx, double *qfn, double *trab, ITG *inotr, ITG *ntrans, double *fmpc, ITG *nelemload, ITG *nload, ITG *ikmpc, ITG *ilmpc, ITG *istep, ITG *iinc, double *springarea, double *reltime, ITG *ne0, double *xforc, ITG *nforc, double *thicke, double *shcon, ITG *nshcon, char *sideload, double *xload, double *xloadold, ITG *icfd, ITG *inomat, double *pslavsurf, double *pmastsurf, ITG *mortar, ITG *islavact, double *cdn, ITG *islavnode, ITG *nslavnode, ITG *ntie, double *clearini, ITG *islavsurf, ITG *ielprop, double *prop, double *energyini, double *energy, ITG *kscale, ITG *iponoel, ITG *inoel, ITG *nener, char *orname, ITG *network, ITG *ipobody, double *xbodyact, ITG *ibody)
Definition: results.c:42
subroutine addizdofdload(nelemload, sideload, ipkon, kon, lakon, nactdof, izdof, nzdof, mi, iload, iznode, nznode, nk, imdnode, nmdnode)
Definition: addizdofdload.f:21
#define NNEW(a, b, c)
Definition: CalculiX.h:39
subroutine rectcyl(co, v, fn, stn, qfn, een, cs, n, icntrl, t, filab, imag, mi, emn)
Definition: rectcyl.f:21

◆ filtermain()

void filtermain ( double *  co,
double *  dgdxglob,
ITG nobject,
ITG nk,
ITG nodedesi,
ITG ndesi,
char *  objectset 
)
51  {
52 
53  /* filtering the sensitivities */
54 
55  ITG *nx=NULL,*ny=NULL,*nz=NULL,i,*ithread=NULL;
56 
57  double *xo=NULL,*yo=NULL,*zo=NULL,*x=NULL,*y=NULL,*z=NULL;
58 
59  /* if no radius is defined no filtering is performed
60  the radius applies to all objective functions */
61 
62  if(*nobject==0){return;}
63  if(strcmp1(&objectset[81]," ")==0){
64  for(i=1;i<2**nk**nobject;i=i+2){
65  dgdxglob[i]=dgdxglob[i-1];
66  }
67  return;
68  }
69 
70  /* prepare for near3d_se */
71 
72  NNEW(xo,double,*ndesi);
73  NNEW(yo,double,*ndesi);
74  NNEW(zo,double,*ndesi);
75  NNEW(x,double,*ndesi);
76  NNEW(y,double,*ndesi);
77  NNEW(z,double,*ndesi);
78  NNEW(nx,ITG,*ndesi);
79  NNEW(ny,ITG,*ndesi);
80  NNEW(nz,ITG,*ndesi);
81 
82  FORTRAN(prefilter,(co,nodedesi,ndesi,xo,yo,zo,x,y,z,nx,ny,nz));
83 
84  /* variables for multithreading procedure */
85 
86  ITG sys_cpus;
87  char *env,*envloc,*envsys;
88 
89  num_cpus = 0;
90  sys_cpus=0;
91 
92  /* explicit user declaration prevails */
93 
94  envsys=getenv("NUMBER_OF_CPUS");
95  if(envsys){
96  sys_cpus=atoi(envsys);
97  if(sys_cpus<0) sys_cpus=0;
98  }
99 
100  /* automatic detection of available number of processors */
101 
102  if(sys_cpus==0){
103  sys_cpus = getSystemCPUs();
104  if(sys_cpus<1) sys_cpus=1;
105  }
106 
107  /* local declaration prevails, if strictly positive */
108 
109  envloc = getenv("CCX_NPROC_FILTER");
110  if(envloc){
111  num_cpus=atoi(envloc);
112  if(num_cpus<0){
113  num_cpus=0;
114  }else if(num_cpus>sys_cpus){
115  num_cpus=sys_cpus;
116  }
117 
118  }
119 
120  /* else global declaration, if any, applies */
121 
122  env = getenv("OMP_NUM_THREADS");
123  if(num_cpus==0){
124  if (env)
125  num_cpus = atoi(env);
126  if (num_cpus < 1) {
127  num_cpus=1;
128  }else if(num_cpus>sys_cpus){
129  num_cpus=sys_cpus;
130  }
131  }
132 
133  /* check that the number of cpus does not supercede the number
134  of design variables */
135 
136  if(*ndesi<num_cpus) num_cpus=*ndesi;
137 
138  pthread_t tid[num_cpus];
139 
140  NNEW(neighbor1,ITG,num_cpus*(*ndesi+6));
141  NNEW(r1,double,num_cpus*(*ndesi+6));
142 
143  dgdxglob1=dgdxglob;nobject1=nobject;nk1=nk;nodedesi1=nodedesi;
144  ndesi1=ndesi;objectset1=objectset;xo1=xo;yo1=yo;zo1=zo;
145  x1=x;yy1=y;z1=z;nx1=nx;ny1=ny;nz1=nz;
146 
147  /* filtering */
148 
149  printf(" Using up to %" ITGFORMAT " cpu(s) for filtering the sensitivities.\n\n", num_cpus);
150 
151  /* create threads and wait */
152 
153  NNEW(ithread,ITG,num_cpus);
154  for(i=0; i<num_cpus; i++) {
155  ithread[i]=i;
156  pthread_create(&tid[i], NULL, (void *)filtermt, (void *)&ithread[i]);
157  }
158  for(i=0; i<num_cpus; i++) pthread_join(tid[i], NULL);
159 
160  SFREE(neighbor1);SFREE(r1);SFREE(xo);SFREE(yo);SFREE(zo);
161  SFREE(x);SFREE(y);SFREE(z);SFREE(nx);SFREE(ny);SFREE(nz);
162  SFREE(ithread);
163 
164  /* postprocessing the filtered results */
165 
166 // FORTRAN(postfilter,(dgdxglob,nobject,nk,nodedesi,ndesi));
167 
168  return;
169 
170 }
static ITG * ndesi1
Definition: filtermain.c:39
static ITG * nx1
Definition: filtermain.c:39
#define ITGFORMAT
Definition: CalculiX.h:52
static double * yy1
Definition: filtermain.c:48
static double * zo1
Definition: filtermain.c:48
void * filtermt(ITG *i)
Definition: filtermain.c:174
static double * z1
Definition: filtermain.c:48
int pthread_create(pthread_t *thread_id, const pthread_attr_t *attributes, void *(*thread_function)(void *), void *arguments)
static double * x1
Definition: filtermain.c:48
static double * dgdxglob1
Definition: filtermain.c:48
static ITG * nz1
Definition: filtermain.c:39
static ITG * nobject1
Definition: filtermain.c:39
static ITG num_cpus
Definition: filtermain.c:39
subroutine prefilter(co, nodedesi, ndesi, xo, yo, zo, x, y, z, nx, ny, nz)
Definition: prefilter.f:21
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
ITG strcmp1(const char *s1, const char *s2)
Definition: strcmp1.c:24
ITG getSystemCPUs()
Definition: getSystemCPUs.c:40
static double * r1
Definition: filtermain.c:48
static ITG * nk1
Definition: filtermain.c:39
static ITG * neighbor1
Definition: filtermain.c:39
#define SFREE(a)
Definition: CalculiX.h:41
static char * objectset1
Definition: filtermain.c:37
static double * xo1
Definition: filtermain.c:48
int pthread_join(pthread_t thread, void **status_ptr)
static ITG * nodedesi1
Definition: filtermain.c:39
#define ITG
Definition: CalculiX.h:51
static ITG * ny1
Definition: filtermain.c:39
#define NNEW(a, b, c)
Definition: CalculiX.h:39
static double * yo1
Definition: filtermain.c:48

◆ filtermt()

void* filtermt ( ITG i)
174  {
175 
176  ITG indexr,ndesia,ndesib,ndesidelta;
177 
178  indexr=*i*(*ndesi1+6);
179 
180  ndesidelta=(ITG)ceil(*ndesi1/(double)num_cpus);
181  ndesia=*i*ndesidelta+1;
182  ndesib=(*i+1)*ndesidelta;
183  if(ndesib>*ndesi1) ndesib=*ndesi1;
184 
185 // printf("i=%" ITGFORMAT ",ntria=%" ITGFORMAT ",ntrib=%" ITGFORMAT "\n",i,ntria,ntrib);
186 // printf("indexad=%" ITGFORMAT ",indexau=%" ITGFORMAT ",indexdi=%" ITGFORMAT "\n",indexad,indexau,indexdi);
187 
189  xo1,yo1,zo1,x1,yy1,z1,nx1,ny1,nz1,&neighbor1[indexr],
190  &r1[indexr],&ndesia,&ndesib));
191 
192  return NULL;
193 }
static ITG * ndesi1
Definition: filtermain.c:39
static ITG * nx1
Definition: filtermain.c:39
static double * yy1
Definition: filtermain.c:48
static double * zo1
Definition: filtermain.c:48
static double * z1
Definition: filtermain.c:48
static double * x1
Definition: filtermain.c:48
static double * dgdxglob1
Definition: filtermain.c:48
static ITG * nz1
Definition: filtermain.c:39
static ITG * nobject1
Definition: filtermain.c:39
static ITG num_cpus
Definition: filtermain.c:39
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
subroutine filter(dgdxglob, nobject, nk, nodedesi, ndesi, objectset, xo, yo, zo, x, y, z, nx, ny, nz, neighbor, r, ndesia, ndesib)
Definition: filter.f:22
static double * r1
Definition: filtermain.c:48
static ITG * nk1
Definition: filtermain.c:39
static ITG * neighbor1
Definition: filtermain.c:39
static char * objectset1
Definition: filtermain.c:37
static double * xo1
Definition: filtermain.c:48
static ITG * nodedesi1
Definition: filtermain.c:39
#define ITG
Definition: CalculiX.h:51
static ITG * ny1
Definition: filtermain.c:39
static double * yo1
Definition: filtermain.c:48

◆ FORTRAN() [1/316]

void FORTRAN ( actideacti  ,
(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne)   
)

◆ FORTRAN() [2/316]

void FORTRAN ( actideactistr  ,
(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *iobject, ITG *ne, ITG *neinset, ITG *iponoel, ITG *inoel, ITG *nepar)   
)

◆ FORTRAN() [3/316]

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)   
)

◆ FORTRAN() [4/316]

void FORTRAN ( addimdnodedload  ,
(ITG *nelemload, char *sideload, ITG *ipkon, ITG *kon, char *lakon, ITG *i, ITG *imdnode, ITG *nmdnode, 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)   
)

◆ FORTRAN() [5/316]

void FORTRAN ( addizdofcload  ,
(ITG *nodeforc, ITG *ndirforc, ITG *nactdof, ITG *mi, ITG *izdof, ITG *nzdof, ITG *i, ITG *iznode, ITG *nznode, ITG *nk, ITG *imdnode, ITG *nmdnode, double *xforc)   
)

◆ FORTRAN() [6/316]

void FORTRAN ( addizdofdload  ,
(ITG *nelemload, char *sideload, ITG *ipkon, ITG *kon, char *lakon, ITG *nactdof, ITG *izdof, ITG *nzdof, ITG *mi, ITG *i, ITG *iznode, ITG *nznode, ITG *nk, ITG *imdnode, ITG *nmdnode)   
)

◆ FORTRAN() [7/316]

void FORTRAN ( adjustcontactnodes  ,
(char *tieset, ITG *ntie, ITG *itietri, double *cg, double *straight, double *co, double *vold, double *xo, double *yo, double *zo, double *x, double *y, double *z, ITG *nx, ITG *ny, ITG *nz, ITG *istep, ITG *iinc, ITG *iit, ITG *mi, ITG *imastop, ITG *nslavnode, ITG *islavnode, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, double *tietol, double *clearini, double *clearslavnode, ITG *itiefac, ITG *ipkon, ITG *kon, char *lakon, ITG *islavsurf)   
)

◆ FORTRAN() [8/316]

void FORTRAN ( allocation  ,
(ITG *nload_, ITG *nforc_, ITG *nboun_, ITG *nk_, ITG *ne_, ITG *nmpc_, ITG *nset_, ITG *nalset_, ITG *nmat_, ITG *ntmat_, ITG *npmat_, ITG *norien_, ITG *nam_, ITG *nprint_, ITG *mi, ITG *ntrans_, char *set, ITG *meminset, ITG *rmeminset, ITG *ncs_, ITG *namtot_, ITG *ncmat_, ITG *memmpc_, ITG *ne1d, ITG *ne2d, ITG *nflow, char *jobnamec, ITG *irstrt, ITG *ithermal, ITG *nener, ITG *nstate_, ITG *istep, char *inpc, ITG *ipoinp, ITG *inp, ITG *ntie_, ITG *nbody_, ITG *nprop_, ITG *ipoinpc, ITG *nevdamp, ITG *npt_, ITG *nslavsm, ITG *nkon_, ITG *mcs, ITG *mortar, ITG *ifacecount, ITG *nintpoint, ITG *infree, ITG *nheading_, ITG *nobject_, ITG *iuel)   
)

◆ FORTRAN() [9/316]

void FORTRAN ( allocont  ,
(ITG *ncont, ITG *ntie, char *tieset, ITG *nset, char *set, ITG *istartset, ITG *iendset, ITG *ialset, char *lakon, ITG *ncone, double *tietol, ITG *ismallsliding, char *kind1, char *kind2, ITG *mortar, ITG *istep)   
)

◆ FORTRAN() [10/316]

void FORTRAN ( applyboun  ,
(ITG *ifaext, ITG *nfaext, ITG *ielfa, ITG *ikboun, ITG *ilboun, ITG *nboun, char *typeboun, ITG *nelemload, ITG *nload, char *sideload, ITG *isolidsurf, ITG *nsolidsurf, ITG *ifabou, ITG *nfabou, ITG *nface, ITG *nodeboun, ITG *ndirboun, ITG *ikmpc, ITG *ilmpc, char *labmpc, ITG *nmpc, ITG *nactdohinv, ITG *compressible, ITG *iatleastonepressurebc, ITG *ipkonf, ITG *kon, ITG *konf, ITG *nblk)   
)

◆ FORTRAN() [11/316]

void FORTRAN ( applympc  ,
(ITG *nface, ITG *ielfa, ITG *is, ITG *ie, ITG *ifabou, ITG *ipompc, double *vfa, double *coefmpc, ITG *nodempc, ITG *ipnei, ITG *neifa, char *labmpc, double *xbounact, ITG *nactdoh, ITG *ifaext, ITG *nfaext)   
)

◆ FORTRAN() [12/316]

void FORTRAN ( applympc_hfa  ,
(ITG *nface, ITG *ielfa, ITG *is, ITG *ie, ITG *ifabou, ITG *ipompc, double *hfa, double *coefmpc, ITG *nodempc, ITG *ipnei, ITG *neifa, char *labmpc, double *xbounact, ITG *nactdoh)   
)

◆ FORTRAN() [13/316]

void FORTRAN ( assigndomtonodes  ,
(ITG *ne, char *lakon, ITG *ipkon, ITG *kon, ITG *ielmat, ITG *inomat, double *elcon, ITG *ncmat_, ITG *ntmat_, ITG *mi, ITG *ne2)   
)

◆ FORTRAN() [14/316]

void FORTRAN ( autocovmatrix  ,
(double *co, double *ad, double *au, ITG *jqs, ITG *irows, ITG *ndesi, ITG *nodedesi, double *physcon)   
)

◆ FORTRAN() [15/316]

void FORTRAN ( basis  ,
(double *x, double *y, double *z, double *xo, double *yo, double *zo, ITG *nx, ITG *ny, ITG *nz, double *planfa, ITG *ifatet, ITG *nktet, ITG *netet, double *field, ITG *nfield, double *cotet, ITG *kontyp, ITG *ipkon, ITG *kon, ITG *iparent, double *xp, double *yp, double *zp, double *value, double *ratio, ITG *iselect, ITG *nselect, ITG *istartset, ITG *iendset, ITG *ialset, ITG *imastset, ITG *ielemnr, ITG *nterms, ITG *konl)   
)

◆ FORTRAN() [16/316]

void FORTRAN ( biotsavart  ,
(ITG *ipkon, ITG *kon, char *lakon, ITG *ne, double *co, double *qfx, double *h0, ITG *mi, ITG *nka, ITG *nkb)   
)

◆ FORTRAN() [17/316]

void FORTRAN ( blockanalysis  ,
(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nblk, ITG *ipkon, ITG *kon, ITG *ielfa, ITG *nodface, ITG *neiel, ITG *neij, ITG *neifa, ITG *ipoface, ITG *ipnei, ITG *konf, ITG *istartblk, ITG *iendblk, ITG *nactdoh, ITG *nblket, ITG *nblkze, ITG *nef, ITG *ielblk, ITG *nk, ITG *nactdohinv)   
)

◆ FORTRAN() [18/316]

void FORTRAN ( bodyforce  ,
(char *cbody, ITG *ibody, ITG *ipobody, ITG *nbody, char *set, ITG *istartset, ITG *iendset, ITG *ialset, ITG *inewton, ITG *nset, ITG *ifreebody, ITG *k)   
)

◆ FORTRAN() [19/316]

void FORTRAN ( calcbody  ,
(ITG *nef, double *body, ITG *ipobody, ITG *ibody, double *xbody, double *coel, double *vel, char *lakon, ITG *nactdohinv)   
)

◆ FORTRAN() [20/316]

void FORTRAN ( calcguesstincf  ,
(ITG *nface, double *dmin, double *vfa, double *umfa, double *cvfa, double *hcfa, ITG *ithermal, double *tincfguess, ITG *compressible)   
)

◆ FORTRAN() [21/316]

void FORTRAN ( calcinitialflux  ,
(double *area, double *vfa, double *xxn, ITG *ipnei, ITG *nef, ITG *neifa, char *lakonf, double *flux  
)

◆ FORTRAN() [22/316]

void FORTRAN ( calccvel  ,
(ITG *nef, double *vel, double *shcon, ITG *nshcon, ITG *ielmatf, ITG *ntmat_, ITG *mi, double *cvel, double *physcon)   
)

◆ FORTRAN() [23/316]

void FORTRAN ( calccvelcomp  ,
(ITG *nef, double *vel, double *shcon, ITG *nshcon, ITG *ielmatf, ITG *ntmat_, ITG *mi, double *cvel, double *physcon)   
)

◆ FORTRAN() [24/316]

void FORTRAN ( calccvfa  ,
(ITG *nface, double *vfa, double *shcon, ITG *nshcon, ITG *ielmatf, ITG *ntmat_, ITG *mi, ITG *ielfa, double *cvfa, double *physcon)   
)

◆ FORTRAN() [25/316]

void FORTRAN ( calccvfacomp  ,
(ITG *nface, double *vfa, double *shcon, ITG *nshcon, ITG *ielmatf, ITG *ntmat_, ITG *mi, ITG *ielfa, double *cvfa, double *physcon)   
)

◆ FORTRAN() [26/316]

void FORTRAN ( calcgamma  ,
(ITG *nface, ITG *ielfa, double *vel, double *gradvel, double *gamma, double *xlet, double *xxn, double *xxj, ITG *ipnei, double *betam, ITG *nef, double *flux  
)

◆ FORTRAN() [27/316]

void FORTRAN ( calcgammak  ,
(ITG *nface, ITG *ielfa, double *vel, double *gradkel, double *gamma, double *xlet, double *xxn, double *xxj, ITG *ipnei, double *betam, ITG *nef, double *flux  
)

◆ FORTRAN() [28/316]

void FORTRAN ( calcgammao  ,
(ITG *nface, ITG *ielfa, double *vel, double *gradoel, double *gamma, double *xlet, double *xxn, double *xxj, ITG *ipnei, double *betam, ITG *nef, double *flux  
)

◆ FORTRAN() [29/316]

void FORTRAN ( calcgammap  ,
(ITG *nface, ITG *ielfa, double *vel, double *gradpel, double *gamma, double *xlet, double *xxn, double *xxj, ITG *ipnei, double *betam, ITG *nef, double *flux  
)

◆ FORTRAN() [30/316]

void FORTRAN ( calcgammat  ,
(ITG *nface, ITG *ielfa, double *vel, double *gradtel, double *gamma, double *xlet, double *xxn, double *xxj, ITG *ipnei, double *betam, ITG *nef, double *flux  
)

◆ FORTRAN() [31/316]

void FORTRAN ( calcgradkel  ,
(ITG *ne, char *lakon, ITG *ipnei, double *vfa, double *area, double *xxn, double *gradkel, ITG *neifa, double *volume)   
)

◆ FORTRAN() [32/316]

void FORTRAN ( calcgradoel  ,
(ITG *ne, char *lakon, ITG *ipnei, double *vfa, double *area, double *xxn, double *gradoel, ITG *neifa, double *volume)   
)

◆ FORTRAN() [33/316]

void FORTRAN ( calcgradpel  ,
(ITG *ne, char *lakon, ITG *ipnei, double *vfa, double *area, double *xxn, double *gradpel, ITG *neifa, double *volume)   
)

◆ FORTRAN() [34/316]

void FORTRAN ( calcgradtel  ,
(ITG *ne, char *lakon, ITG *ipnei, double *vfa, double *area, double *xxn, double *gradtel, ITG *neifa, double *volume)   
)

◆ FORTRAN() [35/316]

void FORTRAN ( calcgradvel  ,
(ITG *ne, char *lakon, ITG *ipnei, double *vfa, double *area, double *xxn, double *gradv, ITG *neifa, double *volume)   
)

◆ FORTRAN() [36/316]

void FORTRAN ( calchcel  ,
(double *vel, double *cocon, ITG *ncocon, ITG *ielmatf, ITG *ntmat_, ITG *mi, double *hcel, ITG *nef)   
)

◆ FORTRAN() [37/316]

void FORTRAN ( calchcfa  ,
(ITG *nface, double *vfa, double *cocon, ITG *ncocon, ITG *ielmatf, ITG *ntmat_, ITG *mi, ITG *ielfa, double *hcfa)   
)

◆ FORTRAN() [38/316]

void FORTRAN ( calch0interface  ,
(ITG *nmpc, ITG *ipompc, ITG *nodempc, double *coefmpc, double *h0)   
)

◆ FORTRAN() [39/316]

void FORTRAN ( calcmac  ,
(ITG *neq, double *z, double *zz, ITG *nev, double *mac, double *maccpx, ITG *istartnmd, ITG *iendnmd, ITG *nmd, ITG *cyclicsymmetry, ITG *neqact, double *bett, double *betm)   
)

◆ FORTRAN() [40/316]

void FORTRAN ( calcmass  ,
(ITG *ipkon, char *lakon, ITG *kon, double *co, ITG *mi, ITG *nelem, ITG *ne, double *thicke, ITG *ielmat, ITG *nope, double *t0, double *t1, double *rhcon, ITG *nrhcon, ITG *ntmat_, ITG *ithermal, double *csmass, ITG *ielprop, double *prop)   
)

◆ FORTRAN() [41/316]

void FORTRAN ( calcmatwavspeed  ,
(ITG *ne0, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *orab, ITG *ntmat_, ITG *ithermal, double *alzero, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, ITG *npmat_, ITG *mi, double *dtime, double *xstiff, ITG *ncmat_, double *vold, ITG *ielmat, double *t0, double *t1, char *matname, char *lakon, double *xmatwavespeed, ITG *nmat, ITG *ipkon)   
)

◆ FORTRAN() [42/316]

void FORTRAN ( calcpel  ,
(ITG *ne, ITG *nactdoh, double *vel, double *b, ITG *nef)   
)

◆ FORTRAN() [43/316]

void FORTRAN ( calcrhoel  ,
(ITG *nef, double *vel, double *rhcon, ITG *nrhcon, ITG *ielmatf, ITG *ntmat_, ITG *ithermal, ITG *mi)   
)

◆ FORTRAN() [44/316]

void FORTRAN ( calcrhoelcomp  ,
(ITG *nef, double *vel, double *shcon, ITG *ielmatf, ITG *ntmat_, ITG *mi)   
)

◆ FORTRAN() [45/316]

void FORTRAN ( calcrhofa  ,
(ITG *nface, double *vfa, double *rhcon, ITG *nrhcon, ITG *ielmatf, ITG *ntmat_, ITG *ithermal, ITG *mi, ITG *ielfa)   
)

◆ FORTRAN() [46/316]

void FORTRAN ( calcrhofacomp  ,
(ITG *nface, double *vfa, double *shcon, ITG *ielmatf, ITG *ntmat_, ITG *mi, ITG *ielfa, ITG *ipnei, double *vel, ITG *nef, double *flux, double *gradpel, double *gradtel, double *xxj, double *betam, double *xlet)   
)

◆ FORTRAN() [47/316]

void FORTRAN ( calcstabletimeinccont  ,
(ITG *ne, char *lakon, ITG *kon, ITG *ipkon, ITG *mi, ITG *ielmat, double *elcon, ITG *mortar, double *adb, double *alpha, ITG *nactdof, double *springarea, ITG *ne0, ITG *ntmat_, ITG *ncmat_, double *dtcont)   
)

◆ FORTRAN() [48/316]

void FORTRAN ( calcstabletimeincvol  ,
(ITG *ne0, char *lakon, double *co, ITG *kon, ITG *ipkon, ITG *mi, ITG *ielmat, double *dtvol, double *alpha, double *xmatwavespeed)   
)

◆ FORTRAN() [49/316]

void FORTRAN ( calcstressheatflux  ,
(double *sti, double *umel, double *gradvel, double *qfx, double *hcel, double *gradtel, ITG *nef, ITG *isti, ITG *iqfx, ITG *mi)   
)

◆ FORTRAN() [50/316]

void FORTRAN ( calctel  ,
(ITG *ne, ITG *nactdoh, double *vel, double *b, ITG *nef)   
)

◆ FORTRAN() [51/316]

void FORTRAN ( calcumel  ,
(ITG *nef, double *vel, double *shcon, ITG *nshcon, ITG *ielmatf, ITG *ntmat_, ITG *ithermal, ITG *mi, double *umel)   
)

◆ FORTRAN() [52/316]

void FORTRAN ( calcumfa  ,
(ITG *nface, double *vfa, double *shcon, ITG *nshcon, ITG *ielmatf, ITG *ntmat_, ITG *ithermal, ITG *mi, ITG *ielfa, double *umfa)   
)

◆ FORTRAN() [53/316]

void FORTRAN ( calcvel  ,
(ITG *ne, ITG *nactdoh, double *vel, double *b, ITG *neq, ITG *nef)   
)

◆ FORTRAN() [54/316]

void FORTRAN ( calcview  ,
(char *sideload, double *vold, double *co, double *pmid, double *e1, double *e2, double *e3, ITG *kontri, ITG *nloadtr, double *adview, double *auview, double *dist, ITG *idist, double *area, ITG *ntrit, ITG *mi, ITG *jqrad, ITG *irowrad, ITG *nzsrad, double *sidemean, ITG *ntria, ITG *ntrib, char *covered, ITG *ng)   
)

◆ FORTRAN() [55/316]

void FORTRAN ( calinput  ,
(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *nkon, ITG *ne, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, ITG *nmpc, ITG *nmpc_, ITG *nodeforc, ITG *ndirforc, double *xforc, ITG *nforc, ITG *nforc_, ITG *nelemload, char *sideload, double *xload, ITG *nload, ITG *nload_, ITG *nprint, char *prlab, char *prset, ITG *mpcfree, ITG *nboun_, ITG *mei, char *set, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nset, ITG *nalset, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, double *t0, double *t1, char *matname, ITG *ielmat, char *orname, double *orab, ITG *ielorien, char *amname, double *amta, ITG *namta, ITG *nam, ITG *nmethod, ITG *iamforc, ITG *iamload, ITG *iamt1, ITG *ithermal, ITG *iperturb, ITG *istat, ITG *istep, ITG *nmat, ITG *ntmat_, ITG *norien, double *prestr, ITG *iprestr, ITG *isolver, double *fei, double *veold, double *timepar, double *xmodal, char *filab, ITG *jout, ITG *nlabel, ITG *idrct, ITG *jmax, ITG *iexpl, double *alpha, ITG *iamboun, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, ITG *iplas, ITG *npmat_, ITG *mi, ITG *nk_, double *trab, ITG *inotr, ITG *ntrans, ITG *ikboun, ITG *ilboun, ITG *ikmpc, ITG *ilmpc, ITG *ics, double *dcs, ITG *ncs_, ITG *namtot_, double *cs, ITG *nstate_, ITG *ncmat_, ITG *iumat, ITG *mcs, char *labmpc, ITG *iponor, double *xnor, ITG *knor, double *thickn, double *thicke, ITG *ikforc, ITG *ilforc, double *offset, ITG *iponoel, ITG *inoel, ITG *rig, ITG *infree, ITG *nshcon, double *shcon, double *cocon, ITG *ncocon, double *physcon, ITG *nflow, double *ctrl, ITG *maxlenmpc, ITG *ne1d, ITG *ne2d, ITG *nener, double *vold, ITG *nodebounold, ITG *ndirbounold, double *xbounold, double *xforcold, double *xloadold, double *t1old, double *eme, double *sti, double *ener, double *xstate, char *jobnamec, ITG *irstrt, double *ttime, double *qaold, char *output, char *typeboun, char *inpc, ITG *ipoinp, ITG *inp, char *tieset, double *tietol, ITG *ntie, double *fmpc, char *cbody, ITG *ibody, double *xbody, ITG *nbody, ITG *nbody_, double *xbodyold, ITG *nam_, ITG *ielprop, ITG *nprop, ITG *nprop_, double *prop, ITG *itpamp, ITG *iviewfile, ITG *ipoinpc, ITG *cfd, ITG *nslavs, double *t0g, double *t1g, ITG *network, ITG *cyclicsymmetry, ITG *idefforc, ITG *idefload, ITG *idefbody, ITG *mortar, ITG *ifacecount, ITG *islavsurf, double *pslavsurf, double *clearini, char *heading, ITG *iaxial, ITG *nobject, char *objectset, ITG *nprint_, ITG *iuel, ITG *nuel_, ITG *nodempcref, double *coefmpcref, ITG *ikmpcref, ITG *memmpcref_, ITG *mpcfreeref, ITG *maxlenmpcref, ITG *memmpc_)   
)

◆ FORTRAN() [56/316]

void FORTRAN ( cataloguenodes  ,
(ITG *iponofa, ITG *inofa, ITG *ifreefa, ITG *ielfa, ITG *ifaboun, ITG *ipkon, ITG *kon, char *lakon, ITG *nface, ITG *ne)   
)

◆ FORTRAN() [57/316]

void FORTRAN ( checkconstraint  ,
(ITG *nobject, char *objectset, double *g0, ITG *nactive, ITG *nnlconst, ITG *ipoacti, ITG *ndesi, double *dgdxglob, ITG *nk, ITG *nodedesi)   
)

◆ FORTRAN() [58/316]

void FORTRAN ( checkimpacts  ,
(ITG *ne, ITG *neini, double *temax, double *sizemaxinc, double *energyref, double *tmin, double *tper, ITG *idivergence, ITG *idirinctime, ITG *istab, double *dtheta, double *enres, double *energy, double *energyini, double *allwk, double *allwkini, double *dampwk, double *dampwkini, double *emax, ITG *mortar, double *maxdecay, double *enetoll)   
)

◆ FORTRAN() [59/316]

void FORTRAN ( checkinputvaluesnet  ,
(ITG *ieg, ITG *nflow, double *prop, ITG *ielprop, char *lakon)   
)

◆ FORTRAN() [60/316]

void FORTRAN ( checktime  ,
(ITG *itpamp, ITG *namta, double *tinc, double *ttime, double *amta, double *tmin, ITG *inext, ITG *itp, ITG *istep, double *tper)   
)

◆ FORTRAN() [61/316]

void FORTRAN ( checktruecontact  ,
(ITG *ntie, char *tieset, double *tietol, double *elcon, ITG *itruecontact, ITG *ncmat_, ITG *ntmat_)   
)

◆ FORTRAN() [62/316]

void FORTRAN ( closefile  ,
()   
)

◆ FORTRAN() [63/316]

void FORTRAN ( closefilefluid  ,
()   
)

◆ FORTRAN() [64/316]

void FORTRAN ( complete_hel  ,
(ITG *neq, double *b, double *hel, double *ad, double *au, ITG *jq, ITG *irow, ITG *nzs)   
)

◆ FORTRAN() [65/316]

void FORTRAN ( complete_hel_blk  ,
(double *vel, double *hel, double *auv6, ITG *ipnei, ITG *neiel, ITG *nef, ITG *nactdohinv)   
)

◆ FORTRAN() [66/316]

void FORTRAN ( complete_hel_cyclic  ,
(ITG *neq, double *b, double *hel, double *ad, double *au, ITG *jq, ITG *irow, ITG *ipnei, ITG *neiel, ITG *ifatie, double *c, char *lakonf, ITG *neifa, ITG *nzs)   
)

◆ FORTRAN() [67/316]

void FORTRAN ( complete_hel_cyclic_blk  ,
(double *vel, double *hel, double *auv6, double *c, ITG *ipnei, ITG *neiel, ITG *neifa, ITG *ifatie, ITG *nef)   
)

◆ FORTRAN() [68/316]

void FORTRAN ( convert2slapcol  ,
(double *au, double *ad, ITG *jq, ITG *nzs, ITG *nef, double *aua)   
)

◆ FORTRAN() [69/316]

void FORTRAN ( coriolissolve  ,
(double *cc, ITG *nev, double *aa, double *bb, double *xx, double *eiga, double *eigb, double *eigxx, ITG *iter, double *d, double *temp)   
)

◆ FORTRAN() [70/316]

void FORTRAN ( correctvel  ,
(double *hel, double *adv, double *vfa, ITG *ipnei, double *area, double *bv, double *xxn, ITG *neifa, char *lakon, ITG *ne, ITG *neq)   
)

◆ FORTRAN() [71/316]

void FORTRAN ( correctvfa  ,
(ITG *nface, ITG *ielfa, double *area, double *vfa, double *ap, double *bp, double *xxn, ITG *ifabou, ITG *ipnei, ITG *nef, ITG *neifa, double *hfa, double *vel, double *xboun, char *lakonf, double *flux  
)

◆ FORTRAN() [72/316]

void FORTRAN ( createfint  ,
(ITG *ne, ITG *ipkon, char *lakon, ITG *kon, ITG *nactdof, ITG *mi, double *fn0, double *fint)   
)

◆ FORTRAN() [73/316]

void FORTRAN ( createialdesi  ,
(ITG *ndesi, ITG *nodedesi, ITG *iponoel, ITG *inoel, ITG *istartdesi, ITG *ialdesi, char *lakon, ITG *ipkon, ITG *kon, ITG *nodedesiinv, ITG *icoordinate, ITG *noregion)   
)

◆ FORTRAN() [74/316]

void FORTRAN ( createialelem  ,
(ITG *ne, ITG *istartelem, ITG *ialelem, ITG *ipoeldi, ITG *ieldi)   
)

◆ FORTRAN() [75/316]

void FORTRAN ( createinterfacempcs  ,
(ITG *imastnode, double *xmastnor, ITG *nmastnode, ITG *ikmpc, ITG *ilmpc, ITG *nmpc, ITG *ipompc, ITG *nodempc, double *coefmpc, char *labmpc, ITG *mpcfree, ITG *ikboun, ITG *nboun)   
)

◆ FORTRAN() [76/316]

void FORTRAN ( createinum  ,
(ITG *ipkon, ITG *inum, ITG *kon, char *lakon, ITG *nk, ITG *ne, char *cflag, ITG *nelemload, ITG *nload, ITG *nodeboun, ITG *nboun, ITG *ndirboun, ITG *ithermal, double *co, double *vold, ITG *mi, ITG *ielmat)   
)

◆ FORTRAN() [77/316]

void FORTRAN ( createmddof  ,
(ITG *imddof, ITG *nmddof, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nactdof, ITG *ithermal, ITG *mi, ITG *imdnode, ITG *nmdnode, ITG *ikmpc, ITG *ilmpc, ITG *ipompc, ITG *nodempc, ITG *nmpc, ITG *imdmpc, ITG *nmdmpc, ITG *imdboun, ITG *nmdboun, ITG *ikboun, ITG *nboun, ITG *nset, ITG *ntie, char *tieset, char *set, char *lakon, ITG *kon, ITG *ipkon, char *labmpc, ITG *ilboun, char *filab, char *prlab, char *prset, ITG *nprint, ITG *ne, ITG *cyclicsymmetry)   
)

◆ FORTRAN() [78/316]

void FORTRAN ( createmdelem  ,
(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, ITG *imdelem, ITG *nmdelem, ITG *iponoel, ITG *inoel, char *prlab, char *prset, ITG *nprint, char *lakon, char *set, ITG *nset, ITG *ialset, ITG *ipkon, ITG *kon, ITG *istartset, ITG *iendset, ITG *nforc, ITG *ikforc, ITG *ilforc)   
)

◆ FORTRAN() [79/316]

void FORTRAN ( createtiedsurfs  ,
(ITG *nodface, ITG *ipoface, char *set, ITG *istartset, ITG *iendset, ITG *ialset, char *tieset, ITG *inomat, ITG *ne, ITG *ipkon, char *lakon, ITG *kon, ITG *ntie, double *tietol, ITG *nalset, ITG *nk, ITG *nset, ITG *iactive)   
)

◆ FORTRAN() [80/316]

void FORTRAN ( create_iau6  ,
(ITG *nef, ITG *ipnei, ITG *neiel, ITG *jq, ITG *irow, ITG *nzs, ITG *iau6, char *lakonf)   
)

◆ FORTRAN() [81/316]

void FORTRAN ( dattime  ,
(char *date, char *clock)   
)

◆ FORTRAN() [82/316]

void FORTRAN ( desiperelem  ,
(ITG *ndesi, ITG *istartdesi, ITG *ialdesi, ITG *ipoeldi, ITG *ieldi, ITG *ne)   
)

◆ FORTRAN() [83/316]

void FORTRAN ( dgesv  ,
(ITG *nteq, ITG *nhrs, double *ac, ITG *lda, ITG *ipiv, double *bc, ITG *ldb, ITG *info)   
)

◆ FORTRAN() [84/316]

void FORTRAN ( dgetrs  ,
(char *trans, ITG *nteq, ITG *nrhs, double *ac, ITG *lda, ITG *ipiv, double *bc, ITG *ldb, ITG *info)   
)

◆ FORTRAN() [85/316]

void FORTRAN ( drfftf  ,
(ITG *ndata, double *r, double *wsave, ITG *isave)   
)

◆ FORTRAN() [86/316]

void FORTRAN ( drffti  ,
(ITG *ndata, double *wsave, ITG *isave)   
)

◆ FORTRAN() [87/316]

void FORTRAN ( dnaupd  ,
(ITG *ido, char *bmat, ITG *n, char *which, ITG *nev, double *tol, double *resid, ITG *ncv, double *z, ITG *ldz, ITG *iparam, ITG *ipntr, double *workd, double *workl, ITG *lworkl, ITG *info)   
)

◆ FORTRAN() [88/316]

void FORTRAN ( dsaupd  ,
(ITG *ido, char *bmat, ITG *n, char *which, ITG *nev, double *tol, double *resid, ITG *ncv, double *z, ITG *ldz, ITG *iparam, ITG *ipntr, double *workd, double *workl, ITG *lworkl, ITG *info)   
)

◆ FORTRAN() [89/316]

void FORTRAN ( dneupd  ,
(ITG *rvec, char *howmny, ITG *select, double *d, double *di, double *z, ITG *ldz, double *sigma, double *sigmai, double *workev, char *bmat, ITG *neq, char *which, ITG *nev, double *tol, double *resid, ITG *ncv, double *v, ITG *ldv, ITG *iparam, ITG *ipntr, double *workd, double *workl, ITG *lworkl, ITG *info)   
)

◆ FORTRAN() [90/316]

void FORTRAN ( dseupd  ,
(ITG *rvec, char *howmny, ITG *select, double *d, double *z, ITG *ldz, double *sigma, char *bmat, ITG *neq, char *which, ITG *nev, double *tol, double *resid, ITG *ncv, double *v, ITG *ldv, ITG *iparam, ITG *ipntr, double *workd, double *workl, ITG *lworkl, ITG *info)   
)

◆ FORTRAN() [91/316]

void FORTRAN ( dsort  ,
(double *dx, ITG *iy, ITG *n, ITG *kflag)   
)

◆ FORTRAN() [92/316]

void FORTRAN ( dynresults  ,
(ITG *nk, double *v, ITG *ithermal, ITG *nactdof, double *vold, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, char *labmpc, ITG *nmpc, double *b, double *bp, double *veold, double *dtime, ITG *mi, ITG *imdnode, ITG *nmdnode, ITG *imdboun, ITG *nmdboun, ITG *imdmpc, ITG *nmdmpc, ITG *nmethod, double *time)   
)

◆ FORTRAN() [93/316]

void FORTRAN ( effectivemodalmass  ,
(ITG *neq, ITG *nactdof, ITG *mi, double *adb, double *aub, ITG *jq, ITG *irow, ITG *nev, double *z, double *co, ITG *nk)   
)

◆ FORTRAN() [94/316]

void FORTRAN ( elementpernode  ,
(ITG *iponoel, ITG *inoel, char *lakon, ITG *ipkon, ITG *kon, ITG *ne, ITG *inoelsize)   
)

◆ FORTRAN() [95/316]

void FORTRAN ( elementperorien  ,
(ITG *ipoorel, ITG *iorel, ITG *ielorien, ITG *ne, ITG *mi)   
)

◆ FORTRAN() [96/316]

void FORTRAN ( envtemp  ,
(ITG *itg, ITG *ieg, ITG *ntg, ITG *ntr, char *sideload, ITG *nelemload, ITG *ipkon, ITG *kon, char *lakon, ITG *ielmat, ITG *ne, ITG *nload, ITG *kontri, ITG *ntri, ITG *nloadtr, ITG *nflow, ITG *ndirboun, ITG *nactdog, ITG *nodeboun, ITG *nacteq, ITG *nboun, ITG *ielprop, double *prop, ITG *nteq, double *v, ITG *network, double *physcon, double *shcon, ITG *ntmat_, double *co, double *vold, char *set, ITG *nshcon, double *rhcon, ITG *nrhcon, ITG *mi, ITG *nmpc, ITG *nodempc, ITG *ipompc, char *labmpc, ITG *ikboun, ITG *nasym, double *ttime, double *time, ITG *iaxial)   
)

◆ FORTRAN() [97/316]

void FORTRAN ( equationcheck  ,
(double *ac, ITG *nteq, ITG *nactdog, ITG *itg, ITG *ntg, ITG *nacteq, ITG *network)   
)

◆ FORTRAN() [98/316]

void FORTRAN ( errorestimator  ,
(double *yi, double *yn, ITG *ipkon, ITG *kon, char *lakon, ITG *nk, ITG *ne, ITG *mi, ITG *ielmat, ITG *nterms, ITG *inum, double *co, double *vold, char *cflag)   
)

◆ FORTRAN() [99/316]

void FORTRAN ( rotationvector  ,
(double *a, double *euler)   
)

◆ FORTRAN() [100/316]

void FORTRAN ( rotationvectorinv  ,
(double *a, double *euler)   
)

◆ FORTRAN() [101/316]

void FORTRAN ( extrapolate  ,
(double *sti, double *stn, ITG *ipkon, ITG *inum, ITG *kon, char *lakon, ITG *nfield, ITG *nk, ITG *ne, ITG *mi, ITG *ndim, double *orab, ITG *ielorien, double *co, ITG *iorienglob, char *cflag, double *vold, ITG *force, ITG *ielmat, double *thicke, ITG *ielprop, double *prop)   
)

◆ FORTRAN() [102/316]

void FORTRAN ( extrapolate_ad_h  ,
(ITG *nface, ITG *ielfa, double *xrlfa, double *ad, double *adfa, double *hel, double *hfa, ITG *icyclic, double *c, ITG *ifatie)   
)

◆ FORTRAN() [103/316]

void FORTRAN ( extrapolate_ad_h_comp  ,
(ITG *nface, ITG *ielfa, double *xrlfa, double *ad, double *adfa, double *hel, double *hfa, ITG *icyclic, double *c, ITG *ifatie)   
)

◆ FORTRAN() [104/316]

void FORTRAN ( extrapolatefluid  ,
(ITG *nk, ITG *iponofa, ITG *inofa, ITG *inum, double *vfa, double *v, ITG *ielfa, ITG *ithermal, ITG *imach, ITG *ikappa, double *xmach, double *xkappa, double *shcon, ITG *nshcon, ITG *ntmat_, ITG *ielmatf, double *physcon, ITG *mi, ITG *iturb, double *xturb)   
)

◆ FORTRAN() [105/316]

void FORTRAN ( extrapolate_gradkel  ,
(ITG *nface, ITG *ielfa, double *xrlfa, double *gradkel, double *gradkfa, ITG *icyclic, double *c, ITG *ifatie)   
)

◆ FORTRAN() [106/316]

void FORTRAN ( extrapolate_gradoel  ,
(ITG *nface, ITG *ielfa, double *xrlfa, double *gradoel, double *gradofa, ITG *icyclic, double *c, ITG *ifatie)   
)

◆ FORTRAN() [107/316]

void FORTRAN ( extrapolate_gradtel  ,
(ITG *nface, ITG *ielfa, double *xrlfa, double *gradtel, double *gradtfa, ITG *icyclic, double *c, ITG *ifatie)   
)

◆ FORTRAN() [108/316]

void FORTRAN ( extrapolate_gradvel  ,
(ITG *nface, ITG *ielfa, double *xrlfa, double *gradv, double *gradvfa, ITG *icyclic, double *c, ITG *ifatie)   
)

◆ FORTRAN() [109/316]

void FORTRAN ( extrapolate_kel  ,
(ITG *nface, ITG *ielfa, double *xrlfa, double *vel, double *vfa, ITG *ifabou, double *xboun, ITG *ipnei, ITG *nef, double *physcon, double *umfa)   
)

◆ FORTRAN() [110/316]

void FORTRAN ( extrapolate_oel  ,
(ITG *nface, ITG *ielfa, double *xrlfa, double *vel, double *vfa, ITG *ifabou, double *xboun, ITG *ipnei, ITG *nef, double *physcon, double *umfa, double *dy)   
)

◆ FORTRAN() [111/316]

void FORTRAN ( extrapolate_pel  ,
(ITG *nface, ITG *ielfa, double *xrlfa, double *vel, double *vfa, ITG *ifabou, double *xboun, ITG *nef)   
)

◆ FORTRAN() [112/316]

void FORTRAN ( extrapolate_tel  ,
(ITG *nface, ITG *ielfa, double *xrlfa, double *vel, double *vfa, ITG *ifabou, double *xboun, ITG *ipnei, ITG *nef)   
)

◆ FORTRAN() [113/316]

void FORTRAN ( extrapolate_vel  ,
(ITG *nface, ITG *ielfa, double *xrlfa, double *vel, double *vfa, ITG *ifabou, double *xboun, ITG *ipnei, ITG *nef, ITG *icyclic, double *c, ITG *ifatie, double *xxn)   
)

◆ FORTRAN() [114/316]

void FORTRAN ( extrapol_kel  ,
(ITG *nface, ITG *ielfa, double *xrlfa, double *vel, double *vfa, ITG *ifabou, double *xbounact, ITG *nef, double *gradtel, double *gradtfa, ITG *neifa, double *rf, double *area, double *volume, double *xle, double *xxi, ITG *icyclic, double *xxn, ITG *ipnei, ITG *ifatie, double *xlet, double *xxj, double *coefmpc, ITG *nmpc, char *labmpc, ITG *ipompc, ITG *nodempc, ITG *ifaext, ITG *nfaext, ITG *nactdoh, double *umfa, double *physcon)   
)

◆ FORTRAN() [115/316]

void FORTRAN ( extrapol_oel  ,
(ITG *nface, ITG *ielfa, double *xrlfa, double *vel, double *vfa, ITG *ifabou, double *xbounact, ITG *nef, double *gradtel, double *gradtfa, ITG *neifa, double *rf, double *area, double *volume, double *xle, double *xxi, ITG *icyclic, double *xxn, ITG *ipnei, ITG *ifatie, double *xlet, double *xxj, double *coefmpc, ITG *nmpc, char *labmpc, ITG *ipompc, ITG *nodempc, ITG *ifaext, ITG *nfaext, ITG *nactdoh, double *umfa, double *physcon, double *dy)   
)

◆ FORTRAN() [116/316]

void FORTRAN ( extrapol_pel  ,
(ITG *nface, ITG *ielfa, double *xrlfa, double *vel, double *vfa, ITG *ifabou, double *xbounact, ITG *nef, double *gradpel, double *gradpfa, ITG *neifa, double *rf, double *area, double *volume, double *xle, double *xxi, ITG *icyclic, double *xxn, ITG *ipnei, ITG *ifatie, double *coefmpc, ITG *nmpc, char *labmpc, ITG *ipompc, ITG *nodempc, ITG *ifaext, ITG *nfaext, ITG *nactdoh)   
)

◆ FORTRAN() [117/316]

void FORTRAN ( extrapol_tel  ,
(ITG *nface, ITG *ielfa, double *xrlfa, double *vel, double *vfa, ITG *ifabou, double *xbounact, ITG *nef, double *gradtel, double *gradtfa, ITG *neifa, double *rf, double *area, double *volume, double *xle, double *xxi, ITG *icyclic, double *xxn, ITG *ipnei, ITG *ifatie, double *xload, double *xlet, double *xxj, double *coefmpc, ITG *nmpc, char *labmpc, ITG *ipompc, ITG *nodempc, ITG *ifaext, ITG *nfaext, ITG *nactdoh)   
)

◆ FORTRAN() [118/316]

void FORTRAN ( extrapol_vel  ,
(ITG *nface, ITG *ielfa, double *xrlfa, double *vel, double *vfa, ITG *ifabou, double *xbounact, ITG *ipnei, ITG *nef, ITG *icyclic, double *c, ITG *ifatie, double *xxn, double *gradvel, double *gradvfa, ITG *neifa, double *rf, double *area, double *volume, double *xle, double *xxi, double *xxj, double *xlet, double *coefmpc, ITG *nmpc, char *labmpc, ITG *ipompc, ITG *nodempc, ITG *ifaext, ITG *nfaext, ITG *nactdoh)   
)

◆ FORTRAN() [119/316]

void FORTRAN ( facepernode  ,
(ITG *iponoelfa, ITG *inoelfa, char *lakonfa, ITG *ipkonfa, ITG *konfa, ITG *nsurfs, ITG *inoelsize)   
)

◆ FORTRAN() [120/316]

void FORTRAN ( fcrit  ,
(double *time, double *tend, double *aai, double *bbi, double *zetaj, double *dj, double *ddj, double *h1, double *h2, double *h3, double *h4, double *func, double *funcp)   
)

◆ FORTRAN() [121/316]

void FORTRAN ( fill_neiel  ,
(ITG *nef, ITG *ipnei, ITG *neiel, ITG *neielcp)   
)

◆ FORTRAN() [122/316]

void FORTRAN ( filter  ,
(double *dgdxglob, ITG *nobject, ITG *nk, ITG *nodedesi, ITG *ndesi, char *objectset, double *xo, double *yo, double *zo, double *x, double *y, double *z, ITG *nx, ITG *ny, ITG *nz, ITG *neighbor, double *r, ITG *ndesia, ITG *ndesib)   
)

◆ FORTRAN() [123/316]

void FORTRAN ( findsurface  ,
(ITG *ipoface, ITG *nodface, ITG *ne, ITG *ipkon, ITG *kon, char *lakon, ITG *ntie, char *tieset)   
)

◆ FORTRAN() [124/316]

void FORTRAN ( findsurface_se  ,
(ITG *nodface, ITG *ipoface, ITG *ne, ITG *ipkon, char *lakon, ITG *kon, ITG *konfa, ITG *ipkonfa, ITG *nk, char *lakonfa, ITG *nsurfs)   
)

◆ FORTRAN() [125/316]

void FORTRAN ( flowoutput  ,
(ITG *itg, ITG *ieg, ITG *ntg, ITG *nteq, double *bc, char *lakon, ITG *ntmat_, double *v, double *shcon, ITG *nshcon, ITG *ipkon, ITG *kon, double *co, ITG *nflow, double *dtime, double *ttime, double *time, ITG *ielmat, double *prop, ITG *ielprop, ITG *nactdog, ITG *nacteq, ITG *iin, double *physcon, double *camt, double *camf, double *camp, double *rhcon, ITG *nrhcon, double *vold, char *jobnamef, char *set, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nset, ITG *mi, ITG *iaxial, ITG *istep, ITG *iit)   
)

◆ FORTRAN() [126/316]

void FORTRAN ( flowresult  ,
(ITG *ntg, ITG *itg, double *cam, double *vold, double *v, ITG *nload, char *sideload, ITG *nelemload, double *xloadact, ITG *nactdog, ITG *network, ITG *mi, ITG *ne, ITG *ipkon, char *lakon, ITG *kon)   
)

◆ FORTRAN() [127/316]

void FORTRAN ( forcesolve  ,
(double *zc, ITG *nev, double *aa, double *bb, double *xx, double *eiga, double *eigb, double *eigxx, ITG *iter, double *d, ITG *neq, double *z, ITG *istartnmd, ITG *iendnmd, ITG *nmd, ITG *cyclicsymmetry, ITG *neqact, ITG *igeneralizedforce)   
)

◆ FORTRAN() [128/316]

void FORTRAN ( formgradient  ,
(ITG *istartdesi, ITG *ialdesi, ITG *ipkon, char *lakon, ITG *ipoface, ITG *ndesi, ITG *nodedesi, ITG *nodface, ITG *kon, double *co, double *dgdx, ITG *nobject, double *weightformgrad, ITG *nodedesiinv, ITG *noregion, char *objectset, double *dgdxglob, ITG *nk)   
)

◆ FORTRAN() [129/316]

void FORTRAN ( formgradinterpol  ,
(ITG *ipkon, char *lakon, ITG *kon, ITG *nobject, double *dgdxglob, double *xinterpol, ITG *nnodes, ITG *ne, ITG *nk, ITG *nodedesiinv, char *objectset)   
)

◆ FORTRAN() [130/316]

void FORTRAN ( frdfluid  ,
(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, double *v, ITG *kode, double *time, ITG *ielmatf, char *matname, char *filab, ITG *inum, ITG *ntrans, ITG *inotr, double *trab, ITG *mi, ITG *istep, double *stn, double *qfn, ITG *nactdofinv, double *xmach, double *xkappa, double *physcon, double *xturb)   
)

◆ FORTRAN() [131/316]

void FORTRAN ( frditeration  ,
(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, double *v, double *time, ITG *ielmat, char *matname, ITG *mi, ITG *istep, ITG *iinc, ITG *ithermal)   
)

◆ FORTRAN() [132/316]

void FORTRAN ( frictionheating  ,
(ITG *ne0, ITG *ne, ITG *ipkon, char *lakon, ITG *ielmat, ITG *mi, double *elcon, ITG *ncmat_, ITG *ntmat_, ITG *kon, ITG *islavsurf, double *pmastsurf, double *springarea, double *co, double *vold, double *veold, double *pslavsurf, double *xload, ITG *nload, ITG *nload_, ITG *nelemload, ITG *iamload, ITG *idefload, char *sideload, double *stx, ITG *nam)   
)

◆ FORTRAN() [133/316]

void FORTRAN ( fsub  ,
(double *time, double *tend, double *aai, double *bbi, double *ddj, double *h1, double *h2, double *h3, double *h4, double *func, double *funcp)   
)

◆ FORTRAN() [134/316]

void FORTRAN ( fsuper  ,
(double *time, double *tend, double *aai, double *bbi, double *h1, double *h2, double *h3, double *h4, double *h5, double *h6, double *func, double *funcp)   
)

◆ FORTRAN() [135/316]

void FORTRAN ( gasmechbc  ,
(double *vold, ITG *nload, char *sideload, ITG *nelemload, double *xload, ITG *mi)   
)

◆ FORTRAN() [136/316]

void FORTRAN ( genadvecelem  ,
(ITG *inodesd, ITG *ipkon, ITG *ne, char *lakon, ITG *kon, ITG *nload, char *sideload, ITG *nelemload, ITG *nkon, ITG *network)   
)

◆ FORTRAN() [137/316]

void FORTRAN ( gencontelem_f2f  ,
(char *tieset, ITG *ntie, ITG *itietri, ITG *ne, ITG *ipkon, ITG *kon, char *lakon, double *cg, double *straight, ITG *ifree, ITG *koncont, double *co, double *vold, double *xo, double *yo, double *zo, double *x, double *y, double *z, ITG *nx, ITG *ny, ITG *nz, ITG *ielmat, double *elcon, ITG *istep, ITG *iinc, ITG *iit, ITG *ncmat_, ITG *ntmat_, ITG *mi, ITG *imastop, ITG *islavsurf, ITG *itiefac, double *springarea, double *tietol, double *reltime, char *filab, ITG *nasym, double *pslavsurf, double *pmastsurf, double *clearini, double *theta, double *xstateini, double *xstate, ITG *nstate_, ITG *ne0, ITG *icutb, ITG *ialeatoric, ITG *nmethod, char *jobnamef)   
)

◆ FORTRAN() [138/316]

void FORTRAN ( gencontelem_n2f  ,
(char *tieset, ITG *ntie, ITG *itietri, ITG *ne, ITG *ipkon, ITG *kon, char *lakon, double *cg, double *straight, ITG *ifree, ITG *koncont, double *co, double *vold, double *xo, double *yo, double *zo, double *x, double *y, double *z, ITG *nx, ITG *ny, ITG *nz, ITG *ielmat, double *elcon, ITG *istep, ITG *iinc, ITG *iit, ITG *ncmat_, ITG *ntmat_, ITG *nmethod, ITG *mi, ITG *imastop, ITG *nslavnode, ITG *islavnode, ITG *islavsurf, ITG *itiefac, double *areaslav, ITG *iponoels, ITG *inoels, double *springarea, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, double *tietol, double *reltime, char *filab, ITG *nasym, double *xnoels, ITG *icutb, ITG *ne0, char *jobnamef)   
)

◆ FORTRAN() [139/316]

void FORTRAN ( generateeminterfaces  ,
(ITG *istartset, ITG *iendset, ITG *ialset, ITG *iactive, ITG *ipkon, char *lakon, ITG *kon, ITG *ikmpc, ITG *nmpc, ITG *nafaces)   
)

◆ FORTRAN() [140/316]

void FORTRAN ( generatetet  ,
(ITG *kontet, ITG *ifatet, ITG *netet, ITG *inodfa, ITG *ifreefa, double *planfa, ITG *ipofa, ITG *nodes, double *cotet)   
)

◆ FORTRAN() [141/316]

void FORTRAN ( gennactdofinv  ,
(ITG *nactdof, ITG *nactdofinv, ITG *nk, ITG *mi, ITG *nodorig, ITG *ipkon, char *lakon, ITG *kon, ITG *ne)   
)

◆ FORTRAN() [142/316]

void FORTRAN ( gentiedmpc  ,
(char *tieset, ITG *ntie, ITG *itietri, ITG *ipkon, ITG *kon, char *lakon, char *set, ITG *istartset, ITG *iendset, ITG *ialset, double *cg, double *straight, ITG *koncont, double *co, double *xo, double *yo, double *zo, double *x, double *y, double *z, ITG *nx, ITG *ny, ITG *nz, ITG *nset, ITG *ifaceslave, ITG *istartfield, ITG *iendfield, ITG *ifield, ITG *ipompc, ITG *nodempc, double *coefmpc, ITG *nmpc, ITG *nmpc_, ITG *mpcfree, ITG *ikmpc, ITG *ilmpc, char *labmpc, ITG *ithermal, double *tietol, ITG *icfd, ITG *ncont, ITG *imastop, ITG *ikboun, ITG *nboun, char *kind)   
)

◆ FORTRAN() [143/316]

void FORTRAN ( geomview  ,
(double *vold, double *co, double *pmid, double *e1, double *e2, double *e3, ITG *kontri, double *area, double *cs, ITG *mcs, ITG *inocs, ITG *ntrit, ITG *nk, ITG *mi, double *sidemean)   
)

◆ FORTRAN() [144/316]

void FORTRAN ( getdesiinfo  ,
(char *set, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nset, ITG *mi, ITG *nactdof, ITG *ndesi, ITG *nodedesi, ITG *ntie, char *tieset, ITG *itmp, ITG *nmpc, ITG *nodempc, ITG *ipompc, ITG *nodedesiinv, ITG *iponoel, ITG *inoel, char *lakon, ITG *ipkon, ITG *kon, ITG *noregion, ITG *ipoface, ITG *nodface, ITG *nk)   
)

◆ FORTRAN() [145/316]

void FORTRAN ( identamta  ,
(double *amta, double *reftime, ITG *istart, ITG *iend, ITG *id)   
)

◆ FORTRAN() [146/316]

void FORTRAN ( identifytiedface  ,
(char *tieset, ITG *ntie, char *set, ITG *nset, ITG *faceslave, char *kind)   
)

◆ FORTRAN() [147/316]

void FORTRAN ( includefilename  ,
(char *buff, char *includefn, ITG *lincludefn)   
)

◆ FORTRAN() [148/316]

void FORTRAN ( inicalcbody  ,
(ITG *nef, double *body, ITG *ipobody, ITG *ibody, double *xbody, double *coel, double *vel, char *lakon, ITG *nactdohinv, ITG *icent)   
)

◆ FORTRAN() [149/316]

void FORTRAN ( init  ,
(ITG *nktet, ITG *inodfa, ITG *ipofa, ITG *netet_)   
)

◆ FORTRAN() [150/316]

void FORTRAN ( initialcfd  ,
(ITG *ne, ITG *ipkon, ITG *kon, char *lakon, double *co, double *coel, double *cofa, ITG *nface, ITG *ielfa, double *area, ITG *ipnei, ITG *neiel, double *xxn, double *xxi, double *xle, double *xlen, double *xlet, double *xrlfa, double *cosa, double *volume, ITG *neifa, double *xxj, double *cosb, double *dmin, ITG *ifatie, double *cs, char *tieset, ITG *icyclic, double *c, ITG *neij, double *physcon, ITG *isolidsurf, ITG *nsolidsurf, double *dy, double *xxni, double *xxnj, double *xxicn, ITG *nflnei, ITG *iturbulent, double *rf)   
)

◆ FORTRAN() [151/316]

void FORTRAN ( initialchannel  ,
(ITG *itg, ITG *ieg, ITG *ntg, double *ac, double *bc, char *lakon, double *v, ITG *ipkon, ITG *kon, ITG *nflow, ITG *ikboun, ITG *nboun, double *prop, ITG *ielprop, ITG *nactdog, ITG *ndirboun, ITG *nodeboun, double *xbounact, ITG *ielmat, ITG *ntmat_, double *shcon, ITG *nshcon, double *physcon, ITG *ipiv, ITG *nteq, double *rhcon, ITG *nrhcon, ITG *ipobody, ITG *ibody, double *xbody, double *co, ITG *nbody, ITG *network, ITG *iin_abs, double *vold, char *set, ITG *istep, ITG *iit, ITG *mi, ITG *ineighe, ITG *ilboun, double *ttime, double *time, ITG *iaxial)   
)

◆ FORTRAN() [152/316]

void FORTRAN ( initialnet  ,
(ITG *itg, ITG *ieg, ITG *ntg, double *ac, double *bc, char *lakon, double *v, ITG *ipkon, ITG *kon, ITG *nflow, ITG *ikboun, ITG *nboun, double *prop, ITG *ielprop, ITG *nactdog, ITG *ndirboun, ITG *nodeboun, double *xbounact, ITG *ielmat, ITG *ntmat_, double *shcon, ITG *nshcon, double *physcon, ITG *ipiv, ITG *nteq, double *rhcon, ITG *nrhcon, ITG *ipobody, ITG *ibody, double *xbody, double *co, ITG *nbody, ITG *network, ITG *iin_abs, double *vold, char *set, ITG *istep, ITG *iit, ITG *mi, ITG *ineighe, ITG *ilboun, ITG *channel, ITG *iaxial, ITG *nmpc, char *labmpc, ITG *ipompc, ITG *nodempc, double *coefmpc, double *ttime, double *time, ITG *iponoel, ITG *inoel)   
)

◆ FORTRAN() [153/316]

void FORTRAN ( integral_boundary  ,
(double *sumfix, double *sumfree, ITG *ifaext, ITG *nfaext, ITG *ielfa, ITG *ifabou, double *vfa, ITG *ipnei, double *xxn)   
)

◆ FORTRAN() [154/316]

void FORTRAN ( interpolatestate  ,
(ITG *ne, ITG *ipkon, ITG *kon, char *lakon, ITG *ne0, ITG *mi, double *xstate, double *pslavsurf, ITG *nstate_, double *xstateini, ITG *islavsurf, ITG *islavsurfold, double *pslavsurfold, char *tieset, ITG *ntie, ITG *itiefac)   
)

◆ FORTRAN() [155/316]

void FORTRAN ( islavactive  ,
(char *tieset, ITG *ntie, ITG *itietri, double *cg, double *straight, double *co, double *vold, double *xo, double *yo, double *zo, double *x, double *y, double *z, ITG *nx, ITG *ny, ITG *nz, ITG *mi, ITG *imastop, ITG *nslavnode, ITG *islavnode, ITG *islavact)   
)

◆ FORTRAN() [156/316]

void FORTRAN ( isortid  ,
(ITG *ix, double *dy, ITG *n, ITG *kflag)   
)

◆ FORTRAN() [157/316]

void FORTRAN ( isortii  ,
(ITG *ix, ITG *iy, ITG *n, ITG *kflag)   
)

◆ FORTRAN() [158/316]

void FORTRAN ( isortiid  ,
(ITG *ix, ITG *iy, double *dy, ITG *n, ITG *kflag)   
)

◆ FORTRAN() [159/316]

void FORTRAN ( isortiddc  ,
(ITG *ix, double *dy1, double *dy2, char *cy, ITG *n, ITG *kflag)   
)

◆ FORTRAN() [160/316]

void FORTRAN ( isortiiddc  ,
(ITG *ix1, ITG *ix2, double *dy1, double *dy2, char *cy, ITG *n, ITG *kflag)   
)

◆ FORTRAN() [161/316]

void FORTRAN ( jouleheating  ,
(ITG *ipkon, char *lakon, ITG *kon, double *co, double *elcon, ITG *nelcon, ITG *mi, ITG *ne, double *sti, ITG *ielmat, ITG *nelemload, char *sideload, double *xload, ITG *nload, ITG *nload_, ITG *iamload, ITG *nam, ITG *idefload, ITG *ncmat_, ITG *ntmat_, double *alcon, ITG *nalcon, ITG *ithermal, double *vold, double *t1)   
)

◆ FORTRAN() [162/316]

void FORTRAN ( keystart  ,
(ITG *ifreeinp, ITG *ipoinp, ITG *inp, char *name, ITG *iline, ITG *ikey)   
)

◆ FORTRAN() [163/316]

void FORTRAN ( mafillcorio  ,
(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, ITG *nmpc, ITG *nodeforc, ITG *ndirforc, double *xforc, ITG *nforc, ITG *nelemload, char *sideload, double *xload, ITG *nload, double *xbody, ITG *ipobody, ITG *nbody, double *cgr, double *ad, double *au, ITG *nactdof, ITG *icol, ITG *jq, ITG *irow, ITG *neq, ITG *nzl, ITG *nmethod, ITG *ikmpc, ITG *ilmpc, ITG *ikboun, ITG *ilboun, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, double *prestr, ITG *iprestr, double *vold, ITG *iperturb, double *sti, ITG *nzs, double *stx, double *adb, double *aub, ITG *iexpl, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstiff, ITG *npmat_, double *dtime, char *matname, ITG *mi, ITG *ncmat_, double *ttime, double *time, ITG *istep, ITG *kinc, ITG *ibody, ITG *ielprop, double *prop)   
)

◆ FORTRAN() [164/316]

void FORTRAN ( mafilldm  ,
(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, ITG *nmpc, ITG *nodeforc, ITG *ndirforc, double *xforc, ITG *nforc, ITG *nelemload, char *sideload, double *xload, ITG *nload, double *xbody, ITG *ipobody, ITG *nbody, double *cgr, double *ad, double *au, ITG *nactdof, ITG *icol, ITG *jq, ITG *irow, ITG *neq, ITG *nzl, ITG *nmethod, ITG *ikmpc, ITG *ilmpc, ITG *ikboun, ITG *ilboun, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, double *prestr, ITG *iprestr, double *vold, ITG *iperturb, double *sti, ITG *nzs, double *stx, double *adb, double *aub, ITG *iexpl, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstiff, ITG *npmat_, double *dtime, char *matname, ITG *mi, ITG *ncmat_, double *ttime, double *time, ITG *istep, ITG *kinc, ITG *ibody, double *clearini, ITG *mortar, double *springarea, double *pslavsurf, double *pmastsurf, double *reltime, ITG *nasym)   
)

◆ FORTRAN() [165/316]

void FORTRAN ( mafillem  ,
(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, ITG *nmpc, ITG *nodeforc, ITG *ndirforc, double *xforc, ITG *nforc, ITG *nelemload, char *sideload, double *xload, ITG *nload, double *xbody, ITG *ipobody, ITG *nbody, double *cgr, double *ad, double *au, double *bb, ITG *nactdof, ITG *icol, ITG *jq, ITG *irow, ITG *neq, ITG *nzl, ITG *nmethod, ITG *ikmpc, ITG *ilmpc, ITG *ikboun, ITG *ilboun, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, double *prestr, ITG *iprestr, double *vold, ITG *iperturb, double *sti, ITG *nzs, double *stx, double *adb, double *aub, ITG *iexpl, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstiff, ITG *npmat_, double *dtime, char *matname, ITG *mi, ITG *ncmat_, ITG *mass, ITG *stiffness, ITG *buckling, ITG *rhs, ITG *intscheme, double *physcon, double *shcon, ITG *nshcon, double *cocon, ITG *ncocon, double *ttime, double *time, ITG *istep, ITG *kinc, ITG *coriolis, ITG *ibody, double *xloadold, double *reltime, double *veold, double *springarea, ITG *nstate_, double *xstateini, double *xstate, double *thicke, ITG *integerglob, double *doubleglob, char *tieset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *ntie, ITG *nasym, ITG *iactive, double *h0, double *pslavsurf, double *pmastsurf, ITG *mortar, double *clearini, ITG *ielprop, double *prop, ITG *iponoel, ITG *inoel, ITG *network)   
)

◆ FORTRAN() [166/316]

void FORTRAN ( mafillk  ,
(ITG *nef, ITG *ipnei, ITG *neifa, ITG *neiel, double *vfa, double *xxn, double *area, double *au, double *ad, ITG *jq, ITG *irow, ITG *nzs, double *b, double *vel, double *umfa, double *xlet, double *xle, double *gradkfa, double *xxi, double *body, double *volume, ITG *ielfa, char *lakonf, ITG *ifabou, ITG *nbody, ITG *neq, double *dtimef, double *velo, double *veloo, double *cpfa, double *hcfa, double *cvel, double *gradvel, double *xload, double *gammat, double *xrlfa, double *xxj, ITG *nactdohinv, double *a1, double *a2, double *a3, double *flux, ITG *nefa, ITG *nefb, ITG *iau6, double *xxni, double *xxnj, ITG *iturbulent)   
)

◆ FORTRAN() [167/316]

void FORTRAN ( mafillnet  ,
(ITG *itg, ITG *ieg, ITG *ntg, double *ac, ITG *nload, char *sideload, ITG *nelemload, double *xloadact, char *lakon, ITG *ntmat_, double *v, double *shcon, ITG *nshcon, ITG *ipkon, ITG *kon, double *co, ITG *nflow, ITG *iinc, ITG *istep, double *dtime, double *ttime, double *time, ITG *ielmat, ITG *nteq, double *prop, ITG *ielprop, ITG *nactdog, ITG *nacteq, double *physcon, double *rhcon, ITG *nrhcon, ITG *ipobody, ITG *ibody, double *xbody, ITG *nbody, double *vold, double *xloadold, double *reltime, ITG *nmethod, char *set, ITG *mi, ITG *nmpc, ITG *nodempc, ITG *ipompc, double *coefmpc, char *labmpc, ITG *iaxial, double *cocon, ITG *ncocon, ITG *iponoel, ITG *inoel)   
)

◆ FORTRAN() [168/316]

void FORTRAN ( mafillo  ,
(ITG *nef, ITG *ipnei, ITG *neifa, ITG *neiel, double *vfa, double *xxn, double *area, double *au, double *ad, ITG *jq, ITG *irow, ITG *nzs, double *b, double *vel, double *umfa, double *xlet, double *xle, double *gradofa, double *xxi, double *body, double *volume, ITG *ielfa, char *lakonf, ITG *ifabou, ITG *nbody, ITG *neq, double *dtimef, double *velo, double *veloo, double *cpfa, double *hcfa, double *cvel, double *gradvel, double *xload, double *gammat, double *xrlfa, double *xxj, ITG *nactdohinv, double *a1, double *a2, double *a3, double *flux, ITG *nefa, ITG *nefb, ITG *iau6, double *xxni, double *xxnj, ITG *iturbulent, double *gradkel, double *gradoel)   
)

◆ FORTRAN() [169/316]

void FORTRAN ( mafillp  ,
(ITG *ne, char *lakonf, ITG *ipnei, ITG *neifa, ITG *neiel, double *vfa, double *area, double *adfa, double *xlet, double *cosa, double *volume, double *au, double *ad, ITG *jq, ITG *irow, double *ap, ITG *ielfa, ITG *ifabou, double *xle, double *b, double *xxn, ITG *neq, ITG *nzs, double *hfa, double *gradpel, double *bp, double *xxi, ITG *neij, double *xlen, double *cosb, ITG *nefa, ITG *nefb, ITG *iau6, double *xxicn)   
)

◆ FORTRAN() [170/316]

void FORTRAN ( mafillpbc  ,
(ITG *nef, double *au, double *ad, ITG *jq, ITG *irow, double *b, ITG *iatleastonepressurebc, ITG *nzs)   
)

◆ FORTRAN() [171/316]

void FORTRAN ( mafillpcomp  ,
(ITG *ne, char *lakonf, ITG *ipnei, ITG *neifa, ITG *neiel, double *vfa, double *area, double *adfa, double *xlet, double *cosa, double *volume, double *au, double *ad, ITG *jq, ITG *irow, double *ap, ITG *ielfa, ITG *ifabou, double *xle, double *b, double *xxn, ITG *neq, ITG *nzs, double *hfa, double *gradpel, double *bp, double *xxi, ITG *neij, double *xlen, double *cosb, ITG *ielmatf, ITG *mi, double *a1, double *a2, double *a3, double *velo, double *veloo, double *dtimef, double *shcon, ITG *ntmat_, double *vel, ITG *nactdohinv, double *xrlfa, double *flux, ITG *nefa, ITG *nefb, ITG *iau6, double *xxicn, double *gamma)   
)

◆ FORTRAN() [172/316]

void FORTRAN ( mafillsm  ,
(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, ITG *nmpc, ITG *nodeforc, ITG *ndirforc, double *xforc, ITG *nforc, ITG *nelemload, char *sideload, double *xload, ITG *nload, double *xbody, ITG *ipobody, ITG *nbody, double *cgr, double *ad, double *au, double *bb, ITG *nactdof, ITG *icol, ITG *jq, ITG *irow, ITG *neq, ITG *nzl, ITG *nmethod, ITG *ikmpc, ITG *ilmpc, ITG *ikboun, ITG *ilboun, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, double *prestr, ITG *iprestr, double *vold, ITG *iperturb, double *sti, ITG *nzs, double *stx, double *adb, double *aub, ITG *iexpl, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstiff, ITG *npmat_, double *dtime, char *matname, ITG *mi, ITG *ncmat_, ITG *mass, ITG *stiffness, ITG *buckling, ITG *rhs, ITG *intscheme, double *physcon, double *shcon, ITG *nshcon, double *cocon, ITG *ncocon, double *ttime, double *time, ITG *istep, ITG *kinc, ITG *coriolis, ITG *ibody, double *xloadold, double *reltime, double *veold, double *springarea, ITG *nstate_, double *xstateini, double *xstate, double *thicke, ITG *integerglob, double *doubleglob, char *tieset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *ntie, ITG *nasym, double *pslavsurf, double *pmastsurf, ITG *mortar, double *clearini, ITG *ielprop, double *prop, ITG *ne0, double *fnext, ITG *nea, ITG *neb, ITG *kscale, ITG *iponoel, ITG *inoel, ITG *network)   
)

◆ FORTRAN() [173/316]

void FORTRAN ( mafillsmcsse  ,
(double *co, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, ITG *ipompc, ITG *nodempc, double *coefmpc, ITG *nmpc, ITG *nelemload, char *sideload, double *xload, ITG *nload, double *xbody, ITG *ipobody, ITG *nbody, double *cgr, ITG *nactdof, ITG *neq, ITG *nmethod, ITG *ikmpc, ITG *ilmpc, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, ITG *iprestr, double *vold, ITG *iperturb, double *sti, double *stx, ITG *iexpl, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstiff, ITG *npmat_, double *dtime, char *matname, ITG *mi, ITG *ncmat_, ITG *mass, ITG *stiffness, ITG *buckling, ITG *rhs, ITG *intscheme, double *physcon, double *ttime, double *time, ITG *istep, ITG *iinc, ITG *coriolis, ITG *ibody, double *xloadold, double *reltime, double *veold, double *springarea, ITG *nstate_, double *xstateini, double *xstate, double *thicke, ITG *integerglob, double *doubleglob, char *tieset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *ntie, ITG *nasym, double *pslavsurf, double *pmastsurf, ITG *mortar, double *clearini, ITG *ielprop, double *prop, ITG *ne0, ITG *nea, ITG *neb, double *distmin, ITG *ndesi, ITG *nodedesi, double *df, ITG *jqs, ITG *irows, double *dfminds, ITG *icoordinate, double *dxstiff, double *xdesi, ITG *istartelem, ITG *ialelem, double *v, double *sigma, char *labmpc, ITG *ics, double *cs, ITG *mcs, ITG *nk, ITG *nzss)   
)

◆ FORTRAN() [174/316]

void FORTRAN ( mafillsmse  ,
(double *co, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, ITG *ipompc, ITG *nodempc, double *coefmpc, ITG *nmpc, ITG *nelemload, char *sideload, double *xload, ITG *nload, double *xbody, ITG *ipobody, ITG *nbody, double *cgr, ITG *nactdof, ITG *neq, ITG *nmethod, ITG *ikmpc, ITG *ilmpc, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, ITG *iprestr, double *vold, ITG *iperturb, double *sti, double *stx, ITG *iexpl, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstiff, ITG *npmat_, double *dtime, char *matname, ITG *mi, ITG *ncmat_, ITG *mass, ITG *stiffness, ITG *buckling, ITG *rhs, ITG *intscheme, double *physcon, double *ttime, double *time, ITG *istep, ITG *iinc, ITG *coriolis, ITG *ibody, double *xloadold, double *reltime, double *veold, double *springarea, ITG *nstate_, double *xstateini, double *xstate, double *thicke, ITG *integerglob, double *doubleglob, char *tieset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *ntie, ITG *nasym, double *pslavsurf, double *pmastsurf, ITG *mortar, double *clearini, ITG *ielprop, double *prop, ITG *ne0, ITG *nea, ITG *neb, double *distmin, ITG *ndesi, ITG *nodedesi, double *df, ITG *jqs, ITG *irows, double *dfminds, ITG *icoordinate, double *dxstiff, double *xdesi, ITG *istartelem, ITG *ialelem, double *v, double *sigma, ITG *ieigenfrequency)   
)

◆ FORTRAN() [175/316]

void FORTRAN ( mafillsmas  ,
(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, ITG *nmpc, ITG *nodeforc, ITG *ndirforc, double *xforc, ITG *nforc, ITG *nelemload, char *sideload, double *xload, ITG *nload, double *xbody, ITG *ipobody, ITG *nbody, double *cgr, double *ad, double *au, double *bb, ITG *nactdof, ITG *icol, ITG *jq, ITG *irow, ITG *neq, ITG *nzl, ITG *nmethod, ITG *ikmpc, ITG *ilmpc, ITG *ikboun, ITG *ilboun, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, double *prestr, ITG *iprestr, double *vold, ITG *iperturb, double *sti, ITG *nzs, double *stx, double *adb, double *aub, ITG *iexpl, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstiff, ITG *npmat_, double *dtime, char *matname, ITG *mi, ITG *ncmat_, ITG *mass, ITG *stiffness, ITG *buckling, ITG *rhs, ITG *intscheme, double *physcon, double *shcon, ITG *nshcon, double *cocon, ITG *ncocon, double *ttime, double *time, ITG *istep, ITG *kinc, ITG *coriolis, ITG *ibody, double *xloadold, double *reltime, double *veold, double *springarea, ITG *nstate_, double *xstateini, double *xstate, double *thicke, ITG *integerglob, double *doubleglob, char *tieset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *ntie, ITG *nasym, double *pslavsurf, double *pmastsurf, ITG *mortar, double *clearini, ITG *ielprop, double *prop, ITG *ne0, ITG *kscale, ITG *iponoel, ITG *inoel, ITG *network)   
)

◆ FORTRAN() [176/316]

void FORTRAN ( mafillsmas1  ,
(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, ITG *nmpc, ITG *nodeforc, ITG *ndirforc, double *xforc, ITG *nforc, ITG *nelemload, char *sideload, double *xload, ITG *nload, double *xbody, ITG *ipobody, ITG *nbody, double *cgr, double *ad, double *au, double *bb, ITG *nactdof, ITG *icol, ITG *jq, ITG *irow, ITG *neq, ITG *nzl, ITG *nmethod, ITG *ikmpc, ITG *ilmpc, ITG *ikboun, ITG *ilboun, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, double *prestr, ITG *iprestr, double *vold, ITG *iperturb, double *sti, ITG *nzs, double *stx, double *adb, double *aub, ITG *iexpl, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstiff, ITG *npmat_, double *dtime, char *matname, ITG *mi, ITG *ncmat_, ITG *mass, ITG *stiffness, ITG *buckling, ITG *rhs, ITG *intscheme, double *physcon, double *shcon, ITG *nshcon, double *cocon, ITG *ncocon, double *ttime, double *time, ITG *istep, ITG *kinc, ITG *coriolis, ITG *ibody, double *xloadold, double *reltime, double *veold, double *springarea, ITG *nstate_, double *xstateini, double *xstate, double *thicke, ITG *integerglob, double *doubleglob, char *tieset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *ntie, ITG *nasym, double *pslavsurf, double *pmastsurf, ITG *mortar, double *clearini, ITG *ielprop, double *prop, ITG *ne0, ITG *nea, ITG *neb, ITG *kscale)   
)

◆ FORTRAN() [177/316]

void FORTRAN ( mafillsmcs  ,
(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, ITG *nmpc, ITG *nodeforc, ITG *ndirforc, double *xforc, ITG *nforc, ITG *nelemload, char *sideload, double *xload, ITG *nload, double *xbody, ITG *ipobody, ITG *nbody, double *cgr, double *ad, double *au, double *bb, ITG *nactdof, ITG *icol, ITG *jq, ITG *irow, ITG *neq, ITG *nzl, ITG *nmethod, ITG *ikmpc, ITG *ilmpc, ITG *ikboun, ITG *ilboun, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, double *prestr, ITG *iprestr, double *vold, ITG *iperturb, double *sti, ITG *nzs, double *stx, double *adb, double *aub, ITG *iexpl, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstiff, ITG *npmat_, double *dtime, char *matname, ITG *mi, ITG *ics, double *cs, ITG *nm, ITG *ncmat_, char *labmpc, ITG *mass, ITG *stiffness, ITG *buckling, ITG *rhs, ITG *intscheme, ITG *mcs, ITG *coriolis, ITG *ibody, double *xloadold, double *reltime, ITG *ielcs, double *veold, double *springarea, double *thicke, ITG *integerglob, double *doubleglob, char *tieset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *ntie, ITG *nasym, double *pslavsurf, double *pmastsurf, ITG *mortar, double *clearini, ITG *ielprop, double *prop, ITG *ne0, ITG *kscale, double *xstateini, double *xstate, ITG *nstate_)   
)

◆ FORTRAN() [178/316]

void FORTRAN ( mafillsmcsas  ,
(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, ITG *nmpc, ITG *nodeforc, ITG *ndirforc, double *xforc, ITG *nforc, ITG *nelemload, char *sideload, double *xload, ITG *nload, double *xbody, ITG *ipobody, ITG *nbody, double *cgr, double *ad, double *au, double *bb, ITG *nactdof, ITG *icol, ITG *jq, ITG *irow, ITG *neq, ITG *nzl, ITG *nmethod, ITG *ikmpc, ITG *ilmpc, ITG *ikboun, ITG *ilboun, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, double *prestr, ITG *iprestr, double *vold, ITG *iperturb, double *sti, ITG *nzs, double *stx, double *adb, double *aub, ITG *iexpl, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstiff, ITG *npmat_, double *dtime, char *matname, ITG *mi, ITG *ics, double *cs, ITG *nm, ITG *ncmat_, char *labmpc, ITG *mass, ITG *stiffness, ITG *buckling, ITG *rhs, ITG *intscheme, ITG *mcs, ITG *coriolis, ITG *ibody, double *xloadold, double *reltime, ITG *ielcs, double *veold, double *springarea, double *thicke, ITG *integerglob, double *doubleglob, char *tieset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *ntie, ITG *nasym, ITG *nstate_, double *xstateini, double *xstate, double *pslavsurf, double *pmastsurf, ITG *mortar, double *clearini, ITG *ielprop, double *prop, ITG *ne0, ITG *kscale)   
)

◆ FORTRAN() [179/316]

void FORTRAN ( mafillsmforc  ,
(ITG *nforc, ITG *ndirforc, ITG *nodeforc, double *xforc, ITG *nactdof, double *fext, ITG *nmpc, ITG *ipompc, ITG *nodempc, ITG *ikmpc, ITG *ilmpc, double *coefmpc, ITG *mi, ITG *rhsi, double *fnext, ITG *nmethod)   
)

◆ FORTRAN() [180/316]

void FORTRAN ( mafillsm_company  ,
(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, ITG *nmpc, ITG *nodeforc, ITG *ndirforc, double *xforc, ITG *nforc, ITG *nelemload, char *sideload, double *xload, ITG *nload, double *xbody, ITG *ipobody, ITG *nbody, double *cgr, double *ad, double *au, double *bb, ITG *nactdof, ITG *icol, ITG *jq, ITG *irow, ITG *neq, ITG *nzl, ITG *nmethod, ITG *ikmpc, ITG *ilmpc, ITG *ikboun, ITG *ilboun, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, double *prestr, ITG *iprestr, double *vold, ITG *iperturb, double *sti, ITG *nzs, double *stx, double *adb, double *aub, ITG *iexpl, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstiff, ITG *npmat_, double *dtime, char *matname, ITG *mi, ITG *ncmat_, ITG *mass, ITG *stiffness, ITG *buckling, ITG *rhs, ITG *intscheme, double *physcon, double *shcon, ITG *nshcon, double *cocon, ITG *ncocon, double *ttime, double *time, ITG *istep, ITG *kinc, ITG *coriolis, ITG *ibody, double *xloadold, double *reltime, double *veold, double *springarea, ITG *nstate_, double *xstateini, double *xstate, double *thicke, ITG *integerglob, double *doubleglob, char *tieset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *ntie, ITG *nasym, double *pslavsurf, double *pmastsurf, ITG *mortar, double *clearini, ITG *ielprop, double *prop, ITG *ne0, double *fnext, ITG *kscale, ITG *iponoel, ITG *inoel, ITG *network)   
)

◆ FORTRAN() [181/316]

void FORTRAN ( mafillt  ,
(ITG *nef, ITG *ipnei, ITG *neifa, ITG *neiel, double *vfa, double *xxn, double *area, double *au, double *ad, ITG *jq, ITG *irow, ITG *nzs, double *b, double *vel, double *umel, double *xlet, double *xle, double *gradtfa, double *xxi, double *body, double *volume, ITG *ielfa, char *lakonf, ITG *ifabou, ITG *nbody, ITG *neq, double *dtimef, double *velo, double *veloo, double *cpfa, double *hcfa, double *cvel, double *gradvel, double *xload, double *gammat, double *xrlfa, double *xxj, ITG *nactdohinv, double *a1, double *a2, double *a3, double *flux, ITG *nefa, ITG *nefb, ITG *iau6, double *xxni, double *xxnj, ITG *iturbulent)   
)

◆ FORTRAN() [182/316]

void FORTRAN ( mafilltcomp  ,
(ITG *nef, ITG *ipnei, ITG *neifa, ITG *neiel, double *vfa, double *xxn, double *area, double *au, double *ad, ITG *jq, ITG *irow, ITG *nzs, double *b, double *vel, double *umel, double *xlet, double *xle, double *gradtfa, double *xxi, double *body, double *volume, ITG *ielfa, char *lakonf, ITG *ifabou, ITG *nbody, ITG *neq, double *dtimef, double *velo, double *veloo, double *cpfa, double *hcfa, double *cvel, double *gradvel, double *xload, double *gammat, double *xrlfa, double *xxj, ITG *nactdohinv, double *a1, double *a2, double *a3, double *flux, ITG *nefa, ITG *nefb, ITG *iau6, double *xxni, double *xxnj)   
)

◆ FORTRAN() [183/316]

void FORTRAN ( mafillv  ,
(ITG *nef, ITG *ipnei, ITG *neifa, ITG *neiel, double *vfa, double *xxn, double *area, double *au, double *ad, ITG *jq, ITG *irow, ITG *nzs, double *b, double *vel, double *cosa, double *umfa, double *xlet, double *xle, double *gradvfa, double *xxi, double *body, double *volume, ITG *ielfa, char *lakonf, ITG *ifabou, ITG *nbody, double *dtimef, double *velo, double *veloo, double *sel, double *xrlfa, double *gamma, double *xxj, ITG *nactdohinv, double *a1, double *a2, double *a3, double *flux, ITG *nefa, ITG *nefb, ITG *icyclic, double *c, ITG *ifatie, ITG *iau6, double *xxni, double *xxnj, ITG *iturbulent, double *gradvel)   
)

◆ FORTRAN() [184/316]

void FORTRAN ( mafillvcomp  ,
(ITG *nef, ITG *ipnei, ITG *neifa, ITG *neiel, double *vfa, double *xxn, double *area, double *au, double *ad, ITG *jq, ITG *irow, ITG *nzs, double *b, double *vel, double *cosa, double *umfa, double *xlet, double *xle, double *gradvfa, double *xxi, double *body, double *volume, ITG *ielfa, char *lakonf, ITG *ifabou, ITG *nbody, double *dtimef, double *velo, double *veloo, double *sel, double *xrlfa, double *gamma, double *xxj, ITG *nactdohinv, double *a1, double *a2, double *a3, double *flux, ITG *nefa, ITG *nefb, ITG *icyclic, double *c, ITG *ifatie, ITG *iau6, double *xxni, double *xxnj)   
)

◆ FORTRAN() [185/316]

void FORTRAN ( materialdata_cfd  ,
(ITG *nef, double *vel, double *shcon, ITG *nshcon, ITG *ielmat, ITG *ntmat_, ITG *mi, double *cvel, double *vfa, double *cocon, ITG *ncocon, double *physcon, double *cvfa, ITG *ithermal, ITG *nface, double *umel, double *umfa, ITG *ielfa, double *hcfa, double *rhcon, ITG *nrhcon)   
)

◆ FORTRAN() [186/316]

void FORTRAN ( materialdata_cfd_comp  ,
(ITG *nef, double *vel, double *shcon, ITG *nshcon, ITG *ielmat, ITG *ntmat_, ITG *mi, double *cvel, double *vfa, double *cocon, ITG *ncocon, double *physcon, double *cvfa, ITG *ithermal, ITG *nface, double *umel, double *umfa, ITG *ielfa, double *hcfa)   
)

◆ FORTRAN() [187/316]

void FORTRAN ( meannode  ,
(ITG *nk, ITG *inum, double *v)   
)

◆ FORTRAN() [188/316]

void FORTRAN ( mpcrem  ,
(ITG *i, ITG *mpcfree, ITG *nodempc, ITG *nmpc, ITG *ikmpc, ITG *ilmpc, char *labmpc, double *coefmpc, ITG *ipompc)   
)

◆ FORTRAN() [189/316]

void FORTRAN ( mult  ,
(double *matrix, double *trans, ITG *n)   
)

◆ FORTRAN() [190/316]

void FORTRAN ( negativepressure  ,
(ITG *ne0, ITG *ne, ITG *mi, double *stx, double *pressureratio)   
)

◆ FORTRAN() [191/316]

void FORTRAN ( networkelementpernode  ,
(ITG *iponoel, ITG *inoel, char *lakon, ITG *ipkon, ITG *kon, ITG *inoelsize, ITG *nflow, ITG *ieg, ITG *ne, ITG *network)   
)

◆ FORTRAN() [192/316]

void FORTRAN ( networkinum  ,
(ITG *ipkon, ITG *inum, ITG *kon, char *lakon, ITG *ne, ITG *itg, ITG *ntg)   
)

◆ FORTRAN() [193/316]

void FORTRAN ( nident  ,
(ITG *x, ITG *px, ITG *n, ITG *id)   
)

◆ FORTRAN() [194/316]

void FORTRAN ( nidentll  ,
(long long *x, long long *px, ITG *n, ITG *id)   
)

◆ FORTRAN() [195/316]

void FORTRAN ( nodestiedface  ,
(char *tieset, ITG *ntie, ITG *ipkon, ITG *kon, char *lakon, char *set, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nset, ITG *faceslave, ITG *istartfield, ITG *iendfield, ITG *ifield, ITG *nconf, ITG *ncone, char *kind)   
)

◆ FORTRAN() [196/316]

void FORTRAN ( nonlinmpc  ,
(double *co, double *vold, ITG *ipompc, ITG *nodempc, double *coefmpc, char *labmpc, ITG *nmpc, ITG *ikboun, ITG *ilboun, ITG *nboun, double *xbounact, double *aux, ITG *iaux, ITG *maxlenmpc, ITG *ikmpc, ITG *ilmpc, ITG *icascade, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, double *reltime, ITG *newstep, double *xboun, double *fmpc, ITG *newinc, ITG *idiscon, ITG *ncont, double *trab, ITG *ntrans, ITG *ithermal, ITG *mi)   
)

◆ FORTRAN() [197/316]

void FORTRAN ( norm  ,
(double *vel, double *velnorm, ITG *nef)   
)

◆ FORTRAN() [198/316]

void FORTRAN ( normalsforequ_se  ,
(ITG *nk, double *co, ITG *iponoelfa, ITG *inoelfa, ITG *konfa, ITG *ipkonfa, char *lakonfa, ITG *ne, ITG *ipnor, double *xnor, ITG *nodedesiinv, char *jobnamef)   
)

◆ FORTRAN() [199/316]

void FORTRAN ( normalsoninterface  ,
(ITG *istartset, ITG *iendset, ITG *ialset, ITG *imast, ITG *ipkon, ITG *kon, char *lakon, ITG *imastnode, ITG *nmastnode, double *xmastnor, double *co)   
)

◆ FORTRAN() [200/316]

void FORTRAN ( normalsonsurface_se  ,
(ITG *ipkon, ITG *kon, char *lakon, double *extnor, double *co, ITG *nk, ITG *ipoface, ITG *nodface, ITG *nactdof, ITG *mi, ITG *nodedesiinv, ITG *noregion)   
)

◆ FORTRAN() [201/316]

void FORTRAN ( objective_disp  ,
(ITG *nodeset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nk, ITG *idesvar, ITG *iobject, ITG *mi, double *g0, ITG *nobject, double *vold)   
)

◆ FORTRAN() [202/316]

void FORTRAN ( objective_disp_dx  ,
(ITG *nodeset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nk, ITG *idesvar, ITG *iobject, ITG *mi, ITG *nactdof, double *dgdx, ITG *ndesi, ITG *nobject, double *vold, double *b)   
)

◆ FORTRAN() [203/316]

void FORTRAN ( objective_freq  ,
(double *dgdx, double *df, double *vold, ITG *ndesi, ITG *iobject, ITG *mi, ITG *nactdofinv, ITG *jqs, ITG *irows)   
)

◆ FORTRAN() [204/316]

void FORTRAN ( objective_freq_cs  ,
(double *dgdx, double *df, double *vold, ITG *ndesi, ITG *iobject, ITG *mi, ITG *nactdofinv, ITG *jqs, ITG *irows, ITG *nk, ITG *nzss)   
)

◆ FORTRAN() [205/316]

void FORTRAN ( objective_mass_dx  ,
(double *co1, ITG *kon1, ITG *ipkon1, char *lakon1, ITG *nelcon1, double *rhcon1, ITG *ielmat1, ITG *ielorien1, ITG *norien1, ITG *ntmat1_, char *matname1, ITG *mi1, double *thicke1, ITG *mortar1, ITG *nea, ITG *neb, ITG *ielprop1, double *prop1, double *distmin1, ITG *ndesi1, ITG *nodedesi1, ITG *nobject1, double *g01, double *dgdx1, ITG *iobject1, double *xmass1, ITG *istartdesi1, ITG *ialdesi1, double *xdesi1, ITG *idesvar)   
)

◆ FORTRAN() [206/316]

void FORTRAN ( objective_shapeener_dx  ,
(double *co1, ITG *kon1, ITG *ipkon1, char *lakon1, ITG *ne1, double *stx1, double *elcon1, ITG *nelcon1, double *rhcon1, ITG *nrhcon1, double *alcon1, ITG *nalcon1, double *alzero1, ITG *ielmat1, ITG *ielorien1, ITG *norien1, double *orab1, ITG *ntmat1_, double *t01, double *t11, ITG *ithermal1, double *prestr1, ITG *iprestr1, ITG *iperturb1, ITG *iout1, double *vold1, ITG *nmethod1, double *veold1, double *dtime1, double *time1, double *ttime1, double *plicon1, ITG *nplicon1, double *plkcon1, ITG *nplkcon1, double *xstateini1, double *xstiff1, double *xstate1, ITG *npmat1_, char *matname1, ITG *mi1, ITG *ielas1, ITG *icmd1, ITG *ncmat1_, ITG *nstate1_, double *stiini1, double *vini1, double *ener1, double *enerini1, ITG *istep1, ITG *iinc1, double *springarea1, double *reltime1, ITG *calcul_qa1, ITG *iener1, ITG *ikin1, ITG *ne01, double *thicke1, double *emeini1, double *pslavsurf1, double *pmastsurf1, ITG *mortar1, double *clearini1, ITG *nea, ITG *neb, ITG *ielprop1, double *prop1, double *distmin1, ITG *ndesi1, ITG *nodedesi1, ITG *nobject1, double *g01, double *dgdx1, ITG *iobject1, double *sti1, double *xener1, ITG *istartdesi1, ITG *ialdesi1, double *xdesi1, ITG *idesvar)   
)

◆ FORTRAN() [207/316]

void FORTRAN ( objective_shapeener_tot  ,
(ITG *ne, ITG *kon, ITG *ipkon, char *lakon, double *fint, double *vold, ITG *iperturb, ITG *mi, ITG *nactdof, double *dgdx, double *df, ITG *ndesi, ITG *iobject, ITG *jqs, ITG *irows, double *vec)   
)

◆ FORTRAN() [208/316]

void FORTRAN ( objective_stress  ,
(ITG *nodeset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nk, ITG *idesvar, ITG *iobject, ITG *mi, double *g0, ITG *nobject, double *stn, char *objectset)   
)

◆ FORTRAN() [209/316]

void FORTRAN ( objective_stress_dx  ,
(ITG *nodeset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nk, ITG *idesvar, ITG *iobject, double *dgdx, ITG *ndesi, ITG *nobject, double *stn, double *dstn, char *objectset, double *g0)   
)

◆ FORTRAN() [210/316]

void FORTRAN ( op  ,
(ITG *n, double *x, double *y, double *ad, double *au, ITG *jq, ITG *irow)   
)

◆ FORTRAN() [211/316]

void FORTRAN ( opas  ,
(ITG *n, double *x, double *y, double *ad, double *au, ITG *jq, ITG *irow, ITG *nzs)   
)

◆ FORTRAN() [212/316]

void FORTRAN ( op_corio  ,
(ITG *n, double *x, double *y, double *ad, double *au, ITG *jq, ITG *irow)   
)

◆ FORTRAN() [213/316]

void FORTRAN ( openfile  ,
(char *jobname, char *output)   
)

◆ FORTRAN() [214/316]

void FORTRAN ( openfilefluid  ,
(char *jobname)   
)

◆ FORTRAN() [215/316]

void FORTRAN ( posttransition  ,
(double *dgdxglob, ITG *nobject, ITG *nk, ITG *nodedesi, ITG *ndesi, char *objectset)   
)

◆ FORTRAN() [216/316]

void FORTRAN ( postview  ,
(ITG *ntr, char *sideload, ITG *nelemload, ITG *kontri, ITG *ntri, ITG *nloadtr, double *tenv, double *adview, double *auview, double *area, double *fenv, ITG *jqrad, ITG *irowrad, ITG *nzsrad)   
)

◆ FORTRAN() [217/316]

void FORTRAN ( precfd  ,
(ITG *ne, ITG *ipkon, ITG *kon, char *lakon, ITG *ipnei, ITG *neifa, ITG *neiel, ITG *ipoface, ITG *nodface, ITG *ielfa, ITG *nkonnei, ITG *nface, ITG *ifaext, ITG *nfaext, ITG *isolidsurf, ITG *nsolidsurf, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, double *vel, double *vold, ITG *mi, ITG *neij, ITG *nef, ITG *nactdoh, ITG *ipkonf, char *lakonf, ITG *ielmatf, ITG *ielmat, ITG *ielorienf, ITG *ielorien, ITG *norien, double *cs, ITG *mcs, char *tieset, double *x, double *y, double *z, double *xo, double *yo, double *zo, ITG *nx, ITG *ny, ITG *nz, double *co, ITG *ifatei)   
)

◆ FORTRAN() [218/316]

void FORTRAN ( preconvert2slapcol  ,
(ITG *irow, ITG *ia, ITG *jq, ITG *ja, ITG *nzs, ITG *nef)   
)

◆ FORTRAN() [219/316]

void FORTRAN ( predgmres  ,
(ITG *n, double *b, double *x, ITG *nelt, ITG *ia, ITG *ja, double *a, ITG *isym, ITG *itol, double *tol, ITG *itmax, ITG *iter, double *err, ITG *ierr, ITG *iunit, double *sb, double *sx, double *rgwk, ITG *lrgw, ITG *igwk, ITG *ligw, double *rwork, ITG *iwork)   
)

◆ FORTRAN() [220/316]

void FORTRAN ( prefilter  ,
(double *co, ITG *nodedesi, ITG *ndesi, double *xo, double *yo, double *zo, double *x, double *y, double *z, ITG *nx, ITG *ny, ITG *nz)   
)

◆ FORTRAN() [221/316]

void FORTRAN ( prethickness  ,
(double *co, double *xo, double *yo, double *zo, double *x, double *y, double *z, ITG *nx, ITG *ny, ITG *nz, ITG *ifree, ITG *nodedesiinv, ITG *ndesiboun, ITG *nodedesiboun, char *set, ITG *nset, char *objectset, ITG *iobject, ITG *istartset, ITG *iendset, ITG *ialset)   
)

◆ FORTRAN() [222/316]

void FORTRAN ( pretransition  ,
(ITG *ipkon, ITG *kon, char *lakon, double *co, ITG *nk, ITG *ipoface, ITG *nodface, ITG *nodedesiinv, double *xo, double *yo, double *zo, double *x, double *y, double *z, ITG *nx, ITG *ny, ITG *nz, ITG *ifree)   
)

◆ FORTRAN() [223/316]

void FORTRAN ( printoutfluid  ,
(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nprint, char *prlab, char *prset, ITG *ipkon, char *lakon, double *stx, double *eei, double *xstate, double *ener, ITG *mi, ITG *nstate_, double *co, ITG *kon, double *qfx, double *ttime, double *trab, ITG *inotr, ITG *ntrans, double *orab, ITG *ielorien, ITG *norien, double *vold, ITG *ielmatf, double *thicke, double *eme, double *vcontu, double *physcon, ITG *nactdoh, ITG *ielpropf, double *prop, double *xkappa, double *xmach, ITG *ithermal, char *orname)   
)

◆ FORTRAN() [224/316]

void FORTRAN ( printoutface  ,
(double *co, double *rhcon, ITG *nrhcon, ITG *ntmat_, double *vold, double *shcon, ITG *nshcon, double *cocon, ITG *ncocon, ITG *icompressible, ITG *istartset, ITG *iendset, ITG *ipkon, char *lakon, ITG *kon, ITG *ialset, char *prset, double *timef, ITG *nset, char *set, ITG *nprint, char *prlab, ITG *ielmat, ITG *mi, ITG *ithermal, ITG *nactdoh, ITG *icfd, double *time, double *stn)   
)

◆ FORTRAN() [225/316]

void FORTRAN ( propertynet  ,
(ITG *ieg, ITG *nflow, double *prop, ITG *ielprop, char *lakon, ITG *iin, double *prop_store, double *ttime, double *time, ITG *nam, char *amname, ITG *namta, double *amta)   
)

◆ FORTRAN() [226/316]

void FORTRAN ( radmatrix  ,
(ITG *ntr, double *adrad, double *aurad, double *bcr, char *sideload, ITG *nelemload, double *xloadact, char *lakon, double *vold, ITG *ipkon, ITG *kon, double *co, ITG *nloadtr, double *tarea, double *tenv, double *physcon, double *erad, double *adview, double *auview, ITG *ithermal, ITG *iinc, ITG *iit, double *fenv, ITG *istep, double *dtime, double *ttime, double *time, ITG *iviewfile, double *xloadold, double *reltime, ITG *nmethod, ITG *mi, ITG *iemchange, ITG *nam, ITG *iamload, ITG *jqrad, ITG *irowrad, ITG *nzsrad)   
)

◆ FORTRAN() [227/316]

void FORTRAN ( radresult  ,
(ITG *ntr, double *xloadact, double *bcr, ITG *nloadtr, double *tarea, double *tenv, double *physcon, double *erad, double *auview, double *fenv, ITG *irowrad, ITG *jqrad, ITG *nzsrad, double *q)   
)

◆ FORTRAN() [228/316]

void FORTRAN ( randomval  ,
(double *randval, ITG *nev)   
)

◆ FORTRAN() [229/316]

void FORTRAN ( readforce  ,
(double *zc, ITG *neq, ITG *nev, ITG *nactdof, ITG *ikmpc, ITG *nmpc, ITG *ipompc, ITG *nodempc, ITG *mi, double *coefmpc, char *jobnamec, double *aa, ITG *igeneralizedforce)   
)

◆ FORTRAN() [230/316]

void FORTRAN ( readview  ,
(ITG *ntr, double *adview, double *auview, double *fenv, ITG *nzsrad, ITG *ithermal, char *jobnamef)   
)

◆ FORTRAN() [231/316]

void FORTRAN ( rearrange  ,
(double *au, ITG *irow, ITG *icol, ITG *ndim, ITG *neq)   
)

◆ FORTRAN() [232/316]

void FORTRAN ( rectcyl  ,
(double *co, double *v, double *fn, double *stn, double *qfn, double *een, double *cs, ITG *nk, ITG *icntrl, double *t, char *filab, ITG *imag, ITG *mi, double *emn)   
)

◆ FORTRAN() [233/316]

void FORTRAN ( rectcylexp  ,
(double *co, double *v, double *fn, double *stn, double *qfn, double *een, double *cs, ITG *nkt, ITG *icntrl, double *t, char *filab, ITG *imag, ITG *mi, ITG *iznode, ITG *nznode, ITG *nsectors, ITG *nk, double *emn)   
)

◆ FORTRAN() [234/316]

void FORTRAN ( rectcyltrfm  ,
(ITG *node, double *co, double *cs, ITG *cntrl, double *fin, double *fout)   
)

◆ FORTRAN() [235/316]

void FORTRAN ( rectcylvi  ,
(double *co, double *v, double *fn, double *stn, double *qfn, double *een, double *cs, ITG *nk, ITG *icntrl, double *t, char *filab, ITG *imag, ITG *mi, double *emn)   
)

◆ FORTRAN() [236/316]

void FORTRAN ( restartshort  ,
(ITG *nset, ITG *nload, ITG *nbody, ITG *nforc, ITG *nboun, ITG *nk, ITG *ne, ITG *nmpc, ITG *nalset, ITG *nmat, ITG *ntmat, ITG *npmat, ITG *norien, ITG *nam, ITG *nprint, ITG *mint, ITG *ntrans, ITG *ncs, ITG *namtot, ITG *ncmat, ITG *memmpc, ITG *ne1d, ITG *ne2d, ITG *nflow, char *set, ITG *meminset, ITG *rmeminset, char *jobnamec, ITG *irestartstep, ITG *icntrl, ITG *ithermal, ITG *nener, ITG *nstate_, ITG *ntie, ITG *nslavs, ITG *nkon, ITG *mcs, ITG *nprop, ITG *mortar, ITG *ifacecount, ITG *nintpoint, ITG *infree)   
)

◆ FORTRAN() [237/316]

void FORTRAN ( restartwrite  ,
(ITG *istep, ITG *nset, ITG *nload, ITG *nforc, ITG *nboun, ITG *nk, ITG *ne, ITG *nmpc, ITG *nalset, ITG *nmat, ITG *ntmat_, ITG *npmat_, ITG *norien, ITG *nam, ITG *nprint, ITG *mi, ITG *ntrans, ITG *ncs_, ITG *namtot_, ITG *ncmat_, ITG *mpcend, ITG *maxlenmpc, ITG *ne1d, ITG *ne2d, ITG *nflow, ITG *nlabel, ITG *iplas, ITG *nkon, ITG *ithermal, ITG *nmethod, ITG *iperturb, ITG *nstate_, ITG *nener, char *set, ITG *istartset, ITG *iendset, ITG *ialset, double *co, ITG *kon, ITG *ipkon, char *lakon, ITG *nodeboun, ITG *ndirboun, ITG *iamboun, double *xboun, ITG *ikboun, ITG *ilboun, ITG *ipompc, ITG *nodempc, double *coefmpc, char *labmpc, ITG *ikmpc, ITG *ilmpc, ITG *nodeforc, ITG *ndirforc, ITG *iamforc, double *xforc, ITG *ikforc, ITG *ilforc, ITG *nelemload, ITG *iamload, char *sideload, double *xload, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, char *orname, double *orab, ITG *ielorien, double *trab, ITG *inotr, char *amname, double *amta, ITG *namta, double *t0, double *t1, ITG *iamt1, double *veold, ITG *ielmat, char *matname, char *prlab, char *prset, char *filab, double *vold, ITG *nodebounold, ITG *ndirbounold, double *xbounold, double *xforcold, double *xloadold, double *t1old, double *eme, ITG *iponor, double *xnor, ITG *knor, double *thicke, double *offset, ITG *iponoel, ITG *inoel, ITG *rig, double *shcon, ITG *nshcon, double *cocon, ITG *ncocon, ITG *ics, double *sti, double *ener, double *xstate, char *jobnamec, ITG *infree, double *prestr, ITG *iprestr, char *cbody, ITG *ibody, double *xbody, ITG *nbody, double *xbodyold, double *ttime, double *qaold, double *cs, ITG *mcs, char *output, double *physcon, double *ctrl, char *typeboun, double *fmpc, char *tieset, ITG *ntie, double *tietol, ITG *nslavs, double *t0g, double *t1g, ITG *nprop, ITG *ielprop, double *prop, ITG *mortar, ITG *nintpoint, ITG *ifacecount, ITG *islavsurf, double *pslavsurf, double *clearini)   
)

◆ FORTRAN() [238/316]

void FORTRAN ( resultnet  ,
(ITG *itg, ITG *ieg, ITG *ntg, double *bc, ITG *nload, char *sideload, ITG *nelemload, double *xloadact, char *lakon, ITG *ntmat_, double *v, double *shcon, ITG *nshcon, ITG *ipkon, ITG *kon, double *co, ITG *nflow, ITG *iinc, ITG *istep, double *dtime, double *ttime, double *time, ITG *ikforc, ITG *ilforc, double *xforcact, ITG *nforc, ITG *ielmat, ITG *nteq, double *prop, ITG *ielprop, ITG *nactdog, ITG *nacteq, ITG *iin, double *physcon, double *camt, double *camf, double *camp, double *rhcon, ITG *nrhcon, ITG *ipobody, ITG *ibody, double *xbody, ITG *nbody, double *dtheta, double *vold, double *xloadold, double *reltime, ITG *nmethod, char *set, ITG *mi, ITG *ineighe, double *cama, double *vamt, double *vamf, double *vamp, double *vama, ITG *nmpc, ITG *nodempc, ITG *ipompc, double *coefmpc, char *labmpc, ITG *iaxial, double *qat, double *qaf, double *ramt, double *ramf, double *ramp, double *cocon, ITG *ncocon, ITG *iponoel, ITG *inoel, ITG *iplausi)   
)

◆ FORTRAN() [239/316]

void FORTRAN ( resultsem  ,
(double *co, ITG *kon, ITG *ipkon, char *lakon, double *v, double *elcon, ITG *nelcon, ITG *ielmat, ITG *ntmat_, double *vold, double *dtime, char *matname, ITG *mi, ITG *ncmat_, ITG *nea, ITG *neb, double *sti, double *alcon, ITG *nalcon, double *h0, ITG *istartset, ITG *iendset, ITG *ialset, ITG *iactive, double *fn)   
)

◆ FORTRAN() [240/316]

void FORTRAN ( resultsforc  ,
(ITG *nk, double *f, double *fn, ITG *nactdof, ITG *ipompc, ITG *nodempc, double *coefmpc, char *labmpc, ITG *nmpc, ITG *mi, double *fmpc, ITG *calcul_fn, ITG *calcul_f)   
)

◆ FORTRAN() [241/316]

void FORTRAN ( resultsforc_em  ,
(ITG *nk, double *f, double *fn, ITG *nactdof, ITG *ipompc, ITG *nodempc, double *coefmpc, char *labmpc, ITG *nmpc, ITG *mi, double *fmpc, ITG *calcul_fn, ITG *calcul_f, ITG *inomat)   
)

◆ FORTRAN() [242/316]

void FORTRAN ( resultsforc_se  ,
(ITG *nk, double *dfn, ITG *nactdof, ITG *ipompc, ITG *nodempc, double *coefmpc, ITG *nmpc, ITG *mi, double *fmpc, ITG *calcul_fn, ITG *calcul_f, ITG *idesvar, double *df, ITG *jqs, ITG *irows, double *distmin)   
)

◆ FORTRAN() [243/316]

void FORTRAN ( resultsini  ,
(ITG *nk, double *v, ITG *ithermal, char *filab, ITG *iperturb, double *f, double *fn, ITG *nactdof, ITG *iout, double *qa, double *vold, double *b, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, char *labmpc, ITG *nmpc, ITG *nmethod, double *cam, ITG *neq, double *veold, double *accold, double *bet, double *gam, double *dtime, ITG *mi, double *vini, ITG *nprint, char *prlab, ITG *intpointvar, ITG *calcul_fn, ITG *calcul_f, ITG *calcul_qa, ITG *calcul_cauchy, ITG *iener, ITG *ikin, ITG *intpointvart, double *xforc, ITG *nforc)   
)

◆ FORTRAN() [244/316]

void FORTRAN ( resultsini_em  ,
(ITG *nk, double *v, ITG *ithermal, char *filab, ITG *iperturb, double *f, double *fn, ITG *nactdof, ITG *iout, double *qa, double *b, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, char *labmpc, ITG *nmpc, ITG *nmethod, double *cam, ITG *neq, double *veold, double *dtime, ITG *mi, double *vini, ITG *nprint, char *prlab, ITG *intpointvar, ITG *calcul_fn, ITG *calcul_f, ITG *calcul_qa, ITG *calcul_cauchy, ITG *iener, ITG *ikin, ITG *intpointvart, double *xforc, ITG *nforc)   
)

◆ FORTRAN() [245/316]

void FORTRAN ( resultsmech  ,
(double *co, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, double *v, double *stx, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, double *prestr, ITG *iprestr, double *eme, ITG *iperturb, double *fn, ITG *iout, double *qa, double *vold, ITG *nmethod, double *veold, double *dtime, double *time, double *ttime, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstateini, double *xstiff, double *xstate, ITG *npmat_, char *matname, ITG *mi, ITG *ielas, ITG *icmd, ITG *ncmat_, ITG *nstate_, double *stiini, double *vini, double *ener, double *eei, double *enerini, ITG *istep, ITG *iinc, double *springarea, double *reltime, ITG *calcul_fn, ITG *calcul_qa, ITG *calcul_cauchy, ITG *iener, ITG *ikin, ITG *nal, ITG *ne0, double *thicke, double *emeini, double *pslavsurf, double *pmastsurf, ITG *mortar, double *clearini, ITG *nea, ITG *neb, ITG *ielprop, double *prop, ITG *kscale)   
)

◆ FORTRAN() [246/316]

void FORTRAN ( resultsmech_se  ,
(double *co, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, double *v, double *stx, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, double *prestr, ITG *iprestr, double *eme, ITG *iperturb, double *fn, ITG *iout, double *vold, ITG *nmethod, double *veold, double *dtime, double *time, double *ttime, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstateini, double *xstiff, double *xstate, ITG *npmat_, char *matname, ITG *mi, ITG *ielas, ITG *icmd, ITG *ncmat_, ITG *nstate_, double *stiini, double *vini, double *ener, double *eei, double *enerini, ITG *istep, ITG *iinc, double *springarea, double *reltime, ITG *calcul_fn, ITG *calcul_cauchy, ITG *iener, ITG *ikin, ITG *ne0, double *thicke, double *emeini, double *pslavsurf, double *pmastsurf, ITG *mortar, double *clearini, ITG *nea, ITG *neb, ITG *ielprop, double *prop, double *dfn, ITG *idesvar, ITG *nodedesi, double *fn0, double *sti, ITG *icoordinate, double *dxstiff, ITG *ialdesi, double *xdesi)   
)

◆ FORTRAN() [247/316]

void FORTRAN ( resultsnoddir  ,
(ITG *nk, double *v, ITG *nactdof, double *b, ITG *ipompc, ITG *nodempc, double *coefmpc, ITG *nmpc, ITG *mi)   
)

◆ FORTRAN() [248/316]

void FORTRAN ( resultsprint  ,
(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, double *v, double *stn, ITG *inum, double *stx, ITG *ielorien, ITG *norien, double *orab, double *t1, ITG *ithermal, char *filab, double *een, ITG *iperturb, double *fn, ITG *nactdof, ITG *iout, double *vold, ITG *nodeboun, ITG *ndirboun, ITG *nboun, ITG *nmethod, double *ttime, double *xstate, double *epn, ITG *mi, ITG *nstate_, double *ener, double *enern, double *xstaten, double *eei, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nprint, char *prlab, char *prset, double *qfx, double *qfn, double *trab, ITG *inotr, ITG *ntrans, ITG *nelemload, ITG *nload, ITG *ikin, ITG *ielmat, double *thicke, double *eme, double *emn, double *rhcon, ITG *nrhcon, double *shcon, ITG *nshcon, double *cocon, ITG *ncocon, ITG *ntmat_, char *sideload, ITG *icfd, ITG *inomat, double *pslavsurf, ITG *islavact, double *cdn, ITG *mortar, ITG *islavnode, ITG *nslavnode, ITG *ntie, ITG *islavsurf, double *time, ITG *ielprop, double *prop, double *veold, ITG *ne0, ITG *nmpc, ITG *ipompc, ITG *nodempc, char *labmpc, double *energyini, double *energy, char *orname, double *xload)   
)

◆ FORTRAN() [249/316]

void FORTRAN ( resultstherm  ,
(double *co, ITG *kon, ITG *ipkon, char *lakon, double *v, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, ITG *iperturb, double *fn, double *shcon, ITG *nshcon, ITG *iout, double *qa, double *vold, ITG *ipompc, ITG *nodempc, double *coefmpc, ITG *nmpc, double *dtime, double *time, double *ttime, double *plkcon, ITG *nplkcon, double *xstateini, double *xstiff, double *xstate, ITG *npmat_, char *matname, ITG *mi, ITG *ncmat_, ITG *nstate_, double *cocon, ITG *ncocon, double *qfx, ITG *ikmpc, ITG *ilmpc, ITG *istep, ITG *iinc, double *springarea, ITG *calcul_fn, ITG *calcul_qa, ITG *nal, ITG *nea, ITG *neb, ITG *ithermal, ITG *nelemload, ITG *nload, ITG *nmethod, double *reltime, char *sideload, double *xload, double *xloadold, double *pslavsurf, double *pmastsurf, ITG *mortar, double *clearini, double *plicon, ITG *nplicon, ITG *ielprop, double *prop, ITG *iponoel, ITG *inoel, ITG *network, ITG *ipobody, double *xbodyact, ITG *ibody)   
)

◆ FORTRAN() [250/316]

void FORTRAN ( rhs  ,
(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, ITG *ipompc, ITG *nodempc, double *coefmpc, ITG *nmpc, ITG *nodeforc, ITG *ndirforc, double *xforc, ITG *nforc, ITG *nelemload, char *sideload, double *xload, ITG *nload, double *xbody, ITG *ipobody, ITG *nbody, double *cgr, double *bb, ITG *nactdof, ITG *neq, ITG *nmethod, ITG *ikmpc, ITG *ilmpc, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, ITG *iprestr, double *vold, ITG *iperturb, ITG *iexpl, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, ITG *npmat_, double *ttime, double *time, ITG *istep, ITG *iinc, double *dtime, double *physcon, ITG *ibody, double *xbodyold, double *reltime, double *veold, char *matname, ITG *mi, ITG *ikactmech, ITG *nactmech, ITG *ielprop, double *prop, double *sti, double *xstateini, double *xstate, ITG *nstate_)   
)

◆ FORTRAN() [251/316]

void FORTRAN ( rhsp  ,
(ITG *ne, char *lakon, ITG *ipnei, ITG *neifa, ITG *neiel, double *vfa, double *area, double *adfa, double *xlet, double *cosa, double *volume, double *au, double *ad, ITG *jq, ITG *irow, double *ap, ITG *ielfa, ITG *ifabou, double *xle, double *b, double *xxn, ITG *neq, ITG *nzs, double *hfa, double *gradpel, double *bp, double *xxi, ITG *neij, double *xlen, ITG *nefa, ITG *nefb, double *xxicn)   
)

◆ FORTRAN() [252/316]

void FORTRAN ( sensitivity_glob  ,
(double *dgdxtot, double *dgdxtotglob, ITG *nobject, ITG *ndesi, ITG *nodedesi, ITG *nk)   
)

◆ FORTRAN() [253/316]

void FORTRAN ( shape3tri  ,
(double *xi, double *et, double *xl, double *xsj, double *xs, double *shp, ITG *iflag)   
)

◆ FORTRAN() [254/316]

void FORTRAN ( shape4q  ,
(double *xi, double *et, double *xl, double *xsj, double *xs, double *shp, ITG *iflag)   
)

◆ FORTRAN() [255/316]

void FORTRAN ( shape4tet  ,
(double *xi, double *et, double *ze, double *xl, double *xsj, double *shp, ITG *iflag)   
)

◆ FORTRAN() [256/316]

void FORTRAN ( shape6tri  ,
(double *xi, double *et, double *xl, double *xsj, double *xs, double *shp, ITG *iflag)   
)

◆ FORTRAN() [257/316]

void FORTRAN ( shape6w  ,
(double *xi, double *et, double *ze, double *xl, double *xsj, double *shp, ITG *iflag)   
)

◆ FORTRAN() [258/316]

void FORTRAN ( shape8h  ,
(double *xi, double *et, double *ze, double *xl, double *xsj, double *shp, ITG *iflag)   
)

◆ FORTRAN() [259/316]

void FORTRAN ( shape8q  ,
(double *xi, double *et, double *xl, double *xsj, double *xs, double *shp, ITG *iflag)   
)

◆ FORTRAN() [260/316]

void FORTRAN ( shape10tet  ,
(double *xi, double *et, double *ze, double *xl, double *xsj, double *shp, ITG *iflag)   
)

◆ FORTRAN() [261/316]

void FORTRAN ( shape15w  ,
(double *xi, double *et, double *ze, double *xl, double *xsj, double *shp, ITG *iflag)   
)

◆ FORTRAN() [262/316]

void FORTRAN ( shape20h  ,
(double *xi, double *et, double *ze, double *xl, double *xsj, double *shp, ITG *iflag)   
)

◆ FORTRAN() [263/316]

void FORTRAN ( slavintpoints  ,
(ITG *ntie, ITG *itietri, ITG *ipkon, ITG *kon, char *lakon, double *straight, ITG *nintpoint, ITG *koncont, double *co, double *vold, double *xo, double *yo, double *zo, double *x, double *y, double *z, ITG *nx, ITG *ny, ITG *nz, ITG *islavsurf, ITG *islavnode, ITG *nslavnode, ITG *imastop, ITG *mi, ITG *ncont, ITG *ipe, ITG *ime, double *pslavsurf, ITG *i, ITG *l, ITG *ntri)   
)

◆ FORTRAN() [264/316]

void FORTRAN ( smalldist  ,
(double *co, double *distmin, char *lakon, ITG *ipkon, ITG *kon, ITG *ne)   
)

◆ FORTRAN() [265/316]

void FORTRAN ( sortev  ,
(ITG *nev, ITG *nmd, double *eigxx, ITG *cyclicsymmetry, double *xx, double *eigxr, ITG *pev, ITG *istartnmd, ITG *iendnmd, double *aa, double *bb)   
)

◆ FORTRAN() [266/316]

void FORTRAN ( spcmatch  ,
(double *xboun, ITG *nodeboun, ITG *ndirboun, ITG *nboun, double *xbounold, ITG *nodebounold, ITG *ndirbounold, ITG *nbounold, ITG *ikboun, ITG *ilboun, double *vold, double *reorder, ITG *nreorder, ITG *mi)   
)

◆ FORTRAN() [267/316]

void FORTRAN ( splitline  ,
(char *text, char *textpart, ITG *n)   
)

◆ FORTRAN() [268/316]

void FORTRAN ( springforc_n2f  ,
(double *xl, ITG *konl, double *vl, ITG *imat, double *elcon, ITG *nelcon, double *elas, double *fnl, ITG *ncmat_, ITG *ntmat_, ITG *nope, char *lakonl, double *t1l, ITG *kode, double *elconloc, double *plicon, ITG *nplicon, ITG *npmat_, double *senergy, ITG *iener, double *cstr, ITG *mi, double *springarea, ITG *nmethod, ITG *ne0, ITG *nstate_, double *xstateini, double *xstate, double *reltime, ITG *ielas, double *venergy, ITG *ielorien, double *orab, ITG *norien, ITG *nelem)   
)

◆ FORTRAN() [269/316]

void FORTRAN ( springstiff_n2f  ,
(double *xl, double *elas, ITG *konl, double *voldl, double *s, ITG *imat, double *elcon, ITG *nelcon, ITG *ncmat_, ITG *ntmat_, ITG *nope, char *lakonl, double *t1l, ITG *kode, double *elconloc, double *plicon, ITG *nplicon, ITG *npmat_, ITG *iperturb, double *springarea, ITG *nmethod, ITG *mi, ITG *ne0, ITG *nstate_, double *xstateini, double *xstate, double *reltime, ITG *nasym, ITG *ielorien, double *orab, ITG *norien, ITG *nelem)   
)

◆ FORTRAN() [270/316]

void FORTRAN ( stop  ,
()   
)

◆ FORTRAN() [271/316]

void FORTRAN ( storeresidual  ,
(ITG *nactdof, double *b, double *fn, char *filab, ITG *ithermal, ITG *nk, double *sti, double *stn, ITG *ipkon, ITG *inum, ITG *kon, char *lakon, ITG *ne, ITG *mi, double *orab, ITG *ielorien, double *co, ITG *itg, ITG *ntg, double *vold, ITG *ielmat, double *thicke, ITG *ielprop, double *prop)   
)

◆ FORTRAN() [272/316]

void FORTRAN ( storecontactprop  ,
(ITG *ne, ITG *ne0, char *lakon, ITG *kon, ITG *ipkon, ITG *mi, ITG *ielmat, double *elcon, ITG *mortar, double *adb, ITG *nactdof, double *springarea, ITG *ncmat_, ITG *ntmat_, double *stx, double *temax)   
)

◆ FORTRAN() [273/316]

void FORTRAN ( subspace  ,
(double *d, double *aa, double *bb, double *cc, double *alpham, double *betam, ITG *nev, double *xini, double *cd, double *cv, double *time, double *rwork, ITG *lrw, ITG *k, ITG *jout, double *rpar, double *bj, ITG *iwork, ITG *liw, ITG *iddebdf, double *bjp)   
)

◆ FORTRAN() [274/316]

void FORTRAN ( tempload  ,
(double *xforcold, double *xforc, double *xforcact, ITG *iamforc, ITG *nforc, double *xloadold, double *xload, double *xloadact, ITG *iamload, ITG *nload, ITG *ibody, double *xbody, ITG *nbody, double *xbodyold, double *xbodyact, double *t1old, double *t1, double *t1act, ITG *iamt1, ITG *nk, double *amta, ITG *namta, ITG *nam, double *ampli, double *time, double *reltime, double *ttime, double *dtime, ITG *ithermal, ITG *nmethod, double *xbounold, double *xboun, double *xbounact, ITG *iamboun, ITG *nboun, ITG *nodeboun, ITG *ndirboun, ITG *nodeforc, ITG *ndirforc, ITG *istep, ITG *iint, double *co, double *vold, ITG *itg, ITG *ntg, char *amname, ITG *ikboun, ITG *ilboun, ITG *nelemload, char *sideload, ITG *mi, ITG *ntrans, double *trab, ITG *inotr, double *veold, ITG *integerglob, double *doubleglob, char *tieset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *ntie, ITG *nmpc, ITG *ipompc, ITG *ikmpc, ITG *ilmpc, ITG *nodempc, double *coefmpc, ITG *ipobody, ITG *iponoel, ITG *inoel)   
)

◆ FORTRAN() [275/316]

void FORTRAN ( tempload_em  ,
(double *xforcold, double *xforc, double *xforcact, ITG *iamforc, ITG *nforc, double *xloadold, double *xload, double *xloadact, ITG *iamload, ITG *nload, ITG *ibody, double *xbody, ITG *nbody, double *xbodyold, double *xbodyact, double *t1old, double *t1, double *t1act, ITG *iamt1, ITG *nk, double *amta, ITG *namta, ITG *nam, double *ampli, double *time, double *reltime, double *ttime, double *dtime, ITG *ithermal, ITG *nmethod, double *xbounold, double *xboun, double *xbounact, ITG *iamboun, ITG *nboun, ITG *nodeboun, ITG *ndirboun, ITG *nodeforc, ITG *ndirforc, ITG *istep, ITG *iint, double *co, double *vold, ITG *itg, ITG *ntg, char *amname, ITG *ikboun, ITG *ilboun, ITG *nelemload, char *sideload, ITG *mi, ITG *ntrans, double *trab, ITG *inotr, double *veold, ITG *integerglob, double *doubleglob, char *tieset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *ntie, ITG *nmpc, ITG *ipompc, ITG *ikmpc, ITG *ilmpc, ITG *nodempc, double *coefmpc, double *h0scale, ITG *inomat, ITG *ipobody, ITG *iponoel, ITG *inoel)   
)

◆ FORTRAN() [276/316]

void FORTRAN ( temploaddiff  ,
(double *xforcold, double *xforc, double *xforcact, ITG *iamforc, ITG *nforc, double *xloadold, double *xload, double *xloadact, ITG *iamload, ITG *nload, ITG *ibody, double *xbody, ITG *nbody, double *xbodyold, double *xbodyact, double *t1old, double *t1, double *t1act, ITG *iamt1, ITG *nk, double *amta, ITG *namta, ITG *nam, double *ampli, double *time, double *reltime, double *ttime, double *dtime, ITG *ithermal, ITG *nmethod, double *xbounold, double *xboun, double *xbounact, ITG *iamboun, ITG *nboun, ITG *nodeboun, ITG *ndirboun, ITG *nodeforc, ITG *ndirforc, ITG *istep, ITG *iint, double *co, double *vold, ITG *itg, ITG *ntg, char *amname, ITG *ikboun, ITG *ilboun, ITG *nelemload, char *sideload, ITG *mi, double *xforcdiff, double *xloaddiff, double *xbodydiff, double *t1diff, double *xboundiff, ITG *icorrect, ITG *iprescribedboundary, ITG *ntrans, double *trab, ITG *inotr, double *veold, ITG *nactdof, double *bcont, double *fn, ITG *ipobody, ITG *iponoel, ITG *inoel)   
)

◆ FORTRAN() [277/316]

void FORTRAN ( temploadmodal  ,
(double *amta, ITG *namta, ITG *nam, double *ampli, double *timemin, double *ttimemin, double *dtime, double *xbounold, double *xboun, double *xbounmin, ITG *iamboun, ITG *nboun, ITG *nodeboun, ITG *ndirboun, char *amname)   
)

◆ FORTRAN() [278/316]

void FORTRAN ( tiefaccont  ,
(char *lakon, ITG *ipkon, ITG *kon, ITG *ntie, char *tieset, ITG *nset, char *set, ITG *istartset, ITG *iendset, ITG *ialset, ITG *itiefac, ITG *islavsurf, ITG *islavnode, ITG *imastnode, ITG *nslavnode, ITG *nmastnode, ITG *nslavs, ITG *nmasts, ITG *ifacecount, ITG *iponoels, ITG *inoels, ITG *ifreenoels, ITG *mortar, ITG *ipoface, ITG *nodface, ITG *nk, double *xnoels)   
)

◆ FORTRAN() [279/316]

void FORTRAN ( transformatrix  ,
(double *xab, double *p, double *a)   
)

◆ FORTRAN() [280/316]

void FORTRAN ( transition  ,
(double *dgdxglob, ITG *nobject, ITG *nk, ITG *nodedesi, ITG *ndesi, char *objectset, double *xo, double *yo, double *zo, double *x, double *y, double *z, ITG *nx, ITG *ny, ITG *nz, double *co, ITG *ifree, ITG *ndesia, ITG *ndesib)   
)

◆ FORTRAN() [281/316]

void FORTRAN ( trianeighbor  ,
(ITG *ipe, ITG *ime, ITG *imastop, ITG *ncont, ITG *koncont, ITG *ifreeme)   
)

◆ FORTRAN() [282/316]

void FORTRAN ( triangucont  ,
(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, char *kind1, char *kind2, double *co, ITG *nk)   
)

◆ FORTRAN() [283/316]

void FORTRAN ( tridiagonal_nrhs  ,
(double *a, double *b, ITG *n, ITG *m, ITG *nrhs)   
)

◆ FORTRAN() [284/316]

void FORTRAN ( ufaceload  ,
(double *co, ITG *ipkon, ITG *kon, char *lakon, ITG *nboun, ITG *nodeboun, ITG *nelemload, char *sideload, ITG *nload, ITG *ne, ITG *nk)   
)

◆ FORTRAN() [285/316]

void FORTRAN ( uinit  ,
()   
)

◆ FORTRAN() [286/316]

void FORTRAN ( uiter  ,
(ITG *iit)   
)

◆ FORTRAN() [287/316]

void FORTRAN ( uout  ,
(double *v, ITG *mi, ITG *ithermal, char *filab)   
)

◆ FORTRAN() [288/316]

void FORTRAN ( updatecont  ,
(ITG *koncont, ITG *ncont, double *co, double *vold, double *cg, double *straight, ITG *mi)   
)

◆ FORTRAN() [289/316]

void FORTRAN ( updatecontpen  ,
(ITG *koncont, ITG *ncont, double *co, double *vold, double *cg, double *straight, ITG *mi, ITG *imastnode, ITG *nmastnode, double *xmastnor, ITG *ntie, char *tieset, ITG *nset, char *set, ITG *istartset, ITG *iendset, ITG *ialset, ITG *ipkon, char *lakon, ITG *kon, double *cs, ITG *mcs, ITG *ics)   
)

◆ FORTRAN() [290/316]

void FORTRAN ( writeboun  ,
(ITG *nodeboun, ITG *ndirboun, double *xboun, char *typeboun, ITG *nboun)   
)

◆ FORTRAN() [291/316]

void FORTRAN ( writebv  ,
(double *, ITG *)   
)

◆ FORTRAN() [292/316]

void FORTRAN ( writecvg  ,
(ITG *itep, ITG *iinc, ITG *icutb, ITG *iit, ITG *ne, ITG *ne0, double *ram, double *qam, double *cam, double *uam, ITG *ithermal)   
)

◆ FORTRAN() [293/316]

void FORTRAN ( writedeigdx  ,
(ITG *iev, double *d, ITG *ndesi, char *orname, double *dgdx)   
)

◆ FORTRAN() [294/316]

void FORTRAN ( writedesi  ,
(ITG *norien, char *orname)   
)

◆ FORTRAN() [295/316]

void FORTRAN ( writeev  ,
(double *, ITG *, double *, double *)   
)

◆ FORTRAN() [296/316]

void FORTRAN ( writeevcomplex  ,
(double *eigxx, ITG *nev, double *fmin, double *fmax)   
)

◆ FORTRAN() [297/316]

void FORTRAN ( writeevcs  ,
(double *, ITG *, ITG *, double *, double *)   
)

◆ FORTRAN() [298/316]

void FORTRAN ( writeevcscomplex  ,
(double *eigxx, ITG *nev, ITG *nm, double *fmin, double *fmax)   
)

◆ FORTRAN() [299/316]

void FORTRAN ( writehe  ,
(ITG *)   
)

◆ FORTRAN() [300/316]

void FORTRAN ( writeim  ,
()   
)

◆ FORTRAN() [301/316]

void FORTRAN ( writeinput  ,
(char *inpc, ITG *ipoinp, ITG *inp, ITG *nline, ITG *ninp, ITG *ipoinpc)   
)

◆ FORTRAN() [302/316]

void FORTRAN ( writemac  ,
(double *mac, ITG *nev)   
)

◆ FORTRAN() [303/316]

void FORTRAN ( writemaccs  ,
(double *mac, ITG *nev, ITG *nm)   
)

◆ FORTRAN() [304/316]

void FORTRAN ( writempc  ,
(ITG *, ITG *, double *, char *, ITG *)   
)

◆ FORTRAN() [305/316]

void FORTRAN ( writeobj  ,
(char *objectset, ITG *iobject, double *g0)   
)

◆ FORTRAN() [306/316]

void FORTRAN ( writepf  ,
(double *d, double *bjr, double *bji, double *freq, ITG *nev, ITG *mode, ITG *nherm)   
)

◆ FORTRAN() [307/316]

void FORTRAN ( writerandomfield  ,
(double *d, ITG *nev, double *abserr, double *relerr)   
)

◆ FORTRAN() [308/316]

void FORTRAN ( writere  ,
()   
)

◆ FORTRAN() [309/316]

void FORTRAN ( writesubmatrix  ,
(double *submatrix, ITG *noderetain, ITG *ndirretain, ITG *nretain, char *jobnamec)   
)

◆ FORTRAN() [310/316]

void FORTRAN ( writesummary  ,
(ITG *istep, ITG *j, ITG *icutb, ITG *l, double *ttime, double *time, double *dtime)   
)

◆ FORTRAN() [311/316]

void FORTRAN ( writesummarydiv  ,
(ITG *istep, ITG *j, ITG *icutb, ITG *l, double *ttime, double *time, double *dtime)   
)

◆ FORTRAN() [312/316]

void FORTRAN ( writetetmesh  ,
(ITG *kontet, ITG *netet_, double *cotet, ITG *nktet, double *field, ITG *nfield)   
)

◆ FORTRAN() [313/316]

void FORTRAN ( writeview  ,
(ITG *ntr, double *adview, double *auview, double *fenv, ITG *nzsrad, char *jobnamef)   
)

◆ FORTRAN() [314/316]

void FORTRAN ( zienzhu  ,
(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, double *stn, ITG *ipneigh, ITG *neigh, double *sti, ITG *mi)   
)

◆ FORTRAN() [315/316]

void FORTRAN ( znaupd  ,
(ITG *ido, char *bmat, ITG *n, char *which, ITG *nev, double *tol, double *resid, ITG *ncv, double *z, ITG *ldz, ITG *iparam, ITG *ipntr, double *workd, double *workl, ITG *lworkl, double *rwork, ITG *info)   
)

◆ FORTRAN() [316/316]

void FORTRAN ( zneupd  ,
(ITG *rvec, char *howmny, ITG *select, double *d, double *z, ITG *ldz, double *sigma, double *workev, char *bmat, ITG *neq, char *which, ITG *nev, double *tol, double *resid, ITG *ncv, double *v, ITG *ldv, ITG *iparam, ITG *ipntr, double *workd, double *workl, ITG *lworkl, double *rwork, ITG *info)   
)

◆ frd()

void frd ( double *  co,
ITG nk,
ITG kon,
ITG ipkon,
char *  lakon,
ITG ne0,
double *  v,
double *  stn,
ITG inum,
ITG nmethod,
ITG kode,
char *  filab,
double *  een,
double *  t1,
double *  fn,
double *  time,
double *  epn,
ITG ielmat,
char *  matname,
double *  enern,
double *  xstaten,
ITG nstate_,
ITG istep,
ITG iinc,
ITG ithermal,
double *  qfn,
ITG mode,
ITG noddiam,
double *  trab,
ITG inotr,
ITG ntrans,
double *  orab,
ITG ielorien,
ITG norien,
char *  description,
ITG ipneigh,
ITG neigh,
ITG mi,
double *  stx,
double *  vr,
double *  vi,
double *  stnr,
double *  stni,
double *  vmax,
double *  stnmax,
ITG ngraph,
double *  veold,
double *  ener,
ITG ne,
double *  cs,
char *  set,
ITG nset,
ITG istartset,
ITG iendset,
ITG ialset,
double *  eenmax,
double *  fnr,
double *  fni,
double *  emn,
double *  thicke,
char *  jobnamec,
char *  output,
double *  qfx,
double *  cdn,
ITG mortar,
double *  cdnr,
double *  cdni,
ITG nmat 
)
46  {
47 
48  /* stores the results in frd format
49 
50  iselect selects which nodes are to be stored:
51  iselect=-1 means only those nodes for which inum negative
52  ist, i.e. network nodes
53  iselect=+1 means only those nodes for which inum positive
54  ist, i.e. structural nodes
55  iselect=0 means both of the above */
56 
57  FILE *f1;
58 
59  char c[2]="C",m1[4]=" -1",m2[4]=" -2",m3[4]=" -3",
60  p0[6]=" 0",p1[6]=" 1",p2[6]=" 2",p3[6]=" 3",p4[6]=" 4",
61  p5[6]=" 5",p6[6]=" 6",p7[6]=" 7",p8[6]=" 8",p9[6]=" 9",
62  p10[6]=" 10",p11[6]=" 11",
63  p12[6]=" 12", fneig[132]="",date[8],clock[10],newdate[21],newclock[9],
64  material[59]=" ",
65  text[2]=" ";
66 
67  static ITG icounter=0,nkcoords,iaxial;
68 
69  ITG null,one,i,j,k,indexe,nemax,nlayer,noutloc,iset,iselect,ncomp,nope,
70  nodes,ifield[7],nfield[2],icomp[7],ifieldstate[*nstate_],two,three,
71  icompstate[*nstate_],ip0=0,ip1=1,ip2=2,ip3=3,ip4=4,ip5=5,ip6=6,ip7=7,
72  ip8=8,ip9=9,ip10=10,ip11=11,ip12=12,imat,nelout,
73  nterms,nout,noutplus,noutmin,mt=mi[1]+1;
74 
75  ITG ncompscalar=1,ifieldscalar[1]={1},icompscalar[1]={0},
76  nfieldscalar[2]={1,0};
77  ITG ncompvector=3,ifieldvector[3]={1,1,1},icompvector[3]={0,1,2},
78  nfieldvector1[2]={3,0},nfieldvector0[2]={mi[1]+1,0},
79  icompvectorlast[3]={3,4,5};
80  ITG ncomptensor=6,ifieldtensor[6]={1,1,1,1,1,1},icomptensor[6]={0,1,2,3,5,4},
81  nfieldtensor[2]={6,0};
82  ITG ncompscalph=2,ifieldscalph[2]={1,2},icompscalph[2]={0,0},
83  nfieldscalph[2]={0,0};
84  ITG ncompvectph=6,ifieldvectph[6]={1,1,1,2,2,2},icompvectph[6]={1,2,3,1,2,3},
85  nfieldvectph[2]={mi[1]+1,mi[1]+1};
86  ITG ncomptensph=12,ifieldtensph[12]={1,1,1,1,1,1,2,2,2,2,2,2},
87  icomptensph[12]={0,1,2,3,5,4,0,1,2,3,5,4},nfieldtensph[2]={6,6};
88 
89  int iw;
90 
91  float ifl;
92 
93  double pi,oner,*vold=NULL;
94 
95 #ifdef EXODUSII
96  if(strcmp1(output,"exo")==0){
97  exo(co,nk,kon,ipkon,lakon,ne0,v,stn,inum,nmethod,kode,
98  filab,een,t1,fn,time,epn,ielmat,matname,enern,
99  xstaten,nstate_,istep,iinc,ithermal,qfn,mode,noddiam,
100  trab,inotr,ntrans,orab,ielorien,norien,description,
101  ipneigh,neigh,mi,stx,vr,vi,stnr,stni,vmax,stnmax,
102  ngraph,veold,ener,ne,cs,set,nset,istartset,iendset,
103  ialset,eenmax,fnr,fni,emn,thicke,jobnamec,output,qfx,
104  cdn,mortar,cdnr,cdni,nmat);
105  return;
106  }
107 #endif
108 
109  strcpy(fneig,jobnamec);
110  strcat(fneig,".frd");
111 
112  if((f1=fopen(fneig,"ab"))==NULL){
113  printf("*EOR in frd: cannot open frd file for writing...");
114  exit(0);
115  }
116 
117  pi=4.*atan(1.);
118  null=0;
119  one=1;two=2;three=3;
120  oner=1.;
121 
122  /* determining nout, noutplus and noutmin
123  nout: number of structural and network nodes
124  noutplus: number of structural nodes
125  noutmin: number of network nodes */
126 
127  if(*nmethod!=0){
128  nout=0;
129  noutplus=0;
130  noutmin=0;
131  for(i=0;i<*nk;i++){
132  if(inum[i]==0) continue;
133  nout++;
134  if(inum[i]>0) noutplus++;
135  if(inum[i]<0) noutmin++;
136  }
137  }else{
138  nout=*nk;
139  }
140 
141  /* first time something is written in the frd-file: store
142  computational metadata, the nodal coordinates and the
143  topology */
144 
145 // if(*kode==1){
146  if((*kode==1)&&((*nmethod!=5)||(*mode!=0))){
147  iaxial=0.;
148 // fprintf(f1,"%5s%1s\n",p1,c);
149 
150  /* date and time */
151 
152  FORTRAN(dattime,(date,clock));
153 
154  for(i=0;i<20;i++) newdate[i]=' ';
155  newdate[20]='\0';
156 
157  strcpy1(newdate,&date[6],2);
158  strcpy1(&newdate[2],".",1);
159  if(strcmp1(&date[4],"01")==0){
160  strcpy1(&newdate[3],"january.",8);
161  strcpy1(&newdate[11],&date[0],4);
162  }else if(strcmp1(&date[4],"02")==0){
163  strcpy1(&newdate[3],"february.",9);
164  strcpy1(&newdate[12],&date[0],4);
165  }else if(strcmp1(&date[4],"03")==0){
166  strcpy1(&newdate[3],"march.",6);
167  strcpy1(&newdate[9],&date[0],4);
168  }else if(strcmp1(&date[4],"04")==0){
169  strcpy1(&newdate[3],"april.",6);
170  strcpy1(&newdate[9],&date[0],4);
171  }else if(strcmp1(&date[4],"05")==0){
172  strcpy1(&newdate[3],"may.",4);
173  strcpy1(&newdate[7],&date[0],4);
174  }else if(strcmp1(&date[4],"06")==0){
175  strcpy1(&newdate[3],"june.",5);
176  strcpy1(&newdate[8],&date[0],4);
177  }else if(strcmp1(&date[4],"07")==0){
178  strcpy1(&newdate[3],"july.",5);
179  strcpy1(&newdate[8],&date[0],4);
180  }else if(strcmp1(&date[4],"08")==0){
181  strcpy1(&newdate[3],"august.",7);
182  strcpy1(&newdate[10],&date[0],4);
183  }else if(strcmp1(&date[4],"09")==0){
184  strcpy1(&newdate[3],"september.",10);
185  strcpy1(&newdate[13],&date[0],4);
186  }else if(strcmp1(&date[4],"10")==0){
187  strcpy1(&newdate[3],"october.",8);
188  strcpy1(&newdate[11],&date[0],4);
189  }else if(strcmp1(&date[4],"11")==0){
190  strcpy1(&newdate[3],"november.",9);
191  strcpy1(&newdate[12],&date[0],4);
192  }else if(strcmp1(&date[4],"12")==0){
193  strcpy1(&newdate[3],"december.",9);
194  strcpy1(&newdate[12],&date[0],4);
195  }
196 
197  strcpy1(newclock,clock,2);
198  strcpy1(&newclock[2],":",1);
199  strcpy1(&newclock[3],&clock[2],2);
200  strcpy1(&newclock[5],":",1);
201  strcpy1(&newclock[6],&clock[4],2);
202  newclock[8]='\0';
203 
204  fprintf(f1,"%5sUUSER \n",p1);
205  fprintf(f1,"%5sUDATE %20s \n",p1,newdate);
206  fprintf(f1,"%5sUTIME %8s \n",p1,newclock);
207  fprintf(f1,"%5sUHOST \n",p1);
208  fprintf(f1,"%5sUPGM CalculiX \n",p1);
209  fprintf(f1,"%5sUVERSION Version 2.13 \n",p1);
210  fprintf(f1,"%5sUCOMPILETIME Sat Feb 24 09:43:30 EST 2018 \n",p1);
211  fprintf(f1,"%5sUDIR \n",p1);
212  fprintf(f1,"%5sUDBN \n",p1);
213 
214  for(i=0;i<*nmat;i++){
215  strcpy1(material,&matname[80*i],58);
216  fprintf(f1,"%5sUMAT%5" ITGFORMAT "%58s\n",p1,i+1,material);
217  }
218 
219  /* storing the header of the coordinates */
220 
221  if(strcmp1(output,"asc")==0){
222  fprintf(f1,"%5s%1s %12" ITGFORMAT "%38" ITGFORMAT "\n",p2,c,nout,one);
223  }else{
224  fprintf(f1,"%5s%1s %12" ITGFORMAT "%38" ITGFORMAT "\n",p2,c,nout,three);
225  }
226 
227  /* storing the coordinates themselves */
228 
229  if(*nmethod!=0){
230  for(i=0;i<*nk;i++){
231  if(inum[i]==0) continue;
232  if(strcmp1(output,"asc")==0){
233  fprintf(f1,"%3s%10" ITGFORMAT "%12.5E%12.5E%12.5E\n",m1,i+1,(float)co[3*i],
234  (float)co[3*i+1],(float)co[3*i+2]);
235  }else{
236  iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
237  fwrite(&co[3*i],sizeof(double),1,f1);
238  fwrite(&co[3*i+1],sizeof(double),1,f1);
239  fwrite(&co[3*i+2],sizeof(double),1,f1);
240  }
241  }
242  }else{
243  for(i=0;i<*nk;i++){
244  if(strcmp1(output,"asc")==0){
245  fprintf(f1,"%3s%10" ITGFORMAT "%12.5E%12.5E%12.5E\n",m1,i+1,(float)co[3*i],
246  (float)co[3*i+1],(float)co[3*i+2]);
247  }else{
248  iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
249  fwrite(&co[3*i],sizeof(double),1,f1);
250  fwrite(&co[3*i+1],sizeof(double),1,f1);
251  fwrite(&co[3*i+2],sizeof(double),1,f1);
252  }
253  }
254  }
255 
256  /* nkcoords is the number of nodes at the time when
257  the nodal coordinates are stored in the frd file */
258 
259  nkcoords=*nk;
260  if(strcmp1(output,"asc")==0)fprintf(f1,"%3s\n",m3);
261 
262  /* determining the number of elements */
263 
264  if(*nmethod!=0){
265  nelout=0;
266  for(i=0;i<*ne0;i++){
267  if(ipkon[i]<=-1){
268  continue;
269  }else if(strcmp1(&lakon[8*i],"ESPRNGC")==0){
270  continue;
271  }else if(strcmp1(&lakon[8*i],"ESPRNGF")==0){
272  continue;
273  }else if(strcmp1(&lakon[8*i],"DCOUP3D")==0){
274  continue;
275  }
276  nelout++;
277  }
278  }else{
279  nelout=*ne;
280  }
281 
282  /* storing the topology */
283 
284  if(strcmp1(output,"asc")==0){
285  fprintf(f1,"%5s%1s %12" ITGFORMAT "%38" ITGFORMAT "\n",p3,c,nelout,one);
286  }else{
287  fprintf(f1,"%5s%1s %12" ITGFORMAT "%38" ITGFORMAT "\n",p3,c,nelout,two);
288  }
289  nemax=*ne0;
290 
291  for(i=0;i<*ne0;i++){
292  if(ipkon[i]<=-1){
293  continue;
294  }else if(strcmp1(&lakon[8*i],"F")==0){
295  continue;
296  }else if(strcmp1(&lakon[8*i],"ESPRNGC")==0){
297  continue;
298  }else if(strcmp1(&lakon[8*i],"ESPRNGF")==0){
299  continue;
300  }else if(strcmp1(&lakon[8*i],"DCOUP3D")==0){
301  continue;
302  }else{
303  indexe=ipkon[i];
304  }
305  imat=ielmat[i*mi[2]];
306  if(strcmp1(&lakon[8*i+3],"2")==0){
307 
308  /* 20-node brick element */
309 
310  if(((strcmp1(&lakon[8*i+6]," ")==0)||
311  (strcmp1(&filab[4],"E")==0)||
312  (strcmp1(&lakon[8*i+6],"I")==0))&&
313  (strcmp2(&lakon[8*i+6],"LC",2)!=0)){
314  if(strcmp1(output,"asc")==0){
315  fprintf(f1,"%3s%10" ITGFORMAT "%5s%5s%5" ITGFORMAT "\n%3s",
316  m1,i+1,p4,p0,imat,m2);
317  for(j=0;j<10;j++)fprintf(f1,"%10" ITGFORMAT "",kon[indexe+j]);
318  fprintf(f1,"\n%3s",m2);
319  for(j=10;j<12;j++)fprintf(f1,"%10" ITGFORMAT "",kon[indexe+j]);
320  for(j=16;j<19;j++)fprintf(f1,"%10" ITGFORMAT "",kon[indexe+j]);
321  for(j=19;j<20;j++)fprintf(f1,"%10" ITGFORMAT "",kon[indexe+j]);
322  for(j=12;j<16;j++)fprintf(f1,"%10" ITGFORMAT "",kon[indexe+j]);
323  fprintf(f1,"\n");
324  }else{
325  iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
326  iw=(int)ip4;fwrite(&iw,sizeof(int),1,f1);
327  iw=(int)ip0;fwrite(&iw,sizeof(int),1,f1);
328  iw=(int)imat;fwrite(&iw,sizeof(int),1,f1);
329  for(j=0;j<10;j++){iw=(int)kon[indexe+j];
330  fwrite(&iw,sizeof(int),1,f1);}
331  for(j=10;j<12;j++){iw=(int)kon[indexe+j];
332  fwrite(&iw,sizeof(int),1,f1);}
333  for(j=16;j<19;j++){iw=(int)kon[indexe+j];
334  fwrite(&iw,sizeof(int),1,f1);}
335  for(j=19;j<20;j++){iw=(int)kon[indexe+j];
336  fwrite(&iw,sizeof(int),1,f1);}
337  for(j=12;j<16;j++){iw=(int)kon[indexe+j];
338  fwrite(&iw,sizeof(int),1,f1);}
339  }
340  }else if(strcmp2(&lakon[8*i+6],"LC",2)==0){
341 
342  /* composite material */
343 
344  /* 20-node brick elements */
345 
346  nlayer=0;
347  for(k=0;k<mi[2];k++){
348  if(ielmat[i*mi[2]+k]==0) break;
349  nlayer++;
350  }
351  for(k=0;k<nlayer;k++){
352  nemax++;
353  if(strcmp1(output,"asc")==0){
354  fprintf(f1,"%3s%10" ITGFORMAT "%5s%5s%5" ITGFORMAT "\n%3s",
355  m1,nemax,p4,p0,imat,m2);
356  for(j=0;j<10;j++)fprintf(f1,"%10" ITGFORMAT "",kon[indexe+28+20*k+j]);
357  fprintf(f1,"\n%3s",m2);
358  for(j=10;j<12;j++)fprintf(f1,"%10" ITGFORMAT "",kon[indexe+28+20*k+j]);
359  for(j=16;j<19;j++)fprintf(f1,"%10" ITGFORMAT "",kon[indexe+28+20*k+j]);
360  for(j=19;j<20;j++)fprintf(f1,"%10" ITGFORMAT "",kon[indexe+28+20*k+j]);
361  for(j=12;j<16;j++)fprintf(f1,"%10" ITGFORMAT "",kon[indexe+28+20*k+j]);
362  fprintf(f1,"\n");
363  }else{
364  iw=(int)nemax;fwrite(&iw,sizeof(int),1,f1);
365  iw=(int)ip4;fwrite(&iw,sizeof(int),1,f1);
366  iw=(int)ip0;fwrite(&iw,sizeof(int),1,f1);
367  iw=(int)imat;fwrite(&iw,sizeof(int),1,f1);
368  for(j=0;j<10;j++){iw=(int)kon[indexe+28+20*k+j];
369  fwrite(&iw,sizeof(int),1,f1);}
370  for(j=10;j<12;j++){iw=(int)kon[indexe+28+20*k+j];
371  fwrite(&iw,sizeof(int),1,f1);}
372  for(j=16;j<19;j++){iw=(int)kon[indexe+28+20*k+j];
373  fwrite(&iw,sizeof(int),1,f1);}
374  for(j=19;j<20;j++){iw=(int)kon[indexe+28+20*k+j];
375  fwrite(&iw,sizeof(int),1,f1);}
376  for(j=12;j<16;j++){iw=(int)kon[indexe+28+20*k+j];
377  fwrite(&iw,sizeof(int),1,f1);}
378  }
379  }
380  }else if(strcmp1(&lakon[8*i+6],"B")==0){
381 
382  /* 3-node beam element */
383 
384  if(strcmp1(output,"asc")==0){
385  fprintf(f1,"%3s%10" ITGFORMAT "%5s%5s%5" ITGFORMAT "\n",m1,i+1,p12,p0,imat);
386  fprintf(f1,"%3s%10" ITGFORMAT "%10" ITGFORMAT "%10" ITGFORMAT "\n",m2,kon[indexe+20],
387  kon[indexe+22],kon[indexe+21]);
388  }else{
389  iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
390  iw=(int)ip12;fwrite(&iw,sizeof(int),1,f1);
391  iw=(int)ip0;fwrite(&iw,sizeof(int),1,f1);
392  iw=(int)imat;fwrite(&iw,sizeof(int),1,f1);
393  iw=(int)kon[indexe+20];fwrite(&iw,sizeof(int),1,f1);
394  iw=(int)kon[indexe+22];fwrite(&iw,sizeof(int),1,f1);
395  iw=(int)kon[indexe+21];fwrite(&iw,sizeof(int),1,f1);
396  }
397  }else{
398 
399  /* 8-node 2d element */
400 
401  if(strcmp1(&lakon[8*i+6],"A")==0) iaxial=1;
402  if(strcmp1(output,"asc")==0){
403  fprintf(f1,"%3s%10" ITGFORMAT "%5s%5s%5" ITGFORMAT "\n%3s",
404  m1,i+1,p10,p0,imat,m2);
405  for(j=0;j<8;j++)fprintf(f1,"%10" ITGFORMAT "",kon[indexe+20+j]);
406  fprintf(f1,"\n");
407  }else{
408  iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
409  iw=(int)ip10;fwrite(&iw,sizeof(int),1,f1);
410  iw=(int)ip0;fwrite(&iw,sizeof(int),1,f1);
411  iw=(int)imat;fwrite(&iw,sizeof(int),1,f1);
412  for(j=0;j<8;j++){iw=(int)kon[indexe+20+j];
413  fwrite(&iw,sizeof(int),1,f1);}
414  }
415  }
416  }else if(strcmp1(&lakon[8*i+3],"8")==0){
417  if((strcmp1(&lakon[8*i+6]," ")==0)||
418  (strcmp1(&filab[4],"E")==0)){
419 
420  /* 8-node brick element */
421 
422  if(strcmp1(output,"asc")==0){
423  fprintf(f1,"%3s%10" ITGFORMAT "%5s%5s%5" ITGFORMAT "\n%3s",
424  m1,i+1,p1,p0,imat,m2);
425  for(j=0;j<8;j++)fprintf(f1,"%10" ITGFORMAT "",kon[indexe+j]);
426  fprintf(f1,"\n");
427  }else{
428  iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
429  iw=(int)ip1;fwrite(&iw,sizeof(int),1,f1);
430  iw=(int)ip0;fwrite(&iw,sizeof(int),1,f1);
431  iw=(int)imat;fwrite(&iw,sizeof(int),1,f1);
432  for(j=0;j<8;j++){iw=(int)kon[indexe+j];
433  fwrite(&iw,sizeof(int),1,f1);}
434  }
435  }else if(strcmp1(&lakon[8*i+6],"B")==0){
436 
437  /* 2-node 1d element */
438 
439  if(strcmp1(&lakon[8*i+4],"R")==0){
440  if(strcmp1(output,"asc")==0){
441  fprintf(f1,"%3s%10" ITGFORMAT "%5s%5s%5" ITGFORMAT "\n",m1,i+1,p11,p0,imat);
442  fprintf(f1,"%3s%10" ITGFORMAT "%10" ITGFORMAT "\n",m2,kon[indexe+8],
443  kon[indexe+9]);
444  }else{
445  iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
446  iw=(int)ip11;fwrite(&iw,sizeof(int),1,f1);
447  iw=(int)ip0;fwrite(&iw,sizeof(int),1,f1);
448  iw=(int)imat;fwrite(&iw,sizeof(int),1,f1);
449  iw=(int)kon[indexe+8];fwrite(&iw,sizeof(int),1,f1);
450  iw=(int)kon[indexe+9];fwrite(&iw,sizeof(int),1,f1);
451  }
452  }else if(strcmp1(&lakon[8*i+4],"I")==0){
453  if(strcmp1(output,"asc")==0){
454  fprintf(f1,"%3s%10" ITGFORMAT "%5s%5s%5" ITGFORMAT "\n",m1,i+1,p11,p0,imat);
455  fprintf(f1,"%3s%10" ITGFORMAT "%10" ITGFORMAT "\n",m2,kon[indexe+11],
456  kon[indexe+12]);
457  }else{
458  iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
459  iw=(int)ip11;fwrite(&iw,sizeof(int),1,f1);
460  iw=(int)ip0;fwrite(&iw,sizeof(int),1,f1);
461  iw=(int)imat;fwrite(&iw,sizeof(int),1,f1);
462  iw=(int)kon[indexe+11];fwrite(&iw,sizeof(int),1,f1);
463  iw=(int)kon[indexe+12];fwrite(&iw,sizeof(int),1,f1);
464  }
465  }
466  }else{
467 
468  /* 4-node 2d element */
469 
470  if(strcmp1(&lakon[8*i+6],"A")==0) iaxial=1;
471  if((strcmp1(&lakon[8*i+4],"R")==0)||
472  (strcmp1(&lakon[8*i+4]," ")==0)){
473  if(strcmp1(output,"asc")==0){
474  fprintf(f1,"%3s%10" ITGFORMAT "%5s%5s%5" ITGFORMAT "\n%3s",
475  m1,i+1,p9,p0,imat,m2);
476  for(j=0;j<4;j++)fprintf(f1,"%10" ITGFORMAT "",kon[indexe+8+j]);
477  fprintf(f1,"\n");
478  }else{
479  iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
480  iw=(int)ip9;fwrite(&iw,sizeof(int),1,f1);
481  iw=(int)ip0;fwrite(&iw,sizeof(int),1,f1);
482  iw=(int)imat;fwrite(&iw,sizeof(int),1,f1);
483  for(j=0;j<4;j++){iw=(int)kon[indexe+8+j];
484  fwrite(&iw,sizeof(int),1,f1);}
485  }
486  }else if(strcmp1(&lakon[8*i+4],"I")==0){
487  if(strcmp1(output,"asc")==0){
488  fprintf(f1,"%3s%10" ITGFORMAT "%5s%5s%5" ITGFORMAT "\n%3s",
489  m1,i+1,p9,p0,imat,m2);
490  for(j=0;j<4;j++)fprintf(f1,"%10" ITGFORMAT "",kon[indexe+11+j]);
491  fprintf(f1,"\n");
492  }else{
493  iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
494  iw=(int)ip9;fwrite(&iw,sizeof(int),1,f1);
495  iw=(int)ip0;fwrite(&iw,sizeof(int),1,f1);
496  iw=(int)imat;fwrite(&iw,sizeof(int),1,f1);
497  for(j=0;j<4;j++){iw=(int)kon[indexe+11+j];
498  fwrite(&iw,sizeof(int),1,f1);}
499  }
500  }
501  }
502  }else if((strcmp1(&lakon[8*i+3],"10")==0)||
503  (strcmp1(&lakon[8*i+3],"14")==0)){
504 
505  /* 10-node tetrahedral element */
506 
507  if(strcmp1(output,"asc")==0){
508  fprintf(f1,"%3s%10" ITGFORMAT "%5s%5s%5" ITGFORMAT "\n%3s",
509  m1,i+1,p6,p0,imat,m2);
510  for(j=0;j<10;j++)fprintf(f1,"%10" ITGFORMAT "",kon[indexe+j]);
511  fprintf(f1,"\n");
512  }else{
513  iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
514  iw=(int)ip6;fwrite(&iw,sizeof(int),1,f1);
515  iw=(int)ip0;fwrite(&iw,sizeof(int),1,f1);
516  iw=(int)imat;fwrite(&iw,sizeof(int),1,f1);
517  for(j=0;j<10;j++){iw=(int)kon[indexe+j];
518  fwrite(&iw,sizeof(int),1,f1);}
519  }
520  }else if(strcmp1(&lakon[8*i+3],"4")==0){
521 
522  /* 4-node tetrahedral element */
523 
524  if(strcmp1(output,"asc")==0){
525  fprintf(f1,"%3s%10" ITGFORMAT "%5s%5s%5" ITGFORMAT "\n%3s",
526  m1,i+1,p3,p0,imat,m2);
527  for(j=0;j<4;j++)fprintf(f1,"%10" ITGFORMAT "",kon[indexe+j]);
528  fprintf(f1,"\n");
529  }else{
530  iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
531  iw=(int)ip3;fwrite(&iw,sizeof(int),1,f1);
532  iw=(int)ip0;fwrite(&iw,sizeof(int),1,f1);
533  iw=(int)imat;fwrite(&iw,sizeof(int),1,f1);
534  for(j=0;j<4;j++){iw=(int)kon[indexe+j];
535  fwrite(&iw,sizeof(int),1,f1);}
536  }
537  }else if(strcmp1(&lakon[8*i+3],"15")==0){
538  if(((strcmp1(&lakon[8*i+6]," ")==0)||
539  (strcmp1(&filab[4],"E")==0))&&
540  (strcmp2(&lakon[8*i+6],"LC",2)!=0)){
541 
542  /* 15-node wedge element */
543 
544  if(strcmp1(output,"asc")==0){
545  fprintf(f1,"%3s%10" ITGFORMAT "%5s%5s%5" ITGFORMAT "\n%3s",
546  m1,i+1,p5,p0,imat,m2);
547  for(j=0;j<9;j++)fprintf(f1,"%10" ITGFORMAT "",kon[indexe+j]);
548  for(j=12;j<13;j++)fprintf(f1,"%10" ITGFORMAT "",kon[indexe+j]);
549  fprintf(f1,"\n%3s",m2);
550  for(j=13;j<15;j++)fprintf(f1,"%10" ITGFORMAT "",kon[indexe+j]);
551  for(j=9;j<12;j++)fprintf(f1,"%10" ITGFORMAT "",kon[indexe+j]);
552  fprintf(f1,"\n");
553  }else{
554  iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
555  iw=(int)ip5;fwrite(&iw,sizeof(int),1,f1);
556  iw=(int)ip0;fwrite(&iw,sizeof(int),1,f1);
557  iw=(int)imat;fwrite(&iw,sizeof(int),1,f1);
558  for(j=0;j<9;j++){iw=(int)kon[indexe+j];
559  fwrite(&iw,sizeof(int),1,f1);}
560  for(j=12;j<13;j++){iw=(int)kon[indexe+j];
561  fwrite(&iw,sizeof(int),1,f1);}
562  for(j=13;j<15;j++){iw=(int)kon[indexe+j];
563  fwrite(&iw,sizeof(int),1,f1);}
564  for(j=9;j<12;j++){iw=(int)kon[indexe+j];
565  fwrite(&iw,sizeof(int),1,f1);}
566  }
567 
568  }else if(strcmp2(&lakon[8*i+6],"LC",2)==0){
569 
570  /* composite material */
571 
572  /* 15-node wedge elements */
573 
574  nlayer=0;
575  for(k=0;k<mi[2];k++){
576  if(ielmat[i*mi[2]+k]==0) break;
577  nlayer++;
578  }
579  for(k=0;k<nlayer;k++){
580  nemax++;
581  if(strcmp1(output,"asc")==0){
582  fprintf(f1,"%3s%10" ITGFORMAT "%5s%5s%5" ITGFORMAT "\n%3s",
583  m1,nemax,p5,p0,imat,m2);
584  for(j=0;j<9;j++)fprintf(f1,"%10" ITGFORMAT "",kon[indexe+21+15*k+j]);
585  for(j=12;j<13;j++)fprintf(f1,"%10" ITGFORMAT "",kon[indexe+21+15*k+j]);
586  fprintf(f1,"\n%3s",m2);
587  for(j=13;j<15;j++)fprintf(f1,"%10" ITGFORMAT "",kon[indexe+21+15*k+j]);
588  for(j=9;j<12;j++)fprintf(f1,"%10" ITGFORMAT "",kon[indexe+21+15*k+j]);
589  fprintf(f1,"\n");
590  }else{
591  iw=(int)nemax;fwrite(&iw,sizeof(int),1,f1);
592  iw=(int)ip5;fwrite(&iw,sizeof(int),1,f1);
593  iw=(int)ip0;fwrite(&iw,sizeof(int),1,f1);
594  iw=(int)imat;fwrite(&iw,sizeof(int),1,f1);
595  for(j=0;j<9;j++){iw=(int)kon[indexe+21+15*k+j];
596  fwrite(&iw,sizeof(int),1,f1);}
597  for(j=12;j<13;j++){iw=(int)kon[indexe+21+15*k+j];
598  fwrite(&iw,sizeof(int),1,f1);}
599  for(j=13;j<15;j++){iw=(int)kon[indexe+21+15*k+j];
600  fwrite(&iw,sizeof(int),1,f1);}
601  for(j=9;j<12;j++){iw=(int)kon[indexe+21+15*k+j];
602  fwrite(&iw,sizeof(int),1,f1);}
603  }
604  }
605  }else{
606 
607  /* 6-node 2d element */
608 
609  if(strcmp1(&lakon[8*i+6],"A")==0) iaxial=1;
610  if(strcmp1(output,"asc")==0){
611  fprintf(f1,"%3s%10" ITGFORMAT "%5s%5s%5" ITGFORMAT "\n%3s",
612  m1,i+1,p8,p0,imat,m2);
613  for(j=0;j<6;j++)fprintf(f1,"%10" ITGFORMAT "",kon[indexe+15+j]);
614  fprintf(f1,"\n");
615  }else{
616  iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
617  iw=(int)ip8;fwrite(&iw,sizeof(int),1,f1);
618  iw=(int)ip0;fwrite(&iw,sizeof(int),1,f1);
619  iw=(int)imat;fwrite(&iw,sizeof(int),1,f1);
620  for(j=0;j<6;j++){iw=(int)kon[indexe+15+j];
621  fwrite(&iw,sizeof(int),1,f1);}
622  }
623  }
624  }else if(strcmp1(&lakon[8*i+3],"6")==0){
625  if((strcmp1(&lakon[8*i+6]," ")==0)||
626  (strcmp1(&filab[4],"E")==0)){
627 
628  /* 6-node wedge element */
629 
630  if(strcmp1(output,"asc")==0){
631  fprintf(f1,"%3s%10" ITGFORMAT "%5s%5s%5" ITGFORMAT "\n%3s",
632  m1,i+1,p2,p0,imat,m2);
633  for(j=0;j<6;j++)fprintf(f1,"%10" ITGFORMAT "",kon[indexe+j]);
634  fprintf(f1,"\n");
635  }else{
636  iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
637  iw=(int)ip2;fwrite(&iw,sizeof(int),1,f1);
638  iw=(int)ip0;fwrite(&iw,sizeof(int),1,f1);
639  iw=(int)imat;fwrite(&iw,sizeof(int),1,f1);
640  for(j=0;j<6;j++){iw=(int)kon[indexe+j];
641  fwrite(&iw,sizeof(int),1,f1);}
642  }
643  }else{
644 
645  /* 3-node 2d element */
646 
647  if(strcmp1(&lakon[8*i+6],"A")==0) iaxial=1;
648  if(strcmp1(output,"asc")==0){
649  fprintf(f1,"%3s%10" ITGFORMAT "%5s%5s%5" ITGFORMAT "\n%3s",
650  m1,i+1,p7,p0,imat,m2);
651  for(j=0;j<3;j++)fprintf(f1,"%10" ITGFORMAT "",kon[indexe+6+j]);
652  fprintf(f1,"\n");
653  }else{
654  iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
655  iw=(int)ip7;fwrite(&iw,sizeof(int),1,f1);
656  iw=(int)ip0;fwrite(&iw,sizeof(int),1,f1);
657  iw=(int)imat;fwrite(&iw,sizeof(int),1,f1);
658  for(j=0;j<3;j++){iw=(int)kon[indexe+6+j];
659  fwrite(&iw,sizeof(int),1,f1);}
660  }
661  }
662  }else if((strcmp1(&lakon[8*i],"D")==0)&&(ithermal[1]>1)){
663  if(kon[indexe]==0){
664 
665  /* 2-node 1d element (network entry element) */
666 
667  if(strcmp1(output,"asc")==0){
668  fprintf(f1,"%3s%10" ITGFORMAT "%5s%5s%5" ITGFORMAT "\n",m1,i+1,p11,p0,imat);
669  fprintf(f1,"%3s%10" ITGFORMAT "%10" ITGFORMAT "\n",m2,
670  kon[indexe+1],kon[indexe+2]);
671  }else{
672  iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
673  iw=(int)ip11;fwrite(&iw,sizeof(int),1,f1);
674  iw=(int)ip0;fwrite(&iw,sizeof(int),1,f1);
675  iw=(int)imat;fwrite(&iw,sizeof(int),1,f1);
676  iw=(int)kon[indexe+1];fwrite(&iw,sizeof(int),1,f1);
677  iw=(int)kon[indexe+2];fwrite(&iw,sizeof(int),1,f1);
678  }
679  }else if(kon[indexe+2]==0){
680 
681  /* 2-node 1d element (network exit element) */
682 
683  if(strcmp1(output,"asc")==0){
684  fprintf(f1,"%3s%10" ITGFORMAT "%5s%5s%5" ITGFORMAT "\n",m1,i+1,p11,p0,imat);
685  fprintf(f1,"%3s%10" ITGFORMAT "%10" ITGFORMAT "\n",m2,kon[indexe],
686  kon[indexe+1]);
687  }else{
688  iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
689  iw=(int)ip11;fwrite(&iw,sizeof(int),1,f1);
690  iw=(int)ip0;fwrite(&iw,sizeof(int),1,f1);
691  iw=(int)imat;fwrite(&iw,sizeof(int),1,f1);
692  iw=(int)kon[indexe];fwrite(&iw,sizeof(int),1,f1);
693  iw=(int)kon[indexe+1];fwrite(&iw,sizeof(int),1,f1);
694  }
695  }else{
696 
697  /* 3-node 1d element (genuine network element) */
698 
699  if(strcmp1(output,"asc")==0){
700  fprintf(f1,"%3s%10" ITGFORMAT "%5s%5s%5" ITGFORMAT "\n",m1,i+1,p12,p0,imat);
701  fprintf(f1,"%3s%10" ITGFORMAT "%10" ITGFORMAT "%10" ITGFORMAT "\n",m2,kon[indexe],
702  kon[indexe+2],kon[indexe+1]);
703  }else{
704  iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
705  iw=(int)ip12;fwrite(&iw,sizeof(int),1,f1);
706  iw=(int)ip0;fwrite(&iw,sizeof(int),1,f1);
707  iw=(int)imat;fwrite(&iw,sizeof(int),1,f1);
708  iw=(int)kon[indexe];fwrite(&iw,sizeof(int),1,f1);
709  iw=(int)kon[indexe+2];fwrite(&iw,sizeof(int),1,f1);
710  iw=(int)kon[indexe+1];fwrite(&iw,sizeof(int),1,f1);
711  }
712  }
713  }else if((strcmp1(&lakon[8*i],"E")==0)&&
714  (strcmp1(&lakon[8*i+6],"A")==0)){
715 
716  /* 2-node 1d element (spring element) */
717 
718  if(strcmp1(output,"asc")==0){
719  fprintf(f1,"%3s%10" ITGFORMAT "%5s%5s%5" ITGFORMAT "\n",m1,i+1,p11,p0,imat);
720  fprintf(f1,"%3s%10" ITGFORMAT "%10" ITGFORMAT "\n",m2,kon[indexe],kon[indexe+1]);
721  }else{
722  iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
723  iw=(int)ip11;fwrite(&iw,sizeof(int),1,f1);
724  iw=(int)ip0;fwrite(&iw,sizeof(int),1,f1);
725  iw=(int)imat;fwrite(&iw,sizeof(int),1,f1);
726  iw=(int)kon[indexe];fwrite(&iw,sizeof(int),1,f1);
727  iw=(int)kon[indexe+1];fwrite(&iw,sizeof(int),1,f1);
728  }
729  }
730  }
731  if(strcmp1(output,"asc")==0)fprintf(f1,"%3s\n",m3);
732 
733  if(*nmethod==0){fclose(f1);return;}
734  }
735 
736  /* for cyclic symmetry frequency calculations only results for
737  even numbers (= odd modes, numbering starts at 0) are stored */
738 
739  if((*nmethod==2)&&(((*mode/2)*2!=*mode)&&(*noddiam>=0))){fclose(f1);return;}
740 
741  /* storing the displacements in the nodes */
742 
743  if((*nmethod!=5)||(*mode==-1)){
744  if((strcmp1(filab,"U ")==0)&&(*ithermal!=2)){
745  iselect=1;
746 
747  frdset(filab,set,&iset,istartset,iendset,ialset,
748  inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
749  ngraph);
750 
751  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
752  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
753 
754  if(mi[1]==3){
755 
756  fprintf(f1," -4 DISP 4 1\n");
757  fprintf(f1," -5 D1 1 2 1 0\n");
758  fprintf(f1," -5 D2 1 2 2 0\n");
759  fprintf(f1," -5 D3 1 2 3 0\n");
760  fprintf(f1," -5 ALL 1 2 0 0 1ALL\n");
761 
762  frdvector(v,&iset,ntrans,filab,&nkcoords,inum,m1,inotr,
763  trab,co,istartset,iendset,ialset,mi,ngraph,f1,output,m3);
764 
765  }else if((mi[1]>3)&&(mi[1]<7)){
766 
767  fprintf(f1," -4 DISP %1" ITGFORMAT " 1\n",mi[1]);
768  for(j=1;j<=mi[1];j++){
769  fprintf(f1," -5 D%1" ITGFORMAT " 1 1 0 0\n",j);
770  }
771 
772  frdgeneralvector(v,&iset,ntrans,filab,&nkcoords,inum,m1,inotr,
773  trab,co,istartset,iendset,ialset,mi,ngraph,f1,output,m3);
774  }else{
775  printf("*WARNING in frd:\n");
776  printf(" for output purposes only 4, 5 or 6\n");
777  printf(" degrees of freedom are allowed\n");
778  printf(" for generalized vectors;\n");
779  printf(" actual degrees of freedom = %d\n",mi[1]);
780  printf(" output request ist not performed;\n");
781  }
782  }
783  }
784 
785  /* storing the imaginary part of displacements in the nodes
786  for the odd modes of cyclic symmetry calculations */
787 
788  if(*noddiam>=0){
789  if((strcmp1(filab,"U ")==0)&&(*ithermal!=2)){
790 
791  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
792  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
793 
794  fprintf(f1," -4 DISPI 4 1\n");
795  fprintf(f1," -5 D1 1 2 1 0\n");
796  fprintf(f1," -5 D2 1 2 2 0\n");
797  fprintf(f1," -5 D3 1 2 3 0\n");
798  fprintf(f1," -5 ALL 1 2 0 0 1ALL\n");
799 
800  frdvector(&v[*nk*mt],&iset,ntrans,filab,&nkcoords,inum,m1,inotr,
801  trab,co,istartset,iendset,ialset,mi,ngraph,f1,output,m3);
802  }
803  }
804 
805  /* storing the imaginary part of displacements in the nodes
806  for steady state calculations */
807 
808  if((*nmethod==5)&&(*mode==0)){
809  if((strcmp1(filab,"U ")==0)&&(*ithermal!=2)){
810  iselect=1;
811 
812  frdset(filab,set,&iset,istartset,iendset,ialset,
813  inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
814  ngraph);
815 
816  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
817  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
818 
819  fprintf(f1," -4 DISPI 4 1\n");
820  fprintf(f1," -5 D1 1 2 1 0\n");
821  fprintf(f1," -5 D2 1 2 2 0\n");
822  fprintf(f1," -5 D3 1 2 3 0\n");
823  fprintf(f1," -5 ALL 1 2 0 0 1ALL\n");
824 
825  frdvector(v,&iset,ntrans,filab,&nkcoords,inum,m1,inotr,
826  trab,co,istartset,iendset,ialset,mi,ngraph,f1,output,m3);
827  }
828  }
829 
830  /* storing the velocities in the nodes */
831 
832  if((strcmp1(&filab[1740],"V ")==0)&&(*ithermal!=2)){
833  iselect=1;
834 
835  frdset(&filab[1740],set,&iset,istartset,iendset,ialset,
836  inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
837  ngraph);
838 
839  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
840  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
841 
842  fprintf(f1," -4 VELO 4 1\n");
843  fprintf(f1," -5 V1 1 2 1 0\n");
844  fprintf(f1," -5 V2 1 2 2 0\n");
845  fprintf(f1," -5 V3 1 2 3 0\n");
846  fprintf(f1," -5 ALL 1 2 0 0 1ALL\n");
847 
848  frdvector(veold,&iset,ntrans,&filab[1740],&nkcoords,inum,m1,inotr,
849  trab,co,istartset,iendset,ialset,mi,ngraph,f1,output,m3);
850  }
851 
852  /* storing the temperatures in the nodes */
853 
854  if(strcmp1(&filab[87],"NT ")==0){
855  iselect=0;
856 
857  frdset(&filab[87],set,&iset,istartset,iendset,ialset,
858  inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
859  ngraph);
860 
861  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
862  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
863 
864  fprintf(f1," -4 NDTEMP 1 1\n");
865  fprintf(f1," -5 T 1 1 0 0\n");
866 
867  if(*ithermal<=1){
868  frdselect(t1,t1,&iset,&nkcoords,inum,m1,istartset,iendset,
869  ialset,ngraph,&ncompscalar,ifieldscalar,icompscalar,
870  nfieldscalar,&iselect,m2,f1,output,m3);
871  }else{
872  frdselect(v,v,&iset,&nkcoords,inum,m1,istartset,iendset,
873  ialset,ngraph,&ncompscalar,ifieldscalar,icompscalar,
874  nfieldvector0,&iselect,m2,f1,output,m3);
875  }
876  }
877 
878  /* storing the electrical potential in the nodes */
879 
880  if((strcmp1(&filab[3654],"POT ")==0)&&(*ithermal==2)){
881  iselect=0;
882 
883  frdset(&filab[3654],set,&iset,istartset,iendset,ialset,
884  inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
885  ngraph);
886 
887  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
888  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
889 
890  fprintf(f1," -4 ELPOT 1 1\n");
891  fprintf(f1," -5 V 1 1 0 0\n");
892 
893  frdselect(v,v,&iset,&nkcoords,inum,m1,istartset,iendset,
894  ialset,ngraph,&ncompscalar,ifieldscalar,icompscalar,
895  nfieldvector0,&iselect,m2,f1,output,m3);
896  }
897 
898  /* storing the stresses in the nodes */
899 
900  if((*nmethod!=5)||(*mode==-1)){
901  if((strcmp1(&filab[174],"S ")==0)&&(*ithermal!=2)){
902  iselect=1;
903 
904  frdset(&filab[174],set,&iset,istartset,iendset,ialset,
905  inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
906  ngraph);
907 
908  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
909  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
910 
911  fprintf(f1," -4 STRESS 6 1\n");
912  fprintf(f1," -5 SXX 1 4 1 1\n");
913  fprintf(f1," -5 SYY 1 4 2 2\n");
914  fprintf(f1," -5 SZZ 1 4 3 3\n");
915  fprintf(f1," -5 SXY 1 4 1 2\n");
916  fprintf(f1," -5 SYZ 1 4 2 3\n");
917  fprintf(f1," -5 SZX 1 4 3 1\n");
918 
919  frdselect(stn,stn,&iset,&nkcoords,inum,m1,istartset,iendset,
920  ialset,ngraph,&ncomptensor,ifieldtensor,icomptensor,
921  nfieldtensor,&iselect,m2,f1,output,m3);
922 
923  }
924  }
925 
926  /* storing the imaginary part of the stresses in the nodes
927  for the odd modes of cyclic symmetry calculations */
928 
929  if(*noddiam>=0){
930  if((strcmp1(&filab[174],"S ")==0)&&(*ithermal!=2)){
931 
932  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
933  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
934 
935  fprintf(f1," -4 STRESSI 6 1\n");
936  fprintf(f1," -5 SXX 1 4 1 1\n");
937  fprintf(f1," -5 SYY 1 4 2 2\n");
938  fprintf(f1," -5 SZZ 1 4 3 3\n");
939  fprintf(f1," -5 SXY 1 4 1 2\n");
940  fprintf(f1," -5 SYZ 1 4 2 3\n");
941  fprintf(f1," -5 SZX 1 4 3 1\n");
942 
943  frdselect(&stn[6**nk],stn,&iset,&nkcoords,inum,m1,istartset,iendset,
944  ialset,ngraph,&ncomptensor,ifieldtensor,icomptensor,
945  nfieldtensor,&iselect,m2,f1,output,m3);
946 
947  }
948  }
949 
950  /* storing the imaginary part of the stresses in the nodes
951  for steady state calculations */
952 
953  if((*nmethod==5)&&(*mode==0)){
954  if((strcmp1(&filab[174],"S ")==0)&&(*ithermal!=2)){
955  iselect=1;
956 
957  frdset(&filab[174],set,&iset,istartset,iendset,ialset,
958  inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
959  ngraph);
960 
961  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
962  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
963 
964  fprintf(f1," -4 STRESSI 6 1\n");
965  fprintf(f1," -5 SXX 1 4 1 1\n");
966  fprintf(f1," -5 SYY 1 4 2 2\n");
967  fprintf(f1," -5 SZZ 1 4 3 3\n");
968  fprintf(f1," -5 SXY 1 4 1 2\n");
969  fprintf(f1," -5 SYZ 1 4 2 3\n");
970  fprintf(f1," -5 SZX 1 4 3 1\n");
971 
972  frdselect(stn,stn,&iset,&nkcoords,inum,m1,istartset,iendset,
973  ialset,ngraph,&ncomptensor,ifieldtensor,icomptensor,
974  nfieldtensor,&iselect,m2,f1,output,m3);
975 
976  }
977  }
978 
979  /* storing the electromagnetic field E in the nodes */
980 
981  if((strcmp1(&filab[3741],"EMFE")==0)&&(*ithermal!=2)){
982  iselect=1;
983 
984  frdset(&filab[3741],set,&iset,istartset,iendset,ialset,
985  inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
986  ngraph);
987 
988  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
989  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
990 
991  fprintf(f1," -4 EMFE 4 1\n");
992  fprintf(f1," -5 E1 1 2 1 0\n");
993  fprintf(f1," -5 E2 1 2 2 0\n");
994  fprintf(f1," -5 E3 1 2 3 0\n");
995  fprintf(f1," -5 ALL 1 2 0 0 1ALL\n");
996 
997  frdselect(stn,stn,&iset,&nkcoords,inum,m1,istartset,iendset,
998  ialset,ngraph,&ncompvector,ifieldvector,icompvector,
999  nfieldtensor,&iselect,m2,f1,output,m3);
1000 
1001  }
1002 
1003  /* storing the electromagnetic field B in the nodes */
1004 
1005  if((strcmp1(&filab[3828],"EMFB")==0)&&(*ithermal!=2)){
1006  iselect=1;
1007 
1008  frdset(&filab[3828],set,&iset,istartset,iendset,ialset,
1009  inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1010  ngraph);
1011 
1012  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1013  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1014 
1015  fprintf(f1," -4 EMFB 4 1\n");
1016  fprintf(f1," -5 B1 1 2 1 0\n");
1017  fprintf(f1," -5 B2 1 2 2 0\n");
1018  fprintf(f1," -5 B3 1 2 3 0\n");
1019  fprintf(f1," -5 ALL 1 2 0 0 1ALL\n");
1020 
1021  frdselect(stn,stn,&iset,&nkcoords,inum,m1,istartset,iendset,
1022  ialset,ngraph,&ncompvector,ifieldvector,icompvectorlast,
1023  nfieldtensor,&iselect,m2,f1,output,m3);
1024 
1025  }
1026 
1027  /* storing the total strains in the nodes */
1028 
1029  if((*nmethod!=5)||(*mode==-1)){
1030  if((strcmp1(&filab[261],"E ")==0)&&(*ithermal!=2)){
1031  iselect=1;
1032 
1033  frdset(&filab[261],set,&iset,istartset,iendset,ialset,
1034  inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1035  ngraph);
1036 
1037  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1038  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1039 
1040  fprintf(f1," -4 TOSTRAIN 6 1\n");
1041  fprintf(f1," -5 EXX 1 4 1 1\n");
1042  fprintf(f1," -5 EYY 1 4 2 2\n");
1043  fprintf(f1," -5 EZZ 1 4 3 3\n");
1044  fprintf(f1," -5 EXY 1 4 1 2\n");
1045  fprintf(f1," -5 EYZ 1 4 2 3\n");
1046  fprintf(f1," -5 EZX 1 4 3 1\n");
1047 
1048  frdselect(een,een,&iset,&nkcoords,inum,m1,istartset,iendset,
1049  ialset,ngraph,&ncomptensor,ifieldtensor,icomptensor,
1050  nfieldtensor,&iselect,m2,f1,output,m3);
1051 
1052  }
1053  }
1054 
1055  /* storing the imaginary part of the total strains in the nodes
1056  for the odd modes of cyclic symmetry calculations */
1057 
1058  if(*noddiam>=0){
1059  if((strcmp1(&filab[261],"E ")==0)&&(*ithermal!=2)){
1060 
1061  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1062  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1063 
1064  fprintf(f1," -4 TOSTRAII 6 1\n");
1065  fprintf(f1," -5 EXX 1 4 1 1\n");
1066  fprintf(f1," -5 EYY 1 4 2 2\n");
1067  fprintf(f1," -5 EZZ 1 4 3 3\n");
1068  fprintf(f1," -5 EXY 1 4 1 2\n");
1069  fprintf(f1," -5 EYZ 1 4 2 3\n");
1070  fprintf(f1," -5 EZX 1 4 3 1\n");
1071 
1072  frdselect(&een[6**nk],een,&iset,&nkcoords,inum,m1,istartset,iendset,
1073  ialset,ngraph,&ncomptensor,ifieldtensor,icomptensor,
1074  nfieldtensor,&iselect,m2,f1,output,m3);
1075 
1076  }
1077  }
1078 
1079  /* storing the imaginary part of the total strains in the nodes
1080  for steady state calculations */
1081 
1082  if((*nmethod==5)&&(*mode==0)){
1083  if((strcmp1(&filab[261],"E ")==0)&&(*ithermal!=2)){
1084  iselect=1;
1085 
1086  frdset(&filab[261],set,&iset,istartset,iendset,ialset,
1087  inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1088  ngraph);
1089 
1090  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1091  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1092 
1093  fprintf(f1," -4 TOSTRAII 6 1\n");
1094  fprintf(f1," -5 EXX 1 4 1 1\n");
1095  fprintf(f1," -5 EYY 1 4 2 2\n");
1096  fprintf(f1," -5 EZZ 1 4 3 3\n");
1097  fprintf(f1," -5 EXY 1 4 1 2\n");
1098  fprintf(f1," -5 EYZ 1 4 2 3\n");
1099  fprintf(f1," -5 EZX 1 4 3 1\n");
1100 
1101  frdselect(een,een,&iset,&nkcoords,inum,m1,istartset,iendset,
1102  ialset,ngraph,&ncomptensor,ifieldtensor,icomptensor,
1103  nfieldtensor,&iselect,m2,f1,output,m3);
1104 
1105  }
1106  }
1107 
1108  /* storing the mechanical strains in the nodes */
1109 
1110  if((*nmethod!=5)||(*mode==-1)){
1111  if((strcmp1(&filab[2697],"ME ")==0)&&(*ithermal!=2)){
1112  iselect=1;
1113 
1114  frdset(&filab[2697],set,&iset,istartset,iendset,ialset,
1115  inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1116  ngraph);
1117 
1118  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1119  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1120 
1121  fprintf(f1," -4 MESTRAIN 6 1\n");
1122  fprintf(f1," -5 MEXX 1 4 1 1\n");
1123  fprintf(f1," -5 MEYY 1 4 2 2\n");
1124  fprintf(f1," -5 MEZZ 1 4 3 3\n");
1125  fprintf(f1," -5 MEXY 1 4 1 2\n");
1126  fprintf(f1," -5 MEYZ 1 4 2 3\n");
1127  fprintf(f1," -5 MEZX 1 4 3 1\n");
1128 
1129 
1130  frdselect(emn,emn,&iset,&nkcoords,inum,m1,istartset,iendset,
1131  ialset,ngraph,&ncomptensor,ifieldtensor,icomptensor,
1132  nfieldtensor,&iselect,m2,f1,output,m3);
1133 
1134  }
1135  }
1136 
1137  /* storing the imaginary part of the mechanical strains in the nodes
1138  for the odd modes of cyclic symmetry calculations */
1139 
1140  if((*noddiam>=0)||((*nmethod==5)&&(*mode==0))){
1141  if((strcmp1(&filab[2697],"ME ")==0)&&(*ithermal!=2)){
1142 
1143  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1144  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1145 
1146  fprintf(f1," -4 MESTRAII 6 1\n");
1147  fprintf(f1," -5 MEXX 1 4 1 1\n");
1148  fprintf(f1," -5 MEYY 1 4 2 2\n");
1149  fprintf(f1," -5 MEZZ 1 4 3 3\n");
1150  fprintf(f1," -5 MEXY 1 4 1 2\n");
1151  fprintf(f1," -5 MEYZ 1 4 2 3\n");
1152  fprintf(f1," -5 MEZX 1 4 3 1\n");
1153 
1154  frdselect(&emn[6**nk],een,&iset,&nkcoords,inum,m1,istartset,iendset,
1155  ialset,ngraph,&ncomptensor,ifieldtensor,icomptensor,
1156  nfieldtensor,&iselect,m2,f1,output,m3);
1157 
1158  }
1159  }
1160 
1161  /* storing the forces in the nodes */
1162 
1163  if((*nmethod!=5)||(*mode==-1)){
1164  if((strcmp1(&filab[348],"RF ")==0)&&(*ithermal!=2)){
1165  iselect=1;
1166 
1167  frdset(&filab[348],set,&iset,istartset,iendset,ialset,
1168  inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1169  ngraph);
1170 
1171  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1172  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1173 
1174  fprintf(f1," -4 FORC 4 1\n");
1175  fprintf(f1," -5 F1 1 2 1 0\n");
1176  fprintf(f1," -5 F2 1 2 2 0\n");
1177  fprintf(f1," -5 F3 1 2 3 0\n");
1178  fprintf(f1," -5 ALL 1 2 0 0 1ALL\n");
1179 
1180  if((iaxial==1)&&(strcmp1(&filab[352],"I")==0)){for(i=0;i<*nk;i++){fn[1+i*mt]*=180.;fn[2+i*mt]*=180.;fn[3+i*mt]*=180.;}}
1181  frdvector(fn,&iset,ntrans,&filab[348],&nkcoords,inum,m1,inotr,
1182  trab,co,istartset,iendset,ialset,mi,ngraph,f1,output,m3);
1183  if((iaxial==1)&&(strcmp1(&filab[352],"I")==0)){for(i=0;i<*nk;i++){fn[1+i*mt]/=180.;fn[2+i*mt]/=180.;fn[3+i*mt]/=180.;}}
1184  }
1185  }
1186 
1187  /* storing the imaginary part of the forces in the nodes
1188  for the odd modes of cyclic symmetry calculations */
1189 
1190  if((*noddiam>=0)||((*nmethod==5)&&(*mode==0))){
1191  if((strcmp1(&filab[348],"RF ")==0)&&(*ithermal!=2)){
1192 
1193  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1194  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1195 
1196  fprintf(f1," -4 FORCI 4 1\n");
1197  fprintf(f1," -5 F1 1 2 1 0\n");
1198  fprintf(f1," -5 F2 1 2 2 0\n");
1199  fprintf(f1," -5 F3 1 2 3 0\n");
1200  fprintf(f1," -5 ALL 1 2 0 0 1ALL\n");
1201 
1202  frdvector(&fn[*nk*mt],&iset,ntrans,filab,&nkcoords,inum,m1,inotr,
1203  trab,co,istartset,iendset,ialset,mi,ngraph,f1,output,m3);
1204  }
1205  }
1206 
1207  /* storing the equivalent plastic strains in the nodes */
1208 
1209  if((strcmp1(&filab[435],"PEEQ")==0)&&(*ithermal!=2)){
1210  iselect=1;
1211 
1212  frdset(&filab[435],set,&iset,istartset,iendset,ialset,
1213  inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1214  ngraph);
1215 
1216  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1217  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1218 
1219  fprintf(f1," -4 PE 1 1\n");
1220  fprintf(f1," -5 PE 1 1 0 0\n");
1221 
1222  frdselect(epn,epn,&iset,&nkcoords,inum,m1,istartset,iendset,
1223  ialset,ngraph,&ncompscalar,ifieldscalar,icompscalar,
1224  nfieldscalar,&iselect,m2,f1,output,m3);
1225 
1226  }
1227 
1228  /* storing the energy in the nodes */
1229 
1230  if((strcmp1(&filab[522],"ENER")==0)&&(*ithermal!=2)){
1231  iselect=1;
1232 
1233  frdset(&filab[522],set,&iset,istartset,iendset,ialset,
1234  inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1235  ngraph);
1236 
1237  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1238  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1239 
1240  fprintf(f1," -4 ENER 1 1\n");
1241  fprintf(f1," -5 ENER 1 1 0 0\n");
1242 
1243  frdselect(enern,enern,&iset,&nkcoords,inum,m1,istartset,iendset,
1244  ialset,ngraph,&ncompscalar,ifieldscalar,icompscalar,
1245  nfieldscalar,&iselect,m2,f1,output,m3);
1246 
1247  }
1248 
1249  /* storing the contact displacements and stresses at the slave nodes */
1250 
1251  /* node-to-face penalty */
1252 
1253  if((strcmp1(&filab[2175],"CONT")==0)&&(*mortar!=1)&&(*ithermal!=2)&&(*nmethod!=2)){
1254 
1255  for(i=*ne-1;i>=0;i--){
1256  if((strcmp1(&lakon[8*i+1],"S")!=0)||(strcmp1(&lakon[8*i+6],"C")!=0))
1257  break;
1258  }
1259  noutloc=*ne-i-1;
1260 
1261  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1262  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1263 
1264  fprintf(f1," -4 CONTACT 6 1\n");
1265  fprintf(f1," -5 COPEN 1 4 1 1\n");
1266  fprintf(f1," -5 CSLIP1 1 4 2 2\n");
1267  fprintf(f1," -5 CSLIP2 1 4 3 3\n");
1268  fprintf(f1," -5 CPRESS 1 4 1 2\n");
1269  fprintf(f1," -5 CSHEAR1 1 4 2 3\n");
1270  fprintf(f1," -5 CSHEAR2 1 4 3 1\n");
1271 
1272  for(i=*ne-1;i>=0;i--){
1273  if((strcmp1(&lakon[8*i+1],"S")!=0)||(strcmp1(&lakon[8*i+6],"C")!=0))
1274  break;
1275  strcpy1(text,&lakon[8*i+7],1);
1276  nope=atoi(text)+1;
1277  nodes=kon[ipkon[i]+nope-1];
1278  if(strcmp1(output,"asc")==0){
1279  fprintf(f1,"%3s%10" ITGFORMAT "",m1,nodes);
1280  for(j=0;j<6;j++)fprintf(f1,"%12.5E",(float)stx[6*mi[0]*i+j]);
1281  }else{
1282  iw=(int)(nodes);fwrite(&iw,sizeof(int),1,f1);
1283  for(j=0;j<6;j++){
1284  ifl=(float)stx[6*mi[0]*i+j];
1285  fwrite(&ifl,sizeof(float),1,f1);
1286  }
1287  }
1288  if(strcmp1(output,"asc")==0)fprintf(f1,"\n");
1289  }
1290 
1291  if(strcmp1(output,"asc")==0)fprintf(f1,"%3s\n",m3);
1292  }
1293 
1294  /* face-to-face penalty */
1295 
1296  if((*nmethod!=5)||(*mode==-1)){
1297  if((strcmp1(&filab[2175],"CONT")==0)&&(*mortar==1)&&(*ithermal!=2)){
1298  iselect=1;
1299 
1300  frdset(&filab[2175],set,&iset,istartset,iendset,ialset,
1301  inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1302  ngraph);
1303 
1304  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1305  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1306  fprintf(f1," -4 CONTACT 6 1\n");
1307  fprintf(f1," -5 COPEN 1 4 1 1\n");
1308  fprintf(f1," -5 CSLIP1 1 4 2 2\n");
1309  fprintf(f1," -5 CSLIP2 1 4 3 3\n");
1310  fprintf(f1," -5 CPRESS 1 4 1 2\n");
1311  fprintf(f1," -5 CSHEAR1 1 4 2 3\n");
1312  fprintf(f1," -5 CSHEAR2 1 4 3 1\n");
1313 
1314  frdselect(cdn,cdn,&iset,&nkcoords,inum,m1,istartset,iendset,
1315  ialset,ngraph,&ncomptensor,ifieldtensor,icomptensor,
1316  nfieldtensor,&iselect,m2,f1,output,m3);
1317 
1318  }
1319  }
1320 
1321  /* storing imaginary part of the differential contact displacements
1322  and the contact stresses for the odd modes of cyclic symmetry
1323  calculations */
1324 
1325  if((*noddiam>=0)||((*nmethod==5)&&(*mode==0))){
1326  if((strcmp1(&filab[2175],"CONT")==0)&&(*mortar==1)&&(*ithermal!=2)){
1327  iselect=1;
1328 
1329  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1330  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1331  fprintf(f1," -4 CONTACTI 6 1\n");
1332  fprintf(f1," -5 COPEN 1 4 1 1\n");
1333  fprintf(f1," -5 CSLIP1 1 4 2 2\n");
1334  fprintf(f1," -5 CSLIP2 1 4 3 3\n");
1335  fprintf(f1," -5 CPRESS 1 4 1 2\n");
1336  fprintf(f1," -5 CSHEAR1 1 4 2 3\n");
1337  fprintf(f1," -5 CSHEAR2 1 4 3 1\n");
1338 
1339  frdselect(&cdn[6**nk],cdn,&iset,&nkcoords,inum,m1,istartset,iendset,
1340  ialset,ngraph,&ncomptensor,ifieldtensor,icomptensor,
1341  nfieldtensor,&iselect,m2,f1,output,m3);
1342 
1343  }
1344  }
1345  /* storing the contact energy at the slave nodes */
1346 
1347  if((strcmp1(&filab[2262],"CELS")==0)&&(*ithermal!=2)){
1348 
1349  for(i=*ne-1;i>=0;i--){
1350  if((strcmp1(&lakon[8*i+1],"S")!=0)||(strcmp1(&lakon[8*i+6],"C")!=0))
1351  break;
1352  }
1353  noutloc=*ne-i-1;
1354 
1355  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1356  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1357 
1358  fprintf(f1," -4 CELS 1 1\n");
1359  fprintf(f1," -5 CELS 1 1 0 0\n");
1360 
1361  for(i=*ne-1;i>=0;i--){
1362  if((strcmp1(&lakon[8*i+1],"S")!=0)||(strcmp1(&lakon[8*i+6],"C")!=0))
1363  break;
1364  nope=atoi(&lakon[8*i+7])+1;
1365  nodes=kon[ipkon[i]+nope-1];
1366  if(strcmp1(output,"asc")==0){
1367  fprintf(f1,"%3s%10" ITGFORMAT "%12.5E\n",m1,nodes,(float)ener[i*mi[0]]);
1368  }else{
1369  iw=(int)(nodes);fwrite(&iw,sizeof(int),1,f1);
1370  ifl=(float)ener[i*mi[0]];
1371  fwrite(&ifl,sizeof(float),1,f1);
1372  }
1373  }
1374 
1375  if(strcmp1(output,"asc")==0)fprintf(f1,"%3s\n",m3);
1376  }
1377 
1378  /* storing the internal state variables in the nodes */
1379 
1380  if(strcmp1(&filab[609],"SDV ")==0){
1381  iselect=1;
1382 
1383  frdset(&filab[609],set,&iset,istartset,iendset,ialset,
1384  inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1385  ngraph);
1386 
1387  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1388  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1389 
1390  fprintf(f1," -4 SDV %2" ITGFORMAT " 1\n",*nstate_);
1391  for(j=1;j<=*nstate_;j++){
1392  fprintf(f1," -5 SDV%-2" ITGFORMAT " 1 1 0 0\n",j);
1393  }
1394 
1395  for(i=0;i<*nstate_;i++){
1396  ifieldstate[i]=1;icompstate[i]=i;
1397  }
1398  nfield[0]=*nstate_;
1399 
1400  frdselect(xstaten,xstaten,&iset,&nkcoords,inum,m1,istartset,iendset,
1401  ialset,ngraph,nstate_,ifieldstate,icompstate,
1402  nfield,&iselect,m2,f1,output,m3);
1403 
1404  }
1405 
1406  /* storing the heat flux in the nodes
1407  the heat flux has been extrapolated from the integration points
1408  in subroutine extrapolate.f, taking into account whether the
1409  results are requested in the global system or in a local system.
1410  Therefore, subroutine frdvector cannot be used, since it assumes
1411  the values are stored in the global system */
1412 
1413  if((strcmp1(&filab[696],"HFL ")==0)&&(*ithermal>1)){
1414  iselect=1;
1415 
1416  frdset(&filab[696],set,&iset,istartset,iendset,ialset,
1417  inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1418  ngraph);
1419 
1420  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1421  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1422 
1423  fprintf(f1," -4 FLUX 4 1\n");
1424  fprintf(f1," -5 F1 1 2 1 0\n");
1425  fprintf(f1," -5 F2 1 2 2 0\n");
1426  fprintf(f1," -5 F3 1 2 3 0\n");
1427  fprintf(f1," -5 ALL 1 2 0 0 1ALL\n");
1428 
1429  frdselect(qfn,qfn,&iset,&nkcoords,inum,m1,istartset,iendset,
1430  ialset,ngraph,&ncompvector,ifieldvector,icompvector,
1431  nfieldvector1,&iselect,m2,f1,output,m3);
1432 
1433  }
1434 
1435  /* storing the electrical current in the nodes
1436  (cf. heat flux HFL above) */
1437 
1438  if((strcmp1(&filab[3567],"ECD ")==0)&&(*ithermal==2)){
1439  iselect=1;
1440 
1441  frdset(&filab[3567],set,&iset,istartset,iendset,ialset,
1442  inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1443  ngraph);
1444 
1445  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1446  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1447 
1448  fprintf(f1," -4 CURR 4 1\n");
1449  fprintf(f1," -5 j1 1 2 1 0\n");
1450  fprintf(f1," -5 j2 1 2 2 0\n");
1451  fprintf(f1," -5 j3 1 2 3 0\n");
1452  fprintf(f1," -5 ALL 1 2 0 0 1ALL\n");
1453 
1454  frdselect(qfn,qfn,&iset,&nkcoords,inum,m1,istartset,iendset,
1455  ialset,ngraph,&ncompvector,ifieldvector,icompvector,
1456  nfieldvector1,&iselect,m2,f1,output,m3);
1457 
1458  }
1459 
1460  /* storing the heat generation in the nodes */
1461 
1462  if((strcmp1(&filab[783],"RFL ")==0)&&(*ithermal>1)){
1463  iselect=1;
1464 
1465  frdset(&filab[783],set,&iset,istartset,iendset,ialset,
1466  inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1467  ngraph);
1468 
1469  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1470  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1471 
1472  fprintf(f1," -4 RFL 1 1\n");
1473  fprintf(f1," -5 RFL 1 1 0 0\n");
1474 
1475  frdselect(fn,fn,&iset,&nkcoords,inum,m1,istartset,iendset,
1476  ialset,ngraph,&ncompscalar,ifieldscalar,icompscalar,
1477  nfieldvector0,&iselect,m2,f1,output,m3);
1478 
1479  }
1480 
1481  /* storing the Zienkiewicz-Zhu improved stresses in the nodes */
1482 
1483  if((*nmethod!=5)||(*mode==-1)){
1484  if((strcmp1(&filab[1044],"ZZS")==0)&&(*ithermal!=2)){
1485 
1486  FORTRAN(zienzhu,(co,nk,kon,ipkon,lakon,ne0,stn,ipneigh,neigh,
1487  stx,&mi[0]));
1488 
1489  iselect=1;
1490 
1491  frdset(&filab[1044],set,&iset,istartset,iendset,ialset,
1492  inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1493  ngraph);
1494 
1495  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1496  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1497 
1498  fprintf(f1," -4 ZZSTR 6 1\n");
1499  fprintf(f1," -5 SXX 1 4 1 1\n");
1500  fprintf(f1," -5 SYY 1 4 2 2\n");
1501  fprintf(f1," -5 SZZ 1 4 3 3\n");
1502  fprintf(f1," -5 SXY 1 4 1 2\n");
1503  fprintf(f1," -5 SYZ 1 4 2 3\n");
1504  fprintf(f1," -5 SZX 1 4 3 1\n");
1505 
1506  frdselect(stn,stn,&iset,&nkcoords,inum,m1,istartset,iendset,
1507  ialset,ngraph,&ncomptensor,ifieldtensor,icomptensor,
1508  nfieldtensor,&iselect,m2,f1,output,m3);
1509 
1510  }
1511  }
1512 
1513  /* storing the imaginary part of the Zienkiewicz-Zhu
1514  improved stresses in the nodes
1515  for the odd modes of cyclic symmetry calculations */
1516 
1517  if((*noddiam>=0)||((*nmethod==5)&&(*mode==0))){
1518  if((strcmp1(&filab[1044],"ZZS")==0)&&(*ithermal!=2)){
1519 
1520  FORTRAN(zienzhu,(co,nk,kon,ipkon,lakon,ne0,stn,ipneigh,neigh,
1521  &stx[6*mi[0]**ne],&mi[0]));
1522 
1523  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1524  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1525 
1526  fprintf(f1," -4 ZZSTRI 6 1\n");
1527  fprintf(f1," -5 SXX 1 4 1 1\n");
1528  fprintf(f1," -5 SYY 1 4 2 2\n");
1529  fprintf(f1," -5 SZZ 1 4 3 3\n");
1530  fprintf(f1," -5 SXY 1 4 1 2\n");
1531  fprintf(f1," -5 SYZ 1 4 2 3\n");
1532  fprintf(f1," -5 SZX 1 4 3 1\n");
1533 
1534  frdselect(stn,stn,&iset,&nkcoords,inum,m1,istartset,iendset,
1535  ialset,ngraph,&ncomptensor,ifieldtensor,icomptensor,
1536  nfieldtensor,&iselect,m2,f1,output,m3);
1537 
1538  }
1539  }
1540 
1541  /* storing the error estimator in the nodes */
1542 
1543  if((*nmethod!=5)||(*mode==-1)){
1544  if((strcmp1(&filab[1044],"ERR")==0)&&(*ithermal!=2)){
1545 
1546  nterms=6;
1547  FORTRAN(errorestimator,(stx,stn,ipkon,kon,lakon,nk,ne,
1548  mi,ielmat,&nterms,inum,co,vold,&filab[1048]));
1549 
1550  iselect=1;
1551 
1552  frdset(&filab[1044],set,&iset,istartset,iendset,ialset,
1553  inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1554  ngraph);
1555 
1556  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1557  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1558 
1559  fprintf(f1," -4 ERROR 2 1\n");
1560  fprintf(f1," -5 STR(%%) 1 1 1 0\n");
1561  fprintf(f1," -5 REL 1 2 2 0\n");
1562 
1563  ncomp=2;
1564  ifield[0]=1;ifield[1]=1;
1565  icomp[0]=0;icomp[1]=1;
1566 
1567  frdselect(stn,stn,&iset,&nkcoords,inum,m1,istartset,iendset,
1568  ialset,ngraph,&ncomp,ifield,icomp,
1569  nfieldtensor,&iselect,m2,f1,output,m3);
1570 
1571  }
1572  }
1573 
1574  /* storing the imaginary part of the error estimator in the nodes
1575  for the odd modes of cyclic symmetry calculations */
1576 
1577  if((*noddiam>=0)||((*nmethod==5)&&(*mode==0))){
1578  if((strcmp1(&filab[1044],"ERR")==0)&&(*ithermal!=2)){
1579 
1580  nterms=6;
1581  FORTRAN(errorestimator,(&stx[6*mi[0]**ne],stn,ipkon,kon,lakon,nk,ne,
1582  mi,ielmat,&nterms,inum,co,vold,&filab[1048]));
1583 
1584  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1585  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1586 
1587  fprintf(f1," -4 ERRORI 2 1\n");
1588  fprintf(f1," -5 STR(%%) 1 1 1 0\n");
1589  fprintf(f1," -5 REL 1 2 2 0\n");
1590 
1591  ncomp=2;
1592  ifield[0]=1;ifield[1]=1;
1593  icomp[0]=0;icomp[1]=1;
1594 
1595  frdselect(stn,stn,&iset,&nkcoords,inum,m1,istartset,iendset,
1596  ialset,ngraph,&ncomp,ifield,icomp,
1597  nfieldtensor,&iselect,m2,f1,output,m3);
1598 
1599  }
1600  }
1601 
1602  /* storing the thermal error estimator in the nodes */
1603 
1604  if((*nmethod!=5)||(*mode==-1)){
1605  if((strcmp1(&filab[2784],"HER")==0)&&(*ithermal>1)){
1606 
1607  nterms=3;
1608  FORTRAN(errorestimator,(qfx,qfn,ipkon,kon,lakon,nk,ne,
1609  mi,ielmat,&nterms,inum,co,vold,&filab[2788]));
1610 
1611  iselect=1;
1612 
1613  frdset(&filab[2784],set,&iset,istartset,iendset,ialset,
1614  inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1615  ngraph);
1616 
1617  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1618  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1619 
1620  fprintf(f1," -4 HERROR 1 1\n");
1621  fprintf(f1," -5 HFLSTD 1 1 1 0\n");
1622 
1623  ncomp=1;
1624  ifield[0]=1;
1625  icomp[0]=1;
1626 
1627  frdselect(qfn,qfn,&iset,&nkcoords,inum,m1,istartset,iendset,
1628  ialset,ngraph,&ncomp,ifield,icomp,
1629  nfieldvector1,&iselect,m2,f1,output,m3);
1630 
1631  }
1632  }
1633 
1634  /* storing the imaginary part of the thermal error estimator in the nodes
1635  for the odd modes of cyclic symmetry calculations */
1636 
1637  if((*noddiam>=0)||((*nmethod==5)&&(*mode==0))){
1638  if((strcmp1(&filab[2784],"HER")==0)&&(*ithermal>1)){
1639 
1640  nterms=3;
1641  FORTRAN(errorestimator,(&qfx[3*mi[0]**ne],qfn,ipkon,kon,lakon,nk,ne,
1642  mi,ielmat,&nterms,inum,co,vold,&filab[2788]));
1643 
1644  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1645  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1646 
1647  fprintf(f1," -4 HERRORI 1 1\n");
1648  fprintf(f1," -5 HFLSTD 1 1 1 0\n");
1649 
1650  ncomp=1;
1651  ifield[0]=1;
1652  icomp[0]=1;
1653 
1654  frdselect(qfn,qfn,&iset,&nkcoords,inum,m1,istartset,iendset,
1655  ialset,ngraph,&ncomp,ifield,icomp,
1656  nfieldtensor,&iselect,m2,f1,output,m3);
1657 
1658  }
1659  }
1660 
1661  /* storing the total temperatures in the network nodes */
1662 
1663  if((strcmp1(&filab[1131],"TT ")==0)&&(*ithermal>1)){
1664 
1665  iselect=-1;
1666  frdset(&filab[1131],set,&iset,istartset,iendset,ialset,
1667  inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1668  ngraph);
1669 
1670  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1671  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1672 
1673  fprintf(f1," -4 TOTEMP 1 1\n");
1674  fprintf(f1," -5 TT 1 1 0 0\n");
1675 
1676  frdselect(v,v,&iset,&nkcoords,inum,m1,istartset,iendset,
1677  ialset,ngraph,&ncompscalar,ifieldscalar,icompscalar,
1678  nfieldvector0,&iselect,m2,f1,output,m3);
1679 
1680  }
1681 
1682  /* storing the mass flow in the network nodes */
1683 
1684  if((strcmp1(&filab[1218],"MF ")==0)&&(*ithermal>1)){
1685 
1686  iselect=-1;
1687  frdset(&filab[1218],set,&iset,istartset,iendset,ialset,
1688  inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1689  ngraph);
1690 
1691  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1692  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1693 
1694  fprintf(f1," -4 MAFLOW 1 1\n");
1695  fprintf(f1," -5 MF 1 1 0 0\n");
1696 
1697  icomp[0]=1;
1698  if((iaxial==1)&&(strcmp1(&filab[1222],"I")==0)){for(i=0;i<*nk;i++)v[1+i*mt]*=180.;}
1699  frdselect(v,v,&iset,&nkcoords,inum,m1,istartset,iendset,
1700  ialset,ngraph,&ncompscalar,ifieldscalar,icomp,
1701  nfieldvector0,&iselect,m2,f1,output,m3);
1702  if((iaxial==1)&&(strcmp1(&filab[1222],"I")==0)){for(i=0;i<*nk;i++)v[1+i*mt]/=180.;}
1703 
1704  }
1705 
1706  /* storing the total pressure in the network nodes */
1707 
1708  if((strcmp1(&filab[1305],"PT ")==0)&&(*ithermal>1)){
1709 
1710  iselect=-1;
1711  frdset(&filab[1305],set,&iset,istartset,iendset,ialset,
1712  inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1713  ngraph);
1714 
1715  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1716  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1717 
1718  fprintf(f1," -4 TOPRES 1 1\n");
1719  fprintf(f1," -5 PT 1 1 0 0\n");
1720 
1721  icomp[0]=2;
1722  frdselect(v,v,&iset,&nkcoords,inum,m1,istartset,iendset,
1723  ialset,ngraph,&ncompscalar,ifieldscalar,icomp,
1724  nfieldvector0,&iselect,m2,f1,output,m3);
1725 
1726  }
1727 
1728  /* storing the static pressure in the liquid network nodes */
1729 
1730  if((strcmp1(&filab[1827],"PS ")==0)&&(*ithermal>1)){
1731 
1732  iselect=-1;
1733  frdset(&filab[1827],set,&iset,istartset,iendset,ialset,
1734  inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1735  ngraph);
1736 
1737  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1738  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1739 
1740  fprintf(f1," -4 STPRES 1 1\n");
1741  fprintf(f1," -5 PS 1 1 0 0\n");
1742 
1743  icomp[0]=2;
1744  frdselect(v,v,&iset,&nkcoords,inum,m1,istartset,iendset,
1745  ialset,ngraph,&ncompscalar,ifieldscalar,icomp,
1746  nfieldvector0,&iselect,m2,f1,output,m3);
1747 
1748  }
1749 
1750  /* storing the liquid depth in the channel nodes */
1751 
1752  if((strcmp1(&filab[2349],"PS ")==0)&&(*ithermal>1)){
1753 
1754  iselect=-1;
1755  frdset(&filab[2349],set,&iset,istartset,iendset,ialset,
1756  inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1757  ngraph);
1758 
1759  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1760  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1761 
1762  fprintf(f1," -4 DEPTH 1 1\n");
1763  fprintf(f1," -5 DEPTH 1 1 0 0\n");
1764 
1765  icomp[0]=2;
1766  frdselect(v,v,&iset,&nkcoords,inum,m1,istartset,iendset,
1767  ialset,ngraph,&ncompscalar,ifieldscalar,icomp,
1768  nfieldvector0,&iselect,m2,f1,output,m3);
1769 
1770  }
1771 
1772  /* storing the critical depth in the channel nodes */
1773 
1774  if((strcmp1(&filab[2436],"HCRI")==0)&&(*ithermal>1)){
1775 
1776  iselect=-1;
1777  frdset(&filab[2436],set,&iset,istartset,iendset,ialset,
1778  inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1779  ngraph);
1780 
1781  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1782  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1783 
1784  fprintf(f1," -4 HCRIT 1 1\n");
1785  fprintf(f1," -5 HCRIT 1 1 0 0\n");
1786 
1787  icomp[0]=3;
1788  frdselect(v,v,&iset,&nkcoords,inum,m1,istartset,iendset,
1789  ialset,ngraph,&ncompscalar,ifieldscalar,icomp,
1790  nfieldvector0,&iselect,m2,f1,output,m3);
1791 
1792  }
1793 
1794  /* storing the static temperature in the network nodes */
1795 
1796  if((strcmp1(&filab[1392],"TS ")==0)&&(*ithermal>1)){
1797 
1798  iselect=-1;
1799  frdset(&filab[1392],set,&iset,istartset,iendset,ialset,
1800  inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1801  ngraph);
1802 
1803  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1804  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1805 
1806  fprintf(f1," -4 STTEMP 1 1\n");
1807  fprintf(f1," -5 TS 1 1 0 0\n");
1808 
1809  icomp[0]=3;
1810  frdselect(v,v,&iset,&nkcoords,inum,m1,istartset,iendset,
1811  ialset,ngraph,&ncompscalar,ifieldscalar,icomp,
1812  nfieldvector0,&iselect,m2,f1,output,m3);
1813 
1814  }
1815 
1816  /* the remaining lines only apply to frequency calculations
1817  with cyclic symmetry, complex frequency and steady state calculations */
1818 
1819  if((*nmethod!=2)&&(*nmethod!=5)&&(*nmethod!=6)&&(*nmethod!=7)){fclose(f1);return;}
1820  if((*nmethod==5)&&(*mode==-1)){fclose(f1);return;}
1821 
1822  /* storing the displacements in the nodes (magnitude, phase) */
1823 
1824  if((strcmp1(&filab[870],"PU ")==0)&&(*ithermal!=2)){
1825  iselect=1;
1826 
1827  frdset(&filab[870],set,&iset,istartset,iendset,ialset,
1828  inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1829  ngraph);
1830 
1831  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1832  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1833 
1834  fprintf(f1," -4 PDISP 6 1\n");
1835  fprintf(f1," -5 MAG1 1 12 1 0\n");
1836  fprintf(f1," -5 MAG2 1 12 2 0\n");
1837  fprintf(f1," -5 MAG3 1 12 3 0\n");
1838  fprintf(f1," -5 PHA1 1 12 4 0\n");
1839  fprintf(f1," -5 PHA2 1 12 5 0\n");
1840  fprintf(f1," -5 PHA3 1 12 6 0\n");
1841 
1842  frdselect(vr,vi,&iset,&nkcoords,inum,m1,istartset,iendset,
1843  ialset,ngraph,&ncompvectph,ifieldvectph,icompvectph,
1844  nfieldvectph,&iselect,m2,f1,output,m3);
1845 
1846  }
1847 
1848  /* storing the temperatures in the nodes (magnitude, phase) */
1849 
1850  if((strcmp1(&filab[957],"PNT ")==0)&&(*ithermal>1)){
1851  iselect=1;
1852 
1853  frdset(&filab[957],set,&iset,istartset,iendset,ialset,
1854  inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1855  ngraph);
1856 
1857  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1858  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1859 
1860  fprintf(f1," -4 PNDTEMP 2 1\n");
1861  fprintf(f1," -5 MAG1 1 1 1 0\n");
1862  fprintf(f1," -5 PHA1 1 1 2 0\n");
1863 
1864  frdselect(vr,vi,&iset,&nkcoords,inum,m1,istartset,iendset,
1865  ialset,ngraph,&ncompscalph,ifieldscalph,icompscalph,
1866  nfieldscalph,&iselect,m2,f1,output,m3);
1867 
1868  }
1869 
1870  /* storing the stresses in the nodes (magnitude, phase) */
1871 
1872  if((strcmp1(&filab[1479],"PHS ")==0)&&(*ithermal!=2)){
1873  iselect=1;
1874 
1875  frdset(&filab[1479],set,&iset,istartset,iendset,ialset,
1876  inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1877  ngraph);
1878 
1879  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1880  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1881 
1882  fprintf(f1," -4 PSTRESS 12 1\n");
1883  fprintf(f1," -5 MAGXX 1 14 1 1\n");
1884  fprintf(f1," -5 MAGYY 1 14 2 2\n");
1885  fprintf(f1," -5 MAGZZ 1 14 3 3\n");
1886  fprintf(f1," -5 MAGXY 1 14 1 2\n");
1887  fprintf(f1," -5 MAGYZ 1 14 2 3\n");
1888  fprintf(f1," -5 MAGZX 1 14 3 1\n");
1889  fprintf(f1," -5 PHAXX 1 14 1 1\n");
1890  fprintf(f1," -5 PHAYY 1 14 2 2\n");
1891  fprintf(f1," -5 PHAZZ 1 14 3 3\n");
1892  fprintf(f1," -5 PHAXY 1 14 1 2\n");
1893  fprintf(f1," -5 PHAYZ 1 14 2 3\n");
1894  fprintf(f1," -5 PHAZX 1 14 3 1\n");
1895 
1896  frdselect(stnr,stni,&iset,&nkcoords,inum,m1,istartset,iendset,
1897  ialset,ngraph,&ncomptensph,ifieldtensph,icomptensph,
1898  nfieldtensph,&iselect,m2,f1,output,m3);
1899 
1900  }
1901 
1902  /* storing the differential contact displacements and
1903  the contact stresses in the nodes (magnitude, phase)
1904  only for face-to-face penalty contact */
1905 
1906  if((strcmp1(&filab[3915],"PCON")==0)&&(*ithermal!=2)&&(*mortar==1)){
1907  iselect=1;
1908 
1909  frdset(&filab[3915],set,&iset,istartset,iendset,ialset,
1910  inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1911  ngraph);
1912 
1913  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1914  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1915 
1916  fprintf(f1," -4 PCONTAC 12 1\n");
1917  fprintf(f1," -5 MAGO 1 14 1 1\n");
1918  fprintf(f1," -5 MAGSL1 1 14 2 2\n");
1919  fprintf(f1," -5 MAGSL2 1 14 3 3\n");
1920  fprintf(f1," -5 MAGP 1 14 1 2\n");
1921  fprintf(f1," -5 MAGSH1 1 14 2 3\n");
1922  fprintf(f1," -5 MAGSH2 1 14 3 1\n");
1923  fprintf(f1," -5 PHAO 1 14 1 1\n");
1924  fprintf(f1," -5 PHASL1 1 14 2 2\n");
1925  fprintf(f1," -5 PHASL2 1 14 3 3\n");
1926  fprintf(f1," -5 PHAP 1 14 1 2\n");
1927  fprintf(f1," -5 PHASH1 1 14 2 3\n");
1928  fprintf(f1," -5 PHASH2 1 14 3 1\n");
1929 
1930  frdselect(cdnr,cdni,&iset,&nkcoords,inum,m1,istartset,iendset,
1931  ialset,ngraph,&ncomptensph,ifieldtensph,icomptensph,
1932  nfieldtensph,&iselect,m2,f1,output,m3);
1933 
1934  }
1935 
1936  /* storing the forces in the nodes (magnitude, phase) */
1937 
1938  if((strcmp1(&filab[2610],"PRF ")==0)&&(*ithermal!=2)){
1939  iselect=1;
1940 
1941  frdset(&filab[2610],set,&iset,istartset,iendset,ialset,
1942  inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1943  ngraph);
1944 
1945  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1946  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1947 
1948  fprintf(f1," -4 PFORC 6 1\n");
1949  fprintf(f1," -5 MAG1 1 12 1 0\n");
1950  fprintf(f1," -5 MAG2 1 12 2 0\n");
1951  fprintf(f1," -5 MAG3 1 12 3 0\n");
1952  fprintf(f1," -5 PHA1 1 12 4 0\n");
1953  fprintf(f1," -5 PHA2 1 12 5 0\n");
1954  fprintf(f1," -5 PHA3 1 12 6 0\n");
1955 
1956  frdselect(fnr,fni,&iset,&nkcoords,inum,m1,istartset,iendset,
1957  ialset,ngraph,&ncompvectph,ifieldvectph,icompvectph,
1958  nfieldvectph,&iselect,m2,f1,output,m3);
1959 
1960  }
1961 
1962  /* the remaining parts are for frequency calculations with cyclic symmetry only */
1963 
1964  if(*nmethod!=2){fclose(f1);return;}
1965 
1966  /* storing the maximum displacements of the nodes in the base sector
1967  (components, magnitude) */
1968 
1969  if((strcmp1(&filab[1566],"MAXU")==0)&&(*ithermal!=2)){
1970  iselect=1;
1971 
1972  frdset(&filab[1566],set,&iset,istartset,iendset,ialset,
1973  inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1974  ngraph);
1975 
1976  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1977  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1978 
1979  fprintf(f1," -4 MDISP 4 1\n");
1980  fprintf(f1," -5 DX 1 4 1 0\n");
1981  fprintf(f1," -5 DY 1 4 2 0\n");
1982  fprintf(f1," -5 DZ 1 4 3 0\n");
1983  fprintf(f1," -5 ANG 1 4 4 0\n");
1984 
1985  ncomp=4;
1986  ifield[0]=1;icomp[0]=1;
1987  ifield[1]=1;icomp[1]=2;
1988  ifield[2]=1;icomp[2]=3;
1989  ifield[3]=1;icomp[3]=0;
1990  nfield[0]=4;nfield[1]=4;
1991 
1992  frdselect(vmax,vmax,&iset,&nkcoords,inum,m1,istartset,iendset,
1993  ialset,ngraph,&ncomp,ifield,icomp,
1994  nfield,&iselect,m2,f1,output,m3);
1995 
1996  }
1997 
1998  /* storing the worst principal stress at the nodes
1999  in the basis sector (components, magnitude)
2000 
2001  the worst principal stress is the maximum of the
2002  absolute value of all principal stresses, times
2003  its original sign */
2004 
2005  if((strcmp1(&filab[1653],"MAXS")==0)&&(*ithermal!=2)){
2006  iselect=1;
2007 
2008  frdset(&filab[1653],set,&iset,istartset,iendset,ialset,
2009  inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
2010  ngraph);
2011 
2012  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
2013  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
2014 
2015  fprintf(f1," -4 MSTRESS 7 1\n");
2016  fprintf(f1," -5 SXX 1 4 1 1\n");
2017  fprintf(f1," -5 SYY 1 4 2 2\n");
2018  fprintf(f1," -5 SZZ 1 4 3 3\n");
2019  fprintf(f1," -5 SXY 1 4 1 2\n");
2020  fprintf(f1," -5 SYZ 1 4 2 3\n");
2021  fprintf(f1," -5 SZX 1 4 3 1\n");
2022  fprintf(f1," -5 MAG 1 4 0 0\n");
2023 
2024  ncomp=7;
2025  ifield[0]=1;icomp[0]=1;
2026  ifield[1]=1;icomp[1]=2;
2027  ifield[2]=1;icomp[2]=3;
2028  ifield[3]=1;icomp[3]=4;
2029  ifield[4]=1;icomp[4]=6;
2030  ifield[5]=1;icomp[5]=5;
2031  ifield[6]=1;icomp[6]=0;
2032  nfield[0]=7;nfield[1]=7;
2033 
2034  frdselect(stnmax,stnmax,&iset,&nkcoords,inum,m1,istartset,iendset,
2035  ialset,ngraph,&ncomp,ifield,icomp,
2036  nfield,&iselect,m2,f1,output,m3);
2037 
2038  }
2039 
2040  /* storing the worst principal strain at the nodes
2041  in the basis sector (components, magnitude)
2042 
2043  the worst principal strain is the maximum of the
2044  absolute value of all principal strains, times
2045  its original sign */
2046 
2047  if((strcmp1(&filab[2523],"MAXE")==0)&&(*ithermal!=2)){
2048  iselect=1;
2049 
2050  frdset(&filab[2523],set,&iset,istartset,iendset,ialset,
2051  inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
2052  ngraph);
2053 
2054  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
2055  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
2056 
2057  fprintf(f1," -4 MSTRAIN 7 1\n");
2058  fprintf(f1," -5 EXX 1 4 1 1\n");
2059  fprintf(f1," -5 EYY 1 4 2 2\n");
2060  fprintf(f1," -5 EZZ 1 4 3 3\n");
2061  fprintf(f1," -5 EXY 1 4 1 2\n");
2062  fprintf(f1," -5 EYZ 1 4 2 3\n");
2063  fprintf(f1," -5 EZX 1 4 3 1\n");
2064  fprintf(f1," -5 MAG 1 4 0 0\n");
2065 
2066  ncomp=7;
2067  ifield[0]=1;icomp[0]=1;
2068  ifield[1]=1;icomp[1]=2;
2069  ifield[2]=1;icomp[2]=3;
2070  ifield[3]=1;icomp[3]=4;
2071  ifield[4]=1;icomp[4]=6;
2072  ifield[5]=1;icomp[5]=5;
2073  ifield[6]=1;icomp[6]=0;
2074  nfield[0]=7;nfield[1]=7;
2075 
2076  frdselect(eenmax,eenmax,&iset,&nkcoords,inum,m1,istartset,iendset,
2077  ialset,ngraph,&ncomp,ifield,icomp,
2078  nfield,&iselect,m2,f1,output,m3);
2079 
2080  }
2081 
2082  fclose(f1);
2083  return;
2084 
2085 }
#define ITGFORMAT
Definition: CalculiX.h:52
ITG strcmp2(const char *s1, const char *s2, ITG length)
Definition: strcmp2.c:24
ITG strcpy1(char *s1, const char *s2, ITG length)
Definition: strcpy1.c:24
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
void frdselect(double *field1, double *field2, ITG *iset, ITG *nkcoords, ITG *inum, char *m1, ITG *istartset, ITG *iendset, ITG *ialset, ITG *ngraph, ITG *ncomp, ITG *ifield, ITG *icomp, ITG *nfield, ITG *iselect, char *m2, FILE *f1, char *output, char *m3)
Definition: frdselect.c:27
ITG strcmp1(const char *s1, const char *s2)
Definition: strcmp1.c:24
void frdgeneralvector(double *v, ITG *iset, ITG *ntrans, char *filabl, ITG *nkcoords, ITG *inum, char *m1, ITG *inotr, double *trab, double *co, ITG *istartset, ITG *iendset, ITG *ialset, ITG *mi, ITG *ngraph, FILE *f1, char *output, char *m3)
Definition: frdgeneralvector.c:24
void exo(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne0, double *v, double *stn, ITG *inum, ITG *nmethod, ITG *kode, char *filab, double *een, double *t1, double *fn, double *time, double *epn, ITG *ielmat, char *matname, double *enern, double *xstaten, ITG *nstate_, ITG *istep, ITG *iinc, ITG *ithermal, double *qfn, ITG *mode, ITG *noddiam, double *trab, ITG *inotr, ITG *ntrans, double *orab, ITG *ielorien, ITG *norien, char *description, ITG *ipneigh, ITG *neigh, ITG *mi, double *stx, double *vr, double *vi, double *stnr, double *stni, double *vmax, double *stnmax, ITG *ngraph, double *veold, double *ener, ITG *ne, double *cs, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, double *eenmax, double *fnr, double *fni, double *emn, double *thicke, char *jobnamec, char *output, double *qfx, double *cdn, ITG *mortar, double *cdnr, double *cdni, ITG *nmat)
Definition: exo.c:31
subroutine dattime(date, clock)
Definition: dattime.f:20
static double * f1
Definition: objectivemain_se.c:47
subroutine nodes(inpc, textpart, co, nk, nk_, set, istartset, iendset, ialset, nset, nset_, nalset, nalset_, istep, istat, n, iline, ipol, inl, ipoinp, inp, ipoinpc)
Definition: nodes.f:22
subroutine zienzhu(co, nk, kon, ipkon, lakon, ne, stn, ipneigh, neigh, sti, mi)
Definition: zienzhu.f:21
void frdheader(ITG *icounter, double *oner, double *time, double *pi, ITG *noddiam, double *cs, ITG *null, ITG *mode, ITG *noutloc, char *description, ITG *kode, ITG *nmethod, FILE *f1, char *output, ITG *istep, ITG *iinc)
Definition: frdheader.c:24
void frdset(char *filabl, char *set, ITG *iset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *inum, ITG *noutloc, ITG *nout, ITG *nset, ITG *noutmin, ITG *noutplus, ITG *iselect, ITG *ngraph)
Definition: frdset.c:24
void frdvector(double *v, ITG *iset, ITG *ntrans, char *filabl, ITG *nkcoords, ITG *inum, char *m1, ITG *inotr, double *trab, double *co, ITG *istartset, ITG *iendset, ITG *ialset, ITG *mi, ITG *ngraph, FILE *f1, char *output, char *m3)
Definition: frdvector.c:24
#define ITG
Definition: CalculiX.h:51
subroutine errorestimator(yi, yn, ipkon, kon, lakon, nk, ne, mi, ielmat, nterms, inum, co, vold, cflag)
Definition: errorestimator.f:21

◆ frd_norm_se()

void frd_norm_se ( double *  co,
ITG nk,
double *  stn,
ITG inum,
ITG nmethod,
ITG kode,
char *  filab,
double *  fn,
double *  time,
ITG nstate_,
ITG istep,
ITG iinc,
ITG mode,
ITG noddiam,
char *  description,
ITG mi,
ITG ngraph,
ITG ne,
double *  cs,
char *  set,
ITG nset,
ITG istartset,
ITG iendset,
ITG ialset,
double *  thicke,
char *  jobnamec,
char *  output,
double *  dgdxtotglob,
ITG numobject,
char *  objectset,
double *  extnor,
ITG ntrans,
double *  trab,
ITG inotr 
)

◆ frd_orien_se()

void frd_orien_se ( double *  co,
ITG nk,
double *  stn,
ITG inum,
ITG nmethod,
ITG kode,
char *  filab,
double *  fn,
double *  time,
ITG nstate_,
ITG istep,
ITG iinc,
ITG mode,
ITG noddiam,
char *  description,
ITG mi,
ITG ngraph,
ITG ne,
double *  cs,
char *  set,
ITG nset,
ITG istartset,
ITG iendset,
ITG ialset,
double *  thicke,
char *  jobnamec,
char *  output,
double *  dgdxtotglob,
ITG numobject,
char *  objectset,
ITG ntrans,
ITG inotr,
double *  trab,
ITG idesvar,
char *  orname 
)

◆ frd_sen()

void frd_sen ( double *  co,
ITG nk,
double *  dstn,
ITG inum,
ITG nmethod,
ITG kode,
char *  filab,
double *  time,
ITG nstate_,
ITG istep,
ITG iinc,
ITG mode,
ITG noddiam,
char *  description,
ITG mi,
ITG ngraph,
ITG ne,
double *  cs,
char *  set,
ITG nset,
ITG istartset,
ITG iendset,
ITG ialset,
char *  jobnamec,
char *  output,
double *  v,
ITG iobject,
char *  objectset,
ITG ntrans,
ITG inotr,
double *  trab,
ITG idesvar,
char *  orname,
ITG icoordinate,
ITG inorm,
ITG irand 
)
35  {
36 
37  /* stores the results in frd format
38 
39  iselect selects which nodes are to be stored:
40  iselect=-1 means only those nodes for which inum negative
41  ist, i.e. network nodes
42  iselect=+1 means only those nodes for which inum positive
43  ist, i.e. structural nodes
44  iselect=0 means both of the above */
45 
46  FILE *f1;
47 
48  char m1[4]=" -1",m2[4]=" -2",m3[4]=" -3",fneig[132]="",text[132];
49 
50  static ITG icounter=0,nkcoords;
51 
52  ITG null,one,i,noutloc,iset,iselect,two,three,nout,noutplus,noutmin;
53 
54  ITG ncomptensoro=6,ifieldtensoro[6]={1,1,1,1,1,1},
55  icomptensoro[6]={0,1,2,3,5,4},nfieldtensoro[2]={6,0},
56  ncomptensord=2,ifieldtensord[4]={1,1},icomptensord[2]={0,1},
57  nfieldtensord[2]={2,0};
58  ITG ncompvector=3,ifieldvector[3]={1,1,1},icompvector[3]={0,1,2},
59  nfieldvector1[2]={3,0};
60 
61  double pi,oner;
62 
63  strcpy(fneig,jobnamec);
64  strcat(fneig,".frd");
65 
66  if((f1=fopen(fneig,"ab"))==NULL){
67  printf("*ERROR in frd: cannot open frd file for writing...");
68  exit(0);
69  }
70 
71  pi=4.*atan(1.);
72  null=0;
73  one=1;two=2;three=3;
74  oner=1.;
75 
76  /* determining nout, noutplus and noutmin
77  nout: number of structural and network nodes
78  noutplus: number of structural nodes
79  noutmin: number of network nodes */
80 
81  if(*nmethod!=0){
82  nout=0;
83  noutplus=0;
84  noutmin=0;
85  for(i=0;i<*nk;i++){
86  if(inum[i]==0) continue;
87  nout++;
88  if(inum[i]>0) noutplus++;
89  if(inum[i]<0) noutmin++;
90  }
91  }else{
92  nout=*nk;
93  }
94 
95  nkcoords=*nk;
96  iselect=1;
97 
98  if(*inorm==1){
99 
100  /* storing the normals to the structure */
101 
102  frdset(&filab[4002],set,&iset,istartset,iendset,ialset,
103  inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
104  ngraph);
105 
106  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
107  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
108 
109  fprintf(f1," -4 NORM 4 1\n");
110  fprintf(f1," -5 NORMX 1 2 1 0\n");
111  fprintf(f1," -5 NORMY 1 2 2 0\n");
112  fprintf(f1," -5 NORMZ 1 2 3 0\n");
113  fprintf(f1," -5 ALL 1 2 0 0 1ALL\n");
114 
115  frdselect(v,v,&iset,&nkcoords,inum,m1,istartset,iendset,
116  ialset,ngraph,&ncompvector,ifieldvector,icompvector,
117  nfieldvector1,&iselect,m2,f1,output,m3);
118 
119  }else if(*irand==1){
120 
121  /* storing the random vectors in the structure */
122 
123  /* storing the normals to the structure */
124 
125  frdset(&filab[4002],set,&iset,istartset,iendset,ialset,
126  inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
127  ngraph);
128 
129  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
130  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
131 
132  fprintf(f1," -4 RAND 4 1\n");
133  fprintf(f1," -5 RANDX 1 2 1 0\n");
134  fprintf(f1," -5 RANDY 1 2 2 0\n");
135  fprintf(f1," -5 RANDZ 1 2 3 0\n");
136  fprintf(f1," -5 ALL 1 2 0 0 1ALL\n");
137 
138  frdselect(v,v,&iset,&nkcoords,inum,m1,istartset,iendset,
139  ialset,ngraph,&ncompvector,ifieldvector,icompvector,
140  nfieldvector1,&iselect,m2,f1,output,m3);
141 
142  }else if(*icoordinate!=1){
143 
144  /* storing the orientation sensitivities in the nodes */
145 
146  if((strcmp1(&objectset[(*iobject-1)*324],"DISPLACEMENT")==0)||
147  (strcmp1(&objectset[(*iobject-1)*324],"EIGENFREQUENCY")==0)||
148  (strcmp1(&objectset[(*iobject-1)*324],"GREEN")==0)){
149 
150  frdset(&filab[4002],set,&iset,istartset,iendset,ialset,
151  inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
152  ngraph);
153 
154  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
155  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
156 
157  strcpy1(&text[0]," -4 4 1",23);
158  strcpy1(&text[5],"D",1);
159  strcpy1(&text[6],&orname[80*(*idesvar/3)],5);
160  if(*idesvar-(*idesvar/3)*3==0){
161  strcpy1(&text[11],"Rx",2);
162  text[23]='\0';
163  fprintf(f1,"%s\n",text);
164  fprintf(f1," -5 dD1dRx 1 2 1 0\n");
165  fprintf(f1," -5 dD2dRx 1 2 1 0\n");
166  fprintf(f1," -5 dD3dRx 1 2 1 0\n");
167  }else if(*idesvar-(*idesvar/3)*3==1){
168  strcpy1(&text[11],"Ry",2);
169  text[23]='\0';
170  fprintf(f1,"%s\n",text);
171  fprintf(f1," -5 dD1dRy 1 2 1 0\n");
172  fprintf(f1," -5 dD2dRy 1 2 1 0\n");
173  fprintf(f1," -5 dD3dRy 1 2 1 0\n");
174  }else{
175  strcpy1(&text[11],"Rz",2);
176  text[23]='\0';
177  fprintf(f1,"%s\n",text);
178  fprintf(f1," -5 dD1dRz 1 2 1 0\n");
179  fprintf(f1," -5 dD2dRz 1 2 1 0\n");
180  fprintf(f1," -5 dD3dRz 1 2 1 0\n");
181  }
182  fprintf(f1," -5 ALL 1 2 0 0 1ALL\n");
183 
184  frdvector(v,&iset,ntrans,&filab[4002],&nkcoords,inum,m1,inotr,
185  trab,co,istartset,iendset,ialset,mi,ngraph,f1,output,m3);
186 
187  }else if(strcmp1(&objectset[(*iobject-1)*324],"STRESS")==0){
188 
189  frdset(&filab[4002],set,&iset,istartset,iendset,ialset,
190  inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
191  ngraph);
192 
193  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
194  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
195 
196  strcpy1(&text[0]," -4 6 1",23);
197  strcpy1(&text[5],"S",1);
198  strcpy1(&text[6],&orname[80*(*idesvar/3)],5);
199  if(*idesvar-(*idesvar/3)*3==0){
200  strcpy1(&text[11],"Rx",2);
201  text[23]='\0';
202  fprintf(f1,"%s\n",text);
203  fprintf(f1," -5 dSXXdRx 1 4 1 1\n");
204  fprintf(f1," -5 dSYYdRx 1 4 2 2\n");
205  fprintf(f1," -5 dSZZdRx 1 4 3 3\n");
206  fprintf(f1," -5 dSXYdRx 1 4 1 2\n");
207  fprintf(f1," -5 dSYZdRx 1 4 2 3\n");
208  fprintf(f1," -5 dSZXdRx 1 4 3 1\n");
209  }else if(*idesvar-(*idesvar/3)*3==1){
210  strcpy1(&text[11],"Ry",2);
211  text[23]='\0';
212  fprintf(f1,"%s\n",text);
213  fprintf(f1," -5 dSXXdRy 1 4 1 1\n");
214  fprintf(f1," -5 dSYYdRy 1 4 2 2\n");
215  fprintf(f1," -5 dSZZdRy 1 4 3 3\n");
216  fprintf(f1," -5 dSXYdRy 1 4 1 2\n");
217  fprintf(f1," -5 dSYZdRy 1 4 2 3\n");
218  fprintf(f1," -5 dSZXdRy 1 4 3 1\n");
219  }else{
220  strcpy1(&text[11],"Rz",2);
221  text[23]='\0';
222  fprintf(f1,"%s\n",text);
223  fprintf(f1," -5 dSXXdRz 1 4 1 1\n");
224  fprintf(f1," -5 dSYYdRz 1 4 2 2\n");
225  fprintf(f1," -5 dSZZdRz 1 4 3 3\n");
226  fprintf(f1," -5 dSXYdRz 1 4 1 2\n");
227  fprintf(f1," -5 dSYZdRz 1 4 2 3\n");
228  fprintf(f1," -5 dSZXdRz 1 4 3 1\n");
229  }
230 
231  frdselect(dstn,dstn,&iset,&nkcoords,inum,m1,istartset,iendset,
232  ialset,ngraph,&ncomptensoro,ifieldtensoro,icomptensoro,
233  nfieldtensoro,&iselect,m2,f1,output,m3);
234 
235  }
236 
237  }else{
238 
239  /* storing the coordinate sensitivities in the nodes */
240 
241  frdset(&filab[4002],set,&iset,istartset,iendset,ialset,
242  inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
243  ngraph);
244 
245  frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
246  &noutloc,description,kode,nmethod,f1,output,istep,iinc);
247 
248  if(strcmp1(&objectset[*iobject*324],"SHAPEENERGY")==0){
249  fprintf(f1," -4 SENENER 2 1\n");
250  }else if(strcmp1(&objectset[*iobject*324],"MASS")==0){
251  fprintf(f1," -4 SENMASS 2 1\n");
252  }else if(strcmp1(&objectset[*iobject*324],"DISPLACEMENT")==0){
253  fprintf(f1," -4 SENDISP 2 1\n");
254  }else if(strcmp1(&objectset[*iobject*324],"STRESS")==0){
255  fprintf(f1," -4 SENSTRE 2 1\n");
256  }else if(strcmp1(&objectset[*iobject*324],"EIGENFREQUENCY")==0){
257  fprintf(f1," -4 SENFREQ 2 1\n");
258  }else if(strcmp1(&objectset[*iobject*324],"THICKNESS")==0){
259  fprintf(f1," -4 SENTHCK 2 1\n");
260  }else if(strcmp1(&objectset[*iobject*324],"PROJECTGRAD")==0){
261  fprintf(f1," -4 PRJGRAD 2 1\n");
262  }
263 
264  fprintf(f1," -5 DFDN 1 1 1 0\n");
265  fprintf(f1," -5 DFDNFIL 1 1 2 0\n");
266 
267  frdselect(&v[2**nk**iobject],v,&iset,&nkcoords,inum,m1,istartset,
268  iendset,ialset,ngraph,&ncomptensord,ifieldtensord,icomptensord,
269  nfieldtensord,&iselect,m2,f1,output,m3);
270 
271  }
272 
273  fclose(f1);
274  return;
275 
276 }
ITG strcpy1(char *s1, const char *s2, ITG length)
Definition: strcpy1.c:24
void frdselect(double *field1, double *field2, ITG *iset, ITG *nkcoords, ITG *inum, char *m1, ITG *istartset, ITG *iendset, ITG *ialset, ITG *ngraph, ITG *ncomp, ITG *ifield, ITG *icomp, ITG *nfield, ITG *iselect, char *m2, FILE *f1, char *output, char *m3)
Definition: frdselect.c:27
ITG strcmp1(const char *s1, const char *s2)
Definition: strcmp1.c:24
static double * f1
Definition: objectivemain_se.c:47
void frdheader(ITG *icounter, double *oner, double *time, double *pi, ITG *noddiam, double *cs, ITG *null, ITG *mode, ITG *noutloc, char *description, ITG *kode, ITG *nmethod, FILE *f1, char *output, ITG *istep, ITG *iinc)
Definition: frdheader.c:24
void frdset(char *filabl, char *set, ITG *iset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *inum, ITG *noutloc, ITG *nout, ITG *nset, ITG *noutmin, ITG *noutplus, ITG *iselect, ITG *ngraph)
Definition: frdset.c:24
void frdvector(double *v, ITG *iset, ITG *ntrans, char *filabl, ITG *nkcoords, ITG *inum, char *m1, ITG *inotr, double *trab, double *co, ITG *istartset, ITG *iendset, ITG *ialset, ITG *mi, ITG *ngraph, FILE *f1, char *output, char *m3)
Definition: frdvector.c:24
#define ITG
Definition: CalculiX.h:51

◆ frd_sen_se()

void frd_sen_se ( double *  co,
ITG nk,
double *  stn,
ITG inum,
ITG nmethod,
ITG kode,
char *  filab,
double *  fn,
double *  time,
ITG nstate_,
ITG istep,
ITG iinc,
ITG mode,
ITG noddiam,
char *  description,
ITG mi,
ITG ngraph,
ITG ne,
double *  cs,
char *  set,
ITG nset,
ITG istartset,
ITG iendset,
ITG ialset,
double *  thicke,
char *  jobnamec,
char *  output,
double *  dgdxglob,
ITG iobject,
char *  objectset 
)

◆ frdcyc()

void frdcyc ( double *  co,
ITG nk,
ITG kon,
ITG ipkon,
char *  lakon,
ITG ne,
double *  v,
double *  stn,
ITG inum,
ITG nmethod,
ITG kode,
char *  filab,
double *  een,
double *  t1,
double *  fn,
double *  time,
double *  epn,
ITG ielmat,
char *  matname,
double *  cs,
ITG mcs,
ITG nkon,
double *  enern,
double *  xstaten,
ITG nstate_,
ITG istep,
ITG iinc,
ITG iperturb,
double *  ener,
ITG mi,
char *  output,
ITG ithermal,
double *  qfn,
ITG ialset,
ITG istartset,
ITG iendset,
double *  trab,
ITG inotr,
ITG ntrans,
double *  orab,
ITG ielorien,
ITG norien,
double *  sti,
double *  veold,
ITG noddiam,
char *  set,
ITG nset,
double *  emn,
double *  thicke,
char *  jobnamec,
ITG ne0,
double *  cdn,
ITG mortar,
ITG nmat,
double *  qfx 
)
35  {
36 
37  /* duplicates fields for static cyclic symmetric calculations */
38 
39  char *lakont=NULL,description[13]=" ";
40 
41  ITG nkt,icntrl,*kont=NULL,*ipkont=NULL,*inumt=NULL,*ielmatt=NULL,net,i,l,
42  imag=0,mode=-1,ngraph,*inocs=NULL,*ielcs=NULL,l1,l2,is,
43  jj,node,i1,i2,nope,iel,indexe,j,ielset,*inotrt=NULL,mt=mi[1]+1,
44  *ipneigh=NULL,*neigh=NULL,net0;
45 
46  double *vt=NULL,*fnt=NULL,*stnt=NULL,*eent=NULL,*cot=NULL,*t1t=NULL,
47  *epnt=NULL,*enernt=NULL,*xstatent=NULL,theta,pi,t[3],*qfnt=NULL,
48  *vr=NULL,*vi=NULL,*stnr=NULL,*stni=NULL,*vmax=NULL,*stnmax=NULL,
49  *stit=NULL,*eenmax=NULL,*fnr=NULL,*fni=NULL,*emnt=NULL,
50  *cdnr=NULL,*cdni=NULL;
51 
52  pi=4.*atan(1.);
53 
54  /* determining the maximum number of sectors to be plotted */
55 
56  ngraph=1;
57  for(j=0;j<*mcs;j++){
58  if(cs[17*j+4]>ngraph) ngraph=cs[17*j+4];
59  }
60 
61  /* assigning nodes and elements to sectors */
62 
63  NNEW(inocs,ITG,*nk);
64  NNEW(ielcs,ITG,*ne);
65  ielset=cs[12];
66  if((*mcs!=1)||(ielset!=0)){
67  for(i=0;i<*nk;i++) inocs[i]=-1;
68  for(i=0;i<*ne;i++) ielcs[i]=-1;
69  }
70 
71  for(i=0;i<*mcs;i++){
72  is=cs[17*i+4];
73  if(is==1) continue;
74  ielset=cs[17*i+12];
75  if(ielset==0) continue;
76  for(i1=istartset[ielset-1]-1;i1<iendset[ielset-1];i1++){
77  if(ialset[i1]>0){
78  iel=ialset[i1]-1;
79  if(ipkon[iel]<0) continue;
80  ielcs[iel]=i;
81  indexe=ipkon[iel];
82  if(strcmp1(&lakon[8*iel+3],"2")==0)nope=20;
83  else if (strcmp1(&lakon[8*iel+3],"8")==0)nope=8;
84  else if (strcmp1(&lakon[8*iel+3],"10")==0)nope=10;
85  else if (strcmp1(&lakon[8*iel+3],"4")==0)nope=4;
86  else if (strcmp1(&lakon[8*iel+3],"15")==0)nope=15;
87  else {nope=6;}
88  for(i2=0;i2<nope;++i2){
89  node=kon[indexe+i2]-1;
90  inocs[node]=i;
91  }
92  }
93  else{
94  iel=ialset[i1-2]-1;
95  do{
96  iel=iel-ialset[i1];
97  if(iel>=ialset[i1-1]-1) break;
98  if(ipkon[iel]<0) continue;
99  ielcs[iel]=i;
100  indexe=ipkon[iel];
101  if(strcmp1(&lakon[8*iel+3],"2")==0)nope=20;
102  else if (strcmp1(&lakon[8*iel+3],"8")==0)nope=8;
103  else if (strcmp1(&lakon[8*iel+3],"10")==0)nope=10;
104  else if (strcmp1(&lakon[8*iel+3],"4")==0)nope=4;
105  else if (strcmp1(&lakon[8*iel+3],"15")==0)nope=15;
106  else {nope=6;}
107  for(i2=0;i2<nope;++i2){
108  node=kon[indexe+i2]-1;
109  inocs[node]=i;
110  }
111  }while(1);
112  }
113  }
114  }
115 
116  NNEW(cot,double,3**nk*ngraph);
117  if(*ntrans>0)NNEW(inotrt,ITG,2**nk*ngraph);
118 
119  if((strcmp1(&filab[0],"U ")==0)||
120  (strcmp1(&filab[1131],"TT ")==0)||
121  (strcmp1(&filab[1218],"MF ")==0)||
122  (strcmp1(&filab[1305],"PT ")==0)||
123  ((strcmp1(&filab[87],"NT ")==0)&&(*ithermal>=2)))
124  NNEW(vt,double,mt**nk*ngraph);
125  if((strcmp1(&filab[87],"NT ")==0)&&(*ithermal<2))
126  NNEW(t1t,double,*nk*ngraph);
127  if((strcmp1(&filab[174],"S ")==0)||(strcmp1(&filab[1044],"ZZS ")==0)||
128  (strcmp1(&filab[1044],"ERR ")==0))
129  NNEW(stnt,double,6**nk*ngraph);
130  if(strcmp1(&filab[261],"E ")==0)
131  NNEW(eent,double,6**nk*ngraph);
132  if((strcmp1(&filab[348],"RF ")==0)||(strcmp1(&filab[783],"RFL ")==0))
133  NNEW(fnt,double,mt**nk*ngraph);
134  if(strcmp1(&filab[435],"PEEQ")==0)
135  NNEW(epnt,double,*nk*ngraph);
136  if(strcmp1(&filab[522],"ENER")==0)
137  NNEW(enernt,double,*nk*ngraph);
138  if(strcmp1(&filab[609],"SDV ")==0)
139  NNEW(xstatent,double,*nstate_**nk*ngraph);
140  if((strcmp1(&filab[696],"HFL ")==0)||(strcmp1(&filab[2784],"HER ")==0))
141  NNEW(qfnt,double,3**nk*ngraph);
142  if((strcmp1(&filab[1044],"ZZS ")==0)||(strcmp1(&filab[1044],"ERR ")==0)||
143  (strcmp1(&filab[2175],"CONT")==0))
144  NNEW(stit,double,6*mi[0]**ne*ngraph);
145  if(strcmp1(&filab[2697],"ME ")==0)
146  NNEW(emnt,double,6**nk*ngraph);
147 
148  /* the topology only needs duplication the first time it is
149  stored in the frd file (*kode=1)
150  the above two lines are not true: lakon is needed for
151  contact information in frd.f */
152 
153  NNEW(kont,ITG,*nkon*ngraph);
154  NNEW(ipkont,ITG,*ne*ngraph);
155  NNEW(lakont,char,8**ne*ngraph);
156  NNEW(ielmatt,ITG,mi[2]**ne*ngraph);
157  NNEW(inumt,ITG,*nk*ngraph);
158 
159  nkt=ngraph**nk;
160  net0=(ngraph-1)**ne+(*ne0);
161  net=ngraph**ne;
162 
163  /* copying the coordinates of the first sector */
164 
165  for(l=0;l<3**nk;l++){cot[l]=co[l];}
166  if(*ntrans>0){for(l=0;l<*nk;l++){inotrt[2*l]=inotr[2*l];}}
167 
168  /* copying the topology of the first sector */
169 
170  for(l=0;l<*nkon;l++){kont[l]=kon[l];}
171  for(l=0;l<*ne;l++){ipkont[l]=ipkon[l];}
172  for(l=0;l<8**ne;l++){lakont[l]=lakon[l];}
173  for(l=0;l<mi[2]**ne;l++){ielmatt[l]=ielmat[l];}
174 
175  /* generating the coordinates for the other sectors */
176 
177  icntrl=1;
178 
179  FORTRAN(rectcyl,(cot,v,fn,stn,qfn,een,cs,nk,&icntrl,t,filab,&imag,mi,emn));
180 
181  for(jj=0;jj<*mcs;jj++){
182  is=cs[17*jj+4];
183  for(i=1;i<is;i++){
184 
185  theta=i*2.*pi/cs[17*jj];
186 
187  for(l=0;l<*nk;l++){
188  if(inocs[l]==jj){
189  cot[3*l+i*3**nk]=cot[3*l];
190  cot[1+3*l+i*3**nk]=cot[1+3*l]+theta;
191  cot[2+3*l+i*3**nk]=cot[2+3*l];
192  }
193  }
194 
195  if(*ntrans>0){
196  for(l=0;l<*nk;l++){
197  if(inocs[l]==jj){
198  inotrt[2*l+i*2**nk]=inotrt[2*l];
199  }
200  }
201  }
202 
203  for(l=0;l<*nkon;l++){kont[l+i**nkon]=kon[l]+i**nk;}
204  for(l=0;l<*ne;l++){
205  if(ielcs[l]==jj){
206  if(ipkon[l]>=0){
207  ipkont[l+i**ne]=ipkon[l]+i**nkon;
208  ielmatt[mi[2]*(l+i**ne)]=ielmat[mi[2]*l];
209  for(l1=0;l1<8;l1++){
210  l2=8*l+l1;
211  lakont[l2+i*8**ne]=lakon[l2];
212  }
213  }
214  else ipkont[l+i**ne]=-1;
215  }
216  }
217  }
218  }
219 
220  icntrl=-1;
221 
222  FORTRAN(rectcyl,(cot,vt,fnt,stnt,qfnt,eent,cs,&nkt,&icntrl,t,filab,
223  &imag,mi,emnt));
224 
225  /* mapping the results to the other sectors */
226 
227  for(l=0;l<*nk;l++){inumt[l]=inum[l];}
228 
229  icntrl=2;
230 
231  FORTRAN(rectcyl,(co,v,fn,stn,qfn,een,cs,nk,&icntrl,t,filab,&imag,mi,emn));
232 
233  if((strcmp1(&filab[0],"U ")==0)||
234  (strcmp1(&filab[1131],"TT ")==0)||
235  (strcmp1(&filab[1218],"MF ")==0)||
236  (strcmp1(&filab[1305],"PT ")==0)||
237  ((strcmp1(&filab[87],"NT ")==0)&&(*ithermal>=2)))
238  for(l=0;l<mt**nk;l++){vt[l]=v[l];};
239  if((strcmp1(&filab[87],"NT ")==0)&&(*ithermal<2))
240  for(l=0;l<*nk;l++){t1t[l]=t1[l];};
241  if(strcmp1(&filab[174],"S ")==0)
242  for(l=0;l<6**nk;l++){stnt[l]=stn[l];};
243  if(strcmp1(&filab[261],"E ")==0)
244  for(l=0;l<6**nk;l++){eent[l]=een[l];};
245  if((strcmp1(&filab[348],"RF ")==0)||(strcmp1(&filab[783],"RFL ")==0))
246  for(l=0;l<mt**nk;l++){fnt[l]=fn[l];};
247  if(strcmp1(&filab[435],"PEEQ")==0)
248  for(l=0;l<*nk;l++){epnt[l]=epn[l];};
249  if(strcmp1(&filab[522],"ENER")==0)
250  for(l=0;l<*nk;l++){enernt[l]=enern[l];};
251  if(strcmp1(&filab[609],"SDV ")==0)
252  for(l=0;l<*nstate_**nk;l++){xstatent[l]=xstaten[l];};
253  if((strcmp1(&filab[696],"HFL ")==0)||(strcmp1(&filab[2784],"HER ")==0))
254  for(l=0;l<3**nk;l++){qfnt[l]=qfn[l];};
255  if((strcmp1(&filab[1044],"ZZS ")==0)||(strcmp1(&filab[1044],"ERR ")==0)||
256  (strcmp1(&filab[2175],"CONT")==0))
257  for(l=0;l<6*mi[0]**ne;l++){stit[l]=sti[l];};
258  if(strcmp1(&filab[2697],"ME ")==0)
259  for(l=0;l<6**nk;l++){emnt[l]=emn[l];};
260 
261  for(jj=0;jj<*mcs;jj++){
262  is=cs[17*jj+4];
263  for(i=1;i<is;i++){
264 
265  for(l=0;l<*nk;l++){inumt[l+i**nk]=inum[l];}
266 
267  if((strcmp1(&filab[0],"U ")==0)||
268  (strcmp1(&filab[1131],"TT ")==0)||
269  (strcmp1(&filab[1218],"MF ")==0)||
270  (strcmp1(&filab[1305],"PT ")==0)||
271  ((strcmp1(&filab[87],"NT ")==0)&&(*ithermal>=2))){
272  for(l1=0;l1<*nk;l1++){
273  if(inocs[l1]==jj){
274  for(l2=0;l2<4;l2++){
275  l=mt*l1+l2;
276  vt[l+mt**nk*i]=v[l];
277  }
278  }
279  }
280  }
281 
282  if((strcmp1(&filab[87],"NT ")==0)&&(*ithermal<2)){
283  for(l=0;l<*nk;l++){
284  if(inocs[l]==jj) t1t[l+*nk*i]=t1[l];
285  }
286  }
287 
288  if(strcmp1(&filab[174],"S ")==0){
289  for(l1=0;l1<*nk;l1++){
290  if(inocs[l1]==jj){
291  for(l2=0;l2<6;l2++){
292  l=6*l1+l2;
293  stnt[l+6**nk*i]=stn[l];
294  }
295  }
296  }
297  }
298 
299  if(strcmp1(&filab[261],"E ")==0){
300  for(l1=0;l1<*nk;l1++){
301  if(inocs[l1]==jj){
302  for(l2=0;l2<6;l2++){
303  l=6*l1+l2;
304  eent[l+6**nk*i]=een[l];
305  }
306  }
307  }
308  }
309 
310  if((strcmp1(&filab[348],"RF ")==0)||(strcmp1(&filab[783],"RFL ")==0)){
311  for(l1=0;l1<*nk;l1++){
312  if(inocs[l1]==jj){
313  for(l2=0;l2<4;l2++){
314  l=mt*l1+l2;
315  fnt[l+mt**nk*i]=fn[l];
316  }
317  }
318  }
319  }
320 
321  if(strcmp1(&filab[435],"PEEQ")==0){
322  for(l=0;l<*nk;l++){
323  if(inocs[l]==jj) epnt[l+*nk*i]=epn[l];
324  }
325  }
326 
327  if(strcmp1(&filab[522],"ENER")==0){
328  for(l=0;l<*nk;l++){
329  if(inocs[l]==jj) enernt[l+*nk*i]=enern[l];
330  }
331  }
332 
333  if(strcmp1(&filab[609],"SDV ")==0){
334  for(l1=0;l1<*nk;l1++){
335  if(inocs[l1]==jj){
336  for(l2=0;l2<*nstate_;l2++){
337  l=*nstate_*l1+l2;
338  xstatent[l+*nstate_**nk*i]=xstaten[l];
339  }
340  }
341  }
342  }
343 
344  if((strcmp1(&filab[696],"HFL ")==0)||(strcmp1(&filab[2784],"HER ")==0)){
345  for(l1=0;l1<*nk;l1++){
346  if(inocs[l1]==jj){
347  for(l2=0;l2<3;l2++){
348  l=3*l1+l2;
349  qfnt[l+3**nk*i]=qfn[l];
350  }
351  }
352  }
353  }
354 
355  if(strcmp1(&filab[2697],"ME ")==0){
356  for(l1=0;l1<*nk;l1++){
357  if(inocs[l1]==jj){
358  for(l2=0;l2<6;l2++){
359  l=6*l1+l2;
360  emnt[l+6**nk*i]=emn[l];
361  }
362  }
363  }
364  }
365  }
366  }
367 
368  icntrl=-2;
369 
370  FORTRAN(rectcyl,(cot,vt,fnt,stnt,qfnt,eent,cs,&nkt,&icntrl,t,filab,
371  &imag,mi,emnt));
372 
373  if(strcmp1(&filab[1044],"ZZS")==0){
374  NNEW(neigh,ITG,40*net);
375  NNEW(ipneigh,ITG,nkt);
376  }
377 
378  frd(cot,&nkt,kont,ipkont,lakont,&net0,vt,stnt,inumt,nmethod,
379  kode,filab,eent,t1t,fnt,time,epnt,ielmatt,matname,enernt,xstatent,
380  nstate_,istep,iinc,ithermal,qfnt,&mode,noddiam,trab,inotrt,
381  ntrans,orab,ielorien,norien,description,ipneigh,neigh,
382  mi,stit,vr,vi,stnr,stni,vmax,stnmax,&ngraph,veold,ener,&net,
383  cs,set,nset,istartset,iendset,ialset,eenmax,fnr,fni,emnt,
384  thicke,jobnamec,output,qfx,cdn,mortar,cdnr,cdni,nmat);
385 
386  if(strcmp1(&filab[1044],"ZZS")==0){SFREE(ipneigh);SFREE(neigh);}
387 
388  if((strcmp1(&filab[0],"U ")==0)||
389  (strcmp1(&filab[1131],"TT ")==0)||
390  (strcmp1(&filab[1218],"MF ")==0)||
391  (strcmp1(&filab[1305],"PT ")==0)||
392  ((strcmp1(&filab[87],"NT ")==0)&&(*ithermal>=2))) SFREE(vt);
393  if((strcmp1(&filab[87],"NT ")==0)&&(*ithermal<2)) SFREE(t1t);
394  if((strcmp1(&filab[174],"S ")==0)||(strcmp1(&filab[1044],"ZZS ")==0)||
395  (strcmp1(&filab[1044],"ERR ")==0))
396  SFREE(stnt);
397  if(strcmp1(&filab[261],"E ")==0) SFREE(eent);
398  if((strcmp1(&filab[348],"RF ")==0)||(strcmp1(&filab[783],"RFL ")==0))
399  SFREE(fnt);
400  if(strcmp1(&filab[435],"PEEQ")==0) SFREE(epnt);
401  if(strcmp1(&filab[522],"ENER")==0) SFREE(enernt);
402  if(strcmp1(&filab[609],"SDV ")==0) SFREE(xstatent);
403  if((strcmp1(&filab[696],"HFL ")==0)||(strcmp1(&filab[2784],"HER ")==0)) SFREE(qfnt);
404  if((strcmp1(&filab[1044],"ZZS ")==0)||(strcmp1(&filab[1044],"ERR ")==0)||
405  (strcmp1(&filab[2175],"CONT")==0)) SFREE(stit);
406  if(strcmp1(&filab[2697],"ME ")==0) SFREE(emnt);
407 
408  SFREE(kont);SFREE(ipkont);SFREE(lakont);SFREE(ielmatt);
409  SFREE(inumt);SFREE(cot);if(*ntrans>0)SFREE(inotrt);
410  SFREE(inocs);SFREE(ielcs);
411  return;
412 }
void frd(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne0, double *v, double *stn, ITG *inum, ITG *nmethod, ITG *kode, char *filab, double *een, double *t1, double *fn, double *time, double *epn, ITG *ielmat, char *matname, double *enern, double *xstaten, ITG *nstate_, ITG *istep, ITG *iinc, ITG *ithermal, double *qfn, ITG *mode, ITG *noddiam, double *trab, ITG *inotr, ITG *ntrans, double *orab, ITG *ielorien, ITG *norien, char *description, ITG *ipneigh, ITG *neigh, ITG *mi, double *stx, double *vr, double *vi, double *stnr, double *stni, double *vmax, double *stnmax, ITG *ngraph, double *veold, double *ener, ITG *ne, double *cs, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, double *eenmax, double *fnr, double *fni, double *emn, double *thicke, char *jobnamec, char *output, double *qfx, double *cdn, ITG *mortar, double *cdnr, double *cdni, ITG *nmat)
Definition: frd.c:32
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
ITG strcmp1(const char *s1, const char *s2)
Definition: strcmp1.c:24
#define SFREE(a)
Definition: CalculiX.h:41
#define ITG
Definition: CalculiX.h:51
#define NNEW(a, b, c)
Definition: CalculiX.h:39
subroutine rectcyl(co, v, fn, stn, qfn, een, cs, n, icntrl, t, filab, imag, mi, emn)
Definition: rectcyl.f:21

◆ frdgeneralvector()

void frdgeneralvector ( double *  v,
ITG iset,
ITG ntrans,
char *  filabl,
ITG nkcoords,
ITG inum,
char *  m1,
ITG inotr,
double *  trab,
double *  co,
ITG istartset,
ITG iendset,
ITG ialset,
ITG mi,
ITG ngraph,
FILE *  f1,
char *  output,
char *  m3 
)
28  {
29 
30  ITG i,j,k,l,m,nksegment;
31 
32  int iw;
33 
34  float ifl;
35 
36  double a[9];
37 
38  if(*iset==0){
39  if((*ntrans==0)||(strcmp1(&filabl[5],"G")==0)){
40  for(i=0;i<*nkcoords;i++){
41  if(inum[i]<=0) continue;
42  if(strcmp1(output,"asc")==0){
43  if(mi[1]==4){
44  fprintf(f1,"%3s%10" ITGFORMAT "%12.5E%12.5E%12.5E%12.5E\n",m1,i+1,
45  (float)v[(mi[1]+1)*i+1],(float)v[(mi[1]+1)*i+2],
46  (float)v[(mi[1]+1)*i+3],(float)v[(mi[1]+1)*i+4]);
47  }else if(mi[1]==5){
48  fprintf(f1,"%3s%10" ITGFORMAT "%12.5E%12.5E%12.5E%12.5E%12.5E\n",m1,i+1,
49  (float)v[(mi[1]+1)*i+1],(float)v[(mi[1]+1)*i+2],
50  (float)v[(mi[1]+1)*i+3],(float)v[(mi[1]+1)*i+4],
51  (float)v[(mi[1]+1)*i+5]);
52  }else if(mi[1]==6){
53  fprintf(f1,"%3s%10" ITGFORMAT "%12.5E%12.5E%12.5E%12.5E%12.5E%12.5E\n",m1,i+1,
54  (float)v[(mi[1]+1)*i+1],(float)v[(mi[1]+1)*i+2],
55  (float)v[(mi[1]+1)*i+3],(float)v[(mi[1]+1)*i+4],
56  (float)v[(mi[1]+1)*i+5],(float)v[(mi[1]+1)*i+6]);
57  }
58  }else{
59  iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
60  for(j=1;j<=mi[1];j++){
61  ifl=(float)v[(mi[1]+1)*i+j];fwrite(&ifl,sizeof(float),1,f1);
62  }
63  }
64  }
65  }else{
66  for(i=0;i<*nkcoords;i++){
67  if(inum[i]<=0) continue;
68  if(inotr[2*i]==0){
69  if(strcmp1(output,"asc")==0){
70  if(mi[1]==4){
71  fprintf(f1,"%3s%10" ITGFORMAT "%12.5E%12.5E%12.5E%12.5E\n",m1,i+1,
72  (float)v[(mi[1]+1)*i+1],(float)v[(mi[1]+1)*i+2],
73  (float)v[(mi[1]+1)*i+3],(float)v[(mi[1]+1)*i+4]);
74  }else if(mi[1]==5){
75  fprintf(f1,"%3s%10" ITGFORMAT "%12.5E%12.5E%12.5E%12.5E%12.5E\n",m1,i+1,
76  (float)v[(mi[1]+1)*i+1],(float)v[(mi[1]+1)*i+2],
77  (float)v[(mi[1]+1)*i+3],(float)v[(mi[1]+1)*i+4],
78  (float)v[(mi[1]+1)*i+5]);
79  }else if(mi[1]==6){
80  fprintf(f1,"%3s%10" ITGFORMAT "%12.5E%12.5E%12.5E%12.5E%12.5E%12.5E\n",m1,i+1,
81  (float)v[(mi[1]+1)*i+1],(float)v[(mi[1]+1)*i+2],
82  (float)v[(mi[1]+1)*i+3],(float)v[(mi[1]+1)*i+4],
83  (float)v[(mi[1]+1)*i+5],(float)v[(mi[1]+1)*i+6]);
84  }
85  }else{
86  iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
87  for(j=1;j<=mi[1];j++){
88  ifl=(float)v[(mi[1]+1)*i+j];fwrite(&ifl,sizeof(float),1,f1);
89  }
90  }
91  }else{
92  printf("*WARNING in frdgeneralvector:\n");
93  printf(" no output in local coordinates allowed\n");
94  printf(" for generalized vectors\n");
95  printf(" output request ist not performed;\n");
96  }
97  }
98  }
99  }else{
100  nksegment=(*nkcoords)/(*ngraph);
101  for(k=istartset[*iset-1]-1;k<iendset[*iset-1];k++){
102  if(ialset[k]>0){
103  for(l=0;l<*ngraph;l++){
104  i=ialset[k]+l*nksegment-1;
105  if(inum[i]<=0) continue;
106  if((*ntrans==0)||(strcmp1(&filabl[5],"G")==0)||(inotr[2*i]==0)){
107  if(strcmp1(output,"asc")==0){
108  if(mi[1]==4){
109  fprintf(f1,"%3s%10" ITGFORMAT "%12.5E%12.5E%12.5E%12.5E\n",m1,i+1,
110  (float)v[(mi[1]+1)*i+1],(float)v[(mi[1]+1)*i+2],
111  (float)v[(mi[1]+1)*i+3],(float)v[(mi[1]+1)*i+4]);
112  }else if(mi[1]==5){
113  fprintf(f1,"%3s%10" ITGFORMAT "%12.5E%12.5E%12.5E%12.5E%12.5E\n",m1,i+1,
114  (float)v[(mi[1]+1)*i+1],(float)v[(mi[1]+1)*i+2],
115  (float)v[(mi[1]+1)*i+3],(float)v[(mi[1]+1)*i+4],
116  (float)v[(mi[1]+1)*i+5]);
117  }else if(mi[1]==6){
118  fprintf(f1,"%3s%10" ITGFORMAT "%12.5E%12.5E%12.5E%12.5E%12.5E%12.5E\n",m1,i+1,
119  (float)v[(mi[1]+1)*i+1],(float)v[(mi[1]+1)*i+2],
120  (float)v[(mi[1]+1)*i+3],(float)v[(mi[1]+1)*i+4],
121  (float)v[(mi[1]+1)*i+5],(float)v[(mi[1]+1)*i+6]);
122  }
123  }else{
124  iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
125  for(j=1;j<=mi[1];j++){
126  ifl=(float)v[(mi[1]+1)*i+j];fwrite(&ifl,sizeof(float),1,f1);
127  }
128  }
129  }else{
130  printf("*WARNING in frdgeneralvector:\n");
131  printf(" no output in local coordinates allowed\n");
132  printf(" for generalized vectors\n");
133  printf(" output request ist not performed;\n");
134  }
135  }
136  }else{
137  l=ialset[k-2];
138  do{
139  l-=ialset[k];
140  if(l>=ialset[k-1]) break;
141  for(m=0;m<*ngraph;m++){
142  i=l+m*nksegment-1;
143  if(inum[i]<=0) continue;
144  if((*ntrans==0)||(strcmp1(&filabl[5],"G")==0)||(inotr[2*i]==0)){
145  if(strcmp1(output,"asc")==0){
146  if(mi[1]==4){
147  fprintf(f1,"%3s%10" ITGFORMAT "%12.5E%12.5E%12.5E%12.5E\n",m1,i+1,
148  (float)v[(mi[1]+1)*i+1],(float)v[(mi[1]+1)*i+2],
149  (float)v[(mi[1]+1)*i+3],(float)v[(mi[1]+1)*i+4]);
150  }else if(mi[1]==5){
151  fprintf(f1,"%3s%10" ITGFORMAT "%12.5E%12.5E%12.5E%12.5E%12.5E\n",m1,i+1,
152  (float)v[(mi[1]+1)*i+1],(float)v[(mi[1]+1)*i+2],
153  (float)v[(mi[1]+1)*i+3],(float)v[(mi[1]+1)*i+4],
154  (float)v[(mi[1]+1)*i+5]);
155  }else if(mi[1]==6){
156  fprintf(f1,"%3s%10" ITGFORMAT "%12.5E%12.5E%12.5E%12.5E%12.5E%12.5E\n",m1,i+1,
157  (float)v[(mi[1]+1)*i+1],(float)v[(mi[1]+1)*i+2],
158  (float)v[(mi[1]+1)*i+3],(float)v[(mi[1]+1)*i+4],
159  (float)v[(mi[1]+1)*i+5],(float)v[(mi[1]+1)*i+6]);
160  }
161  }else{
162  iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
163  for(j=1;j<=mi[1];j++){
164  ifl=(float)v[(mi[1]+1)*i+j];fwrite(&ifl,sizeof(float),1,f1);
165  }
166  }
167  }else{
168  printf("*WARNING in frdgeneralvector:\n");
169  printf(" no output in local coordinates allowed\n");
170  printf(" for generalized vectors\n");
171  printf(" output request ist not performed;\n");
172  }
173  }
174  }while(1);
175  }
176  }
177  }
178 
179  if(strcmp1(output,"asc")==0)fprintf(f1,"%3s\n",m3);
180 
181  return;
182 
183 }
#define ITGFORMAT
Definition: CalculiX.h:52
ITG strcmp1(const char *s1, const char *s2)
Definition: strcmp1.c:24
static double * f1
Definition: objectivemain_se.c:47
#define ITG
Definition: CalculiX.h:51

◆ frdheader()

void frdheader ( ITG icounter,
double *  oner,
double *  time,
double *  pi,
ITG noddiam,
double *  cs,
ITG null,
ITG mode,
ITG noutloc,
char *  description,
ITG kode,
ITG nmethod,
FILE *  f1,
char *  output,
ITG istep,
ITG iinc 
)
27  {
28 
29  char tmp[132],text[132];
30 
31  ITG i,ncomma;
32 
33  /* icounter counts the number of loadcases in the frd-file
34  kode counts the number of increments in the frd-file */
35 
36  strcpy1(&text[0]," 1PSTEP",10);
37  for(i=10;i<70;i++)text[i]=' ';text[70]='\0';
38  (*icounter)++;
39  sprintf(&text[24],"%12" ITGFORMAT "",*icounter);
40  sprintf(&text[36],"%12" ITGFORMAT "",*iinc);
41  sprintf(&text[48],"%12" ITGFORMAT "",*istep);text[60]=' ';
42  fprintf(f1,"%s\n",text);
43 
44  /* additional headers for frequency calculations */
45 
46  if((*nmethod==2)||(*nmethod==6)||(*nmethod==7)||
47  ((*nmethod==12)&&(*noddiam>-1))){
48  strcpy1(&text[0]," 1PGM",8);
49  for(i=8;i<70;i++)text[i]=' ';text[70]='\0';
50  sprintf(&text[24],"%12.6E",*oner);text[36]=' ';
51  fprintf(f1,"%s\n",text);
52 
53  strcpy1(&text[0]," 1PGK",8);
54  for(i=8;i<70;i++)text[i]=' ';text[70]='\0';
55  sprintf(&text[24],"%12.6E",(*time*2.**pi)*(*time*2.**pi));text[36]=' ';
56  fprintf(f1,"%s\n",text);
57 
58  strcpy1(&text[0]," 1PHID",9);
59  for(i=9;i<70;i++)text[i]=' ';text[70]='\0';
60  sprintf(&text[24],"%12" ITGFORMAT "",*noddiam);text[36]=' ';
61  fprintf(f1,"%s\n",text);
62 
63  /* additional headers for cyclic symmetry calculations */
64 
65  if((*noddiam>=0)&&(cs!=NULL)){
66  strcpy1(&text[0]," 1PAX",8);
67  for(i=8;i<24;i++)text[i]=' ';
68  sprintf(&text[24],"%12.5E",cs[5]);
69  sprintf(&text[36],"%12.5E",cs[6]);
70  sprintf(&text[48],"%12.5E",cs[7]);
71  sprintf(&text[60],"%12.5E",cs[8]);
72  sprintf(&text[72],"%12.5E",cs[9]);
73  sprintf(&text[84],"%12.5E",cs[10]);
74  fprintf(f1,"%s\n",text);
75  }
76 
77  strcpy1(&text[0]," 1PSUBC",10);
78  for(i=10;i<70;i++)text[i]=' ';text[70]='\0';
79  sprintf(&text[24],"%12" ITGFORMAT "",*null);text[36]=' ';
80  fprintf(f1,"%s\n",text);
81 
82  strcpy1(&text[0]," 1PMODE",10);
83  for(i=10;i<70;i++)text[i]=' ';text[70]='\0';
84  sprintf(&text[24],"%12" ITGFORMAT "",*mode+1);text[36]=' ';
85  fprintf(f1,"%s\n",text);
86  }
87 
88 #ifdef COMPANY
89  writeBasisParameter(f1,istep,iinc);
90 #endif
91 
92  /* 100CL line */
93 
94  for(i=0;i<75;i++)text[i]=' ';
95  if(abs(*nmethod)==1){
96  strcpy1(&text[0]," 100CL .00000E+00 0 1",63);
97  }else if(*nmethod==2){
98  strcpy1(&text[0]," 100CL .00000E+00 2 1",63);
99  }else if(*nmethod==3){
100  strcpy1(&text[0]," 100CL .00000E+00 4 1",63);
101  }else if((*nmethod==4)||(*nmethod==5)){
102  strcpy1(&text[0]," 100CL .00000E+00 1 1",63);
103  }else{
104  strcpy1(&text[0]," 100CL .00000E+00 3 1",63);
105  }
106 
107  sprintf(tmp,"%12" ITGFORMAT "",*noutloc);
108  strcpy1(&text[24],tmp,12);
109  strcpy1(&text[36],description,12);
110  if(*nmethod==2)strcpy1(&text[63],"MODAL",5);
111  if(strcmp1(output,"asc")==0){
112  strcpy1(&text[74],"1",1);
113  }else{
114  strcpy1(&text[74],"2",1);
115  }
116  sprintf(tmp,"%5" ITGFORMAT "",100+(*kode));
117  strcpy1(&text[7],tmp,5);
118 // sprintf(tmp,"%12.5E",*time);
119 
120  if((*time<=0.)||(*nmethod==2)){
121  sprintf(tmp,"%12.5E",*time);
122  }else if((log10(*time)>=0)&&(log10(*time)<10.)){
123  ncomma=10-floor(log10(*time)+1.);
124  if(ncomma==0){
125  sprintf(tmp,"%12.0f",*time);
126  }else if(ncomma==1){
127  sprintf(tmp,"%12.1f",*time);
128  }else if(ncomma==2){
129  sprintf(tmp,"%12.2f",*time);
130  }else if(ncomma==3){
131  sprintf(tmp,"%12.3f",*time);
132  }else if(ncomma==4){
133  sprintf(tmp,"%12.4f",*time);
134  }else if(ncomma==5){
135  sprintf(tmp,"%12.5f",*time);
136  }else if(ncomma==6){
137  sprintf(tmp,"%12.6f",*time);
138  }else if(ncomma==7){
139  sprintf(tmp,"%12.7f",*time);
140  }else if(ncomma==8){
141  sprintf(tmp,"%12.8f",*time);
142  }else{
143  sprintf(tmp,"%12.9f",*time);
144  }
145  }else{
146  sprintf(tmp,"%12.5E",*time);
147  }
148 
149  strcpy1(&text[12],tmp,12);
150  sprintf(tmp,"%5" ITGFORMAT "",*kode);
151  strcpy1(&text[58],tmp,5);
152  text[75]='\0';
153  fprintf(f1,"%s\n",text);
154 
155 }
#define ITGFORMAT
Definition: CalculiX.h:52
ITG strcpy1(char *s1, const char *s2, ITG length)
Definition: strcpy1.c:24
ITG strcmp1(const char *s1, const char *s2)
Definition: strcmp1.c:24
void writeBasisParameter(FILE *f, ITG *istep, ITG *iinc)
static double * f1
Definition: objectivemain_se.c:47
#define ITG
Definition: CalculiX.h:51

◆ frdselect()

void frdselect ( double *  field1,
double *  field2,
ITG iset,
ITG nkcoords,
ITG inum,
char *  m1,
ITG istartset,
ITG iendset,
ITG ialset,
ITG ngraph,
ITG ncomp,
ITG ifield,
ITG icomp,
ITG nfield,
ITG iselect,
char *  m2,
FILE *  f1,
char *  output,
char *  m3 
)
30  {
31 
32  /* storing scalars, components of vectors and tensors without additional
33  transformations */
34 
35  /* number of components in field1: nfield[0]
36  number of components in field2: nfield[1]
37 
38  number of entities to store: ncomp
39  for each entity i, 0<=i<ncomp:
40  - ifield[i]: 1=field1,2=field2
41  - icomp[i]: component: 0...,(nfield[0]-1 or nfield[1]-1) */
42 
43  ITG i,j,k,l,m,n,nksegment;
44 
45  int iw;
46 
47  float ifl;
48 
49  if(*iset==0){
50  for(i=0;i<*nkcoords;i++){
51 
52  /* check whether output is requested for solid nodes or
53  network nodes */
54 
55  if(*iselect==1){
56  if(inum[i]<=0) continue;
57  }else if(*iselect==-1){
58  if(inum[i]>=0) continue;
59  }else{
60  if(inum[i]==0) continue;
61  }
62 
63  /* storing the entities */
64 
65  for(n=1;n<=(ITG)((*ncomp+5)/6);n++){
66  if(n==1){
67  if(strcmp1(output,"asc")==0){
68  fprintf(f1,"%3s%10" ITGFORMAT "",m1,i+1);
69  }else{
70  iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
71  }
72  for(j=0;j<min(6,*ncomp);j++){
73  if(ifield[j]==1){
74  if(strcmp1(output,"asc")==0){
75  fprintf(f1,"%12.5E",(float)field1[i*nfield[0]+icomp[j]]);
76  }else{
77  ifl=(float)field1[i*nfield[0]+icomp[j]];
78  fwrite(&ifl,sizeof(float),1,f1);
79  }
80  }else{
81  if(strcmp1(output,"asc")==0){
82  fprintf(f1,"%12.5E",(float)field2[i*nfield[1]+icomp[j]]);
83  }else{
84  ifl=(float)field2[i*nfield[1]+icomp[j]];
85  fwrite(&ifl,sizeof(float),1,f1);
86  }
87  }
88  }
89  if(strcmp1(output,"asc")==0)fprintf(f1,"\n");
90  }else{
91  if(strcmp1(output,"asc")==0)fprintf(f1,"%3s ",m2);
92  for(j=(n-1)*6;j<min(n*6,*ncomp);j++){
93  if(ifield[j]==1){
94  if(strcmp1(output,"asc")==0){
95  fprintf(f1,"%12.5E",(float)field1[i*nfield[0]+icomp[j]]);
96  }else{
97  ifl=(float)field1[i*nfield[0]+icomp[j]];
98  fwrite(&ifl,sizeof(float),1,f1);
99  }
100  }else{
101  if(strcmp1(output,"asc")==0){
102  fprintf(f1,"%12.5E",(float)field2[i*nfield[1]+icomp[j]]);
103  }else{
104  ifl=(float)field2[i*nfield[1]+icomp[j]];
105  fwrite(&ifl,sizeof(float),1,f1);
106  }
107  }
108  }
109  if(strcmp1(output,"asc")==0)fprintf(f1,"\n");
110  }
111  }
112 
113  }
114  }else{
115  nksegment=(*nkcoords)/(*ngraph);
116  for(k=istartset[*iset-1]-1;k<iendset[*iset-1];k++){
117  if(ialset[k]>0){
118  for(l=0;l<*ngraph;l++){
119  i=ialset[k]+l*nksegment-1;
120 
121  /* check whether output is requested for solid nodes or
122  network nodes */
123 
124  if(*iselect==1){
125  if(inum[i]<=0) continue;
126  }else if(*iselect==-1){
127  if(inum[i]>=0) continue;
128  }else{
129  if(inum[i]==0) continue;
130  }
131 
132  /* storing the entities */
133 
134  for(n=1;n<=(ITG)((*ncomp+5)/6);n++){
135  if(n==1){
136  if(strcmp1(output,"asc")==0){
137  fprintf(f1,"%3s%10" ITGFORMAT "",m1,i+1);
138  }else{
139  iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
140  }
141  for(j=0;j<min(6,*ncomp);j++){
142  if(ifield[j]==1){
143  if(strcmp1(output,"asc")==0){
144  fprintf(f1,"%12.5E",(float)field1[i*nfield[0]+icomp[j]]);
145  }else{
146  ifl=(float)field1[i*nfield[0]+icomp[j]];
147  fwrite(&ifl,sizeof(float),1,f1);
148  }
149  }else{
150  if(strcmp1(output,"asc")==0){
151  fprintf(f1,"%12.5E",(float)field2[i*nfield[1]+icomp[j]]);
152  }else{
153  ifl=(float)field2[i*nfield[1]+icomp[j]];
154  fwrite(&ifl,sizeof(float),1,f1);
155  }
156  }
157  }
158  if(strcmp1(output,"asc")==0)fprintf(f1,"\n");
159  }else{
160  if(strcmp1(output,"asc")==0)fprintf(f1,"%3s ",m2);
161  for(j=(n-1)*6;j<min(n*6,*ncomp);j++){
162  if(ifield[j]==1){
163  if(strcmp1(output,"asc")==0){
164  fprintf(f1,"%12.5E",(float)field1[i*nfield[0]+icomp[j]]);
165  }else{
166  ifl=(float)field1[i*nfield[0]+icomp[j]];
167  fwrite(&ifl,sizeof(float),1,f1);
168  }
169  }else{
170  if(strcmp1(output,"asc")==0){
171  fprintf(f1,"%12.5E",(float)field2[i*nfield[1]+icomp[j]]);
172  }else{
173  ifl=(float)field2[i*nfield[1]+icomp[j]];
174  fwrite(&ifl,sizeof(float),1,f1);
175  }
176  }
177  }
178  if(strcmp1(output,"asc")==0)fprintf(f1,"\n");
179  }
180  }
181 
182  }
183  }else{
184  l=ialset[k-2];
185  do{
186  l-=ialset[k];
187  if(l>=ialset[k-1]) break;
188  for(m=0;m<*ngraph;m++){
189  i=l+m*nksegment-1;
190 
191  /* check whether output is requested for solid nodes or
192  network nodes */
193 
194  if(*iselect==1){
195  if(inum[i]<=0) continue;
196  }else if(*iselect==-1){
197  if(inum[i]>=0) continue;
198  }else{
199  if(inum[i]==0) continue;
200  }
201 
202  /* storing the entities */
203 
204  for(n=1;n<=(ITG)((*ncomp+5)/6);n++){
205  if(n==1){
206  if(strcmp1(output,"asc")==0){
207  fprintf(f1,"%3s%10" ITGFORMAT "",m1,i+1);
208  }else{
209  iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
210  }
211  for(j=0;j<min(6,*ncomp);j++){
212  if(ifield[j]==1){
213  if(strcmp1(output,"asc")==0){
214  fprintf(f1,"%12.5E",(float)field1[i*nfield[0]+icomp[j]]);
215  }else{
216  ifl=(float)field1[i*nfield[0]+icomp[j]];
217  fwrite(&ifl,sizeof(float),1,f1);
218  }
219  }else{
220  if(strcmp1(output,"asc")==0){
221  fprintf(f1,"%12.5E",(float)field2[i*nfield[1]+icomp[j]]);
222  }else{
223  ifl=(float)field2[i*nfield[1]+icomp[j]];
224  fwrite(&ifl,sizeof(float),1,f1);
225  }
226  }
227  }
228  if(strcmp1(output,"asc")==0)fprintf(f1,"\n");
229  }else{
230  if(strcmp1(output,"asc")==0)fprintf(f1,"%3s ",m2);
231  for(j=(n-1)*6;j<min(n*6,*ncomp);j++){
232  if(ifield[j]==1){
233  if(strcmp1(output,"asc")==0){
234  fprintf(f1,"%12.5E",(float)field1[i*nfield[0]+icomp[j]]);
235  }else{
236  ifl=(float)field1[i*nfield[0]+icomp[j]];
237  fwrite(&ifl,sizeof(float),1,f1);
238  }
239  }else{
240  if(strcmp1(output,"asc")==0){
241  fprintf(f1,"%12.5E",(float)field2[i*nfield[1]+icomp[j]]);
242  }else{
243  ifl=(float)field2[i*nfield[1]+icomp[j]];
244  fwrite(&ifl,sizeof(float),1,f1);
245  }
246  }
247  }
248  if(strcmp1(output,"asc")==0)fprintf(f1,"\n");
249  }
250  }
251 
252  }
253  }while(1);
254  }
255  }
256  }
257 
258  if(strcmp1(output,"asc")==0)fprintf(f1,"%3s\n",m3);
259 
260  return;
261 
262 }
#define ITGFORMAT
Definition: CalculiX.h:52
ITG strcmp1(const char *s1, const char *s2)
Definition: strcmp1.c:24
#define min(a, b)
Definition: frdselect.c:24
static double * f1
Definition: objectivemain_se.c:47
#define ITG
Definition: CalculiX.h:51

◆ frdset()

void frdset ( char *  filabl,
char *  set,
ITG iset,
ITG istartset,
ITG iendset,
ITG ialset,
ITG inum,
ITG noutloc,
ITG nout,
ITG nset,
ITG noutmin,
ITG noutplus,
ITG iselect,
ITG ngraph 
)
26  {
27 
28  ITG j,k;
29 
30  char noset[81];
31 
32  /* check for a set, if any */
33 
34  strcpy1(noset,&filabl[6],81);
35  for((*iset)=0;(*iset)<(*nset);(*iset)++){
36  if(strcmp2(&set[81**iset],noset,81)==0) break;
37  }
38  (*iset)++;
39  if(*iset>*nset)*iset=0;
40  // printf("iset,noutplus %" ITGFORMAT " %" ITGFORMAT "\n",*iset,*noutplus);
41 
42  /* determining the number of nodes in the set */
43 
44  if(*iset==0){
45 
46  /* no set defined */
47 
48  // printf("iselect,noutplus %" ITGFORMAT " %" ITGFORMAT "\n",*iselect,*noutplus);
49 
50  if(*iselect==1){
51  *noutloc=*noutplus;
52  }else if(*iselect==-1){
53  *noutloc=*noutmin;
54  }else{
55  *noutloc=*nout;
56  }
57 
58  }else{
59 
60  /* a set was defined */
61 
62  *noutloc=0;
63  for(j=istartset[*iset-1]-1;j<iendset[*iset-1];j++){
64  if(ialset[j]>0){
65  if(*iselect==-1){
66  if(inum[ialset[j]-1]<0) (*noutloc)++;
67  }else if(*iselect==1){
68  if(inum[ialset[j]-1]>0) (*noutloc)++;
69  }else{
70  if(inum[ialset[j]-1]!=0) (*noutloc)++;
71  }
72  }else{
73  k=ialset[j-2];
74  do{
75  k=k-ialset[j];
76  if(k>=ialset[j-1]) break;
77  if(*iselect==-1){
78  if(inum[k-1]<0) (*noutloc)++;
79  }else if(*iselect==1){
80  if(inum[k-1]>0) (*noutloc)++;
81  }else{
82  if(inum[k-1]!=0) (*noutloc)++;
83  }
84  }while(1);
85  }
86  }
87  if(*ngraph>1) (*noutloc)*=(*ngraph);
88  }
89 
90 
91 }
ITG strcmp2(const char *s1, const char *s2, ITG length)
Definition: strcmp2.c:24
ITG strcpy1(char *s1, const char *s2, ITG length)
Definition: strcpy1.c:24
#define ITG
Definition: CalculiX.h:51

◆ frdvector()

void frdvector ( double *  v,
ITG iset,
ITG ntrans,
char *  filabl,
ITG nkcoords,
ITG inum,
char *  m1,
ITG inotr,
double *  trab,
double *  co,
ITG istartset,
ITG iendset,
ITG ialset,
ITG mi,
ITG ngraph,
FILE *  f1,
char *  output,
char *  m3 
)
27  {
28 
29  ITG i,k,l,m,nksegment;
30 
31  int iw;
32 
33  float ifl;
34 
35  double a[9];
36 
37  if(*iset==0){
38  if((*ntrans==0)||(strcmp1(&filabl[5],"G")==0)){
39  for(i=0;i<*nkcoords;i++){
40  if(inum[i]<=0) continue;
41  if(strcmp1(output,"asc")==0){
42  fprintf(f1,"%3s%10" ITGFORMAT "%12.5E%12.5E%12.5E\n",m1,i+1,
43  (float)v[(mi[1]+1)*i+1],
44  (float)v[(mi[1]+1)*i+2],(float)v[(mi[1]+1)*i+3]);
45  }else{
46  iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
47  ifl=(float)v[(mi[1]+1)*i+1];fwrite(&ifl,sizeof(float),1,f1);
48  ifl=(float)v[(mi[1]+1)*i+2];fwrite(&ifl,sizeof(float),1,f1);
49  ifl=(float)v[(mi[1]+1)*i+3];fwrite(&ifl,sizeof(float),1,f1);
50  }
51  }
52  }else{
53  for(i=0;i<*nkcoords;i++){
54  if(inum[i]<=0) continue;
55  if(inotr[2*i]==0){
56  if(strcmp1(output,"asc")==0){
57  fprintf(f1,"%3s%10" ITGFORMAT "%12.5E%12.5E%12.5E\n",m1,i+1,
58  (float)v[(mi[1]+1)*i+1],
59  (float)v[(mi[1]+1)*i+2],(float)v[(mi[1]+1)*i+3]);
60  }else{
61  iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
62  ifl=(float)v[(mi[1]+1)*i+1];fwrite(&ifl,sizeof(float),1,f1);
63  ifl=(float)v[(mi[1]+1)*i+2];fwrite(&ifl,sizeof(float),1,f1);
64  ifl=(float)v[(mi[1]+1)*i+3];fwrite(&ifl,sizeof(float),1,f1);
65  }
66  }else{
67  FORTRAN(transformatrix,(&trab[7*(inotr[2*i]-1)],&co[3*i],a));
68  if(strcmp1(output,"asc")==0){
69  fprintf(f1,"%3s%10" ITGFORMAT "%12.5E%12.5E%12.5E\n",m1,i+1,
70  (float)(v[(mi[1]+1)*i+1]*a[0]+v[(mi[1]+1)*i+2]*a[1]+v[(mi[1]+1)*i+3]*a[2]),
71  (float)(v[(mi[1]+1)*i+1]*a[3]+v[(mi[1]+1)*i+2]*a[4]+v[(mi[1]+1)*i+3]*a[5]),
72  (float)(v[(mi[1]+1)*i+1]*a[6]+v[(mi[1]+1)*i+2]*a[7]+v[(mi[1]+1)*i+3]*a[8]));
73  }else{
74  iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
75  ifl=(float)v[(mi[1]+1)*i+1]*a[0]+v[(mi[1]+1)*i+2]*a[1]+v[(mi[1]+1)*i+3]*a[2];
76  fwrite(&ifl,sizeof(float),1,f1);
77  ifl=(float)v[(mi[1]+1)*i+1]*a[3]+v[(mi[1]+1)*i+2]*a[4]+v[(mi[1]+1)*i+3]*a[5];
78  fwrite(&ifl,sizeof(float),1,f1);
79  ifl=(float)v[(mi[1]+1)*i+1]*a[6]+v[(mi[1]+1)*i+2]*a[7]+v[(mi[1]+1)*i+3]*a[8];
80  fwrite(&ifl,sizeof(float),1,f1);
81  }
82  }
83  }
84  }
85  }else{
86  nksegment=(*nkcoords)/(*ngraph);
87  for(k=istartset[*iset-1]-1;k<iendset[*iset-1];k++){
88  if(ialset[k]>0){
89  for(l=0;l<*ngraph;l++){
90  i=ialset[k]+l*nksegment-1;
91  if(inum[i]<=0) continue;
92  if((*ntrans==0)||(strcmp1(&filabl[5],"G")==0)||(inotr[2*i]==0)){
93  if(strcmp1(output,"asc")==0){
94  fprintf(f1,"%3s%10" ITGFORMAT "%12.5E%12.5E%12.5E\n",m1,i+1,(float)v[(mi[1]+1)*i+1],
95  (float)v[(mi[1]+1)*i+2],(float)v[(mi[1]+1)*i+3]);
96  }else{
97  iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
98  ifl=(float)v[(mi[1]+1)*i+1];fwrite(&ifl,sizeof(float),1,f1);
99  ifl=(float)v[(mi[1]+1)*i+2];fwrite(&ifl,sizeof(float),1,f1);
100  ifl=(float)v[(mi[1]+1)*i+3];fwrite(&ifl,sizeof(float),1,f1);
101  }
102  }else{
103  FORTRAN(transformatrix,(&trab[7*(inotr[2*i]-1)],&co[3*i],a));
104  if(strcmp1(output,"asc")==0){
105  fprintf(f1,"%3s%10" ITGFORMAT "%12.5E%12.5E%12.5E\n",m1,i+1,
106  (float)(v[(mi[1]+1)*i+1]*a[0]+v[(mi[1]+1)*i+2]*a[1]+v[(mi[1]+1)*i+3]*a[2]),
107  (float)(v[(mi[1]+1)*i+1]*a[3]+v[(mi[1]+1)*i+2]*a[4]+v[(mi[1]+1)*i+3]*a[5]),
108  (float)(v[(mi[1]+1)*i+1]*a[6]+v[(mi[1]+1)*i+2]*a[7]+v[(mi[1]+1)*i+3]*a[8]));
109  }else{
110  iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
111  ifl=(float)v[(mi[1]+1)*i+1]*a[0]+v[(mi[1]+1)*i+2]*a[1]+v[(mi[1]+1)*i+3]*a[2];
112  fwrite(&ifl,sizeof(float),1,f1);
113  ifl=(float)v[(mi[1]+1)*i+1]*a[3]+v[(mi[1]+1)*i+2]*a[4]+v[(mi[1]+1)*i+3]*a[5];
114  fwrite(&ifl,sizeof(float),1,f1);
115  ifl=(float)v[(mi[1]+1)*i+1]*a[6]+v[(mi[1]+1)*i+2]*a[7]+v[(mi[1]+1)*i+3]*a[8];
116  fwrite(&ifl,sizeof(float),1,f1);
117  }
118  }
119  }
120  }else{
121  l=ialset[k-2];
122  do{
123  l-=ialset[k];
124  if(l>=ialset[k-1]) break;
125  for(m=0;m<*ngraph;m++){
126  i=l+m*nksegment-1;
127  if(inum[i]<=0) continue;
128  if((*ntrans==0)||(strcmp1(&filabl[5],"G")==0)||(inotr[2*i]==0)){
129  if(strcmp1(output,"asc")==0){
130  fprintf(f1,"%3s%10" ITGFORMAT "%12.5E%12.5E%12.5E\n",m1,i+1,(float)v[(mi[1]+1)*i+1],
131  (float)v[(mi[1]+1)*i+2],(float)v[(mi[1]+1)*i+3]);
132  }else{
133  iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
134  ifl=(float)v[(mi[1]+1)*i+1];fwrite(&ifl,sizeof(float),1,f1);
135  ifl=(float)v[(mi[1]+1)*i+2];fwrite(&ifl,sizeof(float),1,f1);
136  ifl=(float)v[(mi[1]+1)*i+3];fwrite(&ifl,sizeof(float),1,f1);
137  }
138  }else{
139  FORTRAN(transformatrix,(&trab[7*(inotr[2*i]-1)],&co[3*i],a));
140  if(strcmp1(output,"asc")==0){
141  fprintf(f1,"%3s%10" ITGFORMAT "%12.5E%12.5E%12.5E\n",m1,i+1,
142  (float)(v[(mi[1]+1)*i+1]*a[0]+v[(mi[1]+1)*i+2]*a[1]+
143  v[(mi[1]+1)*i+3]*a[2]),
144  (float)(v[(mi[1]+1)*i+1]*a[3]+v[(mi[1]+1)*i+2]*a[4]+
145  v[(mi[1]+1)*i+3]*a[5]),
146  (float)(v[(mi[1]+1)*i+1]*a[6]+v[(mi[1]+1)*i+2]*a[7]+
147  v[(mi[1]+1)*i+3]*a[8]));
148  }else{
149  iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
150  ifl=(float)v[(mi[1]+1)*i+1]*a[0]+v[(mi[1]+1)*i+2]*a[1]+v[(mi[1]+1)*i+3]*a[2];
151  fwrite(&ifl,sizeof(float),1,f1);
152  ifl=(float)v[(mi[1]+1)*i+1]*a[3]+v[(mi[1]+1)*i+2]*a[4]+v[(mi[1]+1)*i+3]*a[5];
153  fwrite(&ifl,sizeof(float),1,f1);
154  ifl=(float)v[(mi[1]+1)*i+1]*a[6]+v[(mi[1]+1)*i+2]*a[7]+v[(mi[1]+1)*i+3]*a[8];
155  fwrite(&ifl,sizeof(float),1,f1);
156  }
157  }
158  }
159  }while(1);
160  }
161  }
162  }
163 
164  if(strcmp1(output,"asc")==0)fprintf(f1,"%3s\n",m3);
165 
166  return;
167 
168 }
#define ITGFORMAT
Definition: CalculiX.h:52
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
ITG strcmp1(const char *s1, const char *s2)
Definition: strcmp1.c:24
subroutine transformatrix(xab, p, a)
Definition: transformatrix.f:20
static double * f1
Definition: objectivemain_se.c:47
#define ITG
Definition: CalculiX.h:51

◆ getglobalresults()

void getglobalresults ( char *  jobnamec,
ITG **  integerglobp,
double **  doubleglobp,
ITG nboun,
ITG iamboun,
double *  xboun,
ITG nload,
char *  sideload,
ITG iamload,
ITG iglob,
ITG nforc,
ITG iamforc,
double *  xforc,
ITG ithermal,
ITG nk,
double *  t1,
ITG iamt1 
)
34 {
35 
36  char datin[MAX_LINE_LENGTH],text[13]=" ";
37  Summen anz[1];
38  Nodes *node=NULL;
39  Elements *elem=NULL;
40  Datasets *lcase=NULL;
41 
42  ITG *kontet=NULL,*ifatet=NULL,*inodfa=NULL,*ipofa=NULL,type,n1,n2,n3,n4,
43  *nnx=NULL,*nny=NULL,*nnz=NULL,*kon=NULL,*ipkon=NULL,*kontyp=NULL,
44  *iparent=NULL,ifreefa=1,kflag=2,ne,netet,numnodes,nkon,
45  indexe,istep,loadcase,nfaces,netet_,nktet=0,nfield,j,nodes[4],i,
46  read_mode=0,nodenr,*integerglob=NULL,*ielemnr=NULL,istep_global;
47 
48  ITG i1[24]={3,7,8,6,4,3,8,1,3,8,5,6,3,5,8,1,2,3,5,6,2,5,3,1};
49  ITG i2[12]={1,2,3,5,1,5,3,4,4,5,3,6};
50  ITG i4[88]={5,20,17,13,20,8,19,16,19,7,18,15,18,6,17,14,
51  1,9,12,13,12,11,4,16,11,10,3,15,9,2,10,14,
52  9,13,11,12,11,13,16,12,13,17,19,20,13,19,16,20,
53  17,14,19,18,19,14,15,18,9,11,14,10,11,15,14,10,
54  11,19,16,13,11,15,19,14,11,14,19,17,11,19,13,17,
55  11,14,17,9,11,17,13,9};
56  ITG i5[56]={1,7,9,10,7,2,8,11,8,3,9,12,5,13,14,11,
57  13,4,15,10,14,15,6,12,11,12,7,10,7,12,9,10,
58  11,7,12,8,12,7,9,8,13,15,11,10,11,15,12,10,
59  13,11,15,14,15,11,12,14};
60  ITG i6[32]={8,9,10,4,1,5,7,8,7,6,3,10,9,8,10,7,
61  8,9,5,7,9,10,6,7,5,6,7,9,5,2,6,9};
62 
63  double *planfa=NULL,*cotet=NULL,*cgtet=NULL,*field=NULL,
64  *x=NULL,*y=NULL,*z=NULL,*xo=NULL,*yo=NULL,*zo=NULL,
65  *doubleglob=NULL;
66 
67  integerglob=*integerglobp;doubleglob=*doubleglobp;
68 
69  /* The global mesh is remeshed into tetrahedral elements
70 
71  cotet(j,i): j-coordinate of node i of tet mesh
72  iparent(i): parent element from global mesh for tet i
73  kontet(4,i): topology of tet i
74  netet: total # of tets
75  cgtet(3,i): center of gravity of tet i */
76 
77  /* reading the global coordinates and the topology from file
78  (if any, else return) */
79 
80  if(strcmp1(&jobnamec[396]," ")==0)return;
81  strcpy1(datin,&jobnamec[396],132);
82  for(i=0;i<MAX_LINE_LENGTH;i++){
83  if(strcmp1(&datin[i]," ")==0){
84  datin[i]='\0';
85  break;
86  }
87  }
88 
89  /* determining the appropriate step number: scanning the SPC
90  boundary conditions and distribed facial loads
91  if no global data is needed return*/
92 
93  istep=0;
94  for(i=0;i<*nboun;i++){
95  if((xboun[i]<1.9232931375)&&(xboun[i]>1.9232931373)){
96  istep=iamboun[i];
97  break;
98  }
99  }
100  if(istep==0){
101  for(i=0;i<*nforc;i++){
102  if((xforc[i]<1.9232931375)&&(xforc[i]>1.9232931373)){
103  istep=iamforc[i];
104  break;
105  }
106  }
107  }
108  if(istep==0){
109  for(i=0;i<*nload;i++){
110  if(strcmp1(&sideload[20*i+2],"SM")==0){
111  istep=iamload[2*i];
112  break;
113  }
114  }
115  }
116  if((istep==0)&&(*ithermal>0)){
117  for(i=0;i<*nk;i++){
118  if((t1[i]<1.9232931375)&&(t1[i]>1.9232931373)){
119  istep=iamt1[i];
120  break;
121  }
122  }
123  }
124  if(istep==0){
125  return;
126  }else{
127  *iglob=1;
128  }
129 
130  /* initialization of the size of fields used in readfrd.c */
131 
132  anz->orign=0;
133  anz->n=0;
134  anz->e=0;
135  anz->f=0;
136  anz->g=0;
137  anz->t=0;
138  anz->l=0;
139  anz->olc=0;
140  anz->orignmax=0;
141  anz->nmax=0;
142  anz->nmin=MAX_INTEGER;
143  anz->emax=0;
144  anz->emin=MAX_INTEGER;
145  anz->sets=0;
146  anz->mats=0;
147  anz->amps=0;
148  anz->noffs=0;
149  anz->eoffs=0;
150 
151  readfrd( datin, anz, &node, &elem, &lcase, read_mode);
152 
153  /* calculation of the highest node number */
154 
155  nktet=0;
156  for(i=0;i<anz[0].n;i++){
157  if(node[i].nr>nktet) nktet=node[i].nr;
158  }
159  NNEW(cotet,double,3*nktet);
160 
161  /* storing the global coordinates */
162 
163  for (i=0;i<anz[0].n;i++){
164  nodenr=node[i].nr;
165  j=nodenr-1;
166  cotet[3*j]=node[nodenr].nx;
167  cotet[3*j+1]=node[nodenr].ny;
168  cotet[3*j+2]=node[nodenr].nz;
169  }
170 
171  /* number of elements (not highest element number; this number
172  is not needed) */
173 
174  ne=anz[0].e;
175 
176  /* check for the existence of nodes and/or elements */
177 
178  if((anz[0].n==0)||(anz[0].e==0)){
179  printf(" *ERROR in getglobalresults: there are either no nodes or\n no elements or neither nodes nor elements in the master frd-file\n");
180  FORTRAN(stop,());
181  }
182 
183  /* storing the topology */
184 
185  indexe=0;
186  NNEW(ielemnr,ITG,ne);
187  NNEW(kontyp,ITG,ne);
188  NNEW(ipkon,ITG,ne);
189  NNEW(kon,ITG,20*ne);
190  for(i=0;i<anz[0].e;i++){
191  ielemnr[i]=elem[i].nr;
192  kontyp[i]=elem[i].type;
193  ipkon[i]=indexe;
194  if(kontyp[i]==1){
195  numnodes=8;
196  }else if(kontyp[i]==2){
197  numnodes=6;
198  }else if(kontyp[i]==3){
199  numnodes=4;
200  }else if(kontyp[i]==4){
201  numnodes=20;
202  }else if(kontyp[i]==5){
203  numnodes=15;
204  }else if(kontyp[i]==6){
205  numnodes=10;
206  }else{
207  printf("*WARNING in getglobalresults.c: element in global\n");
208  printf(" mesh not recognized; cgx element type=%" ITGFORMAT "\n",kontyp[i]);
209  continue;
210  }
211  for(j=0;j<numnodes;j++){
212  kon[indexe++]=elem[i].nod[j];
213  }
214  }
215  nkon=indexe;
216  RENEW(kon,ITG,nkon);
217 
218  /* generating the tetrahedral elements */
219 
220  netet=0;
221  netet_=22*ne;
222 
223  NNEW(iparent,ITG,netet_);
224  NNEW(kontet,ITG,4*netet_);
225  NNEW(ipofa,ITG,nktet);
226  NNEW(inodfa,ITG,16*netet_);
227  NNEW(ifatet,ITG,4*netet_);
228  NNEW(planfa,double,16*netet_);
229 
230  /* initialization of fields */
231 
232  FORTRAN(init,(&nktet,inodfa,ipofa,&netet_));
233 
234  for(i=0;i<ne;i++){
235  type=kontyp[i];
236  indexe=ipkon[i]-1;
237  if(type==1){
238 
239  /* C3D8* */
240 
241  for(j=0;j<6;j++){
242  nodes[0]=kon[indexe+i1[4*j]];
243  nodes[1]=kon[indexe+i1[4*j+1]];
244  nodes[2]=kon[indexe+i1[4*j+2]];
245  nodes[3]=kon[indexe+i1[4*j+3]];
246  iparent[netet]=i+1;
247  netet++;
248  FORTRAN(generatetet,(kontet,ifatet,&netet,inodfa,
249  &ifreefa,planfa,ipofa,nodes,cotet));
250  }
251  }
252  else if(type==2){
253 
254  /* C3D6 */
255 
256  for(j=0;j<3;j++){
257  nodes[0]=kon[indexe+i2[4*j]];
258  nodes[1]=kon[indexe+i2[4*j+1]];
259  nodes[2]=kon[indexe+i2[4*j+2]];
260  nodes[3]=kon[indexe+i2[4*j+3]];
261  iparent[netet]=i+1;
262  netet++;
263  FORTRAN(generatetet,(kontet,ifatet,&netet,inodfa,
264  &ifreefa,planfa,ipofa,nodes,cotet));
265  }
266  }
267  else if(type==3){
268 
269  /* C3D4 */
270 
271  nodes[0]=kon[indexe+1];
272  nodes[1]=kon[indexe+2];
273  nodes[2]=kon[indexe+3];
274  nodes[3]=kon[indexe+4];
275  iparent[netet]=i+1;
276  netet++;
277  FORTRAN(generatetet,(kontet,ifatet,&netet,inodfa,
278  &ifreefa,planfa,ipofa,nodes,cotet));
279  }
280  else if(type==4){
281 
282  /* C3D20* */
283 
284  for(j=0;j<22;j++){
285  nodes[0]=kon[indexe+i4[4*j]];
286  nodes[1]=kon[indexe+i4[4*j+1]];
287  nodes[2]=kon[indexe+i4[4*j+2]];
288  nodes[3]=kon[indexe+i4[4*j+3]];
289  iparent[netet]=i+1;
290  netet++;
291  FORTRAN(generatetet,(kontet,ifatet,&netet,inodfa,
292  &ifreefa,planfa,ipofa,nodes,cotet));
293  }
294  }
295  else if(type==5){
296 
297  /* C3D15 */
298 
299  for(j=0;j<14;j++){
300  nodes[0]=kon[indexe+i5[4*j]];
301  nodes[1]=kon[indexe+i5[4*j+1]];
302  nodes[2]=kon[indexe+i5[4*j+2]];
303  nodes[3]=kon[indexe+i5[4*j+3]];
304  iparent[netet]=i+1;
305  netet++;
306  FORTRAN(generatetet,(kontet,ifatet,&netet,inodfa,
307  &ifreefa,planfa,ipofa,nodes,cotet));
308  }
309  }
310  else if(type==6){
311 
312  /* C3D10 */
313 
314  for(j=0;j<8;j++){
315  nodes[0]=kon[indexe+i6[4*j]];
316  nodes[1]=kon[indexe+i6[4*j+1]];
317  nodes[2]=kon[indexe+i6[4*j+2]];
318  nodes[3]=kon[indexe+i6[4*j+3]];
319  iparent[netet]=i+1;
320  netet++;
321  FORTRAN(generatetet,(kontet,ifatet,&netet,inodfa,
322  &ifreefa,planfa,ipofa,nodes,cotet));
323  }
324  }
325  }
326  SFREE(ipofa);
327 
328  nfaces=ifreefa-1;
329 
330  RENEW(ifatet,ITG,4*netet);
331  RENEW(iparent,ITG,netet);
332  RENEW(planfa,double,4*nfaces);
333 
334  /* writing the tet mesh in frd format */
335 
336 // FORTRAN(writetetmesh,(kontet,&netet,cotet,&nktet,field,&nfield));
337 
338  /* calculating the center of gravity of the tetrahedra */
339 
340  NNEW(cgtet,double,3*netet);
341  for(i=0;i<netet;i++){
342  n1=kontet[4*i]-1;
343  n2=kontet[4*i+1]-1;
344  n3=kontet[4*i+2]-1;
345  n4=kontet[4*i+3]-1;
346  cgtet[3*i]=(cotet[3*n1]+cotet[3*n2]+cotet[3*n3]+cotet[3*n4])/4.;
347  cgtet[3*i+1]=(cotet[3*n1+1]+cotet[3*n2+1]+cotet[3*n3+1]+cotet[3*n4+1])/4.;
348  cgtet[3*i+2]=(cotet[3*n1+2]+cotet[3*n2+2]+cotet[3*n3+2]+cotet[3*n4+2])/4.;
349  }
350 
351  /* initialization of additional fields */
352 
353  NNEW(x,double,netet);
354  NNEW(y,double,netet);
355  NNEW(z,double,netet);
356  NNEW(xo,double,netet);
357  NNEW(yo,double,netet);
358  NNEW(zo,double,netet);
359  NNEW(nnx,ITG,netet);
360  NNEW(nny,ITG,netet);
361  NNEW(nnz,ITG,netet);
362  for(i=0;i<netet;i++){
363  nnx[i]=i+1;
364  nny[i]=i+1;
365  nnz[i]=i+1;
366  x[i]=cgtet[3*i];
367  y[i]=cgtet[3*i+1];
368  z[i]=cgtet[3*i+2];
369  xo[i]=x[i];
370  yo[i]=y[i];
371  zo[i]=z[i];
372  }
373  FORTRAN(dsort,(x,nnx,&netet,&kflag));
374  FORTRAN(dsort,(y,nny,&netet,&kflag));
375  FORTRAN(dsort,(z,nnz,&netet,&kflag));
376  SFREE(cgtet);
377 
378  /* loading the step data : NDTEMP (1 variable), DISP (3 variables) and
379  STRESS (6 variables), if present */
380 
381  NNEW(field,double,13*nktet);
382 
383  /* reading the temperatures */
384  /* 1. determining the last temperature loadcase in the step */
385 
386  loadcase=-1;
387  for(i=0;i<anz[0].l;i++){
388  for(j=0;j<lcase[i].npheader;j++){
389  if(strcmp1(&lcase[i].pheader[j][5],"PSTEP")==0){
390  strcpy1(text,&lcase[i].pheader[j][48],12);
391  istep_global=atoi(text);
392  break;
393  }
394  }
395  if((istep_global==istep)&&
396  (strcmp1(lcase[i].name,"NDTEMP")==0)){
397  loadcase=i;
398  }else if(istep_global>istep){
399  break;
400  }
401  }
402 
403  /* 2. reading the data */
404 
405  if(loadcase>-1){
406 // if( readfrdblock(loadcase, anz, node, lcase )==-1)
407  if(!read_mode && readfrdblock(loadcase, anz, node, lcase )==-1)
408  {
409  printf("ERROR in getglobalresults: Could not read data for Dataset:%" ITGFORMAT "\n", i+1);
410  FORTRAN(stop,());
411  }
412 
413  /* 3. storing the data */
414 
415  for(i=0;i<anz[0].n;i++){
416  nodenr=node[i].nr;
417  field[13*(nodenr-1)]=lcase[loadcase].dat[0][nodenr];
418  }
419  }else{
420  printf("INFO in getglobalresults: no temperature data\n was found for step %d in the global model\n\n",istep);
421  }
422 
423  /* reading the displacements */
424  /* 1. determining the last displacement loadcase in the step */
425 
426  loadcase=-1;
427  for(i=0;i<anz[0].l;i++){
428  for(j=0;j<lcase[i].npheader;j++){
429  if(strcmp1(&lcase[i].pheader[j][5],"PSTEP")==0){
430  strcpy1(text,&lcase[i].pheader[j][48],12);
431  istep_global=atoi(text);
432  break;
433  }
434  }
435  if((istep_global==istep)&&
436  (strcmp1(lcase[i].name,"DISPR")!=0)&&
437  (strcmp1(lcase[i].name,"DISP")==0)){
438  loadcase=i;
439  }else if(istep_global>istep){
440  break;
441  }
442  }
443 
444  /* 2. reading the data */
445 
446  if(loadcase>-1){
447 // if( readfrdblock(loadcase, anz, node, lcase )==-1)
448  if(!read_mode && readfrdblock(loadcase, anz, node, lcase )==-1)
449  {
450  printf("ERROR in getglobalresults: Could not read data for Dataset:%" ITGFORMAT "\n", i+1);
451  FORTRAN(stop,());
452  }
453 
454  /* 3. storing the data */
455 
456  for(i=0;i<anz[0].n;i++){
457  nodenr=node[i].nr;
458  field[13*(nodenr-1)+1]=lcase[loadcase].dat[0][nodenr];
459  field[13*(nodenr-1)+2]=lcase[loadcase].dat[1][nodenr];
460  field[13*(nodenr-1)+3]=lcase[loadcase].dat[2][nodenr];
461  }
462  }else{
463  printf("INFO in getglobalresults: no displacement data\n was found for step %d in the global model\n\n",istep);
464  }
465 
466  /* reading the stresses */
467  /* 1. determining the last stress loadcase in the step */
468 
469  loadcase=-1;
470  for(i=0;i<anz[0].l;i++){
471  for(j=0;j<lcase[i].npheader;j++){
472  if(strcmp1(&lcase[i].pheader[j][5],"PSTEP")==0){
473  strcpy1(text,&lcase[i].pheader[j][48],12);
474  istep_global=atoi(text);
475  break;
476  }
477  }
478  if((istep_global==istep)&&
479  (strcmp1(lcase[i].name,"STRESS")==0)){
480  loadcase=i;
481  }else if(istep_global>istep){
482  break;
483  }
484  }
485 
486  /* 2. reading the data */
487 
488  if(loadcase>-1){
489 // if( readfrdblock(loadcase, anz, node, lcase )==-1)
490  if(!read_mode && readfrdblock(loadcase, anz, node, lcase )==-1)
491  {
492  printf("ERROR in getglobalresults: Could not read data for Dataset:%" ITGFORMAT "\n", i+1);
493  FORTRAN(stop,());
494  }
495 
496  /* 3. storing the data */
497 
498  for(i=0;i<anz[0].n;i++){
499  nodenr=node[i].nr;
500  field[13*(nodenr-1)+4]=lcase[loadcase].dat[0][nodenr];
501  field[13*(nodenr-1)+5]=lcase[loadcase].dat[1][nodenr];
502  field[13*(nodenr-1)+6]=lcase[loadcase].dat[2][nodenr];
503  field[13*(nodenr-1)+7]=lcase[loadcase].dat[3][nodenr];
504  field[13*(nodenr-1)+8]=lcase[loadcase].dat[4][nodenr];
505  field[13*(nodenr-1)+9]=lcase[loadcase].dat[5][nodenr];
506  }
507  }else{
508  printf("INFO in getglobalresults: no stress data\n was found for step %d in the global model\n\n",istep);
509  }
510 
511  /* reading the forces */
512  /* 1. determining the last force loadcase in the step */
513 
514  loadcase=-1;
515  for(i=0;i<anz[0].l;i++){
516  for(j=0;j<lcase[i].npheader;j++){
517  if(strcmp1(&lcase[i].pheader[j][5],"PSTEP")==0){
518  strcpy1(text,&lcase[i].pheader[j][48],12);
519  istep_global=atoi(text);
520  break;
521  }
522  }
523  if((istep_global==istep)&&
524  (strcmp1(lcase[i].name,"FORC")==0)){
525  loadcase=i;
526  }else if(istep_global>istep){
527  break;
528  }
529  }
530 
531  /* 2. reading the data */
532 
533  if(loadcase>-1){
534  if(!read_mode && readfrdblock(loadcase, anz, node, lcase )==-1)
535  {
536  printf("ERROR in getglobalresults: Could not read data for Dataset:%" ITGFORMAT "\n", i+1);
537  FORTRAN(stop,());
538  }
539 
540  /* 3. storing the data */
541 
542  for(i=0;i<anz[0].n;i++){
543  nodenr=node[i].nr;
544  field[13*(nodenr-1)+10]=lcase[loadcase].dat[0][nodenr];
545  field[13*(nodenr-1)+11]=lcase[loadcase].dat[1][nodenr];
546  field[13*(nodenr-1)+12]=lcase[loadcase].dat[2][nodenr];
547  }
548  }else{
549  printf("INFO in getglobalresults: no force data\n was found for step %d in the global model\n\n",istep);
550  }
551 
552  SFREE(kontet);SFREE(inodfa);
553  SFREE(node);SFREE(elem);
554  for(j=0;j<anz->l;j++){
555  freeDatasets(lcase,j);
556  }
557  SFREE(lcase);lcase=NULL;
558 
559  /* storing the global data in a common block */
560 
561 
562  NNEW(integerglob,ITG,5+3*ne+nkon+8*netet);
563 
564  integerglob[0]=nktet;
565  integerglob[1]=netet;
566  integerglob[2]=ne;
567  integerglob[3]=nkon;
568  integerglob[4]=nfaces;
569  memcpy(&integerglob[5],&nnx[0],sizeof(ITG)*netet);
570  memcpy(&integerglob[netet+5],&nny[0],sizeof(ITG)*netet);
571  memcpy(&integerglob[2*netet+5],&nnz[0],sizeof(ITG)*netet);
572  memcpy(&integerglob[3*netet+5],&ifatet[0],sizeof(ITG)*4*netet);
573  memcpy(&integerglob[7*netet+5],&kontyp[0],sizeof(ITG)*ne);
574  memcpy(&integerglob[ne+7*netet+5],&ipkon[0],sizeof(ITG)*ne);
575  memcpy(&integerglob[2*ne+7*netet+5],&kon[0],sizeof(ITG)*nkon);
576  memcpy(&integerglob[nkon+2*ne+7*netet+5],&iparent[0],sizeof(ITG)*netet);
577  memcpy(&integerglob[nkon+2*ne+8*netet+5],&ielemnr[0],sizeof(ITG)*ne);
578 
579  NNEW(doubleglob,double,16*nktet+4*nfaces+6*netet);
580 
581  memcpy(&doubleglob[0],&x[0],sizeof(double)*netet);
582  memcpy(&doubleglob[netet],&y[0],sizeof(double)*netet);
583  memcpy(&doubleglob[2*netet],&z[0],sizeof(double)*netet);
584  memcpy(&doubleglob[3*netet],&xo[0],sizeof(double)*netet);
585  memcpy(&doubleglob[4*netet],&yo[0],sizeof(double)*netet);
586  memcpy(&doubleglob[5*netet],&zo[0],sizeof(double)*netet);
587  memcpy(&doubleglob[6*netet],&planfa[0],sizeof(double)*4*nfaces);
588  memcpy(&doubleglob[4*nfaces+6*netet],&field[0],sizeof(double)*13*nktet);
589  memcpy(&doubleglob[13*nktet+4*nfaces+6*netet],&cotet[0],sizeof(double)*3*nktet);
590 
591  SFREE(nnx);SFREE(nny);SFREE(nnz);SFREE(ifatet);SFREE(kontyp);SFREE(ipkon);
592  SFREE(kon);SFREE(iparent);SFREE(ielemnr);
593 
594  SFREE(x);SFREE(y);SFREE(z);SFREE(xo);SFREE(yo);SFREE(zo);
595  SFREE(planfa);SFREE(field);SFREE(cotet);
596 
597  *integerglobp=integerglob;*doubleglobp=doubleglob;
598 
599  return;
600 
601 }
int npheader
Definition: readfrd.h:77
#define ITGFORMAT
Definition: CalculiX.h:52
subroutine init(nktet, inodfa, ipofa, netet_)
Definition: init.f:20
void freeDatasets(Datasets *lcase, int nr)
Definition: readfrd.c:46
int nmax
Definition: readfrd.h:32
int emax
Definition: readfrd.h:34
int nmin
Definition: readfrd.h:33
int emin
Definition: readfrd.h:35
int nod[27]
Definition: readfrd.h:71
int n
Definition: readfrd.h:20
#define MAX_LINE_LENGTH
Definition: readfrd.h:10
ITG strcpy1(char *s1, const char *s2, ITG length)
Definition: strcpy1.c:24
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
int g
Definition: readfrd.h:23
ITG strcmp1(const char *s1, const char *s2)
Definition: strcmp1.c:24
int nr
Definition: readfrd.h:45
double nz
Definition: readfrd.h:52
int nr
Definition: readfrd.h:56
subroutine stop()
Definition: stop.f:20
int orignmax
Definition: readfrd.h:36
double ny
Definition: readfrd.h:51
int t
Definition: readfrd.h:24
int noffs
Definition: readfrd.h:39
int eoffs
Definition: readfrd.h:40
int olc
Definition: readfrd.h:38
#define RENEW(a, b, c)
Definition: CalculiX.h:40
int l
Definition: readfrd.h:28
#define SFREE(a)
Definition: CalculiX.h:41
int e
Definition: readfrd.h:21
int readfrd(char *datin, Summen *anz, Nodes **nptr, Elements **eptr, Datasets **lptr, int read_mode)
Definition: readfrd.c:87
#define MAX_INTEGER
Definition: readfrd.h:11
int readfrdblock(int lc, Summen *anz, Nodes *node, Datasets *lcase)
Definition: readfrd.c:1323
Definition: readfrd.h:14
subroutine nodes(inpc, textpart, co, nk, nk_, set, istartset, iendset, ialset, nset, nset_, nalset, nalset_, istep, istat, n, iline, ipol, inl, ipoinp, inp, ipoinpc)
Definition: nodes.f:22
int orign
Definition: readfrd.h:37
int amps
Definition: readfrd.h:27
subroutine dsort(dx, iy, n, kflag)
Definition: dsort.f:6
int mats
Definition: readfrd.h:26
Definition: readfrd.h:44
#define ITG
Definition: CalculiX.h:51
int sets
Definition: readfrd.h:25
Definition: readfrd.h:75
Definition: readfrd.h:55
int f
Definition: readfrd.h:22
#define NNEW(a, b, c)
Definition: CalculiX.h:39
subroutine generatetet(kontet, ifatet, ielement, inodfa, ifreefa, planfa, ipofa, nodes, cotet)
Definition: generatetet.f:21
int type
Definition: readfrd.h:58
double nx
Definition: readfrd.h:50

◆ getSystemCPUs()

ITG getSystemCPUs ( )
40  {
41  return sysconf(_SC_NPROCESSORS_CONF);;
42 }

◆ inicont()

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

◆ insert()

void insert ( ITG ipointer,
ITG **  mast1p,
ITG **  mast2p,
ITG i1,
ITG i2,
ITG ifree,
ITG nzs_ 
)
25  {
26 
27  /* routine for the lower triangular matrix, excluding the diagonal */
28 
29  /* inserts a new nonzero matrix position into the data structure
30  in FORTRAN notation:
31  - ipointer(i) points to a position in field mast1 containing
32  the row number of a nonzero position in column i;
33  next(ipointer(i)) points a position in field mast1 containing
34  the row number of another nonzero position in column i, and
35  so on until no nonzero positions in column i are left; for
36  the position j in field mast1 containing the momentarily last
37  nonzero number in column i we have next(j)=0
38 
39  notice that in C the positions start at 0 and not at 1 as in
40  FORTRAN; the present routine is written in FORTRAN convention */
41 
42  ITG idof1,idof2,istart,*mast1=NULL,*next=NULL;
43 
44  mast1=*mast1p;
45  next=*nextp;
46 
47  if(*i1==*i2) return;
48  if(*i1<*i2){
49  idof1=*i2;
50  idof2=*i1-1;
51  }
52  else{
53  idof1=*i1;
54  idof2=*i2-1;
55  }
56 
57  if(*ifree>=*nzs_){
58  *nzs_=(ITG)(1.1**nzs_);
59  RENEW(mast1,ITG,*nzs_);
60  RENEW(next,ITG,*nzs_);
61  }
62  mast1[*ifree]=idof1;
63  next[*ifree]=ipointer[idof2];
64  ipointer[idof2]=++*ifree;
65 
66  *mast1p=mast1;
67  *nextp=next;
68 
69  return;
70 
71 }
#define RENEW(a, b, c)
Definition: CalculiX.h:40
#define ITG
Definition: CalculiX.h:51

◆ insertfreq()

void insertfreq ( ITG ipointer,
ITG **  mast1p,
ITG **  nextp,
ITG i1,
ITG i2,
ITG ifree,
ITG nzs_ 
)
25  {
26 
27  /* subroutine for the boundary stiffness coefficients */
28 
29  /* inserts a new nonzero matrix position into the data structure
30  in FORTRAN notation:
31  - ipointer(i) points to a position in field mast1 containing
32  the row number of a nonzero position in column i;
33  next(ipointer(i)) points a position in field mast1 containing
34  the row number of another nonzero position in column i, and
35  so on until no nonzero positions in column i are left; for
36  the position j in field mast1 containing the momentarily last
37  nonzero number in column i we have next(j)=0
38 
39  notice that in C the positions start at 0 and not at 1 as in
40  FORTRAN; the present routine is written in FORTRAN convention */
41 
42  ITG idof1,idof2,istart,*mast1=NULL,*next=NULL;
43 
44  mast1=*mast1p;
45  next=*nextp;
46 
47  idof1=*i1;
48  idof2=*i2-1;
49 
50  if(*ifree>=*nzs_){
51  *nzs_=(ITG)(1.1**nzs_);
52  RENEW(mast1,ITG,*nzs_);
53  RENEW(next,ITG,*nzs_);
54  }
55  mast1[*ifree]=idof1;
56  next[*ifree]=ipointer[idof2];
57  ipointer[idof2]=++*ifree;
58 
59  *mast1p=mast1;
60  *nextp=next;
61 
62  return;
63 
64 }
#define RENEW(a, b, c)
Definition: CalculiX.h:40
#define ITG
Definition: CalculiX.h:51

◆ insertrad()

void insertrad ( ITG ipointer,
ITG **  mast1p,
ITG **  mast2p,
ITG i1,
ITG i2,
ITG ifree,
ITG nzs_ 
)
25  {
26 
27  /* inserts a new nonzero matrix position into the data structure
28  in FORTRAN notation:
29  - ipointer(i) points to a position in field irow containing
30  the row number of a nonzero position in column i;
31  next(ipointer(i)) points a position in field irow containing
32  the row number of another nonzero position in column i, and
33  so on until no nonzero positions in column i are left; for
34  the position j in field irow containing the momentarily last
35  nonzero number in column i we have next(j)=0
36 
37  special version of insert.c for the call in mastructrad.c
38 
39  notice that in C the positions start at 0 and not at 1 as in
40  FORTRAN; the present routine is written in FORTRAN convention */
41 
42  ITG *irow=NULL,*next=NULL;
43 
44  irow=*irowp;
45  next=*nextp;
46 
47  ++*ifree;
48  if(*ifree>*nzs_){
49  *nzs_=(ITG)(1.1**nzs_);
50  RENEW(irow,ITG,*nzs_);
51  RENEW(next,ITG,*nzs_);
52  }
53 
54  irow[*ifree-1]=*i2;
55  next[*ifree-1]=ipointer[*i1-1];
56  ipointer[*i1-1]=*ifree;
57 
58  *irowp=irow;
59  *nextp=next;
60 
61  return;
62 
63 }
#define RENEW(a, b, c)
Definition: CalculiX.h:40
#define ITG
Definition: CalculiX.h:51

◆ linstatic()

void linstatic ( double *  co,
ITG nk,
ITG **  konp,
ITG **  ipkonp,
char **  lakonp,
ITG ne,
ITG nodeboun,
ITG ndirboun,
double *  xboun,
ITG nboun,
ITG ipompc,
ITG nodempc,
double *  coefmpc,
char *  labmpc,
ITG nmpc,
ITG nodeforc,
ITG ndirforc,
double *  xforc,
ITG nforc,
ITG nelemload,
char *  sideload,
double *  xload,
ITG nload,
ITG nactdof,
ITG **  icolp,
ITG jq,
ITG **  irowp,
ITG neq,
ITG nzl,
ITG nmethod,
ITG ikmpc,
ITG ilmpc,
ITG ikboun,
ITG ilboun,
double *  elcon,
ITG nelcon,
double *  rhcon,
ITG nrhcon,
double *  alcon,
ITG nalcon,
double *  alzero,
ITG **  ielmatp,
ITG **  ielorienp,
ITG norien,
double *  orab,
ITG ntmat_,
double *  t0,
double *  t1,
double *  t1old,
ITG ithermal,
double *  prestr,
ITG iprestr,
double *  vold,
ITG iperturb,
double *  sti,
ITG nzs,
ITG kode,
char *  filab,
double *  eme,
ITG iexpl,
double *  plicon,
ITG nplicon,
double *  plkcon,
ITG nplkcon,
double **  xstatep,
ITG npmat_,
char *  matname,
ITG isolver,
ITG mi,
ITG ncmat_,
ITG nstate_,
double *  cs,
ITG mcs,
ITG nkon,
double **  enerp,
double *  xbounold,
double *  xforcold,
double *  xloadold,
char *  amname,
double *  amta,
ITG namta,
ITG nam,
ITG iamforc,
ITG iamload,
ITG iamt1,
ITG iamboun,
double *  ttime,
char *  output,
char *  set,
ITG nset,
ITG istartset,
ITG iendset,
ITG ialset,
ITG nprint,
char *  prlab,
char *  prset,
ITG nener,
double *  trab,
ITG inotr,
ITG ntrans,
double *  fmpc,
char *  cbody,
ITG ibody,
double *  xbody,
ITG nbody,
double *  xbodyold,
double *  timepar,
double *  thicke,
char *  jobnamec,
char *  tieset,
ITG ntie,
ITG istep,
ITG nmat,
ITG ielprop,
double *  prop,
char *  typeboun,
ITG mortar,
ITG mpcinfo,
double *  tietol,
ITG ics,
ITG icontact,
char *  orname 
)
70  {
71 
72  char description[13]=" ",*lakon=NULL,stiffmatrix[132]="",
73  fneig[132]="",jobnamef[396]="";
74 
75  ITG *inum=NULL,k,*icol=NULL,*irow=NULL,ielas=0,icmd=0,iinc=1,nasym=0,i,j,ic,ir,
76  mass[2]={0,0}, stiffness=1, buckling=0, rhsi=1, intscheme=0,*ncocon=NULL,
77  *nshcon=NULL,mode=-1,noddiam=-1,*ipobody=NULL,inewton=0,coriolis=0,iout,
78  ifreebody,*itg=NULL,ntg=0,symmetryflag=0,inputformat=0,ngraph=1,im,
79  mt=mi[1]+1,ne0,*integerglob=NULL,iglob=0,*ipneigh=NULL,*neigh=NULL,
80  icfd=0,*inomat=NULL,*islavact=NULL,*islavnode=NULL,*nslavnode=NULL,
81  *islavsurf=NULL,nretain,*iretain=NULL,*noderetain=NULL,*ndirretain=NULL,
82  nmethodl,nintpoint,ifacecount,memmpc_,mpcfree,icascade,maxlenmpc,
83  ncont=0,*itietri=NULL,*koncont=NULL,nslavs=0,ismallsliding=0,
84  *itiefac=NULL,*imastnode=NULL,*nmastnode=NULL,*imastop=NULL,
85  *iponoels=NULL,*inoels=NULL,*ipe=NULL,*ime=NULL,iit=-1,iflagact=0,
86  icutb=0,*kon=NULL,*ipkon=NULL,*ielmat=NULL,ialeatoric=0,kscale=1,
87  *iponoel=NULL,*inoel=NULL,zero=0,nherm=1,nev=*nforc,node,idir,
88  *ielorien=NULL,network=0;
89 
90  double *stn=NULL,*v=NULL,*een=NULL,cam[5],*xstiff=NULL,*stiini=NULL,*tper,
91  *f=NULL,*fn=NULL,qa[4],*fext=NULL,*epn=NULL,*xstateini=NULL,
92  *vini=NULL,*stx=NULL,*enern=NULL,*xbounact=NULL,*xforcact=NULL,
93  *xloadact=NULL,*t1act=NULL,*ampli=NULL,*xstaten=NULL,*eei=NULL,
94  *enerini=NULL,*cocon=NULL,*shcon=NULL,*physcon=NULL,*qfx=NULL,
95  *qfn=NULL,sigma=0.,*cgr=NULL,*xbodyact=NULL,*vr=NULL,*vi=NULL,
96  *stnr=NULL,*stni=NULL,*vmax=NULL,*stnmax=NULL,*springarea=NULL,
97  *eenmax=NULL,*fnr=NULL,*fni=NULL,*emn=NULL,*clearini=NULL,ptime,
98  *emeini=NULL,*doubleglob=NULL,*au=NULL,*ad=NULL,*b=NULL,*aub=NULL,
99  *adb=NULL,*pslavsurf=NULL,*pmastsurf=NULL,*cdn=NULL,*cdnr=NULL,
100  *cdni=NULL,*submatrix=NULL,*xnoels=NULL,*cg=NULL,*straight=NULL,
101  *areaslav=NULL,*xmastnor=NULL,theta=0.,*ener=NULL,*xstate=NULL,
102  *fnext=NULL,*energyini=NULL,*energy=NULL,*d=NULL;
103 
104  FILE *f1,*f2;
105 
106 #ifdef SGI
107  ITG token;
108 #endif
109 
110  /* dummy arguments for the results call */
111 
112  double *veold=NULL,*accold=NULL,bet,gam,dtime,time,reltime=1.;
113 
114  irow=*irowp;ener=*enerp;xstate=*xstatep;ipkon=*ipkonp;lakon=*lakonp;
115  kon=*konp;ielmat=*ielmatp;ielorien=*ielorienp;icol=*icolp;
116 
117  for(k=0;k<3;k++){
118  strcpy1(&jobnamef[k*132],&jobnamec[k*132],132);
119  }
120 
121  tper=&timepar[1];
122 
123  time=*tper;
124  dtime=*tper;
125 
126  ne0=*ne;
127 
128  /* determining the global values to be used as boundary conditions
129  for a submodel */
130 
131  getglobalresults(jobnamec,&integerglob,&doubleglob,nboun,iamboun,xboun,
132  nload,sideload,iamload,&iglob,nforc,iamforc,xforc,
133  ithermal,nk,t1,iamt1);
134 
135  /* allocating fields for the actual external loading */
136 
137  NNEW(xbounact,double,*nboun);
138  for(k=0;k<*nboun;++k){xbounact[k]=xbounold[k];}
139  NNEW(xforcact,double,*nforc);
140  NNEW(xloadact,double,2**nload);
141  NNEW(xbodyact,double,7**nbody);
142  /* copying the rotation axis and/or acceleration vector */
143  for(k=0;k<7**nbody;k++){xbodyact[k]=xbody[k];}
144  if(*ithermal==1){
145  NNEW(t1act,double,*nk);
146  for(k=0;k<*nk;++k){t1act[k]=t1old[k];}
147  }
148 
149  /* assigning the body forces to the elements */
150 
151  if(*nbody>0){
152  ifreebody=*ne+1;
153  NNEW(ipobody,ITG,2*ifreebody**nbody);
154  for(k=1;k<=*nbody;k++){
155  FORTRAN(bodyforce,(cbody,ibody,ipobody,nbody,set,istartset,
156  iendset,ialset,&inewton,nset,&ifreebody,&k));
157  RENEW(ipobody,ITG,2*(*ne+ifreebody));
158  }
159  RENEW(ipobody,ITG,2*(ifreebody-1));
160  }
161 
162  /* contact conditions */
163 
164  if(*icontact==1){
165 
166  memmpc_=mpcinfo[0];mpcfree=mpcinfo[1];icascade=mpcinfo[2];
167  maxlenmpc=mpcinfo[3];
168 
169  inicont(nk,&ncont,ntie,tieset,nset,set,istartset,iendset,ialset,&itietri,
170  lakon,ipkon,kon,&koncont,&nslavs,tietol,&ismallsliding,&itiefac,
171  &islavsurf,&islavnode,&imastnode,&nslavnode,&nmastnode,
172  mortar,&imastop,nkon,&iponoels,&inoels,&ipe,&ime,ne,&ifacecount,
173  iperturb,ikboun,nboun,co,istep,&xnoels);
174 
175  if(ncont!=0){
176 
177  NNEW(cg,double,3*ncont);
178  NNEW(straight,double,16*ncont);
179 
180  /* 11 instead of 10: last position is reserved for the
181  local contact spring element number; needed as
182  pointer into springarea */
183 
184  if(*mortar==0){
185  RENEW(kon,ITG,*nkon+11*nslavs);
186  NNEW(springarea,double,2*nslavs);
187  if(*nener==1){
188  RENEW(ener,double,mi[0]*(*ne+nslavs)*2);
189  }
190  RENEW(ipkon,ITG,*ne+nslavs);
191  RENEW(lakon,char,8*(*ne+nslavs));
192 
193  if(*norien>0){
194  RENEW(ielorien,ITG,mi[2]*(*ne+nslavs));
195  for(k=mi[2]**ne;k<mi[2]*(*ne+nslavs);k++) ielorien[k]=0;
196  }
197 
198  RENEW(ielmat,ITG,mi[2]*(*ne+nslavs));
199  for(k=mi[2]**ne;k<mi[2]*(*ne+nslavs);k++) ielmat[k]=1;
200 
201  if(nslavs!=0){
202  RENEW(xstate,double,*nstate_*mi[0]*(*ne+nslavs));
203  for(k=*nstate_*mi[0]**ne;k<*nstate_*mi[0]*(*ne+nslavs);k++){
204  xstate[k]=0.;
205  }
206  }
207 
208  NNEW(areaslav,double,ifacecount);
209  NNEW(xmastnor,double,3*nmastnode[*ntie]);
210  }else if(*mortar==1){
211  NNEW(islavact,ITG,nslavnode[*ntie]);
212  DMEMSET(islavact,0,nslavnode[*ntie],1);
213  NNEW(clearini,double,3*9*ifacecount);
214  NNEW(xmastnor,double,3*nmastnode[*ntie]);
215 
216 
217  nintpoint=0;
218 
219  precontact(&ncont,ntie,tieset,nset,set,istartset,
220  iendset,ialset,itietri,lakon,ipkon,kon,koncont,ne,
221  cg,straight,co,vold,istep,&iinc,&iit,itiefac,
222  islavsurf,islavnode,imastnode,nslavnode,nmastnode,
223  imastop,mi,ipe,ime,tietol,&iflagact,
224  &nintpoint,&pslavsurf,xmastnor,cs,mcs,ics,clearini,
225  &nslavs);
226 
227  /* changing the dimension of element-related fields */
228 
229  RENEW(kon,ITG,*nkon+22*nintpoint);
230  RENEW(springarea,double,2*nintpoint);
231  RENEW(pmastsurf,double,6*nintpoint);
232 
233  if(*nener==1){
234  RENEW(ener,double,mi[0]*(*ne+nintpoint)*2);
235  }
236  RENEW(ipkon,ITG,*ne+nintpoint);
237  RENEW(lakon,char,8*(*ne+nintpoint));
238 
239  if(*norien>0){
240  RENEW(ielorien,ITG,mi[2]*(*ne+nintpoint));
241  for(k=mi[2]**ne;k<mi[2]*(*ne+nintpoint);k++) ielorien[k]=0;
242  }
243  RENEW(ielmat,ITG,mi[2]*(*ne+nintpoint));
244  for(k=mi[2]**ne;k<mi[2]*(*ne+nintpoint);k++) ielmat[k]=1;
245 
246  /* interpolating the state variables */
247 
248  if(*nstate_!=0){
249 
250  RENEW(xstate,double,*nstate_*mi[0]*(ne0+nintpoint));
251  for(k=*nstate_*mi[0]*ne0;k<*nstate_*mi[0]*(ne0+nintpoint);k++){
252  xstate[k]=0.;
253  }
254 
255  RENEW(xstateini,double,*nstate_*mi[0]*(ne0+nintpoint));
256  for(k=0;k<*nstate_*mi[0]*(ne0+nintpoint);++k){
257  xstateini[k]=xstate[k];
258  }
259  }
260  }
261 
262  /* generating contact spring elements */
263 
264  contact(&ncont,ntie,tieset,nset,set,istartset,iendset,
265  ialset,itietri,lakon,ipkon,kon,koncont,ne,cg,straight,nkon,
266  co,vold,ielmat,cs,elcon,istep,&iinc,&iit,ncmat_,ntmat_,
267  &ne0,vini,nmethod,
268  iperturb,ikboun,nboun,mi,imastop,nslavnode,islavnode,islavsurf,
269  itiefac,areaslav,iponoels,inoels,springarea,tietol,&reltime,
270  imastnode,nmastnode,xmastnor,filab,mcs,ics,&nasym,
271  xnoels,mortar,pslavsurf,pmastsurf,clearini,&theta,
272  xstateini,xstate,nstate_,&icutb,&ialeatoric,jobnamef);
273 
274  printf("number of contact spring elements=%" ITGFORMAT "\n\n",*ne-ne0);
275 
276  /* determining the structure of the stiffness/mass matrix */
277 
278  remastructar(ipompc,&coefmpc,&nodempc,nmpc,
279  &mpcfree,nodeboun,ndirboun,nboun,ikmpc,ilmpc,ikboun,ilboun,
280  labmpc,nk,&memmpc_,&icascade,&maxlenmpc,
281  kon,ipkon,lakon,ne,nactdof,icol,jq,&irow,isolver,
282  neq,nzs,nmethod,ithermal,iperturb,mass,mi,ics,cs,
283  mcs,mortar,typeboun,&iit,&network);
284  }
285 
286  /* field for initial values of state variables (needed for contact */
287 
288  if((*nstate_!=0)&&((*mortar==0)||(ncont==0))){
289  NNEW(xstateini,double,*nstate_*mi[0]*(ne0+nslavs));
290  for(k=0;k<*nstate_*mi[0]*(ne0+nslavs);++k){
291  xstateini[k]=xstate[k];
292  }
293  }
294  }
295 
296  /* allocating a field for the instantaneous amplitude */
297 
298  NNEW(ampli,double,*nam);
299 
300  FORTRAN(tempload,(xforcold,xforc,xforcact,iamforc,nforc,xloadold,xload,
301  xloadact,iamload,nload,ibody,xbody,nbody,xbodyold,xbodyact,
302  t1old,t1,t1act,iamt1,nk,amta,
303  namta,nam,ampli,&time,&reltime,ttime,&dtime,ithermal,nmethod,
304  xbounold,xboun,xbounact,iamboun,nboun,
305  nodeboun,ndirboun,nodeforc,ndirforc,istep,&iinc,
306  co,vold,itg,&ntg,amname,ikboun,ilboun,nelemload,sideload,mi,
307  ntrans,trab,inotr,veold,integerglob,doubleglob,tieset,istartset,
308  iendset,ialset,ntie,nmpc,ipompc,ikmpc,ilmpc,nodempc,coefmpc,
309  ipobody,iponoel,inoel));
310 
311  /* determining the internal forces and the stiffness coefficients */
312 
313  NNEW(f,double,*neq);
314 
315  /* allocating a field for the stiffness matrix */
316 
317  NNEW(xstiff,double,(long long)27*mi[0]**ne);
318 
319  iout=-1;
320  NNEW(v,double,mt**nk);
321  NNEW(fn,double,mt**nk);
322  NNEW(stx,double,6*mi[0]**ne);
323  NNEW(inum,ITG,*nk);
324  results(co,nk,kon,ipkon,lakon,ne,v,stn,inum,stx,
325  elcon,nelcon,rhcon,nrhcon,alcon,nalcon,alzero,ielmat,
326  ielorien,norien,orab,ntmat_,t0,t1act,ithermal,
327  prestr,iprestr,filab,eme,emn,een,iperturb,
328  f,fn,nactdof,&iout,qa,vold,b,nodeboun,
329  ndirboun,xbounact,nboun,ipompc,
330  nodempc,coefmpc,labmpc,nmpc,nmethod,cam,neq,veold,accold,
331  &bet,&gam,&dtime,&time,ttime,plicon,nplicon,plkcon,nplkcon,
332  xstateini,xstiff,xstate,npmat_,epn,matname,mi,&ielas,
333  &icmd,ncmat_,nstate_,stiini,vini,ikboun,ilboun,ener,enern,
334  emeini,xstaten,eei,enerini,cocon,ncocon,set,nset,istartset,
335  iendset,ialset,nprint,prlab,prset,qfx,qfn,trab,inotr,ntrans,
336  fmpc,nelemload,nload,ikmpc,ilmpc,istep,&iinc,springarea,
337  &reltime,&ne0,xforc,nforc,thicke,shcon,nshcon,
338  sideload,xloadact,xloadold,&icfd,inomat,pslavsurf,pmastsurf,
339  mortar,islavact,cdn,islavnode,nslavnode,ntie,clearini,
340  islavsurf,ielprop,prop,energyini,energy,&kscale,iponoel,
341  inoel,nener,orname,&network,ipobody,xbodyact,ibody);
342  SFREE(v);SFREE(fn);SFREE(stx);SFREE(inum);
343  iout=1;
344 
345  /* determining the system matrix and the external forces */
346 
347  NNEW(ad,double,*neq);
348  NNEW(fext,double,*neq);
349 
350  if(*nmethod==11){
351 
352  /* determining the nodes and the degrees of freedom in those nodes
353  belonging to the substructure */
354 
355  NNEW(iretain,ITG,*nk);
356  NNEW(noderetain,ITG,*nk);
357  NNEW(ndirretain,ITG,*nk);
358  nretain=0;
359 
360  for(i=0;i<*nboun;i++){
361  if(strcmp1(&typeboun[i],"C")==0){
362  iretain[nretain]=i+1;
363  noderetain[nretain]=nodeboun[i];
364  ndirretain[nretain]=ndirboun[i];
365  nretain++;
366  }
367  }
368 
369  /* nretain!=0: submatrix application
370  nretain==0: Green function application */
371 
372  if(nretain>0){
373  RENEW(iretain,ITG,nretain);
374  RENEW(noderetain,ITG,nretain);
375  RENEW(ndirretain,ITG,nretain);
376  }else{
377  SFREE(iretain);SFREE(noderetain);SFREE(ndirretain);
378  }
379 
380  /* creating the right size au */
381 
382  NNEW(au,double,nzs[2]);
383  rhsi=0;
384  nmethodl=2;
385 
386  /* providing for the mass matrix in case of Green functions */
387 
388  if(nretain==0){
389  mass[0]=1.;
390  NNEW(adb,double,*neq);
391  NNEW(aub,double,nzs[1]);
392  }
393 
394  }else{
395  NNEW(au,double,*nzs);
396  nmethodl=*nmethod;
397  }
398 
399  mafillsmmain(co,nk,kon,ipkon,lakon,ne,nodeboun,ndirboun,xbounact,nboun,
400  ipompc,nodempc,coefmpc,nmpc,nodeforc,ndirforc,xforcact,
401  nforc,nelemload,sideload,xloadact,nload,xbodyact,ipobody,
402  nbody,cgr,ad,au,fext,nactdof,icol,jq,irow,neq,nzl,&nmethodl,
403  ikmpc,ilmpc,ikboun,ilboun,
404  elcon,nelcon,rhcon,nrhcon,alcon,nalcon,alzero,ielmat,
405  ielorien,norien,orab,ntmat_,
406  t0,t1act,ithermal,prestr,iprestr,vold,iperturb,sti,
407  nzs,stx,adb,aub,iexpl,plicon,nplicon,plkcon,nplkcon,
408  xstiff,npmat_,&dtime,matname,mi,
409  ncmat_,mass,&stiffness,&buckling,&rhsi,&intscheme,physcon,
410  shcon,nshcon,cocon,ncocon,ttime,&time,istep,&iinc,&coriolis,
411  ibody,xloadold,&reltime,veold,springarea,nstate_,
412  xstateini,xstate,thicke,integerglob,doubleglob,
413  tieset,istartset,iendset,ialset,ntie,&nasym,pslavsurf,
414  pmastsurf,mortar,clearini,ielprop,prop,&ne0,fnext,&kscale,
415  iponoel,inoel,&network);
416 
417  if(nasym==1){
418  RENEW(au,double,2*nzs[1]);
419  symmetryflag=2;
420  inputformat=1;
421 
422  FORTRAN(mafillsmas,(co,nk,kon,ipkon,lakon,ne,nodeboun,
423  ndirboun,xbounact,nboun,
424  ipompc,nodempc,coefmpc,nmpc,nodeforc,ndirforc,xforcact,
425  nforc,nelemload,sideload,xloadact,nload,xbodyact,ipobody,
426  nbody,cgr,ad,au,fext,nactdof,icol,jq,irow,neq,nzl,
427  nmethod,ikmpc,ilmpc,ikboun,ilboun,
428  elcon,nelcon,rhcon,nrhcon,alcon,nalcon,alzero,
429  ielmat,ielorien,norien,orab,ntmat_,
430  t0,t1act,ithermal,prestr,iprestr,vold,iperturb,sti,
431  nzs,stx,adb,aub,iexpl,plicon,nplicon,plkcon,nplkcon,
432  xstiff,npmat_,&dtime,matname,mi,
433  ncmat_,mass,&stiffness,&buckling,&rhsi,&intscheme,
434  physcon,shcon,nshcon,cocon,ncocon,ttime,&time,istep,&iinc,
435  &coriolis,ibody,xloadold,&reltime,veold,springarea,nstate_,
436  xstateini,xstate,thicke,
437  integerglob,doubleglob,tieset,istartset,iendset,
438  ialset,ntie,&nasym,pslavsurf,pmastsurf,mortar,clearini,
439  ielprop,prop,&ne0,&kscale,iponoel,inoel,&network));
440  }
441 
442  /* determining the right hand side */
443 
444  NNEW(b,double,*neq);
445  for(k=0;k<*neq;++k){
446  b[k]=fext[k]-f[k];
447  }
448  SFREE(fext);SFREE(f);
449 
450  /* generation of a substructure stiffness matrix */
451 
452  if(*nmethod==11){
453 
454  /* recovering omega_0^2 for Green applications */
455 
456  if(nretain==0){
457  if(*nforc>0){sigma=xforc[0];}
458  }
459 
460  /* factorizing the matrix */
461 
462  if(*neq>0){
463  if(*isolver==0){
464 #ifdef SPOOLES
465  spooles_factor(ad,au,adb,aub,&sigma,icol,irow,neq,nzs,&symmetryflag,
466  &inputformat,&nzs[2]);
467 #else
468  printf("*ERROR in linstatic: the SPOOLES library is not linked\n\n");
469  FORTRAN(stop,());
470 #endif
471  }
472  else if(*isolver==7){
473 #ifdef PARDISO
474  pardiso_factor(ad,au,adb,aub,&sigma,icol,irow,neq,nzs,
475  &symmetryflag,&inputformat,jq,&nzs[2]);
476 #else
477  printf("*ERROR in linstatic: the PARDISO library is not linked\n\n");
478  FORTRAN(stop,());
479 #endif
480  }
481  }
482 
483  /* solving the system of equations with appropriate rhs */
484 
485  if(nretain>0){
486 
487  NNEW(submatrix,double,nretain*nretain);
488 
489  for(i=0;i<nretain;i++){
490  DMEMSET(b,0,*neq,0.);
491  ic=*neq+iretain[i]-1;
492  for(j=jq[ic]-1;j<jq[ic+1]-1;j++){
493  ir=irow[j]-1;
494  b[ir]-=au[j];
495  }
496 
497  /* solving the system */
498 
499  if(*neq>0){
500  if(*isolver==0){
501 #ifdef SPOOLES
502  spooles_solve(b,neq);
503 #endif
504  }
505  else if(*isolver==7){
506 #ifdef PARDISO
507  pardiso_solve(b,neq,&symmetryflag);
508 #endif
509 
510  }
511  }
512 
513  /* calculating the internal forces */
514 
515  NNEW(v,double,mt**nk);
516  NNEW(fn,double,mt**nk);
517  NNEW(stn,double,6**nk);
518  NNEW(inum,ITG,*nk);
519  NNEW(stx,double,6*mi[0]**ne);
520 
521  if(strcmp1(&filab[261],"E ")==0) NNEW(een,double,6**nk);
522  if(strcmp1(&filab[2697],"ME ")==0) NNEW(emn,double,6**nk);
523  if(strcmp1(&filab[522],"ENER")==0) NNEW(enern,double,*nk);
524 
525  NNEW(eei,double,6*mi[0]**ne);
526  if(*nener==1){
527  NNEW(stiini,double,6*mi[0]**ne);
528  NNEW(emeini,double,6*mi[0]**ne);
529  NNEW(enerini,double,mi[0]**ne);}
530 
531  /* replacing the appropriate boundary value by unity */
532 
533  xbounact[iretain[i]-1]=1.;
534 
535  results(co,nk,kon,ipkon,lakon,ne,v,stn,inum,stx,
536  elcon,nelcon,rhcon,nrhcon,alcon,nalcon,alzero,ielmat,
537  ielorien,norien,orab,ntmat_,t0,t1act,ithermal,
538  prestr,iprestr,filab,eme,emn,een,iperturb,
539  f,fn,nactdof,&iout,qa,vold,b,nodeboun,ndirboun,
540  xbounact,nboun,ipompc,
541  nodempc,coefmpc,labmpc,nmpc,nmethod,cam,neq,veold,
542  accold,&bet,
543  &gam,&dtime,&time,ttime,plicon,nplicon,plkcon,nplkcon,
544  xstateini,xstiff,xstate,npmat_,epn,matname,mi,&ielas,&icmd,
545  ncmat_,nstate_,stiini,vini,ikboun,ilboun,ener,enern,emeini,
546  xstaten,eei,enerini,cocon,ncocon,set,nset,istartset,iendset,
547  ialset,nprint,prlab,prset,qfx,qfn,trab,inotr,ntrans,fmpc,
548  nelemload,nload,ikmpc,ilmpc,istep,&iinc,springarea,&reltime,
549  &ne0,xforc,nforc,thicke,shcon,nshcon,
550  sideload,xloadact,xloadold,&icfd,inomat,pslavsurf,pmastsurf,
551  mortar,islavact,cdn,islavnode,nslavnode,ntie,clearini,
552  islavsurf,ielprop,prop,energyini,energy,&kscale,iponoel,
553  inoel,nener,orname,&network,ipobody,xbodyact,ibody);
554 
555  xbounact[iretain[i]-1]=0.;
556 
557  SFREE(v);SFREE(stn);SFREE(inum);SFREE(stx);
558 
559  if(strcmp1(&filab[261],"E ")==0) SFREE(een);
560  if(strcmp1(&filab[2697],"ME ")==0) SFREE(emn);
561  if(strcmp1(&filab[522],"ENER")==0) SFREE(enern);
562 
563  SFREE(eei);if(*nener==1){SFREE(stiini);SFREE(emeini);SFREE(enerini);}
564 
565  /* storing the internal forces in the substructure
566  stiffness matrix */
567 
568  for(j=0;j<nretain;j++){
569  submatrix[i*nretain+j]=fn[mt*(noderetain[j]-1)+ndirretain[j]];
570  }
571 
572  SFREE(fn);
573 
574  }
575  SFREE(iretain);
576 
577  FORTRAN(writesubmatrix,(submatrix,noderetain,ndirretain,&nretain,jobnamec));
578 
579  SFREE(submatrix);SFREE(noderetain);SFREE(ndirretain);
580 
581  }else{
582 
583  /* Green function applications */
584 
585  /* storing omega_0^2 into d */
586 
587  NNEW(d,double,*nforc);
588  for(i=0;i<*nforc;i++){d[i]=xforc[0];}
589 
590  strcpy(fneig,jobnamec);
591  strcat(fneig,".eig");
592 
593  if((f2=fopen(fneig,"wb"))==NULL){
594  printf("*ERROR in arpack: cannot open eigenvalue file for writing...");
595 
596  exit(0);
597  }
598 
599  /* storing a zero as indication that this was not a
600  cyclic symmetry calculation */
601 
602  if(fwrite(&zero,sizeof(ITG),1,f2)!=1){
603  printf("*ERROR saving the cyclic symmetry flag to the eigenvalue file...");
604  exit(0);
605  }
606 
607  /* Hermitian */
608 
609  if(fwrite(&nherm,sizeof(ITG),1,f2)!=1){
610  printf("*ERROR saving the Hermitian flag to the eigenvalue file...");
611  exit(0);
612  }
613 
614  /* storing the number of eigenvalues */
615 
616  if(fwrite(&nev,sizeof(ITG),1,f2)!=1){
617  printf("*ERROR saving the number of eigenvalues to the eigenvalue file...");
618  exit(0);
619  }
620 
621  /* the eigenfrequencies are stores as radians/time */
622 
623  if(fwrite(d,sizeof(double),nev,f2)!=nev){
624  printf("*ERROR saving the eigenfrequencies to the eigenvalue file...");
625  exit(0);
626  }
627 
628  /* storing the stiffness matrix */
629 
630  if(fwrite(ad,sizeof(double),neq[1],f2)!=neq[1]){
631  printf("*ERROR saving the diagonal of the stiffness matrix to the eigenvalue file...");
632  exit(0);
633  }
634  if(fwrite(au,sizeof(double),nzs[2],f2)!=nzs[2]){
635  printf("*ERROR saving the off-diagonal terms of the stiffness matrix to the eigenvalue file...");
636  exit(0);
637  }
638 
639  /* storing the mass matrix */
640 
641  if(fwrite(adb,sizeof(double),neq[1],f2)!=neq[1]){
642  printf("*ERROR saving the diagonal of the mass matrix to the eigenvalue file...");
643  exit(0);
644  }
645  if(fwrite(aub,sizeof(double),nzs[1],f2)!=nzs[1]){
646  printf("*ERROR saving the off-diagonal terms of the mass matrix to the eigenvalue file...");
647  exit(0);
648  }
649 
650  SFREE(d);
651 
652  /* calculating each Green function */
653 
654  for(i=0;i<*nforc;i++){
655  node=nodeforc[2*i];
656  idir=ndirforc[i];
657 
658  /* check whether degree of freedom is active */
659 
660  if(nactdof[mt*(node-1)+idir]==0){
661  printf("*ERROR in linstatic: degree of freedom corresponding to node %d \n and direction %d is not active: no unit force can be applied\n",node,idir);
662  FORTRAN(stop,());
663  }
664 
665  /* defining a unit force on the rhs */
666 
667  DMEMSET(b,0,*neq,0.);
668  b[nactdof[mt*(node-1)+idir]-1]=1.;
669 
670  /* solving the system */
671 
672  if(*neq>0){
673  if(*isolver==0){
674 #ifdef SPOOLES
675  spooles_solve(b,neq);
676 #endif
677  }
678  else if(*isolver==7){
679 #ifdef PARDISO
680  pardiso_solve(b,neq,&symmetryflag);
681 #endif
682 
683  }
684  }
685 
686  /* storing the Green function */
687 
688  if(fwrite(b,sizeof(double),*neq,f2)!=*neq){
689  printf("*ERROR saving data to the eigenvalue file...");
690  exit(0);
691  }
692 
693  /* calculating the displacements and the stresses and storing */
694  /* the results in frd format for each valid eigenmode */
695 
696  NNEW(v,double,mt**nk);
697  NNEW(fn,double,mt**nk);
698  NNEW(stn,double,6**nk);
699  NNEW(inum,ITG,*nk);
700  NNEW(stx,double,6*mi[0]**ne);
701 
702  if(strcmp1(&filab[261],"E ")==0) NNEW(een,double,6**nk);
703  if(strcmp1(&filab[2697],"ME ")==0) NNEW(emn,double,6**nk);
704  if(strcmp1(&filab[522],"ENER")==0) NNEW(enern,double,*nk);
705  if(strcmp1(&filab[2175],"CONT")==0) NNEW(cdn,double,6**nk);
706 
707  NNEW(eei,double,6*mi[0]**ne);
708  if(*nener==1){
709  NNEW(stiini,double,6*mi[0]**ne);
710  NNEW(emeini,double,6*mi[0]**ne);
711  NNEW(enerini,double,mi[0]**ne);}
712 
713  results(co,nk,kon,ipkon,lakon,ne,v,stn,inum,stx,
714  elcon,nelcon,rhcon,nrhcon,alcon,nalcon,alzero,ielmat,
715  ielorien,norien,orab,ntmat_,t0,t1act,ithermal,
716  prestr,iprestr,filab,eme,emn,een,iperturb,
717  f,fn,nactdof,&iout,qa,vold,b,nodeboun,ndirboun,
718  xbounact,nboun,ipompc,
719  nodempc,coefmpc,labmpc,nmpc,nmethod,cam,neq,veold,
720  accold,&bet,
721  &gam,&dtime,&time,ttime,plicon,nplicon,plkcon,nplkcon,
722  xstateini,xstiff,xstate,npmat_,epn,matname,mi,&ielas,&icmd,
723  ncmat_,nstate_,stiini,vini,ikboun,ilboun,ener,enern,emeini,
724  xstaten,eei,enerini,cocon,ncocon,set,nset,istartset,iendset,
725  ialset,nprint,prlab,prset,qfx,qfn,trab,inotr,ntrans,fmpc,
726  nelemload,nload,ikmpc,ilmpc,istep,&iinc,springarea,&reltime,
727  &ne0,xforc,nforc,thicke,shcon,nshcon,
728  sideload,xloadact,xloadold,&icfd,inomat,pslavsurf,pmastsurf,
729  mortar,islavact,cdn,islavnode,nslavnode,ntie,clearini,
730  islavsurf,ielprop,prop,energyini,energy,&kscale,iponoel,
731  inoel,nener,orname,&network,ipobody,xbodyact,ibody);
732 
733  SFREE(eei);
734  if(*nener==1){
735  SFREE(stiini);SFREE(emeini);SFREE(enerini);}
736 
737  memcpy(&vold[0],&v[0],sizeof(double)*mt**nk);
738  memcpy(&sti[0],&stx[0],sizeof(double)*6*mi[0]*ne0);
739 
740  ++*kode;
741  time=1.*i;
742 
743  /* for cyclic symmetric sectors: duplicating the results */
744 
745  if(*mcs>0){
746  ptime=*ttime+time;
747  frdcyc(co,nk,kon,ipkon,lakon,ne,v,stn,inum,nmethod,kode,filab,een,t1act,
748  fn,&ptime,epn,ielmat,matname,cs,mcs,nkon,enern,xstaten,
749  nstate_,istep,&iinc,iperturb,ener,mi,output,ithermal,
750  qfn,ialset,istartset,iendset,trab,inotr,ntrans,orab,
751  ielorien,norien,sti,veold,&noddiam,set,nset,emn,thicke,
752  jobnamec,&ne0,cdn,mortar,nmat,qfx);
753  }
754  else{
755  if(strcmp1(&filab[1044],"ZZS")==0){
756  NNEW(neigh,ITG,40**ne);
757  NNEW(ipneigh,ITG,*nk);
758  }
759  ptime=*ttime+time;
760  frd(co,nk,kon,ipkon,lakon,ne,v,stn,inum,nmethod,
761  kode,filab,een,t1act,fn,&ptime,epn,ielmat,matname,enern,xstaten,
762  nstate_,istep,&iinc,ithermal,qfn,&mode,&noddiam,trab,inotr,
763  ntrans,orab,ielorien,norien,description,ipneigh,neigh,
764  mi,stx,vr,vi,stnr,stni,vmax,stnmax,&ngraph,veold,ener,ne,
765  cs,set,nset,istartset,iendset,ialset,eenmax,fnr,fni,emn,
766  thicke,jobnamec,output,qfx,cdn,mortar,cdnr,cdni,nmat);
767  if(strcmp1(&filab[1044],"ZZS")==0){SFREE(ipneigh);SFREE(neigh);}
768  }
769 
770  SFREE(v);SFREE(stn);SFREE(inum);
771  SFREE(stx);SFREE(fn);
772 
773  if(strcmp1(&filab[261],"E ")==0) SFREE(een);
774  if(strcmp1(&filab[2697],"ME ")==0) SFREE(emn);
775  if(strcmp1(&filab[522],"ENER")==0) SFREE(enern);
776  if(strcmp1(&filab[2175],"CONT")==0) SFREE(cdn);
777 
778  }
779 
780  fclose(f2);
781 
782  }
783 
784  SFREE(au);SFREE(ad);SFREE(b);
785 
786  SFREE(xbounact);SFREE(xforcact);SFREE(xloadact);SFREE(t1act);SFREE(ampli);
787  SFREE(xbodyact);if(*nbody>0) SFREE(ipobody);SFREE(xstiff);
788 
789  if(iglob==1){SFREE(integerglob);SFREE(doubleglob);}
790 
791  return;
792 
793 
794  }else if(*nmethod!=0){
795 
796  /* linear static applications */
797 
798  if(*isolver==0){
799 #ifdef SPOOLES
800  spooles(ad,au,adb,aub,&sigma,b,icol,irow,neq,nzs,&symmetryflag,
801  &inputformat,&nzs[2]);
802 #else
803  printf("*ERROR in linstatic: the SPOOLES library is not linked\n\n");
804  FORTRAN(stop,());
805 #endif
806  }
807  else if((*isolver==2)||(*isolver==3)){
808  if(nasym>0){
809  printf(" *ERROR in nonlingeo: the iterative solver cannot be used for asymmetric matrices\n\n");
810  FORTRAN(stop,());
811  }
812  preiter(ad,&au,b,&icol,&irow,neq,nzs,isolver,iperturb);
813  }
814  else if(*isolver==4){
815 #ifdef SGI
816  if(nasym>0){
817  printf(" *ERROR in nonlingeo: the SGI solver cannot be used for asymmetric matrices\n\n");
818  FORTRAN(stop,());
819  }
820  token=1;
821  sgi_main(ad,au,adb,aub,&sigma,b,icol,irow,neq,nzs,token);
822 #else
823  printf("*ERROR in linstatic: the SGI library is not linked\n\n");
824  FORTRAN(stop,());
825 #endif
826  }
827  else if(*isolver==5){
828 #ifdef TAUCS
829  if(nasym>0){
830  printf(" *ERROR in nonlingeo: the TAUCS solver cannot be used for asymmetric matrices\n\n");
831  FORTRAN(stop,());
832  }
833  tau(ad,&au,adb,aub,&sigma,b,icol,&irow,neq,nzs);
834 #else
835  printf("*ERROR in linstatic: the TAUCS library is not linked\n\n");
836  FORTRAN(stop,());
837 #endif
838  }
839  else if(*isolver==7){
840 #ifdef PARDISO
841  pardiso_main(ad,au,adb,aub,&sigma,b,icol,irow,neq,nzs,
842  &symmetryflag,&inputformat,jq,&nzs[2]);
843 #else
844  printf("*ERROR in linstatic: the PARDISO library is not linked\n\n");
845  FORTRAN(stop,());
846 #endif
847  }
848 
849  /* saving of ad and au for sensitivity analysis */
850 
851  for(i=0;i<*ntie;i++){
852  if(strcmp1(&tieset[i*243+80],"D")==0){
853 
854  strcpy(stiffmatrix,jobnamec);
855  strcat(stiffmatrix,".stm");
856 
857  if((f1=fopen(stiffmatrix,"wb"))==NULL){
858  printf("*ERROR in linstatic: cannot open stiffness matrix file for writing...");
859  exit(0);
860  }
861 
862  /* storing the stiffness matrix */
863 
864  /* nzs,irow,jq and icol have to be stored too, since the static analysis
865  can involve contact, whereas in the sensitivity analysis contact is not
866  taken into account while determining the structure of the stiffness
867  matrix (in mastruct.c)
868  */
869 
870  if(fwrite(&nasym,sizeof(ITG),1,f1)!=1){
871  printf("*ERROR saving the symmetry flag to the stiffness matrix file...");
872  exit(0);
873  }
874  if(fwrite(nzs,sizeof(ITG),3,f1)!=3){
875  printf("*ERROR saving the number of subdiagonal nonzeros to the stiffness matrix file...");
876  exit(0);
877  }
878  if(fwrite(irow,sizeof(ITG),nzs[2],f1)!=nzs[2]){
879  printf("*ERROR saving irow to the stiffness matrix file...");
880  exit(0);
881  }
882  if(fwrite(jq,sizeof(ITG),neq[1]+1,f1)!=neq[1]+1){
883  printf("*ERROR saving jq to the stiffness matrix file...");
884  exit(0);
885  }
886  if(fwrite(icol,sizeof(ITG),neq[1],f1)!=neq[1]){
887  printf("*ERROR saving icol to the stiffness matrix file...");
888  exit(0);
889  }
890  if(fwrite(ad,sizeof(double),neq[1],f1)!=neq[1]){
891  printf("*ERROR saving the diagonal of the stiffness matrix to the stiffness matrix file...");
892  exit(0);
893  }
894  if(fwrite(au,sizeof(double),nzs[2],f1)!=nzs[2]){
895  printf("*ERROR saving the off-diagonal terms of the stiffness matrix to the tiffness matrix file...");
896  exit(0);
897  }
898  fclose(f1);
899 
900  break;
901  }
902  }
903 
904  SFREE(ad);SFREE(au);
905 
906  /* calculating the displacements and the stresses and storing */
907  /* the results in frd format for each valid eigenmode */
908 
909  NNEW(v,double,mt**nk);
910  NNEW(fn,double,mt**nk);
911  NNEW(stn,double,6**nk);
912  NNEW(inum,ITG,*nk);
913  NNEW(stx,double,6*mi[0]**ne);
914 
915  if(strcmp1(&filab[261],"E ")==0) NNEW(een,double,6**nk);
916  if(strcmp1(&filab[2697],"ME ")==0) NNEW(emn,double,6**nk);
917  if(strcmp1(&filab[522],"ENER")==0) NNEW(enern,double,*nk);
918  if(strcmp1(&filab[2175],"CONT")==0) NNEW(cdn,double,6**nk);
919 
920  NNEW(eei,double,6*mi[0]**ne);
921  if(*nener==1){
922  NNEW(stiini,double,6*mi[0]**ne);
923  NNEW(emeini,double,6*mi[0]**ne);
924  NNEW(enerini,double,mi[0]**ne);}
925 
926  results(co,nk,kon,ipkon,lakon,ne,v,stn,inum,stx,
927  elcon,nelcon,rhcon,nrhcon,alcon,nalcon,alzero,ielmat,
928  ielorien,norien,orab,ntmat_,t0,t1act,ithermal,
929  prestr,iprestr,filab,eme,emn,een,iperturb,
930  f,fn,nactdof,&iout,qa,vold,b,nodeboun,ndirboun,xbounact,nboun,ipompc,
931  nodempc,coefmpc,labmpc,nmpc,nmethod,cam,neq,veold,accold,&bet,
932  &gam,&dtime,&time,ttime,plicon,nplicon,plkcon,nplkcon,
933  xstateini,xstiff,xstate,npmat_,epn,matname,mi,&ielas,&icmd,
934  ncmat_,nstate_,stiini,vini,ikboun,ilboun,ener,enern,emeini,
935  xstaten,eei,enerini,cocon,ncocon,set,nset,istartset,iendset,
936  ialset,nprint,prlab,prset,qfx,qfn,trab,inotr,ntrans,fmpc,
937  nelemload,nload,ikmpc,ilmpc,istep,&iinc,springarea,&reltime,
938  &ne0,xforc,nforc,thicke,shcon,nshcon,
939  sideload,xloadact,xloadold,&icfd,inomat,pslavsurf,pmastsurf,
940  mortar,islavact,cdn,islavnode,nslavnode,ntie,clearini,
941  islavsurf,ielprop,prop,energyini,energy,&kscale,iponoel,
942  inoel,nener,orname,&network,ipobody,xbodyact,ibody);
943 
944  SFREE(eei);
945  if(*nener==1){
946  SFREE(stiini);SFREE(emeini);SFREE(enerini);}
947 
948  memcpy(&vold[0],&v[0],sizeof(double)*mt**nk);
949  memcpy(&sti[0],&stx[0],sizeof(double)*6*mi[0]*ne0);
950 
951  ++*kode;
952 
953  /* for cyclic symmetric sectors: duplicating the results */
954 
955  if(*mcs>0){
956  ptime=*ttime+time;
957  frdcyc(co,nk,kon,ipkon,lakon,ne,v,stn,inum,nmethod,kode,filab,een,t1act,
958  fn,&ptime,epn,ielmat,matname,cs,mcs,nkon,enern,xstaten,
959  nstate_,istep,&iinc,iperturb,ener,mi,output,ithermal,
960  qfn,ialset,istartset,iendset,trab,inotr,ntrans,orab,
961  ielorien,norien,sti,veold,&noddiam,set,nset,emn,thicke,
962  jobnamec,&ne0,cdn,mortar,nmat,qfx);
963  }
964  else{
965  if(strcmp1(&filab[1044],"ZZS")==0){
966  NNEW(neigh,ITG,40**ne);
967  NNEW(ipneigh,ITG,*nk);
968  }
969  ptime=*ttime+time;
970  frd(co,nk,kon,ipkon,lakon,ne,v,stn,inum,nmethod,
971  kode,filab,een,t1act,fn,&ptime,epn,ielmat,matname,enern,xstaten,
972  nstate_,istep,&iinc,ithermal,qfn,&mode,&noddiam,trab,inotr,
973  ntrans,orab,ielorien,norien,description,ipneigh,neigh,
974  mi,stx,vr,vi,stnr,stni,vmax,stnmax,&ngraph,veold,ener,ne,
975  cs,set,nset,istartset,iendset,ialset,eenmax,fnr,fni,emn,
976  thicke,jobnamec,output,qfx,cdn,mortar,cdnr,cdni,nmat);
977  if(strcmp1(&filab[1044],"ZZS")==0){SFREE(ipneigh);SFREE(neigh);}
978  }
979 
980  SFREE(v);SFREE(stn);SFREE(inum);
981  SFREE(b);SFREE(stx);SFREE(fn);
982 
983  if(strcmp1(&filab[261],"E ")==0) SFREE(een);
984  if(strcmp1(&filab[2697],"ME ")==0) SFREE(emn);
985  if(strcmp1(&filab[522],"ENER")==0) SFREE(enern);
986  if(strcmp1(&filab[2175],"CONT")==0) SFREE(cdn);
987 
988  }
989  else {
990 
991  /* error occurred in mafill: storing the geometry in frd format */
992 
993  ++*kode;
994  NNEW(inum,ITG,*nk);for(k=0;k<*nk;k++) inum[k]=1;
995  if(strcmp1(&filab[1044],"ZZS")==0){
996  NNEW(neigh,ITG,40**ne);
997  NNEW(ipneigh,ITG,*nk);
998  }
999  ptime=*ttime+time;
1000  frd(co,nk,kon,ipkon,lakon,ne,v,stn,inum,nmethod,
1001  kode,filab,een,t1,fn,&ptime,epn,ielmat,matname,enern,xstaten,
1002  nstate_,istep,&iinc,ithermal,qfn,&mode,&noddiam,trab,inotr,
1003  ntrans,orab,ielorien,norien,description,ipneigh,neigh,
1004  mi,sti,vr,vi,stnr,stni,vmax,stnmax,&ngraph,veold,ener,ne,
1005  cs,set,nset,istartset,iendset,ialset,eenmax,fnr,fni,emn,
1006  thicke,jobnamec,output,qfx,cdn,mortar,cdnr,cdni,nmat);
1007  if(strcmp1(&filab[1044],"ZZS")==0){SFREE(ipneigh);SFREE(neigh);}
1008  SFREE(inum);FORTRAN(stop,());
1009 
1010  }
1011 
1012  if(*icontact==1){
1013  if(ncont!=0){
1014  *ne=ne0;
1015  if(*nener==1){
1016  RENEW(ener,double,mi[0]**ne*2);
1017  }
1018  RENEW(ipkon,ITG,*ne);
1019  RENEW(lakon,char,8**ne);
1020  RENEW(kon,ITG,*nkon);
1021  if(*norien>0){
1022  RENEW(ielorien,ITG,mi[2]**ne);
1023  }
1024  RENEW(ielmat,ITG,mi[2]**ne);
1025  SFREE(cg);SFREE(straight);
1026  SFREE(imastop);SFREE(itiefac);SFREE(islavnode);SFREE(islavsurf);
1027  SFREE(nslavnode);SFREE(iponoels);SFREE(inoels);SFREE(imastnode);
1028  SFREE(nmastnode);SFREE(itietri);SFREE(koncont);SFREE(xnoels);
1029  SFREE(springarea);SFREE(xmastnor);
1030 
1031  if(*mortar==0){
1032  SFREE(areaslav);
1033  }else if(*mortar==1){
1034  SFREE(pmastsurf);SFREE(ipe);SFREE(ime);SFREE(pslavsurf);
1035  SFREE(islavact);SFREE(clearini);
1036  }
1037  }
1038  mpcinfo[0]=memmpc_;mpcinfo[1]=mpcfree;mpcinfo[2]=icascade;
1039  mpcinfo[3]=maxlenmpc;
1040  }
1041 
1042  /* updating the loading at the end of the step;
1043  important in case the amplitude at the end of the step
1044  is not equal to one */
1045 
1046  for(k=0;k<*nboun;++k){xbounold[k]=xbounact[k];}
1047  for(k=0;k<*nforc;++k){xforcold[k]=xforcact[k];}
1048  for(k=0;k<2**nload;++k){xloadold[k]=xloadact[k];}
1049  for(k=0;k<7**nbody;k=k+7){xbodyold[k]=xbodyact[k];}
1050  if(*ithermal==1){
1051  for(k=0;k<*nk;++k){t1old[k]=t1act[k];}
1052  for(k=0;k<*nk;++k){vold[mt*k]=t1act[k];}
1053  }
1054 
1055  SFREE(xbounact);SFREE(xforcact);SFREE(xloadact);SFREE(t1act);SFREE(ampli);
1056  SFREE(xbodyact);if(*nbody>0) SFREE(ipobody);SFREE(xstiff);
1057 
1058  if(iglob==1){SFREE(integerglob);SFREE(doubleglob);}
1059 
1060  *irowp=irow;*enerp=ener;*xstatep=xstate;*ipkonp=ipkon;*lakonp=lakon;
1061  *konp=kon;*ielmatp=ielmat;*ielorienp=ielorien;*icolp=icol;
1062 
1063  (*ttime)+=(*tper);
1064 
1065  return;
1066 }
#define ITGFORMAT
Definition: CalculiX.h:52
void spooles_solve(double *b, ITG *neq)
void pardiso_main(double *ad, double *au, double *adb, double *aub, double *sigma, double *b, ITG *icol, ITG *irow, ITG *neq, ITG *nzs, ITG *symmetryflag, ITG *inputformat, ITG *jq, ITG *nzs3)
subroutine writesubmatrix(submatrix, noderetain, ndirretain, nretain, jobnamec)
Definition: writesubmatrix.f:21
void frd(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne0, double *v, double *stn, ITG *inum, ITG *nmethod, ITG *kode, char *filab, double *een, double *t1, double *fn, double *time, double *epn, ITG *ielmat, char *matname, double *enern, double *xstaten, ITG *nstate_, ITG *istep, ITG *iinc, ITG *ithermal, double *qfn, ITG *mode, ITG *noddiam, double *trab, ITG *inotr, ITG *ntrans, double *orab, ITG *ielorien, ITG *norien, char *description, ITG *ipneigh, ITG *neigh, ITG *mi, double *stx, double *vr, double *vi, double *stnr, double *stni, double *vmax, double *stnmax, ITG *ngraph, double *veold, double *ener, ITG *ne, double *cs, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, double *eenmax, double *fnr, double *fni, double *emn, double *thicke, char *jobnamec, char *output, double *qfx, double *cdn, ITG *mortar, double *cdnr, double *cdni, ITG *nmat)
Definition: frd.c:32
void mafillsmmain(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, ITG *nmpc, ITG *nodeforc, ITG *ndirforc, double *xforc, ITG *nforc, ITG *nelemload, char *sideload, double *xload, ITG *nload, double *xbody, ITG *ipobody, ITG *nbody, double *cgr, double *ad, double *au, double *bb, ITG *nactdof, ITG *icol, ITG *jq, ITG *irow, ITG *neq, ITG *nzl, ITG *nmethod, ITG *ikmpc, ITG *ilmpc, ITG *ikboun, ITG *ilboun, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, double *prestr, ITG *iprestr, double *vold, ITG *iperturb, double *sti, ITG *nzs, double *stx, double *adb, double *aub, ITG *iexpl, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstiff, ITG *npmat_, double *dtime, char *matname, ITG *mi, ITG *ncmat_, ITG *mass, ITG *stiffness, ITG *buckling, ITG *rhs, ITG *intscheme, double *physcon, double *shcon, ITG *nshcon, double *cocon, ITG *ncocon, double *ttime, double *time, ITG *istep, ITG *kinc, ITG *coriolis, ITG *ibody, double *xloadold, double *reltime, double *veold, double *springarea, ITG *nstate_, double *xstateini, double *xstate, double *thicke, ITG *integerglob, double *doubleglob, char *tieset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *ntie, ITG *nasym, double *pslavsurf, double *pmastsurf, ITG *mortar, double *clearini, ITG *ielprop, double *prop, ITG *ne0, double *fnext, ITG *kscale, ITG *iponoel, ITG *inoel, ITG *network)
Definition: mafillsmmain.c:47
void preiter(double *ad, double **aup, double *b, ITG **icolp, ITG **irowp, ITG *neq, ITG *nzs, ITG *isolver, ITG *iperturb)
Definition: preiter.c:23
void inicont(ITG *nk, ITG *ncont, ITG *ntie, char *tieset, ITG *nset, char *set, ITG *istartset, ITG *iendset, ITG *ialset, ITG **itietrip, char *lakon, ITG *ipkon, ITG *kon, ITG **koncontp, ITG *ncone, double *tietol, ITG *ismallsliding, ITG **itiefacp, ITG **islavsurfp, ITG **islavnodep, ITG **imastnodep, ITG **nslavnodep, ITG **nmastnodep, ITG *mortar, ITG **imastopp, ITG *nkon, ITG **iponoels, ITG **inoelsp, ITG **ipep, ITG **imep, ITG *ne, ITG *ifacecount, ITG *iperturb, ITG *ikboun, ITG *nboun, double *co, ITG *istep, double **xnoelsp)
Definition: inicont.c:24
ITG strcpy1(char *s1, const char *s2, ITG length)
Definition: strcpy1.c:24
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
ITG strcmp1(const char *s1, const char *s2)
Definition: strcmp1.c:24
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: precontact.c:24
subroutine tempload(xforcold, xforc, xforcact, iamforc, nforc, xloadold, xload, xloadact, iamload, nload, ibody, xbody, nbody, xbodyold, xbodyact, t1old, t1, t1act, iamt1, nk, amta, namta, nam, ampli, time, reltime, ttime, dtime, ithermal, nmethod, xbounold, xboun, xbounact, iamboun, nboun, nodeboun, ndirboun, nodeforc, ndirforc, istep, iinc, co, vold, itg, ntg, amname, ikboun, ilboun, nelemload, sideload, mi, ntrans, trab, inotr, veold, integerglob, doubleglob, tieset, istartset, iendset, ialset, ntie, nmpc, ipompc, ikmpc, ilmpc, nodempc, coefmpc, ipobody, iponoel, inoel)
Definition: tempload.f:29
#define DMEMSET(a, b, c, d)
Definition: CalculiX.h:45
void spooles(double *ad, double *au, double *adb, double *aub, double *sigma, double *b, ITG *icol, ITG *irow, ITG *neq, ITG *nzs, ITG *symmtryflag, ITG *inputformat, ITG *nzs3)
subroutine stop()
Definition: stop.f:20
void tau(double *ad, double **aup, double *adb, double *aubp, double *sigma, double *b, ITG *icol, ITG **irowp, ITG *neq, ITG *nzs)
void pardiso_factor(double *ad, double *au, double *adb, double *aub, double *sigma, ITG *icol, ITG *irow, ITG *neq, ITG *nzs, ITG *symmetryflag, ITG *inputformat, ITG *jq, ITG *nzs3)
void sgi_main(double *ad, double *au, double *adb, double *aub, double *sigma, double *b, ITG *icol, ITG *irow, ITG *neq, ITG *nzs, ITG token)
void contact(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, ITG *ifree, double *co, double *vold, ITG *ielmat, double *cs, double *elcon, ITG *istep, ITG *iinc, ITG *iit, ITG *ncmat_, ITG *ntmat_, ITG *ne0, double *vini, ITG *nmethod, ITG *iperturb, ITG *ikboun, ITG *nboun, ITG *mi, ITG *imastop, ITG *nslavnode, ITG *islavnode, ITG *islavsurf, ITG *itiefac, double *areaslav, ITG *iponoels, ITG *inoels, double *springarea, double *tietol, double *reltime, ITG *imastnode, ITG *nmastnode, double *xmastnor, char *filab, ITG *mcs, ITG *ics, ITG *nasym, double *xnoels, ITG *mortar, double *pslavsurf, double *pmastsurf, double *clearini, double *theta, double *xstateini, double *xstate, ITG *nstate_, ITG *icutb, ITG *ialeatoric, char *jobnamef)
Definition: contact.c:23
#define RENEW(a, b, c)
Definition: CalculiX.h:40
#define SFREE(a)
Definition: CalculiX.h:41
void frdcyc(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, double *v, double *stn, ITG *inum, ITG *nmethod, ITG *kode, char *filab, double *een, double *t1, double *fn, double *time, double *epn, ITG *ielmat, char *matname, double *cs, ITG *mcs, ITG *nkon, double *enern, double *xstaten, ITG *nstate_, ITG *istep, ITG *iinc, ITG *iperturb, double *ener, ITG *mi, char *output, ITG *ithermal, double *qfn, ITG *ialset, ITG *istartset, ITG *iendset, double *trab, ITG *inotr, ITG *ntrans, double *orab, ITG *ielorien, ITG *norien, double *sti, double *veold, ITG *noddiam, char *set, ITG *nset, double *emn, double *thicke, char *jobnamec, ITG *ne0, double *cdn, ITG *mortar, ITG *nmat, double *qfx)
Definition: frdcyc.c:24
static double * f1
Definition: objectivemain_se.c:47
void getglobalresults(char *jobnamec, ITG **integerglobp, double **doubleglobp, ITG *nboun, ITG *iamboun, double *xboun, ITG *nload, char *sideload, ITG *iamload, ITG *iglob, ITG *nforc, ITG *iamforc, double *xforc, ITG *ithermal, ITG *nk, double *t1, ITG *iamt1)
Definition: getglobalresults.c:29
subroutine mafillsmas(co, nk, kon, ipkon, lakon, ne, nodeboun, ndirboun, xboun, nboun, ipompc, nodempc, coefmpc, nmpc, nodeforc, ndirforc, xforc, nforc, nelemload, sideload, xload, nload, xbody, ipobody, nbody, cgr, ad, au, bb, nactdof, icol, jq, irow, neq, nzl, nmethod, ikmpc, ilmpc, ikboun, ilboun, elcon, nelcon, rhcon, nrhcon, alcon, nalcon, alzero, ielmat, ielorien, norien, orab, ntmat_, t0, t1, ithermal, prestr, iprestr, vold, iperturb, sti, nzs, stx, adb, aub, iexpl, plicon, nplicon, plkcon, nplkcon, xstiff, npmat_, dtime, matname, mi, ncmat_, mass, stiffness, buckling, rhsi, intscheme, physcon, shcon, nshcon, cocon, ncocon, ttime, time, istep, iinc, coriolis, ibody, xloadold, reltime, veold, springarea, nstate_, xstateini, xstate, thicke, integerglob, doubleglob, tieset, istartset, iendset, ialset, ntie, nasym, pslavsurf, pmastsurf, mortar, clearini, ielprop, prop, ne0, kscale, iponoel, inoel, network)
Definition: mafillsmas.f:36
void spooles_factor(double *ad, double *au, double *adb, double *aub, double *sigma, ITG *icol, ITG *irow, ITG *neq, ITG *nzs, ITG *symmetryflag, ITG *inputformat, ITG *nzs3)
void remastructar(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, ITG *ithermal, ITG *iperturb, ITG *mass, ITG *mi, ITG *ics, double *cs, ITG *mcs, ITG *mortar, char *typeboun, ITG *iit, ITG *network)
Definition: remastructar.c:24
#define ITG
Definition: CalculiX.h:51
void results(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, double *v, double *stn, ITG *inum, double *stx, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, double *prestr, ITG *iprestr, char *filab, double *eme, double *emn, double *een, ITG *iperturb, double *f, double *fn, ITG *nactdof, ITG *iout, double *qa, double *vold, double *b, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, char *labmpc, ITG *nmpc, ITG *nmethod, double *vmax, ITG *neq, double *veold, double *accold, double *beta, double *gamma, double *dtime, double *time, double *ttime, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstateini, double *xstiff, double *xstate, ITG *npmat_, double *epl, char *matname, ITG *mi, ITG *ielas, ITG *icmd, ITG *ncmat_, ITG *nstate_, double *stiini, double *vini, ITG *ikboun, ITG *ilboun, double *ener, double *enern, double *emeini, double *xstaten, double *eei, double *enerini, double *cocon, ITG *ncocon, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nprint, char *prlab, char *prset, double *qfx, double *qfn, double *trab, ITG *inotr, ITG *ntrans, double *fmpc, ITG *nelemload, ITG *nload, ITG *ikmpc, ITG *ilmpc, ITG *istep, ITG *iinc, double *springarea, double *reltime, ITG *ne0, double *xforc, ITG *nforc, double *thicke, double *shcon, ITG *nshcon, char *sideload, double *xload, double *xloadold, ITG *icfd, ITG *inomat, double *pslavsurf, double *pmastsurf, ITG *mortar, ITG *islavact, double *cdn, ITG *islavnode, ITG *nslavnode, ITG *ntie, double *clearini, ITG *islavsurf, ITG *ielprop, double *prop, double *energyini, double *energy, ITG *kscale, ITG *iponoel, ITG *inoel, ITG *nener, char *orname, ITG *network, ITG *ipobody, double *xbodyact, ITG *ibody)
Definition: results.c:42
void pardiso_solve(double *b, ITG *neq, ITG *symmetryflag)
#define NNEW(a, b, c)
Definition: CalculiX.h:39
subroutine bodyforce(cbody, ibody, ipobody, nbody, set, istartset, iendset, ialset, inewton, nset, ifreebody, k)
Definition: bodyforce.f:21

◆ mafillkmain()

void mafillkmain ( ITG nef,
ITG ipnei,
ITG neifa,
ITG neiel,
double *  vfa,
double *  xxn,
double *  area,
double *  au,
double *  ad,
ITG jq,
ITG irow,
ITG nzs,
double *  b,
double *  vel,
double *  umel,
double *  xlet,
double *  xle,
double *  gradkfa,
double *  xxi,
double *  body,
double *  volume,
ITG ielfa,
char *  lakonf,
ITG ifabou,
ITG nbody,
ITG neq,
double *  dtimef,
double *  velo,
double *  veloo,
double *  cpfa,
double *  hcfa,
double *  cvel,
double *  gradvel,
double *  xload,
double *  gammat,
double *  xrlfa,
double *  xxj,
ITG nactdohinv,
double *  a1,
double *  a2,
double *  a3,
double *  flux,
ITG iau6,
double *  xxni,
double *  xxnj,
ITG iturbulent 
)
46  {
47 
48  ITG i;
49 
50  /* variables for multithreading procedure */
51 
52  ITG sys_cpus,*ithread=NULL;
53  char *env,*envloc,*envsys;
54 
55  num_cpus = 0;
56  sys_cpus=0;
57 
58  /* explicit user declaration prevails */
59 
60  envsys=getenv("NUMBER_OF_CPUS");
61  if(envsys){
62  sys_cpus=atoi(envsys);
63  if(sys_cpus<0) sys_cpus=0;
64  }
65 
66  /* automatic detection of available number of processors */
67 
68  if(sys_cpus==0){
69  sys_cpus = getSystemCPUs();
70  if(sys_cpus<1) sys_cpus=1;
71  }
72 
73  /* local declaration prevails, if strictly positive */
74 
75  envloc = getenv("CCX_NPROC_CFD");
76  if(envloc){
77  num_cpus=atoi(envloc);
78  if(num_cpus<0){
79  num_cpus=0;
80  }else if(num_cpus>sys_cpus){
81  num_cpus=sys_cpus;
82  }
83 
84  }
85 
86  /* else global declaration, if any, applies */
87 
88  env = getenv("OMP_NUM_THREADS");
89  if(num_cpus==0){
90  if (env)
91  num_cpus = atoi(env);
92  if (num_cpus < 1) {
93  num_cpus=1;
94  }else if(num_cpus>sys_cpus){
95  num_cpus=sys_cpus;
96  }
97  }
98 
99 // next line is to be inserted in a similar way for all other paralell parts
100 
101  if(*nef<num_cpus) num_cpus=*nef;
102 
103  pthread_t tid[num_cpus];
104 
105  /* calculating the stiffness and/or mass matrix
106  (symmetric part) */
107 
108  nef1=nef;ipnei1=ipnei;neifa1=neifa;neiel1=neiel;vfa1=vfa;xxn1=xxn;
109  area1=area;
110  jq1=jq;irow1=irow;nzs1=nzs;vel1=vel;umfa1=umfa;xlet1=xlet;xle1=xle;
111  gradtfa1=gradtfa;xxi1=xxi;body1=body;volume1=volume;
112  ielfa1=ielfa;lakonf1=lakonf;ifabou1=ifabou;
113  nbody1=nbody;neq1=neq;dtimef1=dtimef;velo1=velo;veloo1=veloo;
114  cvfa1=cvfa;hcfa1=hcfa;cvel1=cvel;gradvel1=gradvel;xload1=xload;
115  gamma1=gamma;xrlfa1=xrlfa;xxj1=xxj;nactdohinv1=nactdohinv;a11=a1;
116  a21=a2;a31=a3;flux1=flux;iau61=iau6;ad1=ad;au1=au;b1=b;xxni1=xxni;
117  xxnj1=xxnj,iturbulent1=iturbulent;
118 
119  /* create threads and wait */
120 
121  NNEW(ithread,ITG,num_cpus);
122  for(i=0; i<num_cpus; i++) {
123  ithread[i]=i;
124  pthread_create(&tid[i], NULL, (void *)mafillkmt, (void *)&ithread[i]);
125  }
126  for(i=0; i<num_cpus; i++) pthread_join(tid[i], NULL);
127 
128  SFREE(ithread);
129 
130  return;
131 
132 }
static double * cvfa1
Definition: mafillkmain.c:30
static double * gradvel1
Definition: mafillkmain.c:30
static double * xxn1
Definition: mafillkmain.c:30
static ITG * neifa1
Definition: mafillkmain.c:27
int pthread_create(pthread_t *thread_id, const pthread_attr_t *attributes, void *(*thread_function)(void *), void *arguments)
static double * volume1
Definition: mafillkmain.c:30
static double * gamma1
Definition: mafillkmain.c:30
static ITG num_cpus
Definition: mafillkmain.c:27
subroutine flux(node1, node2, nodem, nelem, lakon, kon, ipkon, nactdog, identity, ielprop, prop, kflag, v, xflow, f, nodef, idirf, df, cp, R, rho, physcon, g, co, dvi, numf, vold, set, shcon, nshcon, rhcon, nrhcon, ntmat_, mi, ider, ttime, time, iaxial)
Definition: flux.f:24
static double * a31
Definition: mafillkmain.c:30
static double * vfa1
Definition: mafillkmain.c:30
static double * body1
Definition: mafillkmain.c:30
static double * vel1
Definition: mafillkmain.c:30
static double * xxni1
Definition: mafillkmain.c:30
ITG getSystemCPUs()
Definition: getSystemCPUs.c:40
static ITG * irow1
Definition: mafillkmain.c:27
static double * xrlfa1
Definition: mafillkmain.c:30
static double * au1
Definition: mafillkmain.c:30
void * mafillkmt(ITG *i)
Definition: mafillkmain.c:136
static double * dtimef1
Definition: mafillkmain.c:30
static ITG * iau61
Definition: mafillkmain.c:27
static ITG * nzs1
Definition: mafillkmain.c:27
static double * xlet1
Definition: mafillkmain.c:30
static ITG * ielfa1
Definition: mafillkmain.c:27
static double * a21
Definition: mafillkmain.c:30
static double * gradtfa1
Definition: mafillkmain.c:30
static ITG * iturbulent1
Definition: mafillkmain.c:27
static ITG * nactdohinv1
Definition: mafillkmain.c:27
#define SFREE(a)
Definition: CalculiX.h:41
static double * xxj1
Definition: mafillkmain.c:30
static double * veloo1
Definition: mafillkmain.c:30
static ITG * ipnei1
Definition: mafillkmain.c:27
static double * ad1
Definition: mafillkmain.c:30
static ITG * nef1
Definition: mafillkmain.c:27
static double * a11
Definition: mafillkmain.c:30
static double * umfa1
Definition: mafillkmain.c:30
static ITG * jq1
Definition: mafillkmain.c:27
static double * xxi1
Definition: mafillkmain.c:30
static ITG * neiel1
Definition: mafillkmain.c:27
static double * flux1
Definition: mafillkmain.c:30
int pthread_join(pthread_t thread, void **status_ptr)
static double * xle1
Definition: mafillkmain.c:30
static double * b1
Definition: mafillkmain.c:30
#define ITG
Definition: CalculiX.h:51
static double * xxnj1
Definition: mafillkmain.c:30
static double * area1
Definition: mafillkmain.c:30
static double * velo1
Definition: mafillkmain.c:30
static double * xload1
Definition: mafillkmain.c:30
static ITG * ifabou1
Definition: mafillkmain.c:27
static double * cvel1
Definition: mafillkmain.c:30
#define NNEW(a, b, c)
Definition: CalculiX.h:39
static ITG * nbody1
Definition: mafillkmain.c:27
static double * hcfa1
Definition: mafillkmain.c:30
static char * lakonf1
Definition: mafillkmain.c:25
static ITG * neq1
Definition: mafillkmain.c:27

◆ mafillkmt()

void* mafillkmt ( ITG i)
136  {
137 
138  ITG nefa,nefb,nefdelta;
139 
140 // ceil -> floor
141 
142  nefdelta=(ITG)floor(*nef1/(double)num_cpus);
143  nefa=*i*nefdelta+1;
144  nefb=(*i+1)*nefdelta;
145 // next line! -> all parallel sections
146  if((*i==num_cpus-1)&&(nefb<*nef1)) nefb=*nef1;
147 
149  au1,ad1,jq1,irow1,nzs1,
154  a11,a21,a31,flux1,&nefa,&nefb,iau61,xxni1,xxnj1,
155  iturbulent1));
156 
157  return NULL;
158 }
static double * cvfa1
Definition: mafillkmain.c:30
static double * gradvel1
Definition: mafillkmain.c:30
static double * xxn1
Definition: mafillkmain.c:30
static ITG * neifa1
Definition: mafillkmain.c:27
static double * volume1
Definition: mafillkmain.c:30
static double * gamma1
Definition: mafillkmain.c:30
static ITG num_cpus
Definition: mafillkmain.c:27
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
static double * a31
Definition: mafillkmain.c:30
static double * vfa1
Definition: mafillkmain.c:30
static double * body1
Definition: mafillkmain.c:30
static double * vel1
Definition: mafillkmain.c:30
static double * xxni1
Definition: mafillkmain.c:30
static ITG * irow1
Definition: mafillkmain.c:27
static double * xrlfa1
Definition: mafillkmain.c:30
static double * au1
Definition: mafillkmain.c:30
static double * dtimef1
Definition: mafillkmain.c:30
static ITG * iau61
Definition: mafillkmain.c:27
static ITG * nzs1
Definition: mafillkmain.c:27
static double * xlet1
Definition: mafillkmain.c:30
static ITG * ielfa1
Definition: mafillkmain.c:27
static double * a21
Definition: mafillkmain.c:30
static double * gradtfa1
Definition: mafillkmain.c:30
static ITG * iturbulent1
Definition: mafillkmain.c:27
static ITG * nactdohinv1
Definition: mafillkmain.c:27
subroutine mafillk(nef, ipnei, neifa, neiel, vfa, xxn, area, au, ad, jq, irow, nzs, b, vel, umfa, xlet, xle, gradkfa, xxi, body, volume, ielfa, lakonf, ifabou, nbody, neq, dtimef, velo, veloo, cvfa, hcfa, cvel, gradvel, xload, gamma, xrlfa, xxj, nactdohinv, a1, a2, a3, flux, nefa, nefb, iau6, xxni, xxnj, iturbulent)
Definition: mafillk.f:25
static double * xxj1
Definition: mafillkmain.c:30
static double * veloo1
Definition: mafillkmain.c:30
static ITG * ipnei1
Definition: mafillkmain.c:27
static double * ad1
Definition: mafillkmain.c:30
static ITG * nef1
Definition: mafillkmain.c:27
static double * a11
Definition: mafillkmain.c:30
static double * umfa1
Definition: mafillkmain.c:30
static ITG * jq1
Definition: mafillkmain.c:27
static double * xxi1
Definition: mafillkmain.c:30
static ITG * neiel1
Definition: mafillkmain.c:27
static double * flux1
Definition: mafillkmain.c:30
static double * xle1
Definition: mafillkmain.c:30
static double * b1
Definition: mafillkmain.c:30
#define ITG
Definition: CalculiX.h:51
static double * xxnj1
Definition: mafillkmain.c:30
static double * area1
Definition: mafillkmain.c:30
static double * velo1
Definition: mafillkmain.c:30
static double * xload1
Definition: mafillkmain.c:30
static ITG * ifabou1
Definition: mafillkmain.c:27
static double * cvel1
Definition: mafillkmain.c:30
static ITG * nbody1
Definition: mafillkmain.c:27
static double * hcfa1
Definition: mafillkmain.c:30
static char * lakonf1
Definition: mafillkmain.c:25
static ITG * neq1
Definition: mafillkmain.c:27

◆ mafillomain()

void mafillomain ( ITG nef,
ITG ipnei,
ITG neifa,
ITG neiel,
double *  vfa,
double *  xxn,
double *  area,
double *  au,
double *  ad,
ITG jq,
ITG irow,
ITG nzs,
double *  b,
double *  vel,
double *  umel,
double *  xlet,
double *  xle,
double *  gradofa,
double *  xxi,
double *  body,
double *  volume,
ITG ielfa,
char *  lakonf,
ITG ifabou,
ITG nbody,
ITG neq,
double *  dtimef,
double *  velo,
double *  veloo,
double *  cpfa,
double *  hcfa,
double *  cvel,
double *  gradvel,
double *  xload,
double *  gammat,
double *  xrlfa,
double *  xxj,
ITG nactdohinv,
double *  a1,
double *  a2,
double *  a3,
double *  flux,
ITG iau6,
double *  xxni,
double *  xxnj,
ITG iturbulent,
double *  gradkel,
double *  gradoel 
)
46  {
47 
48  ITG i;
49 
50  /* variables for multithreading procedure */
51 
52  ITG sys_cpus,*ithread=NULL;
53  char *env,*envloc,*envsys;
54 
55  num_cpus = 0;
56  sys_cpus=0;
57 
58  /* explicit user declaration prevails */
59 
60  envsys=getenv("NUMBER_OF_CPUS");
61  if(envsys){
62  sys_cpus=atoi(envsys);
63  if(sys_cpus<0) sys_cpus=0;
64  }
65 
66  /* automatic detection of available number of processors */
67 
68  if(sys_cpus==0){
69  sys_cpus = getSystemCPUs();
70  if(sys_cpus<1) sys_cpus=1;
71  }
72 
73  /* local declaration prevails, if strictly positive */
74 
75  envloc = getenv("CCX_NPROC_CFD");
76  if(envloc){
77  num_cpus=atoi(envloc);
78  if(num_cpus<0){
79  num_cpus=0;
80  }else if(num_cpus>sys_cpus){
81  num_cpus=sys_cpus;
82  }
83 
84  }
85 
86  /* else global declaration, if any, applies */
87 
88  env = getenv("OMP_NUM_THREADS");
89  if(num_cpus==0){
90  if (env)
91  num_cpus = atoi(env);
92  if (num_cpus < 1) {
93  num_cpus=1;
94  }else if(num_cpus>sys_cpus){
95  num_cpus=sys_cpus;
96  }
97  }
98 
99 // next line is to be inserted in a similar way for all other paralell parts
100 
101  if(*nef<num_cpus) num_cpus=*nef;
102 
103  pthread_t tid[num_cpus];
104 
105  /* calculating the stiffness and/or mass matrix
106  (symmetric part) */
107 
108  nef1=nef;ipnei1=ipnei;neifa1=neifa;neiel1=neiel;vfa1=vfa;xxn1=xxn;
109  area1=area;
110  jq1=jq;irow1=irow;nzs1=nzs;vel1=vel;umfa1=umfa;xlet1=xlet;xle1=xle;
111  gradtfa1=gradtfa;xxi1=xxi;body1=body;volume1=volume;
112  ielfa1=ielfa;lakonf1=lakonf;ifabou1=ifabou;
113  nbody1=nbody;neq1=neq;dtimef1=dtimef;velo1=velo;veloo1=veloo;
114  cvfa1=cvfa;hcfa1=hcfa;cvel1=cvel;gradvel1=gradvel;xload1=xload;
115  gamma1=gamma;xrlfa1=xrlfa;xxj1=xxj;nactdohinv1=nactdohinv;a11=a1;
116  a21=a2;a31=a3;flux1=flux;iau61=iau6;ad1=ad;au1=au;b1=b;xxni1=xxni;
117  xxnj1=xxnj,iturbulent1=iturbulent;gradkel1=gradkel;gradoel1=gradoel;
118 
119  /* create threads and wait */
120 
121  NNEW(ithread,ITG,num_cpus);
122  for(i=0; i<num_cpus; i++) {
123  ithread[i]=i;
124  pthread_create(&tid[i], NULL, (void *)mafillomt, (void *)&ithread[i]);
125  }
126  for(i=0; i<num_cpus; i++) pthread_join(tid[i], NULL);
127 
128  SFREE(ithread);
129 
130  return;
131 
132 }
static double * xle1
Definition: mafillomain.c:30
static ITG num_cpus
Definition: mafillomain.c:27
static double * b1
Definition: mafillomain.c:30
static double * area1
Definition: mafillomain.c:30
static double * velo1
Definition: mafillomain.c:30
static double * xload1
Definition: mafillomain.c:30
static ITG * ifabou1
Definition: mafillomain.c:27
int pthread_create(pthread_t *thread_id, const pthread_attr_t *attributes, void *(*thread_function)(void *), void *arguments)
static double * vfa1
Definition: mafillomain.c:30
static double * cvel1
Definition: mafillomain.c:30
static double * vel1
Definition: mafillomain.c:30
static char * lakonf1
Definition: mafillomain.c:25
static ITG * irow1
Definition: mafillomain.c:27
static double * au1
Definition: mafillomain.c:30
static double * gradoel1
Definition: mafillomain.c:30
static double * dtimef1
Definition: mafillomain.c:30
static ITG * iau61
Definition: mafillomain.c:27
static ITG * nzs1
Definition: mafillomain.c:27
subroutine flux(node1, node2, nodem, nelem, lakon, kon, ipkon, nactdog, identity, ielprop, prop, kflag, v, xflow, f, nodef, idirf, df, cp, R, rho, physcon, g, co, dvi, numf, vold, set, shcon, nshcon, rhcon, nrhcon, ntmat_, mi, ider, ttime, time, iaxial)
Definition: flux.f:24
static double * a21
Definition: mafillomain.c:30
static ITG * neifa1
Definition: mafillomain.c:27
static ITG * iturbulent1
Definition: mafillomain.c:27
static double * gamma1
Definition: mafillomain.c:30
static ITG * nactdohinv1
Definition: mafillomain.c:27
ITG getSystemCPUs()
Definition: getSystemCPUs.c:40
static double * xxj1
Definition: mafillomain.c:30
static ITG * ipnei1
Definition: mafillomain.c:27
static double * ad1
Definition: mafillomain.c:30
static double * a11
Definition: mafillomain.c:30
static double * xxi1
Definition: mafillomain.c:30
static ITG * neiel1
Definition: mafillomain.c:27
static double * a31
Definition: mafillomain.c:30
static double * body1
Definition: mafillomain.c:30
#define SFREE(a)
Definition: CalculiX.h:41
static double * xxni1
Definition: mafillomain.c:30
static double * xrlfa1
Definition: mafillomain.c:30
static double * xlet1
Definition: mafillomain.c:30
static double * xxnj1
Definition: mafillomain.c:30
static ITG * ielfa1
Definition: mafillomain.c:27
static double * gradtfa1
Definition: mafillomain.c:30
static ITG * nbody1
Definition: mafillomain.c:27
static double * hcfa1
Definition: mafillomain.c:30
void * mafillomt(ITG *i)
Definition: mafillomain.c:136
static double * gradkel1
Definition: mafillomain.c:30
int pthread_join(pthread_t thread, void **status_ptr)
static ITG * neq1
Definition: mafillomain.c:27
static double * veloo1
Definition: mafillomain.c:30
static double * cvfa1
Definition: mafillomain.c:30
static ITG * nef1
Definition: mafillomain.c:27
static double * gradvel1
Definition: mafillomain.c:30
#define ITG
Definition: CalculiX.h:51
static double * umfa1
Definition: mafillomain.c:30
static ITG * jq1
Definition: mafillomain.c:27
static double * xxn1
Definition: mafillomain.c:30
static double * flux1
Definition: mafillomain.c:30
static double * volume1
Definition: mafillomain.c:30
#define NNEW(a, b, c)
Definition: CalculiX.h:39

◆ mafillomt()

void* mafillomt ( ITG i)
136  {
137 
138  ITG nefa,nefb,nefdelta;
139 
140 // ceil -> floor
141 
142  nefdelta=(ITG)floor(*nef1/(double)num_cpus);
143  nefa=*i*nefdelta+1;
144  nefb=(*i+1)*nefdelta;
145 // next line! -> all parallel sections
146  if((*i==num_cpus-1)&&(nefb<*nef1)) nefb=*nef1;
147 
149  au1,ad1,jq1,irow1,nzs1,
154  a11,a21,a31,flux1,&nefa,&nefb,iau61,xxni1,xxnj1,
156 
157  return NULL;
158 }
static double * xle1
Definition: mafillomain.c:30
static ITG num_cpus
Definition: mafillomain.c:27
static double * b1
Definition: mafillomain.c:30
static double * area1
Definition: mafillomain.c:30
static double * velo1
Definition: mafillomain.c:30
static double * xload1
Definition: mafillomain.c:30
static ITG * ifabou1
Definition: mafillomain.c:27
static double * vfa1
Definition: mafillomain.c:30
static double * cvel1
Definition: mafillomain.c:30
static double * vel1
Definition: mafillomain.c:30
static char * lakonf1
Definition: mafillomain.c:25
static ITG * irow1
Definition: mafillomain.c:27
static double * au1
Definition: mafillomain.c:30
static double * gradoel1
Definition: mafillomain.c:30
static double * dtimef1
Definition: mafillomain.c:30
static ITG * iau61
Definition: mafillomain.c:27
static ITG * nzs1
Definition: mafillomain.c:27
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
static double * a21
Definition: mafillomain.c:30
static ITG * neifa1
Definition: mafillomain.c:27
static ITG * iturbulent1
Definition: mafillomain.c:27
static double * gamma1
Definition: mafillomain.c:30
static ITG * nactdohinv1
Definition: mafillomain.c:27
subroutine mafillo(nef, ipnei, neifa, neiel, vfa, xxn, area, au, ad, jq, irow, nzs, b, vel, umfa, xlet, xle, gradofa, xxi, body, volume, ielfa, lakonf, ifabou, nbody, neq, dtimef, velo, veloo, cvfa, hcfa, cvel, gradvel, xload, gamma, xrlfa, xxj, nactdohinv, a1, a2, a3, flux, nefa, nefb, iau6, xxni, xxnj, iturbulent, gradkel, gradoel)
Definition: mafillo.f:25
static double * xxj1
Definition: mafillomain.c:30
static ITG * ipnei1
Definition: mafillomain.c:27
static double * ad1
Definition: mafillomain.c:30
static double * a11
Definition: mafillomain.c:30
static double * xxi1
Definition: mafillomain.c:30
static ITG * neiel1
Definition: mafillomain.c:27
static double * a31
Definition: mafillomain.c:30
static double * body1
Definition: mafillomain.c:30
static double * xxni1
Definition: mafillomain.c:30
static double * xrlfa1
Definition: mafillomain.c:30
static double * xlet1
Definition: mafillomain.c:30
static double * xxnj1
Definition: mafillomain.c:30
static ITG * ielfa1
Definition: mafillomain.c:27
static double * gradtfa1
Definition: mafillomain.c:30
static ITG * nbody1
Definition: mafillomain.c:27
static double * hcfa1
Definition: mafillomain.c:30
static double * gradkel1
Definition: mafillomain.c:30
static ITG * neq1
Definition: mafillomain.c:27
static double * veloo1
Definition: mafillomain.c:30
static double * cvfa1
Definition: mafillomain.c:30
static ITG * nef1
Definition: mafillomain.c:27
static double * gradvel1
Definition: mafillomain.c:30
#define ITG
Definition: CalculiX.h:51
static double * umfa1
Definition: mafillomain.c:30
static ITG * jq1
Definition: mafillomain.c:27
static double * xxn1
Definition: mafillomain.c:30
static double * flux1
Definition: mafillomain.c:30
static double * volume1
Definition: mafillomain.c:30

◆ mafillpcompmain()

void mafillpcompmain ( ITG ne,
char *  lakonf,
ITG ipnei,
ITG neifa,
ITG neiel,
double *  vfa,
double *  area,
double *  adfa,
double *  xlet,
double *  cosa,
double *  volume,
double *  au,
double *  ad,
ITG jq,
ITG irow,
double *  ap,
ITG ielfa,
ITG ifabou,
double *  xle,
double *  b,
double *  xxn,
ITG neq,
ITG nzs,
double *  hfa,
double *  gradpel,
double *  bp,
double *  xxi,
ITG neij,
double *  xlen,
double *  cosb,
ITG ielmatf,
ITG mi,
double *  a1,
double *  a2,
double *  a3,
double *  velo,
double *  veloo,
double *  dtimef,
double *  shcon,
ITG ntmat_,
double *  vel,
ITG nactdohinv,
double *  xrlfa,
double *  flux,
ITG iau6,
double *  xxicn,
double *  gamma 
)
46  {
47 
48  ITG i,j;
49 
50  /* variables for multithreading procedure */
51 
52  ITG sys_cpus,*ithread=NULL;
53  char *env,*envloc,*envsys;
54 
55  num_cpus = 0;
56  sys_cpus=0;
57 
58  /* explicit user declaration prevails */
59 
60  envsys=getenv("NUMBER_OF_CPUS");
61  if(envsys){
62  sys_cpus=atoi(envsys);
63  if(sys_cpus<0) sys_cpus=0;
64  }
65 
66  /* automatic detection of available number of processors */
67 
68  if(sys_cpus==0){
69  sys_cpus = getSystemCPUs();
70  if(sys_cpus<1) sys_cpus=1;
71  }
72 
73  /* local declaration prevails, if strictly positive */
74 
75  envloc = getenv("CCX_NPROC_CFD");
76  if(envloc){
77  num_cpus=atoi(envloc);
78  if(num_cpus<0){
79  num_cpus=0;
80  }else if(num_cpus>sys_cpus){
81  num_cpus=sys_cpus;
82  }
83 
84  }
85 
86  /* else global declaration, if any, applies */
87 
88  env = getenv("OMP_NUM_THREADS");
89  if(num_cpus==0){
90  if (env)
91  num_cpus = atoi(env);
92  if (num_cpus < 1) {
93  num_cpus=1;
94  }else if(num_cpus>sys_cpus){
95  num_cpus=sys_cpus;
96  }
97  }
98 
99 // next line is to be inserted in a similar way for all other paralell parts
100 
101  if(*nef<num_cpus) num_cpus=*nef;
102 
103  pthread_t tid[num_cpus];
104 
105  /* calculating the stiffness and/or mass matrix
106  (symmetric part) */
107 
108  nef1=nef;lakonf1=lakonf;ipnei1=ipnei;neifa1=neifa;neiel1=neiel;
109  vfa1=vfa;area1=area;advfa1=advfa;xlet1=xlet,cosa1=cosa;volume1=volume;
110  jq1=jq;irow1=irow;ap1=ap;ielfa1=ielfa;ifabou1=ifabou;xle1=xle;
111  xxn1=xxn;neq1=neq;nzs1=nzs;hfa1=hfa;gradpel1=gradpel;bp1=bp;xxi1=xxi;
112  neij1=neij;xlen1=xlen;cosb1=cosb;ielmatf1=ielmatf;mi1=mi,a11=a1;
113  a21=a2;a31=a3;velo1=velo;veloo1=veloo;dtimef1=dtimef;shcon1=shcon;
114  ntmat1_=ntmat_;vel1=vel;nactdohinv1=nactdohinv;xrlfa1=xrlfa;
115  flux1=flux;iau61=iau6;ad1=ad;au1=au;b1=b;xxicn1=xxicn;gamma1=gamma;
116 
117  /* create threads and wait */
118 
119  NNEW(ithread,ITG,num_cpus);
120  for(i=0; i<num_cpus; i++) {
121  ithread[i]=i;
122  pthread_create(&tid[i], NULL, (void *)mafillpcompmt, (void *)&ithread[i]);
123  }
124  for(i=0; i<num_cpus; i++) pthread_join(tid[i], NULL);
125 
126  SFREE(ithread);
127 
128  return;
129 
130 }
static double * xlet1
Definition: mafillpcompmain.c:31
static double * xrlfa1
Definition: mafillpcompmain.c:31
static ITG * ielmatf1
Definition: mafillpcompmain.c:27
static double * b1
Definition: mafillpcompmain.c:31
static double * a21
Definition: mafillpcompmain.c:31
int pthread_create(pthread_t *thread_id, const pthread_attr_t *attributes, void *(*thread_function)(void *), void *arguments)
static ITG * ifabou1
Definition: mafillpcompmain.c:27
static double * au1
Definition: mafillpcompmain.c:31
static double * xle1
Definition: mafillpcompmain.c:31
static double * cosb1
Definition: mafillpcompmain.c:31
static double * vfa1
Definition: mafillpcompmain.c:31
static ITG num_cpus
Definition: mafillpcompmain.c:27
subroutine flux(node1, node2, nodem, nelem, lakon, kon, ipkon, nactdog, identity, ielprop, prop, kflag, v, xflow, f, nodef, idirf, df, cp, R, rho, physcon, g, co, dvi, numf, vold, set, shcon, nshcon, rhcon, nrhcon, ntmat_, mi, ider, ttime, time, iaxial)
Definition: flux.f:24
static double * bp1
Definition: mafillpcompmain.c:31
static double * flux1
Definition: mafillpcompmain.c:31
static double * volume1
Definition: mafillpcompmain.c:31
static double * a31
Definition: mafillpcompmain.c:31
ITG getSystemCPUs()
Definition: getSystemCPUs.c:40
static ITG * neifa1
Definition: mafillpcompmain.c:27
static double * velo1
Definition: mafillpcompmain.c:31
static double * area1
Definition: mafillpcompmain.c:31
static double * gradpel1
Definition: mafillpcompmain.c:31
static ITG * neij1
Definition: mafillpcompmain.c:27
static double * hfa1
Definition: mafillpcompmain.c:31
static ITG * nef1
Definition: mafillpcompmain.c:27
static ITG * ipnei1
Definition: mafillpcompmain.c:27
static double * vel1
Definition: mafillpcompmain.c:31
static ITG * neiel1
Definition: mafillpcompmain.c:27
static double * ad1
Definition: mafillpcompmain.c:31
static double * gamma1
Definition: mafillpcompmain.c:31
static char * lakonf1
Definition: mafillpcompmain.c:25
#define SFREE(a)
Definition: CalculiX.h:41
static double * ap1
Definition: mafillpcompmain.c:31
static double * advfa1
Definition: mafillpcompmain.c:31
static double * dtimef1
Definition: mafillpcompmain.c:31
static double * veloo1
Definition: mafillpcompmain.c:31
static double * xxicn1
Definition: mafillpcompmain.c:31
static ITG * nactdohinv1
Definition: mafillpcompmain.c:27
static double * xxi1
Definition: mafillpcompmain.c:31
static ITG * nzs1
Definition: mafillpcompmain.c:27
static double * shcon1
Definition: mafillpcompmain.c:31
static ITG * neq1
Definition: mafillpcompmain.c:27
int pthread_join(pthread_t thread, void **status_ptr)
static double * xlen1
Definition: mafillpcompmain.c:31
static double * a11
Definition: mafillpcompmain.c:31
static ITG * ntmat1_
Definition: mafillpcompmain.c:27
#define ITG
Definition: CalculiX.h:51
static double * cosa1
Definition: mafillpcompmain.c:31
static ITG * irow1
Definition: mafillpcompmain.c:27
static ITG * ielfa1
Definition: mafillpcompmain.c:27
#define NNEW(a, b, c)
Definition: CalculiX.h:39
static ITG * mi1
Definition: mafillpcompmain.c:27
static ITG * jq1
Definition: mafillpcompmain.c:27
static ITG * iau61
Definition: mafillpcompmain.c:27
static double * xxn1
Definition: mafillpcompmain.c:31
void * mafillpcompmt(ITG *i)
Definition: mafillpcompmain.c:134

◆ mafillpcompmt()

void* mafillpcompmt ( ITG i)
134  {
135 
136  ITG nefa,nefb,nefdelta;
137 
138 // ceil -> floor
139 
140  nefdelta=(ITG)floor(*nef1/(double)num_cpus);
141  nefa=*i*nefdelta+1;
142  nefb=(*i+1)*nefdelta;
143 // next line! -> all parallel sections
144  if((*i==num_cpus-1)&&(nefb<*nef1)) nefb=*nef1;
145 
151  nactdohinv1,xrlfa1,flux1,&nefa,&nefb,iau61,xxicn1,
152  gamma1));
153 
154  return NULL;
155 }
static double * xlet1
Definition: mafillpcompmain.c:31
static double * xrlfa1
Definition: mafillpcompmain.c:31
static ITG * ielmatf1
Definition: mafillpcompmain.c:27
static double * b1
Definition: mafillpcompmain.c:31
static double * a21
Definition: mafillpcompmain.c:31
static ITG * ifabou1
Definition: mafillpcompmain.c:27
static double * au1
Definition: mafillpcompmain.c:31
static double * xle1
Definition: mafillpcompmain.c:31
static double * cosb1
Definition: mafillpcompmain.c:31
static double * vfa1
Definition: mafillpcompmain.c:31
static ITG num_cpus
Definition: mafillpcompmain.c:27
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
static double * bp1
Definition: mafillpcompmain.c:31
static double * flux1
Definition: mafillpcompmain.c:31
static double * volume1
Definition: mafillpcompmain.c:31
static double * a31
Definition: mafillpcompmain.c:31
subroutine mafillpcomp(nef, lakonf, ipnei, neifa, neiel, vfa, area, advfa, xlet, cosa, volume, au, ad, jq, irow, ap, ielfa, ifabou, xle, b, xxn, neq, nzs, hfa, gradpel, bp, xxi, neij, xlen, cosb, ielmatf, mi, a1, a2, a3, velo, veloo, dtimef, shcon, ntmat_, vel, nactdohinv, xrlfa, flux, nefa, nefb, iau6, xxicn, gamma)
Definition: mafillpcomp.f:25
static ITG * neifa1
Definition: mafillpcompmain.c:27
static double * velo1
Definition: mafillpcompmain.c:31
static double * area1
Definition: mafillpcompmain.c:31
static double * gradpel1
Definition: mafillpcompmain.c:31
static ITG * neij1
Definition: mafillpcompmain.c:27
static double * hfa1
Definition: mafillpcompmain.c:31
static ITG * nef1
Definition: mafillpcompmain.c:27
static ITG * ipnei1
Definition: mafillpcompmain.c:27
static double * vel1
Definition: mafillpcompmain.c:31
static ITG * neiel1
Definition: mafillpcompmain.c:27
static double * ad1
Definition: mafillpcompmain.c:31
static double * gamma1
Definition: mafillpcompmain.c:31
static char * lakonf1
Definition: mafillpcompmain.c:25
static double * ap1
Definition: mafillpcompmain.c:31
static double * advfa1
Definition: mafillpcompmain.c:31
static double * dtimef1
Definition: mafillpcompmain.c:31
static double * veloo1
Definition: mafillpcompmain.c:31
static double * xxicn1
Definition: mafillpcompmain.c:31
static ITG * nactdohinv1
Definition: mafillpcompmain.c:27
static double * xxi1
Definition: mafillpcompmain.c:31
static ITG * nzs1
Definition: mafillpcompmain.c:27
static double * shcon1
Definition: mafillpcompmain.c:31
static ITG * neq1
Definition: mafillpcompmain.c:27
static double * xlen1
Definition: mafillpcompmain.c:31
static double * a11
Definition: mafillpcompmain.c:31
static ITG * ntmat1_
Definition: mafillpcompmain.c:27
#define ITG
Definition: CalculiX.h:51
static double * cosa1
Definition: mafillpcompmain.c:31
static ITG * irow1
Definition: mafillpcompmain.c:27
static ITG * ielfa1
Definition: mafillpcompmain.c:27
static ITG * mi1
Definition: mafillpcompmain.c:27
static ITG * jq1
Definition: mafillpcompmain.c:27
static ITG * iau61
Definition: mafillpcompmain.c:27
static double * xxn1
Definition: mafillpcompmain.c:31

◆ mafillpmain()

void mafillpmain ( ITG ne,
char *  lakonf,
ITG ipnei,
ITG neifa,
ITG neiel,
double *  vfa,
double *  area,
double *  adfa,
double *  xlet,
double *  cosa,
double *  volume,
double *  au,
double *  ad,
ITG jq,
ITG irow,
double *  ap,
ITG ielfa,
ITG ifabou,
double *  xle,
double *  b,
double *  xxn,
ITG neq,
ITG nzs,
double *  hfa,
double *  gradpel,
double *  bp,
double *  xxi,
ITG neij,
double *  xlen,
double *  cosb,
ITG iatleastonepressurebc,
ITG iau6,
double *  xxicn 
)
40  {
41 
42  ITG i,j;
43 
44  /* variables for multithreading procedure */
45 
46  ITG sys_cpus,*ithread=NULL;
47  char *env,*envloc,*envsys;
48 
49  num_cpus = 0;
50  sys_cpus=0;
51 
52  /* explicit user declaration prevails */
53 
54  envsys=getenv("NUMBER_OF_CPUS");
55  if(envsys){
56  sys_cpus=atoi(envsys);
57  if(sys_cpus<0) sys_cpus=0;
58  }
59 
60  /* automatic detection of available number of processors */
61 
62  if(sys_cpus==0){
63  sys_cpus = getSystemCPUs();
64  if(sys_cpus<1) sys_cpus=1;
65  }
66 
67  /* local declaration prevails, if strictly positive */
68 
69  envloc = getenv("CCX_NPROC_CFD");
70  if(envloc){
71  num_cpus=atoi(envloc);
72  if(num_cpus<0){
73  num_cpus=0;
74  }else if(num_cpus>sys_cpus){
75  num_cpus=sys_cpus;
76  }
77 
78  }
79 
80  /* else global declaration, if any, applies */
81 
82  env = getenv("OMP_NUM_THREADS");
83  if(num_cpus==0){
84  if (env)
85  num_cpus = atoi(env);
86  if (num_cpus < 1) {
87  num_cpus=1;
88  }else if(num_cpus>sys_cpus){
89  num_cpus=sys_cpus;
90  }
91  }
92 
93 // next line is to be inserted in a similar way for all other paralell parts
94 
95  if(*nef<num_cpus) num_cpus=*nef;
96 
97  pthread_t tid[num_cpus];
98 
99  /* calculating the stiffness and/or mass matrix
100  (symmetric part) */
101 
102  nef1=nef;lakonf1=lakonf;ipnei1=ipnei;neifa1=neifa;neiel1=neiel;
103  vfa1=vfa;area1=area;advfa1=advfa;xlet1=xlet,cosa1=cosa;volume1=volume;
104  jq1=jq;irow1=irow;ap1=ap;ielfa1=ielfa;ifabou1=ifabou;xle1=xle;
105  xxn1=xxn;neq1=neq;nzs1=nzs;hfa1=hfa;gradpel1=gradpel;bp1=bp;xxi1=xxi;
106  neij1=neij;xlen1=xlen;cosb1=cosb;iau61=iau6;ad1=ad;au1=au;b1=b;
107  xxicn1=xxicn;
108 
109  /* create threads and wait */
110 
111  NNEW(ithread,ITG,num_cpus);
112  for(i=0; i<num_cpus; i++) {
113  ithread[i]=i;
114  pthread_create(&tid[i], NULL, (void *)mafillpmt, (void *)&ithread[i]);
115  }
116  for(i=0; i<num_cpus; i++) pthread_join(tid[i], NULL);
117 
118  SFREE(ithread);
119 
120  FORTRAN(mafillpbc,(nef,au,ad,jq,irow,b,iatleastonepressurebc,nzs));
121 
122  return;
123 
124 }
static double * xxi1
Definition: mafillpmain.c:30
static ITG * ielfa1
Definition: mafillpmain.c:27
static ITG * jq1
Definition: mafillpmain.c:27
static double * hfa1
Definition: mafillpmain.c:30
static ITG * neiel1
Definition: mafillpmain.c:27
int pthread_create(pthread_t *thread_id, const pthread_attr_t *attributes, void *(*thread_function)(void *), void *arguments)
static double * xxicn1
Definition: mafillpmain.c:30
static double * advfa1
Definition: mafillpmain.c:30
static double * xlen1
Definition: mafillpmain.c:30
void * mafillpmt(ITG *i)
Definition: mafillpmain.c:128
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
static double * vfa1
Definition: mafillpmain.c:30
static double * volume1
Definition: mafillpmain.c:30
static double * xlet1
Definition: mafillpmain.c:30
static double * ap1
Definition: mafillpmain.c:30
static double * b1
Definition: mafillpmain.c:30
ITG getSystemCPUs()
Definition: getSystemCPUs.c:40
static double * au1
Definition: mafillpmain.c:30
static double * gradpel1
Definition: mafillpmain.c:30
static double * xxn1
Definition: mafillpmain.c:30
static double * bp1
Definition: mafillpmain.c:30
static ITG * nef1
Definition: mafillpmain.c:27
static ITG * neifa1
Definition: mafillpmain.c:27
static char * lakonf1
Definition: mafillpmain.c:25
#define SFREE(a)
Definition: CalculiX.h:41
static double * cosa1
Definition: mafillpmain.c:30
static ITG * ipnei1
Definition: mafillpmain.c:27
static double * area1
Definition: mafillpmain.c:30
static double * xle1
Definition: mafillpmain.c:30
static double * ad1
Definition: mafillpmain.c:30
subroutine mafillpbc(nef, au, ad, jq, irow, b, iatleastonepressurebc, nzs)
Definition: mafillpbc.f:21
static ITG * nzs1
Definition: mafillpmain.c:27
static ITG num_cpus
Definition: mafillpmain.c:27
int pthread_join(pthread_t thread, void **status_ptr)
static ITG * irow1
Definition: mafillpmain.c:27
#define ITG
Definition: CalculiX.h:51
static ITG * ifabou1
Definition: mafillpmain.c:27
static double * cosb1
Definition: mafillpmain.c:30
static ITG * iau61
Definition: mafillpmain.c:27
#define NNEW(a, b, c)
Definition: CalculiX.h:39
static ITG * neq1
Definition: mafillpmain.c:27
static ITG * neij1
Definition: mafillpmain.c:27

◆ mafillpmt()

void* mafillpmt ( ITG i)
128  {
129 
130  ITG nefa,nefb,nefdelta;
131 
132 // ceil -> floor
133 
134  nefdelta=(ITG)floor(*nef1/(double)num_cpus);
135  nefa=*i*nefdelta+1;
136  nefb=(*i+1)*nefdelta;
137 // next line! -> all parallel sections
138  if((*i==num_cpus-1)&&(nefb<*nef1)) nefb=*nef1;
139 
143  hfa1,gradpel1,bp1,xxi1,neij1,xlen1,cosb1,&nefa,&nefb,
144  iau61,xxicn1));
145 
146  return NULL;
147 }
static double * xxi1
Definition: mafillpmain.c:30
static ITG * ielfa1
Definition: mafillpmain.c:27
static ITG * jq1
Definition: mafillpmain.c:27
static double * hfa1
Definition: mafillpmain.c:30
static ITG * neiel1
Definition: mafillpmain.c:27
static double * xxicn1
Definition: mafillpmain.c:30
static double * advfa1
Definition: mafillpmain.c:30
static double * xlen1
Definition: mafillpmain.c:30
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
static double * vfa1
Definition: mafillpmain.c:30
static double * volume1
Definition: mafillpmain.c:30
static double * xlet1
Definition: mafillpmain.c:30
static double * ap1
Definition: mafillpmain.c:30
static double * b1
Definition: mafillpmain.c:30
static double * au1
Definition: mafillpmain.c:30
static double * gradpel1
Definition: mafillpmain.c:30
static double * xxn1
Definition: mafillpmain.c:30
static double * bp1
Definition: mafillpmain.c:30
static ITG * nef1
Definition: mafillpmain.c:27
static ITG * neifa1
Definition: mafillpmain.c:27
static char * lakonf1
Definition: mafillpmain.c:25
static double * cosa1
Definition: mafillpmain.c:30
static ITG * ipnei1
Definition: mafillpmain.c:27
static double * area1
Definition: mafillpmain.c:30
static double * xle1
Definition: mafillpmain.c:30
static double * ad1
Definition: mafillpmain.c:30
subroutine mafillp(nef, lakonf, ipnei, neifa, neiel, vfa, area, advfa, xlet, cosa, volume, au, ad, jq, irow, ap, ielfa, ifabou, xle, b, xxn, neq, nzs, hfa, gradpel, bp, xxi, neij, xlen, cosb, nefa, nefb, iau6, xxicn)
Definition: mafillp.f:23
static ITG * nzs1
Definition: mafillpmain.c:27
static ITG num_cpus
Definition: mafillpmain.c:27
static ITG * irow1
Definition: mafillpmain.c:27
#define ITG
Definition: CalculiX.h:51
static ITG * ifabou1
Definition: mafillpmain.c:27
static double * cosb1
Definition: mafillpmain.c:30
static ITG * iau61
Definition: mafillpmain.c:27
static ITG * neq1
Definition: mafillpmain.c:27
static ITG * neij1
Definition: mafillpmain.c:27

◆ mafillsmasmain()

void mafillsmasmain ( double *  co,
ITG nk,
ITG kon,
ITG ipkon,
char *  lakon,
ITG ne,
ITG nodeboun,
ITG ndirboun,
double *  xboun,
ITG nboun,
ITG ipompc,
ITG nodempc,
double *  coefmpc,
ITG nmpc,
ITG nodeforc,
ITG ndirforc,
double *  xforc,
ITG nforc,
ITG nelemload,
char *  sideload,
double *  xload,
ITG nload,
double *  xbody,
ITG ipobody,
ITG nbody,
double *  cgr,
double *  ad,
double *  au,
double *  bb,
ITG nactdof,
ITG icol,
ITG jq,
ITG irow,
ITG neq,
ITG nzl,
ITG nmethod,
ITG ikmpc,
ITG ilmpc,
ITG ikboun,
ITG ilboun,
double *  elcon,
ITG nelcon,
double *  rhcon,
ITG nrhcon,
double *  alcon,
ITG nalcon,
double *  alzero,
ITG ielmat,
ITG ielorien,
ITG norien,
double *  orab,
ITG ntmat_,
double *  t0,
double *  t1,
ITG ithermal,
double *  prestr,
ITG iprestr,
double *  vold,
ITG iperturb,
double *  sti,
ITG nzs,
double *  stx,
double *  adb,
double *  aub,
ITG iexpl,
double *  plicon,
ITG nplicon,
double *  plkcon,
ITG nplkcon,
double *  xstiff,
ITG npmat_,
double *  dtime,
char *  matname,
ITG mi,
ITG ncmat_,
ITG mass,
ITG stiffness,
ITG buckling,
ITG rhs,
ITG intscheme,
double *  physcon,
double *  shcon,
ITG nshcon,
double *  cocon,
ITG ncocon,
double *  ttime,
double *  time,
ITG istep,
ITG kinc,
ITG coriolis,
ITG ibody,
double *  xloadold,
double *  reltime,
double *  veold,
double *  springarea,
ITG nstate_,
double *  xstateini,
double *  xstate,
double *  thicke,
ITG integerglob,
double *  doubleglob,
char *  tieset,
ITG istartset,
ITG iendset,
ITG ialset,
ITG ntie,
ITG nasym,
double *  pslavsurf,
double *  pmastsurf,
ITG mortar,
double *  clearini,
ITG ielprop,
double *  prop,
ITG ne0,
ITG kscale 
)

◆ mafillsmasmt()

void* mafillsmasmt ( ITG i)

◆ mafillsmmain()

void mafillsmmain ( double *  co,
ITG nk,
ITG kon,
ITG ipkon,
char *  lakon,
ITG ne,
ITG nodeboun,
ITG ndirboun,
double *  xboun,
ITG nboun,
ITG ipompc,
ITG nodempc,
double *  coefmpc,
ITG nmpc,
ITG nodeforc,
ITG ndirforc,
double *  xforc,
ITG nforc,
ITG nelemload,
char *  sideload,
double *  xload,
ITG nload,
double *  xbody,
ITG ipobody,
ITG nbody,
double *  cgr,
double *  ad,
double *  au,
double *  bb,
ITG nactdof,
ITG icol,
ITG jq,
ITG irow,
ITG neq,
ITG nzl,
ITG nmethod,
ITG ikmpc,
ITG ilmpc,
ITG ikboun,
ITG ilboun,
double *  elcon,
ITG nelcon,
double *  rhcon,
ITG nrhcon,
double *  alcon,
ITG nalcon,
double *  alzero,
ITG ielmat,
ITG ielorien,
ITG norien,
double *  orab,
ITG ntmat_,
double *  t0,
double *  t1,
ITG ithermal,
double *  prestr,
ITG iprestr,
double *  vold,
ITG iperturb,
double *  sti,
ITG nzs,
double *  stx,
double *  adb,
double *  aub,
ITG iexpl,
double *  plicon,
ITG nplicon,
double *  plkcon,
ITG nplkcon,
double *  xstiff,
ITG npmat_,
double *  dtime,
char *  matname,
ITG mi,
ITG ncmat_,
ITG mass,
ITG stiffness,
ITG buckling,
ITG rhs,
ITG intscheme,
double *  physcon,
double *  shcon,
ITG nshcon,
double *  cocon,
ITG ncocon,
double *  ttime,
double *  time,
ITG istep,
ITG kinc,
ITG coriolis,
ITG ibody,
double *  xloadold,
double *  reltime,
double *  veold,
double *  springarea,
ITG nstate_,
double *  xstateini,
double *  xstate,
double *  thicke,
ITG integerglob,
double *  doubleglob,
char *  tieset,
ITG istartset,
ITG iendset,
ITG ialset,
ITG ntie,
ITG nasym,
double *  pslavsurf,
double *  pmastsurf,
ITG mortar,
double *  clearini,
ITG ielprop,
double *  prop,
ITG ne0,
double *  fnext,
ITG kscale,
ITG iponoel,
ITG inoel,
ITG network 
)
80  {
81 
82  ITG i,j,mt=mi[1]+1;
83 
84  /* variables for multithreading procedure */
85 
86  ITG sys_cpus,*ithread=NULL;
87  char *env,*envloc,*envsys;
88 
89  num_cpus = 0;
90  sys_cpus=0;
91 
92  /* explicit user declaration prevails */
93 
94  envsys=getenv("NUMBER_OF_CPUS");
95  if(envsys){
96  sys_cpus=atoi(envsys);
97  if(sys_cpus<0) sys_cpus=0;
98  }
99 
100 // sys_cpus=1;
101 
102  /* automatic detection of available number of processors */
103 
104  if(sys_cpus==0){
105  sys_cpus = getSystemCPUs();
106  if(sys_cpus<1) sys_cpus=1;
107  }
108 
109  /* local declaration prevails, if strictly positive */
110 
111  envloc = getenv("CCX_NPROC_STIFFNESS");
112  if(envloc){
113  num_cpus=atoi(envloc);
114  if(num_cpus<0){
115  num_cpus=0;
116  }else if(num_cpus>sys_cpus){
117  num_cpus=sys_cpus;
118  }
119 
120  }
121 
122  /* else global declaration, if any, applies */
123 
124  env = getenv("OMP_NUM_THREADS");
125  if(num_cpus==0){
126  if (env)
127  num_cpus = atoi(env);
128  if (num_cpus < 1) {
129  num_cpus=1;
130  }else if(num_cpus>sys_cpus){
131  num_cpus=sys_cpus;
132  }
133  }
134 
135 // next line is to be inserted in a similar way for all other paralell parts
136 
137  if(*ne<num_cpus) num_cpus=*ne;
138 
139  pthread_t tid[num_cpus];
140 
141  /* determine nzl */
142 
143  *nzl=0;
144  for(i=neq[1];i>=1;i--){
145  if(icol[i-1]>0){
146  *nzl=i;
147  break;
148  }
149  }
150 
151  /* allocating fields for mass and stiffness matrix */
152 
153 // if(*buckling!=1){
154  NNEW(ad1,double,num_cpus*neq[1]);
155  NNEW(au1,double,(long long)num_cpus*nzs[2]);
156 // }
157 
158  if(*rhsi==1){
159  NNEW(fext1,double,num_cpus*neq[1]);
160  }
161 
162  if((mass[1]==1)||((mass[0]==1)||(*buckling==1))){
163  NNEW(adb1,double,num_cpus*neq[1]);
164  NNEW(aub1,double,(long long)num_cpus*nzs[1]);
165  }
166 
167  if(*nmethod==4){
168  NNEW(fnext1,double,num_cpus*mt**nk);
169  }
170 
171  /* allocating memory for nmethod; if the Jacobian determinant
172  in any of the elements is nonpositive, nmethod is set to
173  zero */
174 
176  for(j=0;j<num_cpus;j++){
177  nmethod1[j]=*nmethod;
178  }
179 
180  /* calculating the stiffness and/or mass matrix
181  (symmetric part) */
182 
183  co1=co;nk1=nk;kon1=kon;ipkon1=ipkon;lakon1=lakon;ne1=ne;
184  nodeboun1=nodeboun;ndirboun1=ndirboun;xboun1=xboun;
185  nboun1=nboun;ipompc1=ipompc;nodempc1=nodempc;coefmpc1=coefmpc;
186  nmpc1=nmpc;nodeforc1=nodeforc;ndirforc1=ndirforc;xforc1=xforc;
187  nforc1=nforc;nelemload1=nelemload;sideload1=sideload;xload1=xload;
188  nload1=nload;xbody1=xbody;ipobody1=ipobody;nbody1=nbody;
189  cgr1=cgr;nactdof1=nactdof;icol1=icol;jq1=jq;irow1=irow;neq1=neq;
190  nzl1=nzl;ikmpc1=ikmpc;ilmpc1=ilmpc;ikboun1=ikboun;
191  ilboun1=ilboun;elcon1=elcon;nelcon1=nelcon;rhcon1=rhcon;
192  nrhcon1=nrhcon;alcon1=alcon;nalcon1=nalcon;alzero1=alzero;
193  ielmat1=ielmat;ielorien1=ielorien;norien1=norien;orab1=orab;
194  ntmat1_=ntmat_;t01=t0;t11=t1;ithermal1=ithermal;prestr1=prestr;
195  iprestr1=iprestr;vold1=vold;iperturb1=iperturb;sti1=sti;nzs1=nzs;
196  stx1=stx;iexpl1=iexpl;plicon1=plicon;nplicon1=nplicon;
197  plkcon1=plkcon;nplkcon1=nplkcon;xstiff1=xstiff;npmat1_=npmat_;
198  dtime1=dtime;matname1=matname;mi1=mi;ncmat1_=ncmat_;mass1=mass;
199  stiffness1=stiffness;buckling1=buckling;rhsi1=rhsi;intscheme1=intscheme;
200  physcon1=physcon;shcon1=shcon;nshcon1=nshcon;cocon1=cocon;
201  ncocon1=ncocon;ttime1=ttime;time1=time;istep1=istep;iinc1=iinc;
202  coriolis1=coriolis;ibody1=ibody;xloadold1=xloadold;reltime1=reltime;
203  veold1=veold;springarea1=springarea;nstate1_=nstate_;xstateini1=xstateini;
204  xstate1=xstate;thicke1=thicke;integerglob1=integerglob;
205  doubleglob1=doubleglob;tieset1=tieset;istartset1=istartset;
206  iendset1=iendset;ialset1=ialset;ntie1=ntie;nasym1=nasym;
207  pslavsurf1=pslavsurf;pmastsurf1=pmastsurf;mortar1=mortar;
208  clearini1=clearini;ielprop1=ielprop;prop1=prop;ne01=ne0;kscale1=kscale;
209  iponoel1=iponoel;inoel1=inoel;network1=network;
210 
211  /* calculating the stiffness/mass */
212 
213  printf(" Using up to %" ITGFORMAT " cpu(s) for the symmetric stiffness/mass contributions.\n\n", num_cpus);
214 
215  /* create threads and wait */
216 
217  NNEW(ithread,ITG,num_cpus);
218  for(i=0; i<num_cpus; i++) {
219  ithread[i]=i;
220  pthread_create(&tid[i], NULL, (void *)mafillsmmt, (void *)&ithread[i]);
221  }
222  for(i=0; i<num_cpus; i++) pthread_join(tid[i], NULL);
223 
224  SFREE(ithread);
225 
226  /* for(i=0;i<num_cpus;i++){
227  for(k=i*neq[1];k<i*neq[1]+neq[1];++k){printf("fext=%" ITGFORMAT ",%f\n",k-i*neq[1],fext1[k]);}
228  for(k=i*neq[1];k<i*neq[1]+neq[1];++k){printf("ad=%" ITGFORMAT ",%f\n",k-i*neq[1],ad1[k]);}
229  for(k=i*nzs[2];k<i*nzs[2]+nzs[2];++k){printf("au=%" ITGFORMAT ",%f\n",k-i*nzs[2],au1[k]);}
230  }*/
231 
232  /* copying and accumulating the stiffnes and/or mass matrix
233  for buckling the matrices have to be added*/
234 
235  if(*buckling!=1){
236 
237  /* no buckling */
238 
239  for(i=0;i<neq[1];i++){
240  ad[i]=ad1[i];
241  }
242  }else{
243 
244  /* buckling */
245 
246  for(i=0;i<neq[1];i++){
247  ad[i]+=ad1[i];
248  }
249  }
250 
251  for(i=0;i<neq[1];i++){
252  for(j=1;j<num_cpus;j++){
253  ad[i]+=ad1[i+j*neq[1]];
254  }
255  }
256  SFREE(ad1);
257 
258  if(*buckling!=1){
259 
260  /* no buckling */
261 
262  for(i=0;i<nzs[2];i++){
263  au[i]=au1[i];
264  }
265  }else{
266 
267  /* buckling */
268 
269  for(i=0;i<nzs[2];i++){
270  au[i]+=au1[i];
271  }
272  }
273 
274  for(i=0;i<nzs[2];i++){
275  for(j=1;j<num_cpus;j++){
276  au[i]+=au1[i+(long long)j*nzs[2]];
277  }
278  }
279  SFREE(au1);
280 
281  if(*rhsi==1){
282  for(i=0;i<neq[1];i++){
283  fext[i]=fext1[i];
284  }
285  for(i=0;i<neq[1];i++){
286  for(j=1;j<num_cpus;j++){
287  fext[i]+=fext1[i+j*neq[1]];
288  }
289  }
290  SFREE(fext1);
291  }
292 
293  /* the heat capacity matrix and mass matrix must be treated
294  separately, since the mass matrix is no recalculated
295  in each iteration, whereas the capacity matrix is */
296 
297  /* heat capacity matrix */
298 
299  if(mass[1]==1){
300  for(i=neq[0];i<neq[1];i++){
301  adb[i]=adb1[i];
302  }
303  for(i=neq[0];i<neq[1];i++){
304  for(j=1;j<num_cpus;j++){
305  adb[i]+=adb1[i+j*neq[1]];
306  }
307  }
308 
309  for(i=nzs[0];i<nzs[1];i++){
310  aub[i]=aub1[i];
311  }
312  for(i=nzs[0];i<nzs[1];i++){
313  for(j=1;j<num_cpus;j++){
314  aub[i]+=aub1[i+(long long)j*nzs[1]];
315  }
316  }
317  }
318 
319  /* mass matrix or buckling matrix */
320 
321  if((mass[0]==1)||(*buckling==1)){
322  for(i=0;i<neq[0];i++){
323  adb[i]=adb1[i];
324  }
325  for(i=0;i<neq[0];i++){
326  for(j=1;j<num_cpus;j++){
327  adb[i]+=adb1[i+j*neq[1]];
328  }
329  }
330 
331  for(i=0;i<nzs[0];i++){
332  aub[i]=aub1[i];
333  }
334  for(i=0;i<nzs[0];i++){
335  for(j=1;j<num_cpus;j++){
336  aub[i]+=aub1[i+(long long)j*nzs[1]];
337  }
338  }
339  }
340  if((mass[0]==1)||(mass[1]==1)||(*buckling==1)){
341  SFREE(adb1);SFREE(aub1);
342  }
343 
344  if(*nmethod==4){
345  for(i=0;i<mt**nk;i++){
346  fnext[i]=fnext1[i];
347  }
348  for(i=0;i<mt**nk;i++){
349  for(j=1;j<num_cpus;j++){
350  fnext[i]+=fnext1[i+j*mt**nk];
351  }
352  }
353  SFREE(fnext1);
354  }
355 
356  for(j=0;j<num_cpus;j++){
357  if(nmethod1[j]==0){
358  *nmethod=0;
359  break;
360  }
361  }
362  SFREE(nmethod1);
363 
364  /* for(k=0;k<neq[1];++k){printf("fext=%" ITGFORMAT ",%f\n",k,fext[k]);}
365  for(k=0;k<neq[1];++k){printf("ad=%" ITGFORMAT ",%f\n",k,ad[k]);}
366  for(k=0;k<nzs[1];++k){printf("au=%" ITGFORMAT ",%f\n",k,au[k]);}*/
367 
368  /* taking point forces into account in fext */
369 
370  FORTRAN(mafillsmforc,(nforc,ndirforc,nodeforc,xforc,nactdof,
371  fext,nmpc,ipompc,nodempc,ikmpc,ilmpc,
372  coefmpc,mi,rhsi,fnext,nmethod));
373 
374  return;
375 
376 }
static ITG * irow1
Definition: mafillsmmain.c:27
#define ITGFORMAT
Definition: CalculiX.h:52
static double * aub1
Definition: mafillsmmain.c:41
static ITG * iinc1
Definition: mafillsmmain.c:30
static char * lakon1
Definition: mafillsmmain.c:25
static ITG * nzl1
Definition: mafillsmmain.c:27
static ITG * ithermal1
Definition: mafillsmmain.c:30
static ITG * icol1
Definition: mafillsmmain.c:27
static ITG * iperturb1
Definition: mafillsmmain.c:30
static ITG * nk1
Definition: mafillsmmain.c:27
static double * prestr1
Definition: mafillsmmain.c:40
static double * xload1
Definition: mafillsmmain.c:39
int pthread_create(pthread_t *thread_id, const pthread_attr_t *attributes, void *(*thread_function)(void *), void *arguments)
subroutine mafillsmforc(nforc, ndirforc, nodeforc, xforc, nactdof, fext, nmpc, ipompc, nodempc, ikmpc, ilmpc, coefmpc, mi, rhsi, fnext, nmethod)
Definition: mafillsmforc.f:22
static double * dtime1
Definition: mafillsmmain.c:41
static ITG * ndirboun1
Definition: mafillsmmain.c:27
static ITG * intscheme1
Definition: mafillsmmain.c:30
static double * vold1
Definition: mafillsmmain.c:40
static ITG * istep1
Definition: mafillsmmain.c:30
static ITG * ielprop1
Definition: mafillsmmain.c:30
static ITG * nalcon1
Definition: mafillsmmain.c:30
static double * sti1
Definition: mafillsmmain.c:40
static double * xstateini1
Definition: mafillsmmain.c:41
static ITG * ndirforc1
Definition: mafillsmmain.c:27
static double * fnext1
Definition: mafillsmmain.c:45
static double * alcon1
Definition: mafillsmmain.c:40
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
static char * matname1
Definition: mafillsmmain.c:25
static ITG * ilboun1
Definition: mafillsmmain.c:30
static double * physcon1
Definition: mafillsmmain.c:41
static ITG * npmat1_
Definition: mafillsmmain.c:30
static ITG * mi1
Definition: mafillsmmain.c:30
static double * rhcon1
Definition: mafillsmmain.c:40
static ITG * ne01
Definition: mafillsmmain.c:30
static ITG * ipompc1
Definition: mafillsmmain.c:27
static ITG * nload1
Definition: mafillsmmain.c:27
static ITG * kon1
Definition: mafillsmmain.c:27
static ITG * nrhcon1
Definition: mafillsmmain.c:30
static ITG * ncmat1_
Definition: mafillsmmain.c:30
ITG getSystemCPUs()
Definition: getSystemCPUs.c:40
static ITG * nstate1_
Definition: mafillsmmain.c:30
static double * ttime1
Definition: mafillsmmain.c:41
static double * adb1
Definition: mafillsmmain.c:41
static ITG * iponoel1
Definition: mafillsmmain.c:30
static double * reltime1
Definition: mafillsmmain.c:41
static ITG * nmpc1
Definition: mafillsmmain.c:27
static ITG * nshcon1
Definition: mafillsmmain.c:30
static double * xstiff1
Definition: mafillsmmain.c:41
static ITG * ibody1
Definition: mafillsmmain.c:30
static double * springarea1
Definition: mafillsmmain.c:41
static ITG * nelcon1
Definition: mafillsmmain.c:30
static ITG * nodempc1
Definition: mafillsmmain.c:27
static double * xforc1
Definition: mafillsmmain.c:39
static double * thicke1
Definition: mafillsmmain.c:41
static double * veold1
Definition: mafillsmmain.c:41
static ITG * integerglob1
Definition: mafillsmmain.c:30
static double * co1
Definition: mafillsmmain.c:39
static ITG * nplicon1
Definition: mafillsmmain.c:30
static double * prop1
Definition: mafillsmmain.c:41
static ITG * ncocon1
Definition: mafillsmmain.c:30
static char * tieset1
Definition: mafillsmmain.c:25
static ITG * kscale1
Definition: mafillsmmain.c:30
static ITG * buckling1
Definition: mafillsmmain.c:30
static ITG * istartset1
Definition: mafillsmmain.c:30
static ITG * ilmpc1
Definition: mafillsmmain.c:30
#define SFREE(a)
Definition: CalculiX.h:41
static double * fext1
Definition: mafillsmmain.c:40
static ITG * nodeforc1
Definition: mafillsmmain.c:27
static double * pslavsurf1
Definition: mafillsmmain.c:41
static ITG * ipkon1
Definition: mafillsmmain.c:27
static ITG * nboun1
Definition: mafillsmmain.c:27
static ITG * ielorien1
Definition: mafillsmmain.c:30
static double * xboun1
Definition: mafillsmmain.c:39
static ITG * rhsi1
Definition: mafillsmmain.c:30
static ITG * ne1
Definition: mafillsmmain.c:27
static double * cocon1
Definition: mafillsmmain.c:41
void * mafillsmmt(ITG *i)
Definition: mafillsmmain.c:380
static double * elcon1
Definition: mafillsmmain.c:40
static ITG * ntmat1_
Definition: mafillsmmain.c:30
static ITG * neq1
Definition: mafillsmmain.c:27
static ITG * iendset1
Definition: mafillsmmain.c:30
static double * plicon1
Definition: mafillsmmain.c:41
static ITG * ikmpc1
Definition: mafillsmmain.c:30
static double * stx1
Definition: mafillsmmain.c:40
static double * orab1
Definition: mafillsmmain.c:40
static double * cgr1
Definition: mafillsmmain.c:39
static ITG * ikboun1
Definition: mafillsmmain.c:30
static ITG * nforc1
Definition: mafillsmmain.c:27
static double * ad1
Definition: mafillsmmain.c:40
static ITG * nplkcon1
Definition: mafillsmmain.c:30
static double * pmastsurf1
Definition: mafillsmmain.c:41
static ITG * inoel1
Definition: mafillsmmain.c:30
static double * xstate1
Definition: mafillsmmain.c:41
static double * t01
Definition: mafillsmmain.c:40
static ITG * nmethod1
Definition: mafillsmmain.c:30
static double * au1
Definition: mafillsmmain.c:40
static double * clearini1
Definition: mafillsmmain.c:41
static ITG * nactdof1
Definition: mafillsmmain.c:27
static double * doubleglob1
Definition: mafillsmmain.c:41
static ITG * ialset1
Definition: mafillsmmain.c:30
static ITG * mortar1
Definition: mafillsmmain.c:30
int pthread_join(pthread_t thread, void **status_ptr)
static ITG * norien1
Definition: mafillsmmain.c:30
static ITG * nelemload1
Definition: mafillsmmain.c:27
static double * time1
Definition: mafillsmmain.c:41
static ITG * nzs1
Definition: mafillsmmain.c:30
static double * t11
Definition: mafillsmmain.c:40
static double * shcon1
Definition: mafillsmmain.c:41
static double * coefmpc1
Definition: mafillsmmain.c:39
static ITG * stiffness1
Definition: mafillsmmain.c:30
static double * plkcon1
Definition: mafillsmmain.c:41
#define ITG
Definition: CalculiX.h:51
static ITG * mass1
Definition: mafillsmmain.c:30
static double * xloadold1
Definition: mafillsmmain.c:41
static ITG * coriolis1
Definition: mafillsmmain.c:30
static ITG * network1
Definition: mafillsmmain.c:30
static ITG * nasym1
Definition: mafillsmmain.c:30
static ITG * iexpl1
Definition: mafillsmmain.c:30
static ITG * ielmat1
Definition: mafillsmmain.c:30
static ITG num_cpus
Definition: mafillsmmain.c:30
static double * alzero1
Definition: mafillsmmain.c:40
#define NNEW(a, b, c)
Definition: CalculiX.h:39
static char * sideload1
Definition: mafillsmmain.c:25
static double * xbody1
Definition: mafillsmmain.c:39
static ITG * ntie1
Definition: mafillsmmain.c:30
static ITG * iprestr1
Definition: mafillsmmain.c:30
static ITG * ipobody1
Definition: mafillsmmain.c:27
static ITG * nodeboun1
Definition: mafillsmmain.c:27
static ITG * nbody1
Definition: mafillsmmain.c:27
static ITG * jq1
Definition: mafillsmmain.c:27

◆ mafillsmmain_se()

void mafillsmmain_se ( double *  co,
ITG nk,
ITG kon,
ITG ipkon,
char *  lakon,
ITG ne,
ITG nodeboun,
ITG ndirboun,
double *  xboun,
ITG nboun,
ITG ipompc,
ITG nodempc,
double *  coefmpc,
ITG nmpc,
ITG nodeforc,
ITG ndirforc,
double *  xforc,
ITG nforc,
ITG nelemload,
char *  sideload,
double *  xload,
ITG nload,
double *  xbody,
ITG ipobody,
ITG nbody,
double *  cgr,
ITG nactdof,
ITG neq,
ITG nmethod,
ITG ikmpc,
ITG ilmpc,
ITG ikboun,
ITG ilboun,
double *  elcon,
ITG nelcon,
double *  rhcon,
ITG nrhcon,
double *  alcon,
ITG nalcon,
double *  alzero,
ITG ielmat,
ITG ielorien,
ITG norien,
double *  orab,
ITG ntmat_,
double *  t0,
double *  t1,
ITG ithermal,
double *  prestr,
ITG iprestr,
double *  vold,
ITG iperturb,
double *  sti,
double *  stx,
ITG iexpl,
double *  plicon,
ITG nplicon,
double *  plkcon,
ITG nplkcon,
double *  xstiff,
ITG npmat_,
double *  dtime,
char *  matname,
ITG mi,
ITG ncmat_,
ITG mass,
ITG stiffness,
ITG buckling,
ITG rhs,
ITG intscheme,
double *  physcon,
double *  shcon,
ITG nshcon,
double *  cocon,
ITG ncocon,
double *  ttime,
double *  time,
ITG istep,
ITG kinc,
ITG coriolis,
ITG ibody,
double *  xloadold,
double *  reltime,
double *  veold,
double *  springarea,
ITG nstate_,
double *  xstateini,
double *  xstate,
double *  thicke,
ITG integerglob,
double *  doubleglob,
char *  tieset,
ITG istartset,
ITG iendset,
ITG ialset,
ITG ntie,
ITG nasym,
double *  pslavsurf,
double *  pmastsurf,
ITG mortar,
double *  clearini,
ITG ielprop,
double *  prop,
ITG ne0,
double *  fnext,
double *  distmin,
ITG ndesi,
ITG nodedesi,
double *  df,
ITG nzss,
ITG jqs,
ITG irows,
ITG icoordinate,
double *  dxstiff,
double *  xdesi,
ITG istartelem,
ITG ialelem,
double *  v,
double *  sigma,
ITG cyclicsymmetry,
char *  labmpc,
ITG ics,
double *  cs,
ITG mcs,
ITG ieigenfrequency 
)
83  {
84 
85  ITG i,j;
86 
87  /* variables for multithreading procedure */
88 
89  ITG sys_cpus,*ithread=NULL;
90  char *env,*envloc,*envsys;
91 
92  num_cpus = 0;
93  sys_cpus=0;
94 
95  /* explicit user declaration prevails */
96 
97  envsys=getenv("NUMBER_OF_CPUS");
98  if(envsys){
99  sys_cpus=atoi(envsys);
100  if(sys_cpus<0) sys_cpus=0;
101  }
102 
103 // sys_cpus=1;
104 
105  /* automatic detection of available number of processors */
106 
107  if(sys_cpus==0){
108  sys_cpus = getSystemCPUs();
109  if(sys_cpus<1) sys_cpus=1;
110  }
111 
112  /* local declaration prevails, if strictly positive */
113 
114  envloc = getenv("CCX_NPROC_STIFFNESS");
115  if(envloc){
116  num_cpus=atoi(envloc);
117  if(num_cpus<0){
118  num_cpus=0;
119  }else if(num_cpus>sys_cpus){
120  num_cpus=sys_cpus;
121  }
122 
123  }
124 
125  /* else global declaration, if any, applies */
126 
127  env = getenv("OMP_NUM_THREADS");
128  if(num_cpus==0){
129  if (env)
130  num_cpus = atoi(env);
131  if (num_cpus < 1) {
132  num_cpus=1;
133  }else if(num_cpus>sys_cpus){
134  num_cpus=sys_cpus;
135  }
136  }
137 
138 // next line is to be inserted in a similar way for all other paralell parts
139 
140  if(*ne<num_cpus) num_cpus=*ne;
141 
142  pthread_t tid[num_cpus];
143 
144  /* allocating fields for mass and stiffness matrix and sensitivity matrix */
145 
146  if(!*cyclicsymmetry){
147  NNEW(dfl1,double,num_cpus*60**ndesi);
148  NNEW(df1,double,num_cpus**nzss);
149  }else{
150  NNEW(dfl1,double,num_cpus*120**ndesi);
151  NNEW(df1,double,num_cpus*2**nzss);
152  }
153 
154  /* allocating memory for nmethod; if the Jacobian determinant
155  in any of the elements is nonpositive, nmethod is set to
156  zero */
157 
159  for(j=0;j<num_cpus;j++){
160  nmethod1[j]=*nmethod;
161  }
162 
163  /* calculating the stiffness and/or mass matrix
164  (symmetric part) */
165 
166  co1=co;nk1=nk;kon1=kon;ipkon1=ipkon;lakon1=lakon;ne1=ne;
167  nodeboun1=nodeboun;ndirboun1=ndirboun;xboun1=xboun;
168  nboun1=nboun;ipompc1=ipompc;nodempc1=nodempc;coefmpc1=coefmpc;
169  nmpc1=nmpc;nodeforc1=nodeforc;ndirforc1=ndirforc;xforc1=xforc;
170  nforc1=nforc;nelemload1=nelemload;sideload1=sideload;xload1=xload;
171  nload1=nload;xbody1=xbody;ipobody1=ipobody;nbody1=nbody;
172  cgr1=cgr;nactdof1=nactdof;neq1=neq;
173  ikmpc1=ikmpc;ilmpc1=ilmpc;ikboun1=ikboun;
174  ilboun1=ilboun;elcon1=elcon;nelcon1=nelcon;rhcon1=rhcon;
175  nrhcon1=nrhcon;alcon1=alcon;nalcon1=nalcon;alzero1=alzero;
176  ielmat1=ielmat;ielorien1=ielorien;norien1=norien;orab1=orab;
177  ntmat1_=ntmat_;t01=t0;t11=t1;ithermal1=ithermal;prestr1=prestr;
178  iprestr1=iprestr;vold1=vold;iperturb1=iperturb;sti1=sti;
179  stx1=stx;iexpl1=iexpl;plicon1=plicon;nplicon1=nplicon;
180  plkcon1=plkcon;nplkcon1=nplkcon;xstiff1=xstiff;npmat1_=npmat_;
181  dtime1=dtime;matname1=matname;mi1=mi;ncmat1_=ncmat_;mass1=mass;
182  stiffness1=stiffness;buckling1=buckling;rhsi1=rhsi;intscheme1=intscheme;
183  physcon1=physcon;shcon1=shcon;nshcon1=nshcon;cocon1=cocon;
184  ncocon1=ncocon;ttime1=ttime;time1=time;istep1=istep;iinc1=iinc;
185  coriolis1=coriolis;ibody1=ibody;xloadold1=xloadold;reltime1=reltime;
186  veold1=veold;springarea1=springarea;nstate1_=nstate_;xstateini1=xstateini;
187  xstate1=xstate;thicke1=thicke;integerglob1=integerglob;
188  doubleglob1=doubleglob;tieset1=tieset;istartset1=istartset;
189  iendset1=iendset;ialset1=ialset;ntie1=ntie;nasym1=nasym;
190  pslavsurf1=pslavsurf;pmastsurf1=pmastsurf;mortar1=mortar;
191  clearini1=clearini;ielprop1=ielprop;prop1=prop;ne01=ne0;
192  distmin1=distmin;ndesi1=ndesi;nodedesi1=nodedesi;v1=v;
193  nzss1=nzss;jqs1=jqs;irows1=irows;icoordinate1=icoordinate;
194  dxstiff1=dxstiff;xdesi1=xdesi;istartelem1=istartelem;ialelem1=ialelem;
195  sigma1=sigma;cyclicsymmetry1=cyclicsymmetry;labmpc1=labmpc;
196  ics1=ics;cs1=cs;mcs1=mcs;ieigenfrequency1=ieigenfrequency;
197 
198  /* calculating the stiffness/mass sensitivity */
199 
200  printf(" Using up to %" ITGFORMAT " cpu(s) for the calculation of the sensitivity of the external forces \n and/or the element stiffness matrices.\n\n", num_cpus);
201 
202  /* create threads and wait */
203 
204  NNEW(ithread,ITG,num_cpus);
205  for(i=0; i<num_cpus; i++) {
206  ithread[i]=i;
207  pthread_create(&tid[i], NULL, (void *)mafillsmsemt, (void *)&ithread[i]);
208  }
209  for(i=0; i<num_cpus; i++) pthread_join(tid[i], NULL);
210 
211  SFREE(ithread);
212 
213  for(j=0;j<num_cpus;j++){
214  if(nmethod1[j]==0){
215  *nmethod=0;
216  break;
217  }
218  }
219  SFREE(nmethod1);
220 
221  /* passing of df */
222 
223  if(!*cyclicsymmetry){
224 // if((iperturb[1]==1)&&(*ieigenfrequency!=1)){
225  if(*ieigenfrequency!=1){
226 
227  /* nonlinear geometric: add df to df from results_se */
228 
229  for(i=0;i<*nzss;i++){
230  df[i]+=df1[i];
231  }
232  }else{
233 
234  for(i=0;i<*nzss;i++){
235  df[i]=df1[i];
236  }
237  }
238  for(i=0;i<*nzss;i++){
239  for(j=1;j<num_cpus;j++){
240  df[i]+=df1[i+j**nzss];
241  }
242  }
243  }else{
244  for(i=0;i<2**nzss;i++){
245  df[i]=df1[i];
246  }
247  for(i=0;i<2**nzss;i++){
248  for(j=1;j<num_cpus;j++){
249  df[i]+=df1[i+j*2**nzss];
250  }
251  }
252  }
253  SFREE(df1);SFREE(dfl1);
254 
255  return;
256 
257 }
static ITG * nrhcon1
Definition: mafillsmmain_se.c:30
static double * orab1
Definition: mafillsmmain_se.c:40
#define ITGFORMAT
Definition: CalculiX.h:52
static ITG * ne01
Definition: mafillsmmain_se.c:30
static double * cocon1
Definition: mafillsmmain_se.c:40
static double * reltime1
Definition: mafillsmmain_se.c:40
static ITG * buckling1
Definition: mafillsmmain_se.c:30
static ITG * kon1
Definition: mafillsmmain_se.c:27
static char * lakon1
Definition: mafillsmmain_se.c:25
static ITG * nodedesi1
Definition: mafillsmmain_se.c:30
static ITG * ielorien1
Definition: mafillsmmain_se.c:30
static ITG * iinc1
Definition: mafillsmmain_se.c:30
static ITG * npmat1_
Definition: mafillsmmain_se.c:30
static double * plkcon1
Definition: mafillsmmain_se.c:40
int pthread_create(pthread_t *thread_id, const pthread_attr_t *attributes, void *(*thread_function)(void *), void *arguments)
static ITG * norien1
Definition: mafillsmmain_se.c:30
static double * dxstiff1
Definition: mafillsmmain_se.c:40
static double * xdesi1
Definition: mafillsmmain_se.c:40
static ITG * cyclicsymmetry1
Definition: mafillsmmain_se.c:30
static ITG * ncmat1_
Definition: mafillsmmain_se.c:30
static ITG * nk1
Definition: mafillsmmain_se.c:27
static ITG * iperturb1
Definition: mafillsmmain_se.c:30
subroutine df(x, u, uprime, rpar, nev)
Definition: subspace.f:133
static ITG * ncocon1
Definition: mafillsmmain_se.c:30
static ITG * stiffness1
Definition: mafillsmmain_se.c:30
static ITG * nasym1
Definition: mafillsmmain_se.c:30
static ITG * ipobody1
Definition: mafillsmmain_se.c:27
static double * xloadold1
Definition: mafillsmmain_se.c:40
static double * t11
Definition: mafillsmmain_se.c:40
static double * alcon1
Definition: mafillsmmain_se.c:40
static double * shcon1
Definition: mafillsmmain_se.c:40
static double * rhcon1
Definition: mafillsmmain_se.c:40
static ITG * nmpc1
Definition: mafillsmmain_se.c:27
static double * time1
Definition: mafillsmmain_se.c:40
static double * cs1
Definition: mafillsmmain_se.c:40
static double * plicon1
Definition: mafillsmmain_se.c:40
static ITG * ibody1
Definition: mafillsmmain_se.c:30
static double * dfl1
Definition: mafillsmmain_se.c:40
static double * df1
Definition: mafillsmmain_se.c:40
static ITG * ndirboun1
Definition: mafillsmmain_se.c:27
static ITG * integerglob1
Definition: mafillsmmain_se.c:30
static ITG * nalcon1
Definition: mafillsmmain_se.c:30
static ITG * jqs1
Definition: mafillsmmain_se.c:30
static ITG * nplkcon1
Definition: mafillsmmain_se.c:30
static ITG * neq1
Definition: mafillsmmain_se.c:27
static ITG num_cpus
Definition: mafillsmmain_se.c:30
static ITG * ntie1
Definition: mafillsmmain_se.c:30
static double * xbody1
Definition: mafillsmmain_se.c:40
static double * springarea1
Definition: mafillsmmain_se.c:40
static ITG * ilmpc1
Definition: mafillsmmain_se.c:30
static double * sti1
Definition: mafillsmmain_se.c:40
static ITG * nodeboun1
Definition: mafillsmmain_se.c:27
static double * physcon1
Definition: mafillsmmain_se.c:40
static ITG * icoordinate1
Definition: mafillsmmain_se.c:30
static double * distmin1
Definition: mafillsmmain_se.c:40
static double * xstateini1
Definition: mafillsmmain_se.c:40
ITG getSystemCPUs()
Definition: getSystemCPUs.c:40
static double * vold1
Definition: mafillsmmain_se.c:40
static double * xload1
Definition: mafillsmmain_se.c:40
static ITG * rhsi1
Definition: mafillsmmain_se.c:30
static ITG * nload1
Definition: mafillsmmain_se.c:27
static ITG * nelemload1
Definition: mafillsmmain_se.c:27
static double * sigma1
Definition: mafillsmmain_se.c:40
static ITG * ipompc1
Definition: mafillsmmain_se.c:27
static ITG * nmethod1
Definition: mafillsmmain_se.c:30
static double * elcon1
Definition: mafillsmmain_se.c:40
static double * stx1
Definition: mafillsmmain_se.c:40
static double * xstate1
Definition: mafillsmmain_se.c:40
static ITG * ithermal1
Definition: mafillsmmain_se.c:30
static ITG * nbody1
Definition: mafillsmmain_se.c:27
static ITG * istep1
Definition: mafillsmmain_se.c:30
static ITG * ndesi1
Definition: mafillsmmain_se.c:30
static ITG * nplicon1
Definition: mafillsmmain_se.c:30
static ITG * irows1
Definition: mafillsmmain_se.c:30
#define SFREE(a)
Definition: CalculiX.h:41
static ITG * istartset1
Definition: mafillsmmain_se.c:30
static ITG * nactdof1
Definition: mafillsmmain_se.c:27
static ITG * nshcon1
Definition: mafillsmmain_se.c:30
static ITG * nzss1
Definition: mafillsmmain_se.c:30
static ITG * ics1
Definition: mafillsmmain_se.c:30
static ITG * ieigenfrequency1
Definition: mafillsmmain_se.c:30
static ITG * ndirforc1
Definition: mafillsmmain_se.c:27
static ITG * coriolis1
Definition: mafillsmmain_se.c:30
static double * prestr1
Definition: mafillsmmain_se.c:40
static char * matname1
Definition: mafillsmmain_se.c:25
static char * tieset1
Definition: mafillsmmain_se.c:25
static ITG * ialelem1
Definition: mafillsmmain_se.c:30
static double * cgr1
Definition: mafillsmmain_se.c:40
static ITG * ikboun1
Definition: mafillsmmain_se.c:30
static double * xstiff1
Definition: mafillsmmain_se.c:40
static double * co1
Definition: mafillsmmain_se.c:40
static ITG * nboun1
Definition: mafillsmmain_se.c:27
static double * clearini1
Definition: mafillsmmain_se.c:40
static double * v1
Definition: mafillsmmain_se.c:40
static ITG * istartelem1
Definition: mafillsmmain_se.c:30
static double * xboun1
Definition: mafillsmmain_se.c:40
static ITG * iexpl1
Definition: mafillsmmain_se.c:30
static ITG * mcs1
Definition: mafillsmmain_se.c:30
static double * alzero1
Definition: mafillsmmain_se.c:40
static double * doubleglob1
Definition: mafillsmmain_se.c:40
static ITG * ipkon1
Definition: mafillsmmain_se.c:27
static double * pmastsurf1
Definition: mafillsmmain_se.c:40
static ITG * nstate1_
Definition: mafillsmmain_se.c:30
static double * prop1
Definition: mafillsmmain_se.c:40
int pthread_join(pthread_t thread, void **status_ptr)
void * mafillsmsemt(ITG *i)
Definition: mafillsmmain_se.c:261
static ITG * ielmat1
Definition: mafillsmmain_se.c:30
static double * veold1
Definition: mafillsmmain_se.c:40
static double * xforc1
Definition: mafillsmmain_se.c:40
#define ITG
Definition: CalculiX.h:51
static ITG * nodempc1
Definition: mafillsmmain_se.c:27
static double * pslavsurf1
Definition: mafillsmmain_se.c:40
static ITG * nelcon1
Definition: mafillsmmain_se.c:30
static ITG * mortar1
Definition: mafillsmmain_se.c:30
static char * labmpc1
Definition: mafillsmmain_se.c:25
static char * sideload1
Definition: mafillsmmain_se.c:25
static ITG * ne1
Definition: mafillsmmain_se.c:27
static ITG * mi1
Definition: mafillsmmain_se.c:30
static double * dtime1
Definition: mafillsmmain_se.c:40
static ITG * iprestr1
Definition: mafillsmmain_se.c:30
static ITG * iendset1
Definition: mafillsmmain_se.c:30
static ITG * intscheme1
Definition: mafillsmmain_se.c:30
static ITG * ilboun1
Definition: mafillsmmain_se.c:30
static double * t01
Definition: mafillsmmain_se.c:40
#define NNEW(a, b, c)
Definition: CalculiX.h:39
static ITG * nodeforc1
Definition: mafillsmmain_se.c:27
static ITG * ikmpc1
Definition: mafillsmmain_se.c:30
static double * coefmpc1
Definition: mafillsmmain_se.c:40
static ITG * nforc1
Definition: mafillsmmain_se.c:27
static ITG * ntmat1_
Definition: mafillsmmain_se.c:30
static ITG * mass1
Definition: mafillsmmain_se.c:30
static double * thicke1
Definition: mafillsmmain_se.c:40
static ITG * ielprop1
Definition: mafillsmmain_se.c:30
static double * ttime1
Definition: mafillsmmain_se.c:40
static ITG * ialset1
Definition: mafillsmmain_se.c:30

◆ mafillsmmt()

void* mafillsmmt ( ITG i)
380  {
381 
382  ITG indexad,indexfext,indexadb,nea,neb,nedelta,indexfnext;
383  long long indexau,indexaub;
384 
385  indexad=0;
386  indexau=0;
387  indexfext=0;
388  indexadb=0;
389  indexaub=0;
390  indexfnext=0;
391 
392 // if(*buckling1!=1){
393  indexad=*i*neq1[1];
394  indexau=(long long)*i*nzs1[2];
395 // }
396  if(*rhsi1==1){
397  indexfext=*i*neq1[1];
398  }
399  if(mass1[1]==1){
400  indexadb=*i*neq1[1];
401  indexaub=(long long)*i*nzs1[1];
402  }else if((mass1[0]==1)||(*buckling1==1)){
403  indexadb=*i*neq1[0];
404  indexaub=(long long)*i*nzs1[0];
405  }
406  if(nmethod1[0]==4){
407  indexfnext=*i*(mi1[1]+1)**nk1;
408  }
409 
410 
411  if((*nasym1==0)||(*ithermal1>1)){
412 
413  /* symmetric mechanical calculations or
414  thermal/thermomechanical calculations:
415  include contact elements (symmetric
416  thermal contributions are not covered by
417  mafillsmas.f) */
418 
419  nedelta=(ITG)floor(*ne1/(double)num_cpus);
420  nea=*i*nedelta+1;
421  neb=(*i+1)*nedelta;
422  if((*i==num_cpus-1)&&(neb<*ne1)) neb=*ne1;
423  }else{
424 
425  /* asymmetric mechanical calculations:
426  do not include contact elements */
427 
428  nedelta=(ITG)floor(*ne01/(double)num_cpus);
429  nea=*i*nedelta+1;
430  neb=(*i+1)*nedelta;
431  if((*i==num_cpus-1)&&(neb<*ne01)) neb=*ne01;
432  }
433 
434 
436  xboun1,nboun1,
439  nbody1,cgr1,&ad1[indexad],&au1[indexau],&fext1[indexfext],
440  nactdof1,icol1,jq1,irow1,neq1,nzl1,&nmethod1[*i],
445  nzs1,stx1,&adb1[indexadb],&aub1[indexaub],iexpl1,plicon1,
454  &fnext1[indexfnext],&nea,&neb,kscale1,iponoel1,inoel1,network1));
455 
456  return NULL;
457 }
static ITG * irow1
Definition: mafillsmmain.c:27
static double * aub1
Definition: mafillsmmain.c:41
static ITG * iinc1
Definition: mafillsmmain.c:30
static char * lakon1
Definition: mafillsmmain.c:25
static ITG * nzl1
Definition: mafillsmmain.c:27
static ITG * ithermal1
Definition: mafillsmmain.c:30
static ITG * icol1
Definition: mafillsmmain.c:27
static ITG * iperturb1
Definition: mafillsmmain.c:30
static ITG * nk1
Definition: mafillsmmain.c:27
subroutine mafillsm(co, nk, kon, ipkon, lakon, ne, nodeboun, ndirboun, xboun, nboun, ipompc, nodempc, coefmpc, nmpc, nodeforc, ndirforc, xforc, nforc, nelemload, sideload, xload, nload, xbody, ipobody, nbody, cgr, ad, au, fext, nactdof, icol, jq, irow, neq, nzl, nmethod, ikmpc, ilmpc, ikboun, ilboun, elcon, nelcon, rhcon, nrhcon, alcon, nalcon, alzero, ielmat, ielorien, norien, orab, ntmat_, t0, t1, ithermal, prestr, iprestr, vold, iperturb, sti, nzs, stx, adb, aub, iexpl, plicon, nplicon, plkcon, nplkcon, xstiff, npmat_, dtime, matname, mi, ncmat_, mass, stiffness, buckling, rhsi, intscheme, physcon, shcon, nshcon, cocon, ncocon, ttime, time, istep, iinc, coriolis, ibody, xloadold, reltime, veold, springarea, nstate_, xstateini, xstate, thicke, integerglob, doubleglob, tieset, istartset, iendset, ialset, ntie, nasym, pslavsurf, pmastsurf, mortar, clearini, ielprop, prop, ne0, fnext, nea, neb, kscale, iponoel, inoel, network)
Definition: mafillsm.f:36
static double * prestr1
Definition: mafillsmmain.c:40
static double * xload1
Definition: mafillsmmain.c:39
static double * dtime1
Definition: mafillsmmain.c:41
static ITG * ndirboun1
Definition: mafillsmmain.c:27
static ITG * intscheme1
Definition: mafillsmmain.c:30
static double * vold1
Definition: mafillsmmain.c:40
static ITG * istep1
Definition: mafillsmmain.c:30
static ITG * ielprop1
Definition: mafillsmmain.c:30
static ITG * nalcon1
Definition: mafillsmmain.c:30
static double * sti1
Definition: mafillsmmain.c:40
static double * xstateini1
Definition: mafillsmmain.c:41
static ITG * ndirforc1
Definition: mafillsmmain.c:27
static double * fnext1
Definition: mafillsmmain.c:45
static double * alcon1
Definition: mafillsmmain.c:40
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
static char * matname1
Definition: mafillsmmain.c:25
static ITG * ilboun1
Definition: mafillsmmain.c:30
static double * physcon1
Definition: mafillsmmain.c:41
static ITG * npmat1_
Definition: mafillsmmain.c:30
static ITG * mi1
Definition: mafillsmmain.c:30
static double * rhcon1
Definition: mafillsmmain.c:40
static ITG * ne01
Definition: mafillsmmain.c:30
static ITG * ipompc1
Definition: mafillsmmain.c:27
static ITG * nload1
Definition: mafillsmmain.c:27
static ITG * kon1
Definition: mafillsmmain.c:27
static ITG * nrhcon1
Definition: mafillsmmain.c:30
static ITG * ncmat1_
Definition: mafillsmmain.c:30
static ITG * nstate1_
Definition: mafillsmmain.c:30
static double * ttime1
Definition: mafillsmmain.c:41
static double * adb1
Definition: mafillsmmain.c:41
static ITG * iponoel1
Definition: mafillsmmain.c:30
static double * reltime1
Definition: mafillsmmain.c:41
static ITG * nmpc1
Definition: mafillsmmain.c:27
static ITG * nshcon1
Definition: mafillsmmain.c:30
static double * xstiff1
Definition: mafillsmmain.c:41
static ITG * ibody1
Definition: mafillsmmain.c:30
static double * springarea1
Definition: mafillsmmain.c:41
static ITG * nelcon1
Definition: mafillsmmain.c:30
static ITG * nodempc1
Definition: mafillsmmain.c:27
static double * xforc1
Definition: mafillsmmain.c:39
static double * thicke1
Definition: mafillsmmain.c:41
static double * veold1
Definition: mafillsmmain.c:41
static ITG * integerglob1
Definition: mafillsmmain.c:30
static double * co1
Definition: mafillsmmain.c:39
static ITG * nplicon1
Definition: mafillsmmain.c:30
static double * prop1
Definition: mafillsmmain.c:41
static ITG * ncocon1
Definition: mafillsmmain.c:30
static char * tieset1
Definition: mafillsmmain.c:25
static ITG * kscale1
Definition: mafillsmmain.c:30
static ITG * buckling1
Definition: mafillsmmain.c:30
static ITG * istartset1
Definition: mafillsmmain.c:30
static ITG * ilmpc1
Definition: mafillsmmain.c:30
static double * fext1
Definition: mafillsmmain.c:40
static ITG * nodeforc1
Definition: mafillsmmain.c:27
static double * pslavsurf1
Definition: mafillsmmain.c:41
static ITG * ipkon1
Definition: mafillsmmain.c:27
static ITG * nboun1
Definition: mafillsmmain.c:27
static ITG * ielorien1
Definition: mafillsmmain.c:30
static double * xboun1
Definition: mafillsmmain.c:39
static ITG * rhsi1
Definition: mafillsmmain.c:30
static ITG * ne1
Definition: mafillsmmain.c:27
static double * cocon1
Definition: mafillsmmain.c:41
static double * elcon1
Definition: mafillsmmain.c:40
static ITG * ntmat1_
Definition: mafillsmmain.c:30
static ITG * neq1
Definition: mafillsmmain.c:27
static ITG * iendset1
Definition: mafillsmmain.c:30
static double * plicon1
Definition: mafillsmmain.c:41
static ITG * ikmpc1
Definition: mafillsmmain.c:30
static double * stx1
Definition: mafillsmmain.c:40
static double * orab1
Definition: mafillsmmain.c:40
static double * cgr1
Definition: mafillsmmain.c:39
static ITG * ikboun1
Definition: mafillsmmain.c:30
static ITG * nforc1
Definition: mafillsmmain.c:27
static double * ad1
Definition: mafillsmmain.c:40
static ITG * nplkcon1
Definition: mafillsmmain.c:30
static double * pmastsurf1
Definition: mafillsmmain.c:41
static ITG * inoel1
Definition: mafillsmmain.c:30
static double * xstate1
Definition: mafillsmmain.c:41
static double * t01
Definition: mafillsmmain.c:40
static ITG * nmethod1
Definition: mafillsmmain.c:30
static double * au1
Definition: mafillsmmain.c:40
static double * clearini1
Definition: mafillsmmain.c:41
static ITG * nactdof1
Definition: mafillsmmain.c:27
static double * doubleglob1
Definition: mafillsmmain.c:41
static ITG * ialset1
Definition: mafillsmmain.c:30
static ITG * mortar1
Definition: mafillsmmain.c:30
static ITG * norien1
Definition: mafillsmmain.c:30
static ITG * nelemload1
Definition: mafillsmmain.c:27
static double * time1
Definition: mafillsmmain.c:41
static double * t11
Definition: mafillsmmain.c:40
static ITG * nzs1
Definition: mafillsmmain.c:30
static double * shcon1
Definition: mafillsmmain.c:41
static double * coefmpc1
Definition: mafillsmmain.c:39
static ITG * stiffness1
Definition: mafillsmmain.c:30
static double * plkcon1
Definition: mafillsmmain.c:41
#define ITG
Definition: CalculiX.h:51
static ITG * mass1
Definition: mafillsmmain.c:30
static double * xloadold1
Definition: mafillsmmain.c:41
static ITG * coriolis1
Definition: mafillsmmain.c:30
static ITG * network1
Definition: mafillsmmain.c:30
static ITG * nasym1
Definition: mafillsmmain.c:30
static ITG * iexpl1
Definition: mafillsmmain.c:30
static ITG * ielmat1
Definition: mafillsmmain.c:30
static ITG num_cpus
Definition: mafillsmmain.c:30
static double * alzero1
Definition: mafillsmmain.c:40
static char * sideload1
Definition: mafillsmmain.c:25
static double * xbody1
Definition: mafillsmmain.c:39
static ITG * ntie1
Definition: mafillsmmain.c:30
static ITG * iprestr1
Definition: mafillsmmain.c:30
static ITG * ipobody1
Definition: mafillsmmain.c:27
static ITG * nodeboun1
Definition: mafillsmmain.c:27
static ITG * nbody1
Definition: mafillsmmain.c:27
static ITG * jq1
Definition: mafillsmmain.c:27

◆ mafillsmsemt()

void* mafillsmsemt ( ITG i)
261  {
262 
263  ITG indexdf,indexdfl,nea,neb,nedelta;
264 
265  if(!*cyclicsymmetry1){
266  indexdf=*i**nzss1;
267  indexdfl=*i*60**ndesi1;
268  }else{
269  indexdf=*i*2**nzss1;
270  indexdfl=*i*120**ndesi1;
271  }
272 
273  nedelta=(ITG)floor(*ne1/(double)num_cpus);
274  nea=*i*nedelta+1;
275  neb=(*i+1)*nedelta;
276  if((*i==num_cpus-1)&&(neb<*ne1)) neb=*ne1;
277 
278  if(!*cyclicsymmetry1){
292  &df1[indexdf],jqs1,irows1,&dfl1[indexdfl],
295  }else{
309  &df1[indexdf],jqs1,irows1,&dfl1[indexdfl],
312  }
313 
314 
315  return NULL;
316 }
static ITG * nrhcon1
Definition: mafillsmmain_se.c:30
static double * orab1
Definition: mafillsmmain_se.c:40
static ITG * ne01
Definition: mafillsmmain_se.c:30
static double * reltime1
Definition: mafillsmmain_se.c:40
static ITG * buckling1
Definition: mafillsmmain_se.c:30
static ITG * kon1
Definition: mafillsmmain_se.c:27
static char * lakon1
Definition: mafillsmmain_se.c:25
static ITG * nodedesi1
Definition: mafillsmmain_se.c:30
static ITG * ielorien1
Definition: mafillsmmain_se.c:30
static ITG * iinc1
Definition: mafillsmmain_se.c:30
static ITG * npmat1_
Definition: mafillsmmain_se.c:30
static double * plkcon1
Definition: mafillsmmain_se.c:40
static ITG * norien1
Definition: mafillsmmain_se.c:30
static double * dxstiff1
Definition: mafillsmmain_se.c:40
static double * xdesi1
Definition: mafillsmmain_se.c:40
static ITG * cyclicsymmetry1
Definition: mafillsmmain_se.c:30
static ITG * ncmat1_
Definition: mafillsmmain_se.c:30
static ITG * nk1
Definition: mafillsmmain_se.c:27
static ITG * iperturb1
Definition: mafillsmmain_se.c:30
static ITG * stiffness1
Definition: mafillsmmain_se.c:30
static ITG * nasym1
Definition: mafillsmmain_se.c:30
static ITG * ipobody1
Definition: mafillsmmain_se.c:27
static double * xloadold1
Definition: mafillsmmain_se.c:40
static double * t11
Definition: mafillsmmain_se.c:40
static double * alcon1
Definition: mafillsmmain_se.c:40
subroutine mafillsmse(co, kon, ipkon, lakon, ne, ipompc, nodempc, coefmpc, nmpc, nelemload, sideload, xload, nload, xbody, ipobody, nbody, cgr, nactdof, neq, nmethod, ikmpc, ilmpc, elcon, nelcon, rhcon, nrhcon, alcon, nalcon, alzero, ielmat, ielorien, norien, orab, ntmat_, t0, t1, ithermal, iprestr, vold, iperturb, sti, stx, iexpl, plicon, nplicon, plkcon, nplkcon, xstiff, npmat_, dtime, matname, mi, ncmat_, mass, stiffness, buckling, rhsi, intscheme, physcon, ttime, time, istep, iinc, coriolis, ibody, xloadold, reltime, veold, springarea, nstate_, xstateini, xstate, thicke, integerglob, doubleglob, tieset, istartset, iendset, ialset, ntie, nasym, pslavsurf, pmastsurf, mortar, clearini, ielprop, prop, ne0, nea, neb, distmin, ndesi, nodedesi, df, jqs, irows, dfl, icoordinate, dxstiff, xdesi, istartelem, ialelem, v, sigma, ieigenfrequency)
Definition: mafillsmse.f:33
static double * rhcon1
Definition: mafillsmmain_se.c:40
static ITG * nmpc1
Definition: mafillsmmain_se.c:27
static double * time1
Definition: mafillsmmain_se.c:40
static double * cs1
Definition: mafillsmmain_se.c:40
static double * plicon1
Definition: mafillsmmain_se.c:40
static ITG * ibody1
Definition: mafillsmmain_se.c:30
static double * dfl1
Definition: mafillsmmain_se.c:40
static double * df1
Definition: mafillsmmain_se.c:40
static ITG * integerglob1
Definition: mafillsmmain_se.c:30
static ITG * nalcon1
Definition: mafillsmmain_se.c:30
static ITG * jqs1
Definition: mafillsmmain_se.c:30
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
static ITG * nplkcon1
Definition: mafillsmmain_se.c:30
static ITG * neq1
Definition: mafillsmmain_se.c:27
static ITG num_cpus
Definition: mafillsmmain_se.c:30
static ITG * ntie1
Definition: mafillsmmain_se.c:30
static double * xbody1
Definition: mafillsmmain_se.c:40
static double * springarea1
Definition: mafillsmmain_se.c:40
static ITG * ilmpc1
Definition: mafillsmmain_se.c:30
static double * sti1
Definition: mafillsmmain_se.c:40
static double * physcon1
Definition: mafillsmmain_se.c:40
static ITG * icoordinate1
Definition: mafillsmmain_se.c:30
static double * distmin1
Definition: mafillsmmain_se.c:40
static double * xstateini1
Definition: mafillsmmain_se.c:40
static double * vold1
Definition: mafillsmmain_se.c:40
static double * xload1
Definition: mafillsmmain_se.c:40
static ITG * rhsi1
Definition: mafillsmmain_se.c:30
static ITG * nload1
Definition: mafillsmmain_se.c:27
static ITG * nelemload1
Definition: mafillsmmain_se.c:27
static double * sigma1
Definition: mafillsmmain_se.c:40
static ITG * ipompc1
Definition: mafillsmmain_se.c:27
static ITG * nmethod1
Definition: mafillsmmain_se.c:30
static double * elcon1
Definition: mafillsmmain_se.c:40
static double * stx1
Definition: mafillsmmain_se.c:40
static double * xstate1
Definition: mafillsmmain_se.c:40
static ITG * ithermal1
Definition: mafillsmmain_se.c:30
static ITG * nbody1
Definition: mafillsmmain_se.c:27
static ITG * istep1
Definition: mafillsmmain_se.c:30
static ITG * ndesi1
Definition: mafillsmmain_se.c:30
static ITG * nplicon1
Definition: mafillsmmain_se.c:30
static ITG * irows1
Definition: mafillsmmain_se.c:30
static ITG * istartset1
Definition: mafillsmmain_se.c:30
static ITG * nactdof1
Definition: mafillsmmain_se.c:27
static ITG * nzss1
Definition: mafillsmmain_se.c:30
static ITG * ics1
Definition: mafillsmmain_se.c:30
static ITG * ieigenfrequency1
Definition: mafillsmmain_se.c:30
static ITG * coriolis1
Definition: mafillsmmain_se.c:30
static char * matname1
Definition: mafillsmmain_se.c:25
static char * tieset1
Definition: mafillsmmain_se.c:25
static ITG * ialelem1
Definition: mafillsmmain_se.c:30
static double * cgr1
Definition: mafillsmmain_se.c:40
static double * xstiff1
Definition: mafillsmmain_se.c:40
static double * co1
Definition: mafillsmmain_se.c:40
static double * clearini1
Definition: mafillsmmain_se.c:40
static double * v1
Definition: mafillsmmain_se.c:40
static ITG * istartelem1
Definition: mafillsmmain_se.c:30
static ITG * iexpl1
Definition: mafillsmmain_se.c:30
static ITG * mcs1
Definition: mafillsmmain_se.c:30
static double * alzero1
Definition: mafillsmmain_se.c:40
static double * doubleglob1
Definition: mafillsmmain_se.c:40
static ITG * ipkon1
Definition: mafillsmmain_se.c:27
static double * pmastsurf1
Definition: mafillsmmain_se.c:40
static ITG * nstate1_
Definition: mafillsmmain_se.c:30
static double * prop1
Definition: mafillsmmain_se.c:40
static ITG * ielmat1
Definition: mafillsmmain_se.c:30
static double * veold1
Definition: mafillsmmain_se.c:40
#define ITG
Definition: CalculiX.h:51
static ITG * nodempc1
Definition: mafillsmmain_se.c:27
static double * pslavsurf1
Definition: mafillsmmain_se.c:40
static ITG * nelcon1
Definition: mafillsmmain_se.c:30
static ITG * mortar1
Definition: mafillsmmain_se.c:30
static char * labmpc1
Definition: mafillsmmain_se.c:25
static char * sideload1
Definition: mafillsmmain_se.c:25
static ITG * ne1
Definition: mafillsmmain_se.c:27
static ITG * mi1
Definition: mafillsmmain_se.c:30
static double * dtime1
Definition: mafillsmmain_se.c:40
static ITG * iprestr1
Definition: mafillsmmain_se.c:30
static ITG * iendset1
Definition: mafillsmmain_se.c:30
static ITG * intscheme1
Definition: mafillsmmain_se.c:30
static double * t01
Definition: mafillsmmain_se.c:40
subroutine mafillsmcsse(co, kon, ipkon, lakon, ne, ipompc, nodempc, coefmpc, nmpc, nelemload, sideload, xload, nload, xbody, ipobody, nbody, cgr, nactdof, neq, nmethod, ikmpc, ilmpc, elcon, nelcon, rhcon, nrhcon, alcon, nalcon, alzero, ielmat, ielorien, norien, orab, ntmat_, t0, t1, ithermal, iprestr, vold, iperturb, sti, stx, iexpl, plicon, nplicon, plkcon, nplkcon, xstiff, npmat_, dtime, matname, mi, ncmat_, mass, stiffness, buckling, rhsi, intscheme, physcon, ttime, time, istep, iinc, coriolis, ibody, xloadold, reltime, veold, springarea, nstate_, xstateini, xstate, thicke, integerglob, doubleglob, tieset, istartset, iendset, ialset, ntie, nasym, pslavsurf, pmastsurf, mortar, clearini, ielprop, prop, ne0, nea, neb, distmin, ndesi, nodedesi, df, jqs, irows, dfl, icoordinate, dxstiff, xdesi, istartelem, ialelem, v, sigma, labmpc, ics, cs, mcs, nk, nzss)
Definition: mafillsmcsse.f:33
static ITG * ikmpc1
Definition: mafillsmmain_se.c:30
static double * coefmpc1
Definition: mafillsmmain_se.c:40
static ITG * ntmat1_
Definition: mafillsmmain_se.c:30
static ITG * mass1
Definition: mafillsmmain_se.c:30
static double * thicke1
Definition: mafillsmmain_se.c:40
static ITG * ielprop1
Definition: mafillsmmain_se.c:30
static double * ttime1
Definition: mafillsmmain_se.c:40
static ITG * ialset1
Definition: mafillsmmain_se.c:30

◆ mafilltcompmain()

void mafilltcompmain ( ITG nef,
ITG ipnei,
ITG neifa,
ITG neiel,
double *  vfa,
double *  xxn,
double *  area,
double *  au,
double *  ad,
ITG jq,
ITG irow,
ITG nzs,
double *  b,
double *  vel,
double *  umel,
double *  xlet,
double *  xle,
double *  gradtfa,
double *  xxi,
double *  body,
double *  volume,
ITG ielfa,
char *  lakonf,
ITG ifabou,
ITG nbody,
ITG neq,
double *  dtimef,
double *  velo,
double *  veloo,
double *  cpfa,
double *  hcfa,
double *  cvel,
double *  gradvel,
double *  xload,
double *  gammat,
double *  xrlfa,
double *  xxj,
ITG nactdohinv,
double *  a1,
double *  a2,
double *  a3,
double *  flux,
ITG iau6,
double *  xxni,
double *  xxnj 
)
45  {
46 
47  ITG i,j;
48 
49  /* variables for multithreading procedure */
50 
51  ITG sys_cpus,*ithread=NULL;
52  char *env,*envloc,*envsys;
53 
54  num_cpus = 0;
55  sys_cpus=0;
56 
57  /* explicit user declaration prevails */
58 
59  envsys=getenv("NUMBER_OF_CPUS");
60  if(envsys){
61  sys_cpus=atoi(envsys);
62  if(sys_cpus<0) sys_cpus=0;
63  }
64 
65  /* automatic detection of available number of processors */
66 
67  if(sys_cpus==0){
68  sys_cpus = getSystemCPUs();
69  if(sys_cpus<1) sys_cpus=1;
70  }
71 
72  /* local declaration prevails, if strictly positive */
73 
74  envloc = getenv("CCX_NPROC_CFD");
75  if(envloc){
76  num_cpus=atoi(envloc);
77  if(num_cpus<0){
78  num_cpus=0;
79  }else if(num_cpus>sys_cpus){
80  num_cpus=sys_cpus;
81  }
82 
83  }
84 
85  /* else global declaration, if any, applies */
86 
87  env = getenv("OMP_NUM_THREADS");
88  if(num_cpus==0){
89  if (env)
90  num_cpus = atoi(env);
91  if (num_cpus < 1) {
92  num_cpus=1;
93  }else if(num_cpus>sys_cpus){
94  num_cpus=sys_cpus;
95  }
96  }
97 
98 // next line is to be inserted in a similar way for all other paralell parts
99 
100  if(*nef<num_cpus) num_cpus=*nef;
101 
102  pthread_t tid[num_cpus];
103 
104  /* calculating the stiffness and/or mass matrix
105  (symmetric part) */
106 
107  nef1=nef;ipnei1=ipnei;neifa1=neifa;neiel1=neiel;vfa1=vfa;xxn1=xxn;
108  area1=area;
109  jq1=jq;irow1=irow;nzs1=nzs;vel1=vel;umel1=umel;xlet1=xlet;xle1=xle;
110  gradtfa1=gradtfa;xxi1=xxi;body1=body;volume1=volume;
111  ielfa1=ielfa;lakonf1=lakonf;ifabou1=ifabou;
112  nbody1=nbody;neq1=neq;dtimef1=dtimef;velo1=velo;veloo1=veloo;
113  cvfa1=cvfa;hcfa1=hcfa;cvel1=cvel;gradvel1=gradvel;xload1=xload;
114  gamma1=gamma;xrlfa1=xrlfa;xxj1=xxj;nactdohinv1=nactdohinv;a11=a1;
115  a21=a2;a31=a3;flux1=flux;iau61=iau6;ad1=ad;au1=au;b1=b;xxni1=xxni;
116  xxnj1=xxnj;
117 
118  /* create threads and wait */
119 
120  NNEW(ithread,ITG,num_cpus);
121  for(i=0; i<num_cpus; i++) {
122  ithread[i]=i;
123  pthread_create(&tid[i], NULL, (void *)mafilltcompmt, (void *)&ithread[i]);
124  }
125  for(i=0; i<num_cpus; i++) pthread_join(tid[i], NULL);
126 
127  SFREE(ithread);
128 
129  return;
130 
131 }
static double * umel1
Definition: mafilltcompmain.c:30
static double * xle1
Definition: mafilltcompmain.c:30
static double * xload1
Definition: mafilltcompmain.c:30
static ITG * neq1
Definition: mafilltcompmain.c:27
static double * area1
Definition: mafilltcompmain.c:30
int pthread_create(pthread_t *thread_id, const pthread_attr_t *attributes, void *(*thread_function)(void *), void *arguments)
static double * xrlfa1
Definition: mafilltcompmain.c:30
static double * ad1
Definition: mafilltcompmain.c:30
static ITG * nbody1
Definition: mafilltcompmain.c:27
static double * hcfa1
Definition: mafilltcompmain.c:30
static double * a21
Definition: mafilltcompmain.c:30
static double * gamma1
Definition: mafilltcompmain.c:30
static char * lakonf1
Definition: mafilltcompmain.c:25
void * mafilltcompmt(ITG *i)
Definition: mafilltcompmain.c:135
subroutine flux(node1, node2, nodem, nelem, lakon, kon, ipkon, nactdog, identity, ielprop, prop, kflag, v, xflow, f, nodef, idirf, df, cp, R, rho, physcon, g, co, dvi, numf, vold, set, shcon, nshcon, rhcon, nrhcon, ntmat_, mi, ider, ttime, time, iaxial)
Definition: flux.f:24
static double * xxn1
Definition: mafilltcompmain.c:30
static ITG * nef1
Definition: mafilltcompmain.c:27
static double * xxni1
Definition: mafilltcompmain.c:30
static ITG * nzs1
Definition: mafilltcompmain.c:27
static double * cvel1
Definition: mafilltcompmain.c:30
ITG getSystemCPUs()
Definition: getSystemCPUs.c:40
static double * cvfa1
Definition: mafilltcompmain.c:30
static double * volume1
Definition: mafilltcompmain.c:30
static double * veloo1
Definition: mafilltcompmain.c:30
static double * velo1
Definition: mafilltcompmain.c:30
static double * xxi1
Definition: mafilltcompmain.c:30
static ITG * ipnei1
Definition: mafilltcompmain.c:27
static double * vel1
Definition: mafilltcompmain.c:30
#define SFREE(a)
Definition: CalculiX.h:41
static ITG * irow1
Definition: mafilltcompmain.c:27
static double * a31
Definition: mafilltcompmain.c:30
static ITG * jq1
Definition: mafilltcompmain.c:27
static double * dtimef1
Definition: mafilltcompmain.c:30
static ITG * neifa1
Definition: mafilltcompmain.c:27
static double * xxj1
Definition: mafilltcompmain.c:30
static double * xlet1
Definition: mafilltcompmain.c:30
static ITG * nactdohinv1
Definition: mafilltcompmain.c:27
static ITG * neiel1
Definition: mafilltcompmain.c:27
static double * b1
Definition: mafilltcompmain.c:30
static double * gradvel1
Definition: mafilltcompmain.c:30
static double * body1
Definition: mafilltcompmain.c:30
int pthread_join(pthread_t thread, void **status_ptr)
static ITG * ielfa1
Definition: mafilltcompmain.c:27
static ITG iau61
Definition: mafilltcompmain.c:27
static double * au1
Definition: mafilltcompmain.c:30
static ITG * ifabou1
Definition: mafilltcompmain.c:27
#define ITG
Definition: CalculiX.h:51
static double * gradtfa1
Definition: mafilltcompmain.c:30
static double * vfa1
Definition: mafilltcompmain.c:30
static ITG num_cpus
Definition: mafilltcompmain.c:27
#define NNEW(a, b, c)
Definition: CalculiX.h:39
static double * a11
Definition: mafilltcompmain.c:30
static double * xxnj1
Definition: mafilltcompmain.c:30
static double * flux1
Definition: mafilltcompmain.c:30

◆ mafilltcompmt()

void* mafilltcompmt ( ITG i)
135  {
136 
137  ITG nefa,nefb,nefdelta;
138 
139 // ceil -> floor
140 
141  nefdelta=(ITG)floor(*nef1/(double)num_cpus);
142  nefa=*i*nefdelta+1;
143  nefb=(*i+1)*nefdelta;
144 // next line! -> all parallel sections
145  if((*i==num_cpus-1)&&(nefb<*nef1)) nefb=*nef1;
146 
148  au1,ad1,jq1,irow1,nzs1,
153  a11,a21,a31,flux1,&nefa,&nefb,iau61,xxni1,xxnj1));
154 
155  return NULL;
156 }
static double * umel1
Definition: mafilltcompmain.c:30
static double * xle1
Definition: mafilltcompmain.c:30
static double * xload1
Definition: mafilltcompmain.c:30
static ITG * neq1
Definition: mafilltcompmain.c:27
subroutine mafilltcomp(nef, ipnei, neifa, neiel, vfa, xxn, area, au, ad, jq, irow, nzs, b, vel, umel, xlet, xle, gradtfa, xxi, body, volume, ielfa, lakonf, ifabou, nbody, neq, dtimef, velo, veloo, cvfa, hcfa, cvel, gradvel, xload, gamma, xrlfa, xxj, nactdohinv, a1, a2, a3, flux, nefa, nefb, iau6, xxni, xxnj)
Definition: mafilltcomp.f:24
static double * area1
Definition: mafilltcompmain.c:30
static double * xrlfa1
Definition: mafilltcompmain.c:30
static double * ad1
Definition: mafilltcompmain.c:30
static ITG * nbody1
Definition: mafilltcompmain.c:27
static double * hcfa1
Definition: mafilltcompmain.c:30
static double * a21
Definition: mafilltcompmain.c:30
static double * gamma1
Definition: mafilltcompmain.c:30
static char * lakonf1
Definition: mafilltcompmain.c:25
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
static double * xxn1
Definition: mafilltcompmain.c:30
static ITG * nef1
Definition: mafilltcompmain.c:27
static double * xxni1
Definition: mafilltcompmain.c:30
static ITG * nzs1
Definition: mafilltcompmain.c:27
static double * cvel1
Definition: mafilltcompmain.c:30
static double * cvfa1
Definition: mafilltcompmain.c:30
static double * volume1
Definition: mafilltcompmain.c:30
static double * veloo1
Definition: mafilltcompmain.c:30
static double * velo1
Definition: mafilltcompmain.c:30
static double * xxi1
Definition: mafilltcompmain.c:30
static ITG * ipnei1
Definition: mafilltcompmain.c:27
static double * vel1
Definition: mafilltcompmain.c:30
static ITG * irow1
Definition: mafilltcompmain.c:27
static double * a31
Definition: mafilltcompmain.c:30
static ITG * jq1
Definition: mafilltcompmain.c:27
static double * dtimef1
Definition: mafilltcompmain.c:30
static ITG * neifa1
Definition: mafilltcompmain.c:27
static double * xxj1
Definition: mafilltcompmain.c:30
static double * xlet1
Definition: mafilltcompmain.c:30
static ITG * nactdohinv1
Definition: mafilltcompmain.c:27
static ITG * neiel1
Definition: mafilltcompmain.c:27
static double * b1
Definition: mafilltcompmain.c:30
static double * gradvel1
Definition: mafilltcompmain.c:30
static double * body1
Definition: mafilltcompmain.c:30
static ITG * ielfa1
Definition: mafilltcompmain.c:27
static ITG iau61
Definition: mafilltcompmain.c:27
static double * au1
Definition: mafilltcompmain.c:30
static ITG * ifabou1
Definition: mafilltcompmain.c:27
#define ITG
Definition: CalculiX.h:51
static double * gradtfa1
Definition: mafilltcompmain.c:30
static double * vfa1
Definition: mafilltcompmain.c:30
static ITG num_cpus
Definition: mafilltcompmain.c:27
static double * a11
Definition: mafilltcompmain.c:30
static double * xxnj1
Definition: mafilltcompmain.c:30
static double * flux1
Definition: mafilltcompmain.c:30

◆ mafilltmain()

void mafilltmain ( ITG nef,
ITG ipnei,
ITG neifa,
ITG neiel,
double *  vfa,
double *  xxn,
double *  area,
double *  au,
double *  ad,
ITG jq,
ITG irow,
ITG nzs,
double *  b,
double *  vel,
double *  umel,
double *  xlet,
double *  xle,
double *  gradtfa,
double *  xxi,
double *  body,
double *  volume,
ITG ielfa,
char *  lakonf,
ITG ifabou,
ITG nbody,
ITG neq,
double *  dtimef,
double *  velo,
double *  veloo,
double *  cpfa,
double *  hcfa,
double *  cvel,
double *  gradvel,
double *  xload,
double *  gammat,
double *  xrlfa,
double *  xxj,
ITG nactdohinv,
double *  a1,
double *  a2,
double *  a3,
double *  flux,
ITG iau6,
double *  xxni,
double *  xxnj,
ITG iturbulent 
)
46  {
47 
48  ITG i,j;
49 
50  /* variables for multithreading procedure */
51 
52  ITG sys_cpus,*ithread=NULL;
53  char *env,*envloc,*envsys;
54 
55  num_cpus = 0;
56  sys_cpus=0;
57 
58  /* explicit user declaration prevails */
59 
60  envsys=getenv("NUMBER_OF_CPUS");
61  if(envsys){
62  sys_cpus=atoi(envsys);
63  if(sys_cpus<0) sys_cpus=0;
64  }
65 
66  /* automatic detection of available number of processors */
67 
68  if(sys_cpus==0){
69  sys_cpus = getSystemCPUs();
70  if(sys_cpus<1) sys_cpus=1;
71  }
72 
73  /* local declaration prevails, if strictly positive */
74 
75  envloc = getenv("CCX_NPROC_CFD");
76  if(envloc){
77  num_cpus=atoi(envloc);
78  if(num_cpus<0){
79  num_cpus=0;
80  }else if(num_cpus>sys_cpus){
81  num_cpus=sys_cpus;
82  }
83 
84  }
85 
86  /* else global declaration, if any, applies */
87 
88  env = getenv("OMP_NUM_THREADS");
89  if(num_cpus==0){
90  if (env)
91  num_cpus = atoi(env);
92  if (num_cpus < 1) {
93  num_cpus=1;
94  }else if(num_cpus>sys_cpus){
95  num_cpus=sys_cpus;
96  }
97  }
98 
99 // next line is to be inserted in a similar way for all other paralell parts
100 
101  if(*nef<num_cpus) num_cpus=*nef;
102 
103  pthread_t tid[num_cpus];
104 
105  /* calculating the stiffness and/or mass matrix
106  (symmetric part) */
107 
108  nef1=nef;ipnei1=ipnei;neifa1=neifa;neiel1=neiel;vfa1=vfa;xxn1=xxn;
109  area1=area;
110  jq1=jq;irow1=irow;nzs1=nzs;vel1=vel;umel1=umel;xlet1=xlet;xle1=xle;
111  gradtfa1=gradtfa;xxi1=xxi;body1=body;volume1=volume;
112  ielfa1=ielfa;lakonf1=lakonf;ifabou1=ifabou;
113  nbody1=nbody;neq1=neq;dtimef1=dtimef;velo1=velo;veloo1=veloo;
114  cvfa1=cvfa;hcfa1=hcfa;cvel1=cvel;gradvel1=gradvel;xload1=xload;
115  gamma1=gamma;xrlfa1=xrlfa;xxj1=xxj;nactdohinv1=nactdohinv;a11=a1;
116  a21=a2;a31=a3;flux1=flux;iau61=iau6;ad1=ad;au1=au;b1=b;xxni1=xxni;
117  xxnj1=xxnj;iturbulent1=iturbulent;
118 
119  /* create threads and wait */
120 
121  NNEW(ithread,ITG,num_cpus);
122  for(i=0; i<num_cpus; i++) {
123  ithread[i]=i;
124  pthread_create(&tid[i], NULL, (void *)mafilltmt, (void *)&ithread[i]);
125  }
126  for(i=0; i<num_cpus; i++) pthread_join(tid[i], NULL);
127 
128  SFREE(ithread);
129 
130  return;
131 
132 }
static double * cvfa1
Definition: mafilltmain.c:30
static double * xxni1
Definition: mafilltmain.c:30
static ITG * iturbulent1
Definition: mafilltmain.c:27
static double * flux1
Definition: mafilltmain.c:30
static double * volume1
Definition: mafilltmain.c:30
int pthread_create(pthread_t *thread_id, const pthread_attr_t *attributes, void *(*thread_function)(void *), void *arguments)
static double * gradtfa1
Definition: mafilltmain.c:30
static ITG * ipnei1
Definition: mafilltmain.c:27
static double * body1
Definition: mafilltmain.c:30
static ITG * ielfa1
Definition: mafilltmain.c:27
static double * dtimef1
Definition: mafilltmain.c:30
static double * xxn1
Definition: mafilltmain.c:30
subroutine flux(node1, node2, nodem, nelem, lakon, kon, ipkon, nactdog, identity, ielprop, prop, kflag, v, xflow, f, nodef, idirf, df, cp, R, rho, physcon, g, co, dvi, numf, vold, set, shcon, nshcon, rhcon, nrhcon, ntmat_, mi, ider, ttime, time, iaxial)
Definition: flux.f:24
static ITG * ifabou1
Definition: mafilltmain.c:27
static double * a31
Definition: mafilltmain.c:30
static double * gradvel1
Definition: mafilltmain.c:30
static double * velo1
Definition: mafilltmain.c:30
ITG getSystemCPUs()
Definition: getSystemCPUs.c:40
static double * cvel1
Definition: mafilltmain.c:30
static ITG num_cpus
Definition: mafilltmain.c:27
static ITG * irow1
Definition: mafilltmain.c:27
static double * ad1
Definition: mafilltmain.c:30
static double * gamma1
Definition: mafilltmain.c:30
static double * a21
Definition: mafilltmain.c:30
void * mafilltmt(ITG *i)
Definition: mafilltmain.c:136
static double * vfa1
Definition: mafilltmain.c:30
static double * a11
Definition: mafilltmain.c:30
static double * xlet1
Definition: mafilltmain.c:30
static ITG * jq1
Definition: mafilltmain.c:27
static ITG * neq1
Definition: mafilltmain.c:27
#define SFREE(a)
Definition: CalculiX.h:41
static double * xrlfa1
Definition: mafilltmain.c:30
static ITG * nzs1
Definition: mafilltmain.c:27
static double * umel1
Definition: mafilltmain.c:30
static ITG * neifa1
Definition: mafilltmain.c:27
static double * veloo1
Definition: mafilltmain.c:30
static ITG * nbody1
Definition: mafilltmain.c:27
static ITG * nactdohinv1
Definition: mafilltmain.c:27
static ITG * iau61
Definition: mafilltmain.c:27
static double * xxj1
Definition: mafilltmain.c:30
static char * lakonf1
Definition: mafilltmain.c:25
static double * b1
Definition: mafilltmain.c:30
static double * xxnj1
Definition: mafilltmain.c:30
static double * vel1
Definition: mafilltmain.c:30
int pthread_join(pthread_t thread, void **status_ptr)
static double * xxi1
Definition: mafilltmain.c:30
#define ITG
Definition: CalculiX.h:51
static double * xload1
Definition: mafilltmain.c:30
static ITG * nef1
Definition: mafilltmain.c:27
static double * hcfa1
Definition: mafilltmain.c:30
static ITG * neiel1
Definition: mafilltmain.c:27
static double * au1
Definition: mafilltmain.c:30
#define NNEW(a, b, c)
Definition: CalculiX.h:39
static double * area1
Definition: mafilltmain.c:30
static double * xle1
Definition: mafilltmain.c:30

◆ mafilltmt()

void* mafilltmt ( ITG i)
136  {
137 
138  ITG nefa,nefb,nefdelta;
139 
140 // ceil -> floor
141 
142  nefdelta=(ITG)floor(*nef1/(double)num_cpus);
143  nefa=*i*nefdelta+1;
144  nefb=(*i+1)*nefdelta;
145 // next line! -> all parallel sections
146  if((*i==num_cpus-1)&&(nefb<*nef1)) nefb=*nef1;
147 
149  au1,ad1,jq1,irow1,nzs1,
154  a11,a21,a31,flux1,&nefa,&nefb,iau61,xxni1,xxnj1,
155  iturbulent1));
156 
157  return NULL;
158 }
static double * cvfa1
Definition: mafilltmain.c:30
static double * xxni1
Definition: mafilltmain.c:30
static ITG * iturbulent1
Definition: mafilltmain.c:27
static double * flux1
Definition: mafilltmain.c:30
static double * volume1
Definition: mafilltmain.c:30
static double * gradtfa1
Definition: mafilltmain.c:30
static ITG * ipnei1
Definition: mafilltmain.c:27
static double * body1
Definition: mafilltmain.c:30
static ITG * ielfa1
Definition: mafilltmain.c:27
static double * dtimef1
Definition: mafilltmain.c:30
static double * xxn1
Definition: mafilltmain.c:30
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
static ITG * ifabou1
Definition: mafilltmain.c:27
static double * a31
Definition: mafilltmain.c:30
static double * gradvel1
Definition: mafilltmain.c:30
static double * velo1
Definition: mafilltmain.c:30
static double * cvel1
Definition: mafilltmain.c:30
static ITG num_cpus
Definition: mafilltmain.c:27
static ITG * irow1
Definition: mafilltmain.c:27
static double * ad1
Definition: mafilltmain.c:30
static double * gamma1
Definition: mafilltmain.c:30
static double * a21
Definition: mafilltmain.c:30
static double * vfa1
Definition: mafilltmain.c:30
static double * a11
Definition: mafilltmain.c:30
static double * xlet1
Definition: mafilltmain.c:30
static ITG * jq1
Definition: mafilltmain.c:27
static ITG * neq1
Definition: mafilltmain.c:27
static double * xrlfa1
Definition: mafilltmain.c:30
static ITG * nzs1
Definition: mafilltmain.c:27
static double * umel1
Definition: mafilltmain.c:30
static ITG * neifa1
Definition: mafilltmain.c:27
static double * veloo1
Definition: mafilltmain.c:30
static ITG * nbody1
Definition: mafilltmain.c:27
static ITG * nactdohinv1
Definition: mafilltmain.c:27
static ITG * iau61
Definition: mafilltmain.c:27
static double * xxj1
Definition: mafilltmain.c:30
static char * lakonf1
Definition: mafilltmain.c:25
static double * b1
Definition: mafilltmain.c:30
static double * xxnj1
Definition: mafilltmain.c:30
subroutine mafillt(nef, ipnei, neifa, neiel, vfa, xxn, area, au, ad, jq, irow, nzs, b, vel, umel, xlet, xle, gradtfa, xxi, body, volume, ielfa, lakonf, ifabou, nbody, neq, dtimef, velo, veloo, cvfa, hcfa, cvel, gradvel, xload, gamma, xrlfa, xxj, nactdohinv, a1, a2, a3, flux, nefa, nefb, iau6, xxni, xxnj, iturbulent)
Definition: mafillt.f:25
static double * vel1
Definition: mafilltmain.c:30
static double * xxi1
Definition: mafilltmain.c:30
#define ITG
Definition: CalculiX.h:51
static double * xload1
Definition: mafilltmain.c:30
static ITG * nef1
Definition: mafilltmain.c:27
static double * hcfa1
Definition: mafilltmain.c:30
static ITG * neiel1
Definition: mafilltmain.c:27
static double * au1
Definition: mafilltmain.c:30
static double * area1
Definition: mafilltmain.c:30
static double * xle1
Definition: mafilltmain.c:30

◆ mafillv0mt()

void* mafillv0mt ( ITG i)

◆ mafillv1mt()

void* mafillv1mt ( ITG i)

◆ mafillv2mt()

void* mafillv2mt ( ITG i)

◆ mafillv3mt()

void* mafillv3mt ( ITG i)

◆ mafillvcompmain()

void mafillvcompmain ( ITG nef,
ITG ipnei,
ITG neifa,
ITG neiel,
double *  vfa,
double *  xxn,
double *  area,
double *  au,
double *  ad,
ITG jq,
ITG irow,
ITG nzs,
double *  b,
double *  vel,
double *  cosa,
double *  umfa,
double *  xlet,
double *  xle,
double *  gradvfa,
double *  xxi,
double *  body,
double *  volume,
ITG ielfa,
char *  lakonf,
ITG ifabou,
ITG nbody,
double *  dtimef,
double *  velo,
double *  veloo,
double *  sel,
double *  xrlfa,
double *  gamma,
double *  xxj,
ITG nactdohinv,
double *  a1,
double *  a2,
double *  a3,
double *  flux,
ITG icyclic,
double *  c,
ITG ifatie,
ITG iau6,
double *  xxni,
double *  xxnj 
)
45  {
46 
47  ITG i,j;
48 
49  /* variables for multithreading procedure */
50 
51  ITG sys_cpus,*ithread=NULL;
52  char *env,*envloc,*envsys;
53 
54 // printf("entered mafillvcompmain \n");
55 
56  num_cpus = 0;
57  sys_cpus=0;
58 
59  /* explicit user declaration prevails */
60 
61  envsys=getenv("NUMBER_OF_CPUS");
62  if(envsys){
63  sys_cpus=atoi(envsys);
64  if(sys_cpus<0) sys_cpus=0;
65  }
66 
67  /* automatic detection of available number of processors */
68 
69  if(sys_cpus==0){
70  sys_cpus = getSystemCPUs();
71  if(sys_cpus<1) sys_cpus=1;
72  }
73 
74  /* local declaration prevails, if strictly positive */
75 
76  envloc = getenv("CCX_NPROC_CFD");
77  if(envloc){
78  num_cpus=atoi(envloc);
79  if(num_cpus<0){
80  num_cpus=0;
81  }else if(num_cpus>sys_cpus){
82  num_cpus=sys_cpus;
83  }
84 
85  }
86 
87  /* else global declaration, if any, applies */
88 
89  env = getenv("OMP_NUM_THREADS");
90  if(num_cpus==0){
91  if (env)
92  num_cpus = atoi(env);
93  if (num_cpus < 1) {
94  num_cpus=1;
95  }else if(num_cpus>sys_cpus){
96  num_cpus=sys_cpus;
97  }
98  }
99 
100 // next line is to be inserted in a similar way for all other paralell parts
101 
102  if(*nef<num_cpus) num_cpus=*nef;
103 
104  pthread_t tid[num_cpus];
105 
106  /* calculating the stiffness and/or mass matrix
107  (symmetric part) */
108 
109  nef1=nef;ipnei1=ipnei;neifa1=neifa;neiel1=neiel;vfa1=vfa;xxn1=xxn;
110  area1=area;jq1=jq;irow1=irow;nzs1=nzs;vel1=vel;cosa1=cosa;umfa1=umfa;
111  xlet1=xlet;xle1=xle;gradvfa1=gradvfa;xxi1=xxi;body1=body;volume1=volume;
112  ielfa1=ielfa;lakonf1=lakonf;ifabou1=ifabou;nbody1=nbody;
113  dtimef1=dtimef;velo1=velo;veloo1=veloo;sel1=sel;xrlfa1=xrlfa;
114  gamma1=gamma;xxj1=xxj;nactdohinv1=nactdohinv;a11=a1;a21=a2;a31=a3;
115  flux1=flux;icyclic1=icyclic;c1=c;ifatie1=ifatie;iau61=iau6;
116  adv1=adv;auv1=auv;bv1=bv;xxni1=xxni;xxnj1=xxnj;
117 
118  /* create threads and wait */
119 
120  NNEW(ithread,ITG,num_cpus);
121  for(i=0; i<num_cpus; i++) {
122  ithread[i]=i;
123  pthread_create(&tid[i], NULL, (void *)mafillvcompmt, (void *)&ithread[i]);
124  }
125  for(i=0; i<num_cpus; i++) pthread_join(tid[i], NULL);
126 
127  SFREE(ithread);
128 
129  return;
130 
131 }
static double * xle1
Definition: mafillvcompmain.c:30
static double * xxnj1
Definition: mafillvcompmain.c:30
static double * cosa1
Definition: mafillvcompmain.c:30
static ITG * nbody1
Definition: mafillvcompmain.c:27
static double * flux1
Definition: mafillvcompmain.c:30
static double * vfa1
Definition: mafillvcompmain.c:30
static ITG num_cpus
Definition: mafillvcompmain.c:27
int pthread_create(pthread_t *thread_id, const pthread_attr_t *attributes, void *(*thread_function)(void *), void *arguments)
static double * xxn1
Definition: mafillvcompmain.c:30
static ITG * nef1
Definition: mafillvcompmain.c:27
static ITG * ifatie1
Definition: mafillvcompmain.c:27
static double * xrlfa1
Definition: mafillvcompmain.c:30
static double * area1
Definition: mafillvcompmain.c:30
static double * xxni1
Definition: mafillvcompmain.c:30
static double * a21
Definition: mafillvcompmain.c:30
subroutine flux(node1, node2, nodem, nelem, lakon, kon, ipkon, nactdog, identity, ielprop, prop, kflag, v, xflow, f, nodef, idirf, df, cp, R, rho, physcon, g, co, dvi, numf, vold, set, shcon, nshcon, rhcon, nrhcon, ntmat_, mi, ider, ttime, time, iaxial)
Definition: flux.f:24
static double * gamma1
Definition: mafillvcompmain.c:30
static char * lakonf1
Definition: mafillvcompmain.c:25
static double * c1
Definition: mafillvcompmain.c:30
static double * xxi1
Definition: mafillvcompmain.c:30
ITG getSystemCPUs()
Definition: getSystemCPUs.c:40
static double * veloo1
Definition: mafillvcompmain.c:30
static ITG * nzs1
Definition: mafillvcompmain.c:27
void * mafillvcompmt(ITG *i)
Definition: mafillvcompmain.c:135
static ITG * neifa1
Definition: mafillvcompmain.c:27
#define SFREE(a)
Definition: CalculiX.h:41
static double * volume1
Definition: mafillvcompmain.c:30
static double * vel1
Definition: mafillvcompmain.c:30
static double * a31
Definition: mafillvcompmain.c:30
static ITG * neiel1
Definition: mafillvcompmain.c:27
static double * sel1
Definition: mafillvcompmain.c:30
static double * velo1
Definition: mafillvcompmain.c:30
static double * xxj1
Definition: mafillvcompmain.c:30
static ITG * ipnei1
Definition: mafillvcompmain.c:27
static double * bv1
Definition: mafillvcompmain.c:30
static ITG * iau61
Definition: mafillvcompmain.c:27
static double * dtimef1
Definition: mafillvcompmain.c:30
static double * umfa1
Definition: mafillvcompmain.c:30
static ITG * irow1
Definition: mafillvcompmain.c:27
static ITG * ielfa1
Definition: mafillvcompmain.c:27
static ITG * nactdohinv1
Definition: mafillvcompmain.c:27
static double * gradvfa1
Definition: mafillvcompmain.c:30
int pthread_join(pthread_t thread, void **status_ptr)
static ITG * jq1
Definition: mafillvcompmain.c:27
static double * xlet1
Definition: mafillvcompmain.c:30
#define ITG
Definition: CalculiX.h:51
static double * auv1
Definition: mafillvcompmain.c:30
static ITG * icyclic1
Definition: mafillvcompmain.c:27
static double * adv1
Definition: mafillvcompmain.c:30
#define NNEW(a, b, c)
Definition: CalculiX.h:39
static double * body1
Definition: mafillvcompmain.c:30
static ITG * ifabou1
Definition: mafillvcompmain.c:27
static double * a11
Definition: mafillvcompmain.c:30

◆ mafillvcompmt()

void* mafillvcompmt ( ITG i)
135  {
136 
137  ITG nefa,nefb,nefdelta;
138 
139 // ceil -> floor
140 
141  nefdelta=(ITG)floor(*nef1/(double)num_cpus);
142  nefa=*i*nefdelta+1;
143  nefb=(*i+1)*nefdelta;
144 // next line! -> all parallel sections
145  if((*i==num_cpus-1)&&(nefb<*nef1)) nefb=*nef1;
146 
152  a21,a31,flux1,&nefa,&nefb,icyclic1,c1,ifatie1,iau61,
153  xxni1,xxnj1));
154 
155  return NULL;
156 }
static double * xle1
Definition: mafillvcompmain.c:30
static double * xxnj1
Definition: mafillvcompmain.c:30
static double * cosa1
Definition: mafillvcompmain.c:30
static ITG * nbody1
Definition: mafillvcompmain.c:27
static double * flux1
Definition: mafillvcompmain.c:30
static double * vfa1
Definition: mafillvcompmain.c:30
static ITG num_cpus
Definition: mafillvcompmain.c:27
static double * xxn1
Definition: mafillvcompmain.c:30
static ITG * nef1
Definition: mafillvcompmain.c:27
static ITG * ifatie1
Definition: mafillvcompmain.c:27
static double * xrlfa1
Definition: mafillvcompmain.c:30
subroutine mafillvcomp(nef, ipnei, neifa, neiel, vfa, xxn, area, auv, adv, jq, irow, nzs, bv, vel, cosa, umfa, xlet, xle, gradvfa, xxi, body, volume, ielfa, lakonf, ifabou, nbody, dtimef, velo, veloo, sel, xrlfa, gamma, xxj, nactdohinv, a1, a2, a3, flux, nefa, nefb, icyclic, c, ifatie, iau6, xxni, xxnj)
Definition: mafillvcomp.f:24
static double * area1
Definition: mafillvcompmain.c:30
static double * xxni1
Definition: mafillvcompmain.c:30
static double * a21
Definition: mafillvcompmain.c:30
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
static double * gamma1
Definition: mafillvcompmain.c:30
static char * lakonf1
Definition: mafillvcompmain.c:25
static double * c1
Definition: mafillvcompmain.c:30
static double * xxi1
Definition: mafillvcompmain.c:30
static double * veloo1
Definition: mafillvcompmain.c:30
static ITG * nzs1
Definition: mafillvcompmain.c:27
static ITG * neifa1
Definition: mafillvcompmain.c:27
static double * volume1
Definition: mafillvcompmain.c:30
static double * vel1
Definition: mafillvcompmain.c:30
static double * a31
Definition: mafillvcompmain.c:30
static ITG * neiel1
Definition: mafillvcompmain.c:27
static double * sel1
Definition: mafillvcompmain.c:30
static double * velo1
Definition: mafillvcompmain.c:30
static double * xxj1
Definition: mafillvcompmain.c:30
static ITG * ipnei1
Definition: mafillvcompmain.c:27
static double * bv1
Definition: mafillvcompmain.c:30
static ITG * iau61
Definition: mafillvcompmain.c:27
static double * dtimef1
Definition: mafillvcompmain.c:30
static double * umfa1
Definition: mafillvcompmain.c:30
static ITG * irow1
Definition: mafillvcompmain.c:27
static ITG * ielfa1
Definition: mafillvcompmain.c:27
static ITG * nactdohinv1
Definition: mafillvcompmain.c:27
static double * gradvfa1
Definition: mafillvcompmain.c:30
static ITG * jq1
Definition: mafillvcompmain.c:27
static double * xlet1
Definition: mafillvcompmain.c:30
#define ITG
Definition: CalculiX.h:51
static double * auv1
Definition: mafillvcompmain.c:30
static ITG * icyclic1
Definition: mafillvcompmain.c:27
static double * adv1
Definition: mafillvcompmain.c:30
static double * body1
Definition: mafillvcompmain.c:30
static ITG * ifabou1
Definition: mafillvcompmain.c:27
static double * a11
Definition: mafillvcompmain.c:30

◆ mafillvmain()

void mafillvmain ( ITG nef,
ITG ipnei,
ITG neifa,
ITG neiel,
double *  vfa,
double *  xxn,
double *  area,
double *  au,
double *  ad,
ITG jq,
ITG irow,
ITG nzs,
double *  b,
double *  vel,
double *  cosa,
double *  umfa,
double *  xlet,
double *  xle,
double *  gradvfa,
double *  xxi,
double *  body,
double *  volume,
ITG ielfa,
char *  lakonf,
ITG ifabou,
ITG nbody,
double *  dtimef,
double *  velo,
double *  veloo,
double *  sel,
double *  xrlfa,
double *  gamma,
double *  xxj,
ITG nactdohinv,
double *  a1,
double *  a2,
double *  a3,
double *  flux,
ITG icyclic,
double *  c,
ITG ifatie,
ITG iau6,
double *  xxni,
double *  xxnj,
ITG iturbulent,
double *  gradvel 
)
45  {
46 
47  ITG i,j;
48 
49  /* variables for multithreading procedure */
50 
51  ITG sys_cpus,*ithread=NULL;
52  char *env,*envloc,*envsys;
53 
54  num_cpus = 0;
55  sys_cpus=0;
56 
57  /* explicit user declaration prevails */
58 
59  envsys=getenv("NUMBER_OF_CPUS");
60  if(envsys){
61  sys_cpus=atoi(envsys);
62  if(sys_cpus<0) sys_cpus=0;
63  }
64 
65  /* automatic detection of available number of processors */
66 
67  if(sys_cpus==0){
68  sys_cpus = getSystemCPUs();
69  if(sys_cpus<1) sys_cpus=1;
70  }
71 
72  /* local declaration prevails, if strictly positive */
73 
74  envloc = getenv("CCX_NPROC_CFD");
75  if(envloc){
76  num_cpus=atoi(envloc);
77  if(num_cpus<0){
78  num_cpus=0;
79  }else if(num_cpus>sys_cpus){
80  num_cpus=sys_cpus;
81  }
82 
83  }
84 
85  /* else global declaration, if any, applies */
86 
87  env = getenv("OMP_NUM_THREADS");
88  if(num_cpus==0){
89  if (env)
90  num_cpus = atoi(env);
91  if (num_cpus < 1) {
92  num_cpus=1;
93  }else if(num_cpus>sys_cpus){
94  num_cpus=sys_cpus;
95  }
96  }
97 
98 // next line is to be inserted in a similar way for all other paralell parts
99 
100  if(*nef<num_cpus) num_cpus=*nef;
101 
102  pthread_t tid[num_cpus];
103 
104  /* calculating the stiffness and/or mass matrix
105  (symmetric part) */
106 
107  nef1=nef;ipnei1=ipnei;neifa1=neifa;neiel1=neiel;vfa1=vfa;xxn1=xxn;
108  area1=area;jq1=jq;irow1=irow;nzs1=nzs;vel1=vel;cosa1=cosa;umfa1=umfa;
109  xlet1=xlet;xle1=xle;gradvfa1=gradvfa;xxi1=xxi;body1=body;volume1=volume;
110  ielfa1=ielfa;lakonf1=lakonf;ifabou1=ifabou;nbody1=nbody;
111  dtimef1=dtimef;velo1=velo;veloo1=veloo;sel1=sel;xrlfa1=xrlfa;
112  gamma1=gamma;xxj1=xxj;nactdohinv1=nactdohinv;a11=a1;a21=a2;a31=a3;
113  flux1=flux;icyclic1=icyclic;c1=c;ifatie1=ifatie;iau61=iau6;
114  adv1=adv;auv1=auv;bv1=bv;xxni1=xxni;xxnj1=xxnj;iturbulent1=iturbulent;
115  gradvel1=gradvel;
116 
117  /* create threads and wait */
118 
119  NNEW(ithread,ITG,num_cpus);
120  for(i=0; i<num_cpus; i++) {
121  ithread[i]=i;
122  pthread_create(&tid[i], NULL, (void *)mafillvmt, (void *)&ithread[i]);
123  }
124  for(i=0; i<num_cpus; i++) pthread_join(tid[i], NULL);
125 
126  SFREE(ithread);
127 
128  return;
129 
130 }
static double * volume1
Definition: mafillvmain.c:30
static double * gradvel1
Definition: mafillvmain.c:30
static ITG * ipnei1
Definition: mafillvmain.c:27
static double * xle1
Definition: mafillvmain.c:30
static ITG * irow1
Definition: mafillvmain.c:27
void * mafillvmt(ITG *i)
Definition: mafillvmain.c:134
int pthread_create(pthread_t *thread_id, const pthread_attr_t *attributes, void *(*thread_function)(void *), void *arguments)
static double * dtimef1
Definition: mafillvmain.c:30
static ITG * icyclic1
Definition: mafillvmain.c:27
static double * auv1
Definition: mafillvmain.c:30
static double * cosa1
Definition: mafillvmain.c:30
subroutine flux(node1, node2, nodem, nelem, lakon, kon, ipkon, nactdog, identity, ielprop, prop, kflag, v, xflow, f, nodef, idirf, df, cp, R, rho, physcon, g, co, dvi, numf, vold, set, shcon, nshcon, rhcon, nrhcon, ntmat_, mi, ider, ttime, time, iaxial)
Definition: flux.f:24
static ITG num_cpus
Definition: mafillvmain.c:27
static double * area1
Definition: mafillvmain.c:30
static ITG * nzs1
Definition: mafillvmain.c:27
static ITG * ifatie1
Definition: mafillvmain.c:27
static double * xxni1
Definition: mafillvmain.c:30
ITG getSystemCPUs()
Definition: getSystemCPUs.c:40
static double * a21
Definition: mafillvmain.c:30
static double * vfa1
Definition: mafillvmain.c:30
static double * a11
Definition: mafillvmain.c:30
static double * flux1
Definition: mafillvmain.c:30
static ITG * nbody1
Definition: mafillvmain.c:27
static ITG * iau61
Definition: mafillvmain.c:27
static double * xxj1
Definition: mafillvmain.c:30
static double * velo1
Definition: mafillvmain.c:30
static double * body1
Definition: mafillvmain.c:30
static double * gradvfa1
Definition: mafillvmain.c:30
static ITG * ielfa1
Definition: mafillvmain.c:27
static double * umfa1
Definition: mafillvmain.c:30
static double * bv1
Definition: mafillvmain.c:30
#define SFREE(a)
Definition: CalculiX.h:41
static ITG * ifabou1
Definition: mafillvmain.c:27
static double * a31
Definition: mafillvmain.c:30
static ITG * jq1
Definition: mafillvmain.c:27
static ITG * nactdohinv1
Definition: mafillvmain.c:27
static double * sel1
Definition: mafillvmain.c:30
static double * xxnj1
Definition: mafillvmain.c:30
static double * xrlfa1
Definition: mafillvmain.c:30
static double * vel1
Definition: mafillvmain.c:30
static double * xxi1
Definition: mafillvmain.c:30
static double * c1
Definition: mafillvmain.c:30
static double * gamma1
Definition: mafillvmain.c:30
int pthread_join(pthread_t thread, void **status_ptr)
static double * xlet1
Definition: mafillvmain.c:30
static double * veloo1
Definition: mafillvmain.c:30
static ITG * neiel1
Definition: mafillvmain.c:27
static char * lakonf1
Definition: mafillvmain.c:25
#define ITG
Definition: CalculiX.h:51
static double * adv1
Definition: mafillvmain.c:30
#define NNEW(a, b, c)
Definition: CalculiX.h:39
static double * xxn1
Definition: mafillvmain.c:30
static ITG * neifa1
Definition: mafillvmain.c:27
static ITG * nef1
Definition: mafillvmain.c:27
static ITG * iturbulent1
Definition: mafillvmain.c:27

◆ mafillvmt()

void* mafillvmt ( ITG i)
134  {
135 
136  ITG nefa,nefb,nefdelta;
137 
138 // ceil -> floor
139 
140  nefdelta=(ITG)floor(*nef1/(double)num_cpus);
141  nefa=*i*nefdelta+1;
142  nefb=(*i+1)*nefdelta;
143 // next line! -> all parallel sections
144  if((*i==num_cpus-1)&&(nefb<*nef1)) nefb=*nef1;
145 
151  a11,a21,a31,flux1,&nefa,&nefb,icyclic1,c1,ifatie1,iau61,
153 
154  return NULL;
155 }
static double * volume1
Definition: mafillvmain.c:30
static double * gradvel1
Definition: mafillvmain.c:30
static ITG * ipnei1
Definition: mafillvmain.c:27
static double * xle1
Definition: mafillvmain.c:30
static ITG * irow1
Definition: mafillvmain.c:27
static double * dtimef1
Definition: mafillvmain.c:30
static ITG * icyclic1
Definition: mafillvmain.c:27
subroutine mafillv(nef, ipnei, neifa, neiel, vfa, xxn, area, auv, adv, jq, irow, nzs, bv, vel, cosa, umfa, xlet, xle, gradvfa, xxi, body, volume, ielfa, lakonf, ifabou, nbody, dtimef, velo, veloo, sel, xrlfa, gamma, xxj, nactdohinv, a1, a2, a3, flux, nefa, nefb, icyclic, c, ifatie, iau6, xxni, xxnj, iturbulent, gradvel)
Definition: mafillv.f:25
static double * auv1
Definition: mafillvmain.c:30
static double * cosa1
Definition: mafillvmain.c:30
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
static ITG num_cpus
Definition: mafillvmain.c:27
static double * area1
Definition: mafillvmain.c:30
static ITG * nzs1
Definition: mafillvmain.c:27
static ITG * ifatie1
Definition: mafillvmain.c:27
static double * xxni1
Definition: mafillvmain.c:30
static double * a21
Definition: mafillvmain.c:30
static double * vfa1
Definition: mafillvmain.c:30
static double * a11
Definition: mafillvmain.c:30
static double * flux1
Definition: mafillvmain.c:30
static ITG * nbody1
Definition: mafillvmain.c:27
static ITG * iau61
Definition: mafillvmain.c:27
static double * xxj1
Definition: mafillvmain.c:30
static double * velo1
Definition: mafillvmain.c:30
static double * body1
Definition: mafillvmain.c:30
static double * gradvfa1
Definition: mafillvmain.c:30
static ITG * ielfa1
Definition: mafillvmain.c:27
static double * umfa1
Definition: mafillvmain.c:30
static double * bv1
Definition: mafillvmain.c:30
static ITG * ifabou1
Definition: mafillvmain.c:27
static double * a31
Definition: mafillvmain.c:30
static ITG * jq1
Definition: mafillvmain.c:27
static ITG * nactdohinv1
Definition: mafillvmain.c:27
static double * sel1
Definition: mafillvmain.c:30
static double * xxnj1
Definition: mafillvmain.c:30
static double * xrlfa1
Definition: mafillvmain.c:30
static double * vel1
Definition: mafillvmain.c:30
static double * xxi1
Definition: mafillvmain.c:30
static double * c1
Definition: mafillvmain.c:30
static double * gamma1
Definition: mafillvmain.c:30
static double * xlet1
Definition: mafillvmain.c:30
static double * veloo1
Definition: mafillvmain.c:30
static ITG * neiel1
Definition: mafillvmain.c:27
static char * lakonf1
Definition: mafillvmain.c:25
#define ITG
Definition: CalculiX.h:51
static double * adv1
Definition: mafillvmain.c:30
static double * xxn1
Definition: mafillvmain.c:30
static ITG * neifa1
Definition: mafillvmain.c:27
static ITG * nef1
Definition: mafillvmain.c:27
static ITG * iturbulent1
Definition: mafillvmain.c:27

◆ mastruct()

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,
ITG iit,
ITG icascade,
ITG network 
)
34  {
35 
36  /* determines the structure of the thermo-mechanical matrices;
37  (i.e. the location of the nonzeros */
38 
39  char lakonl[2]=" \0",lakonl2[3]=" \0";
40 
41  ITG i,j,k,l,jj,ll,id,index,jdof1,jdof2,idof1,idof2,mpc1,mpc2,id1,id2,
42  ist1,ist2,node1,node2,isubtract,nmast,ifree,istart,istartold,
43  index1,index2,m,node,nzs_,ist,kflag,indexe,nope,isize,*mast1=NULL,
44  *irow=NULL,icolumn,nmastboun,mt=mi[1]+1,jmax,*next=NULL,nopeold=0,
45  indexeold,identical,jstart,iatleastonenonzero,idof,ndof;
46 
47  /* the indices in the comments follow FORTRAN convention, i.e. the
48  fields start with 1 */
49 
50  mast1=*mast1p;
51  irow=*irowp;
52 
53  kflag=1;
54 
55  /* determining nactdof (only at start of step or if MPC's
56  changed */
57 
58  if((*iit<0)||(*icascade!=0)){
59 
60  /* initialisation of nactdof */
61 
62  for(i=0;i<mt**nk;++i){nactdof[i]=0;}
63 
64  /* determining the mechanical active degrees of freedom due to elements */
65 
66  if((*ithermal<2)||(*ithermal>=3)){
67  for(i=0;i<*ne;++i){
68 
69  if(ipkon[i]<0) continue;
70  if(strcmp1(&lakon[8*i],"F")==0)continue;
71  indexe=ipkon[i];
72 /* Bernhardi start */
73  if (strcmp1(&lakon[8*i+3],"8I")==0){nope=11;ndof=3;}
74  else if(strcmp1(&lakon[8*i+3],"20")==0){nope=20;ndof=3;}
75 /* Bernhardi end */
76  else if (strcmp1(&lakon[8*i+3],"8")==0){nope=8;ndof=3;}
77  else if (strcmp1(&lakon[8*i+3],"10")==0){nope=10;ndof=3;}
78  else if ((strcmp1(&lakon[8*i+3],"4")==0)||
79  (strcmp1(&lakon[8*i+2],"4")==0)){nope=4;ndof=3;}
80  else if (strcmp1(&lakon[8*i+3],"15")==0){nope=15;ndof=3;}
81  else if (strcmp1(&lakon[8*i+3],"6")==0){nope=6;ndof=3;}
82  else if (strcmp1(&lakon[8*i],"E")==0){
83  if((strcmp1(&lakon[8*i+6],"C")==0)&&(*mortar==1)){
84 
85  /* face-to-face contact (all nodes already belong
86  to other elements */
87 
88  continue;
89  }else if(strcmp1(&lakon[8*i+6],"F")!=0){
90 
91  /* node-to-face contact */
92 
93  lakonl[0]=lakon[8*i+7];
94  nope=atoi(lakonl)+1;
95  ndof=3;
96  }else{
97 
98  /* advection elements */
99 
100  continue;
101  }
102  }else if(strcmp1(&lakon[8*i],"U")==0){
103 
104  /* user element
105  number of dofs: 7th entry of label
106  number of nodes: 8th entry of label */
107 
108  ndof=lakon[8*i+6];
109  nope=lakon[8*i+7];
110 /* strcpy1(&lakonl2[0],&lakon[8*i+6],2);
111  nope=atoi(lakonl2);
112  lakonl[0]=lakon[8*i+5];
113  ndof=atoi(lakonl);*/
114  }else continue;
115 
116  /* displacement degrees of freedom */
117 
118  for(j=0;j<nope;++j){
119  node=kon[indexe+j]-1;
120  for(k=1;k<=ndof;++k){
121  nactdof[mt*node+k]=1;
122  }
123  }
124  }
125  }
126 
127  /* determining the thermal active degrees of freedom due to elements */
128 
129  if(*ithermal>1){
130  for(i=0;i<*ne;++i){
131 
132  if(ipkon[i]<0) continue;
133  if(strcmp1(&lakon[8*i],"F")==0)continue;
134  indexe=ipkon[i];
135  if(strcmp1(&lakon[8*i+3],"20")==0)nope=20;
136  else if (strcmp1(&lakon[8*i+3],"8")==0)nope=8;
137  else if (strcmp1(&lakon[8*i+3],"10")==0)nope=10;
138  else if (strcmp1(&lakon[8*i+3],"4")==0)nope=4;
139  else if (strcmp1(&lakon[8*i+3],"15")==0)nope=15;
140  else if (strcmp1(&lakon[8*i+3],"6")==0)nope=6;
141  else if (strcmp1(&lakon[8*i],"E")==0){
142  if((strcmp1(&lakon[8*i+6],"C")==0)&&(*mortar==1)){
143  continue;
144  }else{
145  lakonl[0]=lakon[8*i+7];
146  nope=atoi(lakonl)+1;
147  }
148  }else if ((strcmp1(&lakon[8*i],"D ")==0)||
149  ((strcmp1(&lakon[8*i],"D")==0)&&(*network==1))){
150 
151  /* check for entry or exit element */
152 
153  if((kon[indexe]==0)||(kon[indexe+2]==0)) continue;
154 
155  /* generic network element */
156 
157  for(j=0;j<3;j=j+2){
158  node=kon[indexe+j]-1;
159  nactdof[mt*node]=1;
160  }
161  continue;}
162  else continue;
163 
164  for(j=0;j<nope;++j){
165  node=kon[indexe+j]-1;
166  nactdof[mt*node]=1;
167  }
168  }
169  }
170 
171  /* determining the active degrees of freedom due to mpc's */
172 
173  for(i=0;i<*nmpc;++i){
174  if (strcmp1(&labmpc[20*i],"FLUID")==0) continue;
175 
176  iatleastonenonzero=0;
177 
178  index=ipompc[i]-1;
179  do{
180  if(nodempc[3*index+1]<4){
181  idof=mt*(nodempc[3*index]-1)+nodempc[3*index+1];
182  if(nactdof[idof]==1){
183  iatleastonenonzero=1;
184  }else{
185  nactdof[idof]=1;
186  }
187  }
188  index=nodempc[3*index+2];
189  if(index==0) break;
190  index--;
191  }while(1);
192 
193  if(iatleastonenonzero==1) continue;
194 
195  /* if all dofs in the MPC were inactive, keep then inactive
196  (may e.g. belong to network elements) */
197 
198  index=ipompc[i]-1;
199  do{
200  if(nodempc[3*index+1]<4){
201  nactdof[mt*(nodempc[3*index]-1)+nodempc[3*index+1]]=0;
202  }
203  index=nodempc[3*index+2];
204  if(index==0) break;
205  index--;
206  }while(1);
207 
208  }
209 
210  /* subtracting the SPC and MPC nodes */
211 
212  for(i=0;i<*nboun;++i){
213  if(ndirboun[i]>mi[1]) continue;
214  if (strcmp1(&typeboun[i],"F")==0) continue;
215  nactdof[mt*(nodeboun[i]-1)+ndirboun[i]]=-2*(i+1);
216  }
217 
218  for(i=0;i<*nmpc;++i){
219  if (strcmp1(&labmpc[20*i],"FLUID")==0) continue;
220  index=ipompc[i]-1;
221  if(nodempc[3*index+1]>mi[1]) continue;
222  nactdof[mt*(nodempc[3*index]-1)+nodempc[3*index+1]]=-2*i-1;
223  }
224 
225  /* numbering the active degrees of freedom */
226 
227  neq[0]=0;
228  for(i=0;i<*nk;++i){
229  for(j=1;j<mt;++j){
230  if(nactdof[mt*i+j]>0){
231  if((*ithermal<2)||(*ithermal>=3)){
232  ++neq[0];
233  nactdof[mt*i+j]=neq[0];
234  }
235  else{
236  nactdof[mt*i+j]=0;
237  }
238  }
239  }
240  }
241  neq[1]=neq[0];
242  for(i=0;i<*nk;++i){
243  if(nactdof[mt*i]>0){
244  if(*ithermal>1){
245  ++neq[1];
246  nactdof[mt*i]=neq[1];
247  }
248  else{
249  nactdof[mt*i]=0;
250  }
251  }
252  }
253  if((*nmethod==2)||((*nmethod==4)&&(*iperturb<=1))||((*nmethod>=5)&&(*nmethod<=7))){
254  neq[2]=neq[1]+*nboun;
255  }
256  else{neq[2]=neq[1];}
257  }
258 
259  /* determining the subdiagonal nonzeros in the stiffness/mass matrix */
260 
261  ifree=0;
262  nzs_=nzs[1];
263  NNEW(next,ITG,nzs_);
264 
265  /* determining the position of each nonzero matrix element in
266  the SUBdiagonal matrix (excluding diagonal): x-elements on
267  the left of the vertical line */
268 
269 // |x x x
270 // x |x x x
271 // x x |x x x
272 // x x x |x x x
273 
274  /* mast1(ipointer(i)) = first nonzero row in column i
275  next(ipointer(i)) points to further nonzero elements in
276  column i */
277 
278  for(i=0;i<4**nk;++i){ipointer[i]=0;}
279 
280  /* mechanical entries */
281 
282  if((*ithermal<2)||(*ithermal>=3)){
283 
284  indexeold=0;
285 
286  for(i=0;i<*ne;++i){
287 
288  if(ipkon[i]<0) continue;
289  if(strcmp1(&lakon[8*i],"F")==0)continue;
290  indexe=ipkon[i];
291 /* Bernhardi start */
292  if (strcmp1(&lakon[8*i+3],"8I")==0){nope=11;ndof=3;}
293  else if(strcmp1(&lakon[8*i+3],"20")==0){nope=20;ndof=3;}
294 /* Bernhardi end */
295  else if (strcmp1(&lakon[8*i+3],"8")==0){nope=8;ndof=3;}
296  else if (strcmp1(&lakon[8*i+3],"10")==0){nope=10;ndof=3;}
297  else if (strcmp1(&lakon[8*i+3],"4")==0){nope=4;ndof=3;}
298  else if (strcmp1(&lakon[8*i+3],"15")==0){nope=15;ndof=3;}
299  else if (strcmp1(&lakon[8*i+3],"6")==0){nope=6;ndof=3;}
300  else if (strcmp1(&lakon[8*i],"E")==0){
301  if((strcmp1(&lakon[8*i+6],"C")==0)&&(*mortar==1)){
302  nope=kon[indexe-1];
303  if(nope==nopeold){
304  identical=1;
305  for(j=0;j<nope;j++){
306  if(kon[indexe+j]!=kon[indexeold+j]){
307  identical=0;
308  break;
309  }
310  }
311  if(identical==1)continue;
312  }
313  nopeold=nope;
314  indexeold=indexe;
315  ndof=3;
316  }else{
317  lakonl[0]=lakon[8*i+7];
318  nope=atoi(lakonl)+1;
319  ndof=3;
320  }
321  }else if(strcmp1(&lakon[8*i],"U")==0){
322 
323  /* user element
324  number of dofs: 7th entry of label
325  number of nodes: 8th entry of label */
326 
327  ndof=lakon[8*i+6];
328  nope=lakon[8*i+7];
329  }else continue;
330 
331  for(jj=0;jj<ndof*nope;++jj){
332 
333  j=jj/ndof;
334  k=jj-ndof*j;
335 
336  node1=kon[indexe+j];
337  jdof1=nactdof[mt*(node1-1)+k+1];
338 
339  for(ll=jj;ll<ndof*nope;++ll){
340 
341  l=ll/ndof;
342  m=ll-ndof*l;
343 
344  node2=kon[indexe+l];
345  jdof2=nactdof[mt*(node2-1)+m+1];
346 
347  /* check whether one of the DOF belongs to a SPC or MPC */
348 
349  if((jdof1>0)&&(jdof2>0)){
350  insert(ipointer,&mast1,&next,&jdof1,&jdof2,&ifree,&nzs_);
351  }
352  else if((jdof1>0)||(jdof2>0)){
353 
354  /* idof1: genuine DOF
355  idof2: nominal DOF of the SPC/MPC */
356 
357  if(jdof1<=0){
358  idof1=jdof2;
359  idof2=jdof1;}
360  else{
361  idof1=jdof1;
362  idof2=jdof2;}
363 
364  if(*nmpc>0){
365 
366  if(idof2!=2*(idof2/2)){
367 
368  /* regular DOF / MPC */
369 
370  id=(-idof2+1)/2;
371  ist=ipompc[id-1];
372  index=nodempc[3*ist-1];
373  if(index==0) continue;
374  while(1){
375  idof2=nactdof[mt*(nodempc[3*index-3]-1)+nodempc[3*index-2]];
376  if(idof2>0){
377  insert(ipointer,&mast1,&next,&idof1,&idof2,&ifree,&nzs_);
378  }
379  index=nodempc[3*index-1];
380  if(index==0) break;
381  }
382  continue;
383  }
384  }
385 
386  /* regular DOF/SPC */
387 
388  /* boundary stiffness coefficients (for frequency
389  and modal dynamic calculations) : x-elements
390  on the right of the vertical line */
391 
392 // |x x x
393 // x |x x x
394 // x x |x x x
395 // x x x |x x x
396 
397  if((*nmethod==2)||((*nmethod==4)&&(*iperturb<=1))||((*nmethod>=5)&&(*nmethod<=7))){
398  icolumn=neq[1]-idof2/2;
399  insertfreq(ipointer,&mast1,&next,&idof1,&icolumn,&ifree,&nzs_);
400  }
401  }
402 
403  else{
404  idof1=jdof1;
405  idof2=jdof2;
406  mpc1=0;
407  mpc2=0;
408  if(*nmpc>0){
409  if(idof1!=2*(idof1/2)) mpc1=1;
410  if(idof2!=2*(idof2/2)) mpc2=1;
411  }
412  if((mpc1==1)&&(mpc2==1)){
413  id1=(-idof1+1)/2;
414  id2=(-idof2+1)/2;
415  if(id1==id2){
416 
417  /* MPC id1 / MPC id1 */
418 
419  ist=ipompc[id1-1];
420  index1=nodempc[3*ist-1];
421  if(index1==0) continue;
422  while(1){
423  idof1=nactdof[mt*(nodempc[3*index1-3]-1)+nodempc[3*index1-2]];
424  index2=index1;
425  while(1){
426  idof2=nactdof[mt*(nodempc[3*index2-3]-1)+nodempc[3*index2-2]];
427  if((idof1>0)&&(idof2>0)){
428  insert(ipointer,&mast1,&next,&idof1,&idof2,&ifree,&nzs_);}
429  index2=nodempc[3*index2-1];
430  if(index2==0) break;
431  }
432  index1=nodempc[3*index1-1];
433  if(index1==0) break;
434  }
435  }
436 
437  else{
438 
439  /* MPC id1 /MPC id2 */
440 
441  ist1=ipompc[id1-1];
442  index1=nodempc[3*ist1-1];
443  if(index1==0) continue;
444  while(1){
445  idof1=nactdof[mt*(nodempc[3*index1-3]-1)+nodempc[3*index1-2]];
446  ist2=ipompc[id2-1];
447  index2=nodempc[3*ist2-1];
448  if(index2==0){
449  index1=nodempc[3*index1-1];
450  if(index1==0){break;}
451  else{continue;}
452  }
453  while(1){
454  idof2=nactdof[mt*(nodempc[3*index2-3]-1)+nodempc[3*index2-2]];
455  if((idof1>0)&&(idof2>0)){
456  insert(ipointer,&mast1,&next,&idof1,&idof2,&ifree,&nzs_);}
457  index2=nodempc[3*index2-1];
458  if(index2==0) break;
459  }
460  index1=nodempc[3*index1-1];
461  if(index1==0) break;
462  }
463  }
464  }
465  }
466  }
467  }
468  }
469 
470  }
471 
472  /* thermal entries*/
473 
474  if(*ithermal>1){
475 
476  indexeold=0;
477 
478  for(i=0;i<*ne;++i){
479 
480  if(ipkon[i]<0) continue;
481  if(strcmp1(&lakon[8*i],"F")==0)continue;
482  indexe=ipkon[i];
483  if(strcmp1(&lakon[8*i+3],"20")==0)nope=20;
484  else if (strcmp1(&lakon[8*i+3],"8")==0)nope=8;
485  else if (strcmp1(&lakon[8*i+3],"10")==0)nope=10;
486  else if (strcmp1(&lakon[8*i+3],"4")==0)nope=4;
487  else if (strcmp1(&lakon[8*i+3],"15")==0)nope=15;
488  else if (strcmp1(&lakon[8*i+3],"6")==0)nope=6;
489  else if (strcmp1(&lakon[8*i],"E")==0){
490  if((strcmp1(&lakon[8*i+6],"C")==0)&&(*mortar==1)){
491  nope=kon[indexe-1];
492  if(nope==nopeold){
493  identical=1;
494  for(j=0;j<nope;j++){
495  if(kon[indexe+j]!=kon[indexeold+j]){
496  identical=0;
497  break;
498  }
499  }
500  if(identical==1)continue;
501  }
502  nopeold=nope;
503  indexeold=indexe;
504  }else{
505  lakonl[0]=lakon[8*i+7];
506  nope=atoi(lakonl)+1;
507  }
508  }else if ((strcmp1(&lakon[8*i],"D ")==0)||
509  ((strcmp1(&lakon[8*i],"D")==0)&&(*network==1))){
510 
511  /* check for entry or exit element */
512 
513  if((kon[indexe]==0)||(kon[indexe+2]==0)) continue;
514  nope=3;}
515  else continue;
516 
517  for(jj=0;jj<nope;++jj){
518 
519  j=jj;
520 
521  node1=kon[indexe+j];
522  jdof1=nactdof[mt*(node1-1)];
523 
524  for(ll=jj;ll<nope;++ll){
525 
526  l=ll;
527 
528  node2=kon[indexe+l];
529  jdof2=nactdof[mt*(node2-1)];
530 
531  /* check whether one of the DOF belongs to a SPC or MPC */
532 
533  if((jdof1>0)&&(jdof2>0)){
534  insert(ipointer,&mast1,&next,&jdof1,&jdof2,&ifree,&nzs_);
535  }
536  else if((jdof1>0)||(jdof2>0)){
537 
538  /* idof1: genuine DOF
539  idof2: nominal DOF of the SPC/MPC */
540 
541  if(jdof1<=0){
542  idof1=jdof2;
543  idof2=jdof1;}
544  else{
545  idof1=jdof1;
546  idof2=jdof2;}
547 
548  if(*nmpc>0){
549 
550  if(idof2!=2*(idof2/2)){
551 
552  /* regular DOF / MPC */
553 
554  id=(-idof2+1)/2;
555  ist=ipompc[id-1];
556  index=nodempc[3*ist-1];
557  if(index==0) continue;
558  while(1){
559  idof2=nactdof[mt*(nodempc[3*index-3]-1)+nodempc[3*index-2]];
560  if(idof2>0){
561  insert(ipointer,&mast1,&next,&idof1,&idof2,&ifree,&nzs_);
562  }
563  index=nodempc[3*index-1];
564  if(index==0) break;
565  }
566  continue;
567  }
568  }
569 
570  /* regular DOF/SPC */
571 
572  /* boundary stiffness coefficients (for frequency and
573  modal dynamic calculations */
574 
575  if((*nmethod==2)||((*nmethod==4)&&(*iperturb<=1))||((*nmethod>=5)&&(*nmethod<=7))){
576  icolumn=neq[1]-idof2/2;
577  insertfreq(ipointer,&mast1,&next,&idof1,&icolumn,&ifree,&nzs_);
578  }
579 
580  }
581 
582  else{
583  idof1=jdof1;
584  idof2=jdof2;
585  mpc1=0;
586  mpc2=0;
587  if(*nmpc>0){
588  if(idof1!=2*(idof1/2)) mpc1=1;
589  if(idof2!=2*(idof2/2)) mpc2=1;
590  }
591  if((mpc1==1)&&(mpc2==1)){
592  id1=(-idof1+1)/2;
593  id2=(-idof2+1)/2;
594  if(id1==id2){
595 
596  /* MPC id1 / MPC id1 */
597 
598  ist=ipompc[id1-1];
599  index1=nodempc[3*ist-1];
600  if(index1==0) continue;
601  while(1){
602  idof1=nactdof[mt*(nodempc[3*index1-3]-1)+nodempc[3*index1-2]];
603  index2=index1;
604  while(1){
605  idof2=nactdof[mt*(nodempc[3*index2-3]-1)+nodempc[3*index2-2]];
606  if((idof1>0)&&(idof2>0)){
607  insert(ipointer,&mast1,&next,&idof1,&idof2,&ifree,&nzs_);}
608  index2=nodempc[3*index2-1];
609  if(index2==0) break;
610  }
611  index1=nodempc[3*index1-1];
612  if(index1==0) break;
613  }
614  }
615 
616  else{
617 
618  /* MPC id1 /MPC id2 */
619 
620  ist1=ipompc[id1-1];
621  index1=nodempc[3*ist1-1];
622  if(index1==0) continue;
623  while(1){
624  idof1=nactdof[mt*(nodempc[3*index1-3]-1)+nodempc[3*index1-2]];
625  ist2=ipompc[id2-1];
626  index2=nodempc[3*ist2-1];
627  if(index2==0){
628  index1=nodempc[3*index1-1];
629  if(index1==0){break;}
630  else{continue;}
631  }
632  while(1){
633  idof2=nactdof[mt*(nodempc[3*index2-3]-1)+nodempc[3*index2-2]];
634  if((idof1>0)&&(idof2>0)){
635  insert(ipointer,&mast1,&next,&idof1,&idof2,&ifree,&nzs_);}
636  index2=nodempc[3*index2-1];
637  if(index2==0) break;
638  }
639  index1=nodempc[3*index1-1];
640  if(index1==0) break;
641  }
642  }
643  }
644  }
645  }
646  }
647  }
648 
649  }
650 
651  if(neq[1]==0){
652  printf("\n *WARNING: no degrees of freedom in the model\n\n");
653  }
654 
655  /* determination of the following fields:
656 
657  - irow: row numbers, column per column
658  - icol(i)=# SUBdiagonal nonzero's in column i
659  - jq(i)= location in field irow of the first SUBdiagonal
660  nonzero in column i */
661 
662  /* subdiagonal elements of the regular stiffness/mass matrices
663  (marked by X underneath) */
664 
665 // |x x x
666 // X |x x x
667 // X X |x x x
668 // X X X |x x x
669 
670  RENEW(irow,ITG,ifree);
671  nmast=0;
672  jq[0]=1;
673  for(i=0;i<neq[1];i++){
674  index=ipointer[i];
675  do{
676  if(index==0) break;
677  irow[nmast++]=mast1[index-1];
678  index=next[index-1];
679  }while(1);
680  jq[i+1]=nmast+1;
681  }
682 
683  /* sorting the row numbers within each column */
684 
685  for(i=0;i<neq[1];++i){
686  if(jq[i+1]-jq[i]>0){
687  isize=jq[i+1]-jq[i];
688  FORTRAN(isortii,(&irow[jq[i]-1],&mast1[jq[i]-1],&isize,&kflag));
689  }
690  }
691 
692  /* removing duplicate entries */
693 
694  nmast=0;
695  for(i=0;i<neq[1];i++){
696  jstart=nmast+1;
697  if(jq[i+1]-jq[i]>0){
698  irow[nmast++]=irow[jq[i]-1];
699  for(j=jq[i];j<jq[i+1]-1;j++){
700  if(irow[j]==irow[nmast-1])continue;
701  irow[nmast++]=irow[j];
702  }
703  }
704  jq[i]=jstart;
705  }
706  jq[neq[1]]=nmast+1;
707 
708  for(i=0;i<neq[1];i++){
709  icol[i]=jq[i+1]-jq[i];
710  }
711 
712  if(neq[0]==0){nzs[0]=0;}
713  else{nzs[0]=jq[neq[0]]-1;}
714  nzs[1]=jq[neq[1]]-1;
715 
716  /* summary */
717 
718  printf(" number of equations\n");
719  printf(" %" ITGFORMAT "\n",neq[1]);
720  printf(" number of nonzero lower triangular matrix elements\n");
721  printf(" %" ITGFORMAT "\n",nmast);
722  printf("\n");
723 
724  /* determining irow, jq and icol for the boundary stiffness matrix (only
725  for frequency and modal dynamic calculations)
726  (entries marked by X underneath) */
727 
728 // |X X X
729 // x |X X X
730 // x x |X X X
731 // x x x |X X X
732 
733  if((*nmethod==2)||((*nmethod==4)&&(*iperturb<=1))||((*nmethod>=5)&&(*nmethod<=7))){
734 
735  nmastboun=nmast;
736  for(i=neq[1];i<neq[2];i++){
737  index=ipointer[i];
738  do{
739  if(index==0) break;
740  irow[nmastboun++]=mast1[index-1];
741  index=next[index-1];
742  }while(1);
743  jq[i+1]=nmastboun+1;
744  }
745 
746  /* sorting the row numbers within each column */
747 
748  for(i=neq[1];i<neq[2];++i){
749  if(jq[i+1]-jq[i]>0){
750  isize=jq[i+1]-jq[i];
751  FORTRAN(isortii,(&irow[jq[i]-1],&mast1[jq[i]-1],&isize,&kflag));
752  }
753  }
754 
755  /* removing duplicate entries */
756 
757  nmastboun=nmast;
758  for(i=neq[1];i<neq[2];i++){
759  jstart=nmastboun+1;
760  if(jq[i+1]-jq[i]>0){
761  irow[nmastboun++]=irow[jq[i]-1];
762  for(j=jq[i];j<jq[i+1]-1;j++){
763  if(irow[j]==irow[nmastboun-1])continue;
764  irow[nmastboun++]=irow[j];
765  }
766  }
767  jq[i]=jstart;
768  }
769  jq[neq[2]]=nmastboun+1;
770 
771  for(i=neq[1];i<neq[2];i++){
772  icol[i]=jq[i+1]-jq[i];
773  }
774 
775  /* number of nonzero's in the boundary part*/
776 
777  nzs[2]=jq[neq[2]]-1;
778  }
779  else{nzs[2]=nzs[1];}
780 
781  SFREE(next);
782 
783  *mast1p=mast1;
784  *irowp=irow;
785 
786  return;
787 
788 }
#define ITGFORMAT
Definition: CalculiX.h:52
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
void insertfreq(ITG *ipointer, ITG **mast1p, ITG **nextp, ITG *i1, ITG *i2, ITG *ifree, ITG *nzs_)
Definition: insertfreq.c:24
ITG strcmp1(const char *s1, const char *s2)
Definition: strcmp1.c:24
void insert(ITG *ipointer, ITG **mast1p, ITG **mast2p, ITG *i1, ITG *i2, ITG *ifree, ITG *nzs_)
Definition: insert.c:24
subroutine isortii(ix, iy, n, kflag)
Definition: isortii.f:6
#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

◆ mastructcs()

void mastructcs ( 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 ics,
double *  cs,
char *  labmpc,
ITG mcs,
ITG mi,
ITG mortar 
)
33  {
34 
35  /* determines the structure of the thermo-mechanical matrices with
36  cyclic symmetry;
37  (i.e. the location of the nonzeros */
38 
39  char lakonl[2]=" \0";
40 
41  ITG i,j,k,l,jj,ll,id,index,jdof1,jdof2,idof1,idof2,mpc1,mpc2,id1,id2,
42  ist1,ist2,node1,node2,isubtract,nmast,ifree,istart,istartold,
43  index1,index2,m,node,nzs_,ist,kflag,indexe,nope,isize,*mast1=NULL,
44  *irow=NULL,inode,icomplex,inode1,icomplex1,inode2,*next=NULL,
45  icomplex2,kdof1,kdof2,ilength,lprev,ij,mt=mi[1]+1,jstart;
46 
47  /* the indices in the comments follow FORTRAN convention, i.e. the
48  fields start with 1 */
49 
50  mast1=*mast1p;
51  irow=*irowp;
52 
53  kflag=1;
54  nzs_=nzs[1];
55  NNEW(next,ITG,nzs_);
56 
57  /* initialisation of nactmpc */
58 
59  for(i=0;i<mt**nk;++i){nactdof[i]=0;}
60 
61  /* determining the active degrees of freedom due to elements */
62 
63  for(i=0;i<*ne;++i){
64 
65  if(ipkon[i]<0) continue;
66  indexe=ipkon[i];
67 /* Bernhardi start */
68  if (strcmp1(&lakon[8*i+3],"8I")==0)nope=11;
69  else if(strcmp1(&lakon[8*i+3],"20")==0)nope=20;
70 /* Bernhardi end */
71  else if(strcmp1(&lakon[8*i+3],"2")==0)nope=26;
72  else if (strcmp1(&lakon[8*i+3],"8")==0)nope=8;
73  else if (strcmp1(&lakon[8*i+3],"10")==0)nope=10;
74  else if ((strcmp1(&lakon[8*i+3],"4")==0)||
75  (strcmp1(&lakon[8*i+2],"4")==0)) nope=4;
76  else if (strcmp1(&lakon[8*i+3],"15")==0)nope=15;
77  else if (strcmp1(&lakon[8*i+3],"6")==0)nope=6;
78  else if (strcmp1(&lakon[8*i],"E")==0){
79  if((strcmp1(&lakon[8*i+6],"C")==0)&&(*mortar==1)){
80  nope=kon[ipkon[i]-1];
81  }else{
82  lakonl[0]=lakon[8*i+7];
83  nope=atoi(lakonl)+1;
84  }
85  }else continue;
86 
87 /* else if (strcmp1(&lakon[8*i],"E")==0){
88  lakonl[0]=lakon[8*i+7];
89  nope=atoi(lakonl)+1;}
90  else continue;*/
91 
92  for(j=0;j<nope;++j){
93  node=kon[indexe+j]-1;
94  for(k=1;k<4;++k){
95  nactdof[mt*node+k]=1;
96  }
97  }
98  }
99 
100  /* determining the active degrees of freedom due to mpc's */
101 
102  for(i=0;i<*nmpc;++i){
103  index=ipompc[i]-1;
104  do{
105  if((nodempc[3*index+1]!=0)&&(nodempc[3*index+1]<4)){
106  nactdof[mt*(nodempc[3*index]-1)+nodempc[3*index+1]]=1;}
107  index=nodempc[3*index+2];
108  if(index==0) break;
109  index--;
110  }while(1);
111  }
112 
113  /* subtracting the SPC and MPC nodes */
114 
115  for(i=0;i<*nboun;++i){
116  if(ndirboun[i]>mi[1]) continue;
117  nactdof[mt*(nodeboun[i]-1)+ndirboun[i]]=-2*(i+1);
118  }
119 
120  for(i=0;i<*nmpc;++i){
121  index=ipompc[i]-1;
122  if(nodempc[3*index+1]>mi[1]) continue;
123  nactdof[mt*(nodempc[3*index]-1)+nodempc[3*index+1]]=-2*i-1;
124  }
125 
126  /* numbering the active degrees of freedom */
127 
128  neq[0]=0;
129  for(i=0;i<*nk;++i){
130  for(j=1;j<4;++j){
131  if(nactdof[mt*i+j]>0){
132  ++neq[0];
133  nactdof[mt*i+j]=neq[0];
134  }
135  }
136  }
137 
138  ifree=0;
139 
140  /* determining the position of each nonzero matrix element
141 
142  mast1(ipointer(i)) = first nonzero row in column i
143  next(ipointer(i)) points to further nonzero elements in
144  column i */
145 
146  for(i=0;i<6**nk;++i){ipointer[i]=0;}
147 
148  for(i=0;i<*ne;++i){
149 
150  if(ipkon[i]<0) continue;
151  indexe=ipkon[i];
152 /* Bernhardi start */
153  if(strcmp1(&lakon[8*i],"C3D8I")==0){nope=11;}
154  else if(strcmp1(&lakon[8*i+3],"20")==0)nope=20;
155 /* Bernhardi end */
156  else if(strcmp1(&lakon[8*i+3],"2")==0)nope=26;
157  else if (strcmp1(&lakon[8*i+3],"8")==0)nope=8;
158  else if (strcmp1(&lakon[8*i+3],"10")==0)nope=10;
159  else if (strcmp1(&lakon[8*i+3],"4")==0)nope=4;
160  else if (strcmp1(&lakon[8*i+3],"15")==0)nope=15;
161  else if (strcmp1(&lakon[8*i+3],"6")==0)nope=6;
162  else if (strcmp1(&lakon[8*i],"E")==0){
163  if((strcmp1(&lakon[8*i+6],"C")==0)&&(*mortar==1)){
164  nope=kon[ipkon[i]-1];
165  }else{
166  lakonl[0]=lakon[8*i+7];
167  nope=atoi(lakonl)+1;
168  }
169  }else continue;
170 
171 /* else if (strcmp1(&lakon[8*i],"E")==0){
172  lakonl[0]=lakon[8*i+7];
173  nope=atoi(lakonl)+1;}
174  else continue;*/
175 
176  for(jj=0;jj<3*nope;++jj){
177 
178  j=jj/3;
179  k=jj-3*j;
180 
181  node1=kon[indexe+j];
182  jdof1=nactdof[mt*(node1-1)+k+1];
183 
184  for(ll=jj;ll<3*nope;++ll){
185 
186  l=ll/3;
187  m=ll-3*l;
188 
189  node2=kon[indexe+l];
190  jdof2=nactdof[mt*(node2-1)+m+1];
191 
192  /* check whether one of the DOF belongs to a SPC or MPC */
193 
194  if((jdof1>0)&&(jdof2>0)){
195  insert(ipointer,&mast1,&next,&jdof1,&jdof2,&ifree,&nzs_);
196  kdof1=jdof1+neq[0];kdof2=jdof2+neq[0];
197  insert(ipointer,&mast1,&next,&kdof1,&kdof2,&ifree,&nzs_);
198  }
199  else if((jdof1>0)||(jdof2>0)){
200 
201  /* idof1: genuine DOF
202  idof2: nominal DOF of the SPC/MPC */
203 
204  if(jdof1<=0){
205  idof1=jdof2;
206  idof2=jdof1;}
207 // idof2=8*node1+k-7;}
208  else{
209  idof1=jdof1;
210  idof2=jdof2;}
211 // idof2=8*node2+m-7;}
212 
213  if(*nmpc>0){
214 
215 // FORTRAN(nident,(ikmpc,&idof2,nmpc,&id));
216 // if((id>0)&&(ikmpc[id-1]==idof2)){
217  if(idof2!=2*(idof2/2)){
218 
219  /* regular DOF / MPC */
220 
221 // id1=ilmpc[id-1];
222  id1=(-idof2+1)/2;
223  ist=ipompc[id1-1];
224  index=nodempc[3*ist-1];
225  if(index==0) continue;
226  while(1){
227  inode=nodempc[3*index-3];
228  icomplex=0;
229  if(strcmp1(&labmpc[(id1-1)*20],"CYCLIC")==0){
230  icomplex=atoi(&labmpc[20*(id1-1)+6]);
231  }
232  else if(strcmp1(&labmpc[(id1-1)*20],"SUBCYCLIC")==0){
233  for(ij=0;ij<*mcs;ij++){
234  ilength=cs[17*ij+3];
235  lprev=cs[17*ij+13];
236  FORTRAN(nident,(&ics[lprev],&inode,&ilength,&id));
237  if(id>0){
238  if(ics[lprev+id-1]==inode){
239  icomplex=ij+1;
240  break;
241  }
242  }
243  }
244  }
245 // idof2=nactdof[mt*inode+nodempc[3*index-2]-4];
246  idof2=nactdof[mt*(inode-1)+nodempc[3*index-2]];
247  if(idof2>0){
248  insert(ipointer,&mast1,&next,&idof1,&idof2,&ifree,&nzs_);
249  kdof1=idof1+neq[0];kdof2=idof2+neq[0];
250  insert(ipointer,&mast1,&next,&kdof1,&kdof2,&ifree,&nzs_);
251  if((icomplex!=0)&&(idof1!=idof2)){
252  insert(ipointer,&mast1,&next,&kdof1,&idof2,&ifree,&nzs_);
253  insert(ipointer,&mast1,&next,&idof1,&kdof2,&ifree,&nzs_);
254  }
255  }
256  index=nodempc[3*index-1];
257  if(index==0) break;
258  }
259  continue;
260  }
261  }
262  }
263 
264  else{
265 // idof1=8*node1+k-7;
266 // idof2=8*node2+m-7;
267  idof1=jdof1;
268  idof2=jdof2;
269  mpc1=0;
270  mpc2=0;
271  if(*nmpc>0){
272 /* FORTRAN(nident,(ikmpc,&idof1,nmpc,&id1));
273  if((id1>0)&&(ikmpc[id1-1]==idof1)) mpc1=1;
274  FORTRAN(nident,(ikmpc,&idof2,nmpc,&id2));
275  if((id2>0)&&(ikmpc[id2-1]==idof2)) mpc2=1;*/
276  if(idof1!=2*(idof1/2)) mpc1=1;
277  if(idof2!=2*(idof2/2)) mpc2=1;
278  }
279  if((mpc1==1)&&(mpc2==1)){
280 // id1=ilmpc[id1-1];
281 // id2=ilmpc[id2-1];
282  id1=(-idof1+1)/2;
283  id2=(-idof2+1)/2;
284  if(id1==id2){
285 
286  /* MPC id1 / MPC id1 */
287 
288  ist=ipompc[id1-1];
289  index1=nodempc[3*ist-1];
290  if(index1==0) continue;
291  while(1){
292  inode1=nodempc[3*index1-3];
293  icomplex1=0;
294  if(strcmp1(&labmpc[(id1-1)*20],"CYCLIC")==0){
295  icomplex1=atoi(&labmpc[20*(id1-1)+6]);
296  }
297  else if(strcmp1(&labmpc[(id1-1)*20],"SUBCYCLIC")==0){
298  for(ij=0;ij<*mcs;ij++){
299  ilength=cs[17*ij+3];
300  lprev=cs[17*ij+13];
301  FORTRAN(nident,(&ics[lprev],&inode1,&ilength,&id));
302  if(id>0){
303  if(ics[lprev+id-1]==inode1){
304  icomplex1=ij+1;
305  break;
306  }
307  }
308  }
309  }
310 // idof1=nactdof[mt*inode1+nodempc[3*index1-2]-4];
311  idof1=nactdof[mt*(inode1-1)+nodempc[3*index1-2]];
312  index2=index1;
313  while(1){
314  inode2=nodempc[3*index2-3];
315  icomplex2=0;
316  if(strcmp1(&labmpc[(id1-1)*20],"CYCLIC")==0){
317  icomplex2=atoi(&labmpc[20*(id1-1)+6]);
318  }
319  else if(strcmp1(&labmpc[(id1-1)*20],"SUBCYCLIC")==0){
320  for(ij=0;ij<*mcs;ij++){
321  ilength=cs[17*ij+3];
322  lprev=cs[17*ij+13];
323  FORTRAN(nident,(&ics[lprev],&inode2,&ilength,&id));
324  if(id>0){
325  if(ics[lprev+id-1]==inode2){
326  icomplex2=ij+1;
327  break;
328  }
329  }
330  }
331  }
332 // idof2=nactdof[mt*inode2+nodempc[3*index2-2]-4];
333  idof2=nactdof[mt*(inode2-1)+nodempc[3*index2-2]];
334  if((idof1>0)&&(idof2>0)){
335  insert(ipointer,&mast1,&next,&idof1,&idof2,&ifree,&nzs_);
336  kdof1=idof1+neq[0];kdof2=idof2+neq[0];
337  insert(ipointer,&mast1,&next,&kdof1,&kdof2,&ifree,&nzs_);
338  if(((icomplex1!=0)||(icomplex2!=0))&&
339  (icomplex1!=icomplex2)){
340  /* if(((icomplex1!=0)||(icomplex2!=0))&&
341  ((icomplex1==0)||(icomplex2==0))){*/
342  insert(ipointer,&mast1,&next,&kdof1,&idof2,&ifree,&nzs_);
343  insert(ipointer,&mast1,&next,&idof1,&kdof2,&ifree,&nzs_);
344  }
345  }
346  index2=nodempc[3*index2-1];
347  if(index2==0) break;
348  }
349  index1=nodempc[3*index1-1];
350  if(index1==0) break;
351  }
352  }
353 
354  else{
355 
356  /* MPC id1 /MPC id2 */
357 
358  ist1=ipompc[id1-1];
359  index1=nodempc[3*ist1-1];
360  if(index1==0) continue;
361  while(1){
362  inode1=nodempc[3*index1-3];
363  icomplex1=0;
364  if(strcmp1(&labmpc[(id1-1)*20],"CYCLIC")==0){
365  icomplex1=atoi(&labmpc[20*(id1-1)+6]);
366  }
367  else if(strcmp1(&labmpc[(id1-1)*20],"SUBCYCLIC")==0){
368  for(ij=0;ij<*mcs;ij++){
369  ilength=cs[17*ij+3];
370  lprev=cs[17*ij+13];
371  FORTRAN(nident,(&ics[lprev],&inode1,&ilength,&id));
372  if(id>0){
373  if(ics[lprev+id-1]==inode1){
374  icomplex1=ij+1;
375  break;
376  }
377  }
378  }
379  }
380 // idof1=nactdof[mt*inode1+nodempc[3*index1-2]-4];
381  idof1=nactdof[mt*(inode1-1)+nodempc[3*index1-2]];
382  ist2=ipompc[id2-1];
383  index2=nodempc[3*ist2-1];
384  if(index2==0){
385  index1=nodempc[3*index1-1];
386  if(index1==0){break;}
387  else{continue;}
388  }
389  while(1){
390  inode2=nodempc[3*index2-3];
391  icomplex2=0;
392  if(strcmp1(&labmpc[(id2-1)*20],"CYCLIC")==0){
393  icomplex2=atoi(&labmpc[20*(id2-1)+6]);
394  }
395  else if(strcmp1(&labmpc[(id2-1)*20],"SUBCYCLIC")==0){
396  for(ij=0;ij<*mcs;ij++){
397  ilength=cs[17*ij+3];
398  lprev=cs[17*ij+13];
399  FORTRAN(nident,(&ics[lprev],&inode2,&ilength,&id));
400  if(id>0){
401  if(ics[lprev+id-1]==inode2){
402  icomplex2=ij+1;
403  break;
404  }
405  }
406  }
407  }
408 // idof2=nactdof[mt*inode2+nodempc[3*index2-2]-4];
409  idof2=nactdof[mt*(inode2-1)+nodempc[3*index2-2]];
410  if((idof1>0)&&(idof2>0)){
411  insert(ipointer,&mast1,&next,&idof1,&idof2,&ifree,&nzs_);
412  kdof1=idof1+neq[0];kdof2=idof2+neq[0];
413  insert(ipointer,&mast1,&next,&kdof1,&kdof2,&ifree,&nzs_);
414  if(((icomplex1!=0)||(icomplex2!=0))&&
415  (icomplex1!=icomplex2)){
416  /* if(((icomplex1!=0)||(icomplex2!=0))&&
417  ((icomplex1==0)||(icomplex2==0))){*/
418  insert(ipointer,&mast1,&next,&kdof1,&idof2,&ifree,&nzs_);
419  insert(ipointer,&mast1,&next,&idof1,&kdof2,&ifree,&nzs_);
420  }
421  }
422  index2=nodempc[3*index2-1];
423  if(index2==0) break;
424  }
425  index1=nodempc[3*index1-1];
426  if(index1==0) break;
427  }
428  }
429  }
430  }
431  }
432  }
433  }
434 
435  neq[0]=2*neq[0];
436  neq[1]=neq[0];
437 
438  if(neq[0]==0){
439  printf("\n *WARNING: no degrees of freedom in the model\n");
440  FORTRAN(stop,());
441  }
442 
443  /* determination of the following fields:
444 
445  - irow: row numbers, column per column
446  - icol(i)=# SUBdiagonal nonzero's in column i
447  - jq(i)= location in field irow of the first SUBdiagonal
448  nonzero in column i */
449 
450  RENEW(irow,ITG,ifree);
451  nmast=0;
452  jq[0]=1;
453  for(i=0;i<neq[1];i++){
454  index=ipointer[i];
455  do{
456  if(index==0) break;
457  irow[nmast++]=mast1[index-1];
458  index=next[index-1];
459  }while(1);
460  jq[i+1]=nmast+1;
461 // icol[i]=jq[i+1]-jq[i];
462  }
463 
464  /* sorting the row numbers within each column */
465 
466  for(i=0;i<neq[0];++i){
467  if(jq[i+1]-jq[i]>0){
468  isize=jq[i+1]-jq[i];
469  FORTRAN(isortii,(&irow[jq[i]-1],&mast1[jq[i]-1],&isize,&kflag));
470  }
471  }
472 
473  /* removing duplicate entries */
474 
475  nmast=0;
476  for(i=0;i<neq[0];i++){
477  jstart=nmast+1;
478  if(jq[i+1]-jq[i]>0){
479  irow[nmast++]=irow[jq[i]-1];
480  for(j=jq[i];j<jq[i+1]-1;j++){
481  if(irow[j]==irow[nmast-1])continue;
482  irow[nmast++]=irow[j];
483  }
484  }
485  jq[i]=jstart;
486  }
487  jq[neq[0]]=nmast+1;
488 
489  for(i=0;i<neq[0];i++){
490  icol[i]=jq[i+1]-jq[i];
491  }
492 
493  nzs[0]=jq[neq[0]-1]-1;
494  nzs[1]=nzs[0];
495  nzs[2]=nzs[0];
496 
497  /* summary */
498 
499  printf(" number of equations\n");
500  printf(" %" ITGFORMAT "\n",neq[0]);
501  printf(" number of nonzero lower triangular matrix elements\n");
502  printf(" %" ITGFORMAT "\n",nmast);
503 
504  SFREE(next);
505 
506  *mast1p=mast1;
507  *irowp=irow;
508 
509  return;
510 
511 }
#define ITGFORMAT
Definition: CalculiX.h:52
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
ITG strcmp1(const char *s1, const char *s2)
Definition: strcmp1.c:24
void insert(ITG *ipointer, ITG **mast1p, ITG **mast2p, ITG *i1, ITG *i2, ITG *ifree, ITG *nzs_)
Definition: insert.c:24
subroutine stop()
Definition: stop.f:20
subroutine isortii(ix, iy, n, kflag)
Definition: isortii.f:6
#define RENEW(a, b, c)
Definition: CalculiX.h:40
#define SFREE(a)
Definition: CalculiX.h:41
subroutine nident(x, px, n, id)
Definition: nident.f:26
#define ITG
Definition: CalculiX.h:51
#define NNEW(a, b, c)
Definition: CalculiX.h:39

◆ mastructem()

void mastructem ( 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 ithermal,
ITG mi,
ITG ielmat,
double *  elcon,
ITG ncmat_,
ITG ntmat_,
ITG inomat,
ITG network 
)
33  {
34 
35  /* determines the structure of the thermo-electromagnetic matrices;
36  (i.e. the location of the nonzeros */
37 
38  char lakonl[2]=" \0";
39 
40  ITG i,j,k,l,jj,ll,id,index,jdof1,jdof2,idof1,idof2,mpc1,mpc2,id1,id2,
41  ist1,ist2,node1,node2,isubtract,nmast,ifree,istart,istartold,
42  index1,index2,m,node,nzs_,ist,kflag,indexe,nope,isize,*mast1=NULL,
43  *irow=NULL,mt=mi[1]+1,imat,idomain,jmin,jmax,*next=NULL,jstart;
44 
45  /* the indices in the comments follow FORTRAN convention, i.e. the
46  fields start with 1 */
47 
48  mast1=*mast1p;
49  irow=*irowp;
50 
51  kflag=1;
52  nzs_=nzs[1];
53  NNEW(next,ITG,nzs_);
54 
55  /* initialisation of nactmpc */
56 
57  for(i=0;i<mt**nk;++i){nactdof[i]=0;}
58 
59  /* determining the mechanical active degrees of freedom due to elements */
60  if((*ithermal<2)||(*ithermal>=3)){
61  for(i=0;i<*ne;++i){
62 
63  if(ipkon[i]<0) continue;
64  indexe=ipkon[i];
65  if(strcmp1(&lakon[8*i+3],"20")==0)nope=20;
66  else if (strcmp1(&lakon[8*i+3],"8")==0)nope=8;
67  else if (strcmp1(&lakon[8*i+3],"10")==0)nope=10;
68  else if (strcmp1(&lakon[8*i+3],"4")==0) nope=4;
69  else if (strcmp1(&lakon[8*i+3],"15")==0)nope=15;
70  else if (strcmp1(&lakon[8*i+3],"6")==0)nope=6;
71  else continue;
72 
73  /* degrees of freedom:
74  in domain 1: phi
75  in domain 2: A and V
76  in domain 3: A */
77 
78  imat=ielmat[i*mi[2]];
79  idomain=(ITG)elcon[(*ncmat_+1)**ntmat_*(imat-1)+2];
80  if(idomain==1){
81  jmin=5;jmax=6;
82  }else if(idomain==2){
83  jmin=1;jmax=5;
84  }else if(idomain==3){
85  jmin=1;jmax=4;
86  }else{
87  continue;
88  }
89 
90  /* displacement degrees of freedom */
91 
92  for(j=0;j<nope;++j){
93  node=kon[indexe+j]-1;
94  for(k=jmin;k<jmax;++k){
95  nactdof[mt*node+k]=1;
96  }
97  }
98 
99  }
100  }
101 
102  /* determining the thermal active degrees of freedom due to elements */
103 
104  if(*ithermal>1){
105  for(i=0;i<*ne;++i){
106 
107  if(ipkon[i]<0) continue;
108 
109  /* only the A-V domain (domain 2) has temperature variables */
110 
111  imat=ielmat[i*mi[2]];
112  idomain=(ITG)elcon[(*ncmat_+1)**ntmat_*(imat-1)+2];
113  if(idomain!=2) continue;
114 
115  indexe=ipkon[i];
116  if(strcmp1(&lakon[8*i+3],"20")==0)nope=20;
117  else if (strcmp1(&lakon[8*i+3],"8")==0)nope=8;
118  else if (strcmp1(&lakon[8*i+3],"10")==0)nope=10;
119  else if (strcmp1(&lakon[8*i+3],"4")==0)nope=4;
120  else if (strcmp1(&lakon[8*i+3],"15")==0)nope=15;
121  else if (strcmp1(&lakon[8*i+3],"6")==0)nope=6;
122  else if (strcmp1(&lakon[8*i],"E")==0){
123  lakonl[0]=lakon[8*i+7];
124  nope=atoi(lakonl)+1;}
125  else if ((strcmp1(&lakon[8*i],"D ")==0)||
126  ((strcmp1(&lakon[8*i],"D")==0)&&(*network==1))){
127 
128  /* check for entry or exit element */
129 
130  if((kon[indexe]==0)||(kon[indexe+2]==0)) continue;
131 
132  /* generic network element */
133 
134  for(j=0;j<3;j=j+2){
135  node=kon[indexe+j]-1;
136  nactdof[mt*node]=1;
137  }
138  continue;}
139  else continue;
140 
141  for(j=0;j<nope;++j){
142  node=kon[indexe+j]-1;
143  nactdof[mt*node]=1;
144  }
145  }
146  }
147 
148  /* determining the active degrees of freedom due to mpc's */
149 
150  for(i=0;i<*nmpc;++i){
151  index=ipompc[i]-1;
152  do{
153  node=nodempc[3*index];
154  if(inomat[node-1]>0){
155  nactdof[mt*(node-1)+nodempc[3*index+1]]=1;
156  }
157  index=nodempc[3*index+2];
158  if(index==0) break;
159  index--;
160  }while(1);
161  }
162 
163  /* subtracting the SPC and MPC nodes */
164 
165  for(i=0;i<*nboun;++i){
166  if(ndirboun[i]>mi[1]){continue;}
167  nactdof[mt*(nodeboun[i]-1)+ndirboun[i]]=-2*(i+1);
168  }
169 
170  for(i=0;i<*nmpc;++i){
171  index=ipompc[i]-1;
172  if(nodempc[3*index+1]>mi[1]) continue;
173  nactdof[mt*(nodempc[3*index]-1)+nodempc[3*index+1]]=-2*i-1;
174  }
175 
176  /* numbering the active degrees of freedom */
177 
178  neq[0]=0;
179  for(i=0;i<*nk;++i){
180  for(j=1;j<mt;++j){
181  if(nactdof[mt*i+j]>0){
182  if((*ithermal<2)||(*ithermal>=3)){
183  ++neq[0];
184  nactdof[mt*i+j]=neq[0];
185  }
186  else{
187  nactdof[mt*i+j]=0;
188  }
189  }
190  }
191  }
192  neq[1]=neq[0];
193  for(i=0;i<*nk;++i){
194  if(nactdof[mt*i]>0){
195  if(*ithermal>1){
196  ++neq[1];
197  nactdof[mt*i]=neq[1];
198  }
199  else{
200  nactdof[mt*i]=0;
201  }
202  }
203  }
204  neq[2]=neq[1];
205 
206  ifree=0;
207 
208  /* determining the position of each nonzero matrix element in
209  the SUPERdiagonal matrix */
210 
211  /* mast1(ipointer(i)) = first nonzero row in column i
212  next(ipointer(i)) points to further nonzero elements in
213  column i */
214 
215  for(i=0;i<4**nk;++i){ipointer[i]=0;}
216 
217  /* electromagnetic entries */
218 
219  if((*ithermal<2)||(*ithermal>=3)){
220 
221  for(i=0;i<*ne;++i){
222 
223  if(ipkon[i]<0) continue;
224  indexe=ipkon[i];
225  if(strcmp1(&lakon[8*i+3],"20")==0)nope=20;
226  else if (strcmp1(&lakon[8*i+3],"8")==0)nope=8;
227  else if (strcmp1(&lakon[8*i+3],"10")==0)nope=10;
228  else if (strcmp1(&lakon[8*i+3],"4")==0)nope=4;
229  else if (strcmp1(&lakon[8*i+3],"15")==0)nope=15;
230  else if (strcmp1(&lakon[8*i+3],"6")==0)nope=6;
231  else continue;
232 
233  for(jj=0;jj<mi[1]*nope;++jj){
234 
235  j=jj/mi[1];
236  k=jj-mi[1]*j;
237 
238  node1=kon[indexe+j];
239  jdof1=nactdof[mt*(node1-1)+k+1];
240 
241  for(ll=jj;ll<mi[1]*nope;++ll){
242 
243  l=ll/mi[1];
244  m=ll-mi[1]*l;
245 
246  node2=kon[indexe+l];
247  jdof2=nactdof[mt*(node2-1)+m+1];
248 
249  /* check whether one of the DOF belongs to a SPC or MPC */
250 
251  if((jdof1>0)&&(jdof2>0)){
252  insert(ipointer,&mast1,&next,&jdof1,&jdof2,&ifree,&nzs_);
253  }
254  else if((jdof1>0)||(jdof2>0)){
255 
256  /* idof1: genuine DOF
257  idof2: nominal DOF of the SPC/MPC */
258 
259  if(jdof1<=0){
260  idof1=jdof2;
261  idof2=jdof1;}
262 // idof2=8*node1+k-7;}
263  else{
264  idof1=jdof1;
265  idof2=jdof2;}
266 // idof2=8*node2+m-7;}
267 
268  if(*nmpc>0){
269 
270 // FORTRAN(nident,(ikmpc,&idof2,nmpc,&id));
271 // if((id>0)&&(ikmpc[id-1]==idof2)){
272  if(idof2!=2*(idof2/2)){
273 
274  /* regular DOF / MPC */
275 
276 // id=ilmpc[id-1];
277  id=(-idof2+1)/2;
278  ist=ipompc[id-1];
279  index=nodempc[3*ist-1];
280  if(index==0) continue;
281  while(1){
282  idof2=nactdof[mt*(nodempc[3*index-3]-1)+nodempc[3*index-2]];
283  if(idof2>0){
284  insert(ipointer,&mast1,&next,&idof1,&idof2,&ifree,&nzs_);
285  }
286  index=nodempc[3*index-1];
287  if(index==0) break;
288  }
289  continue;
290  }
291  }
292  }
293 
294  else{
295 // idof1=8*node1+k-7;
296 // idof2=8*node2+m-7;
297  idof1=jdof1;
298  idof2=jdof2;
299  mpc1=0;
300  mpc2=0;
301  if(*nmpc>0){
302 /* FORTRAN(nident,(ikmpc,&idof1,nmpc,&id1));
303  if((id1>0)&&(ikmpc[id1-1]==idof1)) mpc1=1;
304  FORTRAN(nident,(ikmpc,&idof2,nmpc,&id2));
305  if((id2>0)&&(ikmpc[id2-1]==idof2)) mpc2=1;*/
306  if(idof1!=2*(idof1/2)) mpc1=1;
307  if(idof2!=2*(idof2/2)) mpc2=1;
308  }
309  if((mpc1==1)&&(mpc2==1)){
310 // id1=ilmpc[id1-1];
311 // id2=ilmpc[id2-1];
312  id1=(-idof1+1)/2;
313  id2=(-idof2+1)/2;
314  if(id1==id2){
315 
316  /* MPC id1 / MPC id1 */
317 
318  ist=ipompc[id1-1];
319  index1=nodempc[3*ist-1];
320  if(index1==0) continue;
321  while(1){
322  idof1=nactdof[mt*(nodempc[3*index1-3]-1)+nodempc[3*index1-2]];
323  index2=index1;
324  while(1){
325  idof2=nactdof[mt*(nodempc[3*index2-3]-1)+nodempc[3*index2-2]];
326  if((idof1>0)&&(idof2>0)){
327  insert(ipointer,&mast1,&next,&idof1,&idof2,&ifree,&nzs_);}
328  index2=nodempc[3*index2-1];
329  if(index2==0) break;
330  }
331  index1=nodempc[3*index1-1];
332  if(index1==0) break;
333  }
334  }
335 
336  else{
337 
338  /* MPC id1 /MPC id2 */
339 
340  ist1=ipompc[id1-1];
341  index1=nodempc[3*ist1-1];
342  if(index1==0) continue;
343  while(1){
344  idof1=nactdof[mt*(nodempc[3*index1-3]-1)+nodempc[3*index1-2]];
345  ist2=ipompc[id2-1];
346  index2=nodempc[3*ist2-1];
347  if(index2==0){
348  index1=nodempc[3*index1-1];
349  if(index1==0){break;}
350  else{continue;}
351  }
352  while(1){
353  idof2=nactdof[mt*(nodempc[3*index2-3]-1)+nodempc[3*index2-2]];
354  if((idof1>0)&&(idof2>0)){
355  insert(ipointer,&mast1,&next,&idof1,&idof2,&ifree,&nzs_);}
356  index2=nodempc[3*index2-1];
357  if(index2==0) break;
358  }
359  index1=nodempc[3*index1-1];
360  if(index1==0) break;
361  }
362  }
363  }
364  }
365  }
366  }
367  }
368 
369  }
370 
371  /* thermal entries*/
372 
373  if(*ithermal>1){
374 
375  for(i=0;i<*ne;++i){
376 
377  if(ipkon[i]<0) continue;
378 
379  /* only the A-V domain (domain 2) has temperature variables */
380 
381  imat=ielmat[i*mi[2]];
382  idomain=(ITG)elcon[(*ncmat_+1)**ntmat_*(imat-1)+2];
383  if(idomain!=2) continue;
384 
385  indexe=ipkon[i];
386  if(strcmp1(&lakon[8*i+3],"20")==0)nope=20;
387  else if (strcmp1(&lakon[8*i+3],"8")==0)nope=8;
388  else if (strcmp1(&lakon[8*i+3],"10")==0)nope=10;
389  else if (strcmp1(&lakon[8*i+3],"4")==0)nope=4;
390  else if (strcmp1(&lakon[8*i+3],"15")==0)nope=15;
391  else if (strcmp1(&lakon[8*i+3],"6")==0)nope=6;
392  else if (strcmp1(&lakon[8*i],"E")==0){
393  lakonl[0]=lakon[8*i+7];
394  nope=atoi(lakonl)+1;}
395  else if ((strcmp1(&lakon[8*i],"D ")==0)||
396  ((strcmp1(&lakon[8*i],"D")==0)&&(*network==1))){
397 
398  /* check for entry or exit element */
399 
400  if((kon[indexe]==0)||(kon[indexe+2]==0)) continue;
401  nope=3;}
402  else continue;
403 
404  for(jj=0;jj<nope;++jj){
405 
406  j=jj;
407 
408  node1=kon[indexe+j];
409  jdof1=nactdof[mt*(node1-1)];
410 
411  for(ll=jj;ll<nope;++ll){
412 
413  l=ll;
414 
415  node2=kon[indexe+l];
416  jdof2=nactdof[mt*(node2-1)];
417 
418  /* check whether one of the DOF belongs to a SPC or MPC */
419 
420  if((jdof1>0)&&(jdof2>0)){
421  insert(ipointer,&mast1,&next,&jdof1,&jdof2,&ifree,&nzs_);
422  }
423  else if((jdof1>0)||(jdof2>0)){
424 
425  /* idof1: genuine DOF
426  idof2: nominal DOF of the SPC/MPC */
427 
428  if(jdof1<=0){
429  idof1=jdof2;
430 // idof2=8*node1-8;}
431  idof2=jdof1;}
432  else{
433  idof1=jdof1;
434 // idof2=8*node2-8;}
435  idof2=jdof2;}
436 
437  if(*nmpc>0){
438 
439 // FORTRAN(nident,(ikmpc,&idof2,nmpc,&id));
440 // if((id>0)&&(ikmpc[id-1]==idof2)){
441  if(idof2!=2*(idof2/2)){
442 
443  /* regular DOF / MPC */
444 
445 // id=ilmpc[id-1];
446  id=(-idof2+1)/2;
447  ist=ipompc[id-1];
448  index=nodempc[3*ist-1];
449  if(index==0) continue;
450  while(1){
451  idof2=nactdof[mt*(nodempc[3*index-3]-1)+nodempc[3*index-2]];
452  if(idof2>0){
453  insert(ipointer,&mast1,&next,&idof1,&idof2,&ifree,&nzs_);
454  }
455  index=nodempc[3*index-1];
456  if(index==0) break;
457  }
458  continue;
459  }
460  }
461  }
462 
463  else{
464 // idof1=8*node1-8;
465 // idof2=8*node2-8;
466  idof1=jdof1;
467  idof2=jdof2;
468  mpc1=0;
469  mpc2=0;
470  if(*nmpc>0){
471 /* FORTRAN(nident,(ikmpc,&idof1,nmpc,&id1));
472  if((id1>0)&&(ikmpc[id1-1]==idof1)) mpc1=1;
473  FORTRAN(nident,(ikmpc,&idof2,nmpc,&id2));
474  if((id2>0)&&(ikmpc[id2-1]==idof2)) mpc2=1;*/
475  if(idof1!=2*(idof1/2)) mpc1=1;
476  if(idof2!=2*(idof2/2)) mpc2=1;
477  }
478  if((mpc1==1)&&(mpc2==1)){
479 // id1=ilmpc[id1-1];
480 // id2=ilmpc[id2-1];
481  id1=(-idof1+1)/2;
482  id2=(-idof2+1)/2;
483  if(id1==id2){
484 
485  /* MPC id1 / MPC id1 */
486 
487  ist=ipompc[id1-1];
488  index1=nodempc[3*ist-1];
489  if(index1==0) continue;
490  while(1){
491  idof1=nactdof[mt*(nodempc[3*index1-3]-1)+nodempc[3*index1-2]];
492  index2=index1;
493  while(1){
494  idof2=nactdof[mt*(nodempc[3*index2-3]-1)+nodempc[3*index2-2]];
495  if((idof1>0)&&(idof2>0)){
496  insert(ipointer,&mast1,&next,&idof1,&idof2,&ifree,&nzs_);}
497  index2=nodempc[3*index2-1];
498  if(index2==0) break;
499  }
500  index1=nodempc[3*index1-1];
501  if(index1==0) break;
502  }
503  }
504 
505  else{
506 
507  /* MPC id1 /MPC id2 */
508 
509  ist1=ipompc[id1-1];
510  index1=nodempc[3*ist1-1];
511  if(index1==0) continue;
512  while(1){
513  idof1=nactdof[mt*(nodempc[3*index1-3]-1)+nodempc[3*index1-2]];
514  ist2=ipompc[id2-1];
515  index2=nodempc[3*ist2-1];
516  if(index2==0){
517  index1=nodempc[3*index1-1];
518  if(index1==0){break;}
519  else{continue;}
520  }
521  while(1){
522  idof2=nactdof[mt*(nodempc[3*index2-3]-1)+nodempc[3*index2-2]];
523  if((idof1>0)&&(idof2>0)){
524  insert(ipointer,&mast1,&next,&idof1,&idof2,&ifree,&nzs_);}
525  index2=nodempc[3*index2-1];
526  if(index2==0) break;
527  }
528  index1=nodempc[3*index1-1];
529  if(index1==0) break;
530  }
531  }
532  }
533  }
534  }
535  }
536  }
537 
538  }
539 
540  if(neq[1]==0){
541  printf("\n *WARNING: no degrees of freedom in the model\n\n");
542  }
543 
544  /* determination of the following fields:
545 
546  - irow: row numbers, column per column
547  - icol(i)=# SUBdiagonal nonzero's in column i
548  - jq(i)= location in field irow of the first SUBdiagonal
549  nonzero in column i */
550 
551  RENEW(irow,ITG,ifree);
552  nmast=0;
553  jq[0]=1;
554  for(i=0;i<neq[1];i++){
555  index=ipointer[i];
556  do{
557  if(index==0) break;
558  irow[nmast++]=mast1[index-1];
559  index=next[index-1];
560  }while(1);
561  jq[i+1]=nmast+1;
562 // icol[i]=jq[i+1]-jq[i];
563  }
564 
565  /* sorting the row numbers within each column */
566 
567  for(i=0;i<neq[1];++i){
568  if(jq[i+1]-jq[i]>0){
569  isize=jq[i+1]-jq[i];
570  FORTRAN(isortii,(&irow[jq[i]-1],&mast1[jq[i]-1],&isize,&kflag));
571  }
572  }
573 
574  /* removing duplicate entries */
575 
576  nmast=0;
577  for(i=0;i<neq[1];i++){
578  jstart=nmast+1;
579  if(jq[i+1]-jq[i]>0){
580  irow[nmast++]=irow[jq[i]-1];
581  for(j=jq[i];j<jq[i+1]-1;j++){
582  if(irow[j]==irow[nmast-1])continue;
583  irow[nmast++]=irow[j];
584  }
585  }
586  jq[i]=jstart;
587  }
588  jq[neq[1]]=nmast+1;
589 
590  for(i=0;i<neq[1];i++){
591  icol[i]=jq[i+1]-jq[i];
592  }
593 
594  if(neq[0]==0){nzs[0]=0;}
595  else{nzs[0]=jq[neq[0]]-1;}
596  nzs[1]=jq[neq[1]]-1;
597 
598  nzs[2]=nzs[1];
599 
600  /* summary */
601 
602  printf(" number of equations\n");
603  printf(" %" ITGFORMAT "\n",neq[1]);
604  printf(" number of nonzero lower triangular matrix elements\n");
605  printf(" %" ITGFORMAT "\n",nmast);
606  printf("\n");
607 
608  SFREE(next);
609 
610  *mast1p=mast1;
611  *irowp=irow;
612 
613  return;
614 
615 }
#define ITGFORMAT
Definition: CalculiX.h:52
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
ITG strcmp1(const char *s1, const char *s2)
Definition: strcmp1.c:24
void insert(ITG *ipointer, ITG **mast1p, ITG **mast2p, ITG *i1, ITG *i2, ITG *ifree, ITG *nzs_)
Definition: insert.c:24
subroutine isortii(ix, iy, n, kflag)
Definition: isortii.f:6
#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

◆ mastructf()

void mastructf ( ITG nk,
ITG kon,
ITG ipkon,
char *  lakon,
ITG ne,
ITG icol,
ITG jq,
ITG **  mast1p,
ITG **  irowp,
ITG isolver,
ITG ipointer,
ITG nzs,
ITG ipnei,
ITG ineiel,
ITG mi 
)
30  {
31 
32  ITG i,j,k,l,index,idof1,idof2,node1,isubtract,nmast,ifree=0,istart,istartold,
33  nzs_,kflag,isize,*mast1=NULL,*irow=NULL,neighbor,mt=mi[1]+1,numfaces,
34  *next=NULL,jstart;
35 
36  /* the indices in the comments follow FORTRAN convention, i.e. the
37  fields start with 1 */
38 
39  mast1=*mast1p;irow=*irowp;
40 
41  kflag=1;
42  nzs_=*nzs;
43  NNEW(next,ITG,nzs_);
44 
45  /* determining the nonzero locations */
46 
47  for(i=0;i<*nef;i++){
48  idof1=i+1;
49  if(strcmp1(&lakonf[8*i+3],"8")==0){
50  numfaces=6;
51  }else if(strcmp1(&lakonf[8*i+3],"6")==0){
52  numfaces=5;
53  }else{
54  numfaces=4;
55  }
56 
57  index=ipnei[i];
58  insert(ipointer,&mast1,&next,&idof1,&idof1,&ifree,&nzs_);
59  for(j=0;j<numfaces;j++){
60  neighbor=neiel[index+j];
61  if(neighbor==0) continue;
62  idof2=neighbor;
63  insert(ipointer,&mast1,&next,&idof1,&idof2,&ifree,&nzs_);
64  }
65 
66  }
67 
68  if(*nef==0){
69  printf("\n *WARNING: no degrees of freedom in the model\n\n");
70  }
71 
72  /* determination of the following fields:
73 
74  - irow: row numbers, column per column
75  - icol(i)=# SUBdiagonal nonzero's in column i
76  - jq(i)= location in field irow of the first SUBdiagonal
77  nonzero in column i */
78 
79  RENEW(irow,ITG,ifree);
80  nmast=0;
81  jq[0]=1;
82  for(i=0;i<*nef;i++){
83  index=ipointer[i];
84  do{
85  if(index==0) break;
86  irow[nmast++]=mast1[index-1];
87  index=next[index-1];
88  }while(1);
89  jq[i+1]=nmast+1;
90 // icol[i]=jq[i+1]-jq[i];
91  }
92 
93 /* sorting the row numbers within each column */
94 
95  for(i=0;i<*nef;++i){
96  if(jq[i+1]-jq[i]>0){
97  isize=jq[i+1]-jq[i];
98  FORTRAN(isortii,(&irow[jq[i]-1],&mast1[jq[i]-1],&isize,&kflag));
99  }
100  }
101 
102  /* removing duplicate entries */
103 
104  nmast=0;
105  for(i=0;i<*nef;i++){
106  jstart=nmast+1;
107  if(jq[i+1]-jq[i]>0){
108  irow[nmast++]=irow[jq[i]-1];
109  for(j=jq[i];j<jq[i+1]-1;j++){
110  if(irow[j]==irow[nmast-1])continue;
111  irow[nmast++]=irow[j];
112  }
113  }
114  jq[i]=jstart;
115  }
116  jq[*nef]=nmast+1;
117 
118  for(i=0;i<*nef;i++){
119  icol[i]=jq[i+1]-jq[i];
120  }
121 
122  /* summary */
123 
124  printf(" number of equations\n");
125  printf(" %" ITGFORMAT "\n",*nef);
126  printf(" number of nonzero lower triangular matrix elements\n");
127  printf(" %" ITGFORMAT "\n",nmast);
128  printf("\n");
129 
130  *nzs=jq[*nef]-1;
131 
132  SFREE(next);
133 
134  *mast1p=mast1;*irowp=irow;
135 
136  return;
137 
138 }
#define ITGFORMAT
Definition: CalculiX.h:52
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
ITG strcmp1(const char *s1, const char *s2)
Definition: strcmp1.c:24
void insert(ITG *ipointer, ITG **mast1p, ITG **mast2p, ITG *i1, ITG *i2, ITG *ifree, ITG *nzs_)
Definition: insert.c:24
subroutine isortii(ix, iy, n, kflag)
Definition: isortii.f:6
#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

◆ mastructrad()

void mastructrad ( ITG ntr,
ITG nloadtr,
char *  sideload,
ITG ipointerrad,
ITG **  mast1radp,
ITG **  irowradp,
ITG nzsrad,
ITG jqrad,
ITG icolrad 
)
26  {
27 
28 /* determining the structure of the viewfactor and the radiation
29  matrix (both have the same structure). Only the structure of the
30  lower half of the matrix is determined, since the structure of
31  the upper half is identical */
32 
33  char crcav[4]=" \0";
34 
35  ITG three=3,i,j,k,l,ii,jj,icav,jcav,*mast1rad=NULL,*irowrad=NULL,
36  ifree,nzsrad_,nmast,isubtract,isize,kflag,istart,istartold;
37 
38  mast1rad=*mast1radp;
39  irowrad=*irowradp;
40 
41  kflag=2;
42  nzsrad_=*nzsrad;
43 
44  /* determining the position of each nonzero matrix element in
45  the SUPERdiagonal matrix */
46 
47  ifree=0;
48 
49  for(ii=1;ii<=*ntr;ii++){
50  i=nloadtr[ii-1]-1;
51  strcpy1(crcav,&sideload[20*i+17],three);
52  icav=atoi(crcav);
53  for(jj=1;jj<=ii;jj++){
54  j=nloadtr[jj-1]-1;
55  strcpy1(crcav,&sideload[20*j+17],three);
56  jcav=atoi(crcav);
57  if(icav==jcav){
58  insertrad(ipointerrad,&mast1rad,&irowrad,&ii,
59  &jj,&ifree,&nzsrad_);
60  }
61  }
62  }
63 
64  /* storing the nonzero nodes in the SUPERdiagonal columns:
65  mast1rad contains the row numbers (already done),
66  irowrad the column numbers (done in the next lines) */
67 
68  for(i=0;i<*ntr;++i){
69  if(ipointerrad[i]==0){
70  printf("*ERROR in mastructrad: zero column\n");
71  printf(" DOF=%" ITGFORMAT "\n",i);
72  FORTRAN(stop,());
73  }
74  istart=ipointerrad[i];
75  while(1){
76  istartold=istart;
77  istart=irowrad[istart-1];
78  irowrad[istartold-1]=i+1;
79  if(istart==0) break;
80  }
81  }
82 
83  nmast=ifree;
84 
85  /* summary */
86 
87  printf(" number of radiation equations\n");
88  printf(" %" ITGFORMAT "\n",*ntr);
89  printf(" number of nonzero radiation matrix elements\n");
90  printf(" %" ITGFORMAT "\n",2*nmast-*ntr);
91  printf(" \n");
92 
93  /* switching from a SUPERdiagonal inventory to a SUBdiagonal one:
94  since the nonzeros are located in symmetric positions mast1rad
95  can be considered to contain the column numbers and irowrad the
96  row numbers; after sorting mast1rad the following results:
97 
98  - irowrad contains the row numbers of the SUBdiagonal
99  nonzero's, column per column
100  - mast1rad contains the column numbers
101 
102  Furthermore, the following fields are determined:
103 
104  - icolrad(i)=# SUBdiagonal nonzero's in column i
105  - jqrad(i)= location in field irow of the first SUBdiagonal
106  nonzero in column i */
107 
108  /* ordering the column numbers in mast1rad */
109 
110  FORTRAN(isortii,(mast1rad,irowrad,&nmast,&kflag));
111 
112  /* filtering out the diagonal elements and generating icolrad and jqrad */
113 
114  isubtract=0;
115  for(i=0;i<*ntr;++i){icolrad[i]=0;}
116  k=0;
117  for(i=0;i<nmast;++i){
118  if(mast1rad[i]==irowrad[i]){++isubtract;}
119  else{
120  mast1rad[i-isubtract]=mast1rad[i];
121  irowrad[i-isubtract]=irowrad[i];
122  if(k!=mast1rad[i]){
123  for(l=k;l<mast1rad[i];++l){jqrad[l]=i+1-isubtract;}
124  k=mast1rad[i];
125  }
126  ++icolrad[k-1];
127  }
128  }
129  nmast=nmast-isubtract;
130  for(l=k;l<*ntr+1;++l){jqrad[l]=nmast+1;}
131 
132  /* sorting the row numbers within each column */
133 
134  for(i=0;i<*ntr;++i){
135  if(jqrad[i+1]-jqrad[i]>0){
136  isize=jqrad[i+1]-jqrad[i];
137  FORTRAN(isortii,(&irowrad[jqrad[i]-1],&mast1rad[jqrad[i]-1],
138  &isize,&kflag));
139  }
140  }
141 
142  *nzsrad=jqrad[*ntr]-1;
143 
144  *mast1radp=mast1rad;
145  *irowradp=irowrad;
146 
147  return;
148 
149 }
#define ITGFORMAT
Definition: CalculiX.h:52
void insertrad(ITG *ipointer, ITG **mast1p, ITG **mast2p, ITG *i1, ITG *i2, ITG *ifree, ITG *nzs_)
Definition: insertrad.c:24
ITG strcpy1(char *s1, const char *s2, ITG length)
Definition: strcpy1.c:24
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
subroutine stop()
Definition: stop.f:20
subroutine isortii(ix, iy, n, kflag)
Definition: isortii.f:6
#define ITG
Definition: CalculiX.h:51

◆ mastructrand()

void mastructrand ( ITG icols,
ITG jqs,
ITG **  mast1p,
ITG **  irowsp,
ITG ipointer,
ITG nzss,
ITG ndesi,
double *  physcon,
double *  xo,
double *  yo,
double *  zo,
double *  x,
double *  y,
double *  z,
ITG nx,
ITG ny,
ITG nz 
)
30  {
31 
32  /* determines the structure of the covariance matrix;
33  (i.e. the location of the nonzeros */
34 
35  char lakonl[2]=" \0";
36 
37  ITG i,j,ii,index,jdof2,jdof1,nmast,ifree,kflag,indexe,isize,*mast1=NULL,
38  *irows=NULL,*next=NULL,jstart,idesvar,*neighbor=NULL,nnodesinside;
39 
40  double *r=NULL,corrlength;
41 
42  /* the indices in the comments follow FORTRAN convention, i.e. the
43  fields start with 1 */
44 
45  mast1=*mast1p;
46  irows=*irowsp;
47  ifree=0;
48  kflag=2;
49  corrlength=4*physcon[12];
50 
51  NNEW(next,ITG,*nzss);
52  NNEW(neighbor,ITG,*ndesi+6);
53  NNEW(r,double,*ndesi+6);
54 
55  for(idesvar=0;idesvar<*ndesi;idesvar++){
56  jdof1=idesvar+1;
57 
58  /* nodes within 4 times the correlation length */
59 
60  FORTRAN(near3d_se,(xo,yo,zo,x,y,z,nx,ny,nz,&xo[idesvar],
61  &yo[idesvar],&zo[idesvar],ndesi,neighbor,
62  r,&nnodesinside,&corrlength));
63 
64  for(ii=0;ii<nnodesinside;ii++){
65  jdof2=neighbor[ii];
66  insert(ipointer,&mast1,&next,&jdof1,&jdof2,&ifree,nzss);
67  }
68  }
69 
70  /* determination of the following fields:
71 
72  - irows: row numbers, column per column
73  - jqs(i)= location in field irows of the first SUBdiagonal
74  nonzero in column i */
75 
76  RENEW(irows,ITG,ifree);
77  nmast=0;
78  jqs[0]=1;
79  for(i=0;i<*ndesi;i++){
80  index=ipointer[i];
81  do{
82  if(index==0) break;
83  irows[nmast++]=mast1[index-1];
84  index=next[index-1];
85  }while(1);
86  jqs[i+1]=nmast+1;
87  }
88 
89  /* sorting the row numbers within each column */
90 
91  for(i=0;i<*ndesi;++i){
92  if(jqs[i+1]-jqs[i]>0){
93  isize=jqs[i+1]-jqs[i];
94  FORTRAN(isortii,(&irows[jqs[i]-1],&mast1[jqs[i]-1],&isize,&kflag));
95  }
96  }
97 
98  /* removing duplicate entries */
99 
100  nmast=0;
101  for(i=0;i<*ndesi;i++){
102  jstart=nmast+1;
103  if(jqs[i+1]-jqs[i]>0){
104  irows[nmast++]=irows[jqs[i]-1];
105  for(j=jqs[i];j<jqs[i+1]-1;j++){
106  if(irows[j]==irows[nmast-1])continue;
107  irows[nmast++]=irows[j];
108  }
109  }
110  jqs[i]=jstart;
111  }
112  jqs[*ndesi]=nmast+1;
113 
114  for(i=0;i<*ndesi;i++){
115  icols[i]=jqs[i+1]-jqs[i];
116  }
117  *nzss=jqs[*ndesi]-1;
118 
119  SFREE(next);SFREE(neighbor);SFREE(r);
120 
121  *mast1p=mast1;
122  *irowsp=irows;
123 
124  return;
125 
126 }
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
void insert(ITG *ipointer, ITG **mast1p, ITG **mast2p, ITG *i1, ITG *i2, ITG *ifree, ITG *nzs_)
Definition: insert.c:24
subroutine isortii(ix, iy, n, kflag)
Definition: isortii.f:6
#define RENEW(a, b, c)
Definition: CalculiX.h:40
#define SFREE(a)
Definition: CalculiX.h:41
subroutine near3d_se(xo, yo, zo, x, y, z, nx, ny, nz, xp, yp, zp, n, ir, r, nr, radius)
Definition: near3d_se.f:21
#define ITG
Definition: CalculiX.h:51
#define NNEW(a, b, c)
Definition: CalculiX.h:39

◆ mastructse()

void mastructse ( ITG kon,
ITG ipkon,
char *  lakon,
ITG ne,
ITG ipompc,
ITG nodempc,
ITG nmpc,
ITG nactdof,
ITG icols,
ITG jqs,
ITG **  mast1p,
ITG **  irowsp,
ITG ipointer,
ITG nzss,
ITG mi,
ITG mortar,
ITG nodedesi,
ITG ndesi,
ITG icoordinate,
ITG ielorien,
ITG istartdesi,
ITG ialdesi 
)
32  {
33 
34  /* determines the structure of the thermo-mechanical matrices;
35  (i.e. the location of the nonzeros */
36 
37  char lakonl[2]=" \0";
38 
39  ITG i,j,k,id,index,jdof1,idof1,idof2,nmast,ifree,kdof1,
40  node,ist,kflag,indexe,nope,isize,*mast1=NULL,ii,
41  *irows=NULL,mt=mi[1]+1,*next=NULL,jstart,idesvar;
42 
43  mast1=*mast1p;
44  irows=*irowsp;
45  ifree=0;
46  kflag=2;
47 
48  NNEW(next,ITG,*nzss);
49 
50  for(idesvar=0;idesvar<*ndesi;idesvar++){
51  idof2=idesvar+1;
52 
53  for(ii=istartdesi[idesvar]-1;ii<istartdesi[idesvar+1]-1;ii++){
54  i=ialdesi[ii]-1;
55 
56  if(ipkon[i]<0) continue;
57  if(strcmp1(&lakon[8*i],"F")==0)continue;
58  indexe=ipkon[i];
59 /* Bernhardi start */
60  if (strcmp1(&lakon[8*i+3],"8I")==0)nope=11;
61  else if(strcmp1(&lakon[8*i+3],"20")==0)nope=20;
62 /* Bernhardi end */
63  else if (strcmp1(&lakon[8*i+3],"8")==0)nope=8;
64  else if (strcmp1(&lakon[8*i+3],"10")==0)nope=10;
65  else if ((strcmp1(&lakon[8*i+3],"4")==0)||
66  (strcmp1(&lakon[8*i+2],"4")==0)) nope=4;
67  else if (strcmp1(&lakon[8*i+3],"15")==0)nope=15;
68  else if (strcmp1(&lakon[8*i+3],"6")==0)nope=6;
69  else if (strcmp1(&lakon[8*i],"E")==0){
70  if((strcmp1(&lakon[8*i+6],"C")==0)&&(*mortar==1)){
71 
72  /* face-to-face contact (all nodes already belong
73  to other elements */
74 
75  continue;
76  }else if(strcmp1(&lakon[8*i+6],"F")!=0){
77 
78  /* node-to-face contact */
79 
80  lakonl[0]=lakon[8*i+7];
81  nope=atoi(lakonl)+1;
82  }else{
83 
84  /* advection elements */
85 
86  continue;
87  }
88  }else continue;
89 
90  /* displacement degrees of freedom */
91 
92  for(j=0;j<nope;++j){
93  node=kon[indexe+j]-1;
94  for(k=1;k<4;k++){
95  idof1=nactdof[mt*node+k];
96  if(idof1>0){
97  insertfreq(ipointer,&mast1,&next,
98  &idof1,&idof2,&ifree,nzss);
99  }else if(*nmpc!=0){
100  if(idof1!=2*(idof1/2)){
101  id=(-idof1+1)/2-1;
102  ist=ipompc[id]-1;
103  index=nodempc[3*ist+2];
104  if(index==0) continue;
105  do{
106  jdof1=nactdof[mt*(nodempc[3*index-3]-1)
107  +nodempc[3*index-2]];
108  if(jdof1>0){
109  insertfreq(ipointer,&mast1,&next,
110  &jdof1,&idof2,&ifree,nzss);
111  }
112  index=nodempc[3*index-1];
113  if(index==0) break;
114  }while(1);
115  }
116  }
117  }
118  }
119  }
120  }
121 
122  /* determine irows and jqs */
123 
124  RENEW(irows,ITG,ifree);
125  nmast=0;
126  jqs[0]=1;
127  for(i=0;i<*ndesi;i++){
128  index=ipointer[i];
129  do{
130  if(index==0) break;
131  irows[nmast++]=mast1[index-1];
132  index=next[index-1];
133  }while(1);
134  jqs[i+1]=nmast+1;
135  }
136 
137  /* sorting the row numbers within each column */
138 
139  for(i=0;i<*ndesi;++i){
140  if(jqs[i+1]-jqs[i]>0){
141  isize=jqs[i+1]-jqs[i];
142  FORTRAN(isortii,(&irows[jqs[i]-1],&mast1[jqs[i]-1],&isize,&kflag));
143  }
144  }
145 
146  /* removing duplicate entries */
147 
148  nmast=0;
149  for(i=0;i<*ndesi;i++){
150  jstart=nmast+1;
151  if(jqs[i+1]-jqs[i]>0){
152  irows[nmast++]=irows[jqs[i]-1];
153  for(j=jqs[i];j<jqs[i+1]-1;j++){
154  if(irows[j]==irows[nmast-1])continue;
155  irows[nmast++]=irows[j];
156  }
157  }
158  jqs[i]=jstart;
159  }
160  jqs[*ndesi]=nmast+1;
161 
162  for(i=0;i<*ndesi;i++){
163  icols[i]=jqs[i+1]-jqs[i];
164  }
165 
166  *nzss=jqs[*ndesi]-1;
167 
168  SFREE(next);
169 
170  *mast1p=mast1;
171  *irowsp=irows;
172 
173  return;
174 
175 }
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
void insertfreq(ITG *ipointer, ITG **mast1p, ITG **nextp, ITG *i1, ITG *i2, ITG *ifree, ITG *nzs_)
Definition: insertfreq.c:24
ITG strcmp1(const char *s1, const char *s2)
Definition: strcmp1.c:24
subroutine isortii(ix, iy, n, kflag)
Definition: isortii.f:6
#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

◆ nonlingeo()

void nonlingeo ( double **  co,
ITG nk,
ITG **  konp,
ITG **  ipkonp,
char **  lakonp,
ITG ne,
ITG nodeboun,
ITG ndirboun,
double *  xboun,
ITG nboun,
ITG **  ipompcp,
ITG **  nodempcp,
double **  coefmpcp,
char **  labmpcp,
ITG nmpc,
ITG nodeforc,
ITG ndirforc,
double *  xforc,
ITG nforc,
ITG **  nelemloadp,
char **  sideloadp,
double *  xload,
ITG nload,
ITG nactdof,
ITG **  icolp,
ITG jq,
ITG **  irowp,
ITG neq,
ITG nzl,
ITG nmethod,
ITG **  ikmpcp,
ITG **  ilmpcp,
ITG ikboun,
ITG ilboun,
double *  elcon,
ITG nelcon,
double *  rhcon,
ITG nrhcon,
double *  alcon,
ITG nalcon,
double *  alzero,
ITG **  ielmatp,
ITG **  ielorienp,
ITG norien,
double *  orab,
ITG ntmat_,
double *  t0,
double *  t1,
double *  t1old,
ITG ithermal,
double *  prestr,
ITG iprestr,
double **  vold,
ITG iperturb,
double *  sti,
ITG nzs,
ITG kode,
char *  filab,
ITG idrct,
ITG jmax,
ITG jout,
double *  timepar,
double *  eme,
double *  xbounold,
double *  xforcold,
double *  xloadold,
double *  veold,
double *  accold,
char *  amname,
double *  amta,
ITG namta,
ITG nam,
ITG iamforc,
ITG **  iamloadp,
ITG iamt1,
double *  alpha,
ITG iexpl,
ITG iamboun,
double *  plicon,
ITG nplicon,
double *  plkcon,
ITG nplkcon,
double **  xstatep,
ITG npmat_,
ITG istep,
double *  ttime,
char *  matname,
double *  qaold,
ITG mi,
ITG isolver,
ITG ncmat_,
ITG nstate_,
ITG iumat,
double *  cs,
ITG mcs,
ITG nkon,
double **  ener,
ITG mpcinfo,
char *  output,
double *  shcon,
ITG nshcon,
double *  cocon,
ITG ncocon,
double *  physcon,
ITG nflow,
double *  ctrl,
char *  set,
ITG nset,
ITG istartset,
ITG iendset,
ITG ialset,
ITG nprint,
char *  prlab,
char *  prset,
ITG nener,
ITG ikforc,
ITG ilforc,
double *  trab,
ITG inotr,
ITG ntrans,
double **  fmpcp,
char *  cbody,
ITG ibody,
double *  xbody,
ITG nbody,
double *  xbodyold,
ITG ielprop,
double *  prop,
ITG ntie,
char *  tieset,
ITG itpamp,
ITG iviewfile,
char *  jobnamec,
double *  tietol,
ITG nslavs,
double *  thicke,
ITG ics,
ITG nintpoint,
ITG mortar,
ITG ifacecount,
char *  typeboun,
ITG **  islavsurfp,
double **  pslavsurfp,
double **  clearinip,
ITG nmat,
double *  xmodal,
ITG iaxial,
ITG inext,
ITG nprop,
ITG network,
char *  orname 
)
82  {
83 
84  char description[13]=" ",*lakon=NULL,jobnamef[396]="",
85  *sideface=NULL,*labmpc=NULL,fnffrd[132]="",*lakonf=NULL,
86  *sideloadref=NULL,*sideload=NULL,stiffmatrix[132]="";
87 
88  ITG *inum=NULL,k,iout=0,icntrl,iinc=0,jprint=0,iit=-1,jnz=0,
89  icutb=0,istab=0,ifreebody,uncoupled,n1,n2,itruecontact,
90  iperturb_sav[2],ilin,*icol=NULL,*irow=NULL,ielas=0,icmd=0,
91  memmpc_,mpcfree,icascade,maxlenmpc,*nodempc=NULL,*iaux=NULL,
92  *nodempcref=NULL,memmpcref_,mpcfreeref,*itg=NULL,*ineighe=NULL,
93  *ieg=NULL,ntg=0,ntr,*kontri=NULL,*nloadtr=NULL,idamping=0,
94  *ipiv=NULL,ntri,newstep,mode=-1,noddiam=-1,nasym=0,im,
95  ntrit,*inocs=NULL,inewton=0,*ipobody=NULL,*nacteq=NULL,
96  *nactdog=NULL,nteq,*itietri=NULL,*koncont=NULL,
97  ncont,ne0,nkon0,*ipkon=NULL,*kon=NULL,*ielorien=NULL,
98  *ielmat=NULL,itp=0,symmetryflag=0,inputformat=0,kscale=1,
99  *iruc=NULL,iitterm=0,iturbulent,ngraph=1,ismallsliding=0,
100  *ipompc=NULL,*ikmpc=NULL,*ilmpc=NULL,i0ref,irref,icref,
101  *itiefac=NULL,*islavsurf=NULL,*islavnode=NULL,*imastnode=NULL,
102  *nslavnode=NULL,*nmastnode=NULL,*imastop=NULL,imat,
103  *iponoels=NULL,*inoels=NULL,*islavsurfold=NULL,maxlenmpcref,
104  *islavact=NULL,mt=mi[1]+1,*nactdofinv=NULL,*ipe=NULL,
105  *ime=NULL,*ikactmech=NULL,nactmech,inode,idir,neold,neini,
106  iemchange=0,nzsrad,*mast1rad=NULL,*irowrad=NULL,*icolrad=NULL,
107  *jqrad=NULL,*ipointerrad=NULL,*integerglob=NULL,negpres=0,
108  mass[2]={0,0}, stiffness=1, buckling=0, rhsi=1, intscheme=0,idiscon=0,
109  coriolis=0,*ipneigh=NULL,*neigh=NULL,maxprevcontel,nslavs_prev_step,
110  *nelemface=NULL,*ipoface=NULL,*nodface=NULL,*ifreestream=NULL,iex,
111  *isolidsurf=NULL,*neighsolidsurf=NULL,*iponoel=NULL,*inoel=NULL,
112  nef=0,nface,nfreestream,nsolidsurf,i,indexe,icfd=0,id,*neij=NULL,
113  node,networknode,iflagact=0,*nodorig=NULL,*ipivr=NULL,iglob=0,
114  *inomat=NULL,*ipnei=NULL,ntrimax,*nx=NULL,*ny=NULL,*nz=NULL,
115  *neifa=NULL,*neiel=NULL,*ielfa=NULL,*ifaext=NULL,nflnei,nfaext,
116  idampingwithoutcontact=0,*nactdoh=NULL,*nactdohinv=NULL,*ipkonf=NULL,
117  *ielmatf=NULL,*ielorienf=NULL,ialeatoric=0,nloadref,isym,
118  *nelemloadref=NULL,*iamloadref=NULL,*idefload=NULL,nload_,
119  *nelemload=NULL,*iamload=NULL,ncontacts=0,inccontact=0,
120  j=0,*ifatie=NULL,n,inoelsize=0,isensitivity=0,*istartblk=NULL,
121  *iendblk=NULL,*nblket=NULL,*nblkze=NULL,nblk,*konf=NULL,*ielblk=NULL,
122  *iwork=NULL,nelt,lrgw,*igwk=NULL,itol,itmax,iter,ierr,iunit,ligw;
123 
124  double *stn=NULL,*v=NULL,*een=NULL,cam[5],*epn=NULL,*cg=NULL,
125  *cdn=NULL,*vel=NULL,*vfa=NULL,*pslavsurfold=NULL,
126  *f=NULL,*fn=NULL,qa[4]={0.,0.,-1.,0.},qam[2]={0.,0.},dtheta,theta,
127  err,ram[8]={0.,0.,0.,0.,0.,0.,0.,0.},*areaslav=NULL,
128  *springarea=NULL,ram1[8]={0.,0.,0.,0.,0.,0.,0.,0.},
129  ram2[8]={0.,0.,0.,0.,0.,0.,0.,0.},deltmx,ptime,smaxls,sminls,
130  uam[2]={0.,0.},*vini=NULL,*ac=NULL,qa0,qau,ea,*straight=NULL,
131  *t1act=NULL,qamold[2],*xbounact=NULL,*bc=NULL,
132  *xforcact=NULL,*xloadact=NULL,*fext=NULL,*clearini=NULL,
133  reltime,time,bet=0.,gam=0.,*aux2=NULL,dtime,*fini=NULL,
134  *fextini=NULL,*veini=NULL,*accini=NULL,*xstateini=NULL,
135  *ampli=NULL,scal1,*eei=NULL,*t1ini=NULL,pressureratio,
136  *xbounini=NULL,dev,*xstiff=NULL,*stx=NULL,*stiini=NULL,
137  *enern=NULL,*coefmpc=NULL,*aux=NULL,*xstaten=NULL,
138  *coefmpcref=NULL,*enerini=NULL,*emn=NULL,alpham,betam,
139  *tarea=NULL,*tenv=NULL,*erad=NULL,*fnr=NULL,*fni=NULL,
140  *adview=NULL,*auview=NULL,*qfx=NULL,*cvini=NULL,*cv=NULL,
141  *qfn=NULL,*co=NULL,*vold=NULL,*fenv=NULL,sigma=0.,
142  *xbodyact=NULL,*cgr=NULL,dthetaref, *vr=NULL,*vi=NULL,
143  *stnr=NULL,*stni=NULL,*vmax=NULL,*stnmax=NULL,*fmpc=NULL,*ener=NULL,
144  *f_cm=NULL, *f_cs=NULL,*adc=NULL,*auc=NULL,*res=NULL,
145  *xstate=NULL,*eenmax=NULL,*adrad=NULL,*aurad=NULL,*bcr=NULL,
146  *xmastnor=NULL,*emeini=NULL,*tinc,*tper,*tmin,*tmax,*tincf,
147  *doubleglob=NULL,*xnoels=NULL,*au=NULL,*resold=NULL,
148  *ad=NULL,*b=NULL,*aub=NULL,*adb=NULL,*pslavsurf=NULL,*pmastsurf=NULL,
149  *x=NULL,*y=NULL,*z=NULL,*xo=NULL,sum1,sum2,flinesearch,
150  *yo=NULL,*zo=NULL,*cdnr=NULL,*cdni=NULL,*fnext=NULL,*fnextini=NULL,
151  allwk=0.,allwkini,energy[4]={0.,0.,0.,0.},energyini[4],
152  energyref,denergymax,dtcont,dtvol,wavespeed[*nmat],emax,r_abs,
153  enetoll,dampwk=0.,dampwkini=0.,temax,*tmp=NULL,energystartstep[4],
154  sizemaxinc,*adblump=NULL,*adcpy=NULL,*aucpy=NULL,*rwork=NULL,
155  *sol=NULL,*rgwk=NULL,tol,*sb=NULL,*sx=NULL;
156 
157  FILE *f1;
158 
159  // MPADD: initialize rmin to the tolerance
160  enetoll=0.02;
161  r_abs=0.0;
162  emax=0.0;
163  // MPADD end
164 
165 
166 #ifdef SGI
167  ITG token;
168 #endif
169 
170  icol=*icolp;irow=*irowp;co=*cop;vold=*voldp;
171  ipkon=*ipkonp;lakon=*lakonp;kon=*konp;ielorien=*ielorienp;
172  ielmat=*ielmatp;ener=*enerp;xstate=*xstatep;
173 
174  ipompc=*ipompcp;labmpc=*labmpcp;ikmpc=*ikmpcp;ilmpc=*ilmpcp;
175  fmpc=*fmpcp;nodempc=*nodempcp;coefmpc=*coefmpcp;nelemload=*nelemloadp;
176  iamload=*iamloadp;sideload=*sideloadp;
177 
178  islavsurf=*islavsurfp;pslavsurf=*pslavsurfp;clearini=*clearinip;
179 
180  tinc=&timepar[0];
181  tper=&timepar[1];
182  tmin=&timepar[2];
183  tmax=&timepar[3];
184  tincf=&timepar[4];
185 
186  if(*ithermal==4){
187  uncoupled=1;
188  *ithermal=3;
189  }else{
190  uncoupled=0;
191  }
192 
193  if(*mortar!=1){
194  maxprevcontel=*nslavs;
195  }else if(*mortar==1){
196  maxprevcontel=*nintpoint;
197  if(*nstate_!=0){
198  if(maxprevcontel!=0){
199  NNEW(islavsurfold,ITG,2**ifacecount+2);
200  NNEW(pslavsurfold,double,3**nintpoint);
201  memcpy(&islavsurfold[0],&islavsurf[0],
202  sizeof(ITG)*(2**ifacecount+2));
203  memcpy(&pslavsurfold[0],&pslavsurf[0],
204  sizeof(double)*(3**nintpoint));
205  }
206  }
207  }
208  nslavs_prev_step=*nslavs;
209 
210  /* turbulence model
211  iturbulent==0: laminar
212  iturbulent==1: k-epsilon
213  iturbulent==2: q-omega
214  iturbulent==3: SST */
215 
216  iturbulent=(ITG)physcon[8];
217 
218  for(k=0;k<3;k++){
219  strcpy1(&jobnamef[k*132],&jobnamec[k*132],132);
220  }
221 
222  qa0=ctrl[20];qau=ctrl[21];ea=ctrl[23];deltmx=ctrl[26];
223  i0ref=ctrl[0];irref=ctrl[1];icref=ctrl[3];
224 
225  sminls=ctrl[28];smaxls=ctrl[29];
226 
227  memmpc_=mpcinfo[0];mpcfree=mpcinfo[1];icascade=mpcinfo[2];
228  maxlenmpc=mpcinfo[3];
229 
230  alpham=xmodal[0];
231  betam=xmodal[1];
232 
233  /* check whether, for a dynamic calculation, damping is involved */
234 
235  if(*nmethod==4){
236  if(*iexpl<=1){
237  if((fabs(alpham)>1.e-30)||(fabs(betam)>1.e-30)){
238  idamping=1;
239  idampingwithoutcontact=1;
240  }else{
241  for(i=0;i<*ne;i++){
242  if(ipkon[i]<0) continue;
243  if(strcmp1(&lakon[i*8],"ED")==0){
244  idamping=1;idampingwithoutcontact=1;break;
245  }
246  }
247  }
248  }
249  }
250 
251  /* check whether a sensitivity step may follow (whether design variables
252  were defined */
253 
254  for(i=0;i<*ntie;i++){
255  if(strcmp1(&tieset[i*243+80],"D")==0){
256  isensitivity=1;
257  NNEW(adcpy,double,neq[1]);
258  /* no asymmetric matrices allowed for sensitivity */
259  NNEW(aucpy,double,nzs[1]);
260  break;
261  }
262  }
263 
264  if((icascade==2)&&(*iexpl>=2)){
265  printf(" *ERROR in nonlingeo: linear and nonlinear MPC's depend on each other\n");
266  printf(" This is not allowed in a explicit dynamic calculation\n");
267  FORTRAN(stop,());
268  }
269 
270  /* check whether the submodel is meant for a fluid-structure
271  interaction */
272 
273  strcpy(fnffrd,jobnamec);
274  strcat(fnffrd,"f.frd");
275  if((jobnamec[396]!='\0')&&(strcmp1(&jobnamec[396],fnffrd)==0)){
276 
277  /* fluid-structure interaction: wait till after the compfluid
278  call */
279 
280  NNEW(integerglob,ITG,1);
281  NNEW(doubleglob,double,1);
282  }else{
283 
284  /* determining the global values to be used as boundary conditions
285  for a submodel */
286 
287  getglobalresults(jobnamec,&integerglob,&doubleglob,nboun,iamboun,xboun,
288  nload,sideload,iamload,&iglob,nforc,iamforc,xforc,
289  ithermal,nk,t1,iamt1);
290  }
291 
292  /* invert nactdof */
293 
294  NNEW(nactdofinv,ITG,mt**nk);
295  NNEW(nodorig,ITG,*nk);
296  FORTRAN(gennactdofinv,(nactdof,nactdofinv,nk,mi,nodorig,
297  ipkon,lakon,kon,ne));
298  SFREE(nodorig);
299 
300  /* allocating a field for the stiffness matrix */
301 
302  NNEW(xstiff,double,(long long)27*mi[0]**ne);
303 
304  /* allocating force fields */
305 
306  NNEW(f,double,neq[1]);
307  NNEW(fext,double,neq[1]);
308 
309  NNEW(b,double,neq[1]);
310  NNEW(vini,double,mt**nk);
311 
312  NNEW(aux,double,7*maxlenmpc);
313  NNEW(iaux,ITG,2*maxlenmpc);
314 
315  /* allocating fields for the actual external loading */
316 
317  NNEW(xbounact,double,*nboun);
318  NNEW(xbounini,double,*nboun);
319  for(k=0;k<*nboun;++k){xbounact[k]=xbounold[k];}
320  NNEW(xforcact,double,*nforc);
321  NNEW(xloadact,double,2**nload);
322  NNEW(xbodyact,double,7**nbody);
323  /* copying the rotation axis and/or acceleration vector */
324  for(k=0;k<7**nbody;k++){xbodyact[k]=xbody[k];}
325 
326  /* assigning the body forces to the elements */
327 
328  if(*nbody>0){
329  ifreebody=*ne+1;
330  NNEW(ipobody,ITG,2*ifreebody**nbody);
331  for(k=1;k<=*nbody;k++){
332  FORTRAN(bodyforce,(cbody,ibody,ipobody,nbody,set,istartset,
333  iendset,ialset,&inewton,nset,&ifreebody,&k));
334  RENEW(ipobody,ITG,2*(*ne+ifreebody));
335  }
336  RENEW(ipobody,ITG,2*(ifreebody-1));
337  if(inewton==1){NNEW(cgr,double,4**ne);}
338  }
339 
340  /* for mechanical calculations: updating boundary conditions
341  calculated in a previous thermal step */
342 
343  if(*ithermal<2) FORTRAN(gasmechbc,(vold,nload,sideload,
344  nelemload,xload,mi));
345 
346  /* for thermal calculations: forced convection and cavity
347  radiation*/
348 
349  if(*ithermal>1){
350  NNEW(itg,ITG,*nload+3**nflow);
351  NNEW(ieg,ITG,*nflow);
352  /* max 6 triangles per face, 4 entries per triangle */
353  NNEW(kontri,ITG,24**nload);
354  NNEW(nloadtr,ITG,*nload);
355  NNEW(nacteq,ITG,4**nk);
356  NNEW(nactdog,ITG,4**nk);
357  NNEW(v,double,mt**nk);
358  FORTRAN(envtemp,(itg,ieg,&ntg,&ntr,sideload,nelemload,
359  ipkon,kon,lakon,ielmat,ne,nload,
360  kontri,&ntri,nloadtr,nflow,ndirboun,nactdog,
361  nodeboun,nacteq,nboun,ielprop,prop,&nteq,
362  v,network,physcon,shcon,ntmat_,co,
363  vold,set,nshcon,rhcon,nrhcon,mi,nmpc,nodempc,
364  ipompc,labmpc,ikboun,&nasym,ttime,&time,iaxial));
365  SFREE(v);
366 
367  if((*mcs>0)&&(ntr>0)){
368  NNEW(inocs,ITG,*nk);
369  radcyc(nk,kon,ipkon,lakon,ne,cs,mcs,nkon,ialset,istartset,
370  iendset,&kontri,&ntri,&co,&vold,&ntrit,inocs,mi);
371  }
372  else{ntrit=ntri;}
373 
374  nzsrad=100*ntr;
375  NNEW(mast1rad,ITG,nzsrad);
376  NNEW(irowrad,ITG,nzsrad);
377  NNEW(icolrad,ITG,ntr);
378  NNEW(jqrad,ITG,ntr+1);
379  NNEW(ipointerrad,ITG,ntr);
380 
381  if(ntr>0){
382  mastructrad(&ntr,nloadtr,sideload,ipointerrad,
383  &mast1rad,&irowrad,&nzsrad,
384  jqrad,icolrad);
385  }
386 
387  /* determine the network elements belonging to a given node (for usage
388  in user subroutine film */
389 
390 // if(ntg>0){
391  if((*network>0)||(ntg>0)){
392  NNEW(iponoel,ITG,*nk);
393  NNEW(inoel,ITG,2**nkon);
394  if(*network>0){
395  FORTRAN(networkelementpernode,(iponoel,inoel,lakon,ipkon,kon,
396  &inoelsize,nflow,ieg,ne,network));
397  }
398  RENEW(inoel,ITG,2*inoelsize);
399  }
400 
401  SFREE(ipointerrad);SFREE(mast1rad);
402  RENEW(irowrad,ITG,nzsrad);
403 
404  RENEW(itg,ITG,ntg);
405  NNEW(ineighe,ITG,ntg);
406  RENEW(kontri,ITG,4*ntrit);
407  RENEW(nloadtr,ITG,ntr);
408 
409  NNEW(adview,double,ntr);
410  NNEW(auview,double,2*nzsrad);
411  NNEW(tarea,double,ntr);
412  NNEW(tenv,double,ntr);
413  NNEW(fenv,double,ntr);
414  NNEW(erad,double,ntr);
415 
416  NNEW(ac,double,nteq*nteq);
417  NNEW(bc,double,nteq);
418  NNEW(ipiv,ITG,nteq);
419  NNEW(adrad,double,ntr);
420  NNEW(aurad,double,2*nzsrad);
421  NNEW(bcr,double,ntr);
422  NNEW(ipivr,ITG,ntr);
423  }
424 
425  /* check for fluid elements */
426 
427  NNEW(nactdoh,ITG,*ne);
428  NNEW(nactdohinv,ITG,*ne);
429  for(i=0;i<*ne;++i){
430  if(ipkon[i]<0) continue;
431  indexe=ipkon[i];
432  if(strcmp1(&lakon[8*i],"F")==0){
433  icfd=1;nactdohinv[nef]=i+1;nef++;nactdoh[i]=nef;}
434  }
435  if(icfd==1){
436 
437  /* checking block structures (CFD calculations) */
438 
439  NNEW(ielfa,ITG,24*nef);
440  NNEW(nodface,ITG,5*6*nef);
441  NNEW(neiel,ITG,6*nef);
442  NNEW(neij,ITG,6*nef);
443  NNEW(neifa,ITG,6*nef);
444  NNEW(ipoface,ITG,*nk);
445  NNEW(ipnei,ITG,*ne+1);
446  NNEW(konf,ITG,*nkon);
447  NNEW(istartblk,ITG,*nset);
448  NNEW(iendblk,ITG,*nset);
449  NNEW(nblket,ITG,*nset);
450  NNEW(nblkze,ITG,*nset);
451  NNEW(ielblk,ITG,nef);
452  FORTRAN(blockanalysis,(set,nset,istartset,iendset,ialset,&nblk,
453  ipkon,kon,ielfa,nodface,neiel,neij,neifa,ipoface,ipnei,
454  konf,istartblk,iendblk,nactdoh,nblket,nblkze,&nef,ielblk,
455  nk,nactdohinv));
456  if(nblk==0){
457  memcpy(&konf[0],&kon[0],sizeof(ITG)**nkon);
458  SFREE(istartblk);SFREE(iendblk);SFREE(nblket);
459  SFREE(nblkze);SFREE(ielblk);
460  }else{
461  RENEW(istartblk,ITG,nblk);
462  RENEW(iendblk,ITG,nblk);
463  RENEW(nblket,ITG,nblk);
464  RENEW(nblkze,ITG,nblk);
465  }
466  DMEMSET(ipoface,0,*nk,0);
467  DMEMSET(neiel,0,6*nef,0);
468  DMEMSET(ielfa,0,24*nef,0);
469 
470  /* gathering topological information (CFD calculations) */
471 
472  RENEW(nactdohinv,ITG,nef);
473  NNEW(ipkonf,ITG,nef);
474  NNEW(lakonf,char,8*nef);
475  NNEW(ielmatf,ITG,mi[2]*nef);
476  if(*norien>0) NNEW(ielorienf,ITG,mi[2]*nef);
477  NNEW(ifatie,ITG,6*nef);
478  NNEW(ifaext,ITG,6*nef);
479  NNEW(isolidsurf,ITG,6*nef);
480  NNEW(vel,double,8*nef);
481  NNEW(vfa,double,8*6*nef);
482 
483  n=0;for(i=0;i<*mcs;i++){if(floor(cs[17*i+3])>n)n=floor(cs[17*i+3]);}
484  NNEW(xo,double,n);NNEW(yo,double,n);NNEW(zo,double,n);
485  NNEW(x,double,n);NNEW(y,double,n);NNEW(z,double,n);
486  NNEW(nx,ITG,n);NNEW(ny,ITG,n);NNEW(nz,ITG,n);
487 
488  FORTRAN(precfd,(ne,ipkon,konf,lakon,ipnei,neifa,neiel,ipoface,
489  nodface,ielfa,&nflnei,&nface,ifaext,&nfaext,
490  isolidsurf,&nsolidsurf,set,nset,istartset,iendset,ialset,
491  vel,vold,mi,neij,&nef,nactdoh,ipkonf,lakonf,ielmatf,ielmat,
492  ielorienf,ielorien,norien,cs,mcs,tieset,x,y,z,xo,yo,zo,
493  nx,ny,nz,co,ifatie));
494 
495  SFREE(xo);SFREE(yo);SFREE(zo);SFREE(x);SFREE(y);SFREE(z);SFREE(nx);
496 
497  SFREE(ipoface);
498  SFREE(nodface);
499  RENEW(neifa,ITG,nflnei);
500  RENEW(neiel,ITG,nflnei);
501  RENEW(neij,ITG,nflnei);
502  RENEW(ielfa,ITG,4*nface);
503  RENEW(ifatie,ITG,nface);
504  RENEW(ifaext,ITG,nfaext);
505  RENEW(isolidsurf,ITG,nsolidsurf);
506  RENEW(vfa,double,8*nface);
507  RENEW(ipnei,ITG,nef+1);
508  }else{
509  SFREE(nactdoh);SFREE(nactdohinv);
510  }
511  if(*ithermal>1){NNEW(qfx,double,3*mi[0]**ne);}
512 
513  /* contact conditions */
514 
515  inicont(nk,&ncont,ntie,tieset,nset,set,istartset,iendset,ialset,&itietri,
516  lakon,ipkon,kon,&koncont,nslavs,tietol,&ismallsliding,&itiefac,
517  &islavsurf,&islavnode,&imastnode,&nslavnode,&nmastnode,
518  mortar,&imastop,nkon,&iponoels,&inoels,&ipe,&ime,ne,ifacecount,
519  iperturb,ikboun,nboun,co,istep,&xnoels);
520 
521  if(ncont!=0){
522 
523  NNEW(cg,double,3*ncont);
524  NNEW(straight,double,16*ncont);
525 
526  /* 11 instead of 10: last position is reserved for the
527  local contact spring element number; needed as
528  pointer into springarea */
529 
530  if(*mortar==0){
531  RENEW(kon,ITG,*nkon+11**nslavs);
532  NNEW(springarea,double,2**nslavs);
533  if(*nener==1){
534  RENEW(ener,double,mi[0]*(*ne+*nslavs)*2);
535 
536  /* setting the entries for the friction contact energy to zero */
537 
538  for(k=mi[0]*(2**ne+*nslavs);k<mi[0]*(*ne+*nslavs)*2;k++){ener[k]=0.;}
539  }
540  RENEW(ipkon,ITG,*ne+*nslavs);
541  RENEW(lakon,char,8*(*ne+*nslavs));
542 
543  if(*norien>0){
544  RENEW(ielorien,ITG,mi[2]*(*ne+*nslavs));
545  for(k=mi[2]**ne;k<mi[2]*(*ne+*nslavs);k++) ielorien[k]=0;
546  }
547 
548  RENEW(ielmat,ITG,mi[2]*(*ne+*nslavs));
549  for(k=mi[2]**ne;k<mi[2]*(*ne+*nslavs);k++) ielmat[k]=1;
550 
551  if((maxprevcontel==0)&&(*nslavs!=0)){
552  RENEW(xstate,double,*nstate_*mi[0]*(*ne+*nslavs));
553  for(k=*nstate_*mi[0]**ne;k<*nstate_*mi[0]*(*ne+*nslavs);k++){
554  xstate[k]=0.;
555  }
556  }
557  maxprevcontel=*nslavs;
558 
559  NNEW(areaslav,double,*ifacecount);
560  }else if(*mortar==1){
561  NNEW(islavact,ITG,nslavnode[*ntie]);
562  if((*istep==1)||(nslavs_prev_step==0)) NNEW(clearini,double,3*9**ifacecount);
563 
564  /* check whether at least one contact definition involves true contact
565  and not just tied contact */
566 
567  FORTRAN(checktruecontact,(ntie,tieset,tietol,elcon,&itruecontact,
568  ncmat_,ntmat_));
569  }
570 
571  NNEW(xmastnor,double,3*nmastnode[*ntie]);
572  }
573 
574  if(icascade==2){
575  memmpcref_=memmpc_;mpcfreeref=mpcfree;maxlenmpcref=maxlenmpc;
576  NNEW(nodempcref,ITG,3*memmpc_);
577  for(k=0;k<3*memmpc_;k++){nodempcref[k]=nodempc[k];}
578  NNEW(coefmpcref,double,memmpc_);
579  for(k=0;k<memmpc_;k++){coefmpcref[k]=coefmpc[k];}
580  }
581 
582  if((*ithermal==1)||(*ithermal>=3)){
583  NNEW(t1ini,double,*nk);
584  NNEW(t1act,double,*nk);
585  for(k=0;k<*nk;++k){t1act[k]=t1old[k];}
586  }
587 
588  /* allocating a field for the instantaneous amplitude */
589 
590  NNEW(ampli,double,*nam);
591 
592  /* fini is also needed in static calculations if ilin=1
593  to get correct values of f after a divergent increment */
594 
595  NNEW(fini,double,neq[1]);
596 
597  /* allocating fields for nonlinear dynamics */
598 
599  if(*nmethod==4){
600  mass[0]=1;
601  mass[1]=1;
602  NNEW(aux2,double,neq[1]);
603  NNEW(fextini,double,neq[1]);
604  NNEW(fnext,double,mt**nk);
605  NNEW(fnextini,double,mt**nk);
606  NNEW(veini,double,mt**nk);
607  NNEW(accini,double,mt**nk);
608  NNEW(adb,double,neq[1]);
609  NNEW(aub,double,nzs[1]);
610  NNEW(cvini,double,neq[1]);
611  NNEW(cv,double,neq[1]);
612  }
613 
614  if((*nstate_!=0)&&((*mortar!=1)||(ncont==0))){
615  NNEW(xstateini,double,*nstate_*mi[0]*(*ne+*nslavs));
616  for(k=0;k<*nstate_*mi[0]*(*ne+*nslavs);++k){
617  xstateini[k]=xstate[k];
618  }
619  }
620  if((*nstate_!=0)&&(*mortar==1)) NNEW(xstateini,double,1);
621  NNEW(eei,double,6*mi[0]**ne);
622  NNEW(stiini,double,6*mi[0]**ne);
623  NNEW(emeini,double,6*mi[0]**ne);
624  if(*nener==1)
625  NNEW(enerini,double,mi[0]**ne);
626 
627  qa[0]=qaold[0];
628  qa[1]=qaold[1];
629 
630  /* normalizing the time */
631 
632  FORTRAN(checktime,(itpamp,namta,tinc,ttime,amta,tmin,inext,&itp,istep,tper));
633  dtheta=(*tinc)/(*tper);
634 
635  /* taking care of a small increment at the end of the step
636  for face-to-face penalty contact */
637 
638  dthetaref=dtheta;
639  if((dtheta<=1.e-6)&&(*iexpl<=1)){
640  printf("\n *ERROR in nonlingeo\n");
641  printf(" increment size smaller than one millionth of step size\n");
642  printf(" increase increment size\n\n");
643  }
644  *tmin=*tmin/(*tper);
645  *tmax=*tmax/(*tper);
646  theta=0.;
647 
648  /* calculating an initial flux norm */
649 
650  if(*ithermal!=2){
651  if(qau>1.e-10){qam[0]=qau;}
652  else if(qa0>1.e-10){qam[0]=qa0;}
653  else if(qa[0]>1.e-10){qam[0]=qa[0];}
654  else {qam[0]=1.e-2;}
655  }
656  if(*ithermal>1){
657  if(qau>1.e-10){qam[1]=qau;}
658  else if(qa0>1.e-10){qam[1]=qa0;}
659  else if(qa[1]>1.e-10){qam[1]=qa[1];}
660  else {qam[1]=1.e-2;}
661  }
662 
663  /* storing the element and topology information before introducing
664  contact elements */
665 
666  ne0=*ne;nkon0=*nkon;neold=*ne;
667 
668  /*********************************************************************/
669 
670  /* calculating of the acceleration due to force discontinuities
671  (external - internal force) at the start of a step */
672 
673  /*********************************************************************/
674 
675  if((*nmethod==4)&&(*ithermal!=2)&&(icfd!=1)){
676  bet=(1.-*alpha)*(1.-*alpha)/4.;
677  gam=0.5-*alpha;
678 
679  /* initialization of the energy */
680 
681  if(ithermal[0]<=1){
682  for(k=0;k<mi[0]*ne0;++k){enerini[k]=ener[k];}
683  }
684  energyini[3]=energy[3];
685 
686  /* calculating the stiffness and mass matrix */
687 
688  reltime=0.;
689  time=0.;
690  dtime=0.;
691 
692  FORTRAN(tempload,(xforcold,xforc,xforcact,iamforc,nforc,xloadold,xload,
693  xloadact,iamload,nload,ibody,xbody,nbody,xbodyold,xbodyact,
694  t1old,t1,t1act,iamt1,nk,amta,
695  namta,nam,ampli,&time,&reltime,ttime,&dtime,ithermal,nmethod,
696  xbounold,xboun,xbounact,iamboun,nboun,
697  nodeboun,ndirboun,nodeforc,ndirforc,istep,&iinc,
698  co,vold,itg,&ntg,amname,ikboun,ilboun,nelemload,sideload,mi,
699  ntrans,trab,inotr,veold,integerglob,doubleglob,tieset,istartset,
700  iendset,ialset,ntie,nmpc,ipompc,ikmpc,ilmpc,nodempc,coefmpc,
701  ipobody,iponoel,inoel));
702 
703  time=0.;
704  dtime=1.;
705 
706  /* updating the nonlinear mpc's (also affects the boundary
707  conditions through the nonhomogeneous part of the mpc's)
708  if contact arises the number of MPC's can also change */
709 
710  cam[0]=0.;cam[1]=0.;cam[2]=0.;
711 
712  if(icascade==2){
713  memmpc_=memmpcref_;mpcfree=mpcfreeref;maxlenmpc=maxlenmpcref;
714  RENEW(nodempc,ITG,3*memmpcref_);
715  for(k=0;k<3*memmpcref_;k++){nodempc[k]=nodempcref[k];}
716  RENEW(coefmpc,double,memmpcref_);
717  for(k=0;k<memmpcref_;k++){coefmpc[k]=coefmpcref[k];}
718  }
719 
720  newstep=0;
721  FORTRAN(nonlinmpc,(co,vold,ipompc,nodempc,coefmpc,labmpc,
722  nmpc,ikboun,ilboun,nboun,xbounold,aux,iaux,
723  &maxlenmpc,ikmpc,ilmpc,&icascade,
724  kon,ipkon,lakon,ne,&reltime,&newstep,xboun,fmpc,
725  &iit,&idiscon,&ncont,trab,ntrans,ithermal,mi));
726  if(icascade==2){
727 // memmpcref_=memmpc_;mpcfreeref=mpcfree;
728 // RENEW(nodempcref,ITG,3*memmpc_);
729  for(k=0;k<3*memmpc_;k++){nodempcref[k]=nodempc[k];}
730 // RENEW(coefmpcref,double,memmpc_);
731  for(k=0;k<memmpc_;k++){coefmpcref[k]=coefmpc[k];}
732  }
733 
734  if(icascade>0) remastruct(ipompc,&coefmpc,&nodempc,nmpc,
735  &mpcfree,nodeboun,ndirboun,nboun,ikmpc,ilmpc,ikboun,ilboun,
736  labmpc,nk,&memmpc_,&icascade,&maxlenmpc,
737  kon,ipkon,lakon,ne,nactdof,icol,jq,&irow,isolver,
738  neq,nzs,nmethod,&f,&fext,&b,&aux2,&fini,&fextini,
739  &adb,&aub,ithermal,iperturb,mass,mi,iexpl,mortar,
740  typeboun,&cv,&cvini,&iit,network);
741 
742  /* invert nactdof */
743 
744  SFREE(nactdofinv);
745  NNEW(nactdofinv,ITG,1);
746 
747  iout=-1;
748  ielas=1;
749 
750  NNEW(fn,double,mt**nk);
751  NNEW(stx,double,6*mi[0]**ne);
752 
753  NNEW(inum,ITG,*nk);
754  results(co,nk,kon,ipkon,lakon,ne,vold,stn,inum,stx,
755  elcon,nelcon,rhcon,nrhcon,alcon,nalcon,alzero,ielmat,
756  ielorien,norien,orab,ntmat_,t0,t1old,ithermal,
757  prestr,iprestr,filab,eme,emn,een,iperturb,
758  f,fn,nactdof,&iout,qa,vold,b,nodeboun,
759  ndirboun,xbounold,nboun,ipompc,
760  nodempc,coefmpc,labmpc,nmpc,nmethod,cam,&neq[1],veold,accold,&bet,
761  &gam,&dtime,&time,ttime,plicon,nplicon,plkcon,nplkcon,
762  xstateini,xstiff,xstate,npmat_,epn,matname,mi,&ielas,&icmd,
763  ncmat_,nstate_,sti,vini,ikboun,ilboun,ener,enern,emeini,xstaten,
764  eei,enerini,cocon,ncocon,set,nset,istartset,iendset,
765  ialset,nprint,prlab,prset,qfx,qfn,trab,inotr,ntrans,fmpc,
766  nelemload,nload,ikmpc,ilmpc,istep,&iinc,springarea,&reltime,
767  &ne0,xforc,nforc,thicke,shcon,nshcon,
768  sideload,xloadact,xloadold,&icfd,inomat,pslavsurf,pmastsurf,
769  mortar,islavact,cdn,islavnode,nslavnode,ntie,clearini,
770  islavsurf,ielprop,prop,energyini,energy,&kscale,iponoel,
771  inoel,nener,orname,network,ipobody,xbodyact,ibody);
772 
773  SFREE(fn);SFREE(stx);SFREE(inum);
774 
775  iout=0;
776  ielas=0;
777 
778  reltime=0.;
779  time=0.;
780  dtime=0.;
781 
782  if(*iexpl<=1){intscheme=1;}
783 
784  /* in mafillsm the stiffness and mass matrix are computed;
785  The primary aim is to calculate the mass matrix (not
786  lumped for an implicit dynamic calculation, lumped for an
787  explicit dynamic calculation). However:
788  - for an implicit calculation the mass matrix is "doped" with
789  a small amount of stiffness matrix, therefore the calculation
790  of the stiffness matrix is needed.
791  - for an explicit calculation the stiffness matrix is not
792  needed at all. Since the calculation of the mass matrix alone
793  is not possible in mafillsm, the determination of the stiffness
794  matrix is taken as unavoidable "ballast". */
795 
796  NNEW(ad,double,neq[1]);
797  NNEW(au,double,nzs[1]);
798 
799 #ifdef COMPANY
800  if(*ithermal<2){
801 #endif
802  mafillsmmain(co,nk,kon,ipkon,lakon,ne,nodeboun,ndirboun,xbounact,nboun,
803  ipompc,nodempc,coefmpc,nmpc,nodeforc,ndirforc,xforcact,
804  nforc,nelemload,sideload,xloadact,nload,xbodyact,ipobody,
805  nbody,cgr,ad,au,fext,nactdof,icol,jq,irow,neq,nzl,
806  nmethod,ikmpc,ilmpc,ikboun,ilboun,
807  elcon,nelcon,rhcon,nrhcon,alcon,nalcon,alzero,
808  ielmat,ielorien,norien,orab,ntmat_,
809  t0,t1act,ithermal,prestr,iprestr,vold,iperturb,sti,
810  nzs,stx,adb,aub,iexpl,plicon,nplicon,plkcon,nplkcon,
811  xstiff,npmat_,&dtime,matname,mi,
812  ncmat_,mass,&stiffness,&buckling,&rhsi,&intscheme,
813  physcon,shcon,nshcon,cocon,ncocon,ttime,&time,istep,&iinc,
814  &coriolis,ibody,xloadold,&reltime,veold,springarea,nstate_,
815  xstateini,xstate,thicke,integerglob,doubleglob,
816  tieset,istartset,iendset,ialset,ntie,&nasym,pslavsurf,
817  pmastsurf,mortar,clearini,ielprop,prop,&ne0,fnext,&kscale,
818  iponoel,inoel,network);
819 #ifdef COMPANY
820  }else{
821  FORTRAN(mafillsm_company,(co,nk,kon,ipkon,lakon,ne,nodeboun,ndirboun,
822  xbounact,nboun,
823  ipompc,nodempc,coefmpc,nmpc,nodeforc,ndirforc,xforcact,
824  nforc,nelemload,sideload,xloadact,nload,xbodyact,ipobody,
825  nbody,cgr,ad,au,fext,nactdof,icol,jq,irow,neq,nzl,
826  nmethod,ikmpc,ilmpc,ikboun,ilboun,
827  elcon,nelcon,rhcon,nrhcon,alcon,nalcon,alzero,
828  ielmat,ielorien,norien,orab,ntmat_,
829  t0,t1act,ithermal,prestr,iprestr,vold,iperturb,sti,
830  nzs,stx,adb,aub,iexpl,plicon,nplicon,plkcon,nplkcon,
831  xstiff,npmat_,&dtime,matname,mi,
832  ncmat_,mass,&stiffness,&buckling,&rhsi,&intscheme,
833  physcon,shcon,nshcon,cocon,ncocon,ttime,&time,istep,&iinc,
834  &coriolis,ibody,xloadold,&reltime,veold,springarea,nstate_,
835  xstateini,xstate,thicke,integerglob,doubleglob,
836  tieset,istartset,iendset,ialset,ntie,&nasym,pslavsurf,
837  pmastsurf,mortar,clearini,ielprop,prop,&ne0,fnext,&kscale,
838  iponoel,inoel,network));
839  }
840 #endif
841 
842  if(*nmethod==0){
843 
844  /* error occurred in mafill: storing the geometry in frd format */
845 
846  ++*kode;
847  if(strcmp1(&filab[1044],"ZZS")==0){
848  NNEW(neigh,ITG,40**ne);
849  NNEW(ipneigh,ITG,*nk);
850  }
851 
852  ptime=*ttime+time;
853  frd(co,nk,kon,ipkon,lakon,&ne0,v,stn,inum,nmethod,
854  kode,filab,een,t1,fn,&ptime,epn,ielmat,matname,enern,xstaten,
855  nstate_,istep,&iinc,ithermal,qfn,&mode,&noddiam,trab,inotr,
856  ntrans,orab,ielorien,norien,description,ipneigh,neigh,
857  mi,sti,vr,vi,stnr,stni,vmax,stnmax,&ngraph,veold,ener,ne,
858  cs,set,nset,istartset,iendset,ialset,eenmax,fnr,fni,emn,
859  thicke,jobnamec,output,qfx,cdn,mortar,cdnr,cdni,nmat);
860 
861  if(strcmp1(&filab[1044],"ZZS")==0){SFREE(ipneigh);SFREE(neigh);}
862 #ifdef COMPANY
863  FORTRAN(uout,(v,mi,ithermal,filab));
864 #endif
865  FORTRAN(stop,());
866 
867  }
868 
869  /* mass x acceleration = f(external)-f(internal)
870  only for the mechanical loading*/
871 
872  for(k=0;k<neq[0];++k){
873  b[k]=fext[k]-f[k];
874  }
875 
876  if(*iexpl<=1){
877 
878  /* a small amount of stiffness is added to the mass matrix
879  otherwise the system leads to huge accelerations in
880  case of discontinuous load changes at the start of the step */
881 
882  dtime=*tinc/10.;
883  scal1=bet*dtime*dtime*(1.+*alpha);
884  for(k=0;k<neq[0];++k){
885  ad[k]=adb[k]+scal1*ad[k];
886  }
887  for(k=0;k<nzs[0];++k){
888  au[k]=aub[k]+scal1*au[k];
889  }
890  if(*isolver==0){
891 #ifdef SPOOLES
892  spooles(ad,au,adb,aub,&sigma,b,icol,irow,&neq[0],&nzs[0],
893  &symmetryflag,&inputformat,&nzs[2]);
894 #else
895  printf(" *ERROR in nonlingeo: the SPOOLES library is not linked\n\n");
896  FORTRAN(stop,());
897 #endif
898  }
899  else if((*isolver==2)||(*isolver==3)){
900  preiter(ad,&au,b,&icol,&irow,&neq[0],&nzs[0],isolver,iperturb);
901  }
902  else if(*isolver==4){
903 #ifdef SGI
904  token=1;
905  sgi_main(ad,au,adb,aub,&sigma,b,icol,irow,&neq[0],&nzs[0],token);
906 #else
907  printf(" *ERROR in nonlingeo: the SGI library is not linked\n\n");
908  FORTRAN(stop,());
909 #endif
910  }
911  else if(*isolver==5){
912 #ifdef TAUCS
913  tau(ad,&au,adb,aub,&sigma,b,icol,&irow,&neq[0],&nzs[0]);
914 #else
915  printf(" *ERROR in nonlingeo: the TAUCS library is not linked\n\n");
916  FORTRAN(stop,());
917 #endif
918  }
919  else if(*isolver==7){
920 #ifdef PARDISO
921  pardiso_main(ad,au,adb,aub,&sigma,b,icol,irow,&neq[0],&nzs[0],
922  &symmetryflag,&inputformat,jq,&nzs[2]);
923 #else
924  printf(" *ERROR in nonlingeo: the PARDISO library is not linked\n\n");
925  FORTRAN(stop,());
926 #endif
927  }
928  }
929 
930  else{
931  for(k=0;k<neq[0];++k){
932  b[k]=(fext[k]-f[k])/adb[k];
933  }
934  }
935 
936  /* for thermal loading the acceleration is set to zero */
937 
938  for(k=neq[0];k<neq[1];++k){
939  b[k]=0.;
940  }
941 
942  /* calculating the displacements, stresses and forces */
943 
944  NNEW(v,double,mt**nk);
945  memcpy(&v[0],&vold[0],sizeof(double)*mt**nk);
946 
947  NNEW(stx,double,6*mi[0]**ne);
948  NNEW(fn,double,mt**nk);
949 
950  /* setting a "special" time consisting of the first primes;
951  used to recognize the initial acceleration procedure
952  in file resultsini.f */
953 
954  NNEW(inum,ITG,*nk);
955  dtime=1.235711130e-20;
956  results(co,nk,kon,ipkon,lakon,ne,v,stn,inum,stx,
957  elcon,nelcon,rhcon,nrhcon,alcon,nalcon,alzero,ielmat,
958  ielorien,norien,orab,ntmat_,t0,t1act,ithermal,
959  prestr,iprestr,filab,eme,emn,een,iperturb,
960  f,fn,nactdof,&iout,qa,vold,b,nodeboun,
961  ndirboun,xbounact,nboun,ipompc,
962  nodempc,coefmpc,labmpc,nmpc,nmethod,cam,&neq[1],veold,accold,
963  &bet,&gam,&dtime,&time,ttime,plicon,nplicon,plkcon,nplkcon,
964  xstateini,xstiff,xstate,npmat_,epn,matname,mi,&ielas,
965  &icmd,ncmat_,nstate_,stiini,vini,ikboun,ilboun,ener,enern,
966  emeini,xstaten,eei,enerini,cocon,ncocon,set,nset,istartset,
967  iendset,ialset,nprint,prlab,prset,qfx,qfn,trab,inotr,ntrans,
968  fmpc,nelemload,nload,ikmpc,ilmpc,istep,&iinc,springarea,
969  &reltime,&ne0,xforc,nforc,thicke,shcon,nshcon,
970  sideload,xloadact,xloadold,&icfd,inomat,pslavsurf,pmastsurf,
971  mortar,islavact,cdn,islavnode,nslavnode,ntie,clearini,
972  islavsurf,ielprop,prop,energyini,energy,&kscale,iponoel,
973  inoel,nener,orname,network,ipobody,xbodyact,ibody);
974  SFREE(inum);
975  dtime=0.;
976 
977  memcpy(&vold[0],&v[0],sizeof(double)*mt**nk);
978  if(*ithermal!=2){
979  for(k=0;k<6*mi[0]*ne0;++k){
980  sti[k]=stx[k];
981  }
982  }
983 
984  SFREE(v);SFREE(stx);SFREE(fn);
985  SFREE(ad);SFREE(au);
986 
987  /* the mass matrix is kept for subsequent calculations, therefore,
988  no new mass calculation is necessary for the remaining iterations
989  in the present step */
990 
991  mass[0]=0;intscheme=0;
992  energyref=energy[0]+energy[1]+energy[2]+energy[3];
993 
994  /* carlo start */
995 
996  if(*iexpl>1){
997 
998  /* CMT: Calculation of stable time increment according to
999  Courant's Law CARLO MT*/
1000 
1001  FORTRAN(calcmatwavspeed,(ne,elcon,nelcon,
1002  rhcon,nrhcon,alcon,nalcon,orab,ntmat_,ithermal,alzero,
1003  plicon,nplicon,plkcon,nplkcon,npmat_,mi,&dtime,
1004  xstiff,ncmat_,vold,ielmat,t0,t1,
1005  matname,lakon,wavespeed,nmat,ipkon));
1006 
1007  FORTRAN(calcstabletimeincvol,(&ne0,lakon,co,kon,ipkon,mi,
1008  ielmat,&dtvol,alpha,wavespeed));
1009 
1010  printf(" ++CMT DEBUG: courant criterion for stability time inc=%e\n",dtvol);
1011  *tinc=dtvol;
1012  dtheta=(*tinc)/(*tper);
1013  dthetaref=dtheta;
1014 
1015  } else {
1016  // # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
1017  // MPADD start
1018  /* lumping of the mass matrix for implict calculations to
1019  midify the increment time when contact is involved
1020  */
1021 
1022  NNEW(tmp,double,neq[1]);
1023  NNEW(adblump,double,neq[1]);
1024  for(k=0;k<neq[1];k++){
1025  tmp[k] = 1;
1026  }
1027  if(nasym==0){
1028  FORTRAN(op,(&neq[1],tmp,adblump,adb,aub,jq,irow));
1029  }else{
1030  FORTRAN(opas,(&neq[1],tmp,adblump,adb,aub,jq,irow,nzs));
1031  }
1032  SFREE(tmp);
1033 
1034  // MPADD end
1035  // # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
1036  }
1037 
1038  /* carlo end */
1039 
1040  }
1041 
1042  if(*iexpl>1) icmd=3;
1043 
1044  /**************************************************************/
1045  /* starting the loop over the increments */
1046  /**************************************************************/
1047 
1048  newstep=1;
1049 
1050 // MPADD start
1051  if((*nmethod==4)&&(*ithermal<2)&&(*iexpl<=1)){
1052  neini=*ne;
1053  for(k=0;k<4;k++){
1054  energystartstep[k]=energy[k];
1055  }
1056  emax=0.1*energyref; // Anti-stuck at the beginning of simulation
1057  }
1058 // MPADD end
1059 
1060  /* saving the distributed loads (volume heating will be
1061  added because of friction heating) */
1062 
1063  if((*ithermal==3)&&(ncont!=0)&&(*mortar==1)&&(*ncmat_>=11)){
1064  nloadref=*nload;
1065  NNEW(nelemloadref,ITG,2**nload);
1066  if(*nam>0) NNEW(iamloadref,ITG,2**nload);
1067  NNEW(sideloadref,char,20**nload);
1068 
1069  memcpy(&nelemloadref[0],&nelemload[0],sizeof(ITG)*2**nload);
1070  if(*nam>0) memcpy(&iamloadref[0],&iamload[0],sizeof(ITG)*2**nload);
1071  memcpy(&sideloadref[0],&sideload[0],sizeof(char)*20**nload);
1072  }
1073 
1074  while((1.-theta>1.e-6)||(negpres==1)){
1075 
1076  if(icutb==0){
1077 
1078  /* previous increment converged: update the initial values */
1079 
1080  iinc++;
1081  jprint++;
1082 
1083  /* store number of elements (important for implicit dynamic
1084  contact */
1085 
1086  neini=*ne;
1087 
1088  /* vold is copied into vini */
1089 
1090  memcpy(&vini[0],&vold[0],sizeof(double)*mt**nk);
1091 
1092  for(k=0;k<*nboun;++k){xbounini[k]=xbounact[k];}
1093  if((*ithermal==1)||(*ithermal>=3)){
1094  for(k=0;k<*nk;++k){t1ini[k]=t1act[k];}
1095  }
1096  for(k=0;k<neq[1];++k){
1097  fini[k]=f[k];
1098  }
1099  if(*nmethod==4){
1100  for(k=0;k<mt**nk;++k){
1101  veini[k]=veold[k];
1102  accini[k]=accold[k];
1103  fnextini[k]=fnext[k];
1104  }
1105  for(k=0;k<neq[1];++k){
1106  fextini[k]=fext[k];
1107  cvini[k]=cv[k];
1108  }
1109  if(*ithermal<2){
1110  allwkini=allwk;
1111  // MPADD start
1112  if(idamping==1)dampwkini = dampwk;
1113  for(k=0;k<4;k++){
1114  energyini[k]=energy[k];
1115  }
1116  // MPADD end
1117  }
1118  }
1119  if(*ithermal!=2){
1120  for(k=0;k<6*mi[0]*ne0;++k){
1121  stiini[k]=sti[k];
1122  emeini[k]=eme[k];
1123  }
1124  }
1125  if(*nener==1)
1126  for(k=0;k<mi[0]*ne0;++k){enerini[k]=ener[k];}
1127 
1128  if(*mortar!=1){
1129  if(*nstate_!=0){
1130  for(k=0;k<*nstate_*mi[0]*(ne0+*nslavs);++k){
1131  xstateini[k]=xstate[k];
1132  }
1133  }
1134  }
1135  }
1136 
1137  /* check for max. # of increments */
1138 
1139  if(iinc>*jmax){
1140  printf(" *ERROR: max. # of increments reached\n\n");
1141  FORTRAN(stop,());
1142  }
1143  printf(" increment %" ITGFORMAT " attempt %" ITGFORMAT " \n",iinc,icutb+1);
1144  printf(" increment size= %e\n",dtheta**tper);
1145  printf(" sum of previous increments=%e\n",theta**tper);
1146  printf(" actual step time=%e\n",(theta+dtheta)**tper);
1147  printf(" actual total time=%e\n\n",*ttime+(theta+dtheta)**tper);
1148 
1149  printf(" iteration 1\n\n");
1150 
1151  qamold[0]=qam[0];
1152  qamold[1]=qam[1];
1153 
1154  icntrl=0;
1155 
1156  /* restoring the distributed loading before adding the
1157  friction heating */
1158 
1159  if((*ithermal==3)&&(ncont!=0)&&(*mortar==1)&&(*ncmat_>=11)){
1160  *nload=nloadref;
1161  memcpy(&nelemload[0],&nelemloadref[0],sizeof(ITG)*2**nload);
1162  if(*nam>0){
1163  memcpy(&iamload[0],&iamloadref[0],sizeof(ITG)*2**nload);
1164  }
1165  memcpy(&sideload[0],&sideloadref[0],sizeof(char)*20**nload);
1166  }
1167 
1168  /* determining the actual loads at the end of the new increment*/
1169 
1170  reltime=theta+dtheta;
1171  time=reltime**tper;
1172  dtime=dtheta**tper;
1173 
1174  FORTRAN(tempload,(xforcold,xforc,xforcact,iamforc,nforc,xloadold,xload,
1175  xloadact,iamload,nload,ibody,xbody,nbody,xbodyold,xbodyact,
1176  t1old,t1,t1act,iamt1,nk,amta,
1177  namta,nam,ampli,&time,&reltime,ttime,&dtime,ithermal,nmethod,
1178  xbounold,xboun,xbounact,iamboun,nboun,
1179  nodeboun,ndirboun,nodeforc,ndirforc,istep,&iinc,
1180  co,vold,itg,&ntg,amname,ikboun,ilboun,nelemload,sideload,mi,
1181  ntrans,trab,inotr,veold,integerglob,doubleglob,tieset,istartset,
1182  iendset,ialset,ntie,nmpc,ipompc,ikmpc,ilmpc,nodempc,coefmpc,
1183  ipobody,iponoel,inoel));
1184 
1185  for(i=0;i<3;i++){cam[i]=0.;}for(i=3;i<5;i++){cam[i]=0.5;}
1186  if(*ithermal>1){
1187  radflowload(itg,ieg,&ntg,&ntr,adrad,aurad,bcr,ipivr,
1188  ac,bc,nload,sideload,nelemload,xloadact,lakon,ipiv,ntmat_,vold,
1189  shcon,nshcon,ipkon,kon,co,
1190  kontri,&ntri,nloadtr,tarea,tenv,physcon,erad,&adview,&auview,
1191  nflow,ikboun,xbounact,nboun,ithermal,&iinc,&iit,
1192  cs,mcs,inocs,&ntrit,nk,fenv,istep,&dtime,ttime,&time,ilboun,
1193  ikforc,ilforc,xforcact,nforc,cam,ielmat,&nteq,prop,ielprop,
1194  nactdog,nacteq,nodeboun,ndirboun,network,
1195  rhcon,nrhcon,ipobody,ibody,xbodyact,nbody,iviewfile,jobnamef,
1196  ctrl,xloadold,&reltime,nmethod,set,mi,istartset,iendset,ialset,nset,
1197  ineighe,nmpc,nodempc,ipompc,coefmpc,labmpc,&iemchange,nam,iamload,
1198  jqrad,irowrad,&nzsrad,icolrad,ne,iaxial,qa,cocon,ncocon,iponoel,
1199  inoel,nprop,amname,namta,amta);
1200 
1201  /* check whether network iterations converged */
1202 
1203  if(qa[2]>0){
1204  checkdivergence(co,nk,kon,ipkon,lakon,ne,stn,nmethod,
1205  kode,filab,een,t1act,&time,epn,ielmat,matname,enern,
1206  xstaten,nstate_,istep,&iinc,iperturb,ener,mi,output,
1207  ithermal,qfn,&mode,&noddiam,trab,inotr,ntrans,orab,
1208  ielorien,norien,description,sti,&icutb,&iit,&dtime,qa,
1209  vold,qam,ram1,ram2,ram,cam,uam,&ntg,ttime,&icntrl,
1210  &theta,&dtheta,veold,vini,idrct,tper,&istab,tmax,
1211  nactdof,b,tmin,ctrl,amta,namta,itpamp,inext,&dthetaref,
1212  &itp,&jprint,jout,&uncoupled,t1,&iitterm,nelemload,
1213  nload,nodeboun,nboun,itg,ndirboun,&deltmx,&iflagact,
1214  set,nset,istartset,iendset,ialset,emn,thicke,jobnamec,
1215  mortar,nmat,ielprop,prop,&ialeatoric,&kscale,
1216  energy, &allwk,&energyref,&emax,&r_abs,&enetoll,energyini,
1217  &allwkini,&temax,&sizemaxinc,&ne0,&neini,&dampwk,
1218  &dampwkini,energystartstep);
1219 
1220  /* the divergence is flagged by icntrl!=0
1221  icutb is reset to zero in order to generate
1222  regular contact elements etc.. */
1223 
1224  icutb--;
1225  }
1226  }
1227 
1228  if(icfd==1){
1229  compfluid(&co,nk,&ipkonf,konf,&lakonf,&sideface,
1230  ifreestream,&nfreestream,isolidsurf,neighsolidsurf,&nsolidsurf,
1231  nshcon,shcon,nrhcon,rhcon,&vold,ntmat_,nodeboun,
1232  ndirboun,nboun,ipompc,nodempc,nmpc,ikmpc,ilmpc,ithermal,
1233  ikboun,ilboun,&iturbulent,isolver,iexpl,ttime,
1234  &time,&dtime,nodeforc,ndirforc,xforc,nforc,nelemload,sideload,
1235  xload,nload,xbody,ipobody,nbody,ielmatf,matname,mi,ncmat_,
1236  physcon,istep,&iinc,ibody,xloadold,xboun,coefmpc,
1237  nmethod,xforcold,xforcact,iamforc,iamload,xbodyold,xbodyact,
1238  t1old,t1,t1act,iamt1,amta,namta,nam,ampli,xbounold,xbounact,
1239  iamboun,itg,&ntg,amname,t0,&nelemface,&nface,cocon,ncocon,xloadact,
1240  tper,jmax,jout,set,nset,istartset,iendset,ialset,prset,prlab,
1241  nprint,trab,inotr,ntrans,filab,labmpc,sti,norien,orab,jobnamef,
1242  tieset,ntie,mcs,ics,cs,nkon,&mpcfree,&memmpc_,fmpc,&nef,&inomat,
1243  qfx,neifa,neiel,ielfa,ifaext,vfa,vel,ipnei,&nflnei,&nfaext,
1244  typeboun,neij,tincf,nactdoh,nactdohinv,ielorienf,jobnamec,
1245  ifatie,nstate_,xstate,orname,&nblk,ielblk,istartblk,iendblk,
1246  nblket,nblkze,kon);
1247 
1248  /* determining the global values to be used as boundary conditions
1249  for a submodel */
1250 
1251  SFREE(integerglob);SFREE(doubleglob);
1252  getglobalresults(jobnamec,&integerglob,&doubleglob,nboun,iamboun,
1253  xboun,nload,sideload,iamload,&iglob,nforc,iamforc,
1254  xforc,ithermal,nk,t1,iamt1);
1255  }
1256 
1257  if(icascade==2){
1258  memmpc_=memmpcref_;mpcfree=mpcfreeref;maxlenmpc=maxlenmpcref;
1259  RENEW(nodempc,ITG,3*memmpcref_);
1260  for(k=0;k<3*memmpcref_;k++){nodempc[k]=nodempcref[k];}
1261  RENEW(coefmpc,double,memmpcref_);
1262  for(k=0;k<memmpcref_;k++){coefmpc[k]=coefmpcref[k];}
1263  }
1264 
1265  /* generating contact elements */
1266 
1267  if((ncont!=0)&&(*mortar<=1)&&
1268 /* for purely thermal calculations: determine contact integration
1269  points only at the start of a step */
1270  ((*ithermal!=2)||(iit==-1))){
1271 
1272  *ne=ne0;*nkon=nkon0;
1273 
1274  /* at start of new increment:
1275  - copy state variables (node-to-face)
1276  - determine slave integration points (face-to-face)
1277  - interpolate state variables (face-to-face) */
1278 
1279  if(icutb==0){
1280  if(*mortar==1){
1281 
1282  if(*nstate_!=0){
1283  if(maxprevcontel!=0){
1284  if(iit!=-1){
1285  NNEW(islavsurfold,ITG,2**ifacecount+2);
1286  NNEW(pslavsurfold,double,3**nintpoint);
1287  memcpy(&islavsurfold[0],&islavsurf[0],
1288  sizeof(ITG)*(2**ifacecount+2));
1289  memcpy(&pslavsurfold[0],&pslavsurf[0],
1290  sizeof(double)*(3**nintpoint));
1291  }
1292  }
1293  }
1294 
1295  *nintpoint=0;
1296 
1297  /* determine the location of the slave integration
1298  points */
1299 
1300  precontact(&ncont,ntie,tieset,nset,set,istartset,
1301  iendset,ialset,itietri,lakon,ipkon,kon,koncont,ne,
1302  cg,straight,co,vold,istep,&iinc,&iit,itiefac,
1303  islavsurf,islavnode,imastnode,nslavnode,nmastnode,
1304  imastop,mi,ipe,ime,tietol,&iflagact,
1305  nintpoint,&pslavsurf,xmastnor,cs,mcs,ics,clearini,
1306  nslavs);
1307 
1308  /* changing the dimension of element-related fields */
1309 
1310  RENEW(kon,ITG,*nkon+22**nintpoint);
1311  RENEW(springarea,double,2**nintpoint);
1312  RENEW(pmastsurf,double,6**nintpoint);
1313 
1314  if(*nener==1){
1315  RENEW(ener,double,mi[0]*(*ne+*nintpoint)*2);
1316 
1317  /* setting the entries for the friction contact energy to zero */
1318 
1319  for(k=mi[0]*(2**ne+*nintpoint);k<mi[0]*(*ne+*nintpoint)*2;k++){ener[k]=0.;}
1320 
1321  }
1322  RENEW(ipkon,ITG,*ne+*nintpoint);
1323  RENEW(lakon,char,8*(*ne+*nintpoint));
1324 
1325  if(*norien>0){
1326  RENEW(ielorien,ITG,mi[2]*(*ne+*nintpoint));
1327  for(k=mi[2]**ne;k<mi[2]*(*ne+*nintpoint);k++) ielorien[k]=0;
1328  }
1329  RENEW(ielmat,ITG,mi[2]*(*ne+*nintpoint));
1330  for(k=mi[2]**ne;k<mi[2]*(*ne+*nintpoint);k++) ielmat[k]=1;
1331 
1332  /* interpolating the state variables */
1333 
1334  if(*nstate_!=0){
1335  if(maxprevcontel!=0){
1336  RENEW(xstateini,double,
1337  *nstate_*mi[0]*(ne0+maxprevcontel));
1338  for(k=*nstate_*mi[0]*ne0;
1339  k<*nstate_*mi[0]*(ne0+maxprevcontel);++k){
1340  xstateini[k]=xstate[k];
1341  }
1342  }
1343 
1344  RENEW(xstate,double,*nstate_*mi[0]*(ne0+*nintpoint));
1345  for(k=*nstate_*mi[0]*ne0;k<*nstate_*mi[0]*(ne0+*nintpoint);k++){
1346  xstate[k]=0.;
1347  }
1348 
1349  if((*nintpoint>0)&&(maxprevcontel>0)){
1350  iex=2;
1351 
1352  /* interpolation of xstate */
1353 
1354  FORTRAN(interpolatestate,(ne,ipkon,kon,lakon,
1355  &ne0,mi,xstate,pslavsurf,nstate_,
1356  xstateini,islavsurf,islavsurfold,
1357  pslavsurfold,tieset,ntie,itiefac));
1358 
1359  }
1360 
1361  if(maxprevcontel!=0){
1362  SFREE(islavsurfold);SFREE(pslavsurfold);
1363  }
1364 
1365  maxprevcontel=*nintpoint;
1366 
1367  RENEW(xstateini,double,*nstate_*mi[0]*(ne0+*nintpoint));
1368  for(k=0;k<*nstate_*mi[0]*(ne0+*nintpoint);++k){
1369  xstateini[k]=xstate[k];
1370  }
1371  }
1372 
1373  }
1374  }
1375 
1376  contact(&ncont,ntie,tieset,nset,set,istartset,iendset,
1377  ialset,itietri,lakon,ipkon,kon,koncont,ne,cg,straight,nkon,
1378  co,vold,ielmat,cs,elcon,istep,&iinc,&iit,ncmat_,ntmat_,
1379  &ne0,vini,nmethod,
1380  iperturb,ikboun,nboun,mi,imastop,nslavnode,islavnode,
1381  islavsurf,
1382  itiefac,areaslav,iponoels,inoels,springarea,tietol,&reltime,
1383  imastnode,nmastnode,xmastnor,filab,mcs,ics,&nasym,
1384  xnoels,mortar,pslavsurf,pmastsurf,clearini,&theta,
1385  xstateini,xstate,nstate_,&icutb,&ialeatoric,jobnamef);
1386 
1387  /* check whether, for a dynamic calculation, damping is involved */
1388 
1389  if(*nmethod==4){
1390  if(*iexpl<=1){
1391  if(idampingwithoutcontact==0){
1392  for(i=0;i<*ne;i++){
1393  if(ipkon[i]<0) continue;
1394  if(*ncmat_>=5){
1395  if(strcmp1(&lakon[i*8],"ES")==0){
1396  if(strcmp1(&lakon[i*8+6],"C")==0){
1397  imat=ielmat[i*mi[2]];
1398  if(elcon[(*ncmat_+1)**ntmat_*(imat-1)+4]>0.){
1399  idamping=1;break;
1400  }
1401  }
1402  }
1403  }
1404  }
1405  }
1406  }
1407  }
1408 
1409  printf(" Number of contact spring elements=%" ITGFORMAT "\n\n",*ne-ne0);
1410 
1411  /* carlo start */
1412 
1413  if((*iexpl>1)){
1414 
1415  if((*ne-ne0)<ncontacts){
1416  ncontacts=*ne-ne0;
1417  inccontact=0;
1418  }
1419  else if((*ne-ne0)>ncontacts) {
1420 
1421  FORTRAN(calcstabletimeinccont,(ne,lakon,kon,ipkon,mi,
1422  ielmat,elcon,mortar,adb,alpha,nactdof,springarea,
1423  &ne0,ntmat_,ncmat_,&dtcont));
1424 
1425  if(dtcont<*tinc)*tinc=dtcont;
1426  dtheta=(*tinc)/(*tper);
1427  dthetaref=dtheta;
1428 
1429  ncontacts=*ne-ne0;
1430  inccontact=0;
1431  }else if((inccontact==500)&&(ncontacts==0)){
1432  *tinc=dtvol;
1433  dtheta=(*tinc)/(*tper);
1434  dthetaref=dtheta;
1435 
1436  dtcont=1.e30;
1437  }
1438  inccontact++;
1439  }
1440 
1441  /* carlo end */
1442 
1443  }
1444 
1445  /* updating the nonlinear mpc's (also affects the boundary
1446  conditions through the nonhomogeneous part of the mpc's) */
1447 
1448  FORTRAN(nonlinmpc,(co,vold,ipompc,nodempc,coefmpc,labmpc,
1449  nmpc,ikboun,ilboun,nboun,xbounact,aux,iaux,
1450  &maxlenmpc,ikmpc,ilmpc,&icascade,
1451  kon,ipkon,lakon,ne,&reltime,&newstep,xboun,fmpc,
1452  &iit,&idiscon,&ncont,trab,ntrans,ithermal,mi));
1453 
1454  if(icascade==2){
1455  for(k=0;k<3*memmpc_;k++){nodempcref[k]=nodempc[k];}
1456  for(k=0;k<memmpc_;k++){coefmpcref[k]=coefmpc[k];}
1457  }
1458 
1459  if((icascade>0)||(ncont!=0)) remastruct(ipompc,&coefmpc,&nodempc,nmpc,
1460  &mpcfree,nodeboun,ndirboun,nboun,ikmpc,ilmpc,ikboun,ilboun,
1461  labmpc,nk,&memmpc_,&icascade,&maxlenmpc,
1462  kon,ipkon,lakon,ne,nactdof,icol,jq,&irow,isolver,
1463  neq,nzs,nmethod,&f,&fext,&b,&aux2,&fini,&fextini,
1464  &adb,&aub,ithermal,iperturb,mass,mi,iexpl,mortar,
1465  typeboun,&cv,&cvini,&iit,network);
1466 
1467  /* invert nactdof */
1468 
1469  SFREE(nactdofinv);
1470  NNEW(nactdofinv,ITG,mt**nk);
1471  NNEW(nodorig,ITG,*nk);
1472  FORTRAN(gennactdofinv,(nactdof,nactdofinv,nk,mi,nodorig,
1473  ipkon,lakon,kon,ne));
1474  SFREE(nodorig);
1475 
1476  /* check whether the forced displacements changed; if so, and
1477  if the procedure is static, the first iteration has to be
1478  purely linear elastic, in order to get an equilibrium
1479  displacement field; otherwise huge (maybe nonelastic)
1480  stresses may occur, jeopardizing convergence */
1481 
1482  ilin=0;
1483 
1484  /* only for iinc=1 a linearized calculation is performed, since
1485  for iinc>1 a reasonable displacement field is predicted by using the
1486  initial velocity field at the end of the last increment */
1487 
1488  if((iinc==1)&&(*ithermal<2)){
1489  dev=0.;
1490  for(k=0;k<*nboun;++k){
1491  err=fabs(xbounact[k]-xbounini[k]);
1492  if(err>dev){dev=err;}
1493  }
1494  if(dev>1.e-5) ilin=1;
1495  }
1496 
1497  /* prediction of the kinematic vectors */
1498 
1499  NNEW(v,double,mt**nk);
1500 
1501  prediction(uam,nmethod,&bet,&gam,&dtime,ithermal,nk,veold,accold,v,
1502  &iinc,&idiscon,vold,nactdof,mi);
1503 
1504  NNEW(fn,double,mt**nk);
1505  NNEW(stx,double,6*mi[0]**ne);
1506 
1507  /* determining the internal forces at the start of the increment
1508 
1509  for a static calculation with increased forced displacements
1510  the linear strains are calculated corresponding to
1511 
1512  the displacements at the end of the previous increment, extrapolated
1513  if appropriate (for nondispersive media) +
1514  the forced displacements at the end of the present increment +
1515  the temperatures at the end of the present increment (this sum is
1516  v) -
1517  the displacements at the end of the previous increment (this is vold)
1518 
1519  these linear strains are converted in stresses by multiplication
1520  with the tangent element stiffness matrix and converted into nodal
1521  forces.
1522 
1523  this boils down to the fact that the effect of forced displacements
1524  should be handled in a purely linear way at the
1525  start of a new increment, in order to speed up the convergence and
1526  (for dissipative media) guarantee smooth loading within the increment.
1527 
1528  for all other cases the nodal force calculation is based on
1529  the true stresses derived from the appropriate strain tensor taking
1530  into account the extrapolated displacements at the end of the
1531  previous increment + the forced displacements and the temperatures
1532  at the end of the present increment */
1533 
1534  iout=-1;
1535  iperturb_sav[0]=iperturb[0];
1536  iperturb_sav[1]=iperturb[1];
1537 
1538  /* first iteration in first increment: elastic tangent */
1539 
1540  if((*nmethod!=4)&&(ilin==1)){
1541 
1542  ielas=1;
1543 
1544  iperturb[0]=-1;
1545  iperturb[1]=0;
1546 
1547  for(k=0;k<neq[1];++k){b[k]=f[k];}
1548  NNEW(inum,ITG,*nk);
1549  results(co,nk,kon,ipkon,lakon,ne,v,stn,inum,stx,
1550  elcon,nelcon,rhcon,nrhcon,alcon,nalcon,alzero,ielmat,
1551  ielorien,norien,orab,ntmat_,t1ini,t1act,ithermal,
1552  prestr,iprestr,filab,eme,emn,een,iperturb,
1553  f,fn,nactdof,&iout,qa,vold,b,nodeboun,
1554  ndirboun,xbounact,nboun,ipompc,
1555  nodempc,coefmpc,labmpc,nmpc,nmethod,cam,&neq[1],veold,accold,
1556  &bet,&gam,&dtime,&time,ttime,plicon,nplicon,plkcon,nplkcon,
1557  xstateini,xstiff,xstate,npmat_,epn,matname,mi,&ielas,
1558  &icmd, ncmat_,nstate_,stiini,vini,ikboun,ilboun,ener,enern,
1559  emeini,xstaten,eei,enerini,cocon,ncocon,set,nset,istartset,
1560  iendset,ialset,nprint,prlab,prset,qfx,qfn,trab,inotr,ntrans,
1561  fmpc,nelemload,nload,ikmpc,ilmpc,istep,&iinc,springarea,
1562  &reltime,&ne0,xforc,nforc,thicke,shcon,nshcon,
1563  sideload,xloadact,xloadold,&icfd,inomat,pslavsurf,pmastsurf,
1564  mortar,islavact,cdn,islavnode,nslavnode,ntie,clearini,
1565  islavsurf,ielprop,prop,energyini,energy,&kscale,iponoel,
1566  inoel,nener,orname,network,ipobody,xbodyact,ibody);
1567  iperturb[0]=0;SFREE(inum);
1568 
1569  /* check whether any displacements or temperatures are changed
1570  in the new increment */
1571 
1572  for(k=0;k<neq[1];++k){f[k]=f[k]+b[k];}
1573 
1574  }
1575  else{
1576 
1577  NNEW(inum,ITG,*nk);
1578  results(co,nk,kon,ipkon,lakon,ne,v,stn,inum,stx,
1579  elcon,nelcon,rhcon,nrhcon,alcon,nalcon,alzero,ielmat,
1580  ielorien,norien,orab,ntmat_,t0,t1act,ithermal,
1581  prestr,iprestr,filab,eme,emn,een,iperturb,
1582  f,fn,nactdof,&iout,qa,vold,b,nodeboun,
1583  ndirboun,xbounact,nboun,ipompc,
1584  nodempc,coefmpc,labmpc,nmpc,nmethod,cam,&neq[1],veold,accold,
1585  &bet,&gam,&dtime,&time,ttime,plicon,nplicon,plkcon,nplkcon,
1586  xstateini,xstiff,xstate,npmat_,epn,matname,mi,&ielas,
1587  &icmd,ncmat_,nstate_,stiini,vini,ikboun,ilboun,ener,enern,
1588  emeini,xstaten,eei,enerini,cocon,ncocon,set,nset,istartset,
1589  iendset,ialset,nprint,prlab,prset,qfx,qfn,trab,inotr,ntrans,
1590  fmpc,nelemload,nload,ikmpc,ilmpc,istep,&iinc,springarea,
1591  &reltime,&ne0,xforc,nforc,thicke,shcon,nshcon,
1592  sideload,xloadact,xloadold,&icfd,inomat,pslavsurf,pmastsurf,
1593  mortar,islavact,cdn,islavnode,nslavnode,ntie,clearini,
1594  islavsurf,ielprop,prop,energyini,energy,&kscale,iponoel,
1595  inoel,nener,orname,network,ipobody,xbodyact,ibody);
1596  SFREE(inum);
1597 
1598  memcpy(&vold[0],&v[0],sizeof(double)*mt**nk);
1599 
1600  if(*ithermal!=2){
1601  for(k=0;k<6*mi[0]*ne0;++k){
1602  sti[k]=stx[k];
1603  }
1604  }
1605 
1606  }
1607 
1608  ielas=0;
1609  iout=0;
1610 
1611  SFREE(fn);SFREE(v);
1612  if((*ithermal!=3)||(ncont==0)||(*mortar!=1)||(*ncmat_<11)) SFREE(stx);
1613 
1614  /***************************************************************/
1615  /* iteration counter and start of the loop over the iterations */
1616  /***************************************************************/
1617 
1618  iit=1;
1619 // icntrl=0;
1620 
1621  /* change due to previous checkdivergence routine */
1622 
1623  if(icntrl!=0) icutb++;
1624 
1625  ctrl[0]=i0ref;ctrl[1]=irref;ctrl[3]=icref;
1626  if(*nmethod!=4)NNEW(resold,double,neq[1]);
1627  if(uncoupled){
1628  *ithermal=2;
1629  NNEW(iruc,ITG,nzs[1]-nzs[0]);
1630  for(k=0;k<nzs[1]-nzs[0];k++) iruc[k]=irow[k+nzs[0]]-neq[0];
1631  }
1632 
1633  while(icntrl==0){
1634 
1635 #ifdef COMPANY
1636  FORTRAN(uiter,(&iit));
1637 #endif
1638 
1639  /* updating the nonlinear mpc's (also affects the boundary
1640  conditions through the nonhomogeneous part of the mpc's) */
1641 
1642  if((iit!=1)||((uncoupled)&&(*ithermal==1))){
1643 
1644  printf(" iteration %" ITGFORMAT "\n\n",iit);
1645 
1646  /* restoring the distributed loading before adding the
1647  friction heating */
1648 
1649  if((*ithermal==3)&&(ncont!=0)&&(*mortar==1)&&(*ncmat_>=11)){
1650  *nload=nloadref;
1651  memcpy(&nelemload[0],&nelemloadref[0],sizeof(ITG)*2**nload);
1652  if(*nam>0){
1653  memcpy(&iamload[0],&iamloadref[0],sizeof(ITG)*2**nload);
1654  }
1655  memcpy(&sideload[0],&sideloadref[0],sizeof(char)*20**nload);
1656  }
1657 
1658  FORTRAN(tempload,(xforcold,xforc,xforcact,iamforc,nforc,
1659  xloadold,xload,
1660  xloadact,iamload,nload,ibody,xbody,nbody,xbodyold,xbodyact,
1661  t1old,t1,t1act,iamt1,nk,amta,
1662  namta,nam,ampli,&time,&reltime,ttime,&dtime,ithermal,nmethod,
1663  xbounold,xboun,xbounact,iamboun,nboun,
1664  nodeboun,ndirboun,nodeforc,ndirforc,istep,&iinc,
1665  co,vold,itg,&ntg,amname,ikboun,ilboun,nelemload,sideload,mi,
1666  ntrans,trab,inotr,veold,integerglob,doubleglob,tieset,istartset,
1667  iendset,ialset,ntie,nmpc,ipompc,ikmpc,ilmpc,nodempc,coefmpc,
1668  ipobody,iponoel,inoel));
1669 
1670  for(i=0;i<3;i++){cam[i]=0.;}for(i=3;i<5;i++){cam[i]=0.5;}
1671  if(*ithermal>1){
1672  radflowload(itg,ieg,&ntg,&ntr,adrad,aurad,bcr,ipivr,
1673  ac,bc,nload,sideload,nelemload,xloadact,lakon,ipiv,
1674  ntmat_,vold,shcon,nshcon,ipkon,kon,co,
1675  kontri,&ntri,nloadtr,tarea,tenv,physcon,erad,&adview,&auview,
1676  nflow,ikboun,xbounact,nboun,ithermal,&iinc,&iit,
1677  cs,mcs,inocs,&ntrit,nk,fenv,istep,&dtime,ttime,&time,ilboun,
1678  ikforc,ilforc,xforcact,nforc,cam,ielmat,&nteq,prop,ielprop,
1679  nactdog,nacteq,nodeboun,ndirboun,network,
1680  rhcon,nrhcon,ipobody,ibody,xbodyact,nbody,iviewfile,jobnamef,
1681  ctrl,xloadold,&reltime,nmethod,set,mi,istartset,iendset,ialset,
1682  nset,ineighe,nmpc,nodempc,ipompc,coefmpc,labmpc,&iemchange,nam,
1683  iamload,jqrad,irowrad,&nzsrad,icolrad,ne,iaxial,qa,cocon,ncocon,
1684  iponoel,inoel,nprop,amname,namta,amta);
1685 
1686  /* check whether network iterations converged */
1687 
1688  if(qa[2]>0){
1689  checkdivergence(co,nk,kon,ipkon,lakon,ne,stn,nmethod,
1690  kode,filab,een,t1act,&time,epn,ielmat,matname,enern,
1691  xstaten,nstate_,istep,&iinc,iperturb,ener,mi,output,
1692  ithermal,qfn,&mode,&noddiam,trab,inotr,ntrans,orab,
1693  ielorien,norien,description,sti,&icutb,&iit,&dtime,qa,
1694  vold,qam,ram1,ram2,ram,cam,uam,&ntg,ttime,&icntrl,
1695  &theta,&dtheta,veold,vini,idrct,tper,&istab,tmax,
1696  nactdof,b,tmin,ctrl,amta,namta,itpamp,inext,&dthetaref,
1697  &itp,&jprint,jout,&uncoupled,t1,&iitterm,nelemload,
1698  nload,nodeboun,nboun,itg,ndirboun,&deltmx,&iflagact,
1699  set,nset,istartset,iendset,ialset,emn,thicke,jobnamec,
1700  mortar,nmat,ielprop,prop,&ialeatoric,&kscale,
1701  energy, &allwk,&energyref,&emax,&r_abs,&enetoll,energyini,
1702  &allwkini,&temax,&sizemaxinc,&ne0,&neini,&dampwk,
1703  &dampwkini,energystartstep);
1704  continue;
1705  }
1706  }
1707 
1708  if(icascade==2){
1709  memmpc_=memmpcref_;mpcfree=mpcfreeref;maxlenmpc=maxlenmpcref;
1710  RENEW(nodempc,ITG,3*memmpcref_);
1711  for(k=0;k<3*memmpcref_;k++){nodempc[k]=nodempcref[k];}
1712  RENEW(coefmpc,double,memmpcref_);
1713  for(k=0;k<memmpcref_;k++){coefmpc[k]=coefmpcref[k];}
1714  }
1715 
1716  if((ncont!=0)&&(*mortar<=1)&&(ismallsliding==0)&&
1717 /* for node-to-face contact: freeze contact elements for
1718  iterations 8 and higher */
1719  ((iit<=8)||(*mortar==1))&&
1720 /* for purely thermal calculations: freeze contact elements
1721  during complete step */
1722  ((*ithermal!=2)||(iit==-1))){
1723 
1724  neold=*ne;
1725  *ne=ne0;*nkon=nkon0;
1726  contact(&ncont,ntie,tieset,nset,set,istartset,iendset,
1727  ialset,itietri,lakon,ipkon,kon,koncont,ne,cg,
1728  straight,nkon,co,vold,ielmat,cs,elcon,istep,
1729  &iinc,&iit,ncmat_,ntmat_,&ne0,
1730  vini,nmethod,iperturb,
1731  ikboun,nboun,mi,imastop,nslavnode,islavnode,islavsurf,
1732  itiefac,areaslav,iponoels,inoels,springarea,tietol,
1733  &reltime,imastnode,nmastnode,xmastnor,
1734  filab,mcs,ics,&nasym,xnoels,mortar,pslavsurf,pmastsurf,
1735  clearini,&theta,xstateini,xstate,nstate_,&icutb,
1736  &ialeatoric,jobnamef);
1737 
1738  /* check whether, for a dynamic calculation, damping is involved */
1739 
1740  if(*nmethod==4){
1741  if(*iexpl<=1){
1742  if(idampingwithoutcontact==0){
1743  for(i=0;i<*ne;i++){
1744  if(ipkon[i]<0) continue;
1745  if(*ncmat_>=5){
1746  if(strcmp1(&lakon[i*8],"ES")==0){
1747  if(strcmp1(&lakon[i*8+6],"C")==0){
1748  imat=ielmat[i*mi[2]];
1749  if(elcon[(*ncmat_+1)**ntmat_*(imat-1)+4]>0.){
1750  idamping=1;break;
1751  }
1752  }
1753  }
1754  }
1755  }
1756  }
1757  }
1758  }
1759 
1760  if(*mortar==0){
1761  if(*ne!=neold){iflagact=1;}
1762  }else if(*mortar==1){
1763  if(((*ne-ne0)<(neold-ne0)*0.999)||
1764  ((*ne-ne0)>(neold-ne0)*1.001)){iflagact=1;}
1765  }
1766 
1767  printf(" Number of contact spring elements=%" ITGFORMAT "\n\n",*ne-ne0);
1768 
1769  }
1770 
1771  if(*ithermal==3){
1772  for(k=0;k<*nk;++k){t1act[k]=vold[mt*k];}
1773  }
1774 
1775  FORTRAN(nonlinmpc,(co,vold,ipompc,nodempc,coefmpc,labmpc,
1776  nmpc,ikboun,ilboun,nboun,xbounact,aux,iaux,
1777  &maxlenmpc,ikmpc,ilmpc,&icascade,
1778  kon,ipkon,lakon,ne,&reltime,&newstep,xboun,fmpc,&iit,
1779  &idiscon,&ncont,trab,ntrans,ithermal,mi));
1780 
1781  if(icascade==2){
1782  for(k=0;k<3*memmpc_;k++){nodempcref[k]=nodempc[k];}
1783  for(k=0;k<memmpc_;k++){coefmpcref[k]=coefmpc[k];}
1784  }
1785 
1786  if((icascade>0)||(ncont!=0)){
1787  remastruct(ipompc,&coefmpc,&nodempc,nmpc,
1788  &mpcfree,nodeboun,ndirboun,nboun,ikmpc,ilmpc,ikboun,ilboun,
1789  labmpc,nk,&memmpc_,&icascade,&maxlenmpc,
1790  kon,ipkon,lakon,ne,nactdof,icol,jq,&irow,isolver,
1791  neq,nzs,nmethod,&f,&fext,&b,&aux2,&fini,&fextini,
1792  &adb,&aub,ithermal,iperturb,mass,mi,iexpl,mortar,
1793  typeboun,&cv,&cvini,&iit,network);
1794 
1795  /* invert nactdof */
1796 
1797  SFREE(nactdofinv);
1798  NNEW(nactdofinv,ITG,mt**nk);
1799  NNEW(nodorig,ITG,*nk);
1800  FORTRAN(gennactdofinv,(nactdof,nactdofinv,nk,mi,nodorig,
1801  ipkon,lakon,kon,ne));
1802  SFREE(nodorig);
1803 
1804  NNEW(v,double,mt**nk);
1805  NNEW(stx,double,6*mi[0]**ne);
1806  NNEW(fn,double,mt**nk);
1807 
1808  memcpy(&v[0],&vold[0],sizeof(double)*mt**nk);
1809  iout=-1;
1810 
1811  NNEW(inum,ITG,*nk);
1812  results(co,nk,kon,ipkon,lakon,ne,v,stn,inum,stx,
1813  elcon,nelcon,rhcon,nrhcon,alcon,nalcon,alzero,ielmat,
1814  ielorien,norien,orab,ntmat_,t0,t1act,ithermal,
1815  prestr,iprestr,filab,eme,emn,een,iperturb,
1816  f,fn,nactdof,&iout,qa,vold,b,nodeboun,
1817  ndirboun,xbounact,nboun,ipompc,
1818  nodempc,coefmpc,labmpc,nmpc,nmethod,cam,&neq[1],veold,accold,
1819  &bet,&gam,&dtime,&time,ttime,plicon,nplicon,plkcon,nplkcon,
1820  xstateini,xstiff,xstate,npmat_,epn,matname,mi,&ielas,&icmd,
1821  ncmat_,nstate_,stiini,vini,ikboun,ilboun,ener,enern,emeini,
1822  xstaten,eei,enerini,cocon,ncocon,set,nset,istartset,iendset,
1823  ialset,nprint,prlab,prset,qfx,qfn,trab,inotr,ntrans,fmpc,
1824  nelemload,nload,ikmpc,ilmpc,istep,&iinc,springarea,
1825  &reltime,&ne0,xforc,nforc,thicke,shcon,nshcon,
1826  sideload,xloadact,xloadold,&icfd,inomat,pslavsurf,pmastsurf,
1827  mortar,islavact,cdn,islavnode,nslavnode,ntie,clearini,
1828  islavsurf,ielprop,prop,energyini,energy,&kscale,iponoel,
1829  inoel,nener,orname,network,ipobody,xbodyact,ibody);
1830 
1831  memcpy(&vold[0],&v[0],sizeof(double)*mt**nk);
1832 
1833  if(*ithermal!=2){
1834  for(k=0;k<6*mi[0]*ne0;++k){
1835  sti[k]=stx[k];
1836  }
1837  }
1838 
1839  /*for(k=0;k<neq[1];++k){printf("f=%" ITGFORMAT ",%f\n",k,f[k]);}*/
1840 
1841  SFREE(v);SFREE(fn);SFREE(inum);
1842  if((*ithermal!=3)||(ncont==0)||(*mortar!=1)||(*ncmat_<11)) SFREE(stx);
1843  iout=0;
1844 
1845  }else{
1846 
1847  /*for(k=0;k<neq[1];++k){printf("f=%" ITGFORMAT ",%f\n",k,f[k]);}*/
1848  }
1849  }
1850 
1851  /* add friction heating */
1852 
1853  if((*ithermal==3)&&(ncont!=0)&&(*mortar==1)&&(*ncmat_>=11)){
1854  nload_=*nload+2*(*ne-ne0);
1855 
1856  RENEW(nelemload,ITG,2*nload_);
1857  DMEMSET(nelemload,2**nload,2*nload_,0);
1858  if(*nam>0){
1859  RENEW(iamload,ITG,2*nload_);
1860  DMEMSET(iamload,2**nload,2*nload_,0);
1861  }
1862  RENEW(xloadact,double,2*nload_);
1863  DMEMSET(xloadact,2**nload,2*nload_,0.);
1864  RENEW(sideload,char,20*nload_);
1865  DMEMSET(sideload,20**nload,20*nload_,'\0');
1866 
1867  NNEW(idefload,ITG,nload_);
1868  DMEMSET(idefload,0,nload_,1);
1869  FORTRAN(frictionheating,(&ne0,ne,ipkon,lakon,ielmat,mi,elcon,
1870  ncmat_,ntmat_,kon,islavsurf,pmastsurf,springarea,co,vold,
1871  veold,pslavsurf,xloadact,nload,&nload_,nelemload,iamload,
1872  idefload,sideload,stx,nam));
1873  SFREE(idefload);SFREE(stx);
1874  }
1875 
1876  if(*iexpl<=1){
1877 
1878  /* calculating the local stiffness matrix and external loading */
1879 
1880  NNEW(ad,double,neq[1]);
1881  NNEW(au,double,nzs[1]);
1882 
1883  if(*nmethod==4) DMEMSET(fnext,0,mt**nk,0.);
1884 
1885 #ifdef COMPANY
1886  if(*ithermal<2){
1887 #endif
1888  mafillsmmain(co,nk,kon,ipkon,lakon,ne,nodeboun,ndirboun,xbounact,nboun,
1889  ipompc,nodempc,coefmpc,nmpc,nodeforc,ndirforc,xforcact,
1890  nforc,nelemload,sideload,xloadact,nload,xbodyact,ipobody,
1891  nbody,cgr,ad,au,fext,nactdof,icol,jq,irow,neq,nzl,
1892  nmethod,ikmpc,ilmpc,ikboun,ilboun,
1893  elcon,nelcon,rhcon,nrhcon,alcon,nalcon,alzero,
1894  ielmat,ielorien,norien,orab,ntmat_,
1895  t0,t1act,ithermal,prestr,iprestr,vold,iperturb,sti,
1896  nzs,stx,adb,aub,iexpl,plicon,nplicon,plkcon,nplkcon,
1897  xstiff,npmat_,&dtime,matname,mi,
1898  ncmat_,mass,&stiffness,&buckling,&rhsi,&intscheme,
1899  physcon,shcon,nshcon,cocon,ncocon,ttime,&time,istep,&iinc,
1900  &coriolis,ibody,xloadold,&reltime,veold,springarea,nstate_,
1901  xstateini,xstate,thicke,integerglob,doubleglob,
1902  tieset,istartset,iendset,ialset,ntie,&nasym,pslavsurf,
1903  pmastsurf,mortar,clearini,ielprop,prop,&ne0,fnext,&kscale,
1904  iponoel,inoel,network);
1905 #ifdef COMPANY
1906  }else{
1907  FORTRAN(mafillsm_company,(co,nk,kon,ipkon,lakon,ne,nodeboun,ndirboun,
1908  xbounact,nboun,
1909  ipompc,nodempc,coefmpc,nmpc,nodeforc,ndirforc,xforcact,
1910  nforc,nelemload,sideload,xloadact,nload,xbodyact,ipobody,
1911  nbody,cgr,ad,au,fext,nactdof,icol,jq,irow,neq,nzl,
1912  nmethod,ikmpc,ilmpc,ikboun,ilboun,
1913  elcon,nelcon,rhcon,nrhcon,alcon,nalcon,alzero,
1914  ielmat,ielorien,norien,orab,ntmat_,
1915  t0,t1act,ithermal,prestr,iprestr,vold,iperturb,sti,
1916  nzs,stx,adb,aub,iexpl,plicon,nplicon,plkcon,nplkcon,
1917  xstiff,npmat_,&dtime,matname,mi,
1918  ncmat_,mass,&stiffness,&buckling,&rhsi,&intscheme,
1919  physcon,shcon,nshcon,cocon,ncocon,ttime,&time,istep,&iinc,
1920  &coriolis,ibody,xloadold,&reltime,veold,springarea,nstate_,
1921  xstateini,xstate,thicke,integerglob,doubleglob,
1922  tieset,istartset,iendset,ialset,ntie,&nasym,pslavsurf,
1923  pmastsurf,mortar,clearini,ielprop,prop,&ne0,fnext,&kscale,
1924  iponoel,inoel,network));
1925  }
1926 #endif
1927 
1928  if(nasym==1){
1929  RENEW(au,double,2*nzs[1]);
1930  if(*nmethod==4) RENEW(aub,double,2*nzs[1]);
1931  symmetryflag=2;
1932  inputformat=1;
1933 
1934  FORTRAN(mafillsmas,(co,nk,kon,ipkon,lakon,ne,nodeboun,
1935  ndirboun,xbounact,nboun,
1936  ipompc,nodempc,coefmpc,nmpc,nodeforc,ndirforc,xforcact,
1937  nforc,nelemload,sideload,xloadact,nload,xbodyact,ipobody,
1938  nbody,cgr,ad,au,fext,nactdof,icol,jq,irow,neq,nzl,
1939  nmethod,ikmpc,ilmpc,ikboun,ilboun,
1940  elcon,nelcon,rhcon,nrhcon,alcon,nalcon,alzero,
1941  ielmat,ielorien,norien,orab,ntmat_,
1942  t0,t1act,ithermal,prestr,iprestr,vold,iperturb,sti,
1943  nzs,stx,adb,aub,iexpl,plicon,nplicon,plkcon,nplkcon,
1944  xstiff,npmat_,&dtime,matname,mi,
1945  ncmat_,mass,&stiffness,&buckling,&rhsi,&intscheme,
1946  physcon,shcon,nshcon,cocon,ncocon,ttime,&time,istep,&iinc,
1947  &coriolis,ibody,xloadold,&reltime,veold,springarea,nstate_,
1948  xstateini,xstate,thicke,
1949  integerglob,doubleglob,tieset,istartset,iendset,
1950  ialset,ntie,&nasym,pslavsurf,pmastsurf,mortar,clearini,
1951  ielprop,prop,&ne0,&kscale,iponoel,inoel,network));
1952  }
1953 
1954 
1955  iperturb[0]=iperturb_sav[0];
1956  iperturb[1]=iperturb_sav[1];
1957 
1958  }else{
1959 
1960  /* calculating the external loading
1961 
1962  This is only done once per increment. In reality, the
1963  external loading is a function of vold (specifically,
1964  the body forces and surface loading). This effect is
1965  neglected, since the increment size in dynamic explicit
1966  calculations is usually small */
1967 
1968  FORTRAN(rhs,(co,nk,kon,ipkon,lakon,ne,
1969  ipompc,nodempc,coefmpc,nmpc,nodeforc,ndirforc,xforcact,
1970  nforc,nelemload,sideload,xloadact,nload,xbodyact,ipobody,
1971  nbody,cgr,fext,nactdof,&neq[1],
1972  nmethod,ikmpc,ilmpc,
1973  elcon,nelcon,rhcon,nrhcon,alcon,nalcon,alzero,
1974  ielmat,ielorien,norien,orab,ntmat_,
1975  t0,t1act,ithermal,iprestr,vold,iperturb,
1976  iexpl,plicon,nplicon,plkcon,nplkcon,
1977  npmat_,ttime,&time,istep,&iinc,&dtime,physcon,ibody,
1978  xbodyold,&reltime,veold,matname,mi,ikactmech,
1979  &nactmech,ielprop,prop,sti,xstateini,xstate,nstate_));
1980  }
1981 
1982 /* for(k=0;k<neq[1];++k){printf("f=%" ITGFORMAT ",%f\n",k,f[k]);}
1983  for(k=0;k<neq[1];++k){printf("fext=%" ITGFORMAT ",%f\n",k,fext[k]);}
1984  for(k=0;k<neq[1];++k){printf("ad=%" ITGFORMAT ",%f\n",k,ad[k]);}
1985  for(k=0;k<nzs[1];++k){printf("au=%" ITGFORMAT ",%f\n",k,au[k]);}*/
1986 
1987  /* calculating the damping matrix for implicit dynamic
1988  calculations */
1989 
1990  if(idamping==1){
1991 
1992  /* Rayleigh damping */
1993 
1994  NNEW(adc,double,neq[1]);
1995  for(k=0;k<neq[0];k++){adc[k]=alpham*adb[k]+betam*ad[k];}
1996  if(nasym==0){
1997  NNEW(auc,double,nzs[1]);
1998  for(k=0;k<nzs[0];k++){auc[k]=alpham*aub[k]+betam*au[k];}
1999  }else{
2000  NNEW(auc,double,2*nzs[1]);
2001  for(k=0;k<2*nzs[0];k++){auc[k]=alpham*aub[k]+betam*au[k];}
2002  }
2003 
2004  /* dashpots and contact damping */
2005 
2006  FORTRAN(mafilldm,(co,nk,kon,ipkon,lakon,ne,nodeboun,
2007  ndirboun,xbounact,nboun,
2008  ipompc,nodempc,coefmpc,nmpc,nodeforc,ndirforc,xforcact,
2009  nforc,nelemload,sideload,xloadact,nload,xbodyact,
2010  ipobody,nbody,cgr,
2011  adc,auc,nactdof,icol,jq,irow,neq,nzl,nmethod,
2012  ikmpc,ilmpc,ikboun,ilboun,
2013  elcon,nelcon,rhcon,nrhcon,alcon,nalcon,alzero,ielmat,
2014  ielorien,norien,orab,ntmat_,
2015  t0,t1act,ithermal,prestr,iprestr,vold,iperturb,sti,
2016  nzs,stx,adb,aub,iexpl,plicon,nplicon,plkcon,nplkcon,
2017  xstiff,npmat_,&dtime,matname,mi,ncmat_,
2018  ttime,&time,istep,&iinc,ibody,clearini,mortar,springarea,
2019  pslavsurf,pmastsurf,&reltime,&nasym));
2020  }
2021 
2022  /* calculating the residual */
2023 
2024  calcresidual(nmethod,neq,b,fext,f,iexpl,nactdof,aux2,vold,
2025  vini,&dtime,accold,nk,adb,aub,jq,irow,nzl,alpha,fextini,fini,
2026  islavnode,nslavnode,mortar,ntie,f_cm,f_cs,mi,
2027  nzs,&nasym,&idamping,veold,adc,auc,cvini,cv);
2028 
2029  /* storing the residuum in resold (for line search) */
2030 
2031  if((*mortar==1)&&(iit!=1)&&(*ne-ne0>0)&(*nmethod!=4)){memcpy(&resold[0],&b[0],sizeof(double)*neq[1]);}
2032 
2033  newstep=0;
2034 
2035  if(*nmethod==0){
2036 
2037  /* error occurred in mafill: storing the geometry in frd format */
2038 
2039  *nmethod=0;
2040  ++*kode;
2041  NNEW(inum,ITG,*nk);for(k=0;k<*nk;k++) inum[k]=1;
2042  if(strcmp1(&filab[1044],"ZZS")==0){
2043  NNEW(neigh,ITG,40**ne);
2044  NNEW(ipneigh,ITG,*nk);
2045  }
2046 
2047  ptime=*ttime+time;
2048  frd(co,nk,kon,ipkon,lakon,&ne0,v,stn,inum,nmethod,
2049  kode,filab,een,t1,fn,&ptime,epn,ielmat,matname,enern,xstaten,
2050  nstate_,istep,&iinc,ithermal,qfn,&mode,&noddiam,trab,inotr,
2051  ntrans,orab,ielorien,norien,description,ipneigh,neigh,
2052  mi,sti,vr,vi,stnr,stni,vmax,stnmax,&ngraph,veold,ener,ne,
2053  cs,set,nset,istartset,iendset,ialset,eenmax,fnr,fni,emn,
2054  thicke,jobnamec,output,qfx,cdn,mortar,cdnr,cdni,nmat);
2055 
2056  if(strcmp1(&filab[1044],"ZZS")==0){SFREE(ipneigh);SFREE(neigh);}
2057  #ifdef COMPANY
2058  FORTRAN(uout,(v,mi,ithermal,filab));
2059 #endif
2060  SFREE(inum);FORTRAN(stop,());
2061 
2062  }
2063 
2064  /* implicit step (static or dynamic */
2065 
2066  if(*iexpl<=1){
2067  if((*nmethod==4)&&(*mortar<2)){
2068 
2069  /* mechanical part */
2070 
2071  if(*ithermal!=2){
2072  scal1=bet*dtime*dtime*(1.+*alpha);
2073  for(k=0;k<neq[0];++k){
2074  ad[k]=adb[k]+scal1*ad[k];
2075  }
2076  for(k=0;k<nzs[0];++k){
2077  au[k]=aub[k]+scal1*au[k];
2078  }
2079 
2080  /* upper triangle of asymmetric matrix */
2081 
2082  if(nasym>0){
2083  for(k=nzs[2];k<nzs[2]+nzs[0];++k){
2084  au[k]=aub[k]+scal1*au[k];
2085  }
2086  }
2087 
2088  /* damping */
2089 
2090  if(idamping==1){
2091  scal1=gam*dtime*(1.+*alpha);
2092  for(k=0;k<neq[0];++k){
2093  ad[k]+=scal1*adc[k];
2094  }
2095  for(k=0;k<nzs[0];++k){
2096  au[k]+=scal1*auc[k];
2097  }
2098 
2099  /* upper triangle of asymmetric matrix */
2100 
2101  if(nasym>0){
2102  for(k=nzs[2];k<nzs[2]+nzs[0];++k){
2103  au[k]+=scal1*auc[k];
2104  }
2105  }
2106  }
2107 
2108  }
2109 
2110  /* thermal part */
2111 
2112  if(*ithermal>1){
2113  for(k=neq[0];k<neq[1];++k){
2114  ad[k]=adb[k]/dtime+ad[k];
2115  }
2116  for(k=nzs[0];k<nzs[1];++k){
2117  au[k]=aub[k]/dtime+au[k];
2118  }
2119 
2120  /* upper triangle of asymmetric matrix */
2121 
2122  if(nasym>0){
2123  for(k=nzs[2]+nzs[0];k<nzs[2]+nzs[1];++k){
2124  au[k]=aub[k]/dtime+au[k];
2125  }
2126  }
2127  }
2128  }
2129 
2130  if(*isolver==0){
2131 #ifdef SPOOLES
2132  if(*ithermal<2){
2133  spooles(ad,au,adb,aub,&sigma,b,icol,irow,&neq[0],&nzs[0],
2134  &symmetryflag,&inputformat,&nzs[2]);
2135  }else if((*ithermal==2)&&(uncoupled)){
2136  n1=neq[1]-neq[0];
2137  n2=nzs[1]-nzs[0];
2138  spooles(&ad[neq[0]],&au[nzs[0]],&adb[neq[0]],&aub[nzs[0]],
2139  &sigma,&b[neq[0]],&icol[neq[0]],iruc,
2140  &n1,&n2,&symmetryflag,&inputformat,&nzs[2]);
2141  }else{
2142  spooles(ad,au,adb,aub,&sigma,b,icol,irow,&neq[1],&nzs[1],
2143  &symmetryflag,&inputformat,&nzs[2]);
2144  }
2145 #else
2146  printf(" *ERROR in nonlingeo: the SPOOLES library is not linked\n\n");
2147  FORTRAN(stop,());
2148 #endif
2149  }
2150  else if((*isolver==2)||(*isolver==3)){
2151  if(nasym>0){
2152  if(*isolver==3){
2153  printf(" *WARNING in nonlingeo: the iterative Cholesky solver cannot be used for asymmetric matrices.\nThe iterative scaling solver will be used instead\n\n");
2154  }
2155  NNEW(rwork,double,neq[1]);
2156  NNEW(sol,double,neq[1]);
2157  RENEW(au,double,2*nzs[1]+neq[1]);
2158  memcpy(&au[2*nzs[1]],ad,sizeof(double)*neq[1]);
2159  nelt=2*nzs[1]+neq[1];
2160  lrgw=131+16*neq[1];
2161  isym=0;
2162  NNEW(rgwk,double,lrgw);
2163  NNEW(igwk,ITG,20);
2164  for(i=0;i<neq[1];i++){rwork[i]=1./ad[i];}
2165  FORTRAN(predgmres_struct,(&neq[1],b,sol,&nelt,irow,jq,au,
2166  &isym,&itol,&tol,&itmax,&iter,
2167  &err,&ierr,&iunit,sb,sx,rgwk,&lrgw,igwk,
2168  &ligw,rwork,iwork));
2169  memcpy(b,sol,sizeof(double)*neq[1]);
2170  SFREE(rgwk);SFREE(igwk);SFREE(rwork);SFREE(sol);
2171  }else{
2172  preiter(ad,&au,b,&icol,&irow,&neq[1],&nzs[1],isolver,iperturb);
2173  }
2174  }
2175  else if(*isolver==4){
2176 #ifdef SGI
2177  if(nasym>0){
2178  printf(" *ERROR in nonlingeo: the SGI solver cannot be used for asymmetric matrices\n\n");
2179  FORTRAN(stop,());
2180  }
2181  token=1;
2182  if(*ithermal<2){
2183  sgi_main(ad,au,adb,aub,&sigma,b,icol,irow,&neq[0],&nzs[0],token);
2184  }else if((*ithermal==2)&&(uncoupled)){
2185  n1=neq[1]-neq[0];
2186  n2=nzs[1]-nzs[0];
2187  sgi_main(&ad[neq[0]],&au[nzs[0]],&adb[neq[0]],&aub[nzs[0]],
2188  &sigma,&b[neq[0]],&icol[neq[0]],iruc,
2189  &n1,&n2,token);
2190  }else{
2191  sgi_main(ad,au,adb,aub,&sigma,b,icol,irow,&neq[1],&nzs[1],token);
2192  }
2193 #else
2194  printf(" *ERROR in nonlingeo: the SGI library is not linked\n\n");
2195  FORTRAN(stop,());
2196 #endif
2197  }
2198  else if(*isolver==5){
2199 #ifdef TAUCS
2200  if(nasym>0){
2201  printf(" *ERROR in nonlingeo: the TAUCS solver cannot be used for asymmetric matrices\n\n");
2202  FORTRAN(stop,());
2203  }
2204  tau(ad,&au,adb,aub,&sigma,b,icol,&irow,&neq[1],&nzs[1]);
2205 #else
2206  printf(" *ERROR in nonlingeo: the TAUCS library is not linked\n\n");
2207  FORTRAN(stop,());
2208 #endif
2209  }
2210  else if(*isolver==7){
2211 #ifdef PARDISO
2212  if(*ithermal<2){
2213  pardiso_main(ad,au,adb,aub,&sigma,b,icol,irow,&neq[0],&nzs[0],
2214  &symmetryflag,&inputformat,jq,&nzs[2]);
2215  }else if((*ithermal==2)&&(uncoupled)){
2216  n1=neq[1]-neq[0];
2217  n2=nzs[1]-nzs[0];
2218  pardiso_main(&ad[neq[0]],&au[nzs[0]],&adb[neq[0]],&aub[nzs[0]],
2219  &sigma,&b[neq[0]],&icol[neq[0]],iruc,
2220  &n1,&n2,&symmetryflag,&inputformat,jq,&nzs[2]);
2221  }else{
2222  pardiso_main(ad,au,adb,aub,&sigma,b,icol,irow,&neq[1],&nzs[1],
2223  &symmetryflag,&inputformat,jq,&nzs[2]);
2224  }
2225 #else
2226  printf(" *ERROR in nonlingeo: the PARDISO library is not linked\n\n");
2227  FORTRAN(stop,());
2228 #endif
2229  }
2230 
2231  if(*mortar<=1){
2232  if(isensitivity){
2233 /* if(nasym!=0){
2234  printf("*ERROR in nonlingeo: a sensitivity analysis \n is not allowed in combination with frictional contact \n\n");
2235  FORTRAN(stop,());
2236  }*/
2237  SFREE(adcpy);NNEW(adcpy,double,neq[1]);
2238  SFREE(aucpy);NNEW(aucpy,double,(nasym+1)*nzs[1]);
2239  memcpy(&adcpy[0],&ad[0],sizeof(double)*neq[1]);
2240  memcpy(&aucpy[0],&au[0],sizeof(double)*(nasym+1)*nzs[1]);
2241  }
2242  SFREE(ad);SFREE(au);
2243  }
2244  }
2245 
2246  /* explicit dynamic step */
2247 
2248  else{
2249  if(*ithermal!=2){
2250  for(k=0;k<neq[0];++k){
2251  b[k]=b[k]/adb[k];
2252  }
2253  }
2254  if(*ithermal>1){
2255  for(k=neq[0];k<neq[1];++k){
2256  b[k]=b[k]*dtime/adb[k];
2257  }
2258  }
2259  }
2260 
2261  /* calculating the displacements, stresses and forces */
2262 
2263  NNEW(v,double,mt**nk);
2264  memcpy(&v[0],&vold[0],sizeof(double)*mt**nk);
2265 
2266  NNEW(stx,double,6*mi[0]**ne);
2267  NNEW(fn,double,mt**nk);
2268 
2269  NNEW(inum,ITG,*nk);
2270  results(co,nk,kon,ipkon,lakon,ne,v,stn,inum,stx,
2271  elcon,nelcon,rhcon,nrhcon,alcon,nalcon,alzero,ielmat,
2272  ielorien,norien,orab,ntmat_,t0,t1act,ithermal,
2273  prestr,iprestr,filab,eme,emn,een,iperturb,
2274  f,fn,nactdof,&iout,qa,vold,b,nodeboun,
2275  ndirboun,xbounact,nboun,ipompc,
2276  nodempc,coefmpc,labmpc,nmpc,nmethod,cam,&neq[1],veold,accold,
2277  &bet,&gam,&dtime,&time,ttime,plicon,nplicon,plkcon,nplkcon,
2278  xstateini,xstiff,xstate,npmat_,epn,matname,mi,&ielas,
2279  &icmd,ncmat_,nstate_,stiini,vini,ikboun,ilboun,ener,enern,
2280  emeini,xstaten,eei,enerini,cocon,ncocon,set,nset,istartset,
2281  iendset,ialset,nprint,prlab,prset,qfx,qfn,trab,inotr,ntrans,
2282  fmpc,nelemload,nload,ikmpc,ilmpc,istep,&iinc,springarea,
2283  &reltime,&ne0,xforc,nforc,thicke,shcon,nshcon,
2284  sideload,xloadact,xloadold,&icfd,inomat,pslavsurf,pmastsurf,
2285  mortar,islavact,cdn,islavnode,nslavnode,ntie,clearini,
2286  islavsurf,ielprop,prop,energyini,energy,&kscale,iponoel,
2287  inoel,nener,orname,network,ipobody,xbodyact,ibody);
2288  SFREE(inum);
2289 
2290  /* implicit dynamics (Matteo Pacher) */
2291 
2292  if((*ne!=ne0)&&(*nmethod==4)&&(*ithermal<2)&&(*iexpl<=1)){
2293  FORTRAN(storecontactprop,(ne,&ne0,lakon,kon,ipkon,mi,
2294  ielmat,elcon,mortar,adblump,nactdof,springarea,
2295  ncmat_,ntmat_,stx,&temax));
2296  }
2297 
2298  /* updating the external work (only for dynamic calculations) */
2299 
2300  if((*nmethod==4)&&(*ithermal<2)){
2301  allwk=allwkini;
2302  for(i=0;i<*nk;i++){
2303  for(k=1;k<4;k++){
2304  allwk+=(fnext[i*mt+k]+fnextini[i*mt+k])*
2305  (v[i*mt+k]-vini[i*mt+k])/2.;
2306  }
2307  }
2308 
2309  /* Work due to damping forces (cv and cvini) --> MPADD */
2310 
2311  if(idamping==1){
2312  dampwk=dampwkini;
2313  for(k=0;k<*nk;++k){
2314  for(j=1;j<mt;++j){
2315  if(nactdof[mt*k+j]>0){
2316  aux2[nactdof[mt*k+j]-1]=v[mt*k+j]-vini[mt*k+j];
2317  }
2318  }
2319  }
2320  for(k=0;k<neq[0];k++){
2321  dampwk+=-(cv[k]+cvini[k])*aux2[k]/2.;
2322  }
2323  }
2324  /* Damping forces --> MPADD */
2325  }
2326 
2327  /* line search (only for static surface-to-surface penalty contact)
2328  and not in the first iteration */
2329 
2330  if((*mortar==1)&&(iit!=1)&&(*ne-ne0>0)&&(*nmethod!=4)){
2331 
2332  SFREE(v);SFREE(stx);SFREE(fn);
2333 
2334  /* calculating the residual */
2335 
2336  NNEW(res,double,neq[1]);
2337  calcresidual(nmethod,neq,res,fext,f,iexpl,nactdof,aux2,vold,
2338  vini,&dtime,accold,nk,adb,aub,jq,irow,nzl,alpha,fextini,fini,
2339  islavnode,nslavnode,mortar,ntie,f_cm,f_cs,mi,
2340  nzs,&nasym,&idamping,veold,adc,auc,cvini,cv);
2341 
2342  /* calculating the line search factor */
2343 
2344  sum1=0.;sum2=0.;
2345  for(i=0;i<neq[1];i++){
2346  sum1+=b[i]*resold[i];
2347  sum2+=b[i]*res[i];
2348  }
2349  SFREE(res);
2350 
2351  if(fabs(sum1-sum2)<1.e-30){
2352  flinesearch=1.;
2353  }else{
2354  flinesearch=sum1/(sum1-sum2);
2355  if(flinesearch>smaxls){
2356  flinesearch=smaxls;
2357  }else if(flinesearch<sminls){
2358  flinesearch=sminls;
2359  }
2360  }
2361  printf("line search factor=%f\n\n",flinesearch);
2362 
2363  /* update the solution */
2364 
2365  for(i=0;i<neq[1];i++){b[i]*=flinesearch;}
2366 
2367  NNEW(v,double,mt**nk);
2368  memcpy(&v[0],&vold[0],sizeof(double)*mt**nk);
2369 
2370  NNEW(stx,double,6*mi[0]**ne);
2371  NNEW(fn,double,mt**nk);
2372 
2373  NNEW(inum,ITG,*nk);
2374  results(co,nk,kon,ipkon,lakon,ne,v,stn,inum,stx,
2375  elcon,nelcon,rhcon,nrhcon,alcon,nalcon,alzero,ielmat,
2376  ielorien,norien,orab,ntmat_,t0,t1act,ithermal,
2377  prestr,iprestr,filab,eme,emn,een,iperturb,
2378  f,fn,nactdof,&iout,qa,vold,b,nodeboun,
2379  ndirboun,xbounact,nboun,ipompc,
2380  nodempc,coefmpc,labmpc,nmpc,nmethod,cam,&neq[1],veold,accold,
2381  &bet,&gam,&dtime,&time,ttime,plicon,nplicon,plkcon,nplkcon,
2382  xstateini,xstiff,xstate,npmat_,epn,matname,mi,&ielas,
2383  &icmd,ncmat_,nstate_,stiini,vini,ikboun,ilboun,ener,enern,
2384  emeini,xstaten,eei,enerini,cocon,ncocon,set,nset,istartset,
2385  iendset,ialset,nprint,prlab,prset,qfx,qfn,trab,inotr,ntrans,
2386  fmpc,nelemload,nload,ikmpc,ilmpc,istep,&iinc,springarea,
2387  &reltime,&ne0,xforc,nforc,thicke,shcon,nshcon,
2388  sideload,xloadact,xloadold,&icfd,inomat,pslavsurf,pmastsurf,
2389  mortar,islavact,cdn,islavnode,nslavnode,ntie,clearini,
2390  islavsurf,ielprop,prop,energyini,energy,&kscale,iponoel,
2391  inoel,nener,orname,network,ipobody,xbodyact,ibody);
2392  SFREE(inum);
2393  }
2394 
2395  /* calculating the residual */
2396 
2397  calcresidual(nmethod,neq,b,fext,f,iexpl,nactdof,aux2,vold,
2398  vini,&dtime,accold,nk,adb,aub,jq,irow,nzl,alpha,fextini,fini,
2399  islavnode,nslavnode,mortar,ntie,f_cm,f_cs,mi,
2400  nzs,&nasym,&idamping,veold,adc,auc,cvini,cv);
2401 
2402  memcpy(&vold[0],&v[0],sizeof(double)*mt**nk);
2403  if(*ithermal!=2){
2404  for(k=0;k<6*mi[0]*ne0;++k){
2405  sti[k]=stx[k];
2406  }
2407  }
2408 
2409  /* calculating the ratio of the smallest to largest pressure
2410  for face-to-face contact
2411  only done at the end of a step */
2412 
2413  if((*mortar==1)&&(1.-theta-dtheta<=1.e-6)){
2414  FORTRAN(negativepressure,(&ne0,ne,mi,stx,&pressureratio));
2415  }else{pressureratio=0.;}
2416 
2417  SFREE(v);SFREE(stx);SFREE(fn);
2418 
2419  if(idamping==1){SFREE(adc);SFREE(auc);}
2420 
2421  if(*iexpl<=1){
2422 
2423  /* store the residual forces for the next iteration */
2424 
2425  if(*ithermal!=2){
2426  if(cam[0]>uam[0]){uam[0]=cam[0];}
2427  if(qau<1.e-10){
2428  if(qa[0]>ea*qam[0]){qam[0]=(qamold[0]*jnz+qa[0])/(jnz+1);}
2429  else {qam[0]=qamold[0];}
2430  }
2431  }
2432  if(*ithermal>1){
2433  if(cam[1]>uam[1]){uam[1]=cam[1];}
2434  if(qau<1.e-10){
2435  if(qa[1]>ea*qam[1]){qam[1]=(qamold[1]*jnz+qa[1])/(jnz+1);}
2436  else {qam[1]=qamold[1];}
2437  }
2438  }
2439 
2440  /* calculating the maximum residual */
2441 
2442  for(k=0;k<2;++k){
2443  ram2[k]=ram1[k];
2444  ram1[k]=ram[k];
2445  ram[k]=0.;
2446  }
2447  if(*ithermal!=2){
2448  for(k=0;k<neq[0];++k){
2449  err=fabs(b[k]);
2450  if(err>ram[0]){ram[0]=err;ram[2]=k+0.5;}
2451  }
2452  }
2453  if(*ithermal>1){
2454  for(k=neq[0];k<neq[1];++k){
2455  err=fabs(b[k]);
2456  if(err>ram[1]){ram[1]=err;ram[3]=k+0.5;}
2457  }
2458  }
2459 
2460  /* Divergence criteria for face-to-face penalty is different */
2461 
2462  if(*mortar==1){
2463  for(k=4;k<8;++k){
2464  ram2[k]=ram1[k];
2465  ram1[k]=ram[k];
2466  }
2467  ram[4]=ram[0]+ram1[0];
2468  if((iflagact==0)&&(iit>1)){
2469  ram[5]=1.5;
2470  }else{ram[5]=0.5;}
2471  ram[6]=(*ne-ne0)-(neold-ne0)+0.5;
2472  if(iit>3){
2473  if((fabs(ram[6])>=fabs(ram1[6]))&&(fabs(ram[6])>=fabs(ram2[6]))){
2474  ram[7]=1.5;
2475  }else{ram[7]=0.5;}
2476  }
2477 
2478  }
2479 
2480  /* next line is inserted to cope with stress-less
2481  temperature calculations */
2482 
2483  if(*ithermal!=2){
2484  if(ram[0]<1.e-6) ram[0]=0.;
2485  printf(" average force= %f\n",qa[0]);
2486  printf(" time avg. forc= %f\n",qam[0]);
2487  if((ITG)((double)nactdofinv[(ITG)ram[2]]/mt)+1==0){
2488  printf(" largest residual force= %f\n",
2489  ram[0]);
2490  }else{
2491  inode=(ITG)((double)nactdofinv[(ITG)ram[2]]/mt)+1;
2492  idir=nactdofinv[(ITG)ram[2]]-mt*(inode-1);
2493  printf(" largest residual force= %f in node %" ITGFORMAT " and dof %" ITGFORMAT "\n",
2494  ram[0],inode,idir);
2495  }
2496  printf(" largest increment of disp= %e\n",uam[0]);
2497  if((ITG)cam[3]==0){
2498  printf(" largest correction to disp= %e\n\n",
2499  cam[0]);
2500  }else{
2501  inode=(ITG)((double)nactdofinv[(ITG)cam[3]]/mt)+1;
2502  idir=nactdofinv[(ITG)cam[3]]-mt*(inode-1);
2503  printf(" largest correction to disp= %e in node %" ITGFORMAT " and dof %" ITGFORMAT "\n\n",cam[0],inode,idir);
2504  }
2505  }
2506  if(*ithermal>1){
2507  if(ram[1]<1.e-6) ram[1]=0.;
2508  printf(" average flux= %f\n",qa[1]);
2509  printf(" time avg. flux= %f\n",qam[1]);
2510  if((ITG)((double)nactdofinv[(ITG)ram[3]]/mt)+1==0){
2511  printf(" largest residual flux= %f\n",
2512  ram[1]);
2513  }else{
2514  inode=(ITG)((double)nactdofinv[(ITG)ram[3]]/mt)+1;
2515  idir=nactdofinv[(ITG)ram[3]]-mt*(inode-1);
2516  printf(" largest residual flux= %f in node %" ITGFORMAT " and dof %" ITGFORMAT "\n",ram[1],inode,idir);
2517  }
2518  printf(" largest increment of temp= %e\n",uam[1]);
2519  if((ITG)cam[4]==0){
2520  printf(" largest correction to temp= %e\n\n",
2521  cam[1]);
2522  }else{
2523  inode=(ITG)((double)nactdofinv[(ITG)cam[4]]/mt)+1;
2524  idir=nactdofinv[(ITG)cam[4]]-mt*(inode-1);
2525  printf(" largest correction to temp= %e in node %" ITGFORMAT " and dof %" ITGFORMAT "\n\n",cam[1],inode,idir);
2526  }
2527  }
2528  fflush(stdout);
2529 
2530  FORTRAN(writecvg,(istep,&iinc,&icutb,&iit,ne,&ne0,ram,qam,cam,uam,
2531  ithermal));
2532 
2533  checkconvergence(co,nk,kon,ipkon,lakon,ne,stn,nmethod,
2534  kode,filab,een,t1act,&time,epn,ielmat,matname,enern,
2535  xstaten,nstate_,istep,&iinc,iperturb,ener,mi,output,
2536  ithermal,qfn,&mode,&noddiam,trab,inotr,ntrans,orab,
2537  ielorien,norien,description,sti,&icutb,&iit,&dtime,qa,
2538  vold,qam,ram1,ram2,ram,cam,uam,&ntg,ttime,&icntrl,
2539  &theta,&dtheta,veold,vini,idrct,tper,&istab,tmax,
2540  nactdof,b,tmin,ctrl,amta,namta,itpamp,inext,&dthetaref,
2541  &itp,&jprint,jout,&uncoupled,t1,&iitterm,nelemload,
2542  nload,nodeboun,nboun,itg,ndirboun,&deltmx,&iflagact,
2543  set,nset,istartset,iendset,ialset,emn,thicke,jobnamec,
2544  mortar,nmat,ielprop,prop,&ialeatoric,&kscale,
2545  energy,&allwk,&energyref,&emax,&r_abs,&enetoll,energyini,
2546  &allwkini,&temax,&sizemaxinc,&ne0,&neini,&dampwk,
2547  &dampwkini,energystartstep);
2548 
2549  }else{
2550 
2551  /* explicit dynamics */
2552 
2553  icntrl=1;
2554  icutb=0;
2555 
2556  /* recalculation of the time increment every 500 icrements
2557  (may have changed due to deformation) */
2558 
2559  if((iinc/500)*500==iinc){
2560  FORTRAN(calcstabletimeincvol,(&ne0,lakon,co,kon,ipkon,mi,
2561  ielmat,&dtvol,alpha,wavespeed));
2562 
2563  if(dtvol<*tinc)*tinc=dtvol;
2564  dtheta=(*tinc)/(*tper);
2565  dthetaref=dtheta;
2566  }
2567 
2568  theta=theta+dtheta;
2569  if(dtheta>=1.-theta){
2570  if(dtheta>1.-theta){
2571  printf(" the increment size exceeds the remainder of the step and is decreased to %e\n\n",
2572  dtheta**tper);
2573  }
2574  dtheta=1.-theta;
2575  dthetaref=dtheta;
2576  }
2577  iflagact=0;
2578  }
2579 
2580  }
2581 
2582  if(*nmethod!=4)SFREE(resold);
2583 
2584  /*********************************************************/
2585  /* end of the iteration loop */
2586  /*********************************************************/
2587 
2588  /* icutb=0 means that the iterations in the increment converged,
2589  icutb!=0 indicates that the increment has to be reiterated with
2590  another increment size (dtheta) */
2591 
2592  /* printing the energies (only for dynamic calculations) */
2593 
2594  if((icutb==0)&&(*nmethod==4)&&(*ithermal<2)){
2595  printf(" initial energy (at start of step) = %e\n\n",energyref);
2596 
2597  printf(" since start of the step: \n");
2598  printf(" external work = %e\n",allwk);
2599  printf(" work performed by the damping forces = %e\n",dampwk);
2600  printf(" netto work = %e\n\n",allwk+dampwk);
2601 
2602  printf(" actual energy: \n");
2603  printf(" internal energy = %e\n",energy[0]);
2604  printf(" kinetic energy = %e\n",energy[1]);
2605  printf(" elastic contact energy = %e\n",energy[2]);
2606  printf(" energy lost due to friction = %e\n",energy[3]);
2607  printf(" total energy = %e\n\n",energy[0]+energy[1]+energy[2]+energy[3]);
2608 
2609  printf(" energy increase = %e\n\n",energy[0]+energy[1]+energy[2]+energy[3]-energyref);
2610 
2611  printf(" energy balance (absolute) = %e \n",energy[0]+energy[1]+energy[2]+energy[3]-energyref-allwk-dampwk);
2612 
2613  /* Belytschko criterion */
2614 
2615  denergymax=energy[0];
2616  if(denergymax<energy[1]) denergymax=energy[1];
2617  if(denergymax<fabs(allwk)) denergymax=fabs(allwk);
2618 
2619  if(denergymax>1.e-30){
2620  printf(" energy balance (relative) = %f %% \n\n",
2621  fabs((energy[0]+energy[1]+energy[2]+energy[3]-energyref-allwk-dampwk)/
2622  denergymax*100.));
2623  }else{
2624  printf(" energy balance (relative) =0 %% \n\n");
2625  }
2626 // # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
2627 // MPADD start
2628 // printf(" work done by the damping forces = %e\n", dampwk);
2629 // neini=*ne;
2630 // printf(" contact elements end of increment = %"ITGFORMAT"\n\n", *ne - ne0);
2631 // MPADD end
2632 // # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
2633 
2634  }
2635 
2636  if(uncoupled){
2637  SFREE(iruc);
2638  }
2639 
2640  if(((qa[0]>ea*qam[0])||(qa[1]>ea*qam[1]))&&(icutb==0)){jnz++;}
2641  iit=0;
2642 
2643  if(icutb!=0){
2644  memcpy(&vold[0],&vini[0],sizeof(double)*mt**nk);
2645 
2646  for(k=0;k<*nboun;++k){xbounact[k]=xbounini[k];}
2647  if((*ithermal==1)||(*ithermal>=3)){
2648  for(k=0;k<*nk;++k){t1act[k]=t1ini[k];}
2649  }
2650  for(k=0;k<neq[1];++k){
2651  f[k]=fini[k];
2652  }
2653  if(*nmethod==4){
2654  for(k=0;k<mt**nk;++k){
2655  veold[k]=veini[k];
2656  accold[k]=accini[k];
2657  }
2658  for(k=0;k<neq[1];++k){
2659 // f[k]=fini[k];
2660  fext[k]=fextini[k];
2661  cv[k]=cvini[k];
2662  }
2663  }
2664  if(*ithermal!=2){
2665  for(k=0;k<6*mi[0]*ne0;++k){
2666  sti[k]=stiini[k];
2667  eme[k]=emeini[k];
2668  }
2669  }
2670  if(*nener==1)
2671  for(k=0;k<mi[0]*ne0;++k){ener[k]=enerini[k];}
2672 
2673  for(k=0;k<*nstate_*mi[0]*(ne0+maxprevcontel);++k){
2674  xstate[k]=xstateini[k];
2675  }
2676 
2677  qam[0]=qamold[0];
2678  qam[1]=qamold[1];
2679  }
2680 
2681  /* face-to-face penalty */
2682 
2683  if((*mortar==1)&&(icutb==0)){
2684 
2685  ntrimax=0;
2686  for(i=0;i<*ntie;i++){
2687  if(itietri[2*i+1]-itietri[2*i]+1>ntrimax)
2688  ntrimax=itietri[2*i+1]-itietri[2*i]+1;
2689  }
2690  NNEW(xo,double,ntrimax);
2691  NNEW(yo,double,ntrimax);
2692  NNEW(zo,double,ntrimax);
2693  NNEW(x,double,ntrimax);
2694  NNEW(y,double,ntrimax);
2695  NNEW(z,double,ntrimax);
2696  NNEW(nx,ITG,ntrimax);
2697  NNEW(ny,ITG,ntrimax);
2698  NNEW(nz,ITG,ntrimax);
2699 
2700  /* Determination of active nodes (islavact) */
2701 
2702  FORTRAN(islavactive,(tieset,ntie,itietri,cg,straight,
2703  co,vold,xo,yo,zo,x,y,z,nx,ny,nz,mi,
2704  imastop,nslavnode,islavnode,islavact));
2705 
2706  SFREE(xo);SFREE(yo);SFREE(zo);SFREE(x);SFREE(y);SFREE(z);SFREE(nx);
2707  SFREE(ny);SFREE(nz);
2708 
2709  if(negpres==0){
2710  if((*mortar==1)&&(1.-theta-dtheta<=1.e-6)&&(itruecontact==1)){
2711  printf(" pressure ratio (smallest/largest pressure over all contact areas) =%e\n\n",pressureratio);
2712  if(pressureratio<-0.05){
2713  printf(" zero-size increment is appended\n\n");
2714  negpres=1;theta=1.-1.e-6;dtheta=1.e-6;
2715  }
2716  }
2717  }else{negpres=0;}
2718 
2719  }
2720 
2721  /* output */
2722 
2723  if((jout[0]==jprint)&&(icutb==0)){
2724 
2725  jprint=0;
2726 
2727  /* calculating the displacements and the stresses and storing */
2728  /* the results in frd format */
2729 
2730  NNEW(v,double,mt**nk);
2731  NNEW(fn,double,mt**nk);
2732  NNEW(stn,double,6**nk);
2733  if(*ithermal>1) NNEW(qfn,double,3**nk);
2734  NNEW(inum,ITG,*nk);
2735  NNEW(stx,double,6*mi[0]**ne);
2736 
2737  if(strcmp1(&filab[261],"E ")==0) NNEW(een,double,6**nk);
2738  if(strcmp1(&filab[435],"PEEQ")==0) NNEW(epn,double,*nk);
2739  if(strcmp1(&filab[522],"ENER")==0) NNEW(enern,double,*nk);
2740  if(strcmp1(&filab[609],"SDV ")==0) NNEW(xstaten,double,*nstate_**nk);
2741  if(strcmp1(&filab[2175],"CONT")==0) NNEW(cdn,double,6**nk);
2742  if(strcmp1(&filab[2697],"ME ")==0) NNEW(emn,double,6**nk);
2743 
2744  memcpy(&v[0],&vold[0],sizeof(double)*mt**nk);
2745 
2746  iout=2;
2747  icmd=3;
2748 
2749 #ifdef COMPANY
2750  FORTRAN(uinit,());
2751 #endif
2752  results(co,nk,kon,ipkon,lakon,ne,v,stn,inum,stx,
2753  elcon,nelcon,rhcon,nrhcon,alcon,nalcon,alzero,ielmat,
2754  ielorien,norien,orab,ntmat_,t0,t1act,ithermal,
2755  prestr,iprestr,filab,eme,emn,een,iperturb,
2756  f,fn,nactdof,&iout,qa,vold,b,nodeboun,
2757  ndirboun,xbounact,nboun,ipompc,
2758  nodempc,coefmpc,labmpc,nmpc,nmethod,cam,&neq[1],veold,accold,
2759  &bet,&gam,&dtime,&time,ttime,plicon,nplicon,plkcon,nplkcon,
2760  xstateini,xstiff,xstate,npmat_,epn,matname,mi,&ielas,&icmd,
2761  ncmat_,nstate_,stiini,vini,ikboun,ilboun,ener,enern,emeini,
2762  xstaten,eei,enerini,cocon,ncocon,set,nset,istartset,iendset,
2763  ialset,nprint,prlab,prset,qfx,qfn,trab,inotr,ntrans,fmpc,
2764  nelemload,nload,ikmpc,ilmpc,istep,&iinc,springarea,
2765  &reltime,&ne0,xforc,nforc,thicke,shcon,nshcon,
2766  sideload,xloadact,xloadold,&icfd,inomat,pslavsurf,pmastsurf,
2767  mortar,islavact,cdn,islavnode,nslavnode,ntie,clearini,
2768  islavsurf,ielprop,prop,energyini,energy,&kscale,iponoel,
2769  inoel,nener,orname,network,ipobody,xbodyact,ibody);
2770 
2771  memcpy(&vold[0],&v[0],sizeof(double)*mt**nk);
2772 
2773  iout=0;
2774  if(*iexpl<=1) icmd=0;
2775 // FORTRAN(networkinum,(ipkon,inum,kon,lakon,ne,itg,&ntg));
2776 // for(k=0;k<ntg;k++)if(inum[itg[k]-1]>0){inum[itg[k]-1]*=-1;}
2777 
2778  ++*kode;
2779  if(*mcs!=0){
2780  ptime=*ttime+time;
2781  frdcyc(co,nk,kon,ipkon,lakon,ne,v,stn,inum,nmethod,kode,filab,een,
2782  t1act,fn,&ptime,epn,ielmat,matname,cs,mcs,nkon,enern,xstaten,
2783  nstate_,istep,&iinc,iperturb,ener,mi,output,ithermal,qfn,
2784  ialset,istartset,iendset,trab,inotr,ntrans,orab,ielorien,
2785  norien,stx,veold,&noddiam,set,nset,emn,thicke,jobnamec,&ne0,
2786  cdn,mortar,nmat,qfx);
2787 #ifdef COMPANY
2788  FORTRAN(uout,(v,mi,ithermal,filab));
2789 #endif
2790  }
2791  else{
2792  if(strcmp1(&filab[1044],"ZZS")==0){
2793  NNEW(neigh,ITG,40**ne);
2794  NNEW(ipneigh,ITG,*nk);
2795  }
2796 
2797  ptime=*ttime+time;
2798  frd(co,nk,kon,ipkon,lakon,&ne0,v,stn,inum,nmethod,
2799  kode,filab,een,t1act,fn,&ptime,epn,ielmat,matname,enern,xstaten,
2800  nstate_,istep,&iinc,ithermal,qfn,&mode,&noddiam,trab,inotr,
2801  ntrans,orab,ielorien,norien,description,ipneigh,neigh,
2802  mi,stx,vr,vi,stnr,stni,vmax,stnmax,&ngraph,veold,ener,ne,
2803  cs,set,nset,istartset,iendset,ialset,eenmax,fnr,fni,emn,
2804  thicke,jobnamec,output,qfx,cdn,mortar,cdnr,cdni,nmat);
2805 
2806  if(strcmp1(&filab[1044],"ZZS")==0){SFREE(ipneigh);SFREE(neigh);}
2807 #ifdef COMPANY
2808  FORTRAN(uout,(v,mi,ithermal,filab));
2809 #endif
2810  }
2811 
2812  SFREE(v);SFREE(fn);SFREE(stn);SFREE(inum);SFREE(stx);
2813  if(*ithermal>1){SFREE(qfn);}
2814 
2815  if(strcmp1(&filab[261],"E ")==0) SFREE(een);
2816  if(strcmp1(&filab[435],"PEEQ")==0) SFREE(epn);
2817  if(strcmp1(&filab[522],"ENER")==0) SFREE(enern);
2818  if(strcmp1(&filab[609],"SDV ")==0) SFREE(xstaten);
2819  if(strcmp1(&filab[2175],"CONT")==0) SFREE(cdn);
2820  if(strcmp1(&filab[2697],"ME ")==0) SFREE(emn);
2821  }
2822 
2823  }
2824 
2825  /*********************************************************/
2826  /* end of the increment loop */
2827  /*********************************************************/
2828 
2829  if(jprint!=0){
2830 
2831  /* calculating the displacements and the stresses and storing
2832  the results in frd format */
2833 
2834  NNEW(v,double,mt**nk);
2835  NNEW(fn,double,mt**nk);
2836  NNEW(stn,double,6**nk);
2837  if(*ithermal>1) NNEW(qfn,double,3**nk);
2838  NNEW(inum,ITG,*nk);
2839  NNEW(stx,double,6*mi[0]**ne);
2840 
2841  if(strcmp1(&filab[261],"E ")==0) NNEW(een,double,6**nk);
2842  if(strcmp1(&filab[435],"PEEQ")==0) NNEW(epn,double,*nk);
2843  if(strcmp1(&filab[522],"ENER")==0) NNEW(enern,double,*nk);
2844  if(strcmp1(&filab[609],"SDV ")==0) NNEW(xstaten,double,*nstate_**nk);
2845  if(strcmp1(&filab[2175],"CONT")==0) NNEW(cdn,double,6**nk);
2846  if(strcmp1(&filab[2697],"ME ")==0) NNEW(emn,double,6**nk);
2847 
2848  memcpy(&v[0],&vold[0],sizeof(double)*mt**nk);
2849  iout=2;
2850  icmd=3;
2851 
2852 #ifdef COMPANY
2853  FORTRAN(uinit,());
2854 #endif
2855  results(co,nk,kon,ipkon,lakon,ne,v,stn,inum,stx,
2856  elcon,nelcon,rhcon,nrhcon,alcon,nalcon,alzero,ielmat,
2857  ielorien,norien,orab,ntmat_,t0,t1act,ithermal,
2858  prestr,iprestr,filab,eme,emn,een,iperturb,
2859  f,fn,nactdof,&iout,qa,vold,b,nodeboun,
2860  ndirboun,xbounact,nboun,ipompc,
2861  nodempc,coefmpc,labmpc,nmpc,nmethod,cam,&neq[1],veold,accold,
2862  &bet,&gam,&dtime,&time,ttime,plicon,nplicon,plkcon,nplkcon,
2863  xstateini,xstiff,xstate,npmat_,epn,matname,mi,&ielas,&icmd,
2864  ncmat_,nstate_,stiini,vini,ikboun,ilboun,ener,enern,emeini,
2865  xstaten,eei,enerini,cocon,ncocon,set,nset,istartset,iendset,
2866  ialset,nprint,prlab,prset,qfx,qfn,trab,inotr,ntrans,fmpc,
2867  nelemload,nload,ikmpc,ilmpc,istep,&iinc,springarea,
2868  &reltime,&ne0,xforc,nforc,thicke,shcon,nshcon,
2869  sideload,xloadact,xloadold,&icfd,inomat,pslavsurf,pmastsurf,
2870  mortar,islavact,cdn,islavnode,nslavnode,ntie,clearini,
2871  islavsurf,ielprop,prop,energyini,energy,&kscale,iponoel,
2872  inoel,nener,orname,network,ipobody,xbodyact,ibody);
2873 
2874  memcpy(&vold[0],&v[0],sizeof(double)*mt**nk);
2875 
2876  iout=0;
2877  if(*iexpl<=1) icmd=0;
2878 // FORTRAN(networkinum,(ipkon,inum,kon,lakon,ne,itg,&ntg));
2879 // for(k=0;k<ntg;k++)if(inum[itg[k]-1]>0){inum[itg[k]-1]*=-1;}
2880 
2881  ++*kode;
2882  if(*mcs>0){
2883  ptime=*ttime+time;
2884  frdcyc(co,nk,kon,ipkon,lakon,ne,v,stn,inum,nmethod,kode,filab,een,
2885  t1act,fn,&ptime,epn,ielmat,matname,cs,mcs,nkon,enern,xstaten,
2886  nstate_,istep,&iinc,iperturb,ener,mi,output,ithermal,qfn,
2887  ialset,istartset,iendset,trab,inotr,ntrans,orab,ielorien,
2888  norien,stx,veold,&noddiam,set,nset,emn,thicke,jobnamec,&ne0,
2889  cdn,mortar,nmat,qfx);
2890 #ifdef COMPANY
2891  FORTRAN(uout,(v,mi,ithermal,filab));
2892 #endif
2893 
2894  }
2895  else{
2896  if(strcmp1(&filab[1044],"ZZS")==0){
2897  NNEW(neigh,ITG,40**ne);
2898  NNEW(ipneigh,ITG,*nk);
2899  }
2900 
2901  ptime=*ttime+time;
2902  frd(co,nk,kon,ipkon,lakon,&ne0,v,stn,inum,nmethod,
2903  kode,filab,een,t1act,fn,&ptime,epn,ielmat,matname,enern,xstaten,
2904  nstate_,istep,&iinc,ithermal,qfn,&mode,&noddiam,trab,inotr,
2905  ntrans,orab,ielorien,norien,description,ipneigh,neigh,
2906  mi,stx,vr,vi,stnr,stni,vmax,stnmax,&ngraph,veold,ener,ne,
2907  cs,set,nset,istartset,iendset,ialset,eenmax,fnr,fni,emn,
2908  thicke,jobnamec,output,qfx,cdn,mortar,cdnr,cdni,nmat);
2909 
2910  if(strcmp1(&filab[1044],"ZZS")==0){SFREE(ipneigh);SFREE(neigh);}
2911 #ifdef COMPANY
2912  FORTRAN(uout,(v,mi,ithermal,filab));
2913 #endif
2914  }
2915 
2916  SFREE(v);SFREE(fn);SFREE(stn);SFREE(inum);SFREE(stx);
2917  if(*ithermal>1){SFREE(qfn);}
2918 
2919  if(strcmp1(&filab[261],"E ")==0) SFREE(een);
2920  if(strcmp1(&filab[435],"PEEQ")==0) SFREE(epn);
2921  if(strcmp1(&filab[522],"ENER")==0) SFREE(enern);
2922  if(strcmp1(&filab[609],"SDV ")==0) SFREE(xstaten);
2923  if(strcmp1(&filab[2175],"CONT")==0) SFREE(cdn);
2924  if(strcmp1(&filab[2697],"ME ")==0) SFREE(emn);
2925 
2926  }
2927 
2928  /* writing out the latest stiffness matrix for a subsequent
2929  sensitivity analysis */
2930 
2931  if(isensitivity){
2932 
2933  strcpy(stiffmatrix,jobnamec);
2934  strcat(stiffmatrix,".stm");
2935 
2936  if((f1=fopen(stiffmatrix,"wb"))==NULL){
2937  printf("*ERROR in linstatic: cannot open stiffness matrix file for writing...");
2938  exit(0);
2939  }
2940 
2941  /* storing the stiffness matrix */
2942 
2943  /* nzs,irow,jq and icol have to be stored too, since the static analysis
2944  can involve contact, whereas in the sensitivity analysis contact is not
2945  taken into account while determining the structure of the stiffness
2946  matrix (in mastruct.c)
2947  */
2948 
2949  if(fwrite(&nasym,sizeof(ITG),1,f1)!=1){
2950  printf("*ERROR saving the symmetry flag to the stiffness matrix file...");
2951  exit(0);
2952  }
2953  if(fwrite(nzs,sizeof(ITG),3,f1)!=3){
2954  printf("*ERROR saving the number of subdiagonal nonzeros to the stiffness matrix file...");
2955  exit(0);
2956  }
2957  if(fwrite(irow,sizeof(ITG),nzs[2],f1)!=nzs[2]){
2958  printf("*ERROR saving irow to the stiffness matrix file...");
2959  exit(0);
2960  }
2961  if(fwrite(jq,sizeof(ITG),neq[1]+1,f1)!=neq[1]+1){
2962  printf("*ERROR saving jq to the stiffness matrix file...");
2963  exit(0);
2964  }
2965  if(fwrite(icol,sizeof(ITG),neq[1],f1)!=neq[1]){
2966  printf("*ERROR saving icol to the stiffness matrix file...");
2967  exit(0);
2968  }
2969  if(fwrite(adcpy,sizeof(double),neq[1],f1)!=neq[1]){
2970  printf("*ERROR saving the diagonal of the stiffness matrix to the stiffness matrix file...");
2971  exit(0);
2972  }
2973  if(fwrite(aucpy,sizeof(double),(nasym+1)*nzs[2],f1)!=(nasym+1)*nzs[2]){
2974  printf("*ERROR saving the off-diagonal terms of the stiffness matrix to the stiffness matrix file...");
2975  exit(0);
2976  }
2977  fclose(f1);
2978  SFREE(adcpy);SFREE(aucpy);
2979  }
2980 
2981  /* restoring the distributed loading */
2982 
2983  if((*ithermal==3)&&(ncont!=0)&&(*mortar==1)&&(*ncmat_>=11)){
2984  *nload=nloadref;
2985  RENEW(nelemload,ITG,2**nload);memcpy(&nelemload[0],&nelemloadref[0],sizeof(ITG)*2**nload);
2986  if(*nam>0){
2987  RENEW(iamload,ITG,2**nload);
2988  memcpy(&iamload[0],&iamloadref[0],sizeof(ITG)*2**nload);
2989  }
2990  RENEW(sideload,char,20**nload);memcpy(&sideload[0],&sideloadref[0],sizeof(char)*20**nload);
2991 
2992  /* freeing the temporary fields */
2993 
2994  SFREE(nelemloadref);if(*nam>0){SFREE(iamloadref);};
2995  SFREE(sideloadref);
2996  }
2997 
2998  /* setting the velocity to zero at the end of a quasistatic or stationary
2999  step */
3000 
3001  if(abs(*nmethod)==1){
3002  for(k=0;k<mt**nk;++k){veold[k]=0.;}
3003  }
3004 
3005  /* updating the loading at the end of the step;
3006  important in case the amplitude at the end of the step
3007  is not equal to one */
3008 
3009  for(k=0;k<*nboun;++k){
3010 
3011  /* thermal boundary conditions are updated only if the
3012  step was thermal or thermomechanical */
3013 
3014  if(ndirboun[k]==0){
3015  if(*ithermal<2) continue;
3016 
3017  /* mechanical boundary conditions are updated only
3018  if the step was not thermal or the node is a
3019  network node */
3020 
3021  }else if((ndirboun[k]>0)&&(ndirboun[k]<4)){
3022  node=nodeboun[k];
3023  FORTRAN(nident,(itg,&node,&ntg,&id));
3024  networknode=0;
3025  if(id>0){
3026  if(itg[id-1]==node) networknode=1;
3027  }
3028  if((*ithermal==2)&&(networknode==0)) continue;
3029  }
3030  xbounold[k]=xbounact[k];
3031  }
3032  for(k=0;k<*nforc;++k){xforcold[k]=xforcact[k];}
3033  for(k=0;k<2**nload;++k){xloadold[k]=xloadact[k];}
3034  for(k=0;k<7**nbody;k=k+7){xbodyold[k]=xbodyact[k];}
3035  if(*ithermal==1){
3036  for(k=0;k<*nk;++k){t1old[k]=t1act[k];}
3037  for(k=0;k<*nk;++k){vold[mt*k]=t1act[k];}
3038  }
3039  else if(*ithermal>1){
3040  for(k=0;k<*nk;++k){t1[k]=vold[mt*k];}
3041  if(*ithermal>=3){
3042  for(k=0;k<*nk;++k){t1old[k]=t1act[k];}
3043  }
3044  }
3045 
3046  qaold[0]=qa[0];
3047  qaold[1]=qa[1];
3048 
3049  SFREE(f);SFREE(b);
3050  SFREE(xbounact);SFREE(xforcact);SFREE(xloadact);SFREE(xbodyact);
3051  if(*nbody>0) SFREE(ipobody);if(inewton==1){SFREE(cgr);}
3052  SFREE(fext);SFREE(ampli);SFREE(xbounini);SFREE(xstiff);
3053  if((*ithermal==1)||(*ithermal>=3)){SFREE(t1act);SFREE(t1ini);}
3054 
3055  if(*ithermal>1){
3056  SFREE(itg);SFREE(ieg);SFREE(kontri);SFREE(nloadtr);
3057  SFREE(nactdog);SFREE(nacteq);SFREE(ineighe);
3058  SFREE(tarea);SFREE(tenv);SFREE(fenv);SFREE(qfx);
3059  SFREE(erad);SFREE(ac);SFREE(bc);SFREE(ipiv);
3060  SFREE(bcr);SFREE(ipivr);SFREE(adview);SFREE(auview);SFREE(adrad);
3061  SFREE(aurad);SFREE(irowrad);SFREE(jqrad);SFREE(icolrad);
3062  if((*mcs>0)&&(ntr>0)){SFREE(inocs);}
3063  if((*network>0)||(ntg>0)){SFREE(iponoel);SFREE(inoel);}
3064  }
3065 
3066  if(icfd==1){
3067  SFREE(neifa);SFREE(neiel);SFREE(neij);SFREE(ielfa);SFREE(ifaext);
3068  SFREE(vel);SFREE(vfa);SFREE(nactdoh);SFREE(nactdohinv);SFREE(konf);
3069  SFREE(ipkonf);SFREE(lakonf);SFREE(ielmatf);free(ifatie);
3070  if(*norien>0) SFREE(ielorienf);
3071  if(nblk!=0){SFREE(istartblk);SFREE(iendblk);
3072  SFREE(nblket);SFREE(nblkze);SFREE(ielblk);}
3073  }
3074 
3075  SFREE(fini);
3076  if(*nmethod==4){
3077  SFREE(aux2);SFREE(fextini);SFREE(veini);SFREE(accini);
3078  SFREE(adb);SFREE(aub);SFREE(cvini);SFREE(cv);SFREE(fnext);
3079  SFREE(fnextini);
3080  }
3081  SFREE(eei);SFREE(stiini);SFREE(emeini);
3082  if(*nener==1)SFREE(enerini);
3083  if(*nstate_!=0){SFREE(xstateini);}
3084 
3085  SFREE(aux);SFREE(iaux);SFREE(vini);
3086 
3087  if(icascade==2){
3088  memmpc_=memmpcref_;mpcfree=mpcfreeref;maxlenmpc=maxlenmpcref;
3089  RENEW(nodempc,ITG,3*memmpcref_);
3090  for(k=0;k<3*memmpcref_;k++){nodempc[k]=nodempcref[k];}
3091  RENEW(coefmpc,double,memmpcref_);
3092  for(k=0;k<memmpcref_;k++){coefmpc[k]=coefmpcref[k];}
3093  SFREE(nodempcref);SFREE(coefmpcref);
3094  }
3095 
3096  if(ncont!=0){
3097  *ne=ne0;*nkon=nkon0;
3098  if(*nener==1){
3099  RENEW(ener,double,mi[0]**ne*2);
3100  }
3101  RENEW(ipkon,ITG,*ne);
3102  RENEW(lakon,char,8**ne);
3103  RENEW(kon,ITG,*nkon);
3104  if(*norien>0){
3105  RENEW(ielorien,ITG,mi[2]**ne);
3106  }
3107  RENEW(ielmat,ITG,mi[2]**ne);
3108 
3109  SFREE(cg);SFREE(straight);
3110  SFREE(imastop);SFREE(itiefac);SFREE(islavnode);
3111  SFREE(nslavnode);SFREE(iponoels);SFREE(inoels);SFREE(imastnode);
3112  SFREE(nmastnode);SFREE(itietri);SFREE(koncont);SFREE(xnoels);
3113  SFREE(springarea);SFREE(xmastnor);
3114 
3115  if(*mortar==0){
3116  SFREE(areaslav);
3117  }else if(*mortar==1){
3118  SFREE(pmastsurf);SFREE(ipe);SFREE(ime);
3119  SFREE(islavact);
3120  }
3121  }
3122 
3123  /* reset icascade */
3124 
3125  if(icascade==1){icascade=0;}
3126 
3127  mpcinfo[0]=memmpc_;mpcinfo[1]=mpcfree;mpcinfo[2]=icascade;
3128  mpcinfo[3]=maxlenmpc;
3129 
3130  if(iglob==1){SFREE(integerglob);SFREE(doubleglob);}
3131 
3132  *icolp=icol;*irowp=irow;*cop=co;*voldp=vold;
3133 
3134  *ipompcp=ipompc;*labmpcp=labmpc;*ikmpcp=ikmpc;*ilmpcp=ilmpc;
3135  *fmpcp=fmpc;*nodempcp=nodempc;*coefmpcp=coefmpc;*nelemloadp=nelemload;
3136  *iamloadp=iamload;*sideloadp=sideload;
3137 
3138  *ipkonp=ipkon;*lakonp=lakon;*konp=kon;*ielorienp=ielorien;
3139  *ielmatp=ielmat;*enerp=ener;*xstatep=xstate;
3140 
3141  *islavsurfp=islavsurf;*pslavsurfp=pslavsurf;*clearinip=clearini;
3142 
3143  (*tmin)*=(*tper);
3144  (*tmax)*=(*tper);
3145 
3146  SFREE(nactdofinv);
3147  // MPADD start
3148  if((*nmethod==4)&&(*ithermal!=2)&&(*iexpl<=1)&&(icfd!=1)){ SFREE(adblump);}
3149  // MPADD end
3150 
3151  (*ttime)+=(*tper);
3152 
3153  return;
3154 }
subroutine checktime(itpamp, namta, tinc, ttime, amta, tmin, inext, itp, istep, tper)
Definition: checktime.f:21
subroutine negativepressure(ne0, ne, mi, stx, pressureratio)
Definition: negativepressure.f:20
#define ITGFORMAT
Definition: CalculiX.h:52
void pardiso_main(double *ad, double *au, double *adb, double *aub, double *sigma, double *b, ITG *icol, ITG *irow, ITG *neq, ITG *nzs, ITG *symmetryflag, ITG *inputformat, ITG *jq, ITG *nzs3)
subroutine precfd(ne, ipkon, kon, lakon, ipnei, neifa, neiel, ipoface, nodface, ielfa, nflnei, nface, ifaext, nfaext, isolidsurf, nsolidsurf, set, nset, istartset, iendset, ialset, vel, vold, mi, neij, nef, nactdoh, ipkonf, lakonf, ielmatf, ielmat, ielorienf, ielorien, norien, cs, mcs, tieset, x, y, z, xo, yo, zo, nx, ny, nz, co, ifatie)
Definition: precfd.f:25
subroutine calcstabletimeincvol(ne0, lakon, co, kon, ipkon, mi, ielmat, dtvol, alpha, wavespeed)
Definition: calcstabletimeincvol.f:21
void frd(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne0, double *v, double *stn, ITG *inum, ITG *nmethod, ITG *kode, char *filab, double *een, double *t1, double *fn, double *time, double *epn, ITG *ielmat, char *matname, double *enern, double *xstaten, ITG *nstate_, ITG *istep, ITG *iinc, ITG *ithermal, double *qfn, ITG *mode, ITG *noddiam, double *trab, ITG *inotr, ITG *ntrans, double *orab, ITG *ielorien, ITG *norien, char *description, ITG *ipneigh, ITG *neigh, ITG *mi, double *stx, double *vr, double *vi, double *stnr, double *stni, double *vmax, double *stnmax, ITG *ngraph, double *veold, double *ener, ITG *ne, double *cs, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, double *eenmax, double *fnr, double *fni, double *emn, double *thicke, char *jobnamec, char *output, double *qfx, double *cdn, ITG *mortar, double *cdnr, double *cdni, ITG *nmat)
Definition: frd.c:32
subroutine checktruecontact(ntie, tieset, tietol, elcon, itruecontact, ncmat_, ntmat_)
Definition: checktruecontact.f:21
void mafillsmmain(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, ITG *nmpc, ITG *nodeforc, ITG *ndirforc, double *xforc, ITG *nforc, ITG *nelemload, char *sideload, double *xload, ITG *nload, double *xbody, ITG *ipobody, ITG *nbody, double *cgr, double *ad, double *au, double *bb, ITG *nactdof, ITG *icol, ITG *jq, ITG *irow, ITG *neq, ITG *nzl, ITG *nmethod, ITG *ikmpc, ITG *ilmpc, ITG *ikboun, ITG *ilboun, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, double *prestr, ITG *iprestr, double *vold, ITG *iperturb, double *sti, ITG *nzs, double *stx, double *adb, double *aub, ITG *iexpl, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstiff, ITG *npmat_, double *dtime, char *matname, ITG *mi, ITG *ncmat_, ITG *mass, ITG *stiffness, ITG *buckling, ITG *rhs, ITG *intscheme, double *physcon, double *shcon, ITG *nshcon, double *cocon, ITG *ncocon, double *ttime, double *time, ITG *istep, ITG *kinc, ITG *coriolis, ITG *ibody, double *xloadold, double *reltime, double *veold, double *springarea, ITG *nstate_, double *xstateini, double *xstate, double *thicke, ITG *integerglob, double *doubleglob, char *tieset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *ntie, ITG *nasym, double *pslavsurf, double *pmastsurf, ITG *mortar, double *clearini, ITG *ielprop, double *prop, ITG *ne0, double *fnext, ITG *kscale, ITG *iponoel, ITG *inoel, ITG *network)
Definition: mafillsmmain.c:47
void preiter(double *ad, double **aup, double *b, ITG **icolp, ITG **irowp, ITG *neq, ITG *nzs, ITG *isolver, ITG *iperturb)
Definition: preiter.c:23
subroutine storecontactprop(ne, ne0, lakon, kon, ipkon, mi, ielmat, elcon, mortar, adb, nactdof, springarea, ncmat_, ntmat_, stx, temax)
Definition: storecontactprop.f:22
void inicont(ITG *nk, ITG *ncont, ITG *ntie, char *tieset, ITG *nset, char *set, ITG *istartset, ITG *iendset, ITG *ialset, ITG **itietrip, char *lakon, ITG *ipkon, ITG *kon, ITG **koncontp, ITG *ncone, double *tietol, ITG *ismallsliding, ITG **itiefacp, ITG **islavsurfp, ITG **islavnodep, ITG **imastnodep, ITG **nslavnodep, ITG **nmastnodep, ITG *mortar, ITG **imastopp, ITG *nkon, ITG **iponoels, ITG **inoelsp, ITG **ipep, ITG **imep, ITG *ne, ITG *ifacecount, ITG *iperturb, ITG *ikboun, ITG *nboun, double *co, ITG *istep, double **xnoelsp)
Definition: inicont.c:24
subroutine mafilldm(co, nk, kon, ipkon, lakon, ne, nodeboun, ndirboun, xboun, nboun, ipompc, nodempc, coefmpc, nmpc, nodeforc, ndirforc, xforc, nforc, nelemload, sideload, xload, nload, xbody, ipobody, nbody, cgr, ad, au, nactdof, icol, jq, irow, neq, nzl, nmethod, ikmpc, ilmpc, ikboun, ilboun, elcon, nelcon, rhcon, nrhcon, alcon, nalcon, alzero, ielmat, ielorien, norien, orab, ntmat_, t0, t1, ithermal, prestr, iprestr, vold, iperturb, sti, nzs, stx, adb, aub, iexpl, plicon, nplicon, plkcon, nplkcon, xstiff, npmat_, dtime, matname, mi, ncmat_, ttime, time, istep, iinc, ibody, clearini, mortar, springarea, pslavsurf, pmastsurf, reltime, nasym)
Definition: mafilldm.f:31
ITG strcpy1(char *s1, const char *s2, ITG length)
Definition: strcpy1.c:24
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
subroutine writecvg(istep, iinc, icutb, iit, ne, ne0, ram, qam, cam, uam, ithermal)
Definition: writecvg.f:21
subroutine op(n, x, y, ad, au, jq, irow)
Definition: op.f:26
ITG strcmp1(const char *s1, const char *s2)
Definition: strcmp1.c:24
void mastructrad(ITG *ntr, ITG *nloadtr, char *sideload, ITG *ipointerrad, ITG **mast1radp, ITG **irowradp, ITG *nzsrad, ITG *jqrad, ITG *icolrad)
Definition: mastructrad.c:24
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: precontact.c:24
subroutine tempload(xforcold, xforc, xforcact, iamforc, nforc, xloadold, xload, xloadact, iamload, nload, ibody, xbody, nbody, xbodyold, xbodyact, t1old, t1, t1act, iamt1, nk, amta, namta, nam, ampli, time, reltime, ttime, dtime, ithermal, nmethod, xbounold, xboun, xbounact, iamboun, nboun, nodeboun, ndirboun, nodeforc, ndirforc, istep, iinc, co, vold, itg, ntg, amname, ikboun, ilboun, nelemload, sideload, mi, ntrans, trab, inotr, veold, integerglob, doubleglob, tieset, istartset, iendset, ialset, ntie, nmpc, ipompc, ikmpc, ilmpc, nodempc, coefmpc, ipobody, iponoel, inoel)
Definition: tempload.f:29
#define DMEMSET(a, b, c, d)
Definition: CalculiX.h:45
void spooles(double *ad, double *au, double *adb, double *aub, double *sigma, double *b, ITG *icol, ITG *irow, ITG *neq, ITG *nzs, ITG *symmtryflag, ITG *inputformat, ITG *nzs3)
subroutine stop()
Definition: stop.f:20
void radflowload(ITG *itg, ITG *ieg, ITG *ntg, ITG *ntr, double *adrad, double *aurad, double *bcr, ITG *ipivr, double *ac, double *bc, ITG *nload, char *sideload, ITG *nelemload, double *xloadact, char *lakon, ITG *ipiv, ITG *ntmat_, double *vold, double *shcon, ITG *nshcon, ITG *ipkon, ITG *kon, double *co, ITG *kontri, ITG *ntri, ITG *nloadtr, double *tarea, double *tenv, double *physcon, double *erad, double **adviewp, double **auviewp, ITG *nflow, ITG *ikboun, double *xboun, ITG *nboun, ITG *ithermal, ITG *iinc, ITG *iit, double *cs, ITG *mcs, ITG *inocs, ITG *ntrit, ITG *nk, double *fenv, ITG *istep, double *dtime, double *ttime, double *time, ITG *ilboun, ITG *ikforc, ITG *ilforc, double *xforc, ITG *nforc, double *cam, ITG *ielmat, ITG *nteq, double *prop, ITG *ielprop, ITG *nactdog, ITG *nacteq, ITG *nodeboun, ITG *ndirboun, ITG *network, double *rhcon, ITG *nrhcon, ITG *ipobody, ITG *ibody, double *xbody, ITG *nbody, ITG *iviewfile, char *jobnamef, double *ctrl, double *xloadold, double *reltime, ITG *nmethod, char *set, ITG *mi, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nset, ITG *ineighe, ITG *nmpc, ITG *nodempc, ITG *ipompc, double *coefmpc, char *labmpc, ITG *iemchange, ITG *nam, ITG *iamload, ITG *jqrad, ITG *irowrad, ITG *nzsrad, ITG *icolrad, ITG *ne, ITG *iaxial, double *qa, double *cocon, ITG *ncocon, ITG *iponoel, ITG *inoel, ITG *nprop, char *amname, ITG *namta, double *amta)
Definition: radflowload.c:45
void tau(double *ad, double **aup, double *adb, double *aubp, double *sigma, double *b, ITG *icol, ITG **irowp, ITG *neq, ITG *nzs)
void radcyc(ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, double *cs, ITG *mcs, ITG *nkon, ITG *ialset, ITG *istartset, ITG *iendset, ITG **kontrip, ITG *ntri, double **cop, double **voldp, ITG *ntrit, ITG *inocs, ITG *mi)
Definition: radcyc.c:24
void sgi_main(double *ad, double *au, double *adb, double *aub, double *sigma, double *b, ITG *icol, ITG *irow, ITG *neq, ITG *nzs, ITG token)
void contact(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, ITG *ifree, double *co, double *vold, ITG *ielmat, double *cs, double *elcon, ITG *istep, ITG *iinc, ITG *iit, ITG *ncmat_, ITG *ntmat_, ITG *ne0, double *vini, ITG *nmethod, ITG *iperturb, ITG *ikboun, ITG *nboun, ITG *mi, ITG *imastop, ITG *nslavnode, ITG *islavnode, ITG *islavsurf, ITG *itiefac, double *areaslav, ITG *iponoels, ITG *inoels, double *springarea, double *tietol, double *reltime, ITG *imastnode, ITG *nmastnode, double *xmastnor, char *filab, ITG *mcs, ITG *ics, ITG *nasym, double *xnoels, ITG *mortar, double *pslavsurf, double *pmastsurf, double *clearini, double *theta, double *xstateini, double *xstate, ITG *nstate_, ITG *icutb, ITG *ialeatoric, char *jobnamef)
Definition: contact.c:23
#define RENEW(a, b, c)
Definition: CalculiX.h:40
#define SFREE(a)
Definition: CalculiX.h:41
subroutine gennactdofinv(nactdof, nactdofinv, nk, mi, nodorig, ipkon, lakon, kon, ne)
Definition: gennactdofinv.f:21
subroutine frictionheating(ne0, ne, ipkon, lakon, ielmat, mi, elcon, ncmat_, ntmat_, kon, islavsurf, pmastsurf, springarea, co, vold, veold, pslavsurf, xloadact, nload, nload_, nelemload, iamload, idefload, sideload, stx, nam)
Definition: frictionheating.f:23
subroutine islavactive(tieset, ntie, itietri, cg, straight, co, vold, xo, yo, zo, x, y, z, nx, ny, nz, mi, imastop, nslavnode, islavnode, islavact)
Definition: islavactive.f:26
subroutine opas(n, x, y, ad, au, jq, irow, nzs)
Definition: opas.f:26
void frdcyc(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, double *v, double *stn, ITG *inum, ITG *nmethod, ITG *kode, char *filab, double *een, double *t1, double *fn, double *time, double *epn, ITG *ielmat, char *matname, double *cs, ITG *mcs, ITG *nkon, double *enern, double *xstaten, ITG *nstate_, ITG *istep, ITG *iinc, ITG *iperturb, double *ener, ITG *mi, char *output, ITG *ithermal, double *qfn, ITG *ialset, ITG *istartset, ITG *iendset, double *trab, ITG *inotr, ITG *ntrans, double *orab, ITG *ielorien, ITG *norien, double *sti, double *veold, ITG *noddiam, char *set, ITG *nset, double *emn, double *thicke, char *jobnamec, ITG *ne0, double *cdn, ITG *mortar, ITG *nmat, double *qfx)
Definition: frdcyc.c:24
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, ITG *network)
Definition: remastruct.c:24
subroutine blockanalysis(set, nset, istartset, iendset, ialset, nblk, ipkon, kon, ielfa, nodface, neiel, neij, neifa, ipoface, ipnei, konf, istartblk, iendblk, nactdoh, nblket, nblkze, neielsize, ielblk, nk, nactdohinv)
Definition: blockanalysis.f:23
static double * f1
Definition: objectivemain_se.c:47
subroutine predgmres_struct(n, b, x, nelt, ia, ja, a, isym, itol, tol, itmax, iter, err, ierr, iunit, sb, sx, rgwk, lrgw, igwk, ligw, rwork, iwork)
Definition: predgmres_struct.f:28
static double * adview
Definition: radflowload.c:42
subroutine nident(x, px, n, id)
Definition: nident.f:26
void getglobalresults(char *jobnamec, ITG **integerglobp, double **doubleglobp, ITG *nboun, ITG *iamboun, double *xboun, ITG *nload, char *sideload, ITG *iamload, ITG *iglob, ITG *nforc, ITG *iamforc, double *xforc, ITG *ithermal, ITG *nk, double *t1, ITG *iamt1)
Definition: getglobalresults.c:29
void prediction(double *uam, ITG *nmethod, double *bet, double *gam, double *dtime, ITG *ithermal, ITG *nk, double *veold, double *accold, double *v, ITG *iinc, ITG *idiscon, double *vold, ITG *nactdof, ITG *mi)
Definition: prediction.c:33
real *8 function f_cm(x, phi, lambda1, zk0, Pup, Tup, rurd, xflow, kup)
Definition: moehring.f:582
subroutine nonlinmpc(co, vold, ipompc, nodempc, coefmpc, labmpc, nmpc, ikboun, ilboun, nboun, xbounact, aux, iaux, maxlenmpc, ikmpc, ilmpc, icascade, kon, ipkon, lakon, ne, reltime, newstep, xboun, fmpc, iit, idiscon, ncont, trab, ntrans, ithermal, mi)
Definition: nonlinmpc.f:23
void compfluid(double **cop, ITG *nk, ITG **ipkonp, ITG *konf, char **lakonp, char **sideface, ITG *ifreestream, ITG *nfreestream, ITG *isolidsurf, ITG *neighsolidsurf, ITG *nsolidsurf, ITG *nshcon, double *shcon, ITG *nrhcon, double *rhcon, double **voldp, ITG *ntmat_, ITG *nodeboun, ITG *ndirboun, ITG *nboun, ITG *ipompc, ITG *nodempc, ITG *nmpc, ITG *ikmpc, ITG *ilmpc, ITG *ithermal, ITG *ikboun, ITG *ilboun, ITG *turbulent, ITG *isolver, ITG *iexpl, double *ttime, double *time, double *dtime, ITG *nodeforc, ITG *ndirforc, double *xforc, ITG *nforc, ITG *nelemload, char *sideload, double *xload, ITG *nload, double *xbody, ITG *ipobody, ITG *nbody, ITG *ielmatf, char *matname, ITG *mi, ITG *ncmat_, double *physcon, ITG *istep, ITG *iinc, ITG *ibody, double *xloadold, double *xboun, double *coefmpc, ITG *nmethod, double *xforcold, double *xforcact, ITG *iamforc, ITG *iamload, double *xbodyold, double *xbodyact, double *t1old, double *t1, double *t1act, ITG *iamt1, double *amta, ITG *namta, ITG *nam, double *ampli, double *xbounold, double *xbounact, ITG *iamboun, ITG *itg, ITG *ntg, char *amname, double *t0, ITG **nelemface, ITG *nface, double *cocon, ITG *ncocon, double *xloadact, double *tper, ITG *jmax, ITG *jout, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *prset, char *prlab, ITG *nprint, double *trab, ITG *inotr, ITG *ntrans, char *filab, char *labmpc, double *sti, ITG *norien, double *orab, char *jobnamef, char *tieset, ITG *ntie, ITG *mcs, ITG *ics, double *cs, ITG *nkon, ITG *mpcfree, ITG *memmpc_, double *fmpc, ITG *nef, ITG **inomat, double *qfx, ITG *neifa, ITG *neiel, ITG *ielfa, ITG *ifaext, double *vfa, double *vel, ITG *ipnei, ITG *nflnei, ITG *nfaext, char *typeboun, ITG *neij, double *tincf, ITG *nactdoh, ITG *nactdohinv, ITG *ielorien, char *jobnamec, ITG *ifatie, ITG *nstate_, double *xstate, char *orname, ITG *nblk, ITG *ielblk, ITG *istartblk, ITG *iendblk, ITG *nblket, ITG *nblkze, ITG *kon)
Definition: compfluid.c:39
subroutine mafillsmas(co, nk, kon, ipkon, lakon, ne, nodeboun, ndirboun, xboun, nboun, ipompc, nodempc, coefmpc, nmpc, nodeforc, ndirforc, xforc, nforc, nelemload, sideload, xload, nload, xbody, ipobody, nbody, cgr, ad, au, bb, nactdof, icol, jq, irow, neq, nzl, nmethod, ikmpc, ilmpc, ikboun, ilboun, elcon, nelcon, rhcon, nrhcon, alcon, nalcon, alzero, ielmat, ielorien, norien, orab, ntmat_, t0, t1, ithermal, prestr, iprestr, vold, iperturb, sti, nzs, stx, adb, aub, iexpl, plicon, nplicon, plkcon, nplkcon, xstiff, npmat_, dtime, matname, mi, ncmat_, mass, stiffness, buckling, rhsi, intscheme, physcon, shcon, nshcon, cocon, ncocon, ttime, time, istep, iinc, coriolis, ibody, xloadold, reltime, veold, springarea, nstate_, xstateini, xstate, thicke, integerglob, doubleglob, tieset, istartset, iendset, ialset, ntie, nasym, pslavsurf, pmastsurf, mortar, clearini, ielprop, prop, ne0, kscale, iponoel, inoel, network)
Definition: mafillsmas.f:36
void calcresidual(ITG *nmethod, ITG *neq, double *b, double *fext, double *f, ITG *iexpl, ITG *nactdof, double *aux2, double *vold, double *vini, double *dtime, double *accold, ITG *nk, double *adb, double *aub, ITG *jq, ITG *irow, ITG *nzl, double *alpha, double *fextini, double *fini, ITG *islavnode, ITG *nslavnode, ITG *mortar, ITG *ntie, double *f_cm, double *f_cs, ITG *mi, ITG *nzs, ITG *nasym, ITG *idamping, double *veold, double *adc, double *auc, double *cvini, double *cv)
Definition: calcresidual.c:33
subroutine envtemp(itg, ieg, ntg, ntr, sideload, nelemload, ipkon, kon, lakon, ielmat, ne, nload, kontri, ntri, nloadtr, nflow, ndirboun, nactdog, nodeboun, nacteq, nboun, ielprop, prop, nteq, v, network, physcon, shcon, ntmat_, co, vold, set, nshcon, rhcon, nrhcon, mi, nmpc, nodempc, ipompc, labmpc, ikboun, nasym, ttime, time, iaxial)
Definition: envtemp.f:25
subroutine gasmechbc(vold, nload, sideload, nelemload, xload, mi)
Definition: gasmechbc.f:21
subroutine calcstabletimeinccont(ne, lakon, kon, ipkon, mi, ielmat, elcon, mortar, adb, alpha, nactdof, springarea, ne0, ntmat_, ncmat_, dtcont)
Definition: calcstabletimeinccont.f:22
subroutine networkelementpernode(iponoel, inoel, lakon, ipkon, kon, inoelsize, nflow, ieg, ne, network)
Definition: networkelementpernode.f:21
subroutine rhs(co, nk, kon, ipkon, lakon, ne, ipompc, nodempc, coefmpc, nmpc, nodeforc, ndirforc, xforc, nforc, nelemload, sideload, xload, nload, xbody, ipobody, nbody, cgr, fext, nactdof, neq, nmethod, ikmpc, ilmpc, elcon, nelcon, rhcon, nrhcon, alcon, nalcon, alzero, ielmat, ielorien, norien, orab, ntmat_, t0, t1, ithermal, iprestr, vold, iperturb, iexpl, plicon, nplicon, plkcon, nplkcon, npmat_, ttime, time, istep, iinc, dtime, physcon, ibody, xloadold, reltime, veold, matname, mi, ikactmech, nactmech, ielprop, prop, sti, xstateini, xstate, nstate_)
Definition: rhs.f:29
void checkconvergence(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, double *stn, ITG *nmethod, ITG *kode, char *filab, double *een, double *t1act, double *time, double *epn, ITG *ielmat, char *matname, double *enern, double *xstaten, ITG *nstate_, ITG *istep, ITG *iinc, ITG *iperturb, double *ener, ITG *mi, char *output, ITG *ithermal, double *qfn, ITG *mode, ITG *noddiam, double *trab, ITG *inotr, ITG *ntrans, double *orab, ITG *ielorien, ITG *norien, char *description, double *sti, ITG *icutb, ITG *iit, double *dtime, double *qa, double *vold, double *qam, double *ram1, double *ram2, double *ram, double *cam, double *uam, ITG *ntg, double *ttime, ITG *icntrl, double *theta, double *dtheta, double *veold, double *vini, ITG *idrct, double *tper, ITG *istab, double *tmax, ITG *nactdof, double *b, double *tmin, double *ctrl, double *amta, ITG *namta, ITG *itpamp, ITG *inext, double *dthetaref, ITG *itp, ITG *jprint, ITG *jout, ITG *uncoupled, double *t1, ITG *iitterm, ITG *nelemload, ITG *nload, ITG *nodeboun, ITG *nboun, ITG *itg, ITG *ndirboun, double *deltmx, ITG *iflagact, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, double *emn, double *thicke, char *jobnamec, ITG *mortar, ITG *nmat, ITG *ielprop, double *prop, ITG *ialeatoric, ITG *kscale, double *energy, double *allwk, double *energyref, double *emax, double *enres, double *enetoll, double *energyini, double *allwkini, double *temax, double *reswk, ITG *ne0, ITG *neini, double *dampwk, double *dampwkini, double *energystartstep)
Definition: checkconvergence.c:34
#define ITG
Definition: CalculiX.h:51
void results(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, double *v, double *stn, ITG *inum, double *stx, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, double *prestr, ITG *iprestr, char *filab, double *eme, double *emn, double *een, ITG *iperturb, double *f, double *fn, ITG *nactdof, ITG *iout, double *qa, double *vold, double *b, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, char *labmpc, ITG *nmpc, ITG *nmethod, double *vmax, ITG *neq, double *veold, double *accold, double *beta, double *gamma, double *dtime, double *time, double *ttime, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstateini, double *xstiff, double *xstate, ITG *npmat_, double *epl, char *matname, ITG *mi, ITG *ielas, ITG *icmd, ITG *ncmat_, ITG *nstate_, double *stiini, double *vini, ITG *ikboun, ITG *ilboun, double *ener, double *enern, double *emeini, double *xstaten, double *eei, double *enerini, double *cocon, ITG *ncocon, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nprint, char *prlab, char *prset, double *qfx, double *qfn, double *trab, ITG *inotr, ITG *ntrans, double *fmpc, ITG *nelemload, ITG *nload, ITG *ikmpc, ITG *ilmpc, ITG *istep, ITG *iinc, double *springarea, double *reltime, ITG *ne0, double *xforc, ITG *nforc, double *thicke, double *shcon, ITG *nshcon, char *sideload, double *xload, double *xloadold, ITG *icfd, ITG *inomat, double *pslavsurf, double *pmastsurf, ITG *mortar, ITG *islavact, double *cdn, ITG *islavnode, ITG *nslavnode, ITG *ntie, double *clearini, ITG *islavsurf, ITG *ielprop, double *prop, double *energyini, double *energy, ITG *kscale, ITG *iponoel, ITG *inoel, ITG *nener, char *orname, ITG *network, ITG *ipobody, double *xbodyact, ITG *ibody)
Definition: results.c:42
void checkdivergence(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, double *stn, ITG *nmethod, ITG *kode, char *filab, double *een, double *t1act, double *time, double *epn, ITG *ielmat, char *matname, double *enern, double *xstaten, ITG *nstate_, ITG *istep, ITG *iinc, ITG *iperturb, double *ener, ITG *mi, char *output, ITG *ithermal, double *qfn, ITG *mode, ITG *noddiam, double *trab, ITG *inotr, ITG *ntrans, double *orab, ITG *ielorien, ITG *norien, char *description, double *sti, ITG *icutb, ITG *iit, double *dtime, double *qa, double *vold, double *qam, double *ram1, double *ram2, double *ram, double *cam, double *uam, ITG *ntg, double *ttime, ITG *icntrl, double *theta, double *dtheta, double *veold, double *vini, ITG *idrct, double *tper, ITG *istab, double *tmax, ITG *nactdof, double *b, double *tmin, double *ctrl, double *amta, ITG *namta, ITG *itpamp, ITG *inext, double *dthetaref, ITG *itp, ITG *jprint, ITG *jout, ITG *uncoupled, double *t1, ITG *iitterm, ITG *nelemload, ITG *nload, ITG *nodeboun, ITG *nboun, ITG *itg, ITG *ndirboun, double *deltmx, ITG *iflagact, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, double *emn, double *thicke, char *jobnamec, ITG *mortar, ITG *nmat, ITG *ielprop, double *prop, ITG *ialeatoric, ITG *kscale, double *energy, double *allwk, double *energyref, double *emax, double *enres, double *enetoll, double *energyini, double *allwkini, double *temax, double *reswk, ITG *ne0, ITG *neini, double *dampwk, double *dampwkini, double *energystartstep)
Definition: checkdivergence.c:32
#define NNEW(a, b, c)
Definition: CalculiX.h:39
subroutine interpolatestate(ne, ipkon, kon, lakon, ne0, mi, xstate, pslavsurf, nstate_, xstateini, islavsurf, islavsurfold, pslavsurfold, tieset, ntie, itiefac)
Definition: interpolatestate.f:31
subroutine bodyforce(cbody, ibody, ipobody, nbody, set, istartset, iendset, ialset, inewton, nset, ifreebody, k)
Definition: bodyforce.f:21
subroutine calcmatwavspeed(ne0, elcon, nelcon, rhcon, nrhcon, alcon, nalcon, orab, ntmat_, ithermal, alzero, plicon, nplicon, plkcon, nplkcon, npmat_, mi, dtime, xstiff, ncmat_, vold, ielmat, t0, t1, matname, lakon, wavespeed, nmat, ipkon)
Definition: calcmatwavspeed.f:24
static double * auview
Definition: radflowload.c:42
subroutine mafillsm_company(co, nk, kon, ipkon, lakon, ne, nodeboun, ndirboun, xboun, nboun, ipompc, nodempc, coefmpc, nmpc, nodeforc, ndirforc, xforc, nforc, nelemload, sideload, xload, nload, xbody, ipobody, nbody, cgr, ad, au, fext, nactdof, icol, jq, irow, neq, nzl, nmethod, ikmpc, ilmpc, ikboun, ilboun, elcon, nelcon, rhcon, nrhcon, alcon, nalcon, alzero, ielmat, ielorien, norien, orab, ntmat_, t0, t1, ithermal, prestr, iprestr, vold, iperturb, sti, nzs, stx, adb, aub, iexpl, plicon, nplicon, plkcon, nplkcon, xstiff, npmat_, dtime, matname, mi, ncmat_, mass, stiffness, buckling, rhsi, intscheme, physcon, shcon, nshcon, cocon, ncocon, ttime, time, istep, iinc, coriolis, ibody, xloadold, reltime, veold, springarea, nstate_, xstateini, xstate, thicke, integerglob, doubleglob, tieset, istartset, iendset, ialset, ntie, nasym, pslavsurf, pmastsurf, mortar, clearini, ielprop, prop, ne0, fnext, kscale, iponoel, inoel, network)
Definition: mafillsm_company.f:36

◆ objectivemain_se()

void objectivemain_se ( double *  co,
ITG nk,
ITG kon,
ITG ipkon,
char *  lakon,
ITG ne,
double *  v,
double *  stn,
ITG inum,
double *  stx,
double *  elcon,
ITG nelcon,
double *  rhcon,
ITG nrhcon,
double *  alcon,
ITG nalcon,
double *  alzero,
ITG ielmat,
ITG ielorien,
ITG norien,
double *  orab,
ITG ntmat_,
double *  t0,
double *  t1,
ITG ithermal,
double *  prestr,
ITG iprestr,
char *  filab,
double *  eme,
double *  emn,
double *  een,
ITG iperturb,
double *  f,
double *  fn,
ITG nactdof,
ITG iout,
double *  qa,
double *  vold,
ITG nodeboun,
ITG ndirboun,
double *  xboun,
ITG nboun,
ITG ipompc,
ITG nodempc,
double *  coefmpc,
char *  labmpc,
ITG nmpc,
ITG nmethod,
double *  cam,
ITG neq,
double *  veold,
double *  accold,
double *  bet,
double *  gam,
double *  dtime,
double *  time,
double *  ttime,
double *  plicon,
ITG nplicon,
double *  plkcon,
ITG nplkcon,
double *  xstateini,
double *  xstiff,
double *  xstate,
ITG npmat_,
double *  epn,
char *  matname,
ITG mi,
ITG ielas,
ITG icmd,
ITG ncmat_,
ITG nstate_,
double *  stiini,
double *  vini,
ITG ikboun,
ITG ilboun,
double *  ener,
double *  enern,
double *  emeini,
double *  xstaten,
double *  eei,
double *  enerini,
double *  cocon,
ITG ncocon,
char *  set,
ITG nset,
ITG istartset,
ITG iendset,
ITG ialset,
ITG nprint,
char *  prlab,
char *  prset,
double *  qfx,
double *  qfn,
double *  trab,
ITG inotr,
ITG ntrans,
double *  fmpc,
ITG nelemload,
ITG nload,
ITG ikmpc,
ITG ilmpc,
ITG istep,
ITG iinc,
double *  springarea,
double *  reltime,
ITG ne0,
double *  xforc,
ITG nforc,
double *  thicke,
double *  shcon,
ITG nshcon,
char *  sideload,
double *  xload,
double *  xloadold,
ITG icfd,
ITG inomat,
double *  pslavsurf,
double *  pmastsurf,
ITG mortar,
ITG islavact,
double *  cdn,
ITG islavnode,
ITG nslavnode,
ITG ntie,
double *  clearini,
ITG islavsurf,
ITG ielprop,
double *  prop,
double *  energyini,
double *  energy,
double *  distmin,
ITG ndesi,
ITG nodedesi,
ITG nobject,
char *  objectset,
double *  g0,
double *  dgdx,
double *  sti,
double *  df,
ITG nactdofinv,
ITG jqs,
ITG irows,
ITG idisplacement,
ITG nzs,
char *  jobnamec,
ITG isolver,
ITG icol,
ITG irow,
ITG jq,
ITG kode,
double *  cs,
char *  output,
ITG istartdesi,
ITG ialdesi,
double *  xdesi,
char *  orname,
ITG icoordinate,
ITG iev,
double *  d,
double *  z,
double *  au,
double *  ad,
double *  aub,
double *  adb,
ITG cyclicsymmetry,
ITG nzss,
ITG nev,
ITG ishapeenergy,
double *  fint,
ITG nlabel,
ITG igreen,
ITG nasym,
ITG iponoel,
ITG inoel,
ITG nodedesiinv,
double *  dgdxglob 
)
93  {
94 
95  char description[13]=" ",cflag[1]=" ",*filabl=NULL;
96 
97  ITG calcul_qa,nener=0,ikin,i,j,k,m,iobject,im,symmetryflag=0,inputformat=0,
98  mt=mi[1]+1,mode=-1,noddiam=-1,ngraph=1,idesvar,nea,neb,nodeset,lmax,
99  kscale=1,idir,iorien,network=0,inorm=0,irand=0,*neinset=NULL,
100  nepar,isum,idelta,*neapar=NULL,*nebpar=NULL,nestart,neend,num_cpus,
101  l;
102 
103  double sigma=0.,ptime=0.,*temp=NULL,*bfix=NULL,*vnew=NULL,*dstn=NULL,
104  freq,*c=NULL,orabsav[7],rotvec[3],a[9],pgauss[3],*b=NULL,
105  *vec=NULL;
106 
107  if(*nasym!=0){symmetryflag=2;inputformat=1;}
108 
109  /* variables for multithreading procedure */
110 
111  ITG sys_cpus,*ithread=NULL;
112  char *env,*envloc,*envsys;
113 
114  num_cpus=0;
115  sys_cpus=0;
116 
117  /* explicit user declaration prevails */
118 
119  envsys=getenv("NUMBER_OF_CPUS");
120  if(envsys){
121  sys_cpus=atoi(envsys);
122  if(sys_cpus<0) sys_cpus=0;
123  }
124 
125  /* automatic detection of available number of processors */
126 
127  if(sys_cpus==0){
128  sys_cpus = getSystemCPUs();
129  if(sys_cpus<1) sys_cpus=1;
130  }
131 
132  /* local declaration prevails, if strictly positive */
133 
134  envloc = getenv("CCX_NPROC_RESULTS");
135  if(envloc){
136  num_cpus=atoi(envloc);
137  if(num_cpus<0){
138  num_cpus=0;
139  }else if(num_cpus>sys_cpus){
140  num_cpus=sys_cpus;
141  }
142 
143  }
144 
145  /* else global declaration, if any, applies */
146 
147  env = getenv("OMP_NUM_THREADS");
148  if(num_cpus==0){
149  if (env)
150  num_cpus = atoi(env);
151  if (num_cpus < 1) {
152  num_cpus=1;
153  }else if(num_cpus>sys_cpus){
154  num_cpus=sys_cpus;
155  }
156  }
157 
158  pthread_t tid[num_cpus];
159 
160  if((*idisplacement==1)||((*ishapeenergy==1)&&(iperturb[1]==1))){
161 
162  /* factor the system */
163 
164  if(*isolver==0){
165 #ifdef SPOOLES
166  spooles_factor(ad,au,adb,aub,&sigma,icol,irow,&neq[1],&nzs[1],
167  &symmetryflag,&inputformat,&nzs[2]);
168 #else
169  printf("*ERROR in objectivemain_se: the SPOOLES library is not linked\n\n");
170  FORTRAN(stop,());
171 #endif
172  }
173  else if(*isolver==4){
174 #ifdef SGI
175  token=1;
176  sgi_factor(ad,au,adb,aub,&sigma,icol,irow,&neq[1],&nzs[1],token);
177 #else
178  printf("*ERROR in objectivemain_se: the SGI library is not linked\n\n");
179  FORTRAN(stop,());
180 #endif
181  }
182  else if(*isolver==5){
183 #ifdef TAUCS
184  tau_factor(ad,&au,adb,aub,&sigma,icol,&irow,&neq[1],&nzs[1]);
185 #else
186  printf("*ERROR in objectivemain_se: the TAUCS library is not linked\n\n");
187  FORTRAN(stop,());
188 #endif
189  }
190  else if(*isolver==7){
191 #ifdef PARDISO
192  pardiso_factor(ad,au,adb,aub,&sigma,icol,irow,&neq[1],&nzs[1],
193  &symmetryflag,&inputformat,jq,&nzs[2]);
194 #else
195  printf("*ERROR in objectivemain_se: the PARDISO library is not linked\n\n");
196  FORTRAN(stop,());
197 #endif
198  }
199 
200  }
201 
202  /* loop over all objective functions */
203 
204  for(m=0;m<*nobject;m++){
205  if(strcmp1(&objectset[m*324],"MASS")==0){
206  iobject=m+1;
207  iobject1=iobject;
208 
209  /* OBJECTIVE: MASS */
210 
211  NNEW(xmass1,double,*ne);
212 
213  /* deactivating the elements which are not part of the
214  target function */
215 
216  FORTRAN(actideacti,(set,nset,istartset,iendset,ialset,objectset,
217  ipkon,&iobject,ne));
218 
219  /* call without perturbation */
220 
221  idesvar=0;
222 
223  /* calculating the objective function and the derivatives */
224 
225  if(*ne<num_cpus){num_cpuse=*ne;}else{num_cpuse=num_cpus;}
226 
227  NNEW(g01,double,num_cpuse**nobject);
228 
229  co1=co;kon1=kon;ipkon1=ipkon;lakon1=lakon;v1=v;nelcon1=nelcon;rhcon1=rhcon;
230  ielmat1=ielmat;ielorien1=ielorien;norien1=norien;ntmat1_=ntmat_;vold1=vold;
231  matname1=matname;mi1=mi;thicke1=thicke;mortar1=mortar;ielprop1=ielprop;
232  prop1=prop;distmin1=distmin;ndesi1=ndesi;nodedesi1=nodedesi;
233  nobject1=nobject;iobject1=iobject;ne1=ne;istartdesi1=istartdesi;
234  ialdesi1=ialdesi;xdesi1=xdesi;idesvar1=idesvar;
235 
236  if(((*nmethod!=4)&&(*nmethod!=5))||(iperturb[0]>1)){
237  printf(" Using up to %" ITGFORMAT " cpu(s) for the mass sensitivity.\n\n", num_cpuse);
238  }
239 
240  NNEW(ithread,ITG,num_cpuse);
241 
242  /* Total difference of the mass */
243  /* create threads and wait */
244 
245  for(i=0;i<num_cpuse;i++) {
246  ithread[i]=i;
247  pthread_create(&tid[i], NULL, (void *)objectivemt_mass_dx, (void *)&ithread[i]);
248  }
249 
250  for(i=0;i<num_cpuse;i++) pthread_join(tid[i], NULL);
251 
252  /* Assembling g0 */
253 
254  g0[m]=g01[m];
255  for(j=1;j<num_cpuse;j++){
256  g0[m]+=g01[m+j**nobject];
257  }
258  SFREE(g01);SFREE(ithread);
259 
260  /* loop over the design variables (perturbation) */
261 
262  for(idesvar=1;idesvar<=*ndesi;idesvar++){
263 
264  nea=istartdesi[idesvar-1];
265  neb=istartdesi[idesvar]-1;
266 
267  FORTRAN(objective_mass_dx,(co,kon,ipkon,lakon,nelcon,rhcon,
268  ielmat,ielorien,norien,ntmat1_,matname,mi,
269  thicke,mortar,&nea,&neb,ielprop,prop,distmin,ndesi,nodedesi,
270  nobject,g0,dgdx,&iobject,xmass1,
271  istartdesi,ialdesi,xdesi,&idesvar));
272  }
273 
274  SFREE(xmass1);
275 
276  /* reactivating all elements */
277 
278  for(i=0;i<*ne;i++){
279  if(ipkon[i]<-1) ipkon[i]=-2-ipkon[i];
280  }
281 
282  }else if(strcmp1(&objectset[m*324],"SHAPEENERGY")==0){
283  iobject=m+1;
284  iobject1=iobject;
285 
286  /* OBJECTIVE: SHAPE ENERGY */
287 
288  NNEW(xener1,double,*ne);
289 
290  /* deactivating the elements which are not part of the
291  target function */
292 
293  FORTRAN(actideacti,(set,nset,istartset,iendset,ialset,objectset,
294  ipkon,&iobject,ne));
295 
296  /* call without perturbation */
297 
298  idesvar=0;
299 
300  /* calculating the objective function and the derivatives */
301 
302  if(*ne<num_cpus){num_cpuse=*ne;}else{num_cpuse=num_cpus;}
303 
304  NNEW(g01,double,num_cpuse**nobject);
305 
306  co1=co;kon1=kon;ipkon1=ipkon;lakon1=lakon;ne1=ne;
307  stx1=stx;elcon1=elcon;nelcon1=nelcon;rhcon1=rhcon;
308  nrhcon1=nrhcon;alcon1=alcon;nalcon1=nalcon;alzero1=alzero;
309  ielmat1=ielmat;ielorien1=ielorien;norien1=norien;orab1=orab;
310  ntmat1_=ntmat_;t01=t0;t11=t1;ithermal1=ithermal;prestr1=prestr;
311  iprestr1=iprestr;iperturb1=iperturb;iout1=iout;
312  vold1=vold;nmethod1=nmethod;veold1=veold;dtime1=dtime;
313  time1=time;ttime1=ttime;plicon1=plicon;nplicon1=nplicon;
314  plkcon1=plkcon;nplkcon1=nplkcon;xstateini1=xstateini;
315  xstiff1=xstiff;xstate1=xstate;npmat1_=npmat_;matname1=matname;
316  mi1=mi;ielas1=ielas;icmd1=icmd;ncmat1_=ncmat_;nstate1_=nstate_;
317  stiini1=stiini;vini1=vini;ener1=ener;eei1=eei;enerini1=enerini;
318  istep1=istep;iinc1=iinc;springarea1=springarea;reltime1=reltime;
319  calcul_qa1=calcul_qa;nener1=nener;ikin1=ikin;ne01=ne0;thicke1=thicke;
320  emeini1=emeini;pslavsurf1=pslavsurf;pmastsurf1=pmastsurf;mortar1=mortar;
321  clearini1=clearini;ielprop1=ielprop;prop1=prop;
322  distmin1=distmin;ndesi1=ndesi;nodedesi1=nodedesi;
323  nobject1=nobject;iobject1=iobject;sti1=sti;istartdesi1=istartdesi;
324  ialdesi1=ialdesi;xdesi1=xdesi;idesvar1=idesvar;
325 
326  if(((*nmethod!=4)&&(*nmethod!=5))||(iperturb[0]>1)){
327  printf(" Using up to %" ITGFORMAT " cpu(s) for the shape energy sensitivity.\n\n", num_cpuse);
328  }
329 
330  NNEW(ithread,ITG,num_cpuse);
331 
332  /* Total difference of the internal shape energy */
333  /* create threads and wait */
334 
335  for(i=0;i<num_cpuse;i++) {
336  ithread[i]=i;
337  pthread_create(&tid[i], NULL, (void *)objectivemt_shapeener_dx, (void *)&ithread[i]);
338  }
339 
340  for(i=0;i<num_cpuse;i++) pthread_join(tid[i], NULL);
341 
342  /* Assembling g0 */
343 
344  g0[m]=g01[m];
345  for(j=1;j<num_cpuse;j++){
346  g0[m]+=g01[m+j**nobject];
347  }
348  SFREE(g01);SFREE(ithread);
349 
350  /* loop over the design variables (perturbation) */
351 
352  for(idesvar=1;idesvar<=*ndesi;idesvar++){
353 
354  nea=istartdesi[idesvar-1];
355  neb=istartdesi[idesvar]-1;
356 
357  FORTRAN(objective_shapeener_dx,(co,kon,ipkon,lakon,ne,
358  stx,elcon,nelcon,rhcon,nrhcon,alcon,nalcon,alzero,
359  ielmat,ielorien,norien,orab,ntmat1_,t0,t1,ithermal,prestr,
360  iprestr,iperturb,iout,vold,
361  nmethod,veold,dtime,time,ttime,plicon,nplicon,plkcon,
362  nplkcon,xstateini,xstiff,xstate,npmat1_,matname,mi,ielas,
363  icmd,ncmat1_,nstate1_,stiini,vini,ener,enerini,istep,iinc,
364  springarea,reltime,&calcul_qa,&nener,&ikin,
365  ne0,thicke,emeini,pslavsurf,pmastsurf,mortar,clearini,
366  &nea,&neb,ielprop,prop,distmin,ndesi,nodedesi,
367  nobject,g0,dgdx,&iobject,sti,xener1,
368  istartdesi,ialdesi,xdesi,&idesvar));
369 
370  }
371 
372  if(iperturb[1]==1){
373 
374  /* solve the system */
375 
376  if(*isolver==0){
377 #ifdef SPOOLES
378  spooles_solve(fint,&neq[1]);
379 #endif
380  }
381  else if(*isolver==4){
382 #ifdef SGI
383  sgi_solve(fint,token);
384 #endif
385  }
386  else if(*isolver==5){
387 #ifdef TAUCS
388  tau_solve(fint,&neq[1]);
389 #endif
390  }
391  else if(*isolver==7){
392 #ifdef PARDISO
393  pardiso_solve(fint,&neq[1],&symmetryflag);
394 #endif
395 }
396 
397  /* solve the system */
398 
399  }
400 
401  SFREE(xener1);
402 
403  /* reactivating all elements */
404 
405  for(i=0;i<*ne;i++){
406  if(ipkon[i]<-1) ipkon[i]=-2-ipkon[i];
407  }
408 
409  /* composing the total derivative */
410 
411  NNEW(vec,double,*neq);
412 
413  FORTRAN(objective_shapeener_tot,(ne,kon,ipkon,lakon,fint,vold,
414  iperturb,mi,nactdof,dgdx,df,ndesi,&iobject,jqs,
415  irows,vec));
416 
417  SFREE(vec);
418 
419  }else if((strcmp1(&objectset[m*324],"EIGENFREQUENCY")==0)||
420  (strcmp1(&objectset[m*324],"GREEN")==0)){
421  iobject=m+1;
422 
423  /* OBJECTIVE: EIGENFREQUENCY */
424 
425  if(*igreen!=1){
426 
427  /* determination of the sensitivity of the eigenvalues */
428 
429  if(!*cyclicsymmetry){
430 
431  FORTRAN(objective_freq,(dgdx,df,v,ndesi,&iobject,
432  mi,nactdofinv,jqs,irows));
433 
434  /* change sign since df contains -(dK/dX-lambda*dM/DX).U */
435 
436  for(idesvar=0;idesvar<*ndesi;idesvar++){dgdx[idesvar]=-dgdx[idesvar];}
437  }else{
438 
439  FORTRAN(objective_freq_cs,(dgdx,df,v,ndesi,&iobject,
440  mi,nactdofinv,jqs,irows,nk,nzss));
441  }
442  }
443 
444  g0[m]=d[*iev];
445 
446  /* in case the design variables are the orientations
447  the sensitivity of the eigenvectors is also
448  determined */
449 
450  if(*icoordinate!=1){
451  if(*igreen!=1) FORTRAN(writedeigdx,(iev,d,ndesi,orname,dgdx));
452 
453  /* createinum is called in order to determine the nodes belonging
454  to elements; this information is needed in frd_se */
455 
456  NNEW(inum,ITG,*nk);
457  FORTRAN(createinum,(ipkon,inum,kon,lakon,nk,ne,&cflag[0],
458  nelemload,nload,nodeboun,nboun,ndirboun,ithermal,co,
459  vold,mi,ielmat));
460 
461  /* the frequency is also needed for frd_se */
462 
463  if(d[*iev]>=0.){
464  freq=sqrt(d[*iev])/6.283185308;
465  }else{
466  freq=0.;
467  }
468 
469  /* determine the derivative of the eigenvectors */
470 
471  NNEW(bfix,double,neq[1]);
472  NNEW(b,double,neq[1]);
473  NNEW(temp,double,mt**nk);
474 
475  if(*igreen!=1){
476 
477  /* bfix = M * eigenvector */
478 
479  FORTRAN(op,(neq,&z[*iev*neq[1]],bfix,adb,aub,jq,irow));
480 
481  }else{
482 
483  sigma=d[*iev];
484 
485  /* factor the system */
486 
487  if(*isolver==0){
488 #ifdef SPOOLES
489  spooles_factor(ad,au,adb,aub,&sigma,icol,irow,&neq[1],&nzs[1],
490  &symmetryflag,&inputformat,&nzs[2]);
491 #else
492  printf("*ERROR in objectivemain_se: the SPOOLES library is not linked\n\n");
493  FORTRAN(stop,());
494 #endif
495  }
496  else if(*isolver==4){
497 #ifdef SGI
498  token=1;
499  sgi_factor(ad,au,adb,aub,&sigma,icol,irow,&neq[1],&nzs[1],token);
500 #else
501  printf("*ERROR in objectivemain_se: the SGI library is not linked\n\n");
502  FORTRAN(stop,());
503 #endif
504  }
505  else if(*isolver==5){
506 #ifdef TAUCS
507  tau_factor(ad,&au,adb,aub,&sigma,icol,&irow,&neq[1],&nzs[1]);
508 #else
509  printf("*ERROR in objectivemain_se: the TAUCS library is not linked\n\n");
510  FORTRAN(stop,());
511 #endif
512  }
513  else if(*isolver==7){
514 #ifdef PARDISO
515  pardiso_factor(ad,au,adb,aub,&sigma,icol,irow,&neq[1],&nzs[1],
516  &symmetryflag,&inputformat,jq,&nzs[2]);
517 #else
518  printf("*ERROR in objectivemain_se: the PARDISO library is not linked\n\n");
519  FORTRAN(stop,());
520 #endif
521  }
522  }
523 
524  /* loop over all design variables */
525 
526  for(idesvar=0;idesvar<*ndesi;idesvar++){
527 
528  /* setting up the RHS of the system */
529 
530  if(*igreen!=1){
531  for(j=0;j<neq[1];j++){
532  b[j]=dgdx[idesvar]*bfix[j];
533  }
534  }else{
535  DMEMSET(b,0,neq[1],0.);
536  }
537 
538  for(j=jqs[idesvar]-1;j<jqs[idesvar+1]-1;j++){
539  b[irows[j]-1]+=df[j];
540  }
541 
542  if(*igreen==1){
543 
544  /* solve the system */
545 
546  if(*isolver==0){
547 #ifdef SPOOLES
548  spooles_solve(b,&neq[1]);
549 #endif
550  }
551  else if(*isolver==4){
552 #ifdef SGI
553  sgi_solve(b,token);
554 #endif
555  }
556  else if(*isolver==5){
557 #ifdef TAUCS
558  tau_solve(b,&neq[1]);
559 #endif
560  }
561  else if(*isolver==7){
562 #ifdef PARDISO
563  pardiso_solve(b,&neq[1],&symmetryflag);
564 #endif
565  }
566  }else{
567 
568  NNEW(c,double,*nev);
569  for(j=0;j<*nev;j++){
570  if(j==*iev) continue;
571  for(k=0;k<neq[1];k++){
572  c[j]+=z[j*neq[1]+k]*b[k];
573  }
574  c[j]/=(d[j]-d[*iev]);
575  }
576  DMEMSET(b,0,neq[1],0.);
577  for(j=0;j<*nev;j++){
578  if(j==*iev) continue;
579  for(k=0;k<neq[1];k++){
580  b[k]+=c[j]*z[j*neq[1]+k];
581  }
582  }
583  SFREE(c);
584  }
585 
586  /* store the answer in temp w.r.t. node and direction
587  instead of w.r.t. dof */
588 
589  DMEMSET(temp,0,mt**nk,0.);
590  FORTRAN(resultsnoddir,(nk,temp,nactdof,b,ipompc,nodempc,
591  coefmpc,nmpc,mi));
592 
593  /* storing the sensitivity of the eigenmodes to file */
594 
595  ++*kode;
596  frd_sen(co,nk,stn,inum,nmethod,kode,filab,
597  &freq,nstate_,
598  istep,iinc,&mode,&noddiam,description,mi,&ngraph,
599  ne,cs,set,nset,istartset,iendset,ialset,
600  jobnamec,output,temp,&iobject,objectset,ntrans,
601  inotr,trab,&idesvar,orname,icoordinate,&inorm,
602  &irand);
603 
604  } // enddo loop idesvar
605 
606  if(*igreen==1){
607 
608  /* clean the system */
609 
610  if(*isolver==0){
611 #ifdef SPOOLES
612  spooles_cleanup();
613 #endif
614  }
615  else if(*isolver==4){
616 #ifdef SGI
617  sgi_cleanup(token);
618 #endif
619  }
620  else if(*isolver==5){
621 #ifdef TAUCS
622  tau_cleanup();
623 #endif
624  }
625  else if(*isolver==7){
626 #ifdef PARDISO
627  pardiso_cleanup(&neq[1],&symmetryflag);
628 #endif
629  }
630  }
631 
632  SFREE(temp);SFREE(bfix);SFREE(b);SFREE(inum);
633 
634  }
635 
636  }else if(strcmp1(&objectset[m*324],"DISPLACEMENT")==0){
637  iobject=m+1;
638 
639  /* OBJECTIVE: DISPLACEMENT */
640 
641  /* createinum is called in order to determine the nodes belonging
642  to elements; this information is needed in frd_se */
643 
644  NNEW(inum,ITG,*nk);
645  FORTRAN(createinum,(ipkon,inum,kon,lakon,nk,ne,&cflag[0],nelemload,
646  nload,nodeboun,nboun,ndirboun,ithermal,co,vold,mi,ielmat));
647 
648  NNEW(b,double,neq[1]);
649  NNEW(temp,double,mt**nk);
650 
651  /* if the design variables are the coordinates:
652  check for the existence of a target node set */
653 
654  /* calculating the objective function */
655 
656  if(*icoordinate==1){
657  nodeset=0;
658  for(i=0;i<*nset;i++){
659  if(strcmp1(&objectset[m*324+162]," ")==0) continue;
660  if(strcmp2(&objectset[m*324+162],&set[i*81],81)==0){
661  nodeset=i+1;
662  break;
663  }
664  }
665  FORTRAN(objective_disp,(&nodeset,istartset,iendset,
666  ialset,nk,&idesvar,&iobject,mi,g0,
667  nobject,vold));
668  }
669 
670  for(idesvar=0;idesvar<*ndesi;idesvar++){
671 
672  /* copying the RHS from field df */
673 
674  DMEMSET(b,0,neq[1],0.);
675  for(j=jqs[idesvar]-1;j<jqs[idesvar+1]-1;j++){
676  b[irows[j]-1]=df[j];
677  }
678 
679  /* solve the system */
680 
681  if(*isolver==0){
682 #ifdef SPOOLES
683  spooles_solve(b,&neq[1]);
684 #endif
685  }
686  else if(*isolver==4){
687 #ifdef SGI
688  sgi_solve(b,token);
689 #endif
690  }
691  else if(*isolver==5){
692 #ifdef TAUCS
693  tau_solve(b,&neq[1]);
694 #endif
695  }
696  else if(*isolver==7){
697 #ifdef PARDISO
698  pardiso_solve(b,&neq[1],&symmetryflag);
699 #endif
700  }
701 
702  if(*icoordinate!=1){
703 
704  /* store the answer in temp w.r.t. node and direction
705  instead of w.r.t. dof */
706 
707  DMEMSET(temp,0,mt**nk,0.);
708  FORTRAN(resultsnoddir,(nk,temp,nactdof,b,ipompc,nodempc,
709  coefmpc,nmpc,mi));
710 
711  /* storing the results to file */
712 
713  ++*kode;
714  frd_sen(co,nk,stn,inum,nmethod,kode,filab,
715  &ptime,nstate_,
716  istep,iinc,&mode,&noddiam,description,mi,&ngraph,
717  ne,cs,set,nset,istartset,iendset,ialset,
718  jobnamec,output,temp,&iobject,objectset,ntrans,
719  inotr,trab,&idesvar,orname,icoordinate,&inorm,
720  &irand);
721 
722  }else{
723  FORTRAN(objective_disp_dx,(&nodeset,istartset,iendset,
724  ialset,nk,&idesvar,&iobject,mi,nactdof,dgdx,
725  ndesi,nobject,vold,b));
726  }
727  }
728 
729  SFREE(b);SFREE(temp);SFREE(inum);
730 
731  }else if(strcmp1(&objectset[m*324],"STRESS")==0){
732  iobject=m+1;
733 
734  NNEW(filabl,char,87**nlabel);
735  for(i=0;i<87**nlabel;i++){strcpy1(&filabl[i]," ",1);}
736  strcpy1(&filabl[174],"S ",4);
737 
738  /* deactivating all elements which are not part of
739  the target function */
740 
741  NNEW(neinset,ITG,*ne);
742 
743  FORTRAN(actideactistr,(set,nset,istartset,iendset,ialset,objectset,
744  ipkon,&iobject,ne,neinset,iponoel,inoel,&nepar));
745 
746  /* determining the nodal bounds in each thread */
747 
748  if(nepar<num_cpus){num_cpuse=nepar;}else{num_cpuse=num_cpus;}
749 
750  NNEW(neapar,ITG,num_cpuse);
751  NNEW(nebpar,ITG,num_cpuse);
752 
753  idelta=nepar/num_cpuse;
754 
755  /* dividing the range from 1 to the number of active elements */
756 
757  isum=0;
758  for(i=0;i<num_cpuse;i++){
759  neapar[i]=isum;
760  if(i!=num_cpuse-1){
761  isum+=idelta;
762  }else{
763  isum=nepar;
764  }
765  nebpar[i]=isum-1;
766  }
767 
768  /* translating the bounds of the ranges to real node numbers */
769 
770  i=-1;
771  j=0;
772  nepar=-1;
773 
774  do{
775  if(j==num_cpuse) break;
776  do{
777  if(neapar[j]==nepar){
778  neapar[j]=i;
779  break;
780  }else{
781  do{
782  i++;
783  if(neinset[i]==1){
784  nepar++;
785  break;
786  }
787  }while(1);
788  }
789  }while(1);
790 
791  do{
792  if(nebpar[j]==nepar){
793  nebpar[j]=i;
794  j++;
795  break;
796  }else{
797  do{
798  i++;
799  if(neinset[i]==1){
800  nepar++;
801  break;
802  }
803  }while(1);
804  }
805  }while(1);
806  }while(1);
807 
808  /* FORTRAN convention */
809 
810  nestart=neapar[0]+1;
811  neend=nebpar[num_cpuse-1]+1;
812 
813  SFREE(neinset);
814 
815  /* OBJECTIVE: STRESS */
816 
817  /* calculating the stress in the unperturbed state */
818 
819  NNEW(v,double,mt**nk);
820  NNEW(fn,double,mt**nk);
821  NNEW(stn,double,6**nk);
822  NNEW(inum,ITG,*nk);
823  NNEW(stx,double,6*mi[0]**ne);
824  NNEW(eei,double,6*mi[0]**ne);
825 
826  memcpy(&v[0],&vold[0],sizeof(double)*mt**nk);
827  *iout=2;
828  *icmd=3;
829 
830  resultsstr(co,nk,kon,ipkon,lakon,ne,v,stn,inum,stx,
831  elcon,nelcon,rhcon,nrhcon,alcon,nalcon,alzero,ielmat,
832  ielorien,norien,orab,ntmat_,t0,t1,ithermal,
833  prestr,iprestr,filabl,eme,emn,een,iperturb,
834  f,fn,nactdof,iout,qa,vold,b,nodeboun,
835  ndirboun,xboun,nboun,ipompc,
836  nodempc,coefmpc,labmpc,nmpc,nmethod,cam,&neq[1],veold,accold,
837  bet,gam,dtime,time,ttime,plicon,nplicon,plkcon,nplkcon,
838  xstateini,xstiff,xstate,npmat_,epn,matname,mi,ielas,icmd,
839  ncmat_,nstate_,stiini,vini,ikboun,ilboun,ener,enern,emeini,
840  xstaten,eei,enerini,cocon,ncocon,set,nset,istartset,iendset,
841  ialset,nprint,prlab,prset,qfx,qfn,trab,inotr,ntrans,fmpc,
842  nelemload,nload,ikmpc,ilmpc,istep,iinc,springarea,
843  reltime,ne0,xforc,nforc,thicke,shcon,nshcon,
844  sideload,xload,xloadold,icfd,inomat,pslavsurf,pmastsurf,
845  mortar,islavact,cdn,islavnode,nslavnode,ntie,clearini,
846  islavsurf,ielprop,prop,energyini,energy,&kscale,
847  &nener,orname,&network,neapar,nebpar);
848 
849  *icmd=0;
850 
851  SFREE(v);SFREE(fn);SFREE(stx);SFREE(eei);
852 
853 
854  /* if the design variables are the coordinates:
855  check for the existence of a target node set */
856 
857  /* calculating the objective function */
858 
859  if(*icoordinate==1){
860  nodeset=0;
861  for(i=0;i<*nset;i++){
862  if(strcmp1(&objectset[m*324+162]," ")==0) continue;
863  if(strcmp2(&objectset[m*324+162],&set[i*81],81)==0){
864  nodeset=i+1;
865  break;
866  }
867  }
868  FORTRAN(objective_stress,(&nodeset,istartset,iendset,
869  ialset,nk,&idesvar,&iobject,mi,g0,
870  nobject,stn,objectset));
871  }
872 
873  if(*icoordinate!=1){
874 
875  /* orientation as design variables */
876 
877  NNEW(b,double,neq[1]);
878  NNEW(vnew,double,mt**nk);
879 
880  for(idesvar=0;idesvar<*ndesi;idesvar++){
881 
882  /* copying the RHS from field df */
883 
884  DMEMSET(b,0,neq[1],0.);
885  for(j=jqs[idesvar]-1;j<jqs[idesvar+1]-1;j++){
886  b[irows[j]-1]=df[j];
887  }
888 
889  /* solve the system */
890 
891  if(*isolver==0){
892 #ifdef SPOOLES
893  spooles_solve(b,&neq[1]);
894 #endif
895  }
896  else if(*isolver==4){
897 #ifdef SGI
898  sgi_solve(b,token);
899 #endif
900  }
901  else if(*isolver==5){
902 #ifdef TAUCS
903  tau_solve(b,&neq[1]);
904 #endif
905  }
906  else if(*isolver==7){
907 #ifdef PARDISO
908  pardiso_solve(b,&neq[1],&symmetryflag);
909 #endif
910  }
911 
912  /* calculating the perturbed displacements */
913 
914  FORTRAN(resultsnoddir,(nk,vnew,nactdof,b,ipompc,nodempc,
915  coefmpc,nmpc,mi));
916 
917  for(i=0;i<mt**nk;i++){vnew[i]=vold[i]+(*distmin)*vnew[i];}
918 
919  /* calculating the stress in the perturbed state */
920 
921  NNEW(v,double,mt**nk);
922  NNEW(fn,double,mt**nk);
923  NNEW(stx,double,6*mi[0]**ne);
924  NNEW(eei,double,6*mi[0]**ne);
925  NNEW(dstn,double,6**nk);
926 
927  memcpy(&v[0],&vnew[0],sizeof(double)*mt**nk);
928  *iout=2;
929  *icmd=3;
930 
931  /* calculate a delta in the orientation
932  in case the material orientation is the design variable */
933 
934  iorien=idesvar/3;
935 
936  /* save nominal orientation */
937 
938  memcpy(&orabsav[0],&orab[7*iorien],sizeof(double)*7);
939 
940  /* calculate the transformation matrix */
941 
942  FORTRAN(transformatrix,(&orab[7*iorien],pgauss,a));
943 
944  /* calculate the rotation vector from the transformation matrix */
945 
946  FORTRAN(rotationvector,(a,rotvec));
947  idir=idesvar-iorien*3;
948 
949  /* add a small variation to the rotation vector component */
950 
951  rotvec[idir]+=*distmin;
952 
953  /* determine the new transformation matrix */
954 
955  FORTRAN(rotationvectorinv,(a,rotvec));
956 
957  /* determine two new points in the x-y plane */
958 
959  for(i=0;i<6;i++){orab[7*iorien+i]=a[i];}
960 
961  resultsstr(co,nk,kon,ipkon,lakon,ne,v,dstn,inum,stx,
962  elcon,nelcon,rhcon,nrhcon,alcon,nalcon,alzero,ielmat,
963  ielorien,norien,orab,ntmat_,t0,t1,ithermal,
964  prestr,iprestr,filabl,eme,emn,een,iperturb,
965  f,fn,nactdof,iout,qa,vold,b,nodeboun,
966  ndirboun,xboun,nboun,ipompc,
967  nodempc,coefmpc,labmpc,nmpc,nmethod,cam,&neq[1],veold,accold,
968  bet,gam,dtime,time,ttime,plicon,nplicon,plkcon,nplkcon,
969  xstateini,xstiff,xstate,npmat_,epn,matname,mi,ielas,icmd,
970  ncmat_,nstate_,stiini,vini,ikboun,ilboun,ener,enern,emeini,
971  xstaten,eei,enerini,cocon,ncocon,set,nset,istartset,iendset,
972  ialset,nprint,prlab,prset,qfx,qfn,trab,inotr,ntrans,fmpc,
973  nelemload,nload,ikmpc,ilmpc,istep,iinc,springarea,
974  reltime,ne0,xforc,nforc,thicke,shcon,nshcon,
975  sideload,xload,xloadold,icfd,inomat,pslavsurf,pmastsurf,
976  mortar,islavact,cdn,islavnode,nslavnode,ntie,clearini,
977  islavsurf,ielprop,prop,energyini,energy,&kscale,
978  &nener,orname,&network,neapar,nebpar);
979 
980  *icmd=0;
981 
982  SFREE(v);SFREE(fn);SFREE(stx);SFREE(eei);
983 
984  /* calculate the stress sensitivity */
985 
986  for(i=0;i<6**nk;i++){dstn[i]=(dstn[i]-stn[i])/(*distmin);}
987 
988  /* restoring the nominal orientation */
989 
990 // if(idesvar>0){
991  memcpy(&orab[7*iorien],&orabsav[0],sizeof(double)*7);
992 // }
993 
994  /* storing the results to file */
995 
996  ++*kode;
997  frd_sen(co,nk,dstn,inum,nmethod,kode,filab,
998  &ptime,nstate_,
999  istep,iinc,&mode,&noddiam,description,mi,&ngraph,
1000  ne,cs,set,nset,istartset,iendset,ialset,
1001  jobnamec,output,temp,&iobject,objectset,ntrans,
1002  inotr,trab,&idesvar,orname,icoordinate,&inorm,
1003  &irand);
1004 
1005  SFREE(dstn);
1006 
1007  }
1008 
1009  SFREE(vnew);SFREE(b);
1010 
1011  }else{
1012 
1013  /* coordinates as design variables */
1014 
1015  lmax=*ndesi/num_cpus;
1016 
1017  /* deviding the design variables in sets of
1018  num_cpus variables */
1019 
1020  for(l=0;l<lmax+1;l++){
1021  if(l<lmax){
1023  }else{
1024  num_cpusd=*ndesi-lmax*num_cpus;
1025  if(num_cpusd==0){break;}
1026  }
1027 
1028  /* solving the system of equations for
1029  num_cpusd design variables */
1030 
1031  NNEW(b,double,num_cpusd*neq[1]);
1032 
1033  for(k=0;k<num_cpusd;k++){
1034 
1035  /* design variable at stake */
1036 
1037  idesvar=l*num_cpus+k;
1038 
1039  /* copying the RHS from field df */
1040 
1041  for(j=jqs[idesvar]-1;j<jqs[idesvar+1]-1;j++){
1042  b[k*neq[1]+irows[j]-1]=df[j];
1043  }
1044 
1045  /* solve the system */
1046 
1047  if(*isolver==0){
1048 #ifdef SPOOLES
1049  spooles_solve(&b[k*neq[1]],&neq[1]);
1050 #endif
1051  }
1052  else if(*isolver==4){
1053 #ifdef SGI
1054  sgi_solve(&b[k*neq[1]],token);
1055 #endif
1056  }
1057  else if(*isolver==5){
1058 #ifdef TAUCS
1059  tau_solve(&b[k*neq[1]],&neq[1]);
1060 #endif
1061  }
1062  else if(*isolver==7){
1063 #ifdef PARDISO
1064  pardiso_solve(&b[k*neq[1]],&neq[1],&symmetryflag);
1065 #endif
1066  }
1067  }
1068 
1069  /* last design variable treated (FORTRAN-notation) */
1070 
1071  idesvar=l*num_cpus;
1072 
1073  printf(" Using up to %" ITGFORMAT " cpu(s) for the stress sensitivity.\n\n", num_cpusd);
1074 
1075  co1=co;nk1=nk;kon1=kon;ipkon1=ipkon;lakon1=lakon;ne1=ne;stn1=stn;
1076  elcon1=elcon;nelcon1=nelcon;rhcon1=rhcon;nrhcon1=nrhcon;alcon1=alcon;
1077  nalcon1=nalcon;alzero1=alzero;ielmat1=ielmat;ielorien1=ielorien;norien1=norien;
1078  orab1=orab;ntmat1_=ntmat_;t01=t0;t11=t1;ithermal1=ithermal;prestr1=prestr;
1079  iprestr1=iprestr;filabl1=filabl;emn1=emn;een1=een;iperturb1=iperturb;
1080  f1=f;nactdof1=nactdof;vold1=vold;nodeboun1=nodeboun;
1081  ndirboun1=ndirboun;xboun1=xboun;nboun1=nboun;ipompc1=ipompc;nodempc1=nodempc;
1082  coefmpc1=coefmpc;labmpc1=labmpc;nmpc1=nmpc;nmethod1=nmethod;cam1=cam;neq1=neq;
1083  veold1=veold;accold1=accold;bet1=bet;gam1=gam;dtime1=dtime;time1=time;ttime1=ttime;
1084  plicon1=plicon;nplicon1=nplicon;plkcon1=plkcon;nplkcon1=nplkcon;xstateini1=xstateini;
1085  xstate1=xstate;npmat1_=npmat_;epn1=epn;matname1=matname;mi1=mi;
1086  ielas1=ielas;ncmat1_=ncmat_;nstate1_=nstate_;stiini1=stiini;vini1=vini;
1087  ikboun1=ikboun;ilboun1=ilboun;enern1=enern;emeini1=emeini;xstaten1=xstaten;
1088  enerini1=enerini;cocon1=cocon;ncocon1=ncocon;set1=set;nset1=nset;
1089  istartset1=istartset;iendset1=iendset;ialset1=ialset;nprint1=nprint;prlab1=prlab;
1090  prset1=prset;qfx1=qfx;qfn1=qfn;trab1=trab;inotr1=inotr;ntrans1=ntrans;fmpc1=fmpc;
1091  nelemload1=nelemload;nload1=nload;ikmpc1=ikmpc;ilmpc1=ilmpc;istep1=istep;iinc1=iinc;
1092  springarea1=springarea;reltime1=reltime;ne01=ne0;xforc1=xforc;nforc1=nforc;
1093  thicke1=thicke;shcon1=shcon;nshcon1=nshcon;sideload1=sideload;xload1=xload;
1094  xloadold1=xloadold;icfd1=icfd;inomat1=inomat;pslavsurf1=pslavsurf;pmastsurf1=pmastsurf;
1095  mortar1=mortar;islavact1=islavact;cdn1=cdn;islavnode1=islavnode;nslavnode1=nslavnode;
1096  ntie1=ntie;clearini1=clearini;islavsurf1=islavsurf;ielprop1=ielprop;prop1=prop;
1097  energyini1=energyini;energy1=energy;kscale1=kscale;orname1=orname;
1098  network1=network;nestart1=nestart;neend1=neend;jqs1=jqs;irows1=irows;
1099  nodedesi1=nodedesi;xdesi1=xdesi;ndesi1=ndesi;iobject1=iobject;nobject1=nobject;
1100  objectset1=objectset;g01=g0;dgdx1=dgdx;nasym1=nasym;isolver1=isolver;distmin1=distmin;
1101  nodeset1=nodeset;b1=b;idesvar1=idesvar;
1102 
1103  NNEW(ithread,ITG,num_cpusd);
1104 
1105  /* Total difference of the mass */
1106  /* create threads and wait */
1107 
1108  for(i=0;i<num_cpusd;i++) {
1109  ithread[i]=i;
1110  pthread_create(&tid[i], NULL, (void *)stress_senmt, (void *)&ithread[i]);
1111  }
1112 
1113  for(i=0;i<num_cpusd;i++) pthread_join(tid[i], NULL);
1114 
1115  SFREE(ithread);SFREE(b);
1116 
1117  }
1118 
1119  }
1120 
1121  /* reactivating all elements */
1122 
1123  for(i=0;i<*ne;i++){
1124  if(ipkon[i]<-1) ipkon[i]=-2-ipkon[i];
1125  }
1126 
1127  SFREE(inum);SFREE(stn);SFREE(filabl);
1128  SFREE(neapar);SFREE(nebpar);
1129 
1130  }else if(strcmp1(&objectset[m*324],"THICKNESS")==0){
1131  iobject=m+1;
1132 
1133  thicknessmain(co,dgdx,nobject,nk,nodedesi,ndesi,objectset,
1134  ipkon,kon,lakon,set,nset,istartset,iendset,ialset,
1135  &iobject,nodedesiinv,dgdxglob);
1136  }
1137  }
1138 
1139  if(*idisplacement==1){
1140 
1141  /* clean the system */
1142 
1143  if(*isolver==0){
1144 #ifdef SPOOLES
1145  spooles_cleanup();
1146 #endif
1147  }
1148  else if(*isolver==4){
1149 #ifdef SGI
1150  sgi_cleanup(token);
1151 #endif
1152  }
1153  else if(*isolver==5){
1154 #ifdef TAUCS
1155  tau_cleanup();
1156 #endif
1157  }
1158  else if(*isolver==7){
1159 #ifdef PARDISO
1160  pardiso_cleanup(&neq[1],&symmetryflag);
1161 #endif
1162  }
1163  }
1164 
1165  return;
1166 
1167 }
static double * g01
Definition: objectivemain_se.c:42
static double * emeini1
Definition: objectivemain_se.c:42
static ITG * ithermal1
Definition: objectivemain_se.c:29
#define ITGFORMAT
Definition: CalculiX.h:52
void spooles_solve(double *b, ITG *neq)
static ITG nener1
Definition: objectivemain_se.c:29
static ITG * nprint1
Definition: objectivemain_se.c:29
void * objectivemt_mass_dx(ITG *i)
Definition: objectivemain_se.c:1205
static double * pmastsurf1
Definition: objectivemain_se.c:42
static double * xener1
Definition: objectivemain_se.c:47
static double * co1
Definition: objectivemain_se.c:42
subroutine objective_disp_dx(nodeset, istartset, iendset, ialset, nk, idesvarc, iobject, mi, nactdof, dgdx, ndesi, nobject, vold, b)
Definition: objective_disp_dx.f:21
static double * xstateini1
Definition: objectivemain_se.c:42
static ITG * nstate1_
Definition: objectivemain_se.c:29
static ITG * icmd1
Definition: objectivemain_se.c:29
static double * dgdx1
Definition: objectivemain_se.c:42
static double * enerini1
Definition: objectivemain_se.c:42
static double * t01
Definition: objectivemain_se.c:42
static ITG * nmethod1
Definition: objectivemain_se.c:29
static double * coefmpc1
Definition: objectivemain_se.c:47
static double * qfx1
Definition: objectivemain_se.c:47
static ITG * nalcon1
Definition: objectivemain_se.c:29
static double * t11
Definition: objectivemain_se.c:42
static ITG * ielprop1
Definition: objectivemain_se.c:29
int pthread_create(pthread_t *thread_id, const pthread_attr_t *attributes, void *(*thread_function)(void *), void *arguments)
static double * xmass1
Definition: objectivemain_se.c:47
static double * ener1
Definition: objectivemain_se.c:42
ITG strcmp2(const char *s1, const char *s2, ITG length)
Definition: strcmp2.c:24
static ITG * nload1
Definition: objectivemain_se.c:29
subroutine objective_stress(nodeset, istartset, iendset, ialset, nk, idesvarc, iobject, mi, g0, nobject, stn, objectset)
Definition: objective_stress.f:21
static ITG num_cpus
Definition: biosav.c:27
static ITG calcul_qa1
Definition: objectivemain_se.c:29
static ITG * ndesi1
Definition: objectivemain_se.c:29
static double * accold1
Definition: objectivemain_se.c:47
static double * alzero1
Definition: objectivemain_se.c:42
subroutine df(x, u, uprime, rpar, nev)
Definition: subspace.f:133
static ITG neend1
Definition: objectivemain_se.c:29
subroutine objective_disp(nodeset, istartset, iendset, ialset, nk, idesvarc, iobject, mi, g0, nobject, vold)
Definition: objective_disp.f:21
static ITG * ialset1
Definition: objectivemain_se.c:29
static double * xboun1
Definition: objectivemain_se.c:47
subroutine objective_mass_dx(co, kon, ipkon, lakon, nelcon, rhcon, ielmat, ielorien, norien, ntmat_, matname, mi, thicke, mortar, nea, neb, ielprop, prop, distmin, ndesi, nodedesi, nobject, g0, dgdx, iobject, xmass, istartdesi, ialdesi, xdesi, idesvar)
Definition: objective_mass_dx.f:24
void sgi_solve(double *b, ITG token)
subroutine objective_shapeener_tot(ne, kon, ipkon, lakon, fint, vold, iperturb, mi, nactdof, dgdx, df, ndesi, iobject, jqs, irows, vec)
Definition: objective_shapeener_tot.f:22
static double * sti1
Definition: objectivemain_se.c:42
static ITG * ntmat1_
Definition: objectivemain_se.c:29
static double * xdesi1
Definition: objectivemain_se.c:42
static ITG * nplkcon1
Definition: objectivemain_se.c:29
static ITG * islavnode1
Definition: objectivemain_se.c:29
static ITG * nk1
Definition: objectivemain_se.c:29
static double * emn1
Definition: objectivemain_se.c:47
static ITG * ntie1
Definition: objectivemain_se.c:29
subroutine resultsnoddir(nk, v, nactdof, b, ipompc, nodempc, coefmpc, nmpc, mi)
Definition: resultsnoddir.f:21
void thicknessmain(double *co, double *dgdx, ITG *nobject, ITG *nk, ITG *nodedesi, ITG *ndesi, char *objectset, ITG *ipkon, ITG *kon, char *lakon, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *iobject, ITG *nodedesiinv, double *dgdxglob)
Definition: thicknessmain.c:50
static ITG num_cpusd
Definition: objectivemain_se.c:29
static ITG * ntrans1
Definition: objectivemain_se.c:29
static ITG * ncmat1_
Definition: objectivemain_se.c:29
subroutine rotationvectorinv(c, v)
Definition: rotationvectorinv.f:20
ITG strcpy1(char *s1, const char *s2, ITG length)
Definition: strcpy1.c:24
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
subroutine op(n, x, y, ad, au, jq, irow)
Definition: op.f:26
static double * reltime1
Definition: objectivemain_se.c:42
static double * xloadold1
Definition: objectivemain_se.c:47
static ITG * ielas1
Definition: objectivemain_se.c:29
static double * cdn1
Definition: objectivemain_se.c:47
static double * clearini1
Definition: objectivemain_se.c:42
ITG strcmp1(const char *s1, const char *s2)
Definition: strcmp1.c:24
static double * energy1
Definition: objectivemain_se.c:47
static ITG idesvar1
Definition: objectivemain_se.c:29
static double * plicon1
Definition: objectivemain_se.c:42
static char * prset1
Definition: objectivemain_se.c:26
void pardiso_cleanup(ITG *neq, ITG *symmetryflag)
subroutine actideacti(set, nset, istartset, iendset, ialset, objectset, ipkon, iobject, ne)
Definition: actideacti.f:21
static ITG * isolver1
Definition: objectivemain_se.c:29
static ITG * inomat1
Definition: objectivemain_se.c:29
static ITG * iout1
Definition: objectivemain_se.c:29
static double * time1
Definition: objectivemain_se.c:42
static ITG * ialdesi1
Definition: objectivemain_se.c:29
static ITG * norien1
Definition: objectivemain_se.c:29
static ITG * istartset1
Definition: objectivemain_se.c:29
static ITG * jqs1
Definition: objectivemain_se.c:29
static double * fmpc1
Definition: objectivemain_se.c:47
static ITG * irows1
Definition: objectivemain_se.c:29
ITG getSystemCPUs()
Definition: getSystemCPUs.c:40
#define DMEMSET(a, b, c, d)
Definition: CalculiX.h:45
static ITG kscale1
Definition: objectivemain_se.c:29
static double * plkcon1
Definition: objectivemain_se.c:42
static double * veold1
Definition: objectivemain_se.c:42
static char * sideload1
Definition: objectivemain_se.c:26
subroutine stop()
Definition: stop.f:20
subroutine objective_freq_cs(dgdx, df, vold, ndesi, iobject, mi, nactdofinv, jqs, irows, nk, nzss)
Definition: objective_freq_cs.f:22
subroutine objective_shapeener_dx(co, kon, ipkon, lakon, ne, stx, elcon, nelcon, rhcon, nrhcon, alcon, nalcon, alzero, ielmat, ielorien, norien, orab, ntmat_, t0, t1, ithermal, prestr, iprestr, iperturb, iout, vold, nmethod, veold, dtime, time, ttime, plicon, nplicon, plkcon, nplkcon, xstateini, xstiff, xstate, npmat_, matname, mi, ielas, icmd, ncmat_, nstate_, stiini, vini, ener, enerini, istep, iinc, springarea, reltime, calcul_qa, nener, ikin, ne0, thicke, emeini, pslavsurf, pmastsurf, mortar, clearini, nea, neb, ielprop, prop, distmin, ndesi, nodedesi, nobject, g0, dgdx, iobject, sti, xener, istartdesi, ialdesi, xdesi, idesvar)
Definition: objective_shapeener_dx.f:30
static ITG * npmat1_
Definition: objectivemain_se.c:29
void sgi_cleanup(ITG token)
static double * cam1
Definition: objectivemain_se.c:47
static double * alcon1
Definition: objectivemain_se.c:42
static ITG * istep1
Definition: objectivemain_se.c:29
void tau_cleanup()
static double * cocon1
Definition: objectivemain_se.c:47
static ITG * iperturb1
Definition: objectivemain_se.c:29
void sgi_factor(double *ad, double *au, double *adb, double *aub, double *sigma, ITG *icol, ITG *irow, ITG *neq, ITG *nzs, ITG token)
void frd_sen(double *co, ITG *nk, double *dstn, ITG *inum, ITG *nmethod, ITG *kode, char *filab, double *time, ITG *nstate_, ITG *istep, ITG *iinc, ITG *mode, ITG *noddiam, char *description, ITG *mi, ITG *ngraph, ITG *ne, double *cs, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *jobnamec, char *output, double *v, ITG *iobject, char *objectset, ITG *ntrans, ITG *inotr, double *trab, ITG *idesvar, char *orname, ITG *icoordinate, ITG *inorm, ITG *irand)
Definition: frd_sen.c:27
static ITG ikin1
Definition: objectivemain_se.c:29
static ITG * ikmpc1
Definition: objectivemain_se.c:29
void pardiso_factor(double *ad, double *au, double *adb, double *aub, double *sigma, ITG *icol, ITG *irow, ITG *neq, ITG *nzs, ITG *symmetryflag, ITG *inputformat, ITG *jq, ITG *nzs3)
static char * objectset1
Definition: objectivemain_se.c:26
static double * b1
Definition: objectivemain_se.c:47
static ITG nodeset1
Definition: objectivemain_se.c:29
static double * prestr1
Definition: objectivemain_se.c:42
subroutine objective_freq(dgdx, df, vold, ndesi, iobject, mi, nactdofinv, jqs, irows)
Definition: objective_freq.f:22
static double * een1
Definition: objectivemain_se.c:47
static double * xload1
Definition: objectivemain_se.c:47
static double * bet1
Definition: objectivemain_se.c:47
subroutine transformatrix(xab, p, a)
Definition: transformatrix.f:20
static double * ttime1
Definition: objectivemain_se.c:42
static double * enern1
Definition: objectivemain_se.c:47
static double * v1
Definition: objectivemain_se.c:42
static double * rhcon1
Definition: objectivemain_se.c:42
static double * orab1
Definition: objectivemain_se.c:42
static double * stiini1
Definition: objectivemain_se.c:42
static ITG * kon1
Definition: objectivemain_se.c:29
static char * set1
Definition: objectivemain_se.c:26
static ITG * nobject1
Definition: objectivemain_se.c:29
#define SFREE(a)
Definition: CalculiX.h:41
static char * orname1
Definition: objectivemain_se.c:26
static ITG * mi1
Definition: objectivemain_se.c:29
static double * stx1
Definition: objectivemain_se.c:42
static double * dtime1
Definition: objectivemain_se.c:42
static ITG * nplicon1
Definition: objectivemain_se.c:29
static ITG network1
Definition: objectivemain_se.c:29
static double * pslavsurf1
Definition: objectivemain_se.c:42
static ITG * ne1
Definition: objectivemain_se.c:29
static ITG * ilboun1
Definition: objectivemain_se.c:29
static double * trab1
Definition: objectivemain_se.c:47
static double * xstaten1
Definition: objectivemain_se.c:47
static ITG * iendset1
Definition: objectivemain_se.c:29
void resultsstr(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, double *v, double *stn, ITG *inum, double *stx, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, double *prestr, ITG *iprestr, char *filab, double *eme, double *emn, double *een, ITG *iperturb, double *f, double *fn, ITG *nactdof, ITG *iout, double *qa, double *vold, double *b, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, char *labmpc, ITG *nmpc, ITG *nmethod, double *vmax, ITG *neq, double *veold, double *accold, double *beta, double *gamma, double *dtime, double *time, double *ttime, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstateini, double *xstiff, double *xstate, ITG *npmat_, double *epl, char *matname, ITG *mi, ITG *ielas, ITG *icmd, ITG *ncmat_, ITG *nstate_, double *stiini, double *vini, ITG *ikboun, ITG *ilboun, double *ener, double *enern, double *emeini, double *xstaten, double *eei, double *enerini, double *cocon, ITG *ncocon, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nprint, char *prlab, char *prset, double *qfx, double *qfn, double *trab, ITG *inotr, ITG *ntrans, double *fmpc, ITG *nelemload, ITG *nload, ITG *ikmpc, ITG *ilmpc, ITG *istep, ITG *iinc, double *springarea, double *reltime, ITG *ne0, double *xforc, ITG *nforc, double *thicke, double *shcon, ITG *nshcon, char *sideload, double *xload, double *xloadold, ITG *icfd, ITG *inomat, double *pslavsurf, double *pmastsurf, ITG *mortar, ITG *islavact, double *cdn, ITG *islavnode, ITG *nslavnode, ITG *ntie, double *clearini, ITG *islavsurf, ITG *ielprop, double *prop, double *energyini, double *energy, ITG *kscale, ITG *nener, char *orname, ITG *network, ITG *neapar, ITG *nebpar)
Definition: resultsstr.c:40
static ITG * neq1
Definition: objectivemain_se.c:29
static ITG * nboun1
Definition: objectivemain_se.c:29
static double * f1
Definition: objectivemain_se.c:47
subroutine writedeigdx(iev, d, ndesi, orname, dgdx)
Definition: writedeigdx.f:20
void * stress_senmt(ITG *i)
Definition: objectivemain_se.c:1231
static ITG * ielmat1
Definition: objectivemain_se.c:29
static ITG * nasym1
Definition: objectivemain_se.c:29
static ITG * nshcon1
Definition: objectivemain_se.c:29
static double * vold1
Definition: objectivemain_se.c:42
static double * distmin1
Definition: objectivemain_se.c:42
static ITG * ikboun1
Definition: objectivemain_se.c:29
static ITG * iinc1
Definition: objectivemain_se.c:29
static double * xforc1
Definition: objectivemain_se.c:47
static ITG * icfd1
Definition: objectivemain_se.c:29
static double * eei1
Definition: objectivemain_se.c:42
static ITG * nmpc1
Definition: objectivemain_se.c:29
static ITG * nodempc1
Definition: objectivemain_se.c:29
static char * labmpc1
Definition: objectivemain_se.c:26
static ITG * nforc1
Definition: objectivemain_se.c:29
static double * qfn1
Definition: objectivemain_se.c:47
static char * lakon1
Definition: objectivemain_se.c:26
void tau_solve(double *b, ITG *neq)
static ITG * mortar1
Definition: objectivemain_se.c:29
subroutine createinum(ipkon, inum, kon, lakon, nk, ne, cflag, nelemload, nload, nodeboun, nboun, ndirboun, ithermal, co, vold, mi, ielmat)
Definition: createinum.f:21
void spooles_factor(double *ad, double *au, double *adb, double *aub, double *sigma, ITG *icol, ITG *irow, ITG *neq, ITG *nzs, ITG *symmetryflag, ITG *inputformat, ITG *nzs3)
static ITG * ndirboun1
Definition: objectivemain_se.c:29
static ITG * islavact1
Definition: objectivemain_se.c:29
static double * elcon1
Definition: objectivemain_se.c:42
int pthread_join(pthread_t thread, void **status_ptr)
static ITG * nelcon1
Definition: objectivemain_se.c:29
void spooles_cleanup()
static ITG * ne01
Definition: objectivemain_se.c:29
static ITG * ncocon1
Definition: objectivemain_se.c:29
static double * epn1
Definition: objectivemain_se.c:47
static ITG * nslavnode1
Definition: objectivemain_se.c:29
static ITG * ilmpc1
Definition: objectivemain_se.c:29
static ITG * inotr1
Definition: objectivemain_se.c:29
static ITG * nodeboun1
Definition: objectivemain_se.c:29
static double * vini1
Definition: objectivemain_se.c:42
static ITG * nactdof1
Definition: objectivemain_se.c:29
static ITG * iprestr1
Definition: objectivemain_se.c:29
#define ITG
Definition: CalculiX.h:51
static ITG nestart1
Definition: objectivemain_se.c:29
static ITG * istartdesi1
Definition: objectivemain_se.c:29
static double * prop1
Definition: objectivemain_se.c:42
static double * thicke1
Definition: objectivemain_se.c:42
static double * energyini1
Definition: objectivemain_se.c:47
static ITG * islavsurf1
Definition: objectivemain_se.c:29
static char * matname1
Definition: objectivemain_se.c:26
void tau_factor(double *ad, double **aup, double *adb, double *aub, double *sigma, ITG *icol, ITG **irowp, ITG *neq, ITG *nzs)
void pardiso_solve(double *b, ITG *neq, ITG *symmetryflag)
static ITG * ielorien1
Definition: objectivemain_se.c:29
static char * filabl1
Definition: objectivemain_se.c:26
static double * xstiff1
Definition: objectivemain_se.c:42
subroutine rotationvector(a, v)
Definition: rotationvector.f:20
#define NNEW(a, b, c)
Definition: CalculiX.h:39
static ITG * nset1
Definition: objectivemain_se.c:29
static ITG iobject1
Definition: objectivemain_se.c:29
static ITG * nelemload1
Definition: objectivemain_se.c:29
static ITG num_cpuse
Definition: objectivemain_se.c:29
static double * shcon1
Definition: objectivemain_se.c:47
static double * gam1
Definition: objectivemain_se.c:47
static double * stn1
Definition: objectivemain_se.c:47
static double * xstate1
Definition: objectivemain_se.c:42
static double * springarea1
Definition: objectivemain_se.c:42
static ITG * nrhcon1
Definition: objectivemain_se.c:29
subroutine actideactistr(set, nset, istartset, iendset, ialset, objectset, ipkon, iobject, ne, neinset, iponoel, inoel, nepar)
Definition: actideactistr.f:22
static ITG * ipompc1
Definition: objectivemain_se.c:29
static ITG * nodedesi1
Definition: objectivemain_se.c:29
void * objectivemt_shapeener_dx(ITG *i)
Definition: objectivemain_se.c:1173
static char * prlab1
Definition: objectivemain_se.c:26
static ITG * ipkon1
Definition: objectivemain_se.c:29

◆ objectivemt_mass_dx()

void* objectivemt_mass_dx ( ITG i)
1205  {
1206 
1207  ITG nea,neb,nedelta,indexg0,indexdgdx;
1208 
1209  indexg0=*i**nobject1;
1210  indexdgdx=*i**nobject1**ndesi1;
1211 
1212  nedelta=(ITG)floor(*ne1/(double)num_cpuse);
1213  nea=*i*nedelta+1;
1214  neb=(*i+1)*nedelta;
1215  if((*i==num_cpuse-1)&&(neb<*ne1)) neb=*ne1;
1216 
1219  thicke1,mortar1,&nea,&neb,ielprop1,prop1,distmin1,ndesi1,nodedesi1,
1220  nobject1,&g01[indexg0],&dgdx1[indexdgdx],&iobject1,xmass1,
1222 
1223  return NULL;
1224 }
static double * g01
Definition: objectivemain_se.c:42
static double * co1
Definition: objectivemain_se.c:42
static double * dgdx1
Definition: objectivemain_se.c:42
static ITG * ielprop1
Definition: objectivemain_se.c:29
static double * xmass1
Definition: objectivemain_se.c:47
static ITG * ndesi1
Definition: objectivemain_se.c:29
subroutine objective_mass_dx(co, kon, ipkon, lakon, nelcon, rhcon, ielmat, ielorien, norien, ntmat_, matname, mi, thicke, mortar, nea, neb, ielprop, prop, distmin, ndesi, nodedesi, nobject, g0, dgdx, iobject, xmass, istartdesi, ialdesi, xdesi, idesvar)
Definition: objective_mass_dx.f:24
static ITG * ntmat1_
Definition: objectivemain_se.c:29
static double * xdesi1
Definition: objectivemain_se.c:42
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
static ITG idesvar1
Definition: objectivemain_se.c:29
static ITG * ialdesi1
Definition: objectivemain_se.c:29
static ITG * norien1
Definition: objectivemain_se.c:29
static double * rhcon1
Definition: objectivemain_se.c:42
static ITG * kon1
Definition: objectivemain_se.c:29
static ITG * nobject1
Definition: objectivemain_se.c:29
static ITG * mi1
Definition: objectivemain_se.c:29
static ITG * ne1
Definition: objectivemain_se.c:29
static ITG * ielmat1
Definition: objectivemain_se.c:29
static double * distmin1
Definition: objectivemain_se.c:42
static char * lakon1
Definition: objectivemain_se.c:26
static ITG * mortar1
Definition: objectivemain_se.c:29
static ITG * nelcon1
Definition: objectivemain_se.c:29
#define ITG
Definition: CalculiX.h:51
static ITG * istartdesi1
Definition: objectivemain_se.c:29
static double * prop1
Definition: objectivemain_se.c:42
static double * thicke1
Definition: objectivemain_se.c:42
static char * matname1
Definition: objectivemain_se.c:26
static ITG * ielorien1
Definition: objectivemain_se.c:29
static ITG iobject1
Definition: objectivemain_se.c:29
static ITG num_cpuse
Definition: objectivemain_se.c:29
static ITG * nodedesi1
Definition: objectivemain_se.c:29
static ITG * ipkon1
Definition: objectivemain_se.c:29

◆ objectivemt_shapeener_dx()

void* objectivemt_shapeener_dx ( ITG i)
1173  {
1174 
1175  ITG nea,neb,nedelta,indexg0,indexdgdx;
1176 
1177  indexg0=*i**nobject1;
1178  indexdgdx=*i**nobject1**ndesi1;
1179 
1180  nedelta=(ITG)floor(*ne1/(double)num_cpuse);
1181  nea=*i*nedelta+1;
1182  neb=(*i+1)*nedelta;
1183  if((*i==num_cpuse-1)&&(neb<*ne1)) neb=*ne1;
1184 
1194  &nea,&neb,ielprop1,prop1,distmin1,ndesi1,nodedesi1,
1195  nobject1,&g01[indexg0],&dgdx1[indexdgdx],&iobject1,sti1,xener1,
1197 
1198  return NULL;
1199 }
static double * g01
Definition: objectivemain_se.c:42
static double * emeini1
Definition: objectivemain_se.c:42
static ITG * ithermal1
Definition: objectivemain_se.c:29
static ITG nener1
Definition: objectivemain_se.c:29
static double * pmastsurf1
Definition: objectivemain_se.c:42
static double * xener1
Definition: objectivemain_se.c:47
static double * co1
Definition: objectivemain_se.c:42
static double * xstateini1
Definition: objectivemain_se.c:42
static ITG * nstate1_
Definition: objectivemain_se.c:29
static ITG * icmd1
Definition: objectivemain_se.c:29
static double * dgdx1
Definition: objectivemain_se.c:42
static double * enerini1
Definition: objectivemain_se.c:42
static double * t01
Definition: objectivemain_se.c:42
static ITG * nmethod1
Definition: objectivemain_se.c:29
static ITG * nalcon1
Definition: objectivemain_se.c:29
static double * t11
Definition: objectivemain_se.c:42
static ITG * ielprop1
Definition: objectivemain_se.c:29
static double * ener1
Definition: objectivemain_se.c:42
static ITG calcul_qa1
Definition: objectivemain_se.c:29
static ITG * ndesi1
Definition: objectivemain_se.c:29
static double * alzero1
Definition: objectivemain_se.c:42
static double * sti1
Definition: objectivemain_se.c:42
static ITG * ntmat1_
Definition: objectivemain_se.c:29
static double * xdesi1
Definition: objectivemain_se.c:42
static ITG * nplkcon1
Definition: objectivemain_se.c:29
static ITG * ncmat1_
Definition: objectivemain_se.c:29
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
static double * reltime1
Definition: objectivemain_se.c:42
static ITG * ielas1
Definition: objectivemain_se.c:29
static double * clearini1
Definition: objectivemain_se.c:42
static ITG idesvar1
Definition: objectivemain_se.c:29
static double * plicon1
Definition: objectivemain_se.c:42
static ITG * iout1
Definition: objectivemain_se.c:29
static double * time1
Definition: objectivemain_se.c:42
static ITG * ialdesi1
Definition: objectivemain_se.c:29
static ITG * norien1
Definition: objectivemain_se.c:29
static double * plkcon1
Definition: objectivemain_se.c:42
static double * veold1
Definition: objectivemain_se.c:42
subroutine objective_shapeener_dx(co, kon, ipkon, lakon, ne, stx, elcon, nelcon, rhcon, nrhcon, alcon, nalcon, alzero, ielmat, ielorien, norien, orab, ntmat_, t0, t1, ithermal, prestr, iprestr, iperturb, iout, vold, nmethod, veold, dtime, time, ttime, plicon, nplicon, plkcon, nplkcon, xstateini, xstiff, xstate, npmat_, matname, mi, ielas, icmd, ncmat_, nstate_, stiini, vini, ener, enerini, istep, iinc, springarea, reltime, calcul_qa, nener, ikin, ne0, thicke, emeini, pslavsurf, pmastsurf, mortar, clearini, nea, neb, ielprop, prop, distmin, ndesi, nodedesi, nobject, g0, dgdx, iobject, sti, xener, istartdesi, ialdesi, xdesi, idesvar)
Definition: objective_shapeener_dx.f:30
static ITG * npmat1_
Definition: objectivemain_se.c:29
static double * alcon1
Definition: objectivemain_se.c:42
static ITG * istep1
Definition: objectivemain_se.c:29
static ITG * iperturb1
Definition: objectivemain_se.c:29
static ITG ikin1
Definition: objectivemain_se.c:29
static double * prestr1
Definition: objectivemain_se.c:42
static double * ttime1
Definition: objectivemain_se.c:42
static double * rhcon1
Definition: objectivemain_se.c:42
static double * orab1
Definition: objectivemain_se.c:42
static double * stiini1
Definition: objectivemain_se.c:42
static ITG * kon1
Definition: objectivemain_se.c:29
static ITG * nobject1
Definition: objectivemain_se.c:29
static ITG * mi1
Definition: objectivemain_se.c:29
static double * stx1
Definition: objectivemain_se.c:42
static double * dtime1
Definition: objectivemain_se.c:42
static ITG * nplicon1
Definition: objectivemain_se.c:29
static double * pslavsurf1
Definition: objectivemain_se.c:42
static ITG * ne1
Definition: objectivemain_se.c:29
static ITG * ielmat1
Definition: objectivemain_se.c:29
static double * vold1
Definition: objectivemain_se.c:42
static double * distmin1
Definition: objectivemain_se.c:42
static ITG * iinc1
Definition: objectivemain_se.c:29
static char * lakon1
Definition: objectivemain_se.c:26
static ITG * mortar1
Definition: objectivemain_se.c:29
static double * elcon1
Definition: objectivemain_se.c:42
static ITG * nelcon1
Definition: objectivemain_se.c:29
static ITG * ne01
Definition: objectivemain_se.c:29
static double * vini1
Definition: objectivemain_se.c:42
static ITG * iprestr1
Definition: objectivemain_se.c:29
#define ITG
Definition: CalculiX.h:51
static ITG * istartdesi1
Definition: objectivemain_se.c:29
static double * prop1
Definition: objectivemain_se.c:42
static double * thicke1
Definition: objectivemain_se.c:42
static char * matname1
Definition: objectivemain_se.c:26
static ITG * ielorien1
Definition: objectivemain_se.c:29
static double * xstiff1
Definition: objectivemain_se.c:42
static ITG iobject1
Definition: objectivemain_se.c:29
static ITG num_cpuse
Definition: objectivemain_se.c:29
static double * xstate1
Definition: objectivemain_se.c:42
static double * springarea1
Definition: objectivemain_se.c:42
static ITG * nrhcon1
Definition: objectivemain_se.c:29
static ITG * nodedesi1
Definition: objectivemain_se.c:29
static ITG * ipkon1
Definition: objectivemain_se.c:29

◆ precontact()

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 
)
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 }
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:23
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:24
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
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:30
#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:6
#define ITG
Definition: CalculiX.h:51
#define NNEW(a, b, c)
Definition: CalculiX.h:39

◆ prediction()

void prediction ( double *  uam,
ITG nmethod,
double *  bet,
double *  gam,
double *  dtime,
ITG ithermal,
ITG nk,
double *  veold,
double *  accold,
double *  v,
ITG iinc,
ITG idiscon,
double *  vold,
ITG nactdof,
ITG mi 
)
36  {
37 
38  ITG j,k,mt=mi[1]+1;
39  double dextrapol,scal1,scal2;
40 
41  uam[0]=0.;
42  uam[1]=0.;
43  if(*nmethod==4){
44 
45  scal1=0.5*(1.-2.**bet)**dtime**dtime;
46  scal2=(1.-*gam)**dtime;
47 
48  if(*ithermal<2){
49  for(k=0;k<*nk;++k){
50  for(j=0;j<mt;j++){
51  dextrapol=*dtime*veold[mt*k+j]+scal1*accold[mt*k+j];
52  if((fabs(dextrapol)>uam[0])&&(nactdof[mt*k+j]>0)) {uam[0]=fabs(dextrapol);}
53  v[mt*k+j]=vold[mt*k+j]+dextrapol;
54  veold[mt*k+j]=veold[mt*k+j]+scal2*accold[mt*k+j];
55  accold[mt*k+j]=0.;
56  }
57  }
58  }else if(*ithermal==2){
59  for(k=0;k<*nk;++k){
60  for(j=0;j<mt;j++){
61  v[mt*k+j]=vold[mt*k+j];
62  }
63  }
64  for(k=0;k<*nk;++k){
65  dextrapol=*dtime*veold[mt*k];
66  if(fabs(dextrapol)>100.) dextrapol=100.*dextrapol/fabs(dextrapol);
67  if((fabs(dextrapol)>uam[1])&&(nactdof[mt*k]>0)) {uam[1]=fabs(dextrapol);}
68  v[mt*k]+=dextrapol;
69  }
70  }else{
71  for(k=0;k<*nk;++k){
72  for(j=0;j<mt;++j){
73  dextrapol=*dtime*veold[mt*k+j]+scal1*accold[mt*k+j];
74  if((j==0)&&fabs(dextrapol)>100.) dextrapol=100.*dextrapol/fabs(dextrapol);
75  if(j==0){
76  if((fabs(dextrapol)>uam[1])&&(nactdof[mt*k]>0)) {uam[1]=fabs(dextrapol);}
77  }else{
78  if((fabs(dextrapol)>uam[0])&&(nactdof[mt*k+j]>0)) {uam[0]=fabs(dextrapol);}
79  }
80  v[mt*k+j]=vold[mt*k+j]+dextrapol;
81  veold[mt*k+j]=veold[mt*k+j]+scal2*accold[mt*k+j];
82  accold[mt*k+j]=0.;
83  }
84  }
85  }
86  }
87 
88  /* for the static case: extrapolation of the previous increment
89  (if any within the same step) */
90 
91  else{
92  if(*iinc>1){
93  if(*ithermal<2){
94  for(k=0;k<*nk;++k){
95  for(j=0;j<mt;++j){
96  if(*idiscon==0){
97  dextrapol=*dtime*veold[mt*k+j];
98  if((fabs(dextrapol)>uam[0])&&(nactdof[mt*k+j]>0)) {uam[0]=fabs(dextrapol);}
99  v[mt*k+j]=vold[mt*k+j]+dextrapol;
100  }else{
101  v[mt*k+j]=vold[mt*k+j];
102  }
103  }
104  }
105  }else if(*ithermal==2){
106  for(k=0;k<*nk;++k){
107  for(j=0;j<mt;++j){
108  v[mt*k+j]=vold[mt*k+j];
109  }
110  }
111  for(k=0;k<*nk;++k){
112  if(*idiscon==0){
113  dextrapol=*dtime*veold[mt*k];
114  if(fabs(dextrapol)>100.) dextrapol=100.*dextrapol/fabs(dextrapol);
115  if((fabs(dextrapol)>uam[1])&&(nactdof[mt*k]>0)) {uam[1]=fabs(dextrapol);}
116  v[mt*k]+=dextrapol;
117  }
118  }
119  }else{
120  for(k=0;k<*nk;++k){
121  for(j=0;j<mt;++j){
122  if(*idiscon==0){
123  dextrapol=*dtime*veold[mt*k+j];
124  if((j==0)&&fabs(dextrapol)>100.) dextrapol=100.*dextrapol/fabs(dextrapol);
125  if(j==0){
126  if((fabs(dextrapol)>uam[1])&&(nactdof[mt*k+j]>0)) {uam[1]=fabs(dextrapol);}
127  }else{
128  if((fabs(dextrapol)>uam[0])&&(nactdof[mt*k+j]>0)) {uam[0]=fabs(dextrapol);}
129  }
130  v[mt*k+j]=vold[mt*k+j]+dextrapol;
131  }else{
132  v[mt*k+j]=vold[mt*k+j];
133  }
134  }
135  }
136  }
137  }
138  else{
139  for(k=0;k<*nk;++k){
140  for(j=0;j<mt;++j){
141  v[mt*k+j]=vold[mt*k+j];
142  }
143  }
144  }
145  }
146  *idiscon=0;
147 
148  return;
149 }
#define ITG
Definition: CalculiX.h:51

◆ prediction_em()

void prediction_em ( double *  uam,
ITG nmethod,
double *  bet,
double *  gam,
double *  dtime,
ITG ithermal,
ITG nk,
double *  veold,
double *  v,
ITG iinc,
ITG idiscon,
double *  vold,
ITG nactdof,
ITG mi 
)
36  {
37 
38  ITG j,k,mt=mi[1]+1,jstart;
39  double dextrapol;
40 
41  uam[0]=0.;
42  uam[1]=0.;
43 
44  if(*ithermal<2){
45  jstart=1;
46  }else{
47  jstart=0;
48  }
49 
50  if(*nmethod==4){
51  for(k=0;k<*nk;++k){
52  for(j=jstart;j<mt;j++){
53  dextrapol=*dtime*veold[mt*k+j];
54  if(fabs(dextrapol)>100.) dextrapol=100.*dextrapol/fabs(dextrapol);
55  if(j==0){
56  if((fabs(dextrapol)>uam[1])&&(nactdof[mt*k]>0)) {uam[1]=fabs(dextrapol);}
57  }
58  v[mt*k+j]=vold[mt*k+j]+dextrapol;
59  }
60  }
61  }
62 
63  /* for the static case: extrapolation of the previous increment
64  (if any within the same step) */
65 
66  else{
67  if(*iinc>1){
68  for(k=0;k<*nk;++k){
69  for(j=jstart;j<mt;j++){
70  if(*idiscon==0){
71  dextrapol=*dtime*veold[mt*k+j];
72  if(fabs(dextrapol)>100.) dextrapol=100.*dextrapol/fabs(dextrapol);
73  if(j==0){
74  if((fabs(dextrapol)>uam[1])&&(nactdof[mt*k]>0)) {uam[1]=fabs(dextrapol);}
75  }
76  v[mt*k+j]=vold[mt*k+j]+dextrapol;
77  }else{
78  v[mt*k+j]=vold[mt*k+j];
79  }
80  }
81  }
82  }
83  else{
84  for(k=0;k<*nk;++k){
85  for(j=jstart;j<mt;j++){
86  v[mt*k+j]=vold[mt*k+j];
87  }
88  }
89  }
90  }
91  *idiscon=0;
92 
93  return;
94 }
#define ITG
Definition: CalculiX.h:51

◆ preiter()

void preiter ( double *  ad,
double **  aup,
double *  b,
ITG **  icolp,
ITG **  irowp,
ITG neq,
ITG nzs,
ITG isolver,
ITG iperturb 
)
24  {
25 
26  ITG precFlg,niter=5000000,ndim,i,j,k,ier,*icol=NULL,*irow=NULL,
27  *irow_save=NULL,*icol_save=NULL;
28  double eps=1.e-4,*u=NULL,*au=NULL;
29 
30  if(*neq==0) return;
31 
32  /* icol(i) = # subdiagonal nonzeros in column i (i=1,neq)
33  irow(i) = row number of entry i in au (i=1,nzs)
34  ad(i) = diagonal term in column i of the matrix
35  au(i) = subdiagonal nonzero term i; the terms are entered
36  column per column */
37 
38  au=*aup;
39  irow=*irowp;
40  icol=*icolp;
41 
42  if(*iperturb>1){
43  NNEW(irow_save,ITG,*nzs);
44  NNEW(icol_save,ITG,*neq);
45  for(i=0;i<*nzs;++i){
46  irow_save[i]=irow[i];
47  }
48  for(i=0;i<*neq;++i){
49  icol_save[i]=icol[i];
50  }
51  }
52 
53  if(*isolver==2) {precFlg=0;}
54  else {precFlg=3;}
55 
56  ndim=*neq+*nzs;
57 
58  RENEW(au,double,ndim);
59  RENEW(irow,ITG,ndim);
60  RENEW(icol,ITG,ndim);
61 
62  k=*nzs;
63  for(i=*neq-1;i>=0;--i){
64  for(j=0;j<icol[i];++j){
65  icol[--k]=i+1;
66  }
67  }
68 
69  k=*nzs;
70  j=0;
71  for(i=0;i<*neq;++i){
72  au[k]=ad[i];
73  irow[k]=++j;
74  icol[k]=j;
75  ++k;
76  }
77 
78  /* rearranging the storage of the left hand side */
79 
80  FORTRAN(rearrange,(au,irow,icol,&ndim,neq));
81 
82  RENEW(irow,ITG,*neq);
83 
84  NNEW(u,double,*neq);
85 
86  ier=cgsolver(au,u,b,*neq,ndim,icol,irow,&eps,&niter,precFlg);
87 
88  printf("error condition (0=good, 1=bad) = %" ITGFORMAT "\n",ier);
89  printf("# of iterations = %" ITGFORMAT "\n",niter);
90 
91  for(i=0;i<*neq;++i){
92  b[i]=u[i];
93  }
94 
95  SFREE(u);
96 
97  if(*iperturb>1){
98  RENEW(irow,ITG,*nzs);
99  RENEW(icol,ITG,*neq);
100  for(i=0;i<*nzs;++i){
101  irow[i]=irow_save[i];
102  }
103  for(i=0;i<*neq;++i){
104  icol[i]=icol_save[i];
105  }
106  SFREE(irow_save);SFREE(icol_save);
107  }
108 
109  *aup=au;
110  *irowp=irow;
111  *icolp=icol;
112 
113  return;
114 }
#define ITGFORMAT
Definition: CalculiX.h:52
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
ITG cgsolver(double *A, double *x, double *b, ITG neq, ITG len, ITG *ia, ITG *iz, double *eps, ITG *niter, ITG precFlg)
Definition: pcgsolver.c:70
#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
subroutine rearrange(au, irow, icol, ndim, neq)
Definition: rearrange.f:20

◆ projectgradmain()

void projectgradmain ( ITG nobject,
char *  objectset,
double *  dgdxglob,
double *  g0,
ITG ndesi,
ITG nodedesi,
ITG nk,
ITG isolver,
ITG nactive,
ITG nnlconst,
ITG ipoacti 
)

◆ pthread_create()

int pthread_create ( pthread_t *  thread_id,
const pthread_attr_t *  attributes,
void *(*)(void *)  thread_function,
void *  arguments 
)

◆ pthread_join()

int pthread_join ( pthread_t  thread,
void **  status_ptr 
)

◆ radcyc()

void radcyc ( ITG nk,
ITG kon,
ITG ipkon,
char *  lakon,
ITG ne,
double *  cs,
ITG mcs,
ITG nkon,
ITG ialset,
ITG istartset,
ITG iendset,
ITG **  kontrip,
ITG ntri,
double **  cop,
double **  voldp,
ITG ntrit,
ITG inocs,
ITG mi 
)
28  {
29 
30  /* duplicates triangular faces for cyclic radiation conditions */
31 
32  char *filab=NULL;
33 
34  ITG i,is,nsegments,idtie,nkt,icntrl,imag=0,*kontri=NULL,mt=mi[1]+1,
35  node,i1,i2,nope,iel,indexe,j,k,ielset,node1,node2,node3,l,jj;
36 
37  double *vt=NULL,*fnt=NULL,*stnt=NULL,*eent=NULL,*qfnt=NULL,t[3],theta,
38  pi,*v=NULL,*fn=NULL,*stn=NULL,*een=NULL,*qfn=NULL,*co=NULL,
39  *vold=NULL,*emnt=NULL,*emn=NULL;
40 
41  pi=4.*atan(1.);
42 
43  kontri=*kontrip;co=*cop;vold=*voldp;
44 
45  /* determining the maximum number of sectors */
46 
47  nsegments=1;
48  for(j=0;j<*mcs;j++){
49  if(cs[17*j]>nsegments) nsegments=(ITG)(cs[17*j]);
50  }
51 
52  /* assigning nodes and elements to sectors */
53 
54  ielset=cs[12];
55  if((*mcs!=1)||(ielset!=0)){
56  for(i=0;i<*nk;i++) inocs[i]=-1;
57  }
58 
59  for(i=0;i<*mcs;i++){
60  is=cs[17*i+4];
61  if(is==1) continue;
62  ielset=cs[17*i+12];
63  if(ielset==0) continue;
64  for(i1=istartset[ielset-1]-1;i1<iendset[ielset-1];i1++){
65  if(ialset[i1]>0){
66  iel=ialset[i1]-1;
67  if(ipkon[iel]<0) continue;
68  indexe=ipkon[iel];
69  if(strcmp1(&lakon[8*iel+3],"2")==0)nope=20;
70  else if (strcmp1(&lakon[8*iel+3],"8")==0)nope=8;
71  else if (strcmp1(&lakon[8*iel+3],"10")==0)nope=10;
72  else if (strcmp1(&lakon[8*iel+3],"4")==0)nope=4;
73  else if (strcmp1(&lakon[8*iel+3],"15")==0)nope=15;
74  else {nope=6;}
75  for(i2=0;i2<nope;++i2){
76  node=kon[indexe+i2]-1;
77  inocs[node]=i;
78  }
79  }
80  else{
81  iel=ialset[i1-2]-1;
82  do{
83  iel=iel-ialset[i1];
84  if(iel>=ialset[i1-1]-1) break;
85  if(ipkon[iel]<0) continue;
86  indexe=ipkon[iel];
87  if(strcmp1(&lakon[8*iel+3],"2")==0)nope=20;
88  else if (strcmp1(&lakon[8*iel+3],"8")==0)nope=8;
89  else if (strcmp1(&lakon[8*iel+3],"10")==0)nope=10;
90  else if (strcmp1(&lakon[8*iel+3],"4")==0)nope=4;
91  else if (strcmp1(&lakon[8*iel+3],"15")==0)nope=15;
92  else {nope=6;}
93  for(i2=0;i2<nope;++i2){
94  node=kon[indexe+i2]-1;
95  inocs[node]=i;
96  }
97  }while(1);
98  }
99  }
100  }
101 
102  /* duplicating triangular faces
103  only those faces are duplicated the nodes of which belong to
104  the same cyclic symmetry. non-integer cyclic symmety numbers are
105  reduced to the next lower integer. */
106 
107  *ntrit=nsegments**ntri;
108  RENEW(kontri,ITG,4**ntrit);
109  for(i=4**ntri;i<4**ntrit;i++) kontri[i]=0;
110 
111  for(i=0;i<*ntri;i++){
112  node1=kontri[4*i];
113  if(inocs[node1-1]<0) continue;
114  idtie=inocs[node1-1];
115  node2=kontri[4*i+1];
116  if((inocs[node2-1]<0)||(inocs[node2-1]!=idtie)) continue;
117  node3=kontri[4*i+2];
118  if((inocs[node3-1]<0)||(inocs[node3-1]!=idtie)) continue;
119  idtie=cs[17*idtie];
120  for(k=1;k<idtie;k++){
121  j=i+k**ntri;
122  kontri[4*j]=node1+k**nk;
123  kontri[4*j+1]=node2+k**nk;
124  kontri[4*j+2]=node3+k**nk;
125  kontri[4*j+3]=kontri[4*i+3];
126  }
127  }
128 
129  RENEW(co,double,3**nk*nsegments);
130  RENEW(vold,double,mt**nk*nsegments);
131  nkt=*nk*nsegments;
132 
133  /* generating the coordinates for the other sectors */
134 
135  icntrl=1;
136 
137  FORTRAN(rectcyl,(co,v,fn,stn,qfn,een,cs,nk,&icntrl,t,filab,&imag,mi,emn));
138 
139  for(jj=0;jj<*mcs;jj++){
140  is=(ITG)(cs[17*jj]);
141  for(i=1;i<is;i++){
142 
143  theta=i*2.*pi/cs[17*jj];
144 
145  for(l=0;l<*nk;l++){
146  if(inocs[l]==jj){
147  co[3*l+i*3**nk]=co[3*l];
148  co[1+3*l+i*3**nk]=co[1+3*l]-theta;
149  co[2+3*l+i*3**nk]=co[2+3*l];
150  }
151  }
152  }
153  }
154 
155  icntrl=-1;
156 
157  FORTRAN(rectcyl,(co,vt,fnt,stnt,qfnt,eent,cs,&nkt,&icntrl,t,filab,
158  &imag,mi,emnt));
159 
160  *kontrip=kontri;*cop=co;*voldp=vold;
161 
162  return;
163 }
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
ITG strcmp1(const char *s1, const char *s2)
Definition: strcmp1.c:24
#define RENEW(a, b, c)
Definition: CalculiX.h:40
#define ITG
Definition: CalculiX.h:51
subroutine rectcyl(co, v, fn, stn, qfn, een, cs, n, icntrl, t, filab, imag, mi, emn)
Definition: rectcyl.f:21

◆ radflowload()

void radflowload ( ITG itg,
ITG ieg,
ITG ntg,
ITG ntr,
double *  adrad,
double *  aurad,
double *  bcr,
ITG ipivr,
double *  ac,
double *  bc,
ITG nload,
char *  sideload,
ITG nelemload,
double *  xloadact,
char *  lakon,
ITG ipiv,
ITG ntmat_,
double *  vold,
double *  shcon,
ITG nshcon,
ITG ipkon,
ITG kon,
double *  co,
ITG kontri,
ITG ntri,
ITG nloadtr,
double *  tarea,
double *  tenv,
double *  physcon,
double *  erad,
double **  adviewp,
double **  auviewp,
ITG nflow,
ITG ikboun,
double *  xboun,
ITG nboun,
ITG ithermal,
ITG iinc,
ITG iit,
double *  cs,
ITG mcs,
ITG inocs,
ITG ntrit,
ITG nk,
double *  fenv,
ITG istep,
double *  dtime,
double *  ttime,
double *  time,
ITG ilboun,
ITG ikforc,
ITG ilforc,
double *  xforc,
ITG nforc,
double *  cam,
ITG ielmat,
ITG nteq,
double *  prop,
ITG ielprop,
ITG nactdog,
ITG nacteq,
ITG nodeboun,
ITG ndirboun,
ITG network,
double *  rhcon,
ITG nrhcon,
ITG ipobody,
ITG ibody,
double *  xbody,
ITG nbody,
ITG iviewfile,
char *  jobnamef,
double *  ctrl,
double *  xloadold,
double *  reltime,
ITG nmethod,
char *  set,
ITG mi,
ITG istartset,
ITG iendset,
ITG ialset,
ITG nset,
ITG ineighe,
ITG nmpc,
ITG nodempc,
ITG ipompc,
double *  coefmpc,
char *  labmpc,
ITG iemchange,
ITG nam,
ITG iamload,
ITG jqrad,
ITG irowrad,
ITG nzsrad,
ITG icolrad,
ITG ne,
ITG iaxial,
double *  qa,
double *  cocon,
ITG ncocon,
ITG iponoel,
ITG inoel,
ITG nprop,
char *  amname,
ITG namta,
double *  amta 
)
73  {
74 
75  /* network=0: no network
76  network=1: purely thermal (presence of "Dx"- and/or of "D " network elements; declared
77  by the user to be purely thermal (on the *STEP card); simultaneous solution)
78  network=2: purely thermal (alternating solution; this becomes a simultaneous solution in
79  the absence of "Dx"-elements)
80  network=3: general case (temperatures, fluxes and pressures unknown)
81  network=4: purely aerodynamic, i.e. only fluxes and pressures unknown
82 
83  "D "-elements (D followed by a blank) alone do not trigger the alternating solution
84  (are not counted in envtemp.f as true network elements) */
85 
86  ITG nhrs=1,info=0,i,j,iin=0,icntrl,icutb=0,iin_abs=0,mt=mi[1]+1,im,
87  symmetryflag=2,inputformat=1,node,channel,*ithread=NULL,iplausi;
88 
89  static ITG ifactorization=0;
90 
91  double camt[2],camf[2],camp[2],qat,qaf,ramt,ramf,ramp,
92  cam1t=0.,cam1f=0.,cam1p=0.,sidemean,qa0,qau,ea,*prop_store=NULL,
93  cam2t=0.,cam2f=0.,cam2p=0.,dtheta=1.,*v=NULL,cama[2],cam1a=0.,
94  cam2a=0.,vamt=0.,vamf=0.,vamp=0.,vama=0.,cam0t=0.,cam0f=0.,
95  cam0p=0.,cam0a=0.,sigma=0.,*adbrad=NULL,*aubrad=NULL,*q=NULL,
96  *area=NULL,*pmid=NULL,*e1=NULL,*e2=NULL,*e3=NULL,
97  qamt,qamf,qamtold,qamfold;
98 
99  adview=*adviewp;auview=*auviewp;
100 
101  qa0=ctrl[20];qau=ctrl[21];ea=ctrl[23];
102 
103  /* check whether there are any gas temperature nodes; this check should
104  NOT be done on nteq, since also for zero equations the temperature
105  of the gas nodes with boundary conditions must be stored in v
106  (in initialgas) */
107 
108  NNEW(v,double,mt**nk);
109 
110  /* gas networks */
111 
112  if(*ntg!=0) {
113 #ifdef COMPANY
114  NNEW(prop_store,double,*nprop);
115  memcpy(&prop_store[0],&prop[0],sizeof(double)**nprop);
116  FORTRAN(propertynet,(ieg,nflow,prop,ielprop,lakon,&iin,
117  prop_store,ttime,time,nam,amname,namta,amta));
118  FORTRAN(checkinputvaluesnet,(ieg,nflow,prop,ielprop,lakon));
119 #else
120  if(*iit==-1) FORTRAN(checkinputvaluesnet,(ieg,nflow,prop,ielprop,lakon));
121 #endif
122  icntrl=0;
123  while(icntrl==0) {
124 
125  if(iin==0){
126 
127  memcpy(&v[0],&vold[0],sizeof(double)*mt**nk);
128 
129  /* resetting ineighe to 0 for renewed call of
130  radflowload (not for cut-backs without
131  leaving radflowload */
132 
133  /* for a cut-back iin is reset to 0, iin_abs is not */
134 
135  if(iin_abs==0) DMEMSET(ineighe,0,*ntg,0);
136 
137 // for(i=0;i<mt**nk;i++) v[i]=vold[i];
138 
139  /* initialization pressurized flow
140  (no free surface: gas networks or
141  water networks with fully wetted perimeter*/
142 
143  FORTRAN(initialnet,(itg,ieg,ntg,ac,bc,lakon,v,
144  ipkon,kon,nflow,
145  ikboun,nboun,prop,ielprop,nactdog,ndirboun,
146  nodeboun,xbounact,ielmat,ntmat_,shcon,nshcon,
147  physcon,ipiv,nteq,rhcon,nrhcon,ipobody,ibody,
148  xbodyact,co,nbody,network,&iin_abs,vold,set,
149  istep,iit,mi,ineighe,ilboun,&channel,iaxial,
150  nmpc,labmpc,ipompc,nodempc,coefmpc,ttime,time,
151  iponoel,inoel));
152 
153  /* initialization for channels with free surface */
154 
155  if(channel==1){
156  FORTRAN(initialchannel,(itg,ieg,ntg,ac,bc,lakon,v,
157  ipkon,kon,nflow,
158  ikboun,nboun,prop,ielprop,nactdog,ndirboun,
159  nodeboun,xbounact,ielmat,ntmat_,shcon,nshcon,
160  physcon,ipiv,nteq,rhcon,nrhcon,ipobody,ibody,
161  xbodyact,co,nbody,network,&iin_abs,vold,set,
162  istep,iit,mi,ineighe,ilboun,ttime,time,iaxial));
163  }
164 
165  /* storing the residual in the rhs vector */
166 
167  FORTRAN(resultnet,(itg,ieg,ntg,bc,nload,sideload,
168  nelemload,xloadact,
169  lakon,ntmat_,v,shcon,nshcon,ipkon,kon,co,nflow,
170  iinc,istep,dtime,ttime,time,
171  ikforc,ilforc,xforcact,
172  nforc,ielmat,nteq,prop,ielprop,nactdog,nacteq,&iin,
173  physcon,camt,camf,camp,rhcon,nrhcon,ipobody,
174  ibody,xbodyact,nbody,&dtheta,vold,xloadold,
175  reltime,nmethod,set,mi,ineighe,cama,&vamt,
176  &vamf,&vamp,&vama,nmpc,nodempc,ipompc,coefmpc,
177  labmpc,iaxial,&qat,&qaf,&ramt,&ramf,&ramp,
178  cocon,ncocon,iponoel,inoel,&iplausi));
179 
180  /* iniializing qamt and qamf (mean typical energy flow
181  and mass flow */
182 
183  if(qau>1.e-10){qamt=qau;}
184  else if(qa0>1.e-10){qamt=qa0;}
185  else if(qat>1.e-10){qamt=qat;}
186  else {qamt=1.e-2;}
187 
188  if(qau>1.e-10){qamf=qau;}
189  else if(qa0>1.e-10){qamf=qa0;}
190  else if(qaf>1.e-10){qamf=qaf;}
191  else {qamf=1.e-2;}
192  }
193 
194  iin++;
195  iin_abs++;
196  printf(" gas iteration %" ITGFORMAT " \n \n",iin);
197 
198  /* store actual values of typical energy flow and
199  mass flow */
200 
201  qamtold=qamt;
202  qamfold=qamf;
203 
204  /* filling the lhs matrix */
205 
206  FORTRAN(mafillnet,(itg,ieg,ntg,ac,nload,sideload,
207  nelemload,xloadact,lakon,ntmat_,v,
208  shcon,nshcon,ipkon,kon,co,nflow,iinc,
209  istep,dtime,ttime,time,
210  ielmat,nteq,prop,ielprop,nactdog,nacteq,
211  physcon,rhcon,nrhcon,ipobody,ibody,xbodyact,
212  nbody,vold,xloadold,reltime,nmethod,set,mi,
213  nmpc,nodempc,ipompc,coefmpc,labmpc,iaxial,
214  cocon,ncocon,iponoel,inoel));
215 
216  /* solving the system of equations */
217 
218  if(*nteq>0){
219  FORTRAN(dgesv,(nteq,&nhrs,ac,nteq,ipiv,bc,nteq,&info));
220  }
221 
222  /*spooles(ac,au,adb,aub,&sigma,bc,icol,irow,nteq,nteq,
223  &symmetryflag,&inputformat);*/
224 
225  if (info!=0) {
226  printf(" *WARNING in radflowload: singular matrix\n");
227 
228  FORTRAN(mafillnet,(itg,ieg,ntg,ac,nload,sideload,
229  nelemload,xloadact,lakon,ntmat_,v,
230  shcon,nshcon,ipkon,kon,co,nflow,iinc,
231  istep,dtime,ttime,time,
232  ielmat,nteq,prop,ielprop,nactdog,nacteq,
233  physcon,rhcon,nrhcon,ipobody,ibody,xbodyact,
234  nbody,vold,xloadold,reltime,nmethod,set,mi,
235  nmpc,nodempc,ipompc,coefmpc,labmpc,iaxial,
236  cocon,ncocon,iponoel,inoel));
237 
238  FORTRAN(equationcheck,(ac,nteq,nactdog,itg,ntg,nacteq,network));
239 
240  iin=0;
241 
242  }
243  else {
244 
245  /* storing the residual in the rhs vector */
246 
247  FORTRAN(resultnet,(itg,ieg,ntg,bc,nload,sideload,nelemload,
248  xloadact,lakon,ntmat_,v,shcon,nshcon,ipkon,kon,co,
249  nflow,iinc,istep,dtime,ttime,time,ikforc,ilforc,xforcact,
250  nforc,ielmat,nteq,prop,ielprop,nactdog,nacteq,
251  &iin,physcon,camt,camf,camp,rhcon,nrhcon,ipobody,
252  ibody,xbodyact,nbody,&dtheta,vold,xloadold,
253  reltime,nmethod,set,mi,ineighe,cama,&vamt,
254  &vamf,&vamp,&vama,nmpc,nodempc,ipompc,coefmpc,labmpc,
255  iaxial,&qat,&qaf,&ramt,&ramf,&ramp,cocon,ncocon,iponoel,
256  inoel,&iplausi));
257 
258  /* updating the mean typical energy flow and mass flow */
259 
260  if(qau<1.e-10){
261  if(qat>ea*qamt){qamt=(qamtold*iin+qat)/(iin+1);}
262  else {qamt=qamtold;}
263  if(qaf>ea*qamf){qamf=(qamfold*iin+qaf)/(iin+1);}
264  else {qamf=qamfold;}
265  }
266 
267  /* printing the largest corrections */
268 
269  if(*network!=4){
270  cam2t=cam1t;
271  cam1t=cam0t;
272  cam0t=camt[0];
273  printf
274  (" mean typical energy flow since start of network iterations= %e\n",qamt);
275  printf
276  (" largest energy flow residual in present network iteration= %e\n",ramt);
277  printf
278  (" largest change of gas temperature since start of network iteratons= %e\n",vamt);
279  if((ITG)camt[1]==0){
280  printf
281  (" largest correction to gas temperature in present network iteration= %e\n\n",
282  camt[0]);
283  }else{
284  printf
285  (" largest correction to gas temperature= %e in node %" ITGFORMAT "\n\n",
286  camt[0],(ITG)camt[1]);
287  }
288  }
289 
290  if(*network>2){
291  cam2f=cam1f;
292  cam1f=cam0f;
293  cam0f=camf[0];
294  printf
295  (" mean typical mass flow since start of network iterations= %e\n",qamf);
296  printf
297  (" largest mass flow residual in present network iteration= %e\n",ramf);
298  printf(" largest change of gas massflow since start of network iterations= %e\n",vamf);
299  if((ITG)camf[1]==0){
300  printf(" largest correction to gas massflow in present network iteration= %e\n\n",
301  camf[0]);
302  }else{
303  printf(" largest correction to gas massflow= %e in node %" ITGFORMAT "\n\n",
304  camf[0],(ITG)camf[1]);
305  }
306 
307  cam2p=cam1p;
308  cam1p=cam0p;
309  cam0p=camp[0];
310  printf
311  (" largest element equation residual in present network iteration= %e\n",ramp);
312  printf(" largest change of gas pressure since start of network iterations= %e\n",vamp);
313  if((ITG)camp[1]==0){
314  printf(" largest correction to gas pressure in present network iteration= %e\n\n",
315  camp[0]);
316  }else{
317  printf(" largest correction to gas pressure= %e in node %" ITGFORMAT "\n\n",
318  camp[0],(ITG)camp[1]);
319  }
320 
321  cam2a=cam1a;
322  cam1a=cam0a;
323  cam0a=cama[0];
324  printf(" largest change of geometry since start of network iterations= %e\n",vama);
325  if((ITG)cama[1]==0){
326  printf(" largest correction to geometry in present network iteration= %e\n",
327  cama[0]);
328  }else{
329  printf(" largest correction to geometry= %e in node %" ITGFORMAT "\n",
330  cama[0],(ITG)cama[1]);
331  }
332  }
333  }
334 
335  printf("\n");
336 
337  /* for purely thermal calculations no iterations are
338  deemed necessary */
339 
340  if(*network<=2) {icntrl=1;}
341  else {
342 
343  /* check the convergence */
344 
345  checkconvnet(&icutb,&iin,
346  &cam1t,&cam1f,&cam1p,&cam2t,&cam2f,&cam2p,&cam0t,&cam0f,
347  &cam0p,&icntrl,&dtheta,ctrl,&cam1a,&cam2a,&cam0a,
348  &vamt,&vamf,&vamp,&vama,qa,&qamt,&qamf,&ramt,&ramf,&ramp,
349  &iplausi);
350  }
351  }
352 
353  /* storing network output as boundary conditions for
354  the structure */
355 
356  FORTRAN(flowresult,(ntg,itg,cam,vold,v,nload,sideload,
357  nelemload,xloadact,nactdog,network,mi,ne,ipkon,lakon,kon));
358 
359  /* extra output for hydraulic jump (fluid channels) */
360 
361 #ifdef NETWORKOUT
362  if(*network>2){
363  FORTRAN(flowoutput,(itg,ieg,ntg,nteq,bc,lakon,ntmat_,
364  v,shcon,nshcon,ipkon,kon,co,nflow, dtime,ttime,time,
365  ielmat,prop,ielprop,nactdog,nacteq,&iin,physcon,
366  camt,camf,camp,rhcon,nrhcon,
367  vold,jobnamef,set,istartset,iendset,ialset,nset,
368  mi,iaxial,istep,iit));
369  }
370 #endif
371 #ifdef COMPANY
372  memcpy(&prop[0],&prop_store[0],sizeof(double)**nprop);
373  SFREE(prop_store);
374 #endif
375  }
376 
377  /* radiation */
378 
379  if(*ntr>0){
380 
381  /* variables for multithreading procedure */
382 
383  ITG sys_cpus;
384  char *env,*envloc,*envsys;
385 
386  num_cpus = 0;
387  sys_cpus=0;
388 
389  /* explicit user declaration prevails */
390 
391  envsys=getenv("NUMBER_OF_CPUS");
392  if(envsys){
393  sys_cpus=atoi(envsys);
394  if(sys_cpus<0) sys_cpus=0;
395  }
396 
397  /* automatic detection of available number of processors */
398 
399  if(sys_cpus==0){
400  sys_cpus = getSystemCPUs();
401  if(sys_cpus<1) sys_cpus=1;
402  }
403 
404  /* local declaration prevails, if strictly positive */
405 
406  envloc = getenv("CCX_NPROC_VIEWFACTOR");
407  if(envloc){
408  num_cpus=atoi(envloc);
409  if(num_cpus<0){
410  num_cpus=0;
411  }else if(num_cpus>sys_cpus){
412  num_cpus=sys_cpus;
413  }
414 
415  }
416 
417  /* else global declaration, if any, applies */
418 
419  env = getenv("OMP_NUM_THREADS");
420  if(num_cpus==0){
421  if (env)
422  num_cpus = atoi(env);
423  if (num_cpus < 1) {
424  num_cpus=1;
425  }else if(num_cpus>sys_cpus){
426  num_cpus=sys_cpus;
427  }
428  }
429 
430 // next line is to be inserted in a similar way for all other paralell parts
431 
432  if(*ntr<num_cpus) num_cpus=*ntr;
433 
434  pthread_t tid[num_cpus];
435 
436  /*the default sink temperature is updated at the start of each
437  increment */
438 
439  for(i=0;i<*ntr;i++){
440  node=nelemload[2*nloadtr[i]-1];
441  if(node!=0){
442  tenv[i]=vold[mt*(node-1)]-physcon[0];
443  }else if(*iit<=0){
444  tenv[i]=xloadact[2*nloadtr[i]-1]-physcon[0];
445  }
446  }
447 
448 /* for pure thermal steps the viewfactors have to be
449  calculated only once, for thermo-mechanical steps
450  (ithermal=3) they are recalculated in each iteration
451  unless they are read from file */
452 
453  if(((*ithermal==3)&&(*iviewfile>=0))||(*iit==-1)){
454  if(*iviewfile<0){
455 
456  /* reading viewfactors from file */
457 
458  FORTRAN(readview,(ntr,adview,auview,fenv,nzsrad,ithermal,
459  jobnamef));
460 
461  }else{
462 
463  /* determining geometric data to calculate the viewfactors */
464 
465  NNEW(area,double,*ntrit);
466  NNEW(pmid,double,3**ntrit);
467  NNEW(e1,double,3**ntrit);
468  NNEW(e2,double,3**ntrit);
469  NNEW(e3,double,4**ntrit);
470 
471  FORTRAN(geomview,(vold,co,pmid,e1,e2,e3,kontri,area,
472  cs,mcs,inocs,ntrit,nk,mi,&sidemean));
473 
474  RENEW(adview,double,num_cpus**ntr);
475  RENEW(auview,double,num_cpus*2**nzsrad);
476 
477  NNEW(dist,double,num_cpus**ntrit);
478  NNEW(idist,ITG,num_cpus**ntrit);
479 
480  DMEMSET(adview,0,num_cpus**ntr,0.);
481  DMEMSET(auview,0,num_cpus*2**nzsrad,0.);
482 
483  sideload1=sideload;vold1=vold;co1=co;pmid1=pmid;
484  e11=e1;e21=e2;e31=e3;kontri1=kontri;ntr1=ntr;
485  nloadtr1=nloadtr;area1=area;ntri1=ntri;
486  ntrit1=ntrit;mi1=mi;jqrad1=jqrad;irowrad1=irowrad;
487  nzsrad1=nzsrad;sidemean1=sidemean;
488 
489  /* size of the square mesh used to detect
490  the visibility of a triangle; the denser
491  the mesh,the more accurate the results */
492 
493  ng1=1280;
494 // ng1=2560;
495  NNEW(covered1,char,num_cpus*ng1*ng1);
496 
497  /* calculating the viewfactors */
498 
499  printf(" Using up to %" ITGFORMAT " cpu(s) for the viewfactor calculation.\n\n", num_cpus);
500 
501  /* create threads and wait */
502 
503  NNEW(ithread,ITG,num_cpus);
504  for(i=0; i<num_cpus; i++) {
505  ithread[i]=i;
506  pthread_create(&tid[i], NULL, (void *)calcviewmt, (void *)&ithread[i]);
507  }
508  for(i=0; i<num_cpus; i++) pthread_join(tid[i], NULL);
509 
510  for(i=0;i<*ntr;i++){
511  for(j=1;j<num_cpus;j++){
512  adview[i]+=adview[i+j**ntr];
513  }
514  }
515  RENEW(adview,double,*ntr);
516 
517  for(i=0;i<2**nzsrad;i++){
518  for(j=1;j<num_cpus;j++){
519  auview[i]+=auview[i+j*2**nzsrad];
520  }
521  }
522  RENEW(auview,double,2**nzsrad);
523 
524 /* for(i=0;i<*ntr;i++){
525  printf("radflowload adview = %" ITGFORMAT " %e\n",i,adview[i]);
526  }
527  for(i=0;i<2**nzsrad;i++){
528  printf("radflowload auview = %" ITGFORMAT " %e\n",i,auview[i]);
529  }*/
530 
531  SFREE(dist);SFREE(idist);SFREE(e1);SFREE(e2);SFREE(e3);
532  SFREE(pmid);SFREE(ithread);SFREE(covered1);
533 
534  /* postprocessing the viewfactors */
535 
536  FORTRAN(postview,(ntr,sideload,nelemload,kontri,ntri,nloadtr,
537  tenv,adview,auview,area,fenv,jqrad,irowrad,
538  nzsrad));
539 
540  SFREE(area);
541 
542  if(*iviewfile>=2){
543 
544  /* writing viewfactors to file */
545 
546  FORTRAN(writeview,(ntr,adview,auview,fenv,nzsrad,
547  jobnamef));
548  }
549 
550  if(*iviewfile==3){
551 
552  /* calculation of viewfactors only */
553 
554  FORTRAN(stop,());
555  }
556 
557  }
558  }
559 
560  /* assembling the radiation matrix */
561 
562  FORTRAN(radmatrix,(ntr,adrad,aurad,bcr,sideload,nelemload,
563  xloadact,lakon,vold,ipkon,kon,co,nloadtr,tarea,tenv,physcon,
564  erad,adview,auview,ithermal,iinc,iit,fenv,istep,dtime,ttime,
565  time,iviewfile,xloadold,reltime,nmethod,mi,iemchange,nam,
566  iamload,jqrad,irowrad,nzsrad));
567 
568  /* factoring the system of equations */
569 
570  /* the left hand side of the radiation matrix has probably
571  changed if
572  - the viewfactors were updated
573  - a new step was started and NO CHANGE is not active
574  - the emissivity coefficients were changed
575  - a new increment was started in a stationary calculation
576  (since the emissivity coefficients are ramped)
577  in that case the LU decomposition has to be repeated
578  (i.e. call of dgesv) */
579 
580  if(((*ithermal==3)&&(*iviewfile>=0))||
581  ((*iit==-1)&&(*iviewfile!=-2))||(*iemchange==1)||((*iit==0)&&(abs(*nmethod)==1))){
582 
583 #if defined(PARDISO)
584  if(ifactorization==1) pardiso_cleanup_as(ntr,&symmetryflag);
585  pardiso_factor_as(adrad,aurad,adbrad,aubrad,&sigma,icolrad,
586  irowrad,ntr,nzsrad,jqrad);
587  ifactorization=1;
588 #elif defined(SPOOLES)
589  if(ifactorization==1) spooles_cleanup_rad();
590  spooles_factor_rad(adrad,aurad,adbrad,aubrad,&sigma,
591  icolrad,irowrad,ntr,nzsrad,
592  &symmetryflag,&inputformat);
593  ifactorization=1;
594 #else
595  printf("*ERROR in radflowload: the SPOOLES library is not linked\n\n");
596  FORTRAN(stop,());
597 #endif
598 
599  }
600 
601  /* solving the system of equations */
602 
603 #if defined(PARDISO)
604  pardiso_solve_as(bcr,ntr);
605 
606 #elif defined(SPOOLES)
607  spooles_solve_rad(bcr,ntr);
608 #endif
609 
610  if (info!=0){
611  printf("*ERROR IN RADFLOWLOAD: SINGULAR MATRIX*\n");}
612 
613  else{
614  NNEW(q,double,*ntr);
615  FORTRAN(radresult,(ntr,xloadact,bcr,nloadtr,tarea,
616  tenv,physcon,erad,auview,fenv,
617  irowrad,jqrad,nzsrad,q));
618  SFREE(q);
619  }
620 
621  }
622 
623  SFREE(v);
624 
625  *adviewp=adview;*auviewp=auview;
626 
627  return;
628 
629 }
static ITG * mi1
Definition: radflowload.c:39
#define ITGFORMAT
Definition: CalculiX.h:52
static double * co1
Definition: radflowload.c:42
subroutine initialchannel(itg, ieg, ntg, ac, bc, lakon, v, ipkon, kon, nflow, ikboun, nboun, prop, ielprop, nactdog, ndirboun, nodeboun, xbounact, ielmat, ntmat_, shcon, nshcon, physcon, ipiv, nteq, rhcon, nrhcon, ipobody, ibody, xbodyact, co, nbody, network, iin_abs, vold, set, istep, iit, mi, ineighe, ilboun, ttime, time, iaxial)
Definition: initialchannel.f:33
static ITG ng1
Definition: radflowload.c:39
int pthread_create(pthread_t *thread_id, const pthread_attr_t *attributes, void *(*thread_function)(void *), void *arguments)
static double * pmid1
Definition: radflowload.c:42
subroutine postview(ntr, sideload, nelemload, kontri, ntri, nloadtr, tenv, adview, auview, area, fenv, jqrad, irowrad, nzsrad)
Definition: postview.f:28
static ITG * ntri1
Definition: radflowload.c:39
static char * covered1
Definition: radflowload.c:37
void checkconvnet(ITG *icutb, ITG *iin, double *cam1t, double *cam1f, double *cam1p, double *cam2t, double *cam2f, double *cam2p, double *camt, double *camf, double *camp, ITG *icntrl, double *dtheta, double *ctrl, double *cam1a, double *cam2a, double *cama, double *vamt, double *vamf, double *vamp, double *vama, double *qa, double *qamt, double *qamf, double *ramt, double *ramf, double *ramp, ITG *iplausi)
Definition: checkconvnet.c:32
void spooles_factor_rad(double *ad, double *au, double *adb, double *aub, double *sigma, ITG *icol, ITG *irow, ITG *neq, ITG *nzs, ITG *symmetryflag, ITG *inputformat)
subroutine resultnet(itg, ieg, ntg, bc, nload, sideload, nelemload, xloadact, lakon, ntmat_, v, shcon, nshcon, ipkon, kon, co, nflow, iinc, istep, dtime, ttime, time, ikforc, ilforc, xforcact, nforc, ielmat, nteq, prop, ielprop, nactdog, nacteq, iin, physcon, camt, camf, camp, rhcon, nrhcon, ipobody, ibody, xbodyact, nbody, dtheta, vold, xloadold, reltime, nmethod, set, mi, ineighe, cama, vamt, vamf, vamp, vama, nmpc, nodempc, ipompc, coefmpc, labmpc, iaxial, qat, qaf, ramt, ramf, ramp, cocon, ncocon, iponoel, inoel, iplausi)
Definition: resultnet.f:31
static ITG * ntrit1
Definition: radflowload.c:39
subroutine propertynet(ieg, nflow, prop, ielprop, lakon, iin, prop_store, ttime, time, nam, amname, namta, amta)
Definition: propertynet.f:21
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
subroutine geomview(vold, co, pmid, e1, e2, e3, kontri, area, cs, mcs, inocs, ntrit, nk, mi, sidemean)
Definition: geomview.f:28
static ITG * nloadtr1
Definition: radflowload.c:39
subroutine radmatrix(ntr, adrad, aurad, bcr, sideload, nelemload, xloadact, lakon, vold, ipkon, kon, co, nloadtr, tarea, tenv, physcon, erad, adview, auview, ithermal, iinc, iit, fenv, istep, dtime, ttime, time, iviewfile, xloadold, reltime, nmethod, mi, iemchange, nam, iamload, jqrad, irowrad, nzsrad)
Definition: radmatrix.f:31
subroutine equationcheck(ac, nteq, nactdog, itg, ntg, nacteq, network)
Definition: equationcheck.f:23
static ITG * ntr1
Definition: radflowload.c:39
void spooles_solve_rad(double *b, ITG *neq)
ITG getSystemCPUs()
Definition: getSystemCPUs.c:40
#define DMEMSET(a, b, c, d)
Definition: CalculiX.h:45
subroutine dgesv(N, NRHS, A, LDA, IPIV, B, LDB, INFO)
Definition: dgesv.f:58
subroutine stop()
Definition: stop.f:20
static double * e31
Definition: radflowload.c:42
subroutine mafillnet(itg, ieg, ntg, ac, nload, sideload, nelemload, xloadact, lakon, ntmat_, v, shcon, nshcon, ipkon, kon, co, nflow, iinc, istep, dtime, ttime, time, ielmat, nteq, prop, ielprop, nactdog, nacteq, physcon, rhcon, nrhcon, ipobody, ibody, xbodyact, nbody, vold, xloadold, reltime, nmethod, set, mi, nmpc, nodempc, ipompc, coefmpc, labmpc, iaxial, cocon, ncocon, iponoel, inoel)
Definition: mafillnet.f:28
void * calcviewmt(ITG *i)
Definition: radflowload.c:633
static ITG * idist
Definition: radflowload.c:39
static double sidemean1
Definition: radflowload.c:42
static char * sideload1
Definition: radflowload.c:37
static double * dist
Definition: radflowload.c:42
#define RENEW(a, b, c)
Definition: CalculiX.h:40
#define SFREE(a)
Definition: CalculiX.h:41
static double * area1
Definition: radflowload.c:42
static double * vold1
Definition: radflowload.c:42
subroutine radresult(ntr, xloadact, bcr, nloadtr, tarea, tenv, physcon, erad, auview, fenv, irowrad, jqrad, nzsrad, q)
Definition: radresult.f:22
static double * e21
Definition: radflowload.c:42
static double * adview
Definition: radflowload.c:42
static ITG * jqrad1
Definition: radflowload.c:39
static double * e11
Definition: radflowload.c:42
void spooles_cleanup_rad()
static ITG * nzsrad1
Definition: radflowload.c:39
subroutine flowresult(ntg, itg, cam, vold, v, nload, sideload, nelemload, xloadact, nactdog, network, mi, ne, ipkon, lakon, kon)
Definition: flowresult.f:21
int pthread_join(pthread_t thread, void **status_ptr)
subroutine checkinputvaluesnet(ieg, nflow, prop, ielprop, lakon)
Definition: checkinputvaluesnet.f:31
subroutine writeview(ntr, adview, auview, fenv, nzsrad, jobnamef)
Definition: writeview.f:28
static ITG * kontri1
Definition: radflowload.c:39
subroutine flowoutput(itg, ieg, ntg, nteq, bc, lakon, ntmat_, v, shcon, nshcon, ipkon, kon, co, nflow, dtime, ttime, time, ielmat, prop, ielprop, nactdog, nacteq, iin, physcon, camt, camf, camp, rhcon, nrhcon, vold, jobnamef, set, istartset, iendset, ialset, nset, mi, iaxial, istep, iit)
Definition: flowoutput.f:28
static ITG num_cpus
Definition: radflowload.c:39
#define ITG
Definition: CalculiX.h:51
subroutine readview(ntr, adview, auview, fenv, nzsrad, ithermal, jobnamef)
Definition: readview.f:28
subroutine initialnet(itg, ieg, ntg, ac, bc, lakon, v, ipkon, kon, nflow, ikboun, nboun, prop, ielprop, nactdog, ndirboun, nodeboun, xbounact, ielmat, ntmat_, shcon, nshcon, physcon, ipiv, nteq, rhcon, nrhcon, ipobody, ibody, xbodyact, co, nbody, network, iin_abs, vold, set, istep, iit, mi, ineighe, ilboun, channel, iaxial, nmpc, labmpc, ipompc, nodempc, coefmpc, ttime, time, iponoel, inoel)
Definition: initialnet.f:34
#define NNEW(a, b, c)
Definition: CalculiX.h:39
static ITG * irowrad1
Definition: radflowload.c:39
static double * auview
Definition: radflowload.c:42

◆ randomfieldmain()

void randomfieldmain ( ITG kon,
ITG ipkon,
char *  lakon,
ITG ne,
ITG nmpc,
ITG nactdof,
ITG mi,
ITG nodedesi,
ITG ndesi,
ITG istartdesi,
ITG ialdesi,
double *  co,
double *  physcon,
ITG isolver,
ITG ntrans,
ITG nk,
ITG inotr,
double *  trab,
char *  jobnamec,
ITG nboun,
double *  cs,
ITG mcs,
ITG inum,
ITG nmethod,
ITG kode,
char *  filab,
ITG nstate_,
ITG istep,
char *  description,
char *  set,
ITG nset,
ITG iendset,
char *  output,
ITG istartset,
ITG ialset,
double *  extnor 
)

◆ readinput()

void readinput ( char *  jobnamec,
char **  inpcp,
ITG nline,
ITG nset,
ITG ipoinp,
ITG **  inpp,
ITG **  ipoinpcp,
ITG ithermal,
ITG nuel_ 
)
27  {
28 
29  /* reads and stores the input deck in inpcp; determines the
30  number of sets */
31 
32  FILE *f1[10];
33 
34  char buff[1320]="", fninp[132]="", includefn[132]="", *inpc=NULL,
35  textpart[2112]="",*set=NULL;
36 
37  ITG i,j,k,n,in=0,nlinemax=100000,irestartread,irestartstep,
38  icntrl,nload,nforc,nboun,nk,ne,nmpc,nalset,nmat,ntmat,npmat,
39  norien,nam,nprint,mi[3],ntrans,ncs,namtot,ncmat,memmpc,ne1d,
40  ne2d,nflow,*meminset=NULL,*rmeminset=NULL, *inp=NULL,ntie,
41  nener,nstate,nentries=17,ifreeinp,ikey,lincludefn,nslavs,
42  nbody,ncharmax=1000000,*ipoinpc=NULL,ichangefriction=0,nkon,
43  ifile,mcs,initialtemperature=0,nprop,mortar,ifacecount,
44  nintpoint,infree[4],iheading=0,ichangesurfacebehavior=0;
45 
46  /* initialization */
47 
48  /* nentries is the number of different keyword cards for which
49  the input deck order is important, cf keystart.f */
50 
51  NNEW(inpc,char,ncharmax);
52  NNEW(ipoinpc,ITG,nlinemax+1);
53  NNEW(inp,ITG,3*nlinemax);
54  *nline=0;
55  for(i=0;i<2*nentries;i++){ipoinp[i]=0;}
56  ifreeinp=1;
57  ikey=0;
58 
59  /* opening the input file */
60 
61  strcpy(fninp,jobnamec);
62  strcat(fninp,".inp");
63  if((f1[in]=fopen(fninp,"r"))==NULL){
64  printf("*ERROR in readinput: cannot open file %s\n",fninp);
65  exit(0);
66  }
67 
68  /* starting to read the input file */
69 
70  do{
71  if(fgets(buff,1320,f1[in])==NULL){
72  fclose(f1[in]);
73  if(in!=0){
74  in--;
75  continue;
76  }
77  else{break;}
78  }
79 
80  /* check for heading lines: should not be changed */
81 
82  if(iheading==1){
83  if((buff[0]=='*')&&(buff[1]!='*')){
84  iheading=0;
85  }
86  }
87 
88  /* storing the significant characters */
89  /* get rid of blanks */
90 
91  k=0;
92  i=-1;
93  if(iheading==0){
94  do{
95  i++;
96  if((buff[i]=='\0')||(buff[i]=='\n')||(buff[i]=='\r')||(k==1320)) break;
97  if((buff[i]==' ')||(buff[i]=='\t')) continue;
98  buff[k]=buff[i];
99  k++;
100  }while(1);
101  }else{
102  do{
103  i++;
104  if((buff[i]=='\0')||(buff[i]=='\n')||(buff[i]=='\r')||(k==1320)) break;
105  buff[k]=buff[i];
106  k++;
107  }while(1);
108  }
109 
110  /* check for blank lines and comments */
111 
112  if(k==0) continue;
113  if(strcmp1(&buff[0],"**")==0) continue;
114 
115  /* changing to uppercase except filenames */
116 
117  if(iheading==0){
118  j=0;
119  ifile=0;
120  do{
121  if(j>=6){
122  if(strcmp1(&buff[j-6],"INPUT=")==0) ifile=1;
123  }
124  if(j>=7){
125  if(strcmp1(&buff[j-7],"OUTPUT=")==0) ifile=1;
126  }
127  if(j>=9){
128  if(strcmp1(&buff[j-9],"FILENAME=")==0) ifile=1;
129  }
130  if(ifile==1){
131  do{
132  if(strcmp1(&buff[j],",")!=0){
133  j++;
134  }else{
135  ifile=0;
136  break;
137  }
138  }while(j<k);
139  }else{
140  buff[j]=toupper(buff[j]);
141  }
142  j++;
143  }while(j<k);
144  }
145 
146  /* check for a *HEADING card */
147 
148  if(strcmp1(&buff[0],"*HEADING")==0){
149  iheading=1;
150  }
151 
152  /* check for a *KINEMATIC or *DISTRIBUTING card and change
153  the asterisk into a C (is a "dependent" card of the
154  *COUPLING card */
155 
156  if((strcmp1(&buff[0],"*KINEMATIC")==0)||
157  ((strcmp1(&buff[0],"*DISTRIBUTING")==0)&&
158  (strcmp1(&buff[0],"*DISTRIBUTINGCOUPLING")!=0)))
159  {
160  buff[0]='C';
161  }
162 
163  /* check for include statements */
164 
165  if(strcmp1(&buff[0],"*INCLUDE")==0){
166  lincludefn=k;
167  FORTRAN(includefilename,(buff,includefn,&lincludefn));
168  includefn[lincludefn]='\0';
169  in++;
170  if(in>9){
171  printf("*ERROR in readinput: include statements can \n not be cascaded over more than 9 levels\n");
172  }
173  if((f1[in]=fopen(includefn,"r"))==NULL){
174  printf("*ERROR in readinput: cannot open file %s\n",includefn);
175  exit(0);
176  }
177  continue;
178  }
179 
180  /* adding a line */
181 
182  (*nline)++;
183  if(*nline>nlinemax){
184  nlinemax=(ITG)(1.1*nlinemax);
185  RENEW(ipoinpc,ITG,nlinemax+1);
186  RENEW(inp,ITG,3*nlinemax);
187  }
188 
189  /* checking the total number of characters */
190 
191  if(ipoinpc[*nline-1]+k>ncharmax){
192  ncharmax=(ITG)(1.1*ncharmax);
193  RENEW(inpc,char,ncharmax);
194  }
195 
196  /* copying into inpc */
197 
198  for(j=0;j<k;j++){
199  inpc[ipoinpc[*nline-1]+j]=buff[j];
200  }
201  ipoinpc[*nline]=ipoinpc[*nline-1]+k;
202 
203  /* counting sets */
204 
205  if(strcmp1(&buff[0],"*AMPLITUDE")==0){
206  FORTRAN(keystart,(&ifreeinp,ipoinp,inp,"AMPLITUDE",
207  nline,&ikey));
208  }
209  else if(strcmp1(&buff[0],"*CHANGEFRICTION")==0){
210  ichangefriction=1;
211  FORTRAN(keystart,(&ifreeinp,ipoinp,inp,"REST",
212  nline,&ikey));
213  }
214  else if(strcmp1(&buff[0],"*CHANGESURFACEBEHAVIOR")==0){
215  ichangesurfacebehavior=1;
216  FORTRAN(keystart,(&ifreeinp,ipoinp,inp,"REST",
217  nline,&ikey));
218  }
219  else if(strcmp1(&buff[0],"*CONDUCTIVITY")==0){
220  FORTRAN(keystart,(&ifreeinp,ipoinp,inp,"MATERIAL",
221  nline,&ikey));
222  }
223  else if(strcmp1(&buff[0],"*CONTACTDAMPING")==0){
224  FORTRAN(keystart,(&ifreeinp,ipoinp,inp,"SURFACEINTERACTION",
225  nline,&ikey));
226  }
227  else if(strcmp1(&buff[0],"*CONTACTPAIR")==0){
228  FORTRAN(keystart,(&ifreeinp,ipoinp,inp,"CONTACTPAIR",
229  nline,&ikey));
230  }
231  else if(strcmp1(&buff[0],"*COUPLING")==0){
232  FORTRAN(keystart,(&ifreeinp,ipoinp,inp,"COUPLING",
233  nline,&ikey));
234  }
235  else if(strcmp1(&buff[0],"*CREEP")==0){
236  FORTRAN(keystart,(&ifreeinp,ipoinp,inp,"MATERIAL",
237  nline,&ikey));
238  }
239  else if(strcmp1(&buff[0],"*CYCLICHARDENING")==0){
240  FORTRAN(keystart,(&ifreeinp,ipoinp,inp,"MATERIAL",
241  nline,&ikey));
242  }
243  else if(strcmp1(&buff[0],"*DEFORMATIONPLASTICITY")==0){
244  FORTRAN(keystart,(&ifreeinp,ipoinp,inp,"MATERIAL",
245  nline,&ikey));
246  }
247  else if(strcmp1(&buff[0],"*DENSITY")==0){
248  FORTRAN(keystart,(&ifreeinp,ipoinp,inp,"MATERIAL",
249  nline,&ikey));
250  }
251  else if(strcmp1(&buff[0],"*DEPVAR")==0){
252  FORTRAN(keystart,(&ifreeinp,ipoinp,inp,"MATERIAL",
253  nline,&ikey));
254  }
255  else if(strcmp1(&buff[0],"*ELASTIC")==0){
256  FORTRAN(keystart,(&ifreeinp,ipoinp,inp,"MATERIAL",
257  nline,&ikey));
258  }
259  else if(strcmp1(&buff[0],"*ELECTRICALCONDUCTIVITY")==0){
260  FORTRAN(keystart,(&ifreeinp,ipoinp,inp,"MATERIAL",
261  nline,&ikey));
262  }
263  else if((strcmp1(&buff[0],"*ELEMENT")==0)&&
264  (strcmp1(&buff[0],"*ELEMENTOUTPUT")!=0)){
265  (*nset)++;
266  FORTRAN(keystart,(&ifreeinp,ipoinp,inp,"ELEMENT",
267  nline,&ikey));
268  }
269  else if(strcmp1(&buff[0],"*ELSET")==0){
270  (*nset)++;
271  FORTRAN(keystart,(&ifreeinp,ipoinp,inp,"ELSET",
272  nline,&ikey));
273  }
274  else if(strcmp1(&buff[0],"*EXPANSION")==0){
275  FORTRAN(keystart,(&ifreeinp,ipoinp,inp,"MATERIAL",
276  nline,&ikey));
277  }
278  else if(strcmp1(&buff[0],"*FLUIDCONSTANTS")==0){
279  FORTRAN(keystart,(&ifreeinp,ipoinp,inp,"MATERIAL",
280  nline,&ikey));
281  }
282  else if((strcmp1(&buff[0],"*FRICTION")==0)&&(ichangefriction==0)){
283  FORTRAN(keystart,(&ifreeinp,ipoinp,inp,"SURFACEINTERACTION",
284  nline,&ikey));
285  }
286  else if(strcmp1(&buff[0],"*GAPCONDUCTANCE")==0){
287  FORTRAN(keystart,(&ifreeinp,ipoinp,inp,"SURFACEINTERACTION",
288  nline,&ikey));
289  }
290  else if(strcmp1(&buff[0],"*GAPHEATGENERATION")==0){
291  FORTRAN(keystart,(&ifreeinp,ipoinp,inp,"SURFACEINTERACTION",
292  nline,&ikey));
293  }
294  else if(strcmp1(&buff[0],"*HYPERELASTIC")==0){
295  FORTRAN(keystart,(&ifreeinp,ipoinp,inp,"MATERIAL",
296  nline,&ikey));
297  }
298  else if(strcmp1(&buff[0],"*HYPERFOAM")==0){
299  FORTRAN(keystart,(&ifreeinp,ipoinp,inp,"MATERIAL",
300  nline,&ikey));
301  }
302  else if(strcmp1(&buff[0],"*INITIALCONDITIONS")==0){
303  FORTRAN(keystart,(&ifreeinp,ipoinp,inp,"INITIALCONDITIONS",
304  nline,&ikey));
305  FORTRAN(splitline,(buff,textpart,&n));
306  for(i=0;i<n;i++){
307  if(strcmp1(&textpart[(long long)132*i],"TYPE=TEMPERATURE")==0){
308  initialtemperature=1;
309  }
310  }
311  }
312  else if(strcmp1(&buff[0],"*MAGNETICPERMEABILITY")==0){
313  FORTRAN(keystart,(&ifreeinp,ipoinp,inp,"MATERIAL",
314  nline,&ikey));
315  }
316  else if(strcmp1(&buff[0],"*MATERIAL")==0){
317  FORTRAN(keystart,(&ifreeinp,ipoinp,inp,"MATERIAL",
318  nline,&ikey));
319  }
320  else if((strcmp1(&buff[0],"*NODE")==0)&&
321  (strcmp1(&buff[0],"*NODEPRINT")!=0)&&
322  (strcmp1(&buff[0],"*NODEOUTPUT")!=0)&&
323  (strcmp1(&buff[0],"*NODEFILE")!=0)){
324  (*nset)++;
325  FORTRAN(keystart,(&ifreeinp,ipoinp,inp,"NODE",
326  nline,&ikey));
327  }
328  else if(strcmp1(&buff[0],"*NSET")==0){
329  (*nset)++;
330  FORTRAN(keystart,(&ifreeinp,ipoinp,inp,"NSET",
331  nline,&ikey));
332  }
333  else if(strcmp1(&buff[0],"*ORIENTATION")==0){
334  FORTRAN(keystart,(&ifreeinp,ipoinp,inp,"ORIENTATION",
335  nline,&ikey));
336  }
337  else if(strcmp1(&buff[0],"*PLASTIC")==0){
338  FORTRAN(keystart,(&ifreeinp,ipoinp,inp,"MATERIAL",
339  nline,&ikey));
340  }
341  else if(strcmp1(&buff[0],"*RESTART")==0){
342  irestartread=0;
343  irestartstep=0;
344  strcpy1(&buff[k]," ",1);
345  FORTRAN(splitline,(buff,textpart,&n));
346  for(i=0;i<n;i++){
347  if(strcmp1(&textpart[(long long)132*i],"READ")==0){
348  irestartread=1;
349  }
350  if(strcmp1(&textpart[(long long)132*i],"STEP")==0){
351  irestartstep=atoi(&textpart[(long long)132*i+5]);
352  }
353  }
354  if(irestartread==1){
355  icntrl=0;
356  FORTRAN(restartshort,(nset,&nload,&nbody,&nforc,&nboun,&nk,
357  &ne,&nmpc,&nalset,&nmat,&ntmat,&npmat,&norien,&nam,
358  &nprint,mi,&ntrans,&ncs,&namtot,&ncmat,&memmpc,
359  &ne1d,&ne2d,&nflow,set,meminset,rmeminset,jobnamec,
360  &irestartstep,&icntrl,ithermal,&nener,&nstate,&ntie,
361  &nslavs,&nkon,&mcs,&nprop,&mortar,&ifacecount,&nintpoint,
362  infree));
363  FORTRAN(keystart,(&ifreeinp,ipoinp,inp,"RESTART,READ",
364  nline,&ikey));
365  }
366  else{
367  FORTRAN(keystart,(&ifreeinp,ipoinp,inp,"REST",
368  nline,&ikey));
369  }
370 
371  }
372  else if(strcmp1(&buff[0],"*SPECIFICGASCONSTANT")==0){
373  FORTRAN(keystart,(&ifreeinp,ipoinp,inp,"MATERIAL",
374  nline,&ikey));
375  }
376  else if(strcmp1(&buff[0],"*SPECIFICHEAT")==0){
377  FORTRAN(keystart,(&ifreeinp,ipoinp,inp,"MATERIAL",
378  nline,&ikey));
379  }
380  else if(strcmp1(&buff[0],"*SUBMODEL")==0){
381  (*nset)+=2;
382  FORTRAN(keystart,(&ifreeinp,ipoinp,inp,"REST",
383  nline,&ikey));
384  }
385  else if(strcmp1(&buff[0],"*SURFACEINTERACTION")==0){
386  FORTRAN(keystart,(&ifreeinp,ipoinp,inp,"SURFACEINTERACTION",
387  nline,&ikey));
388  }
389  else if(strcmp1(&buff[0],"*SURFACEBEHAVIOR")==0){
390  if(ichangesurfacebehavior==0){
391  FORTRAN(keystart,(&ifreeinp,ipoinp,inp,"SURFACEINTERACTION",
392  nline,&ikey));
393  }else{
394  FORTRAN(keystart,(&ifreeinp,ipoinp,inp,"REST",
395  nline,&ikey));
396  }
397  }
398  else if(strcmp1(&buff[0],"*SURFACE")==0){
399  (*nset)++;
400  FORTRAN(keystart,(&ifreeinp,ipoinp,inp,"SURFACE",
401  nline,&ikey));
402  }
403  else if(strcmp1(&buff[0],"*TIE")==0){
404  FORTRAN(keystart,(&ifreeinp,ipoinp,inp,"TIE",
405  nline,&ikey));
406  }
407  else if(strcmp1(&buff[0],"*TRANSFORM")==0){
408  FORTRAN(keystart,(&ifreeinp,ipoinp,inp,"TRANSFORM",
409  nline,&ikey));
410  }
411  else if(strcmp1(&buff[0],"*USERELEMENT")==0){
412  FORTRAN(keystart,(&ifreeinp,ipoinp,inp,"USERELEMENT",
413  nline,&ikey));
414  (*nuel)++;
415  }
416  else if(strcmp1(&buff[0],"*USERMATERIAL")==0){
417  FORTRAN(keystart,(&ifreeinp,ipoinp,inp,"MATERIAL",
418  nline,&ikey));
419  }
420  else if(strcmp1(&buff[0],"*")==0){
421  FORTRAN(keystart,(&ifreeinp,ipoinp,inp,"REST",
422  nline,&ikey));
423 
424  /* checking whether the calculation is mechanical,
425  thermal or thermomechanical: needed to know
426  which mpc's to apply to 2-D elements */
427 
428  if((strcmp1(&buff[0],"*STATIC")==0)||
429  (strcmp1(&buff[0],"*VISCO")==0)||
430  (strcmp1(&buff[0],"*DYNAMIC")==0)){
431  if(ithermal[1]==0){
432  if(initialtemperature==1)ithermal[1]=1;
433  }else if(ithermal[1]==2){
434  ithermal[1]=3;
435  }
436  }else if(strcmp1(&buff[0],"*HEATTRANSFER")==0){
437  if(ithermal[1]<2) ithermal[1]=ithermal[1]+2;
438  }else if(strcmp1(&buff[0],"*COUPLEDTEMPERATURE-DISPLACEMENT")==0){
439  ithermal[1]=3;
440  }else if(strcmp1(&buff[0],"*UNCOUPLEDTEMPERATURE-DISPLACEMENT")==0){
441  ithermal[1]=3;
442  }else if(strcmp1(&buff[0],"*ELECTROMAGNETICS")==0){
443  ithermal[1]=3;
444  }
445  }
446  }while(1);
447 
448  inp[3*ipoinp[2*ikey-1]-2]=*nline;
449  RENEW(inpc,char,(long long)132**nline);
450  RENEW(inp,ITG,3*ipoinp[2*ikey-1]);
451  *inpcp=inpc;
452  *ipoinpcp=ipoinpc;
453  *inpp=inp;
454 
455 // FORTRAN(writeinput,(inpc,ipoinp,inp,nline,&ipoinp[2*ikey-1],ipoinpc));
456 
457  return;
458 
459 }
ITG strcpy1(char *s1, const char *s2, ITG length)
Definition: strcpy1.c:24
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
ITG strcmp1(const char *s1, const char *s2)
Definition: strcmp1.c:24
subroutine restartshort(nset, nload, nbody, nforc, nboun, nk, ne, nmpc, nalset, nmat, ntmat, npmat, norien, nam, nprint, mi, ntrans, ncs, namtot, ncmat, memmpc, ne1d, ne2d, nflow, set, meminset, rmeminset, jobnamec, irestartstep, icntrl, ithermal, nener, nstate_, ntie, nslavs, nkon, mcs, nprop, mortar, ifacecount, nintpoint, infree)
Definition: restartshort.f:25
#define RENEW(a, b, c)
Definition: CalculiX.h:40
static double * f1
Definition: objectivemain_se.c:47
#define ITG
Definition: CalculiX.h:51
subroutine keystart(ifreeinp, ipoinp, inp, name, iline, ikey)
Definition: keystart.f:20
#define NNEW(a, b, c)
Definition: CalculiX.h:39
subroutine includefilename(text, includefn, lincludefn)
Definition: includefilename.f:20

◆ remastruct()

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

◆ remastructar()

void remastructar ( 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,
ITG ithermal,
ITG iperturb,
ITG mass,
ITG mi,
ITG ics,
double *  cs,
ITG mcs,
ITG mortar,
char *  typeboun,
ITG iit,
ITG network 
)
34  {
35 
36  /* reconstructs the nonzero locations in the stiffness and mass
37  matrix after a change in MPC's or the generation of contact
38  spring elements: version for frequency calculations (called
39  by arpack and arpackcs) */
40 
41  ITG *nodempc=NULL,*mast1=NULL,*ipointer=NULL,mpcend,
42  callfrommain,i,*irow=NULL,mt;
43 
44  double *coefmpc=NULL;
45 
46  nodempc=*nodempcp;coefmpc=*coefmpcp;irow=*irowp;
47 
48  mt=mi[1]+1;
49 
50  /* decascading the MPC's */
51 
52  printf(" Decascading the MPC's\n\n");
53 
54  callfrommain=0;
55  cascade(ipompc,&coefmpc,&nodempc,nmpc,
56  mpcfree,nodeboun,ndirboun,nboun,ikmpc,
57  ilmpc,ikboun,ilboun,&mpcend,
58  labmpc,nk,memmpc_,icascade,maxlenmpc,
59  &callfrommain,iperturb,ithermal);
60 
61  /* determining the matrix structure */
62 
63  printf(" Determining the structure of the matrix:\n");
64 
65  if(nzs[1]<10) nzs[1]=10;
66  NNEW(mast1,ITG,nzs[1]);
67  RENEW(irow,ITG,nzs[1]);
68 
69  if((*mcs==0)||(cs[1]<0)){
70 
71  NNEW(ipointer,ITG,mt**nk);
72 
73  mastruct(nk,kon,ipkon,lakon,ne,nodeboun,ndirboun,nboun,ipompc,
74  nodempc,nmpc,nactdof,icol,jq,&mast1,&irow,isolver,neq,
75  ikmpc,ilmpc,ipointer,nzs,nmethod,ithermal,
76  ikboun,ilboun,iperturb,mi,mortar,typeboun,labmpc,
77  iit,icascade,network);
78 
79  }else{
80 
81  NNEW(ipointer,ITG,8**nk);
82 
83  mastructcs(nk,kon,ipkon,lakon,ne,nodeboun,ndirboun,nboun,
84  ipompc,nodempc,nmpc,nactdof,icol,jq,&mast1,&irow,isolver,
85  neq,ikmpc,ilmpc,ipointer,nzs,nmethod,
86  ics,cs,labmpc,mcs,mi,mortar);
87  }
88 
89  SFREE(ipointer);SFREE(mast1);
90  RENEW(irow,ITG,nzs[2]);
91 
92  *nodempcp=nodempc;*coefmpcp=coefmpc;*irowp=irow;
93 
94  return;
95 }
#define RENEW(a, b, c)
Definition: CalculiX.h:40
#define SFREE(a)
Definition: CalculiX.h:41
void mastructcs(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 *ics, double *cs, char *labmpc, ITG *mcs, ITG *mi, ITG *mortar)
Definition: mastructcs.c:27
#define ITG
Definition: CalculiX.h:51
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, 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, ITG *iit, ITG *icascade, ITG *network)
Definition: mastruct.c:27
#define NNEW(a, b, c)
Definition: CalculiX.h:39

◆ remastructem()

void remastructem ( 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 ielmat,
double *  elcon,
ITG ncmat_,
ITG ntmat_,
ITG inomat,
ITG network 
)
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,
41  callfrommain,i,*irow=NULL,mt;
42 
43  double *coefmpc=NULL,*f=NULL,*fext=NULL,*b=NULL,*aux2=NULL,
44  *fini=NULL,*fextini=NULL,*adb=NULL,*aub=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;
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,
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]);
71 
72  mastructem(nk,kon,ipkon,lakon,ne,nodeboun,ndirboun,nboun,ipompc,
73  nodempc,nmpc,nactdof,icol,jq,&mast1,&irow,isolver,neq,
74  ikmpc,ilmpc,ipointer,nzs,ithermal,mi,ielmat,elcon,
75  ncmat_,ntmat_,inomat,network);
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]);for(i=0;i<neq[1];i++) f[i]=0.;
85  RENEW(fext,double,neq[1]);for(i=0;i<neq[1];i++) fext[i]=0.;
86  RENEW(b,double,neq[1]);for(i=0;i<neq[1];i++) b[i]=0.;
87  RENEW(fini,double,neq[1]);for(i=0;i<neq[1];i++) fini[i]=0.;
88 
89  if(*nmethod==4){
90  RENEW(aux2,double,neq[1]);for(i=0;i<neq[1];i++) aux2[i]=0.;
91  RENEW(fextini,double,neq[1]);for(i=0;i<neq[1];i++) fextini[i]=0.;
92  RENEW(adb,double,neq[1]);for(i=0;i<neq[1];i++) adb[i]=0.;
93  RENEW(aub,double,nzs[1]);for(i=0;i<nzs[1];i++) aub[i]=0.;
94  mass[0]=1;
95  }
96 
97  *fp=f;*fextp=fext;*bp=b;*aux2p=aux2;*finip=fini;
98  *fextinip=fextini;*adbp=adb;*aubp=aub;
99 
100  return;
101 }
#define RENEW(a, b, c)
Definition: CalculiX.h:40
#define SFREE(a)
Definition: CalculiX.h:41
#define ITG
Definition: CalculiX.h:51
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, char *labmpc, ITG *nk, ITG *memmpc_, ITG *icascade, ITG *maxlenmpc, ITG *callfrommain, ITG *iperturb, ITG *ithermal)
Definition: cascade.c:34
#define NNEW(a, b, c)
Definition: CalculiX.h:39
void mastructem(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 *ithermal, ITG *mi, ITG *ielmat, double *elcon, ITG *ncmat_, ITG *ntmat_, ITG *inomat, ITG *network)
Definition: mastructem.c:27

◆ results()

void results ( double *  co,
ITG nk,
ITG kon,
ITG ipkon,
char *  lakon,
ITG ne,
double *  v,
double *  stn,
ITG inum,
double *  stx,
double *  elcon,
ITG nelcon,
double *  rhcon,
ITG nrhcon,
double *  alcon,
ITG nalcon,
double *  alzero,
ITG ielmat,
ITG ielorien,
ITG norien,
double *  orab,
ITG ntmat_,
double *  t0,
double *  t1,
ITG ithermal,
double *  prestr,
ITG iprestr,
char *  filab,
double *  eme,
double *  emn,
double *  een,
ITG iperturb,
double *  f,
double *  fn,
ITG nactdof,
ITG iout,
double *  qa,
double *  vold,
double *  b,
ITG nodeboun,
ITG ndirboun,
double *  xboun,
ITG nboun,
ITG ipompc,
ITG nodempc,
double *  coefmpc,
char *  labmpc,
ITG nmpc,
ITG nmethod,
double *  vmax,
ITG neq,
double *  veold,
double *  accold,
double *  beta,
double *  gamma,
double *  dtime,
double *  time,
double *  ttime,
double *  plicon,
ITG nplicon,
double *  plkcon,
ITG nplkcon,
double *  xstateini,
double *  xstiff,
double *  xstate,
ITG npmat_,
double *  epl,
char *  matname,
ITG mi,
ITG ielas,
ITG icmd,
ITG ncmat_,
ITG nstate_,
double *  stiini,
double *  vini,
ITG ikboun,
ITG ilboun,
double *  ener,
double *  enern,
double *  emeini,
double *  xstaten,
double *  eei,
double *  enerini,
double *  cocon,
ITG ncocon,
char *  set,
ITG nset,
ITG istartset,
ITG iendset,
ITG ialset,
ITG nprint,
char *  prlab,
char *  prset,
double *  qfx,
double *  qfn,
double *  trab,
ITG inotr,
ITG ntrans,
double *  fmpc,
ITG nelemload,
ITG nload,
ITG ikmpc,
ITG ilmpc,
ITG istep,
ITG iinc,
double *  springarea,
double *  reltime,
ITG ne0,
double *  xforc,
ITG nforc,
double *  thicke,
double *  shcon,
ITG nshcon,
char *  sideload,
double *  xload,
double *  xloadold,
ITG icfd,
ITG inomat,
double *  pslavsurf,
double *  pmastsurf,
ITG mortar,
ITG islavact,
double *  cdn,
ITG islavnode,
ITG nslavnode,
ITG ntie,
double *  clearini,
ITG islavsurf,
ITG ielprop,
double *  prop,
double *  energyini,
double *  energy,
ITG kscale,
ITG iponoel,
ITG inoel,
ITG nener,
char *  orname,
ITG network,
ITG ipobody,
double *  xbodyact,
ITG ibody 
)
74  {
75 
76  ITG intpointvarm,calcul_fn,calcul_f,calcul_qa,calcul_cauchy,ikin,
77  intpointvart,mt=mi[1]+1,i,j;
78 
79  /*
80 
81  calculating integration point values (strains, stresses,
82  heat fluxes, material tangent matrices and nodal forces)
83 
84  storing the nodal and integration point results in the
85  .dat file
86 
87  iout=-2: v is assumed to be known and is used to
88  calculate strains, stresses..., no result output
89  corresponds to iout=-1 with in addition the
90  calculation of the internal energy density
91  iout=-1: v is assumed to be known and is used to
92  calculate strains, stresses..., no result output;
93  is used to take changes in SPC's and MPC's at the
94  start of a new increment or iteration into account
95  iout=0: v is calculated from the system solution
96  and strains, stresses.. are calculated, no result output
97  iout=1: v is calculated from the system solution and strains,
98  stresses.. are calculated, requested results output
99  iout=2: v is assumed to be known and is used to
100  calculate strains, stresses..., requested results output */
101 
102  /* variables for multithreading procedure */
103 
104  ITG sys_cpus,*ithread=NULL;
105  char *env,*envloc,*envsys;
106 
107  num_cpus = 0;
108  sys_cpus=0;
109 
110  /* explicit user declaration prevails */
111 
112  envsys=getenv("NUMBER_OF_CPUS");
113  if(envsys){
114  sys_cpus=atoi(envsys);
115  if(sys_cpus<0) sys_cpus=0;
116  }
117 
118  /* automatic detection of available number of processors */
119 
120  if(sys_cpus==0){
121  sys_cpus = getSystemCPUs();
122  if(sys_cpus<1) sys_cpus=1;
123  }
124 
125  /* local declaration prevails, if strictly positive */
126 
127  envloc = getenv("CCX_NPROC_RESULTS");
128  if(envloc){
129  num_cpus=atoi(envloc);
130  if(num_cpus<0){
131  num_cpus=0;
132  }else if(num_cpus>sys_cpus){
133  num_cpus=sys_cpus;
134  }
135 
136  }
137 
138  /* else global declaration, if any, applies */
139 
140  env = getenv("OMP_NUM_THREADS");
141  if(num_cpus==0){
142  if (env)
143  num_cpus = atoi(env);
144  if (num_cpus < 1) {
145  num_cpus=1;
146  }else if(num_cpus>sys_cpus){
147  num_cpus=sys_cpus;
148  }
149  }
150 
151 // next line is to be inserted in a similar way for all other paralell parts
152 
153  if(*ne<num_cpus) num_cpus=*ne;
154 
155  pthread_t tid[num_cpus];
156 
157  /* 1. nodewise storage of the primary variables
158  2. determination which derived variables have to be calculated */
159 
160  FORTRAN(resultsini,(nk,v,ithermal,filab,iperturb,f,fn,
161  nactdof,iout,qa,vold,b,nodeboun,ndirboun,
162  xboun,nboun,ipompc,nodempc,coefmpc,labmpc,nmpc,nmethod,cam,neq,
163  veold,accold,bet,gam,dtime,mi,vini,nprint,prlab,
164  &intpointvarm,&calcul_fn,&calcul_f,&calcul_qa,&calcul_cauchy,nener,
165  &ikin,&intpointvart,xforc,nforc));
166 
167  /* next statement allows for storing the displacements in each
168  iteration: for debugging purposes */
169 
170  if((strcmp1(&filab[3],"I")==0)&&(*iout==0)){
171  FORTRAN(frditeration,(co,nk,kon,ipkon,lakon,ne,v,
172  ttime,ielmat,matname,mi,istep,iinc,ithermal));
173  }
174 
175  /* calculating the stresses and material tangent at the
176  integration points; calculating the internal forces */
177 
178  if(((ithermal[0]<=1)||(ithermal[0]>=3))&&(intpointvarm==1)){
179 
180  NNEW(fn1,double,num_cpus*mt**nk);
181  NNEW(qa1,double,num_cpus*4);
182  NNEW(nal,ITG,num_cpus);
183 
184  co1=co;kon1=kon;ipkon1=ipkon;lakon1=lakon;ne1=ne;v1=v;
185  stx1=stx;elcon1=elcon;nelcon1=nelcon;rhcon1=rhcon;
186  nrhcon1=nrhcon;alcon1=alcon;nalcon1=nalcon;alzero1=alzero;
187  ielmat1=ielmat;ielorien1=ielorien;norien1=norien;orab1=orab;
188  ntmat1_=ntmat_;t01=t0;t11=t1;ithermal1=ithermal;prestr1=prestr;
189  iprestr1=iprestr;eme1=eme;iperturb1=iperturb;iout1=iout;
190  vold1=vold;nmethod1=nmethod;veold1=veold;dtime1=dtime;
191  time1=time;ttime1=ttime;plicon1=plicon;nplicon1=nplicon;
192  plkcon1=plkcon;nplkcon1=nplkcon;xstateini1=xstateini;
193  xstiff1=xstiff;xstate1=xstate;npmat1_=npmat_;matname1=matname;
194  mi1=mi;ielas1=ielas;icmd1=icmd;ncmat1_=ncmat_;nstate1_=nstate_;
195  stiini1=stiini;vini1=vini;ener1=ener;eei1=eei;enerini1=enerini;
196  istep1=istep;iinc1=iinc;springarea1=springarea;reltime1=reltime;
197  calcul_fn1=calcul_fn;calcul_qa1=calcul_qa;calcul_cauchy1=calcul_cauchy;
198  nener1=nener;ikin1=ikin;mt1=mt;nk1=nk;ne01=ne0;thicke1=thicke;
199  emeini1=emeini;pslavsurf1=pslavsurf;clearini1=clearini;
200  pmastsurf1=pmastsurf;mortar1=mortar;ielprop1=ielprop;prop1=prop;
201  kscale1=kscale;
202 
203  /* calculating the stresses */
204 
205  if(((*nmethod!=4)&&(*nmethod!=5))||(iperturb[0]>1)){
206  printf(" Using up to %" ITGFORMAT " cpu(s) for the stress calculation.\n\n", num_cpus);
207  }
208 
209  /* create threads and wait */
210 
211  NNEW(ithread,ITG,num_cpus);
212  for(i=0; i<num_cpus; i++) {
213  ithread[i]=i;
214  pthread_create(&tid[i], NULL, (void *)resultsmechmt, (void *)&ithread[i]);
215  }
216  for(i=0; i<num_cpus; i++) pthread_join(tid[i], NULL);
217 
218  for(i=0;i<mt**nk;i++){
219  fn[i]=fn1[i];
220  }
221  for(i=0;i<mt**nk;i++){
222  for(j=1;j<num_cpus;j++){
223  fn[i]+=fn1[i+j*mt**nk];
224  }
225  }
226  SFREE(fn1);SFREE(ithread);
227 
228  /* determine the internal force */
229 
230  qa[0]=qa1[0];
231  for(j=1;j<num_cpus;j++){
232  qa[0]+=qa1[j*4];
233  }
234 
235  /* determine the decrease of the time increment in case
236  the material routine diverged */
237 
238  qa[2]=qa1[2];
239  for(j=1;j<num_cpus;j++){
240  if(qa1[2+j*4]>0.){
241  if(qa[2]<0.){
242  qa[2]=qa1[2+j*4];
243  }else{
244  if(qa1[2+j*4]<qa[2]){qa[2]=qa1[2+j*4];}
245  }
246  }
247  }
248 
249  /* maximum change in creep strain increment in the
250  present time increment */
251 
252  qa[3]=qa1[3];
253  for(j=1;j<num_cpus;j++){
254  if(qa1[3+j*4]>0.){
255  if(qa[3]<0.){
256  qa[3]=qa1[3+j*4];
257  }else{
258  if(qa1[3+j*4]>qa[3]){qa[3]=qa1[3+j*4];}
259  }
260  }
261  }
262 
263  SFREE(qa1);
264 
265  for(j=1;j<num_cpus;j++){
266  nal[0]+=nal[j];
267  }
268 
269  if(calcul_qa==1){
270  if(nal[0]>0){
271  qa[0]/=nal[0];
272  }
273  }
274  SFREE(nal);
275  }
276 
277  /* calculating the thermal flux and material tangent at the
278  integration points; calculating the internal point flux */
279 
280  if((ithermal[0]>=2)&&(intpointvart==1)){
281 
282  NNEW(fn1,double,num_cpus*mt**nk);
283  NNEW(qa1,double,num_cpus*4);
284  NNEW(nal,ITG,num_cpus);
285 
286  co1=co;kon1=kon;ipkon1=ipkon;lakon1=lakon;v1=v;
287  elcon1=elcon;nelcon1=nelcon;rhcon1=rhcon;nrhcon1=nrhcon;
288  ielmat1=ielmat;ielorien1=ielorien;norien1=norien;orab1=orab;
289  ntmat1_=ntmat_;t01=t0;iperturb1=iperturb;iout1=iout;vold1=vold;
290  ipompc1=ipompc;nodempc1=nodempc;coefmpc1=coefmpc;nmpc1=nmpc;
291  dtime1=dtime;time1=time;ttime1=ttime;plkcon1=plkcon;
292  nplkcon1=nplkcon;xstateini1=xstateini;xstiff1=xstiff;
293  xstate1=xstate;npmat1_=npmat_;matname1=matname;mi1=mi;
294  ncmat1_=ncmat_;nstate1_=nstate_;cocon1=cocon;ncocon1=ncocon;
295  qfx1=qfx;ikmpc1=ikmpc;ilmpc1=ilmpc;istep1=istep;iinc1=iinc;
296  springarea1=springarea;calcul_fn1=calcul_fn;calcul_qa1=calcul_qa;
297  mt1=mt;nk1=nk;shcon1=shcon;nshcon1=nshcon;ithermal1=ithermal;
298  nelemload1=nelemload;nload1=nload;nmethod1=nmethod;reltime1=reltime;
299  sideload1=sideload;xload1=xload;xloadold1=xloadold;
300  pslavsurf1=pslavsurf;pmastsurf1=pmastsurf;mortar1=mortar;
301  clearini1=clearini;plicon1=plicon;nplicon1=nplicon;ne1=ne;
302  ielprop1=ielprop,prop1=prop;iponoel1=iponoel;inoel1=inoel;
303  network1=network;ipobody1=ipobody;ibody1=ibody;xbody1=xbody;
304 
305  /* calculating the heat flux */
306 
307  printf(" Using up to %" ITGFORMAT " cpu(s) for the heat flux calculation.\n\n", num_cpus);
308 
309  /* create threads and wait */
310 
311  NNEW(ithread,ITG,num_cpus);
312  for(i=0; i<num_cpus; i++) {
313  ithread[i]=i;
314  pthread_create(&tid[i], NULL, (void *)resultsthermmt, (void *)&ithread[i]);
315  }
316  for(i=0; i<num_cpus; i++) pthread_join(tid[i], NULL);
317 
318  for(i=0;i<*nk;i++){
319  fn[mt*i]=fn1[mt*i];
320  }
321  for(i=0;i<*nk;i++){
322  for(j=1;j<num_cpus;j++){
323  fn[mt*i]+=fn1[mt*i+j*mt**nk];
324  }
325  }
326  SFREE(fn1);SFREE(ithread);
327 
328  /* determine the internal concentrated heat flux */
329 
330  qa[1]=qa1[1];
331  for(j=1;j<num_cpus;j++){
332  qa[1]+=qa1[1+j*4];
333  }
334 
335  SFREE(qa1);
336 
337  for(j=1;j<num_cpus;j++){
338  nal[0]+=nal[j];
339  }
340 
341  if(calcul_qa==1){
342  if(nal[0]>0){
343  qa[1]/=nal[0];
344  }
345  }
346  SFREE(nal);
347  }
348 
349  /* calculating the matrix system internal force vector */
350 
351  FORTRAN(resultsforc,(nk,f,fn,nactdof,ipompc,nodempc,
352  coefmpc,labmpc,nmpc,mi,fmpc,&calcul_fn,&calcul_f));
353 
354  /* storing results in the .dat file
355  extrapolation of integration point values to the nodes
356  interpolation of 3d results for 1d/2d elements */
357 
358  FORTRAN(resultsprint,(co,nk,kon,ipkon,lakon,ne,v,stn,inum,
359  stx,ielorien,norien,orab,t1,ithermal,filab,een,iperturb,fn,
360  nactdof,iout,vold,nodeboun,ndirboun,nboun,nmethod,ttime,xstate,
361  epn,mi,
362  nstate_,ener,enern,xstaten,eei,set,nset,istartset,iendset,
363  ialset,nprint,prlab,prset,qfx,qfn,trab,inotr,ntrans,
364  nelemload,nload,&ikin,ielmat,thicke,eme,emn,rhcon,nrhcon,shcon,
365  nshcon,cocon,ncocon,ntmat_,sideload,icfd,inomat,pslavsurf,islavact,
366  cdn,mortar,islavnode,nslavnode,ntie,islavsurf,time,ielprop,prop,
367  veold,ne0,nmpc,ipompc,nodempc,labmpc,energyini,energy,orname,
368  xload));
369 
370  return;
371 
372 }
static double * prestr1
Definition: results.c:35
#define ITGFORMAT
Definition: CalculiX.h:52
subroutine resultsforc(nk, f, fn, nactdof, ipompc, nodempc, coefmpc, labmpc, nmpc, mi, fmpc, calcul_fn, calcul_f)
Definition: resultsforc.f:21
static ITG * icmd1
Definition: results.c:27
static double * t11
Definition: results.c:35
static ITG * inoel1
Definition: results.c:31
static double * xbody1
Definition: results.c:36
static ITG * nmethod1
Definition: results.c:27
static double * xload1
Definition: results.c:36
static double * dtime1
Definition: results.c:36
static double * qa1
Definition: results.c:36
static double * xstate1
Definition: results.c:36
static double * ener1
Definition: results.c:36
static ITG * npmat1_
Definition: results.c:27
int pthread_create(pthread_t *thread_id, const pthread_attr_t *attributes, void *(*thread_function)(void *), void *arguments)
static double * xstiff1
Definition: results.c:36
static ITG * istep1
Definition: results.c:27
static ITG * ithermal1
Definition: results.c:27
static ITG num_cpus
Definition: results.c:31
static double * springarea1
Definition: results.c:36
static double * veold1
Definition: results.c:36
static ITG * network1
Definition: results.c:31
static ITG * nmpc1
Definition: results.c:31
static double * eme1
Definition: results.c:35
static ITG * iprestr1
Definition: results.c:27
static ITG * ipompc1
Definition: results.c:31
static char * matname1
Definition: results.c:25
static ITG calcul_qa1
Definition: results.c:27
static ITG * kscale1
Definition: results.c:31
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
static ITG * mortar1
Definition: results.c:31
static ITG * nelemload1
Definition: results.c:31
static double * qfx1
Definition: results.c:36
static ITG * ipobody1
Definition: results.c:31
ITG strcmp1(const char *s1, const char *s2)
Definition: strcmp1.c:24
static double * time1
Definition: results.c:36
static ITG * nodempc1
Definition: results.c:31
static double * pmastsurf1
Definition: results.c:36
subroutine frditeration(co, nk, kon, ipkon, lakon, ne, v, time, ielmat, matname, mi, istep, iinc, ithermal)
Definition: frditeration.f:21
static double * rhcon1
Definition: results.c:35
static ITG * iout1
Definition: results.c:27
static double * fn1
Definition: results.c:36
static ITG * ne1
Definition: results.c:27
void * resultsthermmt(ITG *i)
Definition: results.c:409
ITG getSystemCPUs()
Definition: getSystemCPUs.c:40
subroutine resultsprint(co, nk, kon, ipkon, lakon, ne, v, stn, inum, stx, ielorien, norien, orab, t1, ithermal, filab, een, iperturb, fn, nactdof, iout, vold, nodeboun, ndirboun, nboun, nmethod, ttime, xstate, epn, mi, nstate_, ener, enern, xstaten, eei, set, nset, istartset, iendset, ialset, nprint, prlab, prset, qfx, qfn, trab, inotr, ntrans, nelemload, nload, ikin, ielmat, thicke, eme, emn, rhcon, nrhcon, shcon, nshcon, cocon, ncocon, ntmat_, sideload, icfd, inomat, pslavsurf, islavact, cdn, mortar, islavnode, nslavnode, ntie, islavsurf, time, ielprop, prop, veold, ne0, nmpc, ipompc, nodempc, labmpc, energyini, energy, orname, xload)
Definition: resultsprint.f:29
static double * prop1
Definition: results.c:36
static ITG ikin1
Definition: results.c:27
static double * t01
Definition: results.c:35
static double * shcon1
Definition: results.c:36
static ITG calcul_fn1
Definition: results.c:27
void * resultsmechmt(ITG *i)
Definition: results.c:376
static double * cocon1
Definition: results.c:36
static double * thicke1
Definition: results.c:36
static ITG * ielmat1
Definition: results.c:27
static double * vini1
Definition: results.c:36
static ITG * nplkcon1
Definition: results.c:27
static double * coefmpc1
Definition: results.c:36
static double * co1
Definition: results.c:35
#define SFREE(a)
Definition: CalculiX.h:41
static ITG * nalcon1
Definition: results.c:27
static ITG * ipkon1
Definition: results.c:27
static ITG * iponoel1
Definition: results.c:31
static char * sideload1
Definition: results.c:25
static ITG mt1
Definition: results.c:31
static double * alzero1
Definition: results.c:35
static ITG * norien1
Definition: results.c:27
static double * vold1
Definition: results.c:36
static ITG * ne01
Definition: results.c:31
static double * reltime1
Definition: results.c:36
static double * stx1
Definition: results.c:35
static double * elcon1
Definition: results.c:35
static ITG * ielas1
Definition: results.c:27
static double * xloadold1
Definition: results.c:36
static ITG * nrhcon1
Definition: results.c:27
static double * orab1
Definition: results.c:35
static double * xstateini1
Definition: results.c:36
static ITG * nplicon1
Definition: results.c:27
static ITG * nk1
Definition: results.c:31
static ITG * mi1
Definition: results.c:27
static ITG calcul_cauchy1
Definition: results.c:27
static ITG * iinc1
Definition: results.c:27
static ITG * ibody1
Definition: results.c:31
static double * plkcon1
Definition: results.c:36
static double * emeini1
Definition: results.c:36
static ITG * nshcon1
Definition: results.c:31
static ITG * ikmpc1
Definition: results.c:31
subroutine resultsini(nk, v, ithermal, filab, iperturb, f, fn, nactdof, iout, qa, vold, b, nodeboun, ndirboun, xboun, nboun, ipompc, nodempc, coefmpc, labmpc, nmpc, nmethod, cam, neq, veold, accold, bet, gam, dtime, mi, vini, nprint, prlab, intpointvarm, calcul_fn, calcul_f, calcul_qa, calcul_cauchy, nener, ikin, intpointvart, xforc, nforc)
Definition: resultsini.f:25
static ITG * ielorien1
Definition: results.c:27
static double * stiini1
Definition: results.c:36
int pthread_join(pthread_t thread, void **status_ptr)
static char * lakon1
Definition: results.c:25
static ITG * ncmat1_
Definition: results.c:27
static ITG * nal
Definition: results.c:31
static double * alcon1
Definition: results.c:35
static double * clearini1
Definition: results.c:36
static ITG * ntmat1_
Definition: results.c:27
static ITG * nener1
Definition: results.c:27
static double * plicon1
Definition: results.c:36
static ITG * ilmpc1
Definition: results.c:31
static ITG * ncocon1
Definition: results.c:31
#define ITG
Definition: CalculiX.h:51
static double * eei1
Definition: results.c:36
static double * enerini1
Definition: results.c:36
static ITG * nstate1_
Definition: results.c:27
static double * ttime1
Definition: results.c:36
#define NNEW(a, b, c)
Definition: CalculiX.h:39
static ITG * kon1
Definition: results.c:27
static double * v1
Definition: results.c:35
static ITG * nelcon1
Definition: results.c:27
static double * pslavsurf1
Definition: results.c:36
static ITG * nload1
Definition: results.c:31
static ITG * iperturb1
Definition: results.c:27
static ITG * ielprop1
Definition: results.c:31

◆ results_se()

void results_se ( double *  co,
ITG nk,
ITG kon,
ITG ipkon,
char *  lakon,
ITG ne,
double *  v,
double *  stn,
ITG inum,
double *  stx,
double *  elcon,
ITG nelcon,
double *  rhcon,
ITG nrhcon,
double *  alcon,
ITG nalcon,
double *  alzero,
ITG ielmat,
ITG ielorien,
ITG norien,
double *  orab,
ITG ntmat_,
double *  t0,
double *  t1,
ITG ithermal,
double *  prestr,
ITG iprestr,
char *  filab,
double *  eme,
double *  emn,
double *  een,
ITG iperturb,
double *  f,
double *  fn,
ITG nactdof,
ITG iout,
double *  qa,
double *  vold,
double *  b,
ITG nodeboun,
ITG ndirboun,
double *  xboun,
ITG nboun,
ITG ipompc,
ITG nodempc,
double *  coefmpc,
char *  labmpc,
ITG nmpc,
ITG nmethod,
double *  vmax,
ITG neq,
double *  veold,
double *  accold,
double *  beta,
double *  gamma,
double *  dtime,
double *  time,
double *  ttime,
double *  plicon,
ITG nplicon,
double *  plkcon,
ITG nplkcon,
double *  xstateini,
double *  xstiff,
double *  xstate,
ITG npmat_,
double *  epl,
char *  matname,
ITG mi,
ITG ielas,
ITG icmd,
ITG ncmat_,
ITG nstate_,
double *  stiini,
double *  vini,
ITG ikboun,
ITG ilboun,
double *  ener,
double *  enern,
double *  emeini,
double *  xstaten,
double *  eei,
double *  enerini,
double *  cocon,
ITG ncocon,
char *  set,
ITG nset,
ITG istartset,
ITG iendset,
ITG ialset,
ITG nprint,
char *  prlab,
char *  prset,
double *  qfx,
double *  qfn,
double *  trab,
ITG inotr,
ITG ntrans,
double *  fmpc,
ITG nelemload,
ITG nload,
ITG ikmpc,
ITG ilmpc,
ITG istep,
ITG iinc,
double *  springarea,
double *  reltime,
ITG ne0,
double *  xforc,
ITG nforc,
double *  thicke,
double *  shcon,
ITG nshcon,
char *  sideload,
double *  xload,
double *  xloadold,
ITG icfd,
ITG inomat,
double *  pslavsurf,
double *  pmastsurf,
ITG mortar,
ITG islavact,
double *  cdn,
ITG islavnode,
ITG nslavnode,
ITG ntie,
double *  clearini,
ITG islavsurf,
ITG ielprop,
double *  prop,
double *  energyini,
double *  energy,
double *  df,
double *  distmin,
ITG ndesi,
ITG nodedesi,
double *  sti,
ITG nkon,
ITG jqs,
ITG irows,
ITG nactdofinv,
ITG icoordinate,
double *  dxstiff,
ITG istartdesi,
ITG ialdesi,
double *  xdesi,
ITG ieigenfrequency,
double *  fint,
ITG ishapeenergy 
)
79  {
80 
81  ITG intpointvarm,calcul_fn,calcul_f,calcul_qa,calcul_cauchy,nener,ikin,
82  intpointvart,mt=mi[1]+1,i,j,idesvar,iorien,idir,im,
83  nea,neb;
84 
85  double *dfn=NULL,*fn0=NULL,a[9],pgauss[3],rotvec[3],orabsav[7];
86 
87  /* calculating the sensitivity of the internal forces */
88 
89  /* variables for multithreading procedure */
90 
91  ITG sys_cpus,*ithread=NULL;
92  char *env,*envloc,*envsys;
93 
94  num_cpus = 0;
95  sys_cpus=0;
96 
97  /* explicit user declaration prevails */
98 
99  envsys=getenv("NUMBER_OF_CPUS");
100  if(envsys){
101  sys_cpus=atoi(envsys);
102  if(sys_cpus<0) sys_cpus=0;
103  }
104 
105  /* automatic detection of available number of processors */
106 
107  if(sys_cpus==0){
108  sys_cpus = getSystemCPUs();
109  if(sys_cpus<1) sys_cpus=1;
110  }
111 
112  /* local declaration prevails, if strictly positive */
113 
114  envloc = getenv("CCX_NPROC_RESULTS");
115  if(envloc){
116  num_cpus=atoi(envloc);
117  if(num_cpus<0){
118  num_cpus=0;
119  }else if(num_cpus>sys_cpus){
120  num_cpus=sys_cpus;
121  }
122 
123  }
124 
125  /* else global declaration, if any, applies */
126 
127  env = getenv("OMP_NUM_THREADS");
128  if(num_cpus==0){
129  if (env)
130  num_cpus = atoi(env);
131  if (num_cpus < 1) {
132  num_cpus=1;
133  }else if(num_cpus>sys_cpus){
134  num_cpus=sys_cpus;
135  }
136  }
137 
138 // next line is to be inserted in a similar way for all other paralell parts
139 
140  if(*ne<num_cpus) num_cpus=*ne;
141 
142  pthread_t tid[num_cpus];
143 
144  /* 1. nodewise storage of the primary variables
145  2. determination which derived variables have to be calculated */
146 
147  FORTRAN(resultsini,(nk,v,ithermal,filab,iperturb,f,fn,
148  nactdof,iout,qa,vold,b,nodeboun,ndirboun,
149  xboun,nboun,ipompc,nodempc,coefmpc,labmpc,nmpc,nmethod,cam,neq,
150  veold,accold,bet,gam,dtime,mi,vini,nprint,prlab,
151  &intpointvarm,&calcul_fn,&calcul_f,&calcul_qa,&calcul_cauchy,&nener,
152  &ikin,&intpointvart,xforc,nforc));
153 
154  NNEW(fn0,double,mt**nkon);
155  NNEW(dfn,double,mt**nk);
156 
157  if(((*nmethod!=4)&&(*nmethod!=5))||(iperturb[0]>1)){
158  printf(" Using up to %" ITGFORMAT " cpu(s) for the sensitivity of the internal forces.\n\n", num_cpus);
159  }
160 
161  /* nodal forces without perturbation */
162 
163  idesvar=0;
164 
165  /* calculating the stresses and material tangent at the
166  integration points; calculating the internal forces */
167 
168  if(((ithermal[0]<=1)||(ithermal[0]>=3))&&(intpointvarm==1)){
169 
170  NNEW(fn01,double,num_cpus*mt**nkon);
171 
172  co1=co;kon1=kon;ipkon1=ipkon;lakon1=lakon;ne1=ne;v1=v;
173  stx1=stx;elcon1=elcon;nelcon1=nelcon;rhcon1=rhcon;
174  nrhcon1=nrhcon;alcon1=alcon;nalcon1=nalcon;alzero1=alzero;
175  ielmat1=ielmat;ielorien1=ielorien;norien1=norien;orab1=orab;
176  ntmat1_=ntmat_;t01=t0;t11=t1;ithermal1=ithermal;prestr1=prestr;
177  iprestr1=iprestr;eme1=eme;iperturb1=iperturb;iout1=iout;
178  vold1=vold;nmethod1=nmethod;veold1=veold;dtime1=dtime;
179  time1=time;ttime1=ttime;plicon1=plicon;nplicon1=nplicon;
180  plkcon1=plkcon;nplkcon1=nplkcon;xstateini1=xstateini;
181  xstiff1=xstiff;xstate1=xstate;npmat1_=npmat_;matname1=matname;
182  mi1=mi;ielas1=ielas;icmd1=icmd;ncmat1_=ncmat_;nstate1_=nstate_;
183  stiini1=stiini;vini1=vini;ener1=ener;eei1=eei;enerini1=enerini;
184  istep1=istep;iinc1=iinc;springarea1=springarea;reltime1=reltime;
185  calcul_fn1=calcul_fn;calcul_cauchy1=calcul_cauchy;
186  nener1=nener;ikin1=ikin;mt1=mt;nk1=nk;ne01=ne0;thicke1=thicke;
187  emeini1=emeini;pslavsurf1=pslavsurf;clearini1=clearini;
188  pmastsurf1=pmastsurf;mortar1=mortar;ielprop1=ielprop;prop1=prop;
189  idesvar1=idesvar;nodedesi1=nodedesi;
190  sti1=sti;nkon1=nkon;icoordinate1=icoordinate;
191  dxstiff1=dxstiff;ialdesi1=ialdesi;xdesi1=xdesi;
192 
193  /* create threads and wait */
194 
195  NNEW(ithread,ITG,num_cpus);
196  for(i=0; i<num_cpus; i++) {
197  ithread[i]=i;
198  pthread_create(&tid[i], NULL, (void *)resultsmechmt_se, (void *)&ithread[i]);
199  }
200  for(i=0; i<num_cpus; i++) pthread_join(tid[i], NULL);
201 
202  /* Assembling fn0 and dfn */
203 
204  for(i=0;i<mt**nkon;i++){
205  fn0[i]=fn01[i];
206  }
207  for(i=0;i<mt**nkon;i++){
208  for(j=1;j<num_cpus;j++){
209  fn0[i]+=fn01[i+j*mt**nkon];
210  }
211  }
212 
213  SFREE(fn01);
214  SFREE(ithread);
215  }
216 
217  /* in case of nonlinear geometry calculate vector fint */
218 
219  if((iperturb[1]==1)&&(*ishapeenergy==1)){
220  FORTRAN(createfint,(ne,ipkon,lakon,kon,nactdof,mi,fn0,fint));
221  }
222 
223  /* loop over the design variables (perturbation) */
224 
225  for(idesvar=1;idesvar<=*ndesi;idesvar++){
226 
227  DMEMSET(dfn,0,mt**nk,0.);
228 
229  /* calculate a delta in the orientation
230  in case the material orientation is the design variable */
231 
232  if(*icoordinate!=1){
233  iorien=(idesvar-1)/3;
234 
235  /* save nominal orientation */
236 
237  memcpy(&orabsav[0],&orab[7*iorien],sizeof(double)*7);
238 
239  /* calculate the transformation matrix */
240 
241  FORTRAN(transformatrix,(&orab[7*iorien],pgauss,a));
242 
243  /* calculate the rotation vector from the transformation matrix */
244 
245  FORTRAN(rotationvector,(a,rotvec));
246  idir=(idesvar-1)-iorien*3;
247 
248  /* add a small variation to the rotation vector component */
249 
250  rotvec[idir]+=*distmin;
251 
252  /* determine the new transformation matrix */
253 
254  FORTRAN(rotationvectorinv,(a,rotvec));
255 
256  /* determine two new points in the x-y plane */
257 
258  for(i=0;i<6;i++){orab[7*iorien+i]=a[i];}
259  }
260 
261  /* calculating the stresses and material tangent at the
262  integration points; calculating the internal forces */
263 
264  if(((ithermal[0]<=1)||(ithermal[0]>=3))&&(intpointvarm==1)){
265  nea=istartdesi[idesvar-1];
266  neb=istartdesi[idesvar]-1;
267 
268  FORTRAN(resultsmech_se,(co,kon,ipkon,lakon,ne,v,
269  stx,elcon,nelcon,rhcon,nrhcon,alcon,nalcon,alzero,
270  ielmat,ielorien,norien,orab,ntmat1_,t0,t1,ithermal,prestr,
271  iprestr,eme,iperturb,fn,iout,vold,nmethod,
272  veold,dtime,time,ttime,plicon,nplicon,plkcon,nplkcon,
273  xstateini,xstiff,xstate,npmat1_,matname,mi,ielas,icmd,
274  ncmat1_,nstate1_,stiini,vini,ener,eei,enerini,istep,iinc,
275  springarea,reltime,&calcul_fn,&calcul_cauchy,&nener,
276  &ikin,ne0,thicke,emeini,
277  pslavsurf,pmastsurf,mortar,clearini,&nea,&neb,ielprop,prop,
278  dfn,&idesvar,nodedesi,
279  fn0,sti,icoordinate,dxstiff,ialdesi,xdesi));
280  }
281 
282  /* calculating the matrix system internal force vector
283  for nonlinear geometrical calculations */
284 
285 // if((iperturb[1]==1)&&(*ieigenfrequency!=1)){
286  if(*ieigenfrequency!=1){
287  FORTRAN(resultsforc_se,(nk,dfn,nactdofinv,ipompc,nodempc,
288  coefmpc,nmpc,mi,fmpc,&calcul_fn,&calcul_f,
289  &idesvar,df,jqs,irows,distmin));
290  }
291 
292  /* restoring the nominal orientation (in case the design variables
293  are the orientations */
294 
295  if(*icoordinate!=1){
296  if(idesvar>0){
297  memcpy(&orab[7*iorien],&orabsav[0],sizeof(double)*7);
298  }
299  }
300 
301  } /* end loop over design variables */
302 
303 
304  SFREE(fn0);SFREE(dfn);
305 
306  return;
307 
308 }
static ITG calcul_fn1
Definition: results_se.c:28
static double * reltime1
Definition: results_se.c:37
#define ITGFORMAT
Definition: CalculiX.h:52
static ITG * nkon1
Definition: results_se.c:28
static ITG * icoordinate1
Definition: results_se.c:28
static double * fn01
Definition: results_se.c:37
static ITG * ithermal1
Definition: results_se.c:28
static ITG * iperturb1
Definition: results_se.c:28
static double * enerini1
Definition: results_se.c:37
int pthread_create(pthread_t *thread_id, const pthread_attr_t *attributes, void *(*thread_function)(void *), void *arguments)
static double * rhcon1
Definition: results_se.c:36
static ITG * iinc1
Definition: results_se.c:28
static ITG * iout1
Definition: results_se.c:28
static double * orab1
Definition: results_se.c:36
static ITG * nstate1_
Definition: results_se.c:28
subroutine df(x, u, uprime, rpar, nev)
Definition: subspace.f:133
static double * alzero1
Definition: results_se.c:36
static double * veold1
Definition: results_se.c:37
static ITG * nk1
Definition: results_se.c:28
static double * t01
Definition: results_se.c:36
static ITG * istep1
Definition: results_se.c:28
static double * elcon1
Definition: results_se.c:36
static ITG mt1
Definition: results_se.c:28
static ITG * ielorien1
Definition: results_se.c:28
void * resultsmechmt_se(ITG *i)
Definition: results_se.c:312
static ITG calcul_cauchy1
Definition: results_se.c:28
static double * dxstiff1
Definition: results_se.c:37
static ITG * ntmat1_
Definition: results_se.c:28
subroutine rotationvectorinv(c, v)
Definition: rotationvectorinv.f:20
static ITG * npmat1_
Definition: results_se.c:28
static double * clearini1
Definition: results_se.c:37
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
static double * t11
Definition: results_se.c:36
static char * lakon1
Definition: results_se.c:26
subroutine resultsforc_se(nk, dfn, nactdofinv, ipompc, nodempc, coefmpc, nmpc, mi, fmpc, calcul_fn, calcul_f, idesvar, df, jqs, irows, distmin)
Definition: resultsforc_se.f:22
static ITG * ielas1
Definition: results_se.c:28
static double * xstateini1
Definition: results_se.c:37
static ITG * mi1
Definition: results_se.c:28
static double * thicke1
Definition: results_se.c:37
static double * co1
Definition: results_se.c:36
static double * dtime1
Definition: results_se.c:37
ITG getSystemCPUs()
Definition: getSystemCPUs.c:40
static double * xstate1
Definition: results_se.c:37
#define DMEMSET(a, b, c, d)
Definition: CalculiX.h:45
static ITG * ialdesi1
Definition: results_se.c:28
static double * stiini1
Definition: results_se.c:37
static ITG nener1
Definition: results_se.c:28
static double * pmastsurf1
Definition: results_se.c:37
static ITG * nelcon1
Definition: results_se.c:28
static double * alcon1
Definition: results_se.c:36
static double * emeini1
Definition: results_se.c:37
static double * xstiff1
Definition: results_se.c:37
static double * stx1
Definition: results_se.c:36
static ITG * nodedesi1
Definition: results_se.c:28
subroutine transformatrix(xab, p, a)
Definition: transformatrix.f:20
static double * plkcon1
Definition: results_se.c:37
static ITG ikin1
Definition: results_se.c:28
static ITG * ipkon1
Definition: results_se.c:28
static ITG num_cpus
Definition: results_se.c:28
static ITG * ncmat1_
Definition: results_se.c:28
static ITG * mortar1
Definition: results_se.c:28
static double * ttime1
Definition: results_se.c:37
#define SFREE(a)
Definition: CalculiX.h:41
static double * vini1
Definition: results_se.c:37
static ITG * iprestr1
Definition: results_se.c:28
static ITG * nmethod1
Definition: results_se.c:28
static char * matname1
Definition: results_se.c:26
static ITG idesvar1
Definition: results_se.c:28
static double * vold1
Definition: results_se.c:37
static ITG * nplkcon1
Definition: results_se.c:28
static ITG * ielprop1
Definition: results_se.c:28
static ITG * nplicon1
Definition: results_se.c:28
static double * plicon1
Definition: results_se.c:37
subroutine createfint(ne, ipkon, lakon, kon, nactdof, mi, fn0, fint)
Definition: createfint.f:21
static double * ener1
Definition: results_se.c:37
static ITG * icmd1
Definition: results_se.c:28
static double * springarea1
Definition: results_se.c:37
subroutine resultsini(nk, v, ithermal, filab, iperturb, f, fn, nactdof, iout, qa, vold, b, nodeboun, ndirboun, xboun, nboun, ipompc, nodempc, coefmpc, labmpc, nmpc, nmethod, cam, neq, veold, accold, bet, gam, dtime, mi, vini, nprint, prlab, intpointvarm, calcul_fn, calcul_f, calcul_qa, calcul_cauchy, nener, ikin, intpointvart, xforc, nforc)
Definition: resultsini.f:25
static double * pslavsurf1
Definition: results_se.c:37
static double * sti1
Definition: results_se.c:37
int pthread_join(pthread_t thread, void **status_ptr)
static double * v1
Definition: results_se.c:36
static ITG * nrhcon1
Definition: results_se.c:28
static double * eei1
Definition: results_se.c:37
static ITG * norien1
Definition: results_se.c:28
static ITG * kon1
Definition: results_se.c:28
#define ITG
Definition: CalculiX.h:51
static double * eme1
Definition: results_se.c:36
static ITG * ielmat1
Definition: results_se.c:28
subroutine rotationvector(a, v)
Definition: rotationvector.f:20
static ITG * nalcon1
Definition: results_se.c:28
#define NNEW(a, b, c)
Definition: CalculiX.h:39
static double * prestr1
Definition: results_se.c:36
static double * prop1
Definition: results_se.c:37
static double * xdesi1
Definition: results_se.c:37
static ITG * ne01
Definition: results_se.c:28
subroutine resultsmech_se(co, kon, ipkon, lakon, ne, v, stx, elcon, nelcon, rhcon, nrhcon, alcon, nalcon, alzero, ielmat, ielorien, norien, orab, ntmat_, t0, t1, ithermal, prestr, iprestr, eme, iperturb, fn, iout, vold, nmethod, veold, dtime, time, ttime, plicon, nplicon, plkcon, nplkcon, xstateini, xstiff, xstate, npmat_, matname, mi, ielas, icmd, ncmat_, nstate_, stiini, vini, ener, eei, enerini, istep, iinc, springarea, reltime, calcul_fn, calcul_cauchy, nener, ikin, ne0, thicke, emeini, pslavsurf, pmastsurf, mortar, clearini, nea, neb, ielprop, prop, dfn, idesvar, nodedesi, fn0, sti, icoordinate, dxstiff, ialdesi, xdesi)
Definition: resultsmech_se.f:31
static double * time1
Definition: results_se.c:37
static ITG * ne1
Definition: results_se.c:28

◆ resultsemmt()

void* resultsemmt ( ITG i)
311  {
312 
313  ITG nea,neb,nedelta;
314 
315  nedelta=(ITG)floor(*ne1/(double)num_cpus);
316  nea=*i*nedelta+1;
317  neb=(*i+1)*nedelta;
318 // next line! -> all parallel sections
319  if((*i==num_cpus-1)&&(neb<*ne1)) neb=*ne1;
320 
324 
325  return NULL;
326 }
static ITG * mi1
Definition: resultsinduction.c:27
static double * v1
Definition: resultsinduction.c:35
static double * sti1
Definition: resultsinduction.c:36
static ITG num_cpus
Definition: resultsinduction.c:31
static ITG * istartset1
Definition: resultsinduction.c:31
static double * elcon1
Definition: resultsinduction.c:35
static double * vini1
Definition: resultsinduction.c:36
static char * matname1
Definition: resultsinduction.c:25
static ITG * nelcon1
Definition: resultsinduction.c:27
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
static ITG * kon1
Definition: resultsinduction.c:27
static double * alcon1
Definition: resultsinduction.c:35
static ITG * ipkon1
Definition: resultsinduction.c:27
static ITG * nalcon1
Definition: resultsinduction.c:27
subroutine resultsem(co, kon, ipkon, lakon, v, elcon, nelcon, ielmat, ntmat_, vini, dtime, matname, mi, ncmat_, nea, neb, sti, alcon, nalcon, h0, istartset, iendset, ialset, iactive, fn)
Definition: resultsem.f:22
static double * fn1
Definition: resultsinduction.c:36
static ITG * ielmat1
Definition: resultsinduction.c:27
static ITG * iendset1
Definition: resultsinduction.c:31
static char * lakon1
Definition: resultsinduction.c:25
#define ITG
Definition: CalculiX.h:51
static ITG * ialset1
Definition: resultsinduction.c:31
static ITG * ncmat1_
Definition: resultsinduction.c:27
static double * co1
Definition: resultsinduction.c:35
static ITG * ne1
Definition: resultsinduction.c:27
static double * dtime1
Definition: resultsinduction.c:36
static ITG * ntmat1_
Definition: resultsinduction.c:27
static ITG * iactive1
Definition: resultsinduction.c:31
static double * h01
Definition: resultsinduction.c:36

◆ resultsinduction()

void resultsinduction ( double *  co,
ITG nk,
ITG kon,
ITG ipkon,
char *  lakon,
ITG ne,
double *  v,
double *  stn,
ITG inum,
double *  elcon,
ITG nelcon,
double *  rhcon,
ITG nrhcon,
double *  alcon,
ITG nalcon,
double *  alzero,
ITG ielmat,
ITG ielorien,
ITG norien,
double *  orab,
ITG ntmat_,
double *  t0,
double *  t1,
ITG ithermal,
double *  prestr,
ITG iprestr,
char *  filab,
double *  eme,
double *  emn,
double *  een,
ITG iperturb,
double *  f,
double *  fn,
ITG nactdof,
ITG iout,
double *  qa,
double *  vold,
double *  b,
ITG nodeboun,
ITG ndirboun,
double *  xboun,
ITG nboun,
ITG ipompc,
ITG nodempc,
double *  coefmpc,
char *  labmpc,
ITG nmpc,
ITG nmethod,
double *  vmax,
ITG neq,
double *  veold,
double *  accold,
double *  beta,
double *  gamma,
double *  dtime,
double *  time,
double *  ttime,
double *  plicon,
ITG nplicon,
double *  plkcon,
ITG nplkcon,
double *  xstateini,
double *  xstiff,
double *  xstate,
ITG npmat_,
double *  epl,
char *  matname,
ITG mi,
ITG ielas,
ITG icmd,
ITG ncmat_,
ITG nstate_,
double *  sti,
double *  vini,
ITG ikboun,
ITG ilboun,
double *  ener,
double *  enern,
double *  emeini,
double *  xstaten,
double *  eei,
double *  enerini,
double *  cocon,
ITG ncocon,
char *  set,
ITG nset,
ITG istartset,
ITG iendset,
ITG ialset,
ITG nprint,
char *  prlab,
char *  prset,
double *  qfx,
double *  qfn,
double *  trab,
ITG inotr,
ITG ntrans,
double *  fmpc,
ITG nelemload,
ITG nload,
ITG ikmpc,
ITG ilmpc,
ITG istep,
ITG iinc,
double *  springarea,
double *  reltime,
ITG ne0,
double *  xforc,
ITG nforc,
double *  thicke,
double *  shcon,
ITG nshcon,
char *  sideload,
double *  xload,
double *  xloadold,
ITG icfd,
ITG inomat,
double *  h0,
ITG islavnode,
ITG nslavnode,
ITG ntie,
ITG ielprop,
double *  prop,
ITG iactive,
double *  energyini,
double *  energy,
ITG iponoel,
ITG inoel,
char *  orname,
ITG network,
ITG ipobody,
double *  xbody,
ITG ibody 
)
73  {
74 
75  /* variables for multithreading procedure */
76 
77  char *env,*envloc,*envsys;
78 
79  ITG intpointvarm,calcul_fn,calcul_f,calcul_qa,calcul_cauchy,nener,ikin,
80  intpointvart,mt=mi[1]+1,i,j,*ithread=NULL,*islavsurf=NULL,
81  sys_cpus,mortar=0,*islavact=NULL;
82 
83  double *pmastsurf=NULL,*clearini=NULL,*pslavsurf=NULL,*cdn=NULL;
84 
85  /*
86 
87  calculating integration point values (strains, stresses,
88  heat fluxes, material tangent matrices and nodal forces)
89 
90  storing the nodal and integration point results in the
91  .dat file
92 
93  iout=-2: v is assumed to be known and is used to
94  calculate strains, stresses..., no result output
95  corresponds to iout=-1 with in addition the
96  calculation of the internal energy density
97  iout=-1: v is assumed to be known and is used to
98  calculate strains, stresses..., no result output;
99  is used to take changes in SPC's and MPC's at the
100  start of a new increment or iteration into account
101  iout=0: v is calculated from the system solution
102  and strains, stresses.. are calculated, no result output
103  iout=1: v is calculated from the system solution and strains,
104  stresses.. are calculated, requested results output
105  iout=2: v is assumed to be known and is used to
106  calculate strains, stresses..., requested results output */
107 
108  num_cpus=0;
109  sys_cpus=0;
110 
111  /* explicit user declaration prevails */
112 
113  envsys=getenv("NUMBER_OF_CPUS");
114  if(envsys){
115  sys_cpus=atoi(envsys);
116  if(sys_cpus<0) sys_cpus=0;
117  }
118 
119  /* automatic detection of available number of processors */
120 
121  if(sys_cpus==0){
122  sys_cpus = getSystemCPUs();
123  if(sys_cpus<1) sys_cpus=1;
124  }
125 
126  /* local declaration prevails, if strictly positive */
127 
128  envloc = getenv("CCX_NPROC_RESULTS");
129  if(envloc){
130  num_cpus=atoi(envloc);
131  if(num_cpus<0){
132  num_cpus=0;
133  }else if(num_cpus>sys_cpus){
134  num_cpus=sys_cpus;
135  }
136 
137  }
138 
139  /* else global declaration, if any, applies */
140 
141  env = getenv("OMP_NUM_THREADS");
142  if(num_cpus==0){
143  if (env)
144  num_cpus = atoi(env);
145  if (num_cpus < 1) {
146  num_cpus=1;
147  }else if(num_cpus>sys_cpus){
148  num_cpus=sys_cpus;
149  }
150  }
151 
152 // next line is to be inserted in a similar way for all other paralell parts
153 
154  if(*ne<num_cpus) num_cpus=*ne;
155 
156  pthread_t tid[num_cpus];
157 
158  /* 1. nodewise storage of the primary variables
159  2. determination which derived variables have to be calculated */
160 
161  FORTRAN(resultsini_em,(nk,v,ithermal,filab,iperturb,f,fn,
162  nactdof,iout,qa,b,nodeboun,ndirboun,
163  xboun,nboun,ipompc,nodempc,coefmpc,labmpc,nmpc,nmethod,cam,neq,
164  veold,dtime,mi,vini,nprint,prlab,
165  &intpointvarm,&calcul_fn,&calcul_f,&calcul_qa,&calcul_cauchy,&nener,
166  &ikin,&intpointvart,xforc,nforc));
167 
168  /* electromagnetic calculation is linear: should not be taken
169  into account in the convergence check (only thermal part
170  is taken into account) */
171 
172  cam[0]=0.;
173 
174  /* next statement allows for storing the displacements in each
175  iteration: for debugging purposes */
176 
177  if((strcmp1(&filab[3],"I")==0)&&(*iout==0)){
178  FORTRAN(frditeration,(co,nk,kon,ipkon,lakon,ne,v,
179  ttime,ielmat,matname,mi,istep,iinc,ithermal));
180  }
181 
182  /* calculating the stresses and material tangent at the
183  integration points; calculating the internal forces */
184 
185  if(((ithermal[0]<=1)||(ithermal[0]>=3))&&(intpointvarm==1)){
186 
187  co1=co;kon1=kon;ipkon1=ipkon;lakon1=lakon;v1=v;elcon1=elcon;
188  nelcon1=nelcon;ielmat1=ielmat;ntmat1_=ntmat_;vini1=vini;dtime1=dtime;
189  matname1=matname;mi1=mi;ncmat1_=ncmat_;sti1=sti;alcon1=alcon;
190  nalcon1=nalcon;h01=h0;ne1=ne;istartset1=istartset;iendset1=iendset;
191  ialset1=ialset;iactive1=iactive;fn1=fn;
192 
193  /* calculating the magnetic field */
194 
195  if(((*nmethod!=4)&&(*nmethod!=5))||(iperturb[0]>1)){
196  printf(" Using up to %" ITGFORMAT " cpu(s) for the magnetic field calculation.\n\n", num_cpus);
197  }
198 
199  /* create threads and wait */
200 
201  NNEW(ithread,ITG,num_cpus);
202  for(i=0; i<num_cpus; i++) {
203  ithread[i]=i;
204  pthread_create(&tid[i], NULL, (void *)resultsemmt, (void *)&ithread[i]);
205  }
206  for(i=0; i<num_cpus; i++) pthread_join(tid[i], NULL);
207  SFREE(ithread);
208 
209  qa[0]=0.;
210  }
211 
212  /* calculating the thermal flux and material tangent at the
213  integration points; calculating the internal point flux */
214 
215  if((ithermal[0]>=2)&&(intpointvart==1)){
216 
217  NNEW(fn1,double,num_cpus*mt**nk);
218  NNEW(qa1,double,num_cpus*4);
219  NNEW(nal,ITG,num_cpus);
220 
221  co1=co;kon1=kon;ipkon1=ipkon;lakon1=lakon;v1=v;
222  elcon1=elcon;nelcon1=nelcon;rhcon1=rhcon;nrhcon1=nrhcon;
223  ielmat1=ielmat;ielorien1=ielorien;norien1=norien;orab1=orab;
224  ntmat1_=ntmat_;t01=t0;iperturb1=iperturb;iout1=iout;vold1=vold;
225  ipompc1=ipompc;nodempc1=nodempc;coefmpc1=coefmpc;nmpc1=nmpc;
226  dtime1=dtime;time1=time;ttime1=ttime;plkcon1=plkcon;
227  nplkcon1=nplkcon;xstateini1=xstateini;xstiff1=xstiff;
228  xstate1=xstate;npmat1_=npmat_;matname1=matname;mi1=mi;
229  ncmat1_=ncmat_;nstate1_=nstate_;cocon1=cocon;ncocon1=ncocon;
230  qfx1=qfx;ikmpc1=ikmpc;ilmpc1=ilmpc;istep1=istep;iinc1=iinc;
231  springarea1=springarea;calcul_fn1=calcul_fn;calcul_qa1=calcul_qa;
232  mt1=mt;nk1=nk;shcon1=shcon;nshcon1=nshcon;ithermal1=ithermal;
233  nelemload1=nelemload;nload1=nload;nmethod1=nmethod;reltime1=reltime;
234  sideload1=sideload;xload1=xload;xloadold1=xloadold;
235  pslavsurf1=pslavsurf;pmastsurf1=pmastsurf;mortar1=mortar;
236  clearini1=clearini;plicon1=plicon;nplicon1=nplicon;ielprop1=ielprop;
237  prop1=prop;iponoel1=iponoel;inoel1=inoel;network1=network;
238  ipobody1=ipobody;ibody1=ibody;xbody1=xbody;
239 
240  /* calculating the heat flux */
241 
242  printf(" Using up to %" ITGFORMAT " cpu(s) for the heat flux calculation.\n\n", num_cpus);
243 
244  /* create threads and wait */
245 
246  NNEW(ithread,ITG,num_cpus);
247  for(i=0; i<num_cpus; i++) {
248  ithread[i]=i;
249  pthread_create(&tid[i], NULL, (void *)resultsthermemmt, (void *)&ithread[i]);
250  }
251  for(i=0; i<num_cpus; i++) pthread_join(tid[i], NULL);
252 
253  for(i=0;i<*nk;i++){
254  fn[mt*i]=fn1[mt*i];
255  }
256  for(i=0;i<*nk;i++){
257  for(j=1;j<num_cpus;j++){
258  fn[mt*i]+=fn1[mt*i+j*mt**nk];
259  }
260  }
261  SFREE(fn1);SFREE(ithread);
262 
263  /* determine the internal concentrated heat flux */
264 
265  qa[1]=qa1[1];
266  for(j=1;j<num_cpus;j++){
267  qa[1]+=qa1[1+j*4];
268  }
269 
270  SFREE(qa1);
271 
272  for(j=1;j<num_cpus;j++){
273  nal[0]+=nal[j];
274  }
275 
276  if(calcul_qa==1){
277  if(nal[0]>0){
278  qa[1]/=nal[0];
279  }
280  }
281  SFREE(nal);
282  }
283 
284  /* calculating the thermal internal forces */
285 
286  FORTRAN(resultsforc_em,(nk,f,fn,nactdof,ipompc,nodempc,
287  coefmpc,labmpc,nmpc,mi,fmpc,&calcul_fn,&calcul_f,inomat));
288 
289  /* storing results in the .dat file
290  extrapolation of integration point values to the nodes
291  interpolation of 3d results for 1d/2d elements */
292 
293  FORTRAN(resultsprint,(co,nk,kon,ipkon,lakon,ne,v,stn,inum,
294  sti,ielorien,norien,orab,t1,ithermal,filab,een,iperturb,fn,
295  nactdof,iout,vold,nodeboun,ndirboun,nboun,nmethod,ttime,xstate,
296  epn,mi,
297  nstate_,ener,enern,xstaten,eei,set,nset,istartset,iendset,
298  ialset,nprint,prlab,prset,qfx,qfn,trab,inotr,ntrans,
299  nelemload,nload,&ikin,ielmat,thicke,eme,emn,rhcon,nrhcon,shcon,
300  nshcon,cocon,ncocon,ntmat_,sideload,icfd,inomat,pslavsurf,islavact,
301  cdn,&mortar,islavnode,nslavnode,ntie,islavsurf,time,ielprop,prop,
302  veold,ne0,nmpc,ipompc,nodempc,labmpc,energyini,energy,orname,
303  xload));
304 
305  return;
306 
307 }
static ITG * iinc1
Definition: resultsinduction.c:27
#define ITGFORMAT
Definition: CalculiX.h:52
static ITG * mi1
Definition: resultsinduction.c:27
static double * v1
Definition: resultsinduction.c:35
subroutine resultsini_em(nk, v, ithermal, filab, iperturb, f, fn, nactdof, iout, qa, b, nodeboun, ndirboun, xboun, nboun, ipompc, nodempc, coefmpc, labmpc, nmpc, nmethod, cam, neq, veold, dtime, mi, vini, nprint, prlab, intpointvarm, calcul_fn, calcul_f, calcul_qa, calcul_cauchy, nener, ikin, intpointvart, xforc, nforc)
Definition: resultsini_em.f:25
static ITG * nelemload1
Definition: resultsinduction.c:31
static ITG * nstate1_
Definition: resultsinduction.c:27
static double * prop1
Definition: resultsinduction.c:36
static double * qa1
Definition: resultsinduction.c:36
static ITG * ipobody1
Definition: resultsinduction.c:31
int pthread_create(pthread_t *thread_id, const pthread_attr_t *attributes, void *(*thread_function)(void *), void *arguments)
static double * sti1
Definition: resultsinduction.c:36
static ITG num_cpus
Definition: resultsinduction.c:31
static ITG calcul_fn1
Definition: resultsinduction.c:27
static ITG * istartset1
Definition: resultsinduction.c:31
static ITG * inoel1
Definition: resultsinduction.c:27
static double * elcon1
Definition: resultsinduction.c:35
static ITG * ielorien1
Definition: resultsinduction.c:27
static double * vini1
Definition: resultsinduction.c:36
static ITG * ibody1
Definition: resultsinduction.c:31
static double * xstate1
Definition: resultsinduction.c:36
static double * clearini1
Definition: resultsinduction.c:36
static char * sideload1
Definition: resultsinduction.c:25
static char * matname1
Definition: resultsinduction.c:25
static double * xloadold1
Definition: resultsinduction.c:36
static ITG * nelcon1
Definition: resultsinduction.c:27
static ITG * nload1
Definition: resultsinduction.c:31
static ITG * ielprop1
Definition: resultsinduction.c:27
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
static double * qfx1
Definition: resultsinduction.c:36
static ITG * kon1
Definition: resultsinduction.c:27
ITG strcmp1(const char *s1, const char *s2)
Definition: strcmp1.c:24
static ITG * iperturb1
Definition: resultsinduction.c:27
static double * alcon1
Definition: resultsinduction.c:35
static ITG mortar1
Definition: resultsinduction.c:31
subroutine frditeration(co, nk, kon, ipkon, lakon, ne, v, time, ielmat, matname, mi, istep, iinc, ithermal)
Definition: frditeration.f:21
static double * xbody1
Definition: resultsinduction.c:36
static ITG * nal
Definition: resultsinduction.c:31
ITG getSystemCPUs()
Definition: getSystemCPUs.c:40
static ITG * nodempc1
Definition: resultsinduction.c:31
static ITG * ipkon1
Definition: resultsinduction.c:27
static ITG * network1
Definition: resultsinduction.c:31
subroutine resultsprint(co, nk, kon, ipkon, lakon, ne, v, stn, inum, stx, ielorien, norien, orab, t1, ithermal, filab, een, iperturb, fn, nactdof, iout, vold, nodeboun, ndirboun, nboun, nmethod, ttime, xstate, epn, mi, nstate_, ener, enern, xstaten, eei, set, nset, istartset, iendset, ialset, nprint, prlab, prset, qfx, qfn, trab, inotr, ntrans, nelemload, nload, ikin, ielmat, thicke, eme, emn, rhcon, nrhcon, shcon, nshcon, cocon, ncocon, ntmat_, sideload, icfd, inomat, pslavsurf, islavact, cdn, mortar, islavnode, nslavnode, ntie, islavsurf, time, ielprop, prop, veold, ne0, nmpc, ipompc, nodempc, labmpc, energyini, energy, orname, xload)
Definition: resultsprint.f:29
static ITG * ipompc1
Definition: resultsinduction.c:31
static ITG calcul_qa1
Definition: resultsinduction.c:27
static double * springarea1
Definition: resultsinduction.c:36
static double * ttime1
Definition: resultsinduction.c:36
static ITG * nalcon1
Definition: resultsinduction.c:27
static ITG * iout1
Definition: resultsinduction.c:27
static ITG * iponoel1
Definition: resultsinduction.c:27
static ITG * nk1
Definition: resultsinduction.c:31
static ITG * nshcon1
Definition: resultsinduction.c:31
static ITG * nplkcon1
Definition: resultsinduction.c:27
static ITG * ithermal1
Definition: resultsinduction.c:27
static double * pmastsurf1
Definition: resultsinduction.c:36
#define SFREE(a)
Definition: CalculiX.h:41
static ITG * ncocon1
Definition: resultsinduction.c:31
static double * xstiff1
Definition: resultsinduction.c:36
static ITG * npmat1_
Definition: resultsinduction.c:27
static double * fn1
Definition: resultsinduction.c:36
static double * pslavsurf1
Definition: resultsinduction.c:36
static double * reltime1
Definition: resultsinduction.c:36
static ITG * nrhcon1
Definition: resultsinduction.c:27
static ITG * ielmat1
Definition: resultsinduction.c:27
subroutine resultsforc_em(nk, f, fn, nactdof, ipompc, nodempc, coefmpc, labmpc, nmpc, mi, fmpc, calcul_fn, calcul_f, inomat)
Definition: resultsforc_em.f:21
static double * t01
Definition: resultsinduction.c:35
static double * plicon1
Definition: resultsinduction.c:36
static ITG * iendset1
Definition: resultsinduction.c:31
static ITG * ikmpc1
Definition: resultsinduction.c:31
static double * xload1
Definition: resultsinduction.c:36
void * resultsthermemmt(ITG *i)
Definition: resultsinduction.c:330
static double * vold1
Definition: resultsinduction.c:36
static ITG * ilmpc1
Definition: resultsinduction.c:31
static ITG * istep1
Definition: resultsinduction.c:27
static char * lakon1
Definition: resultsinduction.c:25
int pthread_join(pthread_t thread, void **status_ptr)
static ITG * nmpc1
Definition: resultsinduction.c:31
static ITG * nmethod1
Definition: resultsinduction.c:27
static double * shcon1
Definition: resultsinduction.c:36
static double * orab1
Definition: resultsinduction.c:35
static ITG mt1
Definition: resultsinduction.c:31
#define ITG
Definition: CalculiX.h:51
static double * cocon1
Definition: resultsinduction.c:36
static double * time1
Definition: resultsinduction.c:36
static double * rhcon1
Definition: resultsinduction.c:35
static ITG * ialset1
Definition: resultsinduction.c:31
static ITG * ncmat1_
Definition: resultsinduction.c:27
static double * coefmpc1
Definition: resultsinduction.c:36
static double * co1
Definition: resultsinduction.c:35
void * resultsemmt(ITG *i)
Definition: resultsinduction.c:311
static ITG * nplicon1
Definition: resultsinduction.c:27
static double * xstateini1
Definition: resultsinduction.c:36
#define NNEW(a, b, c)
Definition: CalculiX.h:39
static ITG * ne1
Definition: resultsinduction.c:27
static double * dtime1
Definition: resultsinduction.c:36
static ITG * ntmat1_
Definition: resultsinduction.c:27
static ITG * iactive1
Definition: resultsinduction.c:31
static ITG * norien1
Definition: resultsinduction.c:27
static double * plkcon1
Definition: resultsinduction.c:36
static double * h01
Definition: resultsinduction.c:36

◆ resultsmechmt()

void* resultsmechmt ( ITG i)
376  {
377 
378  ITG indexfn,indexqa,indexnal,nea,neb,nedelta;
379 
380  indexfn=*i*mt1**nk1;
381  indexqa=*i*4;
382  indexnal=*i;
383 
384 // ceil -> floor
385 
386  nedelta=(ITG)floor(*ne1/(double)num_cpus);
387  nea=*i*nedelta+1;
388  neb=(*i+1)*nedelta;
389 // next line! -> all parallel sections
390  if((*i==num_cpus-1)&&(neb<*ne1)) neb=*ne1;
391 
395  iprestr1,eme1,iperturb1,&fn1[indexfn],iout1,&qa1[indexqa],vold1,
396  nmethod1,
401  &ikin1,&nal[indexnal],ne01,thicke1,emeini1,
403 
404  return NULL;
405 }
static double * prestr1
Definition: results.c:35
static ITG * icmd1
Definition: results.c:27
static double * t11
Definition: results.c:35
static ITG * nmethod1
Definition: results.c:27
static double * dtime1
Definition: results.c:36
static double * qa1
Definition: results.c:36
static double * xstate1
Definition: results.c:36
static double * ener1
Definition: results.c:36
static ITG * npmat1_
Definition: results.c:27
static double * xstiff1
Definition: results.c:36
static ITG * istep1
Definition: results.c:27
static ITG * ithermal1
Definition: results.c:27
static ITG num_cpus
Definition: results.c:31
static double * springarea1
Definition: results.c:36
static double * veold1
Definition: results.c:36
static double * eme1
Definition: results.c:35
static ITG * iprestr1
Definition: results.c:27
static char * matname1
Definition: results.c:25
static ITG calcul_qa1
Definition: results.c:27
static ITG * kscale1
Definition: results.c:31
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
static ITG * mortar1
Definition: results.c:31
static double * time1
Definition: results.c:36
static double * pmastsurf1
Definition: results.c:36
static double * rhcon1
Definition: results.c:35
static ITG * iout1
Definition: results.c:27
static double * fn1
Definition: results.c:36
static ITG * ne1
Definition: results.c:27
static double * prop1
Definition: results.c:36
static ITG ikin1
Definition: results.c:27
static double * t01
Definition: results.c:35
static ITG calcul_fn1
Definition: results.c:27
static double * thicke1
Definition: results.c:36
static ITG * ielmat1
Definition: results.c:27
static double * vini1
Definition: results.c:36
static ITG * nplkcon1
Definition: results.c:27
static double * co1
Definition: results.c:35
static ITG * nalcon1
Definition: results.c:27
static ITG * ipkon1
Definition: results.c:27
static ITG mt1
Definition: results.c:31
static double * alzero1
Definition: results.c:35
static ITG * norien1
Definition: results.c:27
static double * vold1
Definition: results.c:36
static ITG * ne01
Definition: results.c:31
static double * reltime1
Definition: results.c:36
static double * stx1
Definition: results.c:35
static double * elcon1
Definition: results.c:35
static ITG * ielas1
Definition: results.c:27
static ITG * nrhcon1
Definition: results.c:27
static double * orab1
Definition: results.c:35
static double * xstateini1
Definition: results.c:36
subroutine resultsmech(co, kon, ipkon, lakon, ne, v, stx, elcon, nelcon, rhcon, nrhcon, alcon, nalcon, alzero, ielmat, ielorien, norien, orab, ntmat_, t0, t1, ithermal, prestr, iprestr, eme, iperturb, fn, iout, qa, vold, nmethod, veold, dtime, time, ttime, plicon, nplicon, plkcon, nplkcon, xstateini, xstiff, xstate, npmat_, matname, mi, ielas, icmd, ncmat_, nstate_, stiini, vini, ener, eei, enerini, istep, iinc, springarea, reltime, calcul_fn, calcul_qa, calcul_cauchy, nener, ikin, nal, ne0, thicke, emeini, pslavsurf, pmastsurf, mortar, clearini, nea, neb, ielprop, prop, kscale)
Definition: resultsmech.f:29
static ITG * nplicon1
Definition: results.c:27
static ITG * nk1
Definition: results.c:31
static ITG * mi1
Definition: results.c:27
static ITG calcul_cauchy1
Definition: results.c:27
static ITG * iinc1
Definition: results.c:27
static double * plkcon1
Definition: results.c:36
static double * emeini1
Definition: results.c:36
static ITG * ielorien1
Definition: results.c:27
static double * stiini1
Definition: results.c:36
static char * lakon1
Definition: results.c:25
static ITG * ncmat1_
Definition: results.c:27
static ITG * nal
Definition: results.c:31
static double * alcon1
Definition: results.c:35
static double * clearini1
Definition: results.c:36
static ITG * ntmat1_
Definition: results.c:27
static ITG * nener1
Definition: results.c:27
static double * plicon1
Definition: results.c:36
#define ITG
Definition: CalculiX.h:51
static double * eei1
Definition: results.c:36
static double * enerini1
Definition: results.c:36
static ITG * nstate1_
Definition: results.c:27
static double * ttime1
Definition: results.c:36
static ITG * kon1
Definition: results.c:27
static double * v1
Definition: results.c:35
static ITG * nelcon1
Definition: results.c:27
static double * pslavsurf1
Definition: results.c:36
static ITG * iperturb1
Definition: results.c:27
static ITG * ielprop1
Definition: results.c:31

◆ resultsmechmt_se()

void* resultsmechmt_se ( ITG i)
312  {
313 
314  ITG indexfn0,indexdfn,nea,neb,nedelta;
315 
316  if(idesvar1==0){
317  indexfn0=*i*mt1**nkon1;
318  indexdfn=0;
319  }else{
320  indexfn0=0;
321  indexdfn=*i*mt1**nk1;
322  }
323 
324 // ceil -> floor
325 
326  nedelta=(ITG)floor(*ne1/(double)num_cpus);
327  nea=*i*nedelta+1;
328  neb=(*i+1)*nedelta;
329 // next line! -> all parallel sections
330  if((*i==num_cpus-1)&&(neb<*ne1)) neb=*ne1;
331 
336  nmethod1,
343  &dfn1[indexdfn],&idesvar1,nodedesi1,
345 
346  return NULL;
347 }
static ITG calcul_fn1
Definition: results_se.c:28
static double * reltime1
Definition: results_se.c:37
static ITG * nkon1
Definition: results_se.c:28
static ITG * icoordinate1
Definition: results_se.c:28
static double * fn01
Definition: results_se.c:37
static ITG * ithermal1
Definition: results_se.c:28
static ITG * iperturb1
Definition: results_se.c:28
static double * enerini1
Definition: results_se.c:37
static double * rhcon1
Definition: results_se.c:36
static double * fn1
Definition: results_se.c:37
static ITG * iinc1
Definition: results_se.c:28
static ITG * iout1
Definition: results_se.c:28
static double * orab1
Definition: results_se.c:36
static ITG * nstate1_
Definition: results_se.c:28
static double * alzero1
Definition: results_se.c:36
static double * veold1
Definition: results_se.c:37
static ITG * nk1
Definition: results_se.c:28
static double * t01
Definition: results_se.c:36
static ITG * istep1
Definition: results_se.c:28
static double * elcon1
Definition: results_se.c:36
static ITG mt1
Definition: results_se.c:28
static ITG * ielorien1
Definition: results_se.c:28
static ITG calcul_cauchy1
Definition: results_se.c:28
static double * dxstiff1
Definition: results_se.c:37
static ITG * ntmat1_
Definition: results_se.c:28
static ITG * npmat1_
Definition: results_se.c:28
static double * clearini1
Definition: results_se.c:37
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
static double * t11
Definition: results_se.c:36
static char * lakon1
Definition: results_se.c:26
static ITG * ielas1
Definition: results_se.c:28
static double * xstateini1
Definition: results_se.c:37
static ITG * mi1
Definition: results_se.c:28
static double * thicke1
Definition: results_se.c:37
static double * co1
Definition: results_se.c:36
static double * dtime1
Definition: results_se.c:37
static double * xstate1
Definition: results_se.c:37
static ITG * ialdesi1
Definition: results_se.c:28
static double * stiini1
Definition: results_se.c:37
static ITG nener1
Definition: results_se.c:28
static double * pmastsurf1
Definition: results_se.c:37
static ITG * nelcon1
Definition: results_se.c:28
static double * alcon1
Definition: results_se.c:36
static double * emeini1
Definition: results_se.c:37
static double * xstiff1
Definition: results_se.c:37
static double * stx1
Definition: results_se.c:36
static ITG * nodedesi1
Definition: results_se.c:28
static double * plkcon1
Definition: results_se.c:37
static ITG ikin1
Definition: results_se.c:28
static ITG * ipkon1
Definition: results_se.c:28
static ITG num_cpus
Definition: results_se.c:28
static ITG * ncmat1_
Definition: results_se.c:28
static ITG * mortar1
Definition: results_se.c:28
static double * ttime1
Definition: results_se.c:37
static double * vini1
Definition: results_se.c:37
static ITG * iprestr1
Definition: results_se.c:28
static ITG * nmethod1
Definition: results_se.c:28
static char * matname1
Definition: results_se.c:26
static ITG idesvar1
Definition: results_se.c:28
static double * vold1
Definition: results_se.c:37
static ITG * nplkcon1
Definition: results_se.c:28
static ITG * ielprop1
Definition: results_se.c:28
static ITG * nplicon1
Definition: results_se.c:28
static double * plicon1
Definition: results_se.c:37
static double * ener1
Definition: results_se.c:37
static ITG * icmd1
Definition: results_se.c:28
static double * springarea1
Definition: results_se.c:37
static double * pslavsurf1
Definition: results_se.c:37
static double * sti1
Definition: results_se.c:37
static double * dfn1
Definition: results_se.c:37
static double * v1
Definition: results_se.c:36
static ITG * nrhcon1
Definition: results_se.c:28
static double * eei1
Definition: results_se.c:37
static ITG * norien1
Definition: results_se.c:28
static ITG * kon1
Definition: results_se.c:28
#define ITG
Definition: CalculiX.h:51
static double * eme1
Definition: results_se.c:36
static ITG * ielmat1
Definition: results_se.c:28
static ITG * nalcon1
Definition: results_se.c:28
static double * prestr1
Definition: results_se.c:36
static double * prop1
Definition: results_se.c:37
static double * xdesi1
Definition: results_se.c:37
static ITG * ne01
Definition: results_se.c:28
subroutine resultsmech_se(co, kon, ipkon, lakon, ne, v, stx, elcon, nelcon, rhcon, nrhcon, alcon, nalcon, alzero, ielmat, ielorien, norien, orab, ntmat_, t0, t1, ithermal, prestr, iprestr, eme, iperturb, fn, iout, vold, nmethod, veold, dtime, time, ttime, plicon, nplicon, plkcon, nplkcon, xstateini, xstiff, xstate, npmat_, matname, mi, ielas, icmd, ncmat_, nstate_, stiini, vini, ener, eei, enerini, istep, iinc, springarea, reltime, calcul_fn, calcul_cauchy, nener, ikin, ne0, thicke, emeini, pslavsurf, pmastsurf, mortar, clearini, nea, neb, ielprop, prop, dfn, idesvar, nodedesi, fn0, sti, icoordinate, dxstiff, ialdesi, xdesi)
Definition: resultsmech_se.f:31
static double * time1
Definition: results_se.c:37
static ITG * ne1
Definition: results_se.c:28

◆ resultsmechmtstr()

void* resultsmechmtstr ( ITG i)
261  {
262 
263  ITG indexfn,indexqa,indexnal,nea,neb,nedelta;
264 
265  indexfn=*i*mt1**nk1;
266  indexqa=*i*4;
267  indexnal=*i;
268 
269 // ceil -> floor
270 
271  nedelta=(ITG)floor(*ne1/(double)num_cpus);
272  //nea=*i*nedelta+1;
273  //neb=(*i+1)*nedelta;
274 
275  nea=neapar1[*i]+1;
276  neb=nebpar1[*i]+1;
277 
278 // next line! -> all parallel sections
279  if((*i==num_cpus-1)&&(neb<*ne1)) neb=*ne1;
280 
284  iprestr1,eme1,iperturb1,&fn1[indexfn],iout1,&qa1[indexqa],vold1,
285  nmethod1,
290  &ikin1,&nal[indexnal],ne01,thicke1,emeini1,
292 
293  return NULL;
294 }
static double * clearini1
Definition: resultsstr.c:35
static double * stx1
Definition: resultsstr.c:34
static double * xstate1
Definition: resultsstr.c:35
static double * elcon1
Definition: resultsstr.c:34
static ITG ikin1
Definition: resultsstr.c:27
static double * prestr1
Definition: resultsstr.c:34
static ITG * ncmat1_
Definition: resultsstr.c:27
static ITG * iinc1
Definition: resultsstr.c:27
static double * co1
Definition: resultsstr.c:34
static ITG * ielprop1
Definition: resultsstr.c:31
static double * qa1
Definition: resultsstr.c:35
static ITG * icmd1
Definition: resultsstr.c:27
static ITG * mortar1
Definition: resultsstr.c:31
static ITG * nebpar1
Definition: resultsstr.c:31
static ITG * iprestr1
Definition: resultsstr.c:27
static double * emeini1
Definition: resultsstr.c:35
static ITG * istep1
Definition: resultsstr.c:27
static ITG * nplicon1
Definition: resultsstr.c:27
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
static double * ener1
Definition: resultsstr.c:35
static ITG * nstate1_
Definition: resultsstr.c:27
static ITG * mi1
Definition: resultsstr.c:27
static ITG * ielorien1
Definition: resultsstr.c:27
static double * prop1
Definition: resultsstr.c:35
static ITG * nplkcon1
Definition: resultsstr.c:27
static char * lakon1
Definition: resultsstr.c:25
static ITG * ntmat1_
Definition: resultsstr.c:27
static double * vini1
Definition: resultsstr.c:35
static double * plkcon1
Definition: resultsstr.c:35
static ITG * neapar1
Definition: resultsstr.c:31
static double * v1
Definition: resultsstr.c:34
static ITG * norien1
Definition: resultsstr.c:27
static double * veold1
Definition: resultsstr.c:35
static double * time1
Definition: resultsstr.c:35
static double * orab1
Definition: resultsstr.c:34
static double * enerini1
Definition: resultsstr.c:35
static double * alzero1
Definition: resultsstr.c:34
static ITG * ne01
Definition: resultsstr.c:31
static ITG * kscale1
Definition: resultsstr.c:31
static ITG * nmethod1
Definition: resultsstr.c:27
static double * pslavsurf1
Definition: resultsstr.c:35
static ITG mt1
Definition: resultsstr.c:31
static double * xstiff1
Definition: resultsstr.c:35
static double * dtime1
Definition: resultsstr.c:35
static double * thicke1
Definition: resultsstr.c:35
static double * t01
Definition: resultsstr.c:34
static double * eme1
Definition: resultsstr.c:34
static double * plicon1
Definition: resultsstr.c:35
static ITG calcul_qa1
Definition: resultsstr.c:27
static double * pmastsurf1
Definition: resultsstr.c:35
static ITG * iout1
Definition: resultsstr.c:27
static double * reltime1
Definition: resultsstr.c:35
static ITG * ielmat1
Definition: resultsstr.c:27
static ITG * ielas1
Definition: resultsstr.c:27
static ITG * nalcon1
Definition: resultsstr.c:27
static ITG * nrhcon1
Definition: resultsstr.c:27
static double * xstateini1
Definition: resultsstr.c:35
static double * ttime1
Definition: resultsstr.c:35
static ITG * ithermal1
Definition: resultsstr.c:27
subroutine resultsmech(co, kon, ipkon, lakon, ne, v, stx, elcon, nelcon, rhcon, nrhcon, alcon, nalcon, alzero, ielmat, ielorien, norien, orab, ntmat_, t0, t1, ithermal, prestr, iprestr, eme, iperturb, fn, iout, qa, vold, nmethod, veold, dtime, time, ttime, plicon, nplicon, plkcon, nplkcon, xstateini, xstiff, xstate, npmat_, matname, mi, ielas, icmd, ncmat_, nstate_, stiini, vini, ener, eei, enerini, istep, iinc, springarea, reltime, calcul_fn, calcul_qa, calcul_cauchy, nener, ikin, nal, ne0, thicke, emeini, pslavsurf, pmastsurf, mortar, clearini, nea, neb, ielprop, prop, kscale)
Definition: resultsmech.f:29
static ITG * nk1
Definition: resultsstr.c:31
static ITG num_cpus
Definition: resultsstr.c:31
static double * fn1
Definition: resultsstr.c:35
static double * t11
Definition: resultsstr.c:34
static ITG * ne1
Definition: resultsstr.c:27
static double * stiini1
Definition: resultsstr.c:35
static double * rhcon1
Definition: resultsstr.c:34
static ITG * nelcon1
Definition: resultsstr.c:27
static double * alcon1
Definition: resultsstr.c:34
static double * vold1
Definition: resultsstr.c:35
static ITG * npmat1_
Definition: resultsstr.c:27
static ITG * iperturb1
Definition: resultsstr.c:27
static char * matname1
Definition: resultsstr.c:25
#define ITG
Definition: CalculiX.h:51
static ITG calcul_fn1
Definition: resultsstr.c:27
static ITG calcul_cauchy1
Definition: resultsstr.c:27
static ITG * nal
Definition: resultsstr.c:31
static double * springarea1
Definition: resultsstr.c:35
static ITG * ipkon1
Definition: resultsstr.c:27
static ITG * kon1
Definition: resultsstr.c:27
static double * eei1
Definition: resultsstr.c:35
static ITG * nener1
Definition: resultsstr.c:27

◆ resultsstr()

void resultsstr ( double *  co,
ITG nk,
ITG kon,
ITG ipkon,
char *  lakon,
ITG ne,
double *  v,
double *  stn,
ITG inum,
double *  stx,
double *  elcon,
ITG nelcon,
double *  rhcon,
ITG nrhcon,
double *  alcon,
ITG nalcon,
double *  alzero,
ITG ielmat,
ITG ielorien,
ITG norien,
double *  orab,
ITG ntmat_,
double *  t0,
double *  t1,
ITG ithermal,
double *  prestr,
ITG iprestr,
char *  filab,
double *  eme,
double *  emn,
double *  een,
ITG iperturb,
double *  f,
double *  fn,
ITG nactdof,
ITG iout,
double *  qa,
double *  vold,
double *  b,
ITG nodeboun,
ITG ndirboun,
double *  xboun,
ITG nboun,
ITG ipompc,
ITG nodempc,
double *  coefmpc,
char *  labmpc,
ITG nmpc,
ITG nmethod,
double *  vmax,
ITG neq,
double *  veold,
double *  accold,
double *  beta,
double *  gamma,
double *  dtime,
double *  time,
double *  ttime,
double *  plicon,
ITG nplicon,
double *  plkcon,
ITG nplkcon,
double *  xstateini,
double *  xstiff,
double *  xstate,
ITG npmat_,
double *  epl,
char *  matname,
ITG mi,
ITG ielas,
ITG icmd,
ITG ncmat_,
ITG nstate_,
double *  stiini,
double *  vini,
ITG ikboun,
ITG ilboun,
double *  ener,
double *  enern,
double *  emeini,
double *  xstaten,
double *  eei,
double *  enerini,
double *  cocon,
ITG ncocon,
char *  set,
ITG nset,
ITG istartset,
ITG iendset,
ITG ialset,
ITG nprint,
char *  prlab,
char *  prset,
double *  qfx,
double *  qfn,
double *  trab,
ITG inotr,
ITG ntrans,
double *  fmpc,
ITG nelemload,
ITG nload,
ITG ikmpc,
ITG ilmpc,
ITG istep,
ITG iinc,
double *  springarea,
double *  reltime,
ITG ne0,
double *  xforc,
ITG nforc,
double *  thicke,
double *  shcon,
ITG nshcon,
char *  sideload,
double *  xload,
double *  xloadold,
ITG icfd,
ITG inomat,
double *  pslavsurf,
double *  pmastsurf,
ITG mortar,
ITG islavact,
double *  cdn,
ITG islavnode,
ITG nslavnode,
ITG ntie,
double *  clearini,
ITG islavsurf,
ITG ielprop,
double *  prop,
double *  energyini,
double *  energy,
ITG kscale,
ITG nener,
char *  orname,
ITG network,
ITG neapar,
ITG nebpar 
)
72  {
73 
74  ITG intpointvarm,calcul_fn,calcul_f,calcul_qa,calcul_cauchy,ikin,
75  intpointvart,mt=mi[1]+1,i,j;
76 
77  /*
78 
79  calculating the stress integration point values
80 
81  iout=2: v is assumed to be known and is used to
82  calculate strains, stresses..., requested results output */
83 
84  /* variables for multithreading procedure */
85 
86  ITG sys_cpus,*ithread=NULL;
87  char *env,*envloc,*envsys;
88 
89  num_cpus = 0;
90  sys_cpus=0;
91 
92  /* explicit user declaration prevails */
93 
94  envsys=getenv("NUMBER_OF_CPUS");
95  if(envsys){
96  sys_cpus=atoi(envsys);
97  if(sys_cpus<0) sys_cpus=0;
98  }
99 
100  /* automatic detection of available number of processors */
101 
102  if(sys_cpus==0){
103  sys_cpus = getSystemCPUs();
104  if(sys_cpus<1) sys_cpus=1;
105  }
106 
107  /* local declaration prevails, if strictly positive */
108 
109  envloc = getenv("CCX_NPROC_RESULTS");
110  if(envloc){
111  num_cpus=atoi(envloc);
112  if(num_cpus<0){
113  num_cpus=0;
114  }else if(num_cpus>sys_cpus){
115  num_cpus=sys_cpus;
116  }
117 
118  }
119 
120  /* else global declaration, if any, applies */
121 
122  env = getenv("OMP_NUM_THREADS");
123  if(num_cpus==0){
124  if (env)
125  num_cpus = atoi(env);
126  if (num_cpus < 1) {
127  num_cpus=1;
128  }else if(num_cpus>sys_cpus){
129  num_cpus=sys_cpus;
130  }
131  }
132 
133 // next line is to be inserted in a similar way for all other paralell parts
134 
135  if(*ne<num_cpus) num_cpus=*ne;
136 
137  pthread_t tid[num_cpus];
138 
139  /* setting the output variables */
140 
141  calcul_fn=0;
142  calcul_f=0;
143  calcul_qa=0;
144  calcul_cauchy=1;
145 
146  qa[0]=0.e0;
147  qa[1]=0.e0;
148  intpointvarm=1;
149  ikin=0;
150 
151  /* calculating the stresses and material tangent at the
152  integration points; calculating the internal forces */
153 
154  if(((ithermal[0]<=1)||(ithermal[0]>=3))&&(intpointvarm==1)){
155 
156  NNEW(fn1,double,num_cpus*mt**nk);
157  NNEW(qa1,double,num_cpus*4);
158  NNEW(nal,ITG,num_cpus);
159 
160  co1=co;kon1=kon;ipkon1=ipkon;lakon1=lakon;ne1=ne;v1=v;
161  stx1=stx;elcon1=elcon;nelcon1=nelcon;rhcon1=rhcon;
162  nrhcon1=nrhcon;alcon1=alcon;nalcon1=nalcon;alzero1=alzero;
163  ielmat1=ielmat;ielorien1=ielorien;norien1=norien;orab1=orab;
164  ntmat1_=ntmat_;t01=t0;t11=t1;ithermal1=ithermal;prestr1=prestr;
165  iprestr1=iprestr;eme1=eme;iperturb1=iperturb;iout1=iout;
166  vold1=vold;nmethod1=nmethod;veold1=veold;dtime1=dtime;
167  time1=time;ttime1=ttime;plicon1=plicon;nplicon1=nplicon;
168  plkcon1=plkcon;nplkcon1=nplkcon;xstateini1=xstateini;
169  xstiff1=xstiff;xstate1=xstate;npmat1_=npmat_;matname1=matname;
170  mi1=mi;ielas1=ielas;icmd1=icmd;ncmat1_=ncmat_;nstate1_=nstate_;
171  stiini1=stiini;vini1=vini;ener1=ener;eei1=eei;enerini1=enerini;
172  istep1=istep;iinc1=iinc;springarea1=springarea;reltime1=reltime;
173  calcul_fn1=calcul_fn;calcul_qa1=calcul_qa;calcul_cauchy1=calcul_cauchy;
174  nener1=nener;ikin1=ikin;mt1=mt;nk1=nk;ne01=ne0;thicke1=thicke;
175  emeini1=emeini;pslavsurf1=pslavsurf;clearini1=clearini;
176  pmastsurf1=pmastsurf;mortar1=mortar;ielprop1=ielprop;prop1=prop;
177  kscale1=kscale;neapar1=neapar;
178  nebpar1=nebpar;
179 
180  /* calculating the stresses */
181 
182  if(((*nmethod!=4)&&(*nmethod!=5))||(iperturb[0]>1)){
183  printf(" Using up to %" ITGFORMAT " cpu(s) for the stress calculation.\n\n", num_cpus);
184  }
185 
186  /* create threads and wait */
187 
188  NNEW(ithread,ITG,num_cpus);
189  for(i=0; i<num_cpus; i++) {
190  ithread[i]=i;
191  pthread_create(&tid[i], NULL, (void *)resultsmechmtstr, (void *)&ithread[i]);
192  }
193  for(i=0; i<num_cpus; i++) pthread_join(tid[i], NULL);
194 
195  for(i=0;i<mt**nk;i++){
196  fn[i]=fn1[i];
197  }
198  for(i=0;i<mt**nk;i++){
199  for(j=1;j<num_cpus;j++){
200  fn[i]+=fn1[i+j*mt**nk];
201  }
202  }
203  SFREE(fn1);SFREE(ithread);
204 
205  /* determine the internal force */
206 
207  qa[0]=qa1[0];
208  for(j=1;j<num_cpus;j++){
209  qa[0]+=qa1[j*4];
210  }
211 
212  /* determine the decrease of the time increment in case
213  the material routine diverged */
214 
215  for(j=0;j<num_cpus;j++){
216  if(qa1[2+j*4]>0.){
217  if(qa[2]<0.){
218  qa[2]=qa1[2+j*4];
219  }else{
220  if(qa1[2+j*4]<qa[2]){qa[2]=qa1[2+j*4];}
221  }
222  }
223  }
224 
225  SFREE(qa1);
226 
227  for(j=1;j<num_cpus;j++){
228  nal[0]+=nal[j];
229  }
230 
231  if(calcul_qa==1){
232  if(nal[0]>0){
233  qa[0]/=nal[0];
234  }
235  }
236  SFREE(nal);
237  }
238 
239  /* storing results in the .dat file
240  extrapolation of integration point values to the nodes
241  interpolation of 3d results for 1d/2d elements */
242 
243  FORTRAN(resultsprint,(co,nk,kon,ipkon,lakon,ne,v,stn,inum,
244  stx,ielorien,norien,orab,t1,ithermal,filab,een,iperturb,fn,
245  nactdof,iout,vold,nodeboun,ndirboun,nboun,nmethod,ttime,xstate,
246  epn,mi,
247  nstate_,ener,enern,xstaten,eei,set,nset,istartset,iendset,
248  ialset,nprint,prlab,prset,qfx,qfn,trab,inotr,ntrans,
249  nelemload,nload,&ikin,ielmat,thicke,eme,emn,rhcon,nrhcon,shcon,
250  nshcon,cocon,ncocon,ntmat_,sideload,icfd,inomat,pslavsurf,islavact,
251  cdn,mortar,islavnode,nslavnode,ntie,islavsurf,time,ielprop,prop,
252  veold,ne0,nmpc,ipompc,nodempc,labmpc,energyini,energy,orname,
253  xload));
254 
255  return;
256 
257 }
static double * clearini1
Definition: resultsstr.c:35
#define ITGFORMAT
Definition: CalculiX.h:52
static double * stx1
Definition: resultsstr.c:34
static double * xstate1
Definition: resultsstr.c:35
static double * elcon1
Definition: resultsstr.c:34
static ITG ikin1
Definition: resultsstr.c:27
static double * prestr1
Definition: resultsstr.c:34
static ITG * ncmat1_
Definition: resultsstr.c:27
int pthread_create(pthread_t *thread_id, const pthread_attr_t *attributes, void *(*thread_function)(void *), void *arguments)
static ITG * iinc1
Definition: resultsstr.c:27
static double * co1
Definition: resultsstr.c:34
static ITG * ielprop1
Definition: resultsstr.c:31
static double * qa1
Definition: resultsstr.c:35
static ITG * icmd1
Definition: resultsstr.c:27
static ITG * mortar1
Definition: resultsstr.c:31
static ITG * nebpar1
Definition: resultsstr.c:31
static ITG * iprestr1
Definition: resultsstr.c:27
static double * emeini1
Definition: resultsstr.c:35
static ITG * istep1
Definition: resultsstr.c:27
static ITG * nplicon1
Definition: resultsstr.c:27
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
static double * ener1
Definition: resultsstr.c:35
static ITG * nstate1_
Definition: resultsstr.c:27
static ITG * mi1
Definition: resultsstr.c:27
static ITG * ielorien1
Definition: resultsstr.c:27
static double * prop1
Definition: resultsstr.c:35
static ITG * nplkcon1
Definition: resultsstr.c:27
static char * lakon1
Definition: resultsstr.c:25
static ITG * ntmat1_
Definition: resultsstr.c:27
static double * vini1
Definition: resultsstr.c:35
ITG getSystemCPUs()
Definition: getSystemCPUs.c:40
subroutine resultsprint(co, nk, kon, ipkon, lakon, ne, v, stn, inum, stx, ielorien, norien, orab, t1, ithermal, filab, een, iperturb, fn, nactdof, iout, vold, nodeboun, ndirboun, nboun, nmethod, ttime, xstate, epn, mi, nstate_, ener, enern, xstaten, eei, set, nset, istartset, iendset, ialset, nprint, prlab, prset, qfx, qfn, trab, inotr, ntrans, nelemload, nload, ikin, ielmat, thicke, eme, emn, rhcon, nrhcon, shcon, nshcon, cocon, ncocon, ntmat_, sideload, icfd, inomat, pslavsurf, islavact, cdn, mortar, islavnode, nslavnode, ntie, islavsurf, time, ielprop, prop, veold, ne0, nmpc, ipompc, nodempc, labmpc, energyini, energy, orname, xload)
Definition: resultsprint.f:29
static double * plkcon1
Definition: resultsstr.c:35
static ITG * neapar1
Definition: resultsstr.c:31
static double * v1
Definition: resultsstr.c:34
static ITG * norien1
Definition: resultsstr.c:27
static double * veold1
Definition: resultsstr.c:35
static double * time1
Definition: resultsstr.c:35
static double * orab1
Definition: resultsstr.c:34
static double * enerini1
Definition: resultsstr.c:35
static double * alzero1
Definition: resultsstr.c:34
static ITG * ne01
Definition: resultsstr.c:31
static ITG * kscale1
Definition: resultsstr.c:31
static ITG * nmethod1
Definition: resultsstr.c:27
static double * pslavsurf1
Definition: resultsstr.c:35
static ITG mt1
Definition: resultsstr.c:31
#define SFREE(a)
Definition: CalculiX.h:41
static double * xstiff1
Definition: resultsstr.c:35
static double * dtime1
Definition: resultsstr.c:35
static double * thicke1
Definition: resultsstr.c:35
static double * t01
Definition: resultsstr.c:34
static double * eme1
Definition: resultsstr.c:34
static double * plicon1
Definition: resultsstr.c:35
static ITG calcul_qa1
Definition: resultsstr.c:27
static double * pmastsurf1
Definition: resultsstr.c:35
static ITG * iout1
Definition: resultsstr.c:27
static double * reltime1
Definition: resultsstr.c:35
static ITG * ielmat1
Definition: resultsstr.c:27
static ITG * ielas1
Definition: resultsstr.c:27
static ITG * nalcon1
Definition: resultsstr.c:27
static ITG * nrhcon1
Definition: resultsstr.c:27
static double * xstateini1
Definition: resultsstr.c:35
static double * ttime1
Definition: resultsstr.c:35
static ITG * ithermal1
Definition: resultsstr.c:27
static ITG * nk1
Definition: resultsstr.c:31
static ITG num_cpus
Definition: resultsstr.c:31
static double * fn1
Definition: resultsstr.c:35
static double * t11
Definition: resultsstr.c:34
static ITG * ne1
Definition: resultsstr.c:27
static double * stiini1
Definition: resultsstr.c:35
static double * rhcon1
Definition: resultsstr.c:34
int pthread_join(pthread_t thread, void **status_ptr)
static ITG * nelcon1
Definition: resultsstr.c:27
static double * alcon1
Definition: resultsstr.c:34
static double * vold1
Definition: resultsstr.c:35
static ITG * npmat1_
Definition: resultsstr.c:27
static ITG * iperturb1
Definition: resultsstr.c:27
static char * matname1
Definition: resultsstr.c:25
#define ITG
Definition: CalculiX.h:51
static ITG calcul_fn1
Definition: resultsstr.c:27
static ITG calcul_cauchy1
Definition: resultsstr.c:27
static ITG * nal
Definition: resultsstr.c:31
void * resultsmechmtstr(ITG *i)
Definition: resultsstr.c:261
static double * springarea1
Definition: resultsstr.c:35
#define NNEW(a, b, c)
Definition: CalculiX.h:39
static ITG * ipkon1
Definition: resultsstr.c:27
static ITG * kon1
Definition: resultsstr.c:27
static double * eei1
Definition: resultsstr.c:35
static ITG * nener1
Definition: resultsstr.c:27

◆ resultsthermemmt()

void* resultsthermemmt ( ITG i)
330  {
331 
332  ITG indexfn,indexqa,indexnal,nea,neb,nedelta;
333 
334  indexfn=*i*mt1**nk1;
335  indexqa=*i*4;
336  indexnal=*i;
337 
338  nedelta=(ITG)floor(*ne1/(double)num_cpus);
339  nea=*i*nedelta+1;
340  neb=(*i+1)*nedelta;
341  if((*i==num_cpus-1)&&(neb<*ne1)) neb=*ne1;
342 
348  npmat1_,
351  &calcul_fn1,&calcul_qa1,&nal[indexnal],&nea,&neb,ithermal1,
355 
356  return NULL;
357 }
static ITG * iinc1
Definition: resultsinduction.c:27
static ITG * mi1
Definition: resultsinduction.c:27
static double * v1
Definition: resultsinduction.c:35
static ITG * nelemload1
Definition: resultsinduction.c:31
static ITG * nstate1_
Definition: resultsinduction.c:27
static double * prop1
Definition: resultsinduction.c:36
static double * qa1
Definition: resultsinduction.c:36
static ITG * ipobody1
Definition: resultsinduction.c:31
static ITG num_cpus
Definition: resultsinduction.c:31
static ITG calcul_fn1
Definition: resultsinduction.c:27
static ITG * inoel1
Definition: resultsinduction.c:27
static double * elcon1
Definition: resultsinduction.c:35
static ITG * ielorien1
Definition: resultsinduction.c:27
static ITG * ibody1
Definition: resultsinduction.c:31
static double * xstate1
Definition: resultsinduction.c:36
static double * clearini1
Definition: resultsinduction.c:36
static char * sideload1
Definition: resultsinduction.c:25
subroutine resultstherm(co, kon, ipkon, lakon, v, elcon, nelcon, rhcon, nrhcon, ielmat, ielorien, norien, orab, ntmat_, t0, iperturb, fn, shcon, nshcon, iout, qa, vold, ipompc, nodempc, coefmpc, nmpc, dtime, time, ttime, plkcon, nplkcon, xstateini, xstiff, xstate, npmat_, matname, mi, ncmat_, nstate_, cocon, ncocon, qfx, ikmpc, ilmpc, istep, iinc, springarea, calcul_fn, calcul_qa, nal, nea, neb, ithermal, nelemload, nload, nmethod, reltime, sideload, xload, xloadold, pslavsurf, pmastsurf, mortar, clearini, plicon, nplicon, ielprop, prop, iponoel, inoel, network, ipobody, xbody, ibody)
Definition: resultstherm.f:30
static char * matname1
Definition: resultsinduction.c:25
static double * xloadold1
Definition: resultsinduction.c:36
static ITG * nelcon1
Definition: resultsinduction.c:27
static ITG * nload1
Definition: resultsinduction.c:31
static ITG * ielprop1
Definition: resultsinduction.c:27
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
static double * qfx1
Definition: resultsinduction.c:36
static ITG * kon1
Definition: resultsinduction.c:27
static ITG * iperturb1
Definition: resultsinduction.c:27
static ITG mortar1
Definition: resultsinduction.c:31
static double * xbody1
Definition: resultsinduction.c:36
static ITG * nal
Definition: resultsinduction.c:31
static ITG * nodempc1
Definition: resultsinduction.c:31
static ITG * ipkon1
Definition: resultsinduction.c:27
static ITG * network1
Definition: resultsinduction.c:31
static ITG * ipompc1
Definition: resultsinduction.c:31
static ITG calcul_qa1
Definition: resultsinduction.c:27
static double * springarea1
Definition: resultsinduction.c:36
static double * ttime1
Definition: resultsinduction.c:36
static ITG * iout1
Definition: resultsinduction.c:27
static ITG * iponoel1
Definition: resultsinduction.c:27
static ITG * nk1
Definition: resultsinduction.c:31
static ITG * nshcon1
Definition: resultsinduction.c:31
static ITG * nplkcon1
Definition: resultsinduction.c:27
static ITG * ithermal1
Definition: resultsinduction.c:27
static double * pmastsurf1
Definition: resultsinduction.c:36
static ITG * ncocon1
Definition: resultsinduction.c:31
static double * xstiff1
Definition: resultsinduction.c:36
static ITG * npmat1_
Definition: resultsinduction.c:27
static double * fn1
Definition: resultsinduction.c:36
static double * pslavsurf1
Definition: resultsinduction.c:36
static double * reltime1
Definition: resultsinduction.c:36
static ITG * nrhcon1
Definition: resultsinduction.c:27
static ITG * ielmat1
Definition: resultsinduction.c:27
static double * t01
Definition: resultsinduction.c:35
static double * plicon1
Definition: resultsinduction.c:36
static ITG * ikmpc1
Definition: resultsinduction.c:31
static double * xload1
Definition: resultsinduction.c:36
static double * vold1
Definition: resultsinduction.c:36
static ITG * ilmpc1
Definition: resultsinduction.c:31
static ITG * istep1
Definition: resultsinduction.c:27
static char * lakon1
Definition: resultsinduction.c:25
static ITG * nmpc1
Definition: resultsinduction.c:31
static ITG * nmethod1
Definition: resultsinduction.c:27
static double * shcon1
Definition: resultsinduction.c:36
static double * orab1
Definition: resultsinduction.c:35
static ITG mt1
Definition: resultsinduction.c:31
#define ITG
Definition: CalculiX.h:51
static double * cocon1
Definition: resultsinduction.c:36
static double * time1
Definition: resultsinduction.c:36
static double * rhcon1
Definition: resultsinduction.c:35
static ITG * ncmat1_
Definition: resultsinduction.c:27
static double * coefmpc1
Definition: resultsinduction.c:36
static double * co1
Definition: resultsinduction.c:35
static ITG * nplicon1
Definition: resultsinduction.c:27
static double * xstateini1
Definition: resultsinduction.c:36
static ITG * ne1
Definition: resultsinduction.c:27
static double * dtime1
Definition: resultsinduction.c:36
static ITG * ntmat1_
Definition: resultsinduction.c:27
static ITG * norien1
Definition: resultsinduction.c:27
static double * plkcon1
Definition: resultsinduction.c:36

◆ resultsthermmt()

void* resultsthermmt ( ITG i)
409  {
410 
411  ITG indexfn,indexqa,indexnal,nea,neb,nedelta;
412 
413  indexfn=*i*mt1**nk1;
414  indexqa=*i*4;
415  indexnal=*i;
416 
417  nedelta=(ITG)floor(*ne1/(double)num_cpus);
418  nea=*i*nedelta+1;
419  neb=(*i+1)*nedelta;
420  if((*i==num_cpus-1)&&(neb<*ne1)) neb=*ne1;
421 
429  &calcul_fn1,&calcul_qa1,&nal[indexnal],&nea,&neb,ithermal1,
433 
434  return NULL;
435 }
static ITG * inoel1
Definition: results.c:31
static double * xbody1
Definition: results.c:36
static ITG * nmethod1
Definition: results.c:27
static double * xload1
Definition: results.c:36
static double * dtime1
Definition: results.c:36
static double * qa1
Definition: results.c:36
static double * xstate1
Definition: results.c:36
static ITG * npmat1_
Definition: results.c:27
static double * xstiff1
Definition: results.c:36
static ITG * istep1
Definition: results.c:27
static ITG * ithermal1
Definition: results.c:27
static ITG num_cpus
Definition: results.c:31
static double * springarea1
Definition: results.c:36
static ITG * network1
Definition: results.c:31
static ITG * nmpc1
Definition: results.c:31
subroutine resultstherm(co, kon, ipkon, lakon, v, elcon, nelcon, rhcon, nrhcon, ielmat, ielorien, norien, orab, ntmat_, t0, iperturb, fn, shcon, nshcon, iout, qa, vold, ipompc, nodempc, coefmpc, nmpc, dtime, time, ttime, plkcon, nplkcon, xstateini, xstiff, xstate, npmat_, matname, mi, ncmat_, nstate_, cocon, ncocon, qfx, ikmpc, ilmpc, istep, iinc, springarea, calcul_fn, calcul_qa, nal, nea, neb, ithermal, nelemload, nload, nmethod, reltime, sideload, xload, xloadold, pslavsurf, pmastsurf, mortar, clearini, plicon, nplicon, ielprop, prop, iponoel, inoel, network, ipobody, xbody, ibody)
Definition: resultstherm.f:30
static ITG * ipompc1
Definition: results.c:31
static char * matname1
Definition: results.c:25
static ITG calcul_qa1
Definition: results.c:27
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
static ITG * mortar1
Definition: results.c:31
static ITG * nelemload1
Definition: results.c:31
static double * qfx1
Definition: results.c:36
static ITG * ipobody1
Definition: results.c:31
static double * time1
Definition: results.c:36
static ITG * nodempc1
Definition: results.c:31
static double * pmastsurf1
Definition: results.c:36
static double * rhcon1
Definition: results.c:35
static ITG * iout1
Definition: results.c:27
static double * fn1
Definition: results.c:36
static ITG * ne1
Definition: results.c:27
static double * prop1
Definition: results.c:36
static double * t01
Definition: results.c:35
static double * shcon1
Definition: results.c:36
static ITG calcul_fn1
Definition: results.c:27
static double * cocon1
Definition: results.c:36
static ITG * ielmat1
Definition: results.c:27
static ITG * nplkcon1
Definition: results.c:27
static double * coefmpc1
Definition: results.c:36
static double * co1
Definition: results.c:35
static ITG * ipkon1
Definition: results.c:27
static ITG * iponoel1
Definition: results.c:31
static char * sideload1
Definition: results.c:25
static ITG mt1
Definition: results.c:31
static ITG * norien1
Definition: results.c:27
static double * vold1
Definition: results.c:36
static double * reltime1
Definition: results.c:36
static double * elcon1
Definition: results.c:35
static double * xloadold1
Definition: results.c:36
static ITG * nrhcon1
Definition: results.c:27
static double * orab1
Definition: results.c:35
static double * xstateini1
Definition: results.c:36
static ITG * nplicon1
Definition: results.c:27
static ITG * nk1
Definition: results.c:31
static ITG * mi1
Definition: results.c:27
static ITG * iinc1
Definition: results.c:27
static ITG * ibody1
Definition: results.c:31
static double * plkcon1
Definition: results.c:36
static ITG * nshcon1
Definition: results.c:31
static ITG * ikmpc1
Definition: results.c:31
static ITG * ielorien1
Definition: results.c:27
static char * lakon1
Definition: results.c:25
static ITG * ncmat1_
Definition: results.c:27
static ITG * nal
Definition: results.c:31
static double * clearini1
Definition: results.c:36
static ITG * ntmat1_
Definition: results.c:27
static double * plicon1
Definition: results.c:36
static ITG * ilmpc1
Definition: results.c:31
static ITG * ncocon1
Definition: results.c:31
#define ITG
Definition: CalculiX.h:51
static ITG * nstate1_
Definition: results.c:27
static double * ttime1
Definition: results.c:36
static ITG * kon1
Definition: results.c:27
static double * v1
Definition: results.c:35
static ITG * nelcon1
Definition: results.c:27
static double * pslavsurf1
Definition: results.c:36
static ITG * nload1
Definition: results.c:31
static ITG * iperturb1
Definition: results.c:27
static ITG * ielprop1
Definition: results.c:31

◆ resultsthermmt_se()

void* resultsthermmt_se ( ITG i)

◆ rhspmain()

void rhspmain ( ITG ne,
char *  lakon,
ITG ipnei,
ITG neifa,
ITG neiel,
double *  vfa,
double *  area,
double *  adfa,
double *  xlet,
double *  cosa,
double *  volume,
double *  au,
double *  ad,
ITG jq,
ITG irow,
double *  ap,
ITG ielfa,
ITG ifabou,
double *  xle,
double *  b,
double *  xxn,
ITG neq,
ITG nzs,
double *  hfa,
double *  gradpel,
double *  bp,
double *  xxi,
ITG neij,
double *  xlen,
ITG iatleastonepressurebc,
double *  xxicn 
)
41  {
42 
43  ITG i,j;
44 
45  /* variables for multithreading procedure */
46 
47  ITG sys_cpus,*ithread=NULL;
48  char *env,*envloc,*envsys;
49 
50  num_cpus = 0;
51  sys_cpus=0;
52 
53  /* explicit user declaration prevails */
54 
55  envsys=getenv("NUMBER_OF_CPUS");
56  if(envsys){
57  sys_cpus=atoi(envsys);
58  if(sys_cpus<0) sys_cpus=0;
59  }
60 
61  /* automatic detection of available number of processors */
62 
63  if(sys_cpus==0){
64  sys_cpus = getSystemCPUs();
65  if(sys_cpus<1) sys_cpus=1;
66  }
67 
68  /* local declaration prevails, if strictly positive */
69 
70  envloc = getenv("CCX_NPROC_CFD");
71  if(envloc){
72  num_cpus=atoi(envloc);
73  if(num_cpus<0){
74  num_cpus=0;
75  }else if(num_cpus>sys_cpus){
76  num_cpus=sys_cpus;
77  }
78 
79  }
80 
81  /* else global declaration, if any, applies */
82 
83  env = getenv("OMP_NUM_THREADS");
84  if(num_cpus==0){
85  if (env)
86  num_cpus = atoi(env);
87  if (num_cpus < 1) {
88  num_cpus=1;
89  }else if(num_cpus>sys_cpus){
90  num_cpus=sys_cpus;
91  }
92  }
93 
94 // next line is to be inserted in a similar way for all other paralell parts
95 
96  if(*nef<num_cpus) num_cpus=*nef;
97 
98  pthread_t tid[num_cpus];
99 
100  /* calculating the stiffness and/or mass matrix
101  (symmetric part) */
102 
103  nef1=nef;lakonf1=lakonf;ipnei1=ipnei;neifa1=neifa;neiel1=neiel;
104  vfa1=vfa;area1=area;advfa1=advfa;xlet1=xlet,cosa1=cosa;volume1=volume;
105  jq1=jq;irow1=irow;ap1=ap;ielfa1=ielfa;ifabou1=ifabou;xle1=xle;
106  xxn1=xxn;neq1=neq;nzs1=nzs;hfa1=hfa;gradpel1=gradpel;bp1=bp;xxi1=xxi;
107  neij1=neij;xlen1=xlen;ad1=ad;au1=au;b1=b;xxicn1=xxicn;
108 
109  /* create threads and wait */
110 
111  NNEW(ithread,ITG,num_cpus);
112  for(i=0; i<num_cpus; i++) {
113  ithread[i]=i;
114  pthread_create(&tid[i], NULL, (void *)rhspmt, (void *)&ithread[i]);
115  }
116  for(i=0; i<num_cpus; i++) pthread_join(tid[i], NULL);
117 
118  SFREE(ithread);
119 
120 /* at least one pressure bc is needed. If none is applied,
121  the last dof is set to 0
122 
123  a pressure bc is only recognized if not all velocity degrees of
124  freedom are prescribed on the same face */
125 
126  if(*iatleastonepressurebc==0) b[*nef-1]=0.;
127 
128  return;
129 
130 }
static ITG * neq1
Definition: rhspmain.c:27
static double * gradpel1
Definition: rhspmain.c:30
static ITG num_cpus
Definition: rhspmain.c:27
static double * advfa1
Definition: rhspmain.c:30
int pthread_create(pthread_t *thread_id, const pthread_attr_t *attributes, void *(*thread_function)(void *), void *arguments)
static double * cosa1
Definition: rhspmain.c:30
static double * au1
Definition: rhspmain.c:30
static ITG * jq1
Definition: rhspmain.c:27
static double * xxicn1
Definition: rhspmain.c:30
static double * bp1
Definition: rhspmain.c:30
static double * ad1
Definition: rhspmain.c:30
static ITG * ielfa1
Definition: rhspmain.c:27
ITG getSystemCPUs()
Definition: getSystemCPUs.c:40
static ITG * neifa1
Definition: rhspmain.c:27
static ITG * nzs1
Definition: rhspmain.c:27
static double * xlet1
Definition: rhspmain.c:30
#define SFREE(a)
Definition: CalculiX.h:41
static ITG * ipnei1
Definition: rhspmain.c:27
static double * hfa1
Definition: rhspmain.c:30
static double * vfa1
Definition: rhspmain.c:30
static ITG * ifabou1
Definition: rhspmain.c:27
static ITG * neiel1
Definition: rhspmain.c:27
static double * xxn1
Definition: rhspmain.c:30
static double * xlen1
Definition: rhspmain.c:30
int pthread_join(pthread_t thread, void **status_ptr)
static double * ap1
Definition: rhspmain.c:30
void * rhspmt(ITG *i)
Definition: rhspmain.c:134
static double * volume1
Definition: rhspmain.c:30
static ITG * neij1
Definition: rhspmain.c:27
static char * lakonf1
Definition: rhspmain.c:25
#define ITG
Definition: CalculiX.h:51
static double * xxi1
Definition: rhspmain.c:30
static double * xle1
Definition: rhspmain.c:30
static ITG * nef1
Definition: rhspmain.c:27
#define NNEW(a, b, c)
Definition: CalculiX.h:39
static double * area1
Definition: rhspmain.c:30
static double * b1
Definition: rhspmain.c:30
static ITG * irow1
Definition: rhspmain.c:27

◆ rhspmt()

void* rhspmt ( ITG i)
134  {
135 
136  ITG indexad,indexb,nefa,nefb,nefdelta;
137  long long indexau;
138 
139  indexad=*i**neq1;
140  indexau=(long long)*i**nzs1;
141  indexb=*i**neq1;
142 
143 // ceil -> floor
144 
145  nefdelta=(ITG)floor(*nef1/(double)num_cpus);
146  nefa=*i*nefdelta+1;
147  nefb=(*i+1)*nefdelta;
148 // next line! -> all parallel sections
149  if((*i==num_cpus-1)&&(nefb<*nef1)) nefb=*nef1;
150 
154  neq1,nzs1,
155  hfa1,gradpel1,bp1,xxi1,neij1,xlen1,&nefa,&nefb,
156  xxicn1));
157 
158  return NULL;
159 }
static ITG * neq1
Definition: rhspmain.c:27
static double * gradpel1
Definition: rhspmain.c:30
static ITG num_cpus
Definition: rhspmain.c:27
static double * advfa1
Definition: rhspmain.c:30
static double * cosa1
Definition: rhspmain.c:30
static double * au1
Definition: rhspmain.c:30
static ITG * jq1
Definition: rhspmain.c:27
static double * xxicn1
Definition: rhspmain.c:30
static double * bp1
Definition: rhspmain.c:30
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
static double * ad1
Definition: rhspmain.c:30
static ITG * ielfa1
Definition: rhspmain.c:27
static ITG * neifa1
Definition: rhspmain.c:27
subroutine rhsp(nef, lakonf, ipnei, neifa, neiel, vfa, area, advfa, xlet, cosa, volume, au, ad, jq, irow, ap, ielfa, ifabou, xle, b, xxn, neq, nzs, hfa, gradpel, bp, xxi, neij, xlen, nefa, nefb, xxicn)
Definition: rhsp.f:23
static ITG * nzs1
Definition: rhspmain.c:27
static double * xlet1
Definition: rhspmain.c:30
static ITG * ipnei1
Definition: rhspmain.c:27
static double * hfa1
Definition: rhspmain.c:30
static double * vfa1
Definition: rhspmain.c:30
static ITG * ifabou1
Definition: rhspmain.c:27
static ITG * neiel1
Definition: rhspmain.c:27
static double * xxn1
Definition: rhspmain.c:30
static double * xlen1
Definition: rhspmain.c:30
static double * ap1
Definition: rhspmain.c:30
static double * volume1
Definition: rhspmain.c:30
static ITG * neij1
Definition: rhspmain.c:27
static char * lakonf1
Definition: rhspmain.c:25
#define ITG
Definition: CalculiX.h:51
static double * xxi1
Definition: rhspmain.c:30
static double * xle1
Definition: rhspmain.c:30
static ITG * nef1
Definition: rhspmain.c:27
static double * area1
Definition: rhspmain.c:30
static double * b1
Definition: rhspmain.c:30
static ITG * irow1
Definition: rhspmain.c:27

◆ sensitivity()

void sensitivity ( double *  co,
ITG nk,
ITG **  konp,
ITG **  ipkonp,
char **  lakonp,
ITG ne,
ITG nodeboun,
ITG ndirboun,
double *  xboun,
ITG nboun,
ITG ipompc,
ITG nodempc,
double *  coefmpc,
char *  labmpc,
ITG nmpc,
ITG nodeforc,
ITG ndirforc,
double *  xforc,
ITG nforc,
ITG nelemload,
char *  sideload,
double *  xload,
ITG nload,
ITG nactdof,
ITG icol,
ITG jq,
ITG **  irowp,
ITG neq,
ITG nzl,
ITG nmethod,
ITG ikmpc,
ITG ilmpc,
ITG ikboun,
ITG ilboun,
double *  elcon,
ITG nelcon,
double *  rhcon,
ITG nrhcon,
double *  alcon,
ITG nalcon,
double *  alzero,
ITG **  ielmatp,
ITG **  ielorienp,
ITG norien,
double *  orab,
ITG ntmat_,
double *  t0,
double *  t1,
double *  t1old,
ITG ithermal,
double *  prestr,
ITG iprestr,
double *  vold,
ITG iperturb,
double *  sti,
ITG nzs,
ITG kode,
char *  filab,
double *  eme,
ITG iexpl,
double *  plicon,
ITG nplicon,
double *  plkcon,
ITG nplkcon,
double **  xstatep,
ITG npmat_,
char *  matname,
ITG isolver,
ITG mi,
ITG ncmat_,
ITG nstate_,
double *  cs,
ITG mcs,
ITG nkon,
double **  enerp,
double *  xbounold,
double *  xforcold,
double *  xloadold,
char *  amname,
double *  amta,
ITG namta,
ITG nam,
ITG iamforc,
ITG iamload,
ITG iamt1,
ITG iamboun,
double *  ttime,
char *  output,
char *  set,
ITG nset,
ITG istartset,
ITG iendset,
ITG ialset,
ITG nprint,
char *  prlab,
char *  prset,
ITG nener,
double *  trab,
ITG inotr,
ITG ntrans,
double *  fmpc,
char *  cbody,
ITG ibody,
double *  xbody,
ITG nbody,
double *  xbodyold,
double *  timepar,
double *  thicke,
char *  jobnamec,
char *  tieset,
ITG ntie,
ITG istep,
ITG nmat,
ITG ielprop,
double *  prop,
char *  typeboun,
ITG mortar,
ITG mpcinfo,
double *  tietol,
ITG ics,
ITG icontact,
ITG nobject,
char **  objectsetp,
ITG istat,
char *  orname,
ITG nzsfreq,
ITG nlabel,
double *  physcon,
char *  jobnamef 
)
71  {
72 
73  char description[13]=" ",*lakon=NULL,cflag[1]=" ",fneig[132]="",
74  stiffmatrix[132]="",*lakonfa=NULL,*objectset=NULL;
75 
76  ITG *inum=NULL,k,*irow=NULL,ielas=0,icmd=0,iinc=1,nasym=0,
77  mass[2]={0,0},stiffness=1,buckling=0,rhsi=1,intscheme=0,*ncocon=NULL,
78  *nshcon=NULL,mode=-1,noddiam=-1,*ipobody=NULL,inewton=0,coriolis=0,iout,
79  ifreebody,*itg=NULL,ntg=0,ngraph=1,mt=mi[1]+1,ne0,*integerglob=NULL,
80  icfd=0,*inomat=NULL,*islavact=NULL,*islavnode=NULL,*nslavnode=NULL,
81  *islavsurf=NULL,nmethodl,*kon=NULL,*ipkon=NULL,*ielmat=NULL,nzss,
82  *mast1=NULL,*irows=NULL,*icols=NULL,*jqs=NULL,*ipointer=NULL,i,
83  *nactdofinv=NULL,*nodorig=NULL,ndesi,iobject,*iponoel=NULL,node,
84  *nodedesi=NULL,*ipoface=NULL,*nodface=NULL,*inoel=NULL,*ipoorel=NULL,
85  icoordinate=0,iorientation=0,ishapeenergy=0,imass=0,idisplacement=0,
86  *istartdesi=NULL,*ialdesi=NULL,*iorel=NULL,*ipoeldi=NULL,*ieldi=NULL,
87  *istartelem=NULL,*ialelem=NULL,ieigenfrequency=0,cyclicsymmetry=0,
88  nherm,nev,iev,inoelsize,*itmp=NULL,nmd,nevd,*nm=NULL,*ielorien=NULL,
89  igreen=0,iglob=0,idesvar=0,inorm=0,irand=0,*nodedesiinv=NULL,
90  *nnodes=NULL,index,noregion=0,*konfa=NULL,*ipkonfa=NULL,nsurfs,
91  *iponor=NULL,*iponoelfa=NULL,*inoelfa=NULL,ithickness,nactive=0,nnlconst,
92  *ipoacti=NULL;
93 
94  double *stn=NULL,*v=NULL,*een=NULL,cam[5],*xstiff=NULL,*stiini=NULL,*tper,
95  *f=NULL,*fn=NULL,qa[4],*epn=NULL,*xstateini=NULL,*xdesi=NULL,
96  *vini=NULL,*stx=NULL,*enern=NULL,*xbounact=NULL,*xforcact=NULL,
97  *xloadact=NULL,*t1act=NULL,*ampli=NULL,*xstaten=NULL,*eei=NULL,
98  *enerini=NULL,*cocon=NULL,*shcon=NULL,*qfx=NULL,
99  *qfn=NULL,*cgr=NULL,*xbodyact=NULL,*springarea=NULL,*emn=NULL,
100  *clearini=NULL,ptime=0.,*emeini=NULL,*doubleglob=NULL,*au=NULL,
101  *ad=NULL,*b=NULL,*aub=NULL,*adb=NULL,*pslavsurf=NULL,
102  *pmastsurf=NULL,*cdn=NULL,*xstate=NULL,*fnext=NULL,*energyini=NULL,
103  *energy=NULL,*ener=NULL,*dxstiff=NULL,*d=NULL,*z=NULL,
104  distmin,*df=NULL,*g0=NULL,*dgdx=NULL,sigma=0,*xinterpol=NULL,
105  *dgdxglob=NULL,*extnor=NULL,*veold=NULL,*accold=NULL,bet,gam,
106  dtime,time,reltime=1.,*weightformgrad=NULL,*fint=NULL,*xnor=NULL;
107 
108  FILE *f1;
109 
110 #ifdef SGI
111  ITG token;
112 #endif
113 
114  irow=*irowp;ener=*enerp;xstate=*xstatep;ipkon=*ipkonp;lakon=*lakonp;
115  kon=*konp;ielmat=*ielmatp;ielorien=*ielorienp;objectset=*objectsetp;
116 
117  tper=&timepar[1];
118 
119  time=*tper;
120  dtime=*tper;
121 
122  ne0=*ne;
123 
124  /* determining the global values to be used as boundary conditions
125  for a submodel */
126 
127  getglobalresults(jobnamec,&integerglob,&doubleglob,nboun,iamboun,xboun,
128  nload,sideload,iamload,&iglob,nforc,iamforc,xforc,
129  ithermal,nk,t1,iamt1);
130 
131  /* check which design variables are active */
132 
133  for(i=0;i<*ntie;i++){
134  if(strcmp1(&tieset[i*243+80],"D")==0){
135  if(strcmp1(&tieset[i*243],"COORDINATE")==0){
136  icoordinate=1;
137  if(strcmp1(&tieset[i*243],"COORDINATENOREGION")==0){noregion=1;}
138  break;
139  }else if(strcmp1(&tieset[i*243],"ORIENTATION")==0){
140  if(*norien==0){
141  printf(" *ERROR in sensitivity: the ORIENTATION sensitivity was requested,\n");
142  printf(" yet no orientations were defined.\n");
143  FORTRAN(stop,());
144  }
145  iorientation=1;
146  break;
147  }
148  }
149  }
150 
151  /* check which targets are active */
152 
153  for(i=0;i<*nobject;i++){
154  if(strcmp1(&objectset[i*324],"DISPLACEMENT")==0){
155  idisplacement=1;
156  }else if(strcmp1(&objectset[i*324],"EIGENFREQUENCY")==0){
157  ieigenfrequency=1;
158  }else if(strcmp1(&objectset[i*324],"GREEN")==0){
159  ieigenfrequency=1;
160  igreen=1;
161  }else if(strcmp1(&objectset[i*324],"MASS")==0){
162  imass=1;
163  }else if(strcmp1(&objectset[i*324],"SHAPEENERGY")==0){
164  ishapeenergy=1;
165  }else if(strcmp1(&objectset[i*324],"STRESS")==0){
166  idisplacement=1;
167  }else if(strcmp1(&objectset[i*324],"THICKNESS")==0){
168  ithickness=1;
169  }
170  }
171 
172  /* EIGENFREQUENCY as objective should not be used with any
173  other objective in the same step */
174 
175  if(((idisplacement==1)||(imass==1)||(ishapeenergy==1))&&
176  (ieigenfrequency==1)){
177  printf(" *ERROR in sensitivity: the objective EIGENFREQUENCY\n");
178  printf(" cannot be used with any other objective within\n");
179  printf(" the same step\n");
180  exit(0);
181  }
182 
183  if(ishapeenergy==1){
184  NNEW(enerini,double,mi[0]**ne);
185  NNEW(emeini,double,6*mi[0]**ne);
186  NNEW(stiini,double,6*mi[0]**ne);
187 
188  memcpy(&enerini[0],&ener[0],sizeof(double)*mi[0]**ne);
189  memcpy(&emeini[0],&eme[0],sizeof(double)*6*mi[0]**ne);
190  memcpy(&stiini[0],&sti[0],sizeof(double)*6*mi[0]**ne);
191  }
192 
193  if(ieigenfrequency==1){
194 
195  /* opening the eigenvalue file and checking for cyclic symmetry */
196 
197  strcpy(fneig,jobnamec);
198  strcat(fneig,".eig");
199 
200  if((f1=fopen(fneig,"rb"))==NULL){
201  printf(" *ERROR in sensitivity: cannot open eigenvalue file for reading");
202  printf(" *INFO in sensitivity: if there are problems reading the .eig file this may be due to:\n");
203  printf(" 1) the nonexistence of the .eig file\n");
204  printf(" 2) other boundary conditions than in the input deck\n");
205  printf(" which created the .eig file\n\n");
206  exit(0);
207  }
208 
209  if(fread(&cyclicsymmetry,sizeof(ITG),1,f1)!=1){
210  printf(" *ERROR in sensitivity reading the cyclic symmetry flag in the eigenvalue file");
211  printf(" *INFO in sensitivity: if there are problems reading the .eig file this may be due to:\n");
212  printf(" 1) the nonexistence of the .eig file\n");
213  printf(" 2) other boundary conditions than in the input deck\n");
214  printf(" which created the .eig file\n\n");
215  exit(0);
216  }
217 
218  if(fread(&nherm,sizeof(ITG),1,f1)!=1){
219  printf(" *ERROR in sensitivity reading the Hermitian flag in the eigenvalue file");
220  printf(" *INFO in sensitivity: if there are problems reading the .eig file this may be due to:\n");
221  printf(" 1) the nonexistence of the .eig file\n");
222  printf(" 2) other boundary conditions than in the input deck\n");
223  printf(" which created the .eig file\n\n");
224  exit(0);
225  }
226 
227  if(nherm!=1){
228  printf(" *ERROR in sensitivity: the eigenvectors in the .eig-file result\n");
229  printf(" from a non-Hermitian eigenvalue problem. The \n");
230  printf(" sensitivity procedure cannot handle that yet\n\n");
231  FORTRAN(stop,());
232  }
233  }
234 
235  /* determining the elements belonging to a given node */
236 
237  NNEW(iponoel,ITG,*nk);
238  NNEW(inoel,ITG,2**nkon);
239  FORTRAN(elementpernode,(iponoel,inoel,lakon,ipkon,kon,ne,&inoelsize));
240 
241  if(icoordinate==1){
242 
243  /* find the external surfaces */
244 
245  NNEW(ipoface,ITG,*nk);
246  NNEW(nodface,ITG,5*6**ne);
247  NNEW(konfa,ITG,8*6**ne);
248  NNEW(ipkonfa,ITG,6**ne);
249  NNEW(lakonfa,char,8*6**ne);
250  NNEW(iponoelfa,ITG,*nk);
251  NNEW(inoelfa,ITG,3*8*6**ne);
252 
253  FORTRAN(findsurface_se,(nodface,ipoface,ne,ipkon,lakon,kon,
254  konfa,ipkonfa,nk,lakonfa,&nsurfs));
255 
256  FORTRAN(facepernode,(iponoelfa,inoelfa,lakonfa,ipkonfa,konfa,
257  &nsurfs,&inoelsize));
258 
259  RENEW(konfa,ITG,8*nsurfs);
260  RENEW(ipkonfa,ITG,nsurfs);
261  RENEW(lakonfa,char,8*nsurfs);
262 
263  /* determining the information of the designvariable set */
264 
265  NNEW(nodedesi,ITG,*nk);
266  NNEW(itmp,ITG,*nk);
267  NNEW(nodedesiinv,ITG,*nk);
268 
269  FORTRAN(getdesiinfo,(set,istartset,iendset,ialset,nset,
270  mi,nactdof,&ndesi,nodedesi,ntie,tieset,
271  itmp,nmpc,nodempc,ipompc,nodedesiinv,
272  iponoel,inoel,lakon,ipkon,
273  kon,&noregion,ipoface,nodface,nk));
274 
275  SFREE(itmp);
276  RENEW(nodedesi,ITG,ndesi);
277 
278  /* storing the elements to which each design variable belongs
279  in field ialdesi */
280 
281  NNEW(istartdesi,ITG,ndesi+1);
282  NNEW(ialdesi,ITG,*nkon);
283  FORTRAN(createialdesi,(&ndesi,nodedesi,iponoel,inoel,
284  istartdesi,ialdesi,lakon,ipkon,kon,
285  nodedesiinv,&icoordinate,&noregion));
286  RENEW(ialdesi,ITG,istartdesi[ndesi]-1);
287 
288  /* calculating the normal direction for every designvariable */
289 
290  NNEW(extnor,double,3**nk);
291 
292  FORTRAN(normalsonsurface_se,(ipkon,kon,lakon,extnor,co,nk,ipoface,
293  nodface,nactdof,mi,nodedesiinv,&noregion));
294 
295  /* if the sensitivity calculation is used in a optimization script
296  this script usually contains a loop consisting of:
297  1. a call to CalculiX to define the sensitivities
298  2. a small modification of the surface geometry in a direction which
299  decrease the objective function (only the design variables)
300  3. a modification of the internal mesh in order to preserve
301  mesh quality
302  The latter point can be done by performing a linear elastic
303  calculation in which the small modification in 2. is applied
304  a *boundary condition and all other nodes (on the external
305  surface but no design variables) are fixed by *equation's
306  in a direction normal to the surface. At corners and edges
307  there my be more than one normal. The necessary equations are
308  calculated in normalsforeq_se.f and stored in jobname.equ */
309 
310  NNEW(iponor,ITG,8*nsurfs);
311  for(i=0;i<8*nsurfs;i++) iponor[i]=-1;
312  NNEW(xnor,double,24*nsurfs);
313 
314  FORTRAN(normalsforequ_se,(nk,co,iponoelfa,inoelfa,konfa,ipkonfa,lakonfa,
315  &nsurfs,iponor,xnor,nodedesiinv,jobnamef));
316 
317  SFREE(konfa);SFREE(ipkonfa);SFREE(lakonfa);SFREE(iponor);SFREE(xnor);
318  SFREE(iponoelfa);SFREE(inoelfa);
319 
320  /* createinum is called in order to determine the nodes belonging
321  to elements; this information is needed in frd_se */
322 
323  NNEW(inum,ITG,*nk);
324  FORTRAN(createinum,(ipkon,inum,kon,lakon,nk,ne,&cflag[0],nelemload,
325  nload,nodeboun,nboun,ndirboun,ithermal,co,vold,mi,ielmat));
326 
327  /* storing the normal information in the frd-file for the optimizer */
328 
329  ++*kode;
330 
331  inorm=1;
332  frd_sen(co,nk,stn,inum,nmethod,kode,filab,&ptime,nstate_,
333  istep,
334  &iinc,&mode,&noddiam,description,mi,&ngraph,ne,cs,set,nset,
335  istartset,iendset,ialset,jobnamec,output,
336  extnor,&iobject,objectset,ntrans,inotr,trab,&idesvar,orname,
337  &icoordinate,&inorm,&irand);
338  inorm=0;
339 
340  /* storing the normal direction for every design variable */
341 
342  NNEW(xdesi,double,3*ndesi);
343  for(k=0;k<ndesi;k++){
344  node=nodedesi[k]-1;
345  memcpy(&xdesi[3*k],&extnor[3*node],sizeof(double)*3);
346  }
347 
348  /* calculation of the smallest distance between nodes */
349 
350  FORTRAN(smalldist,(co,&distmin,lakon,ipkon,kon,ne));
351 
352  /* resizing xdesi to a length of distmin */
353 
354  for(k=0;k<3*ndesi;k++){
355  xdesi[k]*=distmin;
356  }
357 
358  /* calculation of gaussian r fields for robust optimization */
359 
360  if(physcon[10]>0){
361 
362  randomfieldmain(kon,ipkon,lakon,ne,nmpc,nactdof,mi,nodedesi,&ndesi,
363  istartdesi,ialdesi,co,physcon,isolver,ntrans,nk,inotr,trab,jobnamec,
364  nboun,cs,mcs,inum,nmethod,kode,filab,nstate_,istep,description,set,
365  nset,iendset,output,istartset,ialset,extnor);
366 
367  }
368 
369  SFREE(inum);SFREE(extnor);
370 
371  }else if(iorientation==1){
372  ndesi=3**norien;
373  distmin=1.e-3;
374 
375  /* writing the design variables into the dat-file */
376 
377  FORTRAN(writedesi,(norien,orname));
378 
379  /* storing the elements with a given orientation in
380  ipoorel and iorel */
381 
382  NNEW(ipoorel,ITG,*norien);
383  NNEW(iorel,ITG,2**ne);
384  FORTRAN(elementperorien,(ipoorel,iorel,ielorien,ne,mi));
385 
386  /* storing the orientation of the design variables
387  in nodedesi (per orientation there are three design
388  variables - the Euler angles) */
389 
390  NNEW(nodedesi,ITG,ndesi);
391  for(i=0;i<ndesi;i++){
392  nodedesi[i]=i/3+1;
393  }
394 
395  /* storing the elements corresponding with a given
396  design variable in istartdesi and ialdesi */
397 
398  NNEW(istartdesi,ITG,ndesi+1);
399  NNEW(ialdesi,ITG,3**ne);
400  FORTRAN(createialdesi,(&ndesi,nodedesi,ipoorel,iorel,
401  istartdesi,ialdesi,lakon,ipkon,kon,
402  nodedesiinv,&icoordinate,&noregion));
403  SFREE(ipoorel);SFREE(iorel);SFREE(nodedesi);
404  RENEW(ialdesi,ITG,istartdesi[ndesi]-1);
405 
406  }
407 
408  /* allocating fields for the actual external loading */
409 
410  NNEW(xbounact,double,*nboun);
411  for(k=0;k<*nboun;++k){xbounact[k]=xbounold[k];}
412  NNEW(xforcact,double,*nforc);
413  NNEW(xloadact,double,2**nload);
414  NNEW(xbodyact,double,7**nbody);
415  /* copying the rotation axis and/or acceleration vector */
416  for(k=0;k<7**nbody;k++){xbodyact[k]=xbody[k];}
417  if(*ithermal==1){
418  NNEW(t1act,double,*nk);
419  for(k=0;k<*nk;++k){t1act[k]=t1old[k];}
420  }
421 
422  /* assigning the body forces to the elements */
423 
424  if(*nbody>0){
425  ifreebody=*ne+1;
426  NNEW(ipobody,ITG,2*ifreebody**nbody);
427  for(k=1;k<=*nbody;k++){
428  FORTRAN(bodyforce,(cbody,ibody,ipobody,nbody,set,istartset,
429  iendset,ialset,&inewton,nset,&ifreebody,&k));
430  RENEW(ipobody,ITG,2*(*ne+ifreebody));
431  }
432  RENEW(ipobody,ITG,2*(ifreebody-1));
433  }
434 
435  /* allocating a field for the instantaneous amplitude */
436 
437  NNEW(ampli,double,*nam);
438 
439  FORTRAN(tempload,(xforcold,xforc,xforcact,iamforc,nforc,xloadold,xload,
440  xloadact,iamload,nload,ibody,xbody,nbody,xbodyold,xbodyact,
441  t1old,t1,t1act,iamt1,nk,amta,
442  namta,nam,ampli,&time,&reltime,ttime,&dtime,ithermal,nmethod,
443  xbounold,xboun,xbounact,iamboun,nboun,
444  nodeboun,ndirboun,nodeforc,ndirforc,istep,&iinc,
445  co,vold,itg,&ntg,amname,ikboun,ilboun,nelemload,sideload,mi,
446  ntrans,trab,inotr,veold,integerglob,doubleglob,tieset,istartset,
447  iendset,ialset,ntie,nmpc,ipompc,ikmpc,ilmpc,nodempc,coefmpc,
448  ipobody,iponoel,inoel));
449 
450  /* determining the structure of the df matrix */
451 
452  nzss=20000000;
453  NNEW(mast1,ITG,nzss);
454  NNEW(irows,ITG,1);
455  NNEW(icols,ITG,ndesi);
456  NNEW(jqs,ITG,ndesi+1);
457  NNEW(ipointer,ITG,ndesi);
458 
459  mastructse(kon,ipkon,lakon,ne,ipompc,nodempc,nmpc,nactdof,icols,jqs,
460  &mast1,&irows,ipointer,&nzss,mi,mortar,nodedesi,&ndesi,
461  &icoordinate,ielorien,istartdesi,ialdesi);
462 
463  SFREE(ipointer);SFREE(mast1);
464  RENEW(irows,ITG,nzss);
465 
466  /* invert nactdof */
467 
468  NNEW(nactdofinv,ITG,mt**nk);
469  NNEW(nodorig,ITG,*nk);
470  FORTRAN(gennactdofinv,(nactdof,nactdofinv,nk,mi,nodorig,
471  ipkon,lakon,kon,ne));
472  SFREE(nodorig);
473 
474  /* reading the stiffness matrix, mass matrix, eigenfrequencies
475  and eigenmodes */
476 
477  if(ieigenfrequency==1){
478 
479  /* reading the eigenvalues / eigenmodes */
480 
481  if(!cyclicsymmetry){
482 
483  if(fread(&nev,sizeof(ITG),1,f1)!=1){
484  printf(" *ERROR in sensitivity reading the number of eigenvalues in the eigenvalue file");
485  printf(" *INFO in sensitivity: if there are problems reading the .eig file this may be due to:\n");
486  printf(" 1) the nonexistence of the .eig file\n");
487  printf(" 2) other boundary conditions than in the input deck\n");
488  printf(" which created the .eig file\n\n");
489  exit(0);
490  }
491 
492  NNEW(d,double,nev);
493 
494  if(fread(d,sizeof(double),nev,f1)!=nev){
495  printf(" *ERROR in sensitivity reading the eigenvalues in the eigenvalue file");
496  printf(" *INFO in sensitivity: if there are problems reading the .eig file this may be due to:\n");
497  printf(" 1) the nonexistence of the .eig file\n");
498  printf(" 2) other boundary conditions than in the input deck\n");
499  printf(" which created the .eig file\n\n");
500  exit(0);
501  }
502 
503 /* for(i=0;i<nev;i++){
504  if(d[i]>0){d[i]=sqrt(d[i]);}else{d[i]=0.;}
505  }*/
506 
507  NNEW(ad,double,neq[1]);
508  NNEW(adb,double,neq[1]);
509  NNEW(au,double,nzsprevstep[2]);
510  NNEW(aub,double,nzs[1]);
511 
512  if(fread(ad,sizeof(double),neq[1],f1)!=neq[1]){
513  printf(" *ERROR in sensitivity reading the diagonal of the stiffness matrix in the eigenvalue file");
514  printf(" *INFO in sensitivity: if there are problems reading the .eig file this may be due to:\n");
515  printf(" 1) the nonexistence of the .eig file\n");
516  printf(" 2) other boundary conditions than in the input deck\n");
517  printf(" which created the .eig file\n\n");
518  exit(0);
519  }
520 
521  if(fread(au,sizeof(double),nzsprevstep[2],f1)!=nzsprevstep[2]){
522  printf(" *ERROR in sensitivity reading the off-diagonals of the stiffness matrix in the eigenvalue file");
523  printf(" *INFO in sensitivity: if there are problems reading the .eig file this may be due to:\n");
524  printf(" 1) the nonexistence of the .eig file\n");
525  printf(" 2) other boundary conditions than in the input deck\n");
526  printf(" which created the .eig file\n\n");
527  exit(0);
528  }
529 
530  if(fread(adb,sizeof(double),neq[1],f1)!=neq[1]){
531  printf(" *ERROR in sensitivity reading the diagonal of the mass matrix in the eigenvalue file");
532  printf(" *INFO in sensitivity: if there are problems reading the .eig file this may be due to:\n");
533  printf(" 1) the nonexistence of the .eig file\n");
534  printf(" 2) other boundary conditions than in the input deck\n");
535  printf(" which created the .eig file\n\n");
536  exit(0);
537  }
538 
539  if(fread(aub,sizeof(double),nzs[1],f1)!=nzs[1]){
540  printf(" *ERROR in sensitivity reading the off-diagonals of the mass matrix in the eigenvalue file");
541  printf(" *INFO in sensitivity: if there are problems reading the .eig file this may be due to:\n");
542  printf(" 1) the nonexistence of the .eig file\n");
543  printf(" 2) other boundary conditions than in the input deck\n");
544  printf(" which created the .eig file\n\n");
545  exit(0);
546  }
547 
548  NNEW(z,double,neq[1]*nev);
549 
550  if(fread(z,sizeof(double),neq[1]*nev,f1)!=neq[1]*nev){
551  printf(" *ERROR in sensitivity reading the eigenvectors in the eigenvalue file");
552  printf(" *INFO in sensitivity: if there are problems reading the .eig file this may be due to:\n");
553  printf(" 1) the nonexistence of the .eig file\n");
554  printf(" 2) other boundary conditions than in the input deck\n");
555  printf(" which created the .eig file\n\n");
556  exit(0);
557  }
558  }
559  else{
560  nev=0;
561  do{
562  if(fread(&nmd,sizeof(ITG),1,f1)!=1){
563  break;
564  }
565  if(fread(&nevd,sizeof(ITG),1,f1)!=1){
566  printf(" *ERROR in sensitivity reading the number of eigenvalues for nodal diameter %" ITGFORMAT " in the eigenvalue file",nmd);
567  printf(" *INFO in sensitivity: if there are problems reading the .eig file this may be due to:\n");
568  printf(" 1) the nonexistence of the .eig file\n");
569  printf(" 2) other boundary conditions than in the input deck\n");
570  printf(" which created the .eig file\n\n");
571  exit(0);
572  }
573  if(nev==0){
574  NNEW(d,double,nevd);
575  NNEW(nm,ITG,nevd);
576  }else{
577  RENEW(d,double,nev+nevd);
578  RENEW(nm,ITG,nev+nevd);
579  }
580 
581  if(fread(&d[nev],sizeof(double),nevd,f1)!=nevd){
582  printf(" *ERROR in sensitivity reading the eigenvalues for nodal diameter %" ITGFORMAT " in the eigenvalue file",nmd);
583  printf(" *INFO in sensitivity: if there are problems reading the .eig file this may be due to:\n");
584  printf(" 1) the nonexistence of the .eig file\n");
585  printf(" 2) other boundary conditions than in the input deck\n");
586  printf(" which created the .eig file\n\n");
587  exit(0);
588  }
589 
590 /* for(i=nev;i<nev+nevd;i++){
591  if(d[i]>0){d[i]=sqrt(d[i]);}else{d[i]=0.;}
592  }*/
593 
594  for(i=nev;i<nev+nevd;i++){nm[i]=nmd;}
595 
596  if(nev==0){
597 
598  /* reading stiffness and mass matrix; these are not kept */
599 
600  NNEW(adb,double,neq[1]);
601  NNEW(aub,double,nzs[1]);
602 
603  if(fread(adb,sizeof(double),neq[1],f1)!=neq[1]){
604  printf(" *ERROR in sensitivity reading the diagonal of the mass matrix in the eigenvalue file");
605  printf(" *INFO in sensitivity: if there are problems reading the .eig file this may be due to:\n");
606  printf(" 1) the nonexistence of the .eig file\n");
607  printf(" 2) other boundary conditions than in the input deck\n");
608  printf(" which created the .eig file\n\n");
609  exit(0);
610  }
611 
612  if(fread(aub,sizeof(double),nzs[1],f1)!=nzs[1]){
613  printf(" *ERROR in sensitivity reading the off-diagonals of the mass matrix in the eigenvalue file");
614  printf(" *INFO in sensitivity: if there are problems reading the .eig file this may be due to:\n");
615  printf(" 1) the nonexistence of the .eig file\n");
616  printf(" 2) other boundary conditions than in the input deck\n");
617  printf(" which created the .eig file\n\n");
618  exit(0);
619  }
620 
621  SFREE(adb);SFREE(aub);
622  }
623 
624  if(nev==0){
625  NNEW(z,double,neq[1]*nevd);
626  }else{
627  RENEW(z,double,(long long)neq[1]*(nev+nevd));
628  }
629 
630  if(fread(&z[(long long)neq[1]*nev],sizeof(double),neq[1]*nevd,f1)!=neq[1]*nevd){
631  printf(" *ERROR in sensitivity reading the eigenvectors for nodal diameter %" ITGFORMAT " in the eigenvalue file",nmd);
632  printf(" *INFO in sensitivity: if there are problems reading the .eig file this may be due to:\n");
633  printf(" 1) the nonexistence of the .eig file\n");
634  printf(" 2) other boundary conditions than in the input deck\n");
635  printf(" which created the .eig file\n\n");
636  exit(0);
637  }
638  nev+=nevd;
639  }while(1);
640  }
641  fclose(f1);
642  }else{
643  nev=1;
644  if((idisplacement==1)||((ishapeenergy==1)&&(iperturb[1]==1))){
645 
646  /* reading the stiffness matrix from previous step for sensitivity analysis */
647  /* matrix stored in <jobname>.stm file */
648 
649  /* nzs,irow,jq and icol are stored too, since the static analysis
650  can involve contact, whereas in the sensitivity analysis contact is not
651  taken into account while determining the structure of the stiffness
652  matrix (in mastruct.c)
653  */
654 
655  /* for mass and shape energy the stiffness matrix is not needed */
656 
657  strcpy(stiffmatrix,jobnamec);
658  strcat(stiffmatrix,".stm");
659 
660  if((f1=fopen(stiffmatrix,"rb"))==NULL){
661  printf("*ERROR in sensitivity: cannot open stiffness-matrix file for reading");
662  exit(0);
663  }
664 
665  if(fread(&nasym,sizeof(ITG),1,f1)!=1){
666  printf("*ERROR in sensitivity reading the symmetry flag of the stiffness matrix file...");
667  exit(0);
668  }
669 
670  if(fread(nzs,sizeof(ITG),3,f1)!=3){
671  printf("*ERROR in sensitivity reading the number of subdiagonal nonzeros in the stiffness matrix file...");
672  exit(0);
673  }
674  RENEW(irow,ITG,nzs[2]);
675 
676  if(fread(irow,sizeof(ITG),nzs[2],f1)!=nzs[2]){
677  printf("*ERROR in sensitivity reading irow in the stiffness matrix file...");
678  exit(0);
679  }
680 
681  if(fread(jq,sizeof(ITG),neq[1]+1,f1)!=neq[1]+1){
682  printf("*ERROR in sensitivity reading jq in the stiffness matrix file...");
683  exit(0);
684  }
685 
686  if(fread(icol,sizeof(ITG),neq[1],f1)!=neq[1]){
687  printf("*ERROR in sensitivity reading icol in the stiffness matrix file...");
688  exit(0);
689  }
690 
691  NNEW(ad,double,neq[1]);
692  NNEW(au,double,(nasym+1)*nzs[2]);
693 
694  if(fread(ad,sizeof(double),neq[1],f1)!=neq[1]){
695  printf("*ERROR in sensitivity reading the diagonal of the stiffness matrix in the .stm-file");
696  exit(0);
697  }
698 
699  if(fread(au,sizeof(double),(nasym+1)*nzs[2],f1)!=(nasym+1)*nzs[2]){
700  printf("*ERROR in sensitivity reading the off-diagonals of the stiffness matrix in the .stm-file");
701  exit(0);
702  }
703 
704  fclose(f1);
705  }
706  }
707 
708  /* loop over all eigenvalues, or, if it is not an eigenvalue sensitivity study,
709  loop over just one value */
710 
711  for(iev=0;iev<nev;iev++){
712 
713  /* for cyclic symmetry calculations only the odd modes are calculated
714  (modes occur in phase-shifted pairs) */
715 
716  if(cyclicsymmetry){
717  if((iev/2)*2!=iev){
718  continue;
719  }
720  mode=iev;
721  noddiam=nm[iev];
722  }
723 
724  /* determining the internal forces and the stiffness coefficients */
725 
726  NNEW(f,double,*neq); /* FAKE */
727 
728  /* needed for nonlinear shape energy */
729 
730  if((iperturb[1]==1)&&(ishapeenergy==1)){
731  NNEW(fint,double,*neq);
732  }
733 
734  /* allocating a field for the stiffness matrix
735  (calculated in results_se and needed in mafillsmse */
736 
737  NNEW(xstiff,double,(long long)27*mi[0]**ne);
738  if(iorientation==1) NNEW(dxstiff,double,(long long)3*27*mi[0]**ne);
739 
740  iout=-1;
741  NNEW(v,double,mt**nk);
742 // memcpy(&v[0],&vold[0],sizeof(double)*mt**nk);
743  if(iperturb[1]==1) memcpy(&v[0],&vold[0],sizeof(double)*mt**nk);
744 
745  NNEW(fn,double,mt**nk); /* FAKE */
746  if(!cyclicsymmetry){
747  NNEW(df,double,nzss);
748  }else{
749  NNEW(df,double,2*nzss);
750  }
751  NNEW(stx,double,6*mi[0]**ne);
752 
753  results_se(co,nk,kon,ipkon,lakon,ne,v,stn,inum,stx,
754  elcon,nelcon,rhcon,nrhcon,alcon,nalcon,alzero,ielmat,
755  ielorien,norien,orab,ntmat_,t0,t1act,ithermal,
756  prestr,iprestr,filab,eme,emn,een,iperturb,
757  f,fn,nactdof,&iout,qa,vold,b,nodeboun,
758  ndirboun,xbounact,nboun,ipompc,
759  nodempc,coefmpc,labmpc,nmpc,nmethod,cam,neq,veold,accold,
760  &bet,&gam,&dtime,&time,ttime,plicon,nplicon,plkcon,nplkcon,
761  xstateini,xstiff,xstate,npmat_,epn,matname,mi,&ielas,
762  &icmd,ncmat_,nstate_,stiini,vini,ikboun,ilboun,ener,enern,
763  emeini,xstaten,eei,enerini,cocon,ncocon,set,nset,istartset,
764  iendset,ialset,nprint,prlab,prset,qfx,qfn,trab,inotr,ntrans,
765  fmpc,nelemload,nload,ikmpc,ilmpc,istep,&iinc,springarea,
766  &reltime,&ne0,xforc,nforc,thicke,shcon,nshcon,
767  sideload,xloadact,xloadold,&icfd,inomat,pslavsurf,pmastsurf,
768  mortar,islavact,cdn,islavnode,nslavnode,ntie,clearini,
769  islavsurf,ielprop,prop,energyini,energy,df,&distmin,
770  &ndesi,nodedesi,sti,nkon,jqs,irows,nactdofinv,
771  &icoordinate,dxstiff,istartdesi,ialdesi,xdesi,
772  &ieigenfrequency,fint,&ishapeenergy);
773 
774  iout=1;SFREE(v);
775 
776  /* storing the design variables per element
777  (including 0 for the unperturbed state) */
778 
779  NNEW(ipoeldi,ITG,*ne);
780  NNEW(ieldi,ITG,2*(istartdesi[ndesi]-1+*ne));
781 
782  FORTRAN(desiperelem,(&ndesi,istartdesi,ialdesi,ipoeldi,ieldi,ne));
783 
784  NNEW(istartelem,ITG,*ne+1);
785  NNEW(ialelem,ITG,istartdesi[ndesi]-1+*ne);
786 
787  FORTRAN(createialelem,(ne,istartelem,ialelem,ipoeldi,ieldi));
788 
789  SFREE(ipoeldi);SFREE(ieldi);
790  RENEW(ialelem,ITG,istartelem[*ne]-1);
791 
792  nmethodl=*nmethod;
793 
794  /* v contains the values dK/dx has to be multiplied with */
795 
796  if(ieigenfrequency==0){
797  NNEW(v,double,mt**nk);
798  memcpy(&v[0],&vold[0],sizeof(double)*mt**nk);
799  }else{
800  if(!cyclicsymmetry){
801  NNEW(v,double,mt**nk);
802  FORTRAN(resultsnoddir,(nk,v,nactdof,&z[iev*neq[1]],ipompc,
803  nodempc,coefmpc,nmpc,mi));
804  }else{
805  NNEW(v,double,2*mt**nk);
806  FORTRAN(resultsnoddir,(nk,v,nactdof,&z[iev*neq[1]],ipompc,
807  nodempc,coefmpc,nmpc,mi));
808  FORTRAN(resultsnoddir,(nk,&v[mt**nk],nactdof,&z[iev*neq[1]+neq[1]/2],ipompc,
809  nodempc,coefmpc,nmpc,mi));
810  }
811 
812  ptime=d[iev];
813  if(ptime>0){ptime=sqrt(ptime)/6.283185308;}else{ptime=0.;}
814 
815  /* for an eigenfrequency objective (K-eigenvalue*M) is
816  taken instead of K (not for ORIENTATION as design
817  variable since the mass does not change with orientation)*/
818 
819  if(icoordinate==1){
820  sigma=d[iev];
821  mass[0]=1;
822  }
823  }
824 
825  /* determining the system matrix and the external forces */
826 
827  mafillsmmain_se(co,nk,kon,ipkon,lakon,ne,nodeboun,
828  ndirboun,xbounact,nboun,
829  ipompc,nodempc,coefmpc,nmpc,nodeforc,ndirforc,xforcact,
830  nforc,nelemload,sideload,xloadact,nload,xbodyact,ipobody,
831  nbody,cgr,nactdof,neq,&nmethodl,
832  ikmpc,ilmpc,ikboun,ilboun,
833  elcon,nelcon,rhcon,nrhcon,alcon,nalcon,alzero,ielmat,
834  ielorien,norien,orab,ntmat_,
835  t0,t1act,ithermal,prestr,iprestr,vold,iperturb,sti,
836  stx,iexpl,plicon,nplicon,plkcon,nplkcon,
837  xstiff,npmat_,&dtime,matname,mi,
838  ncmat_,mass,&stiffness,&buckling,&rhsi,&intscheme,physcon,
839  shcon,nshcon,cocon,ncocon,ttime,&time,istep,&iinc,&coriolis,
840  ibody,xloadold,&reltime,veold,springarea,nstate_,
841  xstateini,xstate,thicke,integerglob,doubleglob,
842  tieset,istartset,iendset,ialset,ntie,&nasym,pslavsurf,
843  pmastsurf,mortar,clearini,ielprop,prop,&ne0,fnext,
844  &distmin,&ndesi,nodedesi,df,&nzss,jqs,irows,
845  &icoordinate,dxstiff,xdesi,istartelem,ialelem,v,&sigma,
846  &cyclicsymmetry,labmpc,ics,cs,mcs,&ieigenfrequency);
847 
848  SFREE(istartelem);SFREE(ialelem);
849 
850  if(iorientation==1) SFREE(dxstiff);
851 
852  /* determining the values and the derivatives of the objective functions */
853 
854  NNEW(g0,double,*nobject);
855  NNEW(dgdx,double,ndesi**nobject);
856  if(icoordinate==1){NNEW(dgdxglob,double,2**nk**nobject);}
857 
858  iout=-1;
859  objectivemain_se(co,nk,kon,ipkon,lakon,ne,v,stn,inum,stx,
860  elcon,nelcon,rhcon,nrhcon,alcon,nalcon,alzero,ielmat,
861  ielorien,norien,orab,ntmat_,t0,t1act,ithermal,
862  prestr,iprestr,filab,eme,emn,een,iperturb,
863  f,fn,nactdof,&iout,qa,vold,nodeboun,
864  ndirboun,xbounact,nboun,ipompc,
865  nodempc,coefmpc,labmpc,nmpc,nmethod,cam,neq,veold,accold,
866  &bet,&gam,&dtime,&time,ttime,plicon,nplicon,plkcon,nplkcon,
867  xstateini,xstiff,xstate,npmat_,epn,matname,mi,&ielas,
868  &icmd,ncmat_,nstate_,stiini,vini,ikboun,ilboun,ener,enern,
869  emeini,xstaten,eei,enerini,cocon,ncocon,set,nset,istartset,
870  iendset,ialset,nprint,prlab,prset,qfx,qfn,trab,inotr,ntrans,
871  fmpc,nelemload,nload,ikmpc,ilmpc,istep,&iinc,springarea,
872  &reltime,&ne0,xforc,nforc,thicke,shcon,nshcon,
873  sideload,xloadact,xloadold,&icfd,inomat,pslavsurf,pmastsurf,
874  mortar,islavact,cdn,islavnode,nslavnode,ntie,clearini,
875  islavsurf,ielprop,prop,energyini,energy,&distmin,
876  &ndesi,nodedesi,nobject,objectset,g0,dgdx,sti,
877  df,nactdofinv,jqs,irows,&idisplacement,nzs,jobnamec,
878  isolver,icol,irow,jq,kode,cs,output,istartdesi,ialdesi,
879  xdesi,orname,&icoordinate,&iev,d,z,au,ad,aub,adb,&cyclicsymmetry,
880  &nzss,&nev,&ishapeenergy,fint,nlabel,&igreen,&nasym,
881  iponoel,inoel,nodedesiinv,dgdxglob);
882  iout=1;
883 
884  SFREE(v);
885 
886  if(icoordinate==1){
887 
888  /* Elimination of mesh-dependency and filling of dgdxglob */
889 
890  NNEW(weightformgrad,double,ndesi);
891 
892  FORTRAN(formgradient,(istartdesi,ialdesi,ipkon,lakon,ipoface,
893  &ndesi,nodedesi,nodface,kon,co,dgdx,nobject,
894  weightformgrad,nodedesiinv,&noregion,objectset,
895  dgdxglob,nk));
896 
897  SFREE(weightformgrad);
898 
899  /* for quadratic elements: interpolation of midnode-sensitivity
900  to the corner nodes */
901 
902  NNEW(xinterpol,double,*nk**nobject);
903  NNEW(nnodes,ITG,*nk);
904 
905  FORTRAN(formgradinterpol,(ipkon,lakon,kon,nobject,dgdxglob,
906  xinterpol,nnodes,ne,nk,nodedesiinv,objectset));
907 
908  SFREE(nnodes);SFREE(xinterpol);
909 
910  /* Filtering of sensitivities */
911 
912  filtermain(co,dgdxglob,nobject,nk,nodedesi,&ndesi,objectset);
913 
914  /* scaling the designnodes being in the transition between
915  the designspace and the non-designspace */
916 
917  transitionmain(co,dgdxglob,nobject,nk,nodedesi,&ndesi,objectset,
918  ipkon,kon,lakon,ipoface,nodface,nodedesiinv);
919 
920  /* createinum is called in order to determine the nodes belonging
921  to elements; this information is needed in frd_se */
922 
923  NNEW(inum,ITG,*nk);
924  FORTRAN(createinum,(ipkon,inum,kon,lakon,nk,ne,&cflag[0],nelemload,
925  nload,nodeboun,nboun,ndirboun,ithermal,co,vold,mi,ielmat));
926 
927  /* calculate projected gradient if:
928  - any constraint functions are defined AND
929  - at least one constraint function is active */
930 
931  if(*nobject>1){
932 
933  /* check if any constraints are active */
934 
935  /* in the field "ipoacti" and the variable "nnlconst" the
936  characteristics of the N-matrix are stored:
937  -nnlconst is the number of nonlinear constraints
938  -in the first nnlconst entries of ipoacti the position of the
939  nonlinear constraints (e.g. mass) is inserted
940  -in the following entries the position of the linear
941  constraints (wall thickness constraints) is stored */
942 
943  NNEW(ipoacti,ITG,*nobject+ndesi);
944 
945  FORTRAN(checkconstraint,(nobject,objectset,g0,&nactive,&nnlconst,
946  ipoacti,&ndesi,dgdxglob,nk,nodedesi));
947 
948  RENEW(ipoacti,ITG,nactive);
949 
950  if(nactive>0){
951 
952  *nobject=*nobject+1;
953  RENEW(dgdxglob,double,2**nk**nobject);
954  RENEW(objectset,char,324**nobject);
955 
956  projectgradmain(nobject,objectset,dgdxglob,g0,&ndesi,nodedesi,
957  nk,isolver,&nactive,&nnlconst,ipoacti);
958 
959  }
960  }
961 
962  for(iobject=0;iobject<*nobject;iobject++){
963 
964  /* storing the sensitivities in the frd-file for visualization
965  and for optimizer */
966 
967  ++*kode;
968 
969  frd_sen(co,nk,stn,inum,nmethod,kode,filab,&ptime,nstate_,
970  istep,
971  &iinc,&mode,&noddiam,description,mi,&ngraph,ne,cs,set,nset,
972  istartset,iendset,ialset,jobnamec,output,
973  dgdxglob,&iobject,objectset,ntrans,inotr,trab,&idesvar,orname,
974  &icoordinate,&inorm,&irand);
975 
976  /* writing the objectives in the dat-file for optimizer */
977 
978  FORTRAN(writeobj,(objectset,&iobject,g0));
979  }
980 
981  SFREE(inum);
982 
983  }
984 
985  SFREE(fn);SFREE(stx);SFREE(f);SFREE(xstiff);SFREE(g0);SFREE(dgdx);
986  SFREE(df);SFREE(dgdxglob);
987 
988  if(*nobject>1){SFREE(ipoacti);}
989 // if(*nobject>0){SFREE(objectset);}
990 
991  } // end loop over nev
992 
993  SFREE(iponoel);SFREE(inoel);SFREE(nodedesiinv);
994 
995  if((iperturb[1]==1)&&(ishapeenergy==1)){SFREE(fint);}
996 
997  if(ieigenfrequency==1){
998  if(!cyclicsymmetry){SFREE(d);SFREE(ad);SFREE(adb);SFREE(au);
999  SFREE(aub);SFREE(z);
1000  }else{
1001  SFREE(d);SFREE(z);SFREE(nm);}
1002  }else if(idisplacement==1){
1003  SFREE(ad);SFREE(au);
1004  }
1005 
1006  SFREE(xbounact);SFREE(xforcact);SFREE(xloadact);SFREE(t1act);SFREE(ampli);
1007  SFREE(xbodyact);SFREE(nactdofinv);
1008  if(*nbody>0) SFREE(ipobody);
1009 
1010  if(ishapeenergy==1){
1011  SFREE(enerini);SFREE(emeini);SFREE(stiini);
1012  }
1013 
1014  SFREE(istartdesi);SFREE(ialdesi);
1015  if(icoordinate==1){
1016  SFREE(nodedesi);SFREE(xdesi);SFREE(ipoface);SFREE(nodface);
1017  }
1018 
1019  SFREE(irows);SFREE(icols);SFREE(jqs);
1020 
1021  *irowp=irow;*enerp=ener;*xstatep=xstate;*ipkonp=ipkon;*lakonp=lakon;
1022  *konp=kon;*ielmatp=ielmat;*ielorienp=ielorien;*objectsetp=objectset;
1023 
1024  (*ttime)+=(*tper);
1025 
1026  return;
1027 }
subroutine desiperelem(ndesi, istartdesi, ialdesi, ipoeldi, ieldi, ne)
Definition: desiperelem.f:21
#define ITGFORMAT
Definition: CalculiX.h:52
subroutine checkconstraint(nobject, objectset, g0, nactive, nnlconst, ipoacti, ndesi, dgdxglob, nk, nodedesi)
Definition: checkconstraint.f:21
void transitionmain(double *co, double *dgdxglob, ITG *nobject, ITG *nk, ITG *nodedesi, ITG *ndesi, char *objectset, ITG *ipkon, ITG *kon, char *lakon, ITG *ipoface, ITG *nodface, ITG *nodedesiinv)
Definition: transitionmain.c:49
void mastructse(ITG *kon, ITG *ipkon, char *lakon, ITG *ne, ITG *ipompc, ITG *nodempc, ITG *nmpc, ITG *nactdof, ITG *icols, ITG *jqs, ITG **mast1p, ITG **irowsp, ITG *ipointer, ITG *nzss, ITG *mi, ITG *mortar, ITG *nodedesi, ITG *ndesi, ITG *icoordinate, ITG *ielorien, ITG *istartdesi, ITG *ialdesi)
Definition: mastructse.c:27
subroutine smalldist(co, distmin, lakon, ipkon, kon, ne)
Definition: smalldist.f:20
subroutine createialdesi(ndesi, nodedesi, iponoel, inoel, istartdesi, ialdesi, lakon, ipkon, kon, nodedesiinv, icoordinate, noregion)
Definition: createialdesi.f:22
subroutine df(x, u, uprime, rpar, nev)
Definition: subspace.f:133
subroutine formgradinterpol(ipkon, lakon, kon, nobject, dgdxglob, xinterpol, nnodes, ne, nk, nodedesiinv, objectset)
Definition: formgradinterpol.f:21
subroutine resultsnoddir(nk, v, nactdof, b, ipompc, nodempc, coefmpc, nmpc, mi)
Definition: resultsnoddir.f:21
void mafillsmmain_se(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, ITG *nmpc, ITG *nodeforc, ITG *ndirforc, double *xforc, ITG *nforc, ITG *nelemload, char *sideload, double *xload, ITG *nload, double *xbody, ITG *ipobody, ITG *nbody, double *cgr, ITG *nactdof, ITG *neq, ITG *nmethod, ITG *ikmpc, ITG *ilmpc, ITG *ikboun, ITG *ilboun, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, double *prestr, ITG *iprestr, double *vold, ITG *iperturb, double *sti, double *stx, ITG *iexpl, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstiff, ITG *npmat_, double *dtime, char *matname, ITG *mi, ITG *ncmat_, ITG *mass, ITG *stiffness, ITG *buckling, ITG *rhs, ITG *intscheme, double *physcon, double *shcon, ITG *nshcon, double *cocon, ITG *ncocon, double *ttime, double *time, ITG *istep, ITG *kinc, ITG *coriolis, ITG *ibody, double *xloadold, double *reltime, double *veold, double *springarea, ITG *nstate_, double *xstateini, double *xstate, double *thicke, ITG *integerglob, double *doubleglob, char *tieset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *ntie, ITG *nasym, double *pslavsurf, double *pmastsurf, ITG *mortar, double *clearini, ITG *ielprop, double *prop, ITG *ne0, double *fnext, double *distmin, ITG *ndesi, ITG *nodedesi, double *df, ITG *nzss, ITG *jqs, ITG *irows, ITG *icoordinate, double *dxstiff, double *xdesi, ITG *istartelem, ITG *ialelem, double *v, double *sigma, ITG *cyclicsymmetry, char *labmpc, ITG *ics, double *cs, ITG *mcs, ITG *ieigenfrequency)
Definition: mafillsmmain_se.c:48
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
subroutine elementpernode(iponoel, inoel, lakon, ipkon, kon, ne, inoelsize)
Definition: elementpernode.f:21
ITG strcmp1(const char *s1, const char *s2)
Definition: strcmp1.c:24
subroutine normalsonsurface_se(ipkon, kon, lakon, extnor, co, nk, ipoface, nodface, nactdof, mi, nodedesiinv, noregion)
Definition: normalsonsurface_se.f:21
void results_se(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, double *v, double *stn, ITG *inum, double *stx, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, double *prestr, ITG *iprestr, char *filab, double *eme, double *emn, double *een, ITG *iperturb, double *f, double *fn, ITG *nactdof, ITG *iout, double *qa, double *vold, double *b, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, char *labmpc, ITG *nmpc, ITG *nmethod, double *vmax, ITG *neq, double *veold, double *accold, double *beta, double *gamma, double *dtime, double *time, double *ttime, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstateini, double *xstiff, double *xstate, ITG *npmat_, double *epl, char *matname, ITG *mi, ITG *ielas, ITG *icmd, ITG *ncmat_, ITG *nstate_, double *stiini, double *vini, ITG *ikboun, ITG *ilboun, double *ener, double *enern, double *emeini, double *xstaten, double *eei, double *enerini, double *cocon, ITG *ncocon, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nprint, char *prlab, char *prset, double *qfx, double *qfn, double *trab, ITG *inotr, ITG *ntrans, double *fmpc, ITG *nelemload, ITG *nload, ITG *ikmpc, ITG *ilmpc, ITG *istep, ITG *iinc, double *springarea, double *reltime, ITG *ne0, double *xforc, ITG *nforc, double *thicke, double *shcon, ITG *nshcon, char *sideload, double *xload, double *xloadold, ITG *icfd, ITG *inomat, double *pslavsurf, double *pmastsurf, ITG *mortar, ITG *islavact, double *cdn, ITG *islavnode, ITG *nslavnode, ITG *ntie, double *clearini, ITG *islavsurf, ITG *ielprop, double *prop, double *energyini, double *energy, double *df, double *distmin, ITG *ndesi, ITG *nodedesi, double *sti, ITG *nkon, ITG *jqs, ITG *irows, ITG *nactdofinv, ITG *icoordinate, double *dxstiff, ITG *istartdesi, ITG *ialdesi, double *xdesi, ITG *ieigenfrequency, double *fint, ITG *ishapeenergy)
Definition: results_se.c:44
subroutine findsurface_se(nodface, ipoface, ne, ipkon, lakon, kon, konfa, ipkonfa, nk, lakonfa, nsurfs)
Definition: findsurface_se.f:21
subroutine tempload(xforcold, xforc, xforcact, iamforc, nforc, xloadold, xload, xloadact, iamload, nload, ibody, xbody, nbody, xbodyold, xbodyact, t1old, t1, t1act, iamt1, nk, amta, namta, nam, ampli, time, reltime, ttime, dtime, ithermal, nmethod, xbounold, xboun, xbounact, iamboun, nboun, nodeboun, ndirboun, nodeforc, ndirforc, istep, iinc, co, vold, itg, ntg, amname, ikboun, ilboun, nelemload, sideload, mi, ntrans, trab, inotr, veold, integerglob, doubleglob, tieset, istartset, iendset, ialset, ntie, nmpc, ipompc, ikmpc, ilmpc, nodempc, coefmpc, ipobody, iponoel, inoel)
Definition: tempload.f:29
subroutine writeobj(objectset, iobject, g0)
Definition: writeobj.f:20
subroutine stop()
Definition: stop.f:20
subroutine writedesi(norien, orname)
Definition: writedesi.f:20
void frd_sen(double *co, ITG *nk, double *dstn, ITG *inum, ITG *nmethod, ITG *kode, char *filab, double *time, ITG *nstate_, ITG *istep, ITG *iinc, ITG *mode, ITG *noddiam, char *description, ITG *mi, ITG *ngraph, ITG *ne, double *cs, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *jobnamec, char *output, double *v, ITG *iobject, char *objectset, ITG *ntrans, ITG *inotr, double *trab, ITG *idesvar, char *orname, ITG *icoordinate, ITG *inorm, ITG *irand)
Definition: frd_sen.c:27
subroutine normalsforequ_se(nk, co, iponoelfa, inoelfa, konfa, ipkonfa, lakonfa, ne, iponor, xnor, nodedesiinv, jobnamef)
Definition: normalsforequ_se.f:21
subroutine elementperorien(ipoorel, iorel, ielorien, ne, mi)
Definition: elementperorien.f:20
void projectgradmain(ITG *nobject, char *objectset, double *dgdxglob, double *g0, ITG *ndesi, ITG *nodedesi, ITG *nk, ITG *isolver, ITG *nactive, ITG *nnlconst, ITG *ipoacti)
#define RENEW(a, b, c)
Definition: CalculiX.h:40
void randomfieldmain(ITG *kon, ITG *ipkon, char *lakon, ITG *ne, ITG *nmpc, ITG *nactdof, ITG *mi, ITG *nodedesi, ITG *ndesi, ITG *istartdesi, ITG *ialdesi, double *co, double *physcon, ITG *isolver, ITG *ntrans, ITG *nk, ITG *inotr, double *trab, char *jobnamec, ITG *nboun, double *cs, ITG *mcs, ITG *inum, ITG *nmethod, ITG *kode, char *filab, ITG *nstate_, ITG *istep, char *description, char *set, ITG *nset, ITG *iendset, char *output, ITG *istartset, ITG *ialset, double *extnor)
#define SFREE(a)
Definition: CalculiX.h:41
subroutine gennactdofinv(nactdof, nactdofinv, nk, mi, nodorig, ipkon, lakon, kon, ne)
Definition: gennactdofinv.f:21
void objectivemain_se(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, double *v, double *stn, ITG *inum, double *stx, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, double *prestr, ITG *iprestr, char *filab, double *eme, double *emn, double *een, ITG *iperturb, double *f, double *fn, ITG *nactdof, ITG *iout, double *qa, double *vold, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, char *labmpc, ITG *nmpc, ITG *nmethod, double *cam, ITG *neq, double *veold, double *accold, double *bet, double *gam, double *dtime, double *time, double *ttime, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstateini, double *xstiff, double *xstate, ITG *npmat_, double *epn, char *matname, ITG *mi, ITG *ielas, ITG *icmd, ITG *ncmat_, ITG *nstate_, double *stiini, double *vini, ITG *ikboun, ITG *ilboun, double *ener, double *enern, double *emeini, double *xstaten, double *eei, double *enerini, double *cocon, ITG *ncocon, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nprint, char *prlab, char *prset, double *qfx, double *qfn, double *trab, ITG *inotr, ITG *ntrans, double *fmpc, ITG *nelemload, ITG *nload, ITG *ikmpc, ITG *ilmpc, ITG *istep, ITG *iinc, double *springarea, double *reltime, ITG *ne0, double *xforc, ITG *nforc, double *thicke, double *shcon, ITG *nshcon, char *sideload, double *xload, double *xloadold, ITG *icfd, ITG *inomat, double *pslavsurf, double *pmastsurf, ITG *mortar, ITG *islavact, double *cdn, ITG *islavnode, ITG *nslavnode, ITG *ntie, double *clearini, ITG *islavsurf, ITG *ielprop, double *prop, double *energyini, double *energy, double *distmin, ITG *ndesi, ITG *nodedesi, ITG *nobject, char *objectset, double *g0, double *dgdx, double *sti, double *df, ITG *nactdofinv, ITG *jqs, ITG *irows, ITG *idisplacement, ITG *nzs, char *jobnamec, ITG *isolver, ITG *icol, ITG *irow, ITG *jq, ITG *kode, double *cs, char *output, ITG *istartdesi, ITG *ialdesi, double *xdesi, char *orname, ITG *icoordinate, ITG *iev, double *d, double *z, double *au, double *ad, double *aub, double *adb, ITG *cyclicsymmetry, ITG *nzss, ITG *nev, ITG *ishapeenergy, double *fint, ITG *nlabel, ITG *igreen, ITG *nasym, ITG *iponoel, ITG *inoel, ITG *nodedesiinv, double *dgdxglob)
Definition: objectivemain_se.c:53
void filtermain(double *co, double *dgdxglob, ITG *nobject, ITG *nk, ITG *nodedesi, ITG *ndesi, char *objectset)
Definition: filtermain.c:50
static double * f1
Definition: objectivemain_se.c:47
subroutine createialelem(ne, istartelem, ialelem, ipoeldi, ieldi)
Definition: createialelem.f:20
void getglobalresults(char *jobnamec, ITG **integerglobp, double **doubleglobp, ITG *nboun, ITG *iamboun, double *xboun, ITG *nload, char *sideload, ITG *iamload, ITG *iglob, ITG *nforc, ITG *iamforc, double *xforc, ITG *ithermal, ITG *nk, double *t1, ITG *iamt1)
Definition: getglobalresults.c:29
subroutine facepernode(iponoelfa, inoelfa, lakonfa, ipkonfa, konfa, nsurfs, inoelsize)
Definition: facepernode.f:21
subroutine createinum(ipkon, inum, kon, lakon, nk, ne, cflag, nelemload, nload, nodeboun, nboun, ndirboun, ithermal, co, vold, mi, ielmat)
Definition: createinum.f:21
subroutine formgradient(istartdesi, ialdesi, ipkon, lakon, ipoface, ndesi, nodedesi, nodface, kon, co, dgdx, nobject, weightformgrad, nodedesiinv, noregion, objectset, dgdxglob, nk)
Definition: formgradient.f:23
#define ITG
Definition: CalculiX.h:51
#define NNEW(a, b, c)
Definition: CalculiX.h:39
subroutine bodyforce(cbody, ibody, ipobody, nbody, set, istartset, iendset, ialset, inewton, nset, ifreebody, k)
Definition: bodyforce.f:21
subroutine getdesiinfo(set, istartset, iendset, ialset, nset, mi, nactdof, ndesi, nodedesi, ntie, tieset, itmp, nmpc, nodempc, ipompc, nodedesiinv, iponoel, inoel, lakon, ipkon, kon, noregion, ipoface, nodface, nk)
Definition: getdesiinfo.f:23

◆ sensitivity_out()

void sensitivity_out ( char *  jobnamec,
double *  dgdxtotglob,
ITG neq,
ITG nobject,
double *  g0 
)
25  {
26 
27  char sensitivities[132]="",nominal[132]="";
28 
29  ITG i=0,iobject=0;
30 
31  FILE *f1;
32 
33  /* writing the sensitivities in the sen-file for optimizer */
34 
35  strcpy(sensitivities,jobnamec);
36  strcat(sensitivities,".sen");
37 
38  if((f1=fopen(sensitivities,"w"))==NULL){
39  printf("*ERROR in sensitivity: cannot open sensitivity vector file for writing...");
40 
41  exit(0);
42  }
43 
44  /* storing the sensitivity vectors */
45 
46  fprintf(f1,"---------------------------------- \n");
47  fprintf(f1,"Objective \n");
48  fprintf(f1,"---------------------------------- \n");
49 
50  for(i=0;i<neq[1];i++){
51  for(iobject=0;iobject<*nobject;iobject++){
52  fprintf(f1,"%12.5E",(double)dgdxglob[3+5*i+(5*neq[1]+2)*iobject]);
53  fprintf(f1,"; ");
54  }
55  fprintf(f1,"\n");
56  }
57 
58  fclose(f1);
59 
60  /* writing the nominal values in the nom-file for optimizer */
61 
62  strcpy(nominal,jobnamec);
63  strcat(nominal,".nom");
64 
65  if((f1=fopen(nominal,"w"))==NULL){
66  printf("*ERROR in sensitivity: cannot open sensitivity vector file for writing...");
67 
68  exit(0);
69  }
70 
71  /* storing the sensitivity vectors */
72 
73  fprintf(f1,"---------------------------------- \n");
74  fprintf(f1,"Objective \n");
75  fprintf(f1,"---------------------------------- \n");
76 
77  for(iobject=0;iobject<*nobject;iobject++){
78  fprintf(f1,"%12.5E",(double)g0[iobject]);
79  fprintf(f1,"; ");
80  }
81  fprintf(f1,"\n");
82 
83  fclose(f1);
84 
85  return;
86 
87 }
static double * f1
Definition: objectivemain_se.c:47
#define ITG
Definition: CalculiX.h:51

◆ spooles()

void spooles ( double *  ad,
double *  au,
double *  adb,
double *  aub,
double *  sigma,
double *  b,
ITG icol,
ITG irow,
ITG neq,
ITG nzs,
ITG symmtryflag,
ITG inputformat,
ITG nzs3 
)

◆ steadystate()

void steadystate ( double **  co,
ITG nk,
ITG **  kon,
ITG **  ipkon,
char **  lakon,
ITG ne,
ITG **  nodeboun,
ITG **  ndirboun,
double **  xboun,
ITG nboun,
ITG **  ipompcp,
ITG **  nodempcp,
double **  coefmpcp,
char **  labmpcp,
ITG nmpc,
ITG nodeforc,
ITG ndirforc,
double *  xforc,
ITG nforc,
ITG nelemload,
char *  sideload,
double *  xload,
ITG nload,
ITG **  nactdof,
ITG neq,
ITG nzl,
ITG icol,
ITG irow,
ITG nmethod,
ITG **  ikmpcp,
ITG **  ilmpcp,
ITG **  ikboun,
ITG **  ilboun,
double *  elcon,
ITG nelcon,
double *  rhcon,
ITG nrhcon,
double *  cocon,
ITG ncocon,
double *  alcon,
ITG nalcon,
double *  alzero,
ITG **  ielmat,
ITG **  ielorien,
ITG norien,
double *  orab,
ITG ntmat_,
double **  t0,
double **  t1,
ITG ithermal,
double *  prestr,
ITG iprestr,
double **  voldp,
ITG iperturb,
double *  sti,
ITG nzs,
double *  timepar,
double *  xmodal,
double **  veoldp,
char *  amname,
double *  amta,
ITG namta,
ITG nam,
ITG iamforc,
ITG iamload,
ITG **  iamt1,
ITG jout,
ITG kode,
char *  filab,
double **  emep,
double *  xforcold,
double *  xloadold,
double **  t1old,
ITG **  iamboun,
double **  xbounold,
ITG iexpl,
double *  plicon,
ITG nplicon,
double *  plkcon,
ITG nplkcon,
double *  xstate,
ITG npmat_,
char *  matname,
ITG mi,
ITG ncmat_,
ITG nstate_,
double **  enerp,
char *  jobnamec,
double *  ttime,
char *  set,
ITG nset,
ITG istartset,
ITG iendset,
ITG ialset,
ITG nprint,
char *  prlab,
char *  prset,
ITG nener,
double *  trab,
ITG **  inotr,
ITG ntrans,
double **  fmpcp,
char *  cbody,
ITG ibody,
double *  xbody,
ITG nbody,
double *  xbodyold,
ITG istep,
ITG isolver,
ITG jq,
char *  output,
ITG mcs,
ITG nkon,
ITG ics,
double *  cs,
ITG mpcend,
double *  ctrl,
ITG ikforc,
ITG ilforc,
double *  thicke,
ITG nmat,
char *  typeboun,
ITG ielprop,
double *  prop,
char *  orname 
)
70  {
71 
72  char fneig[132]="",description[13]=" ",*lakon=NULL,*labmpc=NULL,
73  *labmpcold=NULL,cflag[1]=" ";
74 
75  ITG nev,i,j,k, *inum=NULL,*ipobody=NULL,inewton=0,nsectors,im,
76  iinc=0,l,iout,ielas,icmd,iprescribedboundary,ndata,nmd,nevd,
77  ndatatot,*iphaseforc=NULL,*iphaseload=NULL,*iphaseboun=NULL,
78  *isave=NULL,nfour,ii,ir,ic,mode,noddiam=-1,*nm=NULL,*islavact=NULL,
79  *kon=NULL,*ipkon=NULL,*ielmat=NULL,*ielorien=NULL,*inotr=NULL,
80  *nodeboun=NULL,*ndirboun=NULL,*iamboun=NULL,*ikboun=NULL,jj,
81  *ilboun=NULL,*nactdof=NULL,*ipompc=NULL,*nodempc=NULL,*ikmpc=NULL,
82  *ilmpc=NULL,*ipompcold=NULL,*nodempcold=NULL,*ikmpcold=NULL,
83  *ilmpcold=NULL,nmpcold,mpcendold,kflag=2,*iamt1=NULL,ifreebody,
84  *itg=NULL,ntg=0,symmetryflag=0,inputformat=0,dashpot,nrhs=1,
85  *ipiv=NULL,info,nev2,ngraph=1,nkg,neg,iflag=1,idummy=1,imax,
86  nzse[3],mt=mi[1]+1,*ikactmech=NULL,nactmech,id,nasym=0,
87  *imddof=NULL,nmddof,*imdnode=NULL,nmdnode,*imdboun=NULL,nmdboun,
88  *imdmpc=NULL,nmdmpc,*izdof=NULL,nzdof,cyclicsymmetry,mortar=0,
89  *ikactmechr=NULL,*ikactmechi=NULL,nactmechr,nactmechi,intpointvar,
90  iforc,iload,ne0,*iponoel=NULL,*inoel=NULL,*imdelem=NULL,
91  nmdelem,*integerglob=NULL,*nshcon=NULL,nherm,icfd=0,*inomat=NULL,
92  *islavnode=NULL,*nslavnode=NULL,*islavsurf=NULL,iit=-1,inoelsize,
93  network=0;
94 
95  long long i2;
96 
97  double *d=NULL, *z=NULL,*stiini=NULL,*vini=NULL,*freqnh=NULL,
98  *xforcact=NULL, *xloadact=NULL,y,*fr=NULL,*fi=NULL,*cc=NULL,
99  *t1act=NULL,*ampli=NULL, *aa=NULL,*bb=NULL,*vr=NULL,*vi=NULL,
100  *stn=NULL,*stx=NULL,*een=NULL,*adb=NULL,*xstiff=NULL,ptime,
101  *aub=NULL,*bjr=NULL, *bji=NULL,*xbodyr=NULL,*cdn=NULL,
102  *f=NULL, *fn=NULL, *xbounact=NULL,*epn=NULL,*xstateini=NULL,
103  *enern=NULL,*xstaten=NULL,*eei=NULL,*enerini=NULL,*qfn=NULL,
104  *qfx=NULL, *xbodyact=NULL, *cgr=NULL, *au=NULL,*xbodyi=NULL,
105  time,dtime,reltime,*co=NULL,*xboun=NULL,*xbounold=NULL,
106  physcon[1],qa[4],cam[5],accold[1],bet,gam,*emn=NULL,timem,
107  *ad=NULL,sigma=0.,alpham,betam,*fnr=NULL,*fni=NULL,*emeini=NULL,
108  fmin,fmax,bias,*freq=NULL,*xforcr=NULL,dd,pi,vreal,constant,
109  *xforci=NULL,*xloadr=NULL,*xloadi=NULL,*xbounr=NULL,*xbouni=NULL,
110  *br=NULL,*bi=NULL,*ubr=NULL,*ubi=NULL,*mubr=NULL,*mubi=NULL,
111  *wsave=NULL,*r=NULL,*xbounacttime=NULL,*btot=NULL,breal,tmin,tmax,
112  *vold=NULL,*eme=NULL,*ener=NULL,*coefmpc=NULL,*fmpc=NULL,
113  *coefmpcold=NULL,*t0=NULL,*t1=NULL,*t1old=NULL,*adc=NULL,*auc=NULL,
114  *am=NULL,*bm=NULL,*zc=NULL,*e=NULL,*stnr=NULL,*stni=NULL,
115  *vmax=NULL,*stnmax=NULL,*va=NULL,*vp=NULL,*fric=NULL,*springarea=NULL,
116  *stna=NULL,*stnp=NULL,*bp=NULL,*eenmax=NULL,*clearini=NULL,
117  *doubleglob=NULL,*shcon=NULL,*veold=NULL,*xmr=NULL,*xmi=NULL,*eig=NULL,
118  *ax=NULL,*bx=NULL,*pslavsurf=NULL,*pmastsurf=NULL,xnull=0.,
119  *cdnr=NULL,*cdni=NULL,*tinc,*tper,*energyini=NULL,*energy=NULL;
120 
121  /* dummy arguments for the call of expand*/
122 
123  char* tieset=NULL;
124  ITG *jqe=NULL,*icole=NULL,*irowe=NULL,ntie=0;
125  double *adbe=NULL,*aube=NULL;
126 
127  FILE *f1;
128 
129  ITG *ipneigh=NULL,*neigh=NULL;
130 
131 #ifdef SGI
132  ITG token;
133 #endif
134 
135  co=*cop;kon=*konp;ipkon=*ipkonp;lakon=*lakonp;ielmat=*ielmatp;
136  ielorien=*ielorienp;inotr=*inotrp;nodeboun=*nodebounp;
137  ndirboun=*ndirbounp;iamboun=*iambounp;xboun=*xbounp;veold=*veoldp;
138  xbounold=*xbounoldp;ikboun=*ikbounp;ilboun=*ilbounp;nactdof=*nactdofp;
139  vold=*voldp;eme=*emep;ener=*enerp;ipompc=*ipompcp;nodempc=*nodempcp;
140  coefmpc=*coefmpcp;labmpc=*labmpcp;ikmpc=*ikmpcp;ilmpc=*ilmpcp;
141  fmpc=*fmpcp;iamt1=*iamt1p;t0=*t0p;t1=*t1p;t1old=*t1oldp;
142 
143  tinc=&timepar[0];
144  tper=&timepar[1];
145 
146  pi=4.*atan(1.);
147  iout=2;
148 
149  alpham=xmodal[0];
150  betam=xmodal[1];
151 
152  fmin=2.*pi*xmodal[2];
153  fmax=2.*pi*xmodal[3];
154  ndata=floor(xmodal[4]);
155  bias=xmodal[5];
156  nfour=floor(xmodal[6]);
157  if(nfour>0){
158  tmin=xmodal[7];
159  tmax=xmodal[8];
160  }
161 
162  /* determining nzl */
163 
164  *nzl=0;
165  for(i=neq[1];i>0;i--){
166  if(icol[i-1]>0){
167  *nzl=i;
168  break;
169  }
170  }
171 
172  /* opening the eigenvalue file and checking for cyclic symmetry */
173 
174  strcpy(fneig,jobnamec);
175  strcat(fneig,".eig");
176 
177  if((f1=fopen(fneig,"rb"))==NULL){
178  printf(" *ERROR in steadystate: cannot open eigenvalue file for reading");
179  exit(0);
180  }
181 
182  if(fread(&cyclicsymmetry,sizeof(ITG),1,f1)!=1){
183  printf(" *ERROR in steadystate reading the cyclic symmetry flag in the eigenvalue file");
184  printf(" *INFO in steadystate: if there are problems reading the .eig file this may be due to:\n");
185  printf(" 1) the nonexistence of the .eig file\n");
186  printf(" 2) other boundary conditions than in the input deck\n");
187  printf(" which created the .eig file\n\n");
188  exit(0);
189  }
190 
191  if(fread(&nherm,sizeof(ITG),1,f1)!=1){
192  printf(" *ERROR in steadystate reading the Hermitian flag in the eigenvalue file");
193  printf(" *INFO in steadystate: if there are problems reading the .eig file this may be due to:\n");
194  printf(" 1) the nonexistence of the .eig file\n");
195  printf(" 2) other boundary conditions than in the input deck\n");
196  printf(" which created the .eig file\n\n");
197  exit(0);
198  }
199 
200  /* creating imddof containing the degrees of freedom
201  retained by the user and imdnode containing the nodes */
202 
203  nmddof=0;nmdnode=0;nmdboun=0;nmdmpc=0;nmdelem=0;
204 
205  NNEW(imddof,ITG,*nk*3);
206  NNEW(imdnode,ITG,*nk);
207  NNEW(imdboun,ITG,*nboun);
208  NNEW(imdmpc,ITG,*nmpc);
209  FORTRAN(createmddof,(imddof,&nmddof,istartset,iendset,
210  ialset,nactdof,ithermal,mi,imdnode,&nmdnode,
211  ikmpc,ilmpc,ipompc,nodempc,nmpc,
212  imdmpc,&nmdmpc,imdboun,&nmdboun,ikboun,
213  nboun,nset,&ntie,tieset,set,lakon,kon,ipkon,labmpc,
214  ilboun,filab,prlab,prset,nprint,ne,&cyclicsymmetry));
215 
216  /* if results are requested in too many nodes, it is faster to
217  calculate the results in all nodes */
218 
219  if((nmdnode>*nk/2)&&(!cyclicsymmetry)){
220  nmdnode=0;nmddof=0;nmdboun=0;nmdmpc=0;
221  }
222 
223  if(nmdnode!=0){
224  if(!cyclicsymmetry){
225  for(i=0;i<*nload;i++){
226  iload=i+1;
227  FORTRAN(addimdnodedload,(nelemload,sideload,ipkon,kon,lakon,
228  &iload,imdnode,&nmdnode,ikmpc,ilmpc,ipompc,nodempc,nmpc,
229  imddof,&nmddof,nactdof,mi,imdmpc,&nmdmpc,imdboun,&nmdboun,
230  ikboun,nboun,ilboun,ithermal));
231  }
232 
233  for(i=0;i<*nforc;i++){
234  iforc=i+1;
235  FORTRAN(addimdnodecload,(nodeforc,&iforc,imdnode,&nmdnode,xforc,
236  ikmpc,ilmpc,ipompc,nodempc,nmpc,imddof,&nmddof,
237  nactdof,mi,imdmpc,&nmdmpc,imdboun,&nmdboun,
238  ikboun,nboun,ilboun,ithermal));
239  }
240  }
241 
242  /* determining the elements belonging to a given node */
243 
244  NNEW(iponoel,ITG,*nk);
245  NNEW(inoel,ITG,2**nkon);
246  FORTRAN(elementpernode,(iponoel,inoel,lakon,ipkon,kon,ne,&inoelsize));
247  NNEW(imdelem,ITG,*ne);
248 
249  /* storing the elements in which integration point results
250  are needed; storing the nodes which are needed to
251  calculate these results */
252 
253  FORTRAN(createmdelem,(imdnode,&nmdnode,xforc,
254  ikmpc,ilmpc,ipompc,nodempc,nmpc,imddof,&nmddof,
255  nactdof,mi,imdmpc,&nmdmpc,imdboun,&nmdboun,
256  ikboun,nboun,ilboun,ithermal,imdelem,&nmdelem,
257  iponoel,inoel,prlab,prset,nprint,lakon,set,nset,
258  ialset,ipkon,kon,istartset,iendset,nforc,
259  ikforc,ilforc));
260 
261  RENEW(imdelem,ITG,nmdelem);
262  SFREE(iponoel);SFREE(inoel);
263  }
264 
265  /* if results are requested in too many nodes, it is faster to
266  calculate the results in all nodes */
267 
268  if((nmdnode>*nk/2)&&(!cyclicsymmetry)){
269  nmdnode=0;nmddof=0;nmdboun=0;nmdmpc=0;
270  }
271 
272  /* subtracting 1 to comply with the C-convention */
273 
274  for(i=0;i<nmddof;i++){imddof[i]-=1;}
275 
276  RENEW(imddof,ITG,nmddof);
277  RENEW(imdnode,ITG,nmdnode);
278  RENEW(imdboun,ITG,nmdboun);
279  RENEW(imdmpc,ITG,nmdmpc);
280 
281  nsectors=1;
282 
283  if(!cyclicsymmetry){
284 
285  nkg=*nk;
286  neg=*ne;
287 
288  if(fread(&nev,sizeof(ITG),1,f1)!=1){
289  printf(" *ERROR in steadystate reading the number of eigenvalues in the eigenvalue file");
290  printf(" *INFO in steadystate: if there are problems reading the .eig file this may be due to:\n");
291  printf(" 1) the nonexistence of the .eig file\n");
292  printf(" 2) other boundary conditions than in the input deck\n");
293  printf(" which created the .eig file\n\n");
294  exit(0);
295  }
296 
297  if(nherm==1){
298  NNEW(d,double,nev);
299  if(fread(d,sizeof(double),nev,f1)!=nev){
300  printf(" *ERROR in steadystate reading the eigenvalues in the eigenvalue file...");
301  printf(" *INFO in steadystate: if there are problems reading the .eig file this may be due to:\n");
302  printf(" 1) the nonexistence of the .eig file\n");
303  printf(" 2) other boundary conditions than in the input deck\n");
304  printf(" which created the .eig file\n\n");
305  exit(0);
306  }
307 
308  for(i=0;i<nev;i++){
309  if(d[i]<0){d[i]=0.;}
310  }
311  }else{
312  NNEW(d,double,2*nev);
313  if(fread(d,sizeof(double),2*nev,f1)!=2*nev){
314  printf(" *ERROR in steadystate reading the eigenvalues in the eigenvalue file...");
315  printf(" *INFO in steadystate: if there are problems reading the .eig file this may be due to:\n");
316  printf(" 1) the nonexistence of the .eig file\n");
317  printf(" 2) other boundary conditions than in the input deck\n");
318  printf(" which created the .eig file\n\n");
319  exit(0);
320  }
321  }
322 
323  NNEW(ad,double,neq[1]);
324  NNEW(adb,double,neq[1]);
325  NNEW(au,double,nzs[2]);
326  NNEW(aub,double,nzs[1]);
327 
328  /* reading the stiffness matrix */
329 
330  if(fread(ad,sizeof(double),neq[1],f1)!=neq[1]){
331  printf(" *ERROR in steadystate reading the diagonal of the stiffness matrix in the eigenvalue file");
332  printf(" *INFO in steadystate: if there are problems reading the .eig file this may be due to:\n");
333  printf(" 1) the nonexistence of the .eig file\n");
334  printf(" 2) other boundary conditions than in the input deck\n");
335  printf(" which created the .eig file\n\n");
336  exit(0);
337  }
338 
339  if(fread(au,sizeof(double),nzs[2],f1)!=nzs[2]){
340  printf(" *ERROR in steadystate reading the off-diagonals of the stiffness matrix in the eigenvalue file");
341  printf(" *INFO in steadystate: if there are problems reading the .eig file this may be due to:\n");
342  printf(" 1) the nonexistence of the .eig file\n");
343  printf(" 2) other boundary conditions than in the input deck\n");
344  printf(" which created the .eig file\n\n");
345  exit(0);
346  }
347 
348  /* reading the mass matrix */
349 
350  if(fread(adb,sizeof(double),neq[1],f1)!=neq[1]){
351  printf(" *ERROR in steadystate reading the diagonal of the mass matrix in the eigenvalue file");
352  printf(" *INFO in steadystate: if there are problems reading the .eig file this may be due to:\n");
353  printf(" 1) the nonexistence of the .eig file\n");
354  printf(" 2) other boundary conditions than in the input deck\n");
355  printf(" which created the .eig file\n\n");
356  exit(0);
357  }
358 
359  if(fread(aub,sizeof(double),nzs[1],f1)!=nzs[1]){
360  printf(" *ERROR in steadystate reading the off-diagonals of the mass matrix in the eigenvalue file");
361  printf(" *INFO in steadystate: if there are problems reading the .eig file this may be due to:\n");
362  printf(" 1) the nonexistence of the .eig file\n");
363  printf(" 2) other boundary conditions than in the input deck\n");
364  printf(" which created the .eig file\n\n");
365  exit(0);
366  }
367 
368  /* reading the eigenvectors */
369 
370  if(nherm==1){
371  NNEW(z,double,neq[1]*nev);
372  if(fread(z,sizeof(double),neq[1]*nev,f1)!=neq[1]*nev){
373  printf(" *ERROR in complexfreq reading the eigenvectors in the eigenvalue file...");
374  printf(" *INFO in steadystate: if there are problems reading the .eig file this may be due to:\n");
375  printf(" 1) the nonexistence of the .eig file\n");
376  printf(" 2) other boundary conditions than in the input deck\n");
377  printf(" which created the .eig file\n\n");
378  exit(0);
379  }
380  }else{
381  NNEW(z,double,2*neq[1]*nev);
382  if(fread(z,sizeof(double),2*neq[1]*nev,f1)!=2*neq[1]*nev){
383  printf(" *ERROR in complexfreq reading the eigenvectors in the eigenvalue file...");
384  printf(" *INFO in steadystate: if there are problems reading the .eig file this may be due to:\n");
385  printf(" 1) the nonexistence of the .eig file\n");
386  printf(" 2) other boundary conditions than in the input deck\n");
387  printf(" which created the .eig file\n\n");
388  exit(0);
389  }
390  }
391 
392  /* reading the orthogonality matrices */
393 
394  if(nherm!=1){
395  NNEW(xmr,double,nev*nev);
396  NNEW(xmi,double,nev*nev);
397  if(fread(xmr,sizeof(double),nev*nev,f1)!=nev*nev){
398  printf(" *ERROR in steadystate reading the real orthogonality matrix to the eigenvalue file...");
399  printf(" *INFO in steadystate: if there are problems reading the .eig file this may be due to:\n");
400  printf(" 1) the nonexistence of the .eig file\n");
401  printf(" 2) other boundary conditions than in the input deck\n");
402  printf(" which created the .eig file\n\n");
403  exit(0);
404  }
405 
406  if(fread(xmi,sizeof(double),nev*nev,f1)!=nev*nev){
407  printf(" *ERROR in steadystate reading the imaginary orthogonality matrix to the eigenvalue file...");
408  printf(" *INFO in steadystate: if there are problems reading the .eig file this may be due to:\n");
409  printf(" 1) the nonexistence of the .eig file\n");
410  printf(" 2) other boundary conditions than in the input deck\n");
411  printf(" which created the .eig file\n\n");
412  exit(0);
413  }
414  }
415  }
416  else{
417  nev=0;
418  do{
419  if(fread(&nmd,sizeof(ITG),1,f1)!=1){
420  break;
421  }
422 
423  if(fread(&nevd,sizeof(ITG),1,f1)!=1){
424  printf(" *ERROR in steadystate reading the number of eigenvalues for nodal diameter %" ITGFORMAT " in the eigenvalue file",nmd);
425  printf(" *INFO in steadystate: if there are problems reading the .eig file this may be due to:\n");
426  printf(" 1) the nonexistence of the .eig file\n");
427  printf(" 2) other boundary conditions than in the input deck\n");
428  printf(" which created the .eig file\n\n");
429  exit(0);
430  }
431 
432  /* reading the eigenvalues (complex for non-Hermitian systems) */
433 
434  if(nev==0){
435  if(nherm==1){NNEW(d,double,nevd);
436  }else{NNEW(d,double,2*nevd);}
437  NNEW(nm,ITG,nevd);
438  }else{
439  if(nherm!=1){
440  printf(" *ERROR in steadystate: non-Hermitian systems cannot\n");
441  printf(" be combined with multiple modal diameters\n");
442  printf(" in cyclic symmetry calculations\n\n");
443  FORTRAN(stop,());
444  }
445  RENEW(d,double,nev+nevd);
446  RENEW(nm,ITG,nev+nevd);
447  }
448 
449  if(nherm==1){
450  if(fread(&d[nev],sizeof(double),nevd,f1)!=nevd){
451  printf(" *ERROR in steadystate reading the eigenvalues for nodal diameter %" ITGFORMAT " in the eigenvalue file",nmd);
452  printf(" *INFO in steadystate: if there are problems reading the .eig file this may be due to:\n");
453  printf(" 1) the nonexistence of the .eig file\n");
454  printf(" 2) other boundary conditions than in the input deck\n");
455  printf(" which created the .eig file\n\n");
456  exit(0);
457  }
458  for(i=nev;i<nev+nevd;i++){
459  if(d[i]<0){d[i]=0.;}
460  }
461  }else{
462  if(fread(&d[nev],sizeof(double),2*nevd,f1)!=2*nevd){
463  printf(" *ERROR in steadystate reading the eigenvalues in the eigenvalue file...");
464  printf(" *INFO in steadystate: if there are problems reading the .eig file this may be due to:\n");
465  printf(" 1) the nonexistence of the .eig file\n");
466  printf(" 2) other boundary conditions than in the input deck\n");
467  printf(" which created the .eig file\n\n");
468  exit(0);
469  }
470  }
471 
472  for(i=nev;i<nev+nevd;i++){nm[i]=nmd;}
473 
474  if(nev==0){
475  NNEW(adb,double,neq[1]);
476  NNEW(aub,double,nzs[1]);
477 
478  if(fread(adb,sizeof(double),neq[1],f1)!=neq[1]){
479  printf(" *ERROR in steadystate reading the diagonal of the mass matrix in the eigenvalue file");
480  printf(" *INFO in steadystate: if there are problems reading the .eig file this may be due to:\n");
481  printf(" 1) the nonexistence of the .eig file\n");
482  printf(" 2) other boundary conditions than in the input deck\n");
483  printf(" which created the .eig file\n\n");
484  exit(0);
485  }
486 
487  if(fread(aub,sizeof(double),nzs[1],f1)!=nzs[1]){
488  printf(" *ERROR in steadystate reading the off-diagonals of the mass matrix in the eigenvalue file");
489  printf(" *INFO in steadystate: if there are problems reading the .eig file this may be due to:\n");
490  printf(" 1) the nonexistence of the .eig file\n");
491  printf(" 2) other boundary conditions than in the input deck\n");
492  printf(" which created the .eig file\n\n");
493  exit(0);
494  }
495  }
496 
497  /* reading the eigenvectors */
498 
499  if(nev==0){
500  NNEW(z,double,neq[1]*nevd);
501  }else{
502  RENEW(z,double,(long long)neq[1]*(nev+nevd));
503  }
504 
505  if(fread(&z[(long long)neq[1]*nev],sizeof(double),neq[1]*nevd,f1)!=neq[1]*nevd){
506  printf(" *ERROR in steadystate reading the eigenvectors for nodal diameter %" ITGFORMAT " in the eigenvalue file",nmd);
507  printf(" *INFO in steadystate: if there are problems reading the .eig file this may be due to:\n");
508  printf(" 1) the nonexistence of the .eig file\n");
509  printf(" 2) other boundary conditions than in the input deck\n");
510  printf(" which created the .eig file\n\n");
511  exit(0);
512  }
513 
514  /* reading the orthogonality matrices */
515 
516  if(nherm!=1){
517  NNEW(xmr,double,nev*nev);
518  NNEW(xmi,double,nev*nev);
519  if(fread(xmr,sizeof(double),nev*nev,f1)!=nev*nev){
520  printf(" *ERROR in steadystate reading the real orthogonality matrix to the eigenvalue file...");
521  printf(" *INFO in steadystate: if there are problems reading the .eig file this may be due to:\n");
522  printf(" 1) the nonexistence of the .eig file\n");
523  printf(" 2) other boundary conditions than in the input deck\n");
524  printf(" which created the .eig file\n\n");
525  exit(0);
526  }
527 
528  if(fread(xmi,sizeof(double),nev*nev,f1)!=nev*nev){
529  printf(" *ERROR in steadystate reading the imaginary orthogonality matrix to the eigenvalue file...");
530  printf(" *INFO in steadystate: if there are problems reading the .eig file this may be due to:\n");
531  printf(" 1) the nonexistence of the .eig file\n");
532  printf(" 2) other boundary conditions than in the input deck\n");
533  printf(" which created the .eig file\n\n");
534  exit(0);
535  }
536  }
537 
538  nev+=nevd;
539  }while(1);
540 
541  /* determining the maximum amount of sectors */
542 
543  for(i=0;i<*mcs;i++){
544  if(cs[17*i]>nsectors) nsectors=(ITG)(cs[17*i]+0.5);
545  }
546 
547  /* determining the maximum number of sectors to be plotted */
548 
549  for(j=0;j<*mcs;j++){
550  if(cs[17*j+4]>ngraph) ngraph=(ITG)cs[17*j+4];
551  }
552  nkg=*nk*ngraph;
553  neg=*ne*ngraph;
554 
555  /* allocating field for the expanded structure */
556 
557  RENEW(co,double,3**nk*nsectors);
558 
559  /* next line is necessary for multiple cyclic symmetry
560  conditions */
561 
562  for(i=3**nk;i<3**nk*nsectors;i++){co[i]=0.;}
563  if(*ithermal!=0){
564  RENEW(t0,double,*nk*nsectors);
565  RENEW(t1old,double,*nk*nsectors);
566  RENEW(t1,double,*nk*nsectors);
567  if(*nam>0) RENEW(iamt1,ITG,*nk*nsectors);
568  }
569  RENEW(nactdof,ITG,mt**nk*nsectors);
570  if(*ntrans>0) RENEW(inotr,ITG,2**nk*nsectors);
571  RENEW(kon,ITG,*nkon*nsectors);
572  RENEW(ipkon,ITG,*ne*nsectors);
573  for(i=*ne;i<*ne*nsectors;i++){ipkon[i]=-1;}
574  RENEW(lakon,char,8**ne*nsectors);
575  RENEW(ielmat,ITG,mi[2]**ne*nsectors);
576  if(*norien>0) RENEW(ielorien,ITG,mi[2]**ne*nsectors);
577 // RENEW(z,double,(long long)neq[1]*nev*nsectors/2);
578 
579  RENEW(nodeboun,ITG,*nboun*nsectors);
580  RENEW(ndirboun,ITG,*nboun*nsectors);
581  if(*nam>0) RENEW(iamboun,ITG,*nboun*nsectors);
582  RENEW(xboun,double,*nboun*nsectors);
583  RENEW(xbounold,double,*nboun*nsectors);
584  RENEW(ikboun,ITG,*nboun*nsectors);
585  RENEW(ilboun,ITG,*nboun*nsectors);
586 
587  NNEW(ipompcold,ITG,*nmpc);
588  NNEW(nodempcold,ITG,3**mpcend);
589  NNEW(coefmpcold,double,*mpcend);
590  NNEW(labmpcold,char,20**nmpc);
591  NNEW(ikmpcold,ITG,*nmpc);
592  NNEW(ilmpcold,ITG,*nmpc);
593 
594  for(i=0;i<*nmpc;i++){ipompcold[i]=ipompc[i];}
595  for(i=0;i<3**mpcend;i++){nodempcold[i]=nodempc[i];}
596  for(i=0;i<*mpcend;i++){coefmpcold[i]=coefmpc[i];}
597  for(i=0;i<20**nmpc;i++){labmpcold[i]=labmpc[i];}
598  for(i=0;i<*nmpc;i++){ikmpcold[i]=ikmpc[i];}
599  for(i=0;i<*nmpc;i++){ilmpcold[i]=ilmpc[i];}
600  nmpcold=*nmpc;
601  mpcendold=*mpcend;
602 
603  RENEW(ipompc,ITG,*nmpc*nsectors);
604  RENEW(nodempc,ITG,3**mpcend*nsectors);
605  RENEW(coefmpc,double,*mpcend*nsectors);
606  RENEW(labmpc,char,20**nmpc*nsectors+1);
607  RENEW(ikmpc,ITG,*nmpc*nsectors);
608  RENEW(ilmpc,ITG,*nmpc*nsectors);
609  RENEW(fmpc,double,*nmpc*nsectors);
610 
611  /* reallocating the fields for the nodes in which the
612  solution has to be calculated */
613 
614  RENEW(imddof,ITG,neq[1]/2*nsectors);
615  RENEW(imdnode,ITG,*nk*nsectors);
616  RENEW(imdboun,ITG,*nboun*nsectors);
617  RENEW(imdmpc,ITG,*nmpc*nsectors);
618 
619 //izdofNNEW(// izdof,ITG,1);
620 
621  expand(co,nk,kon,ipkon,lakon,ne,nodeboun,ndirboun,xboun,nboun,
622  ipompc,nodempc,coefmpc,labmpc,nmpc,nodeforc,ndirforc,xforc,
623  nforc,nelemload,sideload,xload,nload,nactdof,neq,
624  nmethod,ikmpc,ilmpc,ikboun,ilboun,elcon,nelcon,rhcon,nrhcon,
625  alcon,nalcon,alzero,ielmat,ielorien,norien,orab,ntmat_,
626  t0,ithermal,prestr,iprestr,vold,iperturb,sti,nzs,
627  adb,aub,filab,eme,plicon,nplicon,plkcon,nplkcon,
628  xstate,npmat_,matname,mi,ics,cs,mpcend,ncmat_,
629  nstate_,mcs,nkon,ener,jobnamec,output,set,nset,istartset,
630  iendset,ialset,nprint,prlab,prset,nener,trab,
631  inotr,ntrans,ttime,fmpc,&nev,&z,iamboun,xbounold,
632  &nsectors,nm,icol,irow,nzl,nam,ipompcold,nodempcold,coefmpcold,
633  labmpcold,&nmpcold,xloadold,iamload,t1old,t1,iamt1,xstiff,&icole,&jqe,
634  &irowe,isolver,nzse,&adbe,&aube,iexpl,
635  ibody,xbody,nbody,cocon,ncocon,tieset,&ntie,imddof,&nmddof,
636  imdnode,&nmdnode,imdboun,&nmdboun,imdmpc,&nmdmpc,&izdof,&nzdof,
637  &nherm,xmr,xmi,typeboun,ielprop,prop,orname);
638 
639  RENEW(imddof,ITG,nmddof);
640  RENEW(imdnode,ITG,nmdnode);
641  RENEW(imdboun,ITG,nmdboun);
642  RENEW(imdmpc,ITG,nmdmpc);
643 
644  SFREE(vold);
645  NNEW(vold,double,mt**nk);
646  SFREE(veold);
647  NNEW(veold,double,mt**nk);
648  RENEW(eme,double,6*mi[0]**ne);
649 
650  if(*nener==1) RENEW(ener,double,mi[0]**ne);
651  }
652 
653  fclose(f1);
654 
655  /* allocating space for the friction coefficients */
656 
657  if(nherm==1){
658  NNEW(fric,double,nev);
659  }else{
660  NNEW(fric,double,2*nev);
661  }
662 
663  /* check whether there are dashpot elements */
664 
665  dashpot=0;
666  for(i=0;i<*ne;i++){
667  if(ipkon[i]==-1) continue;
668  if(strcmp1(&lakon[i*8],"ED")==0){
669  dashpot=1;break;}
670  }
671  if(dashpot){
672 
673  if(cyclicsymmetry){
674  printf(" *ERROR in steadystate: dashpots are not allowed in combination with cyclic symmetry\n");
675  FORTRAN(stop,());
676  }
677 
678  if(nherm!=1){
679  printf("ERROR in steadystate: dashpots cannot be combined with non-Hermitian systems (in the present version of CalculiX)\n");
680  FORTRAN(stop,());
681  }
682 
683  /* cc is the reduced damping matrix (damping matrix mapped onto
684  space spanned by eigenmodes) */
685 
686  NNEW(cc,double,nev*nev);
687 /* nev2=2*nev;
688  NNEW(am,double,nev2*nev2);
689  NNEW(bm,double,nev2);
690  NNEW(ipiv,ITG,nev2);*/
691  }
692 
693  NNEW(inum,ITG,*nk);
694  strcpy1(&cflag[0],&filab[4],1);
695  FORTRAN(createinum,(ipkon,inum,kon,lakon,nk,ne,&cflag[0],nelemload,
696  nload,nodeboun,nboun,ndirboun,ithermal,co,vold,mi,ielmat));
697 
698  /* check whether integration point values are requested; if not,
699  the stress fields do not have to be allocated */
700 
701  intpointvar=0;
702  if(*ithermal<=1){
703 
704  /* mechanical */
705 
706  if((strcmp1(&filab[174],"S")==0)||
707  (strcmp1(&filab[261],"E")==0)||
708  (strcmp1(&filab[348],"RF")==0)||
709  (strcmp1(&filab[435],"PEEQ")==0)||
710  (strcmp1(&filab[522],"ENER")==0)||
711  (strcmp1(&filab[609],"SDV")==0)||
712  (strcmp1(&filab[1044],"ZZS")==0)||
713  (strcmp1(&filab[1044],"ERR")==0)||
714  (strcmp1(&filab[1479],"PHS")==0)||
715  (strcmp1(&filab[1653],"MAXS")==0)||
716  (strcmp1(&filab[2175],"CONT")==0)||
717  (strcmp1(&filab[2262],"CELS")==0)) intpointvar=1;
718  for(i=0;i<*nprint;i++){
719  if((strcmp1(&prlab[6*i],"S")==0)||
720  (strcmp1(&prlab[6*i],"E")==0)||
721  (strcmp1(&prlab[6*i],"PEEQ")==0)||
722  (strcmp1(&prlab[6*i],"ENER")==0)||
723  (strcmp1(&prlab[6*i],"SDV")==0)||
724  (strcmp1(&prlab[6*i],"RF")==0)) {intpointvar=1;break;}
725  }
726  }else{
727 
728  /* thermal */
729 
730  if((strcmp1(&filab[696],"HFL")==0)||
731  (strcmp1(&filab[783],"RFL")==0)) intpointvar=1;
732  for(i=0;i<*nprint;i++){
733  if((strcmp1(&prlab[6*i],"HFL")==0)||
734  (strcmp1(&prlab[6*i],"RFL")==0)) {intpointvar=1;break;}
735  }
736  }
737 
738  if(nfour<=0){
739 
740  /* harmonic excitation */
741 
742  NNEW(ikactmechr,ITG,neq[1]);
743  NNEW(ikactmechi,ITG,neq[1]);
744  nactmechr=0;nactmechi=0;
745 
746  /* result fields */
747 
748  if(intpointvar==1){
749  NNEW(fn,double,mt**nk);
750  NNEW(stnr,double,6**nk);
751  NNEW(stni,double,6**nk);
752  NNEW(stx,double,6*mi[0]**ne);
753  NNEW(eei,double,6*mi[0]**ne);
754 
755  if(*ithermal>1) {NNEW(qfn,double,3**nk);
756  NNEW(qfx,double,3*mi[0]**ne);}
757 
758  if(strcmp1(&filab[261],"E ")==0) NNEW(een,double,6**nk);
759  if(strcmp1(&filab[522],"ENER")==0) NNEW(enern,double,*nk);
760  if(strcmp1(&filab[2697],"ME ")==0) NNEW(emn,double,6**nk);
761 
762  if(*nener==1){
763  NNEW(stiini,double,6*mi[0]**ne);
764  NNEW(emeini,double,6*mi[0]**ne);
765  NNEW(enerini,double,mi[0]**ne);}
766  }
767 
768  /* determining the frequency data points */
769 
770  NNEW(freq,double,ndata*(nev+1));
771 
772  ndatatot=0.;
773  freq[0]=fmin;
774  if(fabs(fmax-fmin)<1.e-10){
775  ndatatot=1;
776  }else{
777 
778  /* copy the eigenvalues and sort them in ascending order
779  (important for values from distinct nodal diameters */
780 
781  NNEW(e,double,nev);
782  if(nherm==1){
783  for(i=0;i<nev;i++){e[i]=sqrt(d[i]);}
784  }else{
785 
786  /* for complex eigenvalues: sorting the real part */
787 
788  for(i=0;i<nev;i++){
789  e[i]=sqrt(sqrt(d[2*i]*d[2*i]+d[2*i+1]*d[2*i+1])+d[2*i])/sqrt(2.);
790  }
791  }
792  FORTRAN(dsort,(e,&idummy,&nev,&iflag));
793 
794  for(i=0;i<nev;i++){
795  if(i!=0){
796  if(fabs(e[i]-e[i-1])<1.e-5){continue;}
797  }
798  if(e[i]>=fmin){
799  if(e[i]<=fmax){
800  for(j=1;j<ndata;j++){
801  y=-1.+2.*j/((double)(ndata-1));
802  if(fabs(y)<1.e-10){freq[ndatatot+j]=
803  (freq[ndatatot]+e[i])/2.;}
804  else{
805  freq[ndatatot+j]=(freq[ndatatot]+e[i])/2.+
806  (e[i]-freq[ndatatot])*pow(fabs(y),1./bias)*
807  y/(2.*fabs(y));
808  }
809  }
810  ndatatot+=ndata-1;
811  }
812  else{break;}
813  }
814  }
815 
816  SFREE(e);
817 
818  for(j=1;j<ndata;j++){
819  y=-1.+2.*j/((double)(ndata-1));
820  if(fabs(y)<1.e-10){freq[ndatatot+j]=(freq[ndatatot]+fmax)/2.;}
821  else{
822  freq[ndatatot+j]=(freq[ndatatot]+fmax)/2.+
823  (fmax-freq[ndatatot])*pow(fabs(y),1./bias)*
824  y/(2.*fabs(y));
825  }
826  }
827  ndatatot+=ndata;
828  }
829  RENEW(freq,double,ndatatot);
830 
831  /* check for nonzero SPC's */
832 
833  iprescribedboundary=0;
834  for(i=0;i<*nboun;i++){
835  if(fabs(xboun[i])>1.e-10){
836  iprescribedboundary=1;
837  nmdnode=0;nmddof=0;nmdboun=0;nmdmpc=0;
838  break;
839  }
840  }
841 
842  if((iprescribedboundary)&&(cyclicsymmetry)){
843  printf(" *ERROR in steadystate: prescribed boundaries are not allowed in combination with cyclic symmetry\n");
844  FORTRAN(stop,());
845  }
846 
847  /* calculating the damping coefficients = friction coefficient*2*eigenvalue */
848 
849  if(xmodal[10]<0){
850  for(i=0;i<nev;i++){
851  if(nherm==1){
852  if(sqrt(d[i])>(1.e-10)){
853  fric[i]=(alpham+betam*d[i]);
854  }
855  else {
856  printf("*WARNING in steadystate: one of the frequencies is zero\n");
857  printf(" no Rayleigh mass damping allowed\n");
858  fric[i]=0.;
859  }
860  }else{
861  fric[2*i]=sqrt(sqrt(d[2*i]*d[2*i]+d[2*i+1]*d[2*i+1])+d[2*i])/
862  sqrt(2.);
863  fric[2*i+1]=sqrt(sqrt(d[2*i]*d[2*i]+d[2*i+1]*d[2*i+1])-d[2*i])/
864  sqrt(2.);
865  if(d[2*i+1]<0.) fric[2*i+1]=-fric[2*i+1];
866  fric[2*i]=alpham+betam*fric[2*i];
867  fric[2*i+1]=betam*fric[2*i+1];
868  }
869  }
870  }
871  else{
872  if(iprescribedboundary){
873  printf(" *ERROR in steadystate: prescribed boundaries are not allowed in combination with direct modal damping\n");
874  FORTRAN(stop,());
875  }
876 
877  /*copy the damping coefficients for every eigenfrequencie from xmodal[11....] */
878  if(nev<(ITG)xmodal[10]){
879  imax=nev;
880  printf("*WARNING in steadystate: too many modal damping coefficients applied\n");
881  printf(" damping coefficients corresponding to nonexisting eigenvalues are ignored\n");
882  }
883  else{
884  imax=(ITG)xmodal[10];
885  }
886  for(i=0; i<imax; i++){
887  if(nherm==1){
888  fric[i]=2.*sqrt(d[i])*xmodal[11+i];
889  }else{
890  fric[2*i]=sqrt(sqrt(d[2*i]*d[2*i]+d[2*i+1]*d[2*i+1])+d[2*i])/
891  sqrt(2.);
892  fric[2*i+1]=sqrt(sqrt(d[2*i]*d[2*i]+d[2*i+1]*d[2*i+1])-d[2*i])/
893  sqrt(2.);
894  if(d[2*i+1]<0.) fric[2*i+1]=-fric[2*i+1];
895  fric[2*i]=2.*fric[2*i]*xmodal[11+i];
896  fric[2*i+1]=2.*fric[2*i+1]*xmodal[11+i];
897  }
898  }
899 
900  }
901 
902  /* check whether the loading is real or imaginary */
903 
904  NNEW(iphaseforc,ITG,*nforc);
905  for (i=0;i<*nforc;i++){
906  if(nodeforc[2*i+1]>=nsectors){
907  iphaseforc[i]=1;
908  }
909  }
910 
911  NNEW(iphaseload,ITG,*nload);
912  for (i=0;i<*nload;i++){
913  if(nelemload[2*i+1]>=nsectors){
914  iphaseload[i]=1;
915  }
916  }
917 
918  if(iprescribedboundary){
919  NNEW(iphaseboun,ITG,*nboun);
920  for (i=0;i<*nboun;i++){
921  if(nodeboun[i]>*nk){
922  iphaseboun[i]=1;
923  nodeboun[i]=nodeboun[i]-*nk;
924  }
925  }
926  }
927 
928  /* allocating actual loading fields */
929 
930  NNEW(xforcact,double,*nforc);
931  NNEW(xforcr,double,*nforc);
932  NNEW(xforci,double,*nforc);
933 
934  NNEW(xloadact,double,2**nload);
935  NNEW(xloadr,double,2**nload);
936  NNEW(xloadi,double,2**nload);
937 
938  NNEW(xbodyact,double,7**nbody);
939  NNEW(xbodyr,double,7**nbody);
940  NNEW(xbodyi,double,7**nbody);
941  /* copying the rotation axis and/or acceleration vector */
942  for(k=0;k<7**nbody;k++){xbodyact[k]=xbody[k];}
943 
944  NNEW(xbounact,double,*nboun);
945 
946  if(*ithermal==1) NNEW(t1act,double,*nk);
947 
948  /* assigning the body forces to the elements */
949 
950  if(*nbody>0){
951  ifreebody=*ne+1;
952  NNEW(ipobody,ITG,2*ifreebody**nbody);
953  for(k=1;k<=*nbody;k++){
954  FORTRAN(bodyforce,(cbody,ibody,ipobody,nbody,set,istartset,
955  iendset,ialset,&inewton,nset,&ifreebody,&k));
956  RENEW(ipobody,ITG,2*(*ne+ifreebody));
957  }
958  RENEW(ipobody,ITG,2*(ifreebody-1));
959  }
960 
961  NNEW(br,double,neq[1]); /* load rhs vector */
962  NNEW(bi,double,neq[1]); /* load rhs vector */
963 
964  if(iprescribedboundary){
965  NNEW(xbounr,double,*nboun);
966  NNEW(xbouni,double,*nboun);
967 
968  NNEW(fr,double,neq[1]); /* force corresponding to real particular solution */
969  NNEW(fi,double,neq[1]); /* force corresponding to imaginary particular solution */
970 
971  NNEW(ubr,double,neq[1]); /* real particular solution */
972  NNEW(ubi,double,neq[1]); /* imaginary particular solution */
973 
974  NNEW(mubr,double,neq[1]); /* mass times real particular solution */
975  NNEW(mubi,double,neq[1]); /* mass times imaginary particular solution */
976  }
977 
978  NNEW(bjr,double,nev); /* real response modal decomposition */
979  NNEW(bji,double,nev); /* imaginary response modal decomposition */
980 
981  NNEW(ampli,double,*nam); /* instantaneous amplitude */
982 
983  if(nherm==1){
984  NNEW(aa,double,nev); /* modal coefficients of the real loading */
985  NNEW(bb,double,nev); /* modal coefficients of the imaginary loading */
986  }else{
987  NNEW(aa,double,2*nev); /* modal coefficients of the real loading */
988  NNEW(bb,double,2*nev); /* modal coefficients of the imaginary loading */
989  }
990 
991  /* result fields */
992 
993  NNEW(vr,double,mt**nk);
994  NNEW(vi,double,mt**nk);
995 
996  if(iprescribedboundary){
997 
998  /* LU decomposition of the stiffness matrix */
999 
1000  if(*isolver==0){
1001 #ifdef SPOOLES
1002  spooles_factor(ad,au,adb,aub,&sigma,icol,irow,&neq[1],&nzs[1],
1003  &symmetryflag,&inputformat,&nzs[2]);
1004 #else
1005  printf(" *ERROR in steadystate: the SPOOLES library is not linked\n\n");
1006  FORTRAN(stop,());
1007 #endif
1008  }
1009  else if(*isolver==4){
1010 #ifdef SGI
1011  token=1;
1012  sgi_factor(ad,au,adb,aub,&sigma,icol,irow,&neq[1],&nzs[1],token);
1013 #else
1014  printf(" *ERROR in steadystate: the SGI library is not linked\n\n");
1015  FORTRAN(stop,());
1016 #endif
1017  }
1018  else if(*isolver==5){
1019 #ifdef TAUCS
1020  tau_factor(ad,&au,adb,aub,&sigma,icol,&irow,&neq[1],&nzs[1]);
1021 #else
1022  printf(" *ERROR in steadystate: the TAUCS library is not linked\n\n");
1023  FORTRAN(stop,());
1024 #endif
1025  }
1026  else if(*isolver==7){
1027 #ifdef PARDISO
1028  pardiso_factor(ad,au,adb,aub,&sigma,icol,irow,&neq[1],&nzs[1],
1029  &symmetryflag,&inputformat,jq,&nzs[2]);
1030 #else
1031  printf(" *ERROR in steadystate: the PARDISO library is not linked\n\n");
1032  FORTRAN(stop,());
1033 #endif
1034  }
1035  }
1036 
1037  for(l=0;l<ndatatot;l=l+*jout){
1038  for(i=0;i<6*mi[0]**ne;i++){eme[i]=0.;}
1039  time=freq[l]/(2.*pi);
1040  timem=-time;
1041  ptime=time;
1042 
1043  /* calculating cc */
1044 
1045  if(dashpot){
1046  NNEW(adc,double,neq[1]);
1047  NNEW(auc,double,nzs[1]);
1048  FORTRAN(mafilldm,(co,nk,kon,ipkon,lakon,ne,nodeboun,
1049  ndirboun,xboun,nboun,
1050  ipompc,nodempc,coefmpc,nmpc,nodeforc,ndirforc,xforc,
1051  nforc,nelemload,sideload,xload,nload,xbody,ipobody,nbody,cgr,
1052  adc,auc,nactdof,icol,jq,irow,neq,nzl,nmethod,
1053  ikmpc,ilmpc,ikboun,ilboun,
1054  elcon,nelcon,rhcon,nrhcon,alcon,nalcon,alzero,ielmat,
1055  ielorien,norien,orab,ntmat_,
1056  t0,t0,ithermal,prestr,iprestr,vold,iperturb,sti,
1057  nzs,stx,adb,aub,iexpl,plicon,nplicon,plkcon,nplkcon,
1058  xstiff,npmat_,&dtime,matname,mi,ncmat_,
1059  ttime,&time,istep,&iinc,ibody,clearini,&mortar,springarea,
1060  pslavsurf,pmastsurf,&reltime,&nasym));
1061 
1062  /* zc = damping matrix * eigenmodes */
1063 
1064  NNEW(zc,double,neq[1]*nev);
1065  for(i=0;i<nev;i++){
1066  FORTRAN(op,(&neq[1],&z[(long long)i*neq[1]],&zc[i*neq[1]],adc,auc,
1067  jq,irow));
1068  }
1069 
1070  /* cc is the reduced damping matrix (damping matrix mapped onto
1071  space spanned by eigenmodes) */
1072 
1073  for(i=0;i<nev*nev;i++){cc[i]=0.;}
1074  for(i=0;i<nev;i++){
1075  for(j=0;j<=i;j++){
1076  for(k=0;k<neq[1];k++){
1077  cc[i*nev+j]+=z[(long long)j*neq[1]+k]*zc[i*neq[1]+k];
1078  }
1079  }
1080  }
1081 
1082  /* symmetric part of cc matrix */
1083 
1084  for(i=0;i<nev;i++){
1085  for(j=i;j<nev;j++){
1086  cc[i*nev+j]=cc[j*nev+i];
1087  }
1088  }
1089  SFREE(zc);SFREE(adc);SFREE(auc);
1090  }
1091 
1092  /* calculating the instantaneous loads (forces, surface loading,
1093  centrifugal and gravity loading or temperature) */
1094 
1095  FORTRAN(tempload,(xforcold,xforc,xforcact,iamforc,nforc,
1096  xloadold,xload,xloadact,iamload,nload,ibody,xbody,
1097  nbody,xbodyold,xbodyact,t1old,t1,t1act,iamt1,nk,amta,namta,
1098  nam,ampli,&time,&reltime,ttime,&dtime,ithermal,nmethod,
1099  xbounold,xboun,xbounact,iamboun,nboun,nodeboun,ndirboun,
1100  nodeforc,ndirforc,istep,&iinc,co,vold,itg,&ntg,amname,
1101  ikboun,ilboun,nelemload,sideload,mi,
1102  ntrans,trab,inotr,veold,integerglob,doubleglob,tieset,istartset,
1103  iendset,ialset,&ntie,nmpc,ipompc,ikmpc,ilmpc,nodempc,coefmpc,
1104  ipobody,iponoel,inoel));
1105 
1106  /* real part of forces */
1107 
1108  for (i=0;i<*nforc;i++){
1109  xforcr[i]=xforcact[i]*(1-iphaseforc[i]);
1110  }
1111 
1112  for (i=0;i<*nload;i++){
1113  for(j=0;j<2;j++){
1114  xloadr[2*i+j]=xloadact[2*i+j]*(1-iphaseload[i]);
1115  }
1116  }
1117 
1118  for(i=0;i<*nbody;i++){
1119  for(j=0;j<7;j++){
1120  xbodyr[7*i+j]=xbodyact[7*i+j];
1121  }
1122  if(ibody[3*i+2]==2){
1123  xbodyr[7*i]=0.;
1124  }
1125  }
1126 
1127  /* calculating the instantaneous loading vector */
1128 
1129  FORTRAN(rhs,(co,nk,kon,ipkon,lakon,ne,
1130  ipompc,nodempc,coefmpc,nmpc,nodeforc,ndirforc,xforcr,
1131  nforc,nelemload,sideload,xloadr,nload,xbodyr,
1132  ipobody,nbody,cgr,br,nactdof,&neq[1],nmethod,
1133  ikmpc,ilmpc,elcon,nelcon,rhcon,nrhcon,
1134  alcon,nalcon,alzero,ielmat,ielorien,norien,orab,ntmat_,
1135  t0,t1act,ithermal,iprestr,vold,iperturb,iexpl,plicon,
1136  nplicon,plkcon,nplkcon,
1137  npmat_,ttime,&time,istep,&iinc,&dtime,physcon,ibody,
1138  xbodyold,&reltime,veold,matname,mi,ikactmechr,
1139  &nactmechr,ielprop,prop,sti,xstateini,xstate,nstate_));
1140 
1141  /* real modal coefficients */
1142 
1143  if(!iprescribedboundary){
1144 
1145  if(nherm==1){
1146  if(!cyclicsymmetry){
1147  for(i=0;i<nev;i++){
1148  i2=(long long)i*neq[1];
1149  aa[i]=0.;
1150  if(nactmechr<neq[1]/2){
1151  for(j=0;j<nactmechr;j++){
1152  aa[i]+=z[i2+ikactmechr[j]]*br[ikactmechr[j]];
1153  }
1154  }else{
1155  for(j=0;j<neq[1];j++){
1156  aa[i]+=z[i2+j]*br[j];
1157  }
1158  }
1159  }
1160  }else{
1161  for(i=0;i<nev;i++){aa[i]=0.;}
1162  for(j=0;j<nactmechr;j++){
1163  for(i=0;i<nev;i++){
1164  FORTRAN(nident,(izdof,&ikactmechr[j],&nzdof,&id));
1165  if(id!=0){
1166  if(izdof[id-1]==ikactmechr[j]){
1167  aa[i]+=z[(long long)i*nzdof+id-1]*br[ikactmechr[j]];
1168  }else{printf(" *ERROR in steadystate\n");FORTRAN(stop,());}
1169  }else{printf(" *ERROR in steadystate\n");FORTRAN(stop,());}
1170  }
1171  }
1172  }
1173  }else{
1174  if(!cyclicsymmetry){
1175  for(i=0;i<nev;i++){
1176  aa[2*i]=0.;aa[2*i+1]=0.;
1177  if(nactmechr<neq[1]/2){
1178  for(j=0;j<nactmechr;j++){
1179  aa[2*i]+=z[(long long)2*i*neq[1]+ikactmechr[j]]*br[ikactmechr[j]];
1180  aa[2*i+1]+=z[(long long)(2*i+1)*neq[1]+ikactmechr[j]]*br[ikactmechr[j]];
1181  }
1182  }else{
1183  for(j=0;j<neq[1];j++){
1184  aa[2*i]+=z[(long long)2*i*neq[1]+j]*br[j];
1185  aa[2*i+1]+=z[(long long)(2*i+1)*neq[1]+j]*br[j];
1186  }
1187  }
1188  }
1189  }else{
1190  for(i=0;i<nev;i++){aa[2*i]=0.;aa[2*i+1]=0.;}
1191  for(j=0;j<nactmechr;j++){
1192  for(i=0;i<nev;i++){
1193  FORTRAN(nident,(izdof,&ikactmechr[j],&nzdof,&id));
1194  if(id!=0){
1195  if(izdof[id-1]==ikactmechr[j]){
1196  aa[i]+=z[(long long)2*i*nzdof+id-1]*br[ikactmechr[j]];
1197  aa[i]+=z[(long long)(2*i+1)*nzdof+id-1]*br[ikactmechr[j]];
1198  }else{printf(" *ERROR in steadystate\n");FORTRAN(stop,());}
1199  }else{printf(" *ERROR in steadystate\n");FORTRAN(stop,());}
1200  }
1201  }
1202  }
1203  }
1204 
1205  }else{
1206 
1207  /* correction for nonzero SPC's */
1208 
1209  /* next statement makes sure that br is reset to zero at the
1210  start of rhs.f */
1211  nactmechr=neq[1];
1212 
1213  /* real part of boundary conditions */
1214 
1215  for (i=0;i<*nboun;i++){
1216  xbounr[i]=xbounact[i]*(1-iphaseboun[i]);
1217  }
1218 
1219  for(j=0;j<neq[1];j++){fr[j]=0.;ubr[j]=0.;}
1220  for(i=0;i<*nboun;i++){
1221  ic=neq[1]+i;
1222  for(j=jq[ic]-1;j<jq[ic+1]-1;j++){
1223  ir=irow[j]-1;
1224  fr[ir]=fr[ir]-au[j]*xbounr[i];
1225  ubr[ir]=fr[ir];
1226  }
1227  }
1228  if(*isolver==0){
1229 #ifdef SPOOLES
1230  spooles_solve(ubr,&neq[1]);
1231 #endif
1232  }
1233  else if(*isolver==4){
1234 #ifdef SGI
1235  sgi_solve(ubr,token);
1236 #endif
1237  }
1238  else if(*isolver==5){
1239 #ifdef TAUCS
1240  tau_solve(ubr,&neq[1]);
1241 #endif
1242  }
1243  else if(*isolver==7){
1244 #ifdef PARDISO
1245  pardiso_solve(ubr,&neq[1],&symmetryflag);
1246 #endif
1247  }
1248  FORTRAN(op,(&neq[1],ubr,mubr,adb,aub,jq,irow));
1249  }
1250 
1251  /* imaginary part of forces */
1252 
1253  for (i=0;i<*nforc;i++){
1254  xforci[i]=xforcact[i]*iphaseforc[i];
1255  }
1256 
1257  for (i=0;i<*nload;i++){
1258  for(j=0;j<2;j++){
1259  xloadi[2*i+j]=xloadact[2*i+j]*iphaseload[i];
1260  }
1261  }
1262 
1263  for(i=0;i<*nbody;i++){
1264  for(j=0;j<7;j++){
1265  xbodyi[7*i+j]=xbodyact[7*i+j];
1266  }
1267  if(ibody[3*i+2]==1){
1268  xbodyi[7*i]=0.;
1269  }
1270  }
1271 
1272  /* calculating the instantaneous loading vector */
1273 
1274  FORTRAN(rhs,(co,nk,kon,ipkon,lakon,ne,
1275  ipompc,nodempc,coefmpc,nmpc,nodeforc,ndirforc,xforci,
1276  nforc,nelemload,sideload,xloadi,nload,xbodyi,
1277  ipobody,nbody,cgr,bi,nactdof,&neq[1],nmethod,
1278  ikmpc,ilmpc,elcon,nelcon,rhcon,nrhcon,
1279  alcon,nalcon,alzero,ielmat,ielorien,norien,orab,ntmat_,
1280  t0,t1act,ithermal,iprestr,vold,iperturb,iexpl,plicon,
1281  nplicon,plkcon,nplkcon,
1282  npmat_,ttime,&time,istep,&iinc,&dtime,physcon,ibody,
1283  xbodyold,&reltime,veold,matname,mi,ikactmechi,
1284  &nactmechi,ielprop,prop,sti,xstateini,xstate,nstate_));
1285 
1286  /* imaginary modal coefficients */
1287 
1288  if(!iprescribedboundary){
1289 
1290  if(nherm==1){
1291  if(!cyclicsymmetry){
1292  for(i=0;i<nev;i++){
1293  i2=(long long)i*neq[1];
1294  bb[i]=0.;
1295  if(nactmechi<neq[1]/2){
1296  for(j=0;j<nactmechi;j++){
1297  bb[i]+=z[i2+ikactmechi[j]]*bi[ikactmechi[j]];
1298  }
1299  }else{
1300  for(j=0;j<neq[1];j++){
1301  bb[i]+=z[i2+j]*bi[j];
1302  }
1303  }
1304  }
1305  }else{
1306  for(i=0;i<nev;i++){bb[i]=0.;}
1307  for(j=0;j<nactmechi;j++){
1308  for(i=0;i<nev;i++){
1309  FORTRAN(nident,(izdof,&ikactmechi[j],&nzdof,&id));
1310  if(id!=0){
1311  if(izdof[id-1]==ikactmechi[j]){
1312  bb[i]+=z[(long long)i*nzdof+id-1]*bi[ikactmechi[j]];
1313  }else{printf(" *ERROR in steadystate\n");FORTRAN(stop,());}
1314  }else{printf(" *ERROR in steadystate\n");FORTRAN(stop,());}
1315  }
1316  }
1317  }
1318  }else{
1319  if(!cyclicsymmetry){
1320  for(i=0;i<nev;i++){
1321  bb[2*i]=0.;bb[2*i+1]=0.;
1322  if(nactmechi<neq[1]/2){
1323  for(j=0;j<nactmechi;j++){
1324  bb[2*i]+=z[(long long)2*i*neq[1]+ikactmechi[j]]*bi[ikactmechi[j]];
1325  bb[2*i+1]+=z[(long long)(2*i+1)*neq[1]+ikactmechi[j]]*bi[ikactmechi[j]];
1326  }
1327  }else{
1328  for(j=0;j<neq[1];j++){
1329  bb[2*i]+=z[(long long)2*i*neq[1]+j]*bi[j];
1330  bb[2*i+1]+=z[(long long)(2*i+1)*neq[1]+j]*bi[j];
1331  }
1332  }
1333  }
1334  }else{
1335  for(i=0;i<nev;i++){bb[2*i]=0.;bb[2*i+1]=0.;}
1336  for(j=0;j<nactmechi;j++){
1337  for(i=0;i<nev;i++){
1338  FORTRAN(nident,(izdof,&ikactmechi[j],&nzdof,&id));
1339  if(id!=0){
1340  if(izdof[id-1]==ikactmechi[j]){
1341  bb[2*i]+=z[(long long)2*i*nzdof+id-1]*bi[ikactmechi[j]];
1342  bb[2*i+1]+=z[(long long)(2*i+1)*nzdof+id-1]*bi[ikactmechi[j]];
1343  }else{printf(" *ERROR in steadystate\n");FORTRAN(stop,());}
1344  }else{printf(" *ERROR in steadystate\n");FORTRAN(stop,());}
1345  }
1346  }
1347  }
1348  }
1349 
1350  }else{
1351 
1352  /* correction for nonzero SPC's */
1353 
1354  /* next statement makes sure that bi is reset to zero at the
1355  start of rhs.f */
1356 
1357  nactmechi=neq[1];
1358 
1359  /* imaginary part of boundary conditions */
1360 
1361  for (i=0;i<*nboun;i++){
1362  xbouni[i]=xbounact[i]*iphaseboun[i];
1363  }
1364 
1365  for(j=0;j<neq[1];j++){fi[j]=0.;ubi[j]=0.;}
1366  for(i=0;i<*nboun;i++){
1367  ic=neq[1]+i;
1368  for(j=jq[ic]-1;j<jq[ic+1]-1;j++){
1369  ir=irow[j]-1;
1370  fi[ir]=fi[ir]-au[j]*xbouni[i];
1371  ubi[ir]=fi[ir];
1372  }
1373  }
1374  if(*isolver==0){
1375 #ifdef SPOOLES
1376  spooles_solve(ubi,&neq[1]);
1377 #endif
1378  }
1379  else if(*isolver==4){
1380 #ifdef SGI
1381  sgi_solve(ubi,token);
1382 #endif
1383  }
1384  else if(*isolver==5){
1385 #ifdef TAUCS
1386  tau_solve(ubi,&neq[1]);
1387 #endif
1388  }
1389  else if(*isolver==7){
1390 #ifdef PARDISO
1391  pardiso_solve(ubi,&neq[1],&symmetryflag);
1392 #endif
1393  }
1394  FORTRAN(op,(&neq[1],ubi,mubi,adb,aub,jq,irow));
1395 
1396  /* correction for prescribed boundary conditions */
1397 
1398  for(i=0;i<neq[1];i++){
1399  br[i]+=freq[l]*(freq[l]*mubr[i]+alpham*mubi[i]+betam*fi[i]);
1400  bi[i]+=freq[l]*(freq[l]*mubi[i]-alpham*mubr[i]-betam*fr[i]);
1401  }
1402 
1403  /* real and imaginary modal coefficients */
1404 
1405  for(i=0;i<nev;i++){
1406  aa[i]=0.;
1407  for(j=0;j<neq[1];j++){
1408  aa[i]+=z[(long long)i*neq[1]+j]*br[j];
1409  }
1410  }
1411 
1412  for(i=0;i<nev;i++){
1413  bb[i]=0.;
1414  for(j=0;j<neq[1];j++){
1415  bb[i]+=z[(long long)i*neq[1]+j]*bi[j];
1416  }
1417  }
1418 
1419  }
1420 
1421  /* calculating the modal coefficients */
1422 
1423  if(nherm==1){
1424  if(dashpot==0){
1425  for(i=0;i<nev;i++){
1426  dd=pow(d[i]-pow(freq[l],2),2)+
1427  pow(fric[i],2)*pow(freq[l],2);
1428  bjr[i]=(aa[i]*(d[i]-freq[l]*freq[l])+
1429  bb[i]*fric[i]*freq[l])/dd;
1430  bji[i]=(bb[i]*(d[i]-freq[l]*freq[l])-
1431  aa[i]*fric[i]*freq[l])/dd;
1432  }
1433  /* printf("old l=%" ITGFORMAT ",bjr=%f,bji=%f\n",l,bjr[0],bji[0]);*/
1434  }else{
1435  nev2=2*nev;
1436  NNEW(am,double,nev2*nev2);
1437  NNEW(bm,double,nev2);
1438  NNEW(ipiv,ITG,nev2);
1439 
1440  for(i=0;i<nev2;i++){
1441  for(j=0;j<nev2;j++){
1442  am[i*nev2+j]=0.;
1443  }
1444  bm[i]=0.;
1445  }
1446  for(i=0;i<nev;i++){
1447  am[i*nev2+i]=d[i]-freq[l]*freq[l];
1448  am[(i+nev)*nev2+i]=-fric[i]*freq[l];
1449  bm[i]=aa[i];
1450  am[i*nev2+nev+i]=-am[(i+nev)*nev2+i];
1451  am[(i+nev)*nev2+nev+i]=am[i*nev2+i];
1452  bm[nev+i]=bb[i];
1453  for(j=0;j<nev;j++){
1454  am[(j+nev)*nev2+i]=am[(j+nev)*nev2+i]
1455  -cc[i*nev+j]*freq[l];
1456  am[j*nev2+nev+i]=am[j*nev2+nev+i]
1457  +cc[i*nev+j]*freq[l];
1458  }
1459  }
1460 
1461  /* solving the system of equations */
1462 
1463  FORTRAN(dgesv,(&nev2,&nrhs,am,&nev2,ipiv,bm,&nev2,&info));
1464  if(info!=0){
1465  printf(" *ERROR in steadystate: fatal termination of dgesv\n");
1466  printf(" info=%" ITGFORMAT "\n",info);
1467  FORTRAN(stop,());
1468  }
1469 
1470  /* storing the solution in bjr and bji */
1471 
1472  for(i=0;i<nev;i++){
1473  bjr[i]=bm[i];
1474  bji[i]=bm[nev+i];
1475  }
1476 
1477  SFREE(am);SFREE(bm);SFREE(ipiv);
1478  }
1479  }else{
1480  nev2=2*nev;
1481  NNEW(am,double,nev2*nev2);
1482  NNEW(bm,double,nev2);
1483  NNEW(ipiv,ITG,nev2);
1484 
1485  NNEW(ax,double,nev);
1486  NNEW(bx,double,nev);
1487  for(i=0;i<nev;i++){
1488  ax[i]=-pow(freq[l],2)-freq[l]*fric[2*i+1]+d[2*i];
1489  bx[i]=-freq[l]*fric[2*i]-d[2*i+1];
1490  }
1491  for(i=0;i<nev;i++){
1492  for(j=0;j<nev;j++){
1493  am[j*nev2+i]=xmr[j*nev+i]*ax[j]+xmi[j*nev+i]*bx[j];
1494  am[(j+nev)*nev2+i]=xmr[j*nev+i]*bx[j]-xmi[j*nev+i]*bx[j];
1495  am[j*nev2+nev+i]=xmi[j*nev+i]*ax[j]-xmr[j*nev+i]*bx[j];
1496  am[(j+nev)*nev2+nev+i]=xmi[j*nev+i]*bx[j]+xmr[j*nev+i]*ax[j];
1497  }
1498  bm[i]=aa[i]-bb[nev+i];
1499  bm[nev+i]=bb[i]+aa[nev+i];
1500  }
1501  SFREE(ax);SFREE(bx);
1502 
1503  /* solving the system of equations */
1504 
1505  FORTRAN(dgesv,(&nev2,&nrhs,am,&nev2,ipiv,bm,&nev2,&info));
1506  if(info!=0){
1507  printf(" *ERROR in steadystate: fatal termination of dgesv\n");
1508  printf(" info=%" ITGFORMAT "\n",info);
1509  FORTRAN(stop,());
1510  }
1511 
1512  /* storing the solution in bjr and bji */
1513 
1514  for(i=0;i<nev;i++){
1515  bjr[i]=bm[i];
1516  bji[i]=bm[nev+i];
1517  }
1518 
1519  SFREE(am);SFREE(bm);SFREE(ipiv);
1520  }
1521 
1522  /* storing the participation factors */
1523 
1524  if(nherm==1){
1525  NNEW(eig,double,nev);
1526  for(i=0;i<nev;i++){
1527  eig[i]=sqrt(d[i]);
1528  }
1529  }else{
1530 
1531  NNEW(eig,double,2*nev);
1532  for(i=0;i<nev;i++){
1533  eig[2*i]=sqrt(sqrt(d[2*i]*d[2*i]+d[2*i+1]*d[2*i+1])+d[2*i])
1534  /sqrt(2.);
1535  eig[2*i+1]=sqrt(sqrt(d[2*i]*d[2*i]+d[2*i+1]*d[2*i+1])-d[2*i])
1536  /sqrt(2.);
1537  if(d[2*i+1]<0.) eig[2*i+1]=-eig[2*i+1];
1538  }
1539  }
1540 
1541  mode=0;
1542  FORTRAN(writepf,(eig,bjr,bji,&time,&nev,&mode,&nherm));
1543  SFREE(eig);
1544 
1545  /* calculating the real response */
1546 
1547  if(iprescribedboundary){
1548  if(nmdnode==0){
1549  memcpy(&br[0],&ubr[0],sizeof(double)*neq[1]);
1550  }else{
1551  for(i=0;i<nmddof;i++){
1552  br[imddof[i]]=ubr[imddof[i]];
1553  }
1554  }
1555  }
1556  else{
1557  if(nmdnode==0){
1558  DMEMSET(br,0,neq[1],0.);
1559  }else{
1560  for(i=0;i<nmddof;i++){
1561  br[imddof[i]]=0.;
1562  }
1563  }
1564  }
1565 
1566  if(!cyclicsymmetry){
1567  if(nmdnode==0){
1568  for(i=0;i<neq[1];i++){
1569  for(j=0;j<nev;j++){
1570  br[i]+=bjr[j]*z[(long long)j*neq[1]+i];
1571  }
1572  }
1573  }else{
1574  for(i=0;i<nmddof;i++){
1575  for(j=0;j<nev;j++){
1576  br[imddof[i]]+=bjr[j]*z[(long long)j*neq[1]+imddof[i]];
1577  }
1578  }
1579  }
1580  }else{
1581  for(i=0;i<nmddof;i++){
1582  FORTRAN(nident,(izdof,&imddof[i],&nzdof,&id));
1583  if(id!=0){
1584  if(izdof[id-1]==imddof[i]){
1585  for(j=0;j<nev;j++){
1586  br[imddof[i]]+=bjr[j]*z[(long long)j*nzdof+id-1];
1587  }
1588  }else{printf(" *ERROR in steadystate\n");FORTRAN(stop,());}
1589  }else{printf(" *ERROR in steadystate\n");FORTRAN(stop,());}
1590  }
1591  }
1592 
1593  if(nmdnode==0){
1594  DMEMSET(vr,0,mt**nk,0.);
1595  }else{
1596  for(jj=0;jj<nmdnode;jj++){
1597  i=imdnode[jj]-1;
1598  for(j=1;j<4;j++){
1599  vr[mt*i+j]=0.;
1600  }
1601  }
1602  }
1603 
1604  /* calculating the imaginary response */
1605 
1606  if(iprescribedboundary){
1607  if(nmdnode==0){
1608  memcpy(&bi[0],&ubi[0],sizeof(double)*neq[1]);
1609  }else{
1610  for(i=0;i<nmddof;i++){
1611  bi[imddof[i]]=ubi[imddof[i]];
1612  }
1613  }
1614  }
1615  else{
1616  if(nmdnode==0){
1617  DMEMSET(bi,0,neq[1],0.);
1618  }else{
1619  for(i=0;i<nmddof;i++){
1620  bi[imddof[i]]=0.;
1621  }
1622  }
1623  }
1624 
1625  if(!cyclicsymmetry){
1626  if(nmdnode==0){
1627  for(i=0;i<neq[1];i++){
1628  for(j=0;j<nev;j++){
1629  bi[i]+=bji[j]*z[(long long)j*neq[1]+i];
1630  }
1631  }
1632  }else{
1633  for(i=0;i<nmddof;i++){
1634  for(j=0;j<nev;j++){
1635  bi[imddof[i]]+=bji[j]*z[(long long)j*neq[1]+imddof[i]];
1636  }
1637  }
1638  }
1639  }else{
1640  for(i=0;i<nmddof;i++){
1641  FORTRAN(nident,(izdof,&imddof[i],&nzdof,&id));
1642  if(id!=0){
1643  if(izdof[id-1]==imddof[i]){
1644  for(j=0;j<nev;j++){
1645  bi[imddof[i]]+=bji[j]*z[(long long)j*nzdof+id-1];
1646  }
1647  }else{printf(" *ERROR in steadystate\n");FORTRAN(stop,());}
1648  }else{printf(" *ERROR in steadystate\n");FORTRAN(stop,());}
1649  }
1650  }
1651 
1652 
1653  if(nmdnode==0){
1654  DMEMSET(vi,0,mt**nk,0.);
1655  }else{
1656  for(jj=0;jj<nmdnode;jj++){
1657  i=imdnode[jj]-1;
1658  for(j=1;j<4;j++){
1659  vi[mt*i+j]=0.;
1660  }
1661  }
1662  }
1663 
1664  /* real response */
1665 
1666  if(iprescribedboundary){
1667 
1668  /* calculating displacements/temperatures */
1669 
1670  FORTRAN(dynresults,(nk,vr,ithermal,nactdof,vold,nodeboun,
1671  ndirboun,xbounr,nboun,ipompc,nodempc,coefmpc,labmpc,nmpc,
1672  br,bi,veold,&dtime,mi,imdnode,&nmdnode,imdboun,&nmdboun,
1673  imdmpc,&nmdmpc,nmethod,&timem));
1674 
1675  results(co,nk,kon,ipkon,lakon,ne,vr,stnr,inum,
1676  stx,elcon,nelcon,rhcon,nrhcon,alcon,nalcon,alzero,
1677  ielmat,ielorien,norien,orab,ntmat_,t0,t1,
1678  ithermal,prestr,iprestr,filab,eme,emn,een,
1679  iperturb,f,fn,nactdof,&iout,qa,
1680  vold,br,nodeboun,ndirboun,xbounr,nboun,
1681  ipompc,nodempc,coefmpc,labmpc,nmpc,nmethod,cam,&neq[1],
1682  veold,accold,&bet,&gam,&dtime,&time,&xnull,
1683  plicon,nplicon,plkcon,nplkcon,
1684  xstateini,xstiff,xstate,npmat_,epn,matname,mi,&ielas,
1685  &icmd,ncmat_,nstate_,stiini,vini,ikboun,ilboun,ener,
1686  enern,emeini,xstaten,eei,enerini,cocon,ncocon,
1687  set,nset,istartset,iendset,ialset,nprint,prlab,prset,
1688  qfx,qfn,trab,inotr,ntrans,fmpc,nelemload,nload,
1689  ikmpc,ilmpc,istep,&iinc,springarea,&reltime,&ne0,
1690  xforc,nforc,thicke,shcon,nshcon,
1691  sideload,xload,xloadold,&icfd,inomat,pslavsurf,pmastsurf,
1692  &mortar,islavact,cdn,islavnode,nslavnode,&ntie,clearini,
1693  islavsurf,ielprop,prop,energyini,energy,&iit,iponoel,
1694  inoel,nener,orname,&network,ipobody,xbodyact,ibody);}
1695  else{
1696 
1697  /* calculating displacements/temperatures */
1698 
1699  FORTRAN(dynresults,(nk,vr,ithermal,nactdof,vold,nodeboun,
1700  ndirboun,xbounact,nboun,ipompc,nodempc,coefmpc,labmpc,nmpc,
1701  br,bi,veold,&dtime,mi,imdnode,&nmdnode,imdboun,&nmdboun,
1702  imdmpc,&nmdmpc,nmethod,&timem));
1703 
1704  results(co,nk,kon,ipkon,lakon,ne,vr,stnr,inum,
1705  stx,elcon,nelcon,rhcon,nrhcon,alcon,nalcon,alzero,
1706  ielmat,ielorien,norien,orab,ntmat_,t0,t1,
1707  ithermal,prestr,iprestr,filab,eme,emn,een,
1708  iperturb,f,fn,nactdof,&iout,qa,
1709  vold,br,nodeboun,ndirboun,xbounact,nboun,
1710  ipompc,nodempc,coefmpc,labmpc,nmpc,nmethod,cam,&neq[1],
1711  veold,accold,&bet,&gam,&dtime,&time,&xnull,
1712  plicon,nplicon,plkcon,nplkcon,
1713  xstateini,xstiff,xstate,npmat_,epn,matname,mi,&ielas,
1714  &icmd,ncmat_,nstate_,stiini,vini,ikboun,ilboun,ener,
1715  enern,emeini,xstaten,eei,enerini,cocon,ncocon,
1716  set,nset,istartset,iendset,ialset,nprint,prlab,prset,
1717  qfx,qfn,trab,inotr,ntrans,fmpc,nelemload,nload,
1718  ikmpc,ilmpc,istep,&iinc,springarea,&reltime,&ne0,
1719  xforc,nforc,thicke,shcon,nshcon,
1720  sideload,xload,xloadold,&icfd,inomat,pslavsurf,pmastsurf,
1721  &mortar,islavact,cdn,islavnode,nslavnode,&ntie,
1722  clearini,islavsurf,ielprop,prop,energyini,energy,&iit,
1723  iponoel,inoel,nener,orname,&network,ipobody,xbodyact,
1724  ibody);
1725 
1726  if(nmdnode==0){
1727  DMEMSET(br,0,neq[1],0.);
1728  }else{
1729  for(i=0;i<nmddof;i++){
1730  br[imddof[i]]=0.;
1731  }
1732  }
1733  }
1734 
1735  (*kode)++;
1736 
1737  mode=-1;
1738  if(strcmp1(&filab[1044],"ZZS")==0){
1739  NNEW(neigh,ITG,40**ne);
1740  NNEW(ipneigh,ITG,*nk);
1741  }
1742 
1743  frd(co,&nkg,kon,ipkon,lakon,&neg,vr,stnr,inum,nmethod,
1744  kode,filab,een,t1,fn,&ptime,epn,ielmat,matname,enern,xstaten,
1745  nstate_,istep,&iinc,ithermal,qfn,&mode,&noddiam,trab,inotr,
1746  ntrans,orab,ielorien,norien,description,ipneigh,neigh,
1747  mi,stx,vr,vi,stnr,stni,vmax,stnmax,&ngraph,veold,ener,&neg,
1748  cs,set,nset,istartset,iendset,ialset,eenmax,fnr,fni,emn,
1749  thicke,jobnamec,output,qfx,cdn,&mortar,cdnr,cdni,nmat);
1750 
1751  if(strcmp1(&filab[1044],"ZZS")==0){SFREE(ipneigh);SFREE(neigh);}
1752 
1753  /* imaginary response */
1754 
1755  if(iprescribedboundary){
1756 
1757  /* calculating displacements/temperatures */
1758 
1759  FORTRAN(dynresults,(nk,vi,ithermal,nactdof,vold,nodeboun,
1760  ndirboun,xbouni,nboun,ipompc,nodempc,coefmpc,labmpc,nmpc,
1761  bi,br,veold,&dtime,mi,imdnode,&nmdnode,imdboun,&nmdboun,
1762  imdmpc,&nmdmpc,nmethod,&time));
1763 
1764  results(co,nk,kon,ipkon,lakon,ne,vi,stni,inum,
1765  stx,elcon,nelcon,rhcon,nrhcon,alcon,nalcon,alzero,
1766  ielmat,ielorien,norien,orab,ntmat_,t0,t1,
1767  ithermal,prestr,iprestr,filab,eme,emn,een,
1768  iperturb,f,fn,nactdof,&iout,qa,
1769  vold,bi,nodeboun,ndirboun,xbouni,nboun,
1770  ipompc,nodempc,coefmpc,labmpc,nmpc,nmethod,cam,&neq[1],
1771  veold,accold,&bet,&gam,&dtime,&time,&xnull,
1772  plicon,nplicon,plkcon,nplkcon,
1773  xstateini,xstiff,xstate,npmat_,epn,matname,mi,&ielas,
1774  &icmd,ncmat_,nstate_,stiini,vini,ikboun,ilboun,ener,
1775  enern,emeini,xstaten,eei,enerini,cocon,ncocon,
1776  set,nset,istartset,iendset,ialset,nprint,prlab,prset,
1777  qfx,qfn,trab,inotr,ntrans,fmpc,nelemload,nload,
1778  ikmpc,ilmpc,istep,&iinc,springarea,&reltime,&ne0,
1779  xforc,nforc,thicke,shcon,nshcon,
1780  sideload,xload,xloadold,&icfd,inomat,pslavsurf,pmastsurf,
1781  &mortar,islavact,cdn,islavnode,nslavnode,&ntie,clearini,
1782  islavsurf,ielprop,prop,energyini,energy,&iit,iponoel,
1783  inoel,nener,orname,&network,ipobody,xbodyact,ibody);}
1784  else{
1785 
1786  /* calculating displacements/temperatures */
1787 
1788  FORTRAN(dynresults,(nk,vi,ithermal,nactdof,vold,nodeboun,
1789  ndirboun,xbounact,nboun,ipompc,nodempc,coefmpc,labmpc,nmpc,
1790  bi,br,veold,&dtime,mi,imdnode,&nmdnode,imdboun,&nmdboun,
1791  imdmpc,&nmdmpc,nmethod,&time));
1792 
1793  results(co,nk,kon,ipkon,lakon,ne,vi,stni,inum,
1794  stx,elcon,nelcon,rhcon,nrhcon,alcon,nalcon,alzero,
1795  ielmat,ielorien,norien,orab,ntmat_,t0,t1,
1796  ithermal,prestr,iprestr,filab,eme,emn,een,
1797  iperturb,f,fn,nactdof,&iout,qa,
1798  vold,bi,nodeboun,ndirboun,xbounact,nboun,
1799  ipompc,nodempc,coefmpc,labmpc,nmpc,nmethod,cam,&neq[1],
1800  veold,accold,&bet,&gam,&dtime,&time,&xnull,
1801  plicon,nplicon,plkcon,nplkcon,
1802  xstateini,xstiff,xstate,npmat_,epn,matname,mi,&ielas,
1803  &icmd,ncmat_,nstate_,stiini,vini,ikboun,ilboun,ener,
1804  enern,emeini,xstaten,eei,enerini,cocon,ncocon,
1805  set,nset,istartset,iendset,ialset,nprint,prlab,prset,
1806  qfx,qfn,trab,inotr,ntrans,fmpc,nelemload,nload,
1807  ikmpc,ilmpc,istep,&iinc,springarea,&reltime,&ne0,
1808  xforc,nforc,thicke,shcon,nshcon,
1809  sideload,xload,xloadold,&icfd,inomat,pslavsurf,pmastsurf,
1810  &mortar,islavact,cdn,islavnode,nslavnode,&ntie,
1811  clearini,islavsurf,ielprop,prop,energyini,energy,&iit,
1812  iponoel,inoel,nener,orname,&network,ipobody,xbodyact,
1813  ibody);
1814 
1815  if(nmdnode==0){
1816  DMEMSET(bi,0,neq[1],0.);
1817  }else{
1818  for(i=0;i<nmddof;i++){
1819  bi[imddof[i]]=0.;
1820  }
1821  }
1822  }
1823 
1824  /* calculating the magnitude and phase */
1825 
1826  if(strcmp1(&filab[870],"PU")==0){
1827 
1828  constant=180./pi;
1829  NNEW(va,double,mt**nk);
1830  NNEW(vp,double,mt**nk);
1831 
1832  if(*ithermal<=1){
1833  if(nmdnode==0){
1834  for(i=0;i<*nk;i++){
1835  for(j=1;j<4;j++){
1836  vreal=vr[mt*i+j];
1837  va[mt*i+j]=sqrt(vr[mt*i+j]*vr[mt*i+j]+vi[mt*i+j]*vi[mt*i+j]);
1838  if(fabs(vreal)<1.e-10){
1839  if(vi[mt*i+j]>0.){vp[mt*i+j]=90.;}
1840  else{vp[mt*i+j]=-90.;}
1841  }
1842  else{
1843  vp[mt*i+j]=atan(vi[mt*i+j]/vreal)*constant;
1844  if(vreal<0.) vp[mt*i+j]+=180.;
1845  }
1846  }
1847  }
1848  }else{
1849  for(jj=0;jj<nmdnode;jj++){
1850  i=imdnode[jj]-1;
1851  for(j=1;j<4;j++){
1852  vreal=vr[mt*i+j];
1853  va[mt*i+j]=sqrt(vr[mt*i+j]*vr[mt*i+j]+vi[mt*i+j]*vi[mt*i+j]);
1854  if(fabs(vreal)<1.e-10){
1855  if(vi[mt*i+j]>0.){vp[mt*i+j]=90.;}
1856  else{vp[mt*i+j]=-90.;}
1857  }
1858  else{
1859  vp[mt*i+j]=atan(vi[mt*i+j]/vreal)*constant;
1860  if(vreal<0.) vp[mt*i+j]+=180.;
1861  }
1862  }
1863  }
1864  }
1865  }
1866  else{
1867  if(nmdnode==0){
1868  for(i=0;i<*nk;i++){
1869  vreal=vr[mt*i];
1870  va[mt*i]=sqrt(vr[mt*i]*vr[mt*i]+vi[mt*i]*vi[mt*i]);
1871  if(fabs(vreal)<1.e-10){
1872  if(vi[mt*i]>0){vp[mt*i]=90.;}
1873  else{vp[mt*i]=-90.;}
1874  }
1875  else{
1876  vp[mt*i]=atan(vi[mt*i]/vreal)*constant;
1877  if(vreal<0.) vp[mt*i]+=180.;
1878  }
1879  }
1880  }else{
1881  for(jj=0;jj<nmdnode;jj++){
1882  i=imdnode[jj]-1;
1883  vreal=vr[mt*i];
1884  va[mt*i]=sqrt(vr[mt*i]*vr[mt*i]+vi[mt*i]*vi[mt*i]);
1885  if(fabs(vreal)<1.e-10){
1886  if(vi[mt*i]>0){vp[mt*i]=90.;}
1887  else{vp[mt*i]=-90.;}
1888  }
1889  else{
1890  vp[mt*i]=atan(vi[mt*i]/vreal)*constant;
1891  if(vreal<0.) vp[mt*i]+=180.;
1892  }
1893  }
1894  }
1895  }
1896  }
1897 
1898  if(strcmp1(&filab[1479],"PHS")==0){
1899 
1900  constant=180./pi;
1901  NNEW(stna,double,6**nk);
1902  NNEW(stnp,double,6**nk);
1903 
1904  if(*ithermal<=1){
1905  if(nmdnode==0){
1906  for(i=0;i<*nk;i++){
1907  for(j=0;j<6;j++){
1908  vreal=stnr[6*i+j];
1909  stna[6*i+j]=sqrt(stnr[6*i+j]*stnr[6*i+j]+stni[6*i+j]*stni[6*i+j]);
1910  if(fabs(vreal)<1.e-10){
1911  if(stni[6*i+j]>0.){stnp[6*i+j]=90.;}
1912  else{stnp[6*i+j]=-90.;}
1913  }
1914  else{
1915  stnp[6*i+j]=atan(stni[6*i+j]/vreal)*constant;
1916  if(vreal<0.) stnp[6*i+j]+=180.;
1917  }
1918  }
1919  }
1920  }else{
1921  for(jj=0;jj<nmdnode;jj++){
1922  i=imdnode[jj]-1;
1923  for(j=0;j<6;j++){
1924  vreal=stnr[6*i+j];
1925  stna[6*i+j]=sqrt(stnr[6*i+j]*stnr[6*i+j]+stni[6*i+j]*stni[6*i+j]);
1926  if(fabs(vreal)<1.e-10){
1927  if(stni[6*i+j]>0.){stnp[6*i+j]=90.;}
1928  else{stnp[6*i+j]=-90.;}
1929  }
1930  else{
1931  stnp[6*i+j]=atan(stni[6*i+j]/vreal)*constant;
1932  if(vreal<0.) stnp[6*i+j]+=180.;
1933  }
1934  }
1935  }
1936  }
1937  }
1938  }
1939 
1940 // (*kode)++;
1941  mode=0;
1942 
1943  if(strcmp1(&filab[1044],"ZZS")==0){
1944  NNEW(neigh,ITG,40**ne);
1945  NNEW(ipneigh,ITG,*nk);
1946  }
1947 
1948  frd(co,&nkg,kon,ipkon,lakon,&neg,vi,stni,inum,nmethod,
1949  kode,filab,een,t1,fn,&ptime,epn,ielmat,matname,enern,xstaten,
1950  nstate_,istep,&iinc,ithermal,qfn,&mode,&noddiam,trab,inotr,
1951  ntrans,orab,ielorien,norien,description,ipneigh,neigh,
1952  mi,stx,va,vp,stna,stnp,vmax,stnmax,&ngraph,veold,ener,&neg,
1953  cs,set,nset,istartset,iendset,ialset,eenmax,fnr,fni,emn,
1954  thicke,jobnamec,output,qfx,cdn,&mortar,cdnr,cdni,nmat);
1955 
1956  if(strcmp1(&filab[1044],"ZZS")==0){SFREE(ipneigh);SFREE(neigh);}
1957 
1958  SFREE(va);SFREE(vp);SFREE(stna);SFREE(stnp);
1959 
1960  }
1961 
1962  /* restoring the imaginary loading */
1963 
1964  SFREE(iphaseforc);SFREE(xforcr);SFREE(xforci);
1965 
1966  SFREE(iphaseload);SFREE(xloadr);SFREE(xloadi);
1967 
1968  SFREE(xbodyr);SFREE(xbodyi);
1969 
1970  if(iprescribedboundary){
1971  for (i=0;i<*nboun;i++){
1972  if(iphaseboun[i]==1){
1973  nodeboun[i]=nodeboun[i]+*nk;
1974  }
1975  }
1976  SFREE(iphaseboun);
1977  }
1978 
1979  /* updating the loading at the end of the step;
1980  important in case the amplitude at the end of the step
1981  is not equal to one */
1982 
1983  for(k=0;k<*nboun;++k){xboun[k]=xbounact[k];}
1984  for(k=0;k<*nforc;++k){xforc[k]=xforcact[k];}
1985  for(k=0;k<2**nload;++k){xload[k]=xloadact[k];}
1986  for(k=0;k<7**nbody;k=k+7){xbody[k]=xbodyact[k];}
1987  if(*ithermal==1){
1988  for(k=0;k<*nk;++k){t1[k]=t1act[k];}
1989  }
1990 
1991  SFREE(br);SFREE(bi);SFREE(bjr);SFREE(bji),SFREE(freq);
1992  SFREE(xforcact);SFREE(xloadact);SFREE(xbounact);SFREE(aa);SFREE(bb);
1993  SFREE(ampli);SFREE(xbodyact);SFREE(vr);SFREE(vi);if(*nbody>0) SFREE(ipobody);
1994 
1995  if(*ithermal==1) SFREE(t1act);
1996 
1997  if(iprescribedboundary){
1998  if(*isolver==0){
1999 #ifdef SPOOLES
2000  spooles_cleanup();
2001 #endif
2002  }
2003  else if(*isolver==4){
2004 #ifdef SGI
2005  sgi_cleanup(token);
2006 #endif
2007  }
2008  else if(*isolver==5){
2009 #ifdef TAUCS
2010  tau_cleanup();
2011 #endif
2012  }
2013  else if(*isolver==7){
2014 #ifdef PARDISO
2015  pardiso_cleanup(&neq[1],&symmetryflag);
2016 #endif
2017  }
2018  SFREE(xbounr);SFREE(xbouni);SFREE(fr);SFREE(fi);SFREE(ubr);SFREE(ubi);
2019  SFREE(mubr);SFREE(mubi);
2020  }
2021 
2022  SFREE(ikactmechr);SFREE(ikactmechi);
2023 
2024  if(intpointvar==1){
2025  SFREE(fn);
2026  SFREE(stnr);SFREE(stni);SFREE(stx);SFREE(eei);
2027 
2028  if(*ithermal>1) {SFREE(qfn);SFREE(qfx);}
2029 
2030  if(strcmp1(&filab[261],"E ")==0) SFREE(een);
2031  if(strcmp1(&filab[522],"ENER")==0) SFREE(enern);
2032  if(strcmp1(&filab[2697],"ME ")==0) SFREE(emn);
2033 
2034  if(*nener==1){SFREE(stiini);SFREE(emeini);SFREE(enerini);}
2035  }
2036 
2037  }else{
2038 
2039  /* steady state response to a nonharmonic periodic loading */
2040 
2041  NNEW(ikactmech,ITG,neq[1]);
2042  nactmech=0;
2043 
2044  NNEW(xforcact,double,nfour**nforc);
2045  NNEW(xloadact,double,nfour*2**nload);
2046  NNEW(xbodyact,double,nfour*7**nbody);
2047  NNEW(xbounact,double,nfour**nboun);
2048  NNEW(xbounacttime,double,nfour**nboun);
2049  if(*ithermal==1) NNEW(t1act,double,*nk);
2050 
2051  NNEW(r,double,nfour);
2052  NNEW(wsave,double,2*nfour);
2053  NNEW(isave,ITG,15);
2054 
2055  /* check for nonzero SPC's */
2056 
2057  iprescribedboundary=0;
2058  for(i=0;i<*nboun;i++){
2059  if(fabs(xboun[i])>1.e-10){
2060  iprescribedboundary=1;
2061  break;
2062  }
2063  }
2064 
2065  if((iprescribedboundary)&&(cyclicsymmetry)){
2066  printf(" *ERROR in steadystate: prescribed boundaries are not allowed in combination with cyclic symmetry\n");
2067  FORTRAN(stop,());
2068  }
2069 
2070  /* calculating the damping coefficients = friction coefficient*2*eigenvalue */
2071 
2072  if(xmodal[10]<0){
2073  for(i=0;i<nev;i++){
2074  if(sqrt(d[i])>(1.e-10)){
2075  fric[i]=(alpham+betam*d[i]);
2076  }
2077  else {
2078  printf("*WARNING in steadystate: one of the frequencies is zero\n");
2079  printf(" no Rayleigh mass damping allowed\n");
2080  fric[i]=0.;
2081  }
2082  }
2083  }
2084  else{
2085  if(iprescribedboundary){
2086  printf(" *ERROR in steadystate: prescribed boundaries are not allowed in combination with direct modal damping\n");
2087  FORTRAN(stop,());
2088  }
2089 
2090  /*copy the damping coefficients for every eigenfrequencie from xmodal[11....] */
2091  if(nev<(ITG)xmodal[10]){
2092  imax=nev;
2093  printf("*WARNING in steadystate: too many modal damping coefficients applied\n");
2094  printf(" damping coefficients corresponding to nonexisting eigenvalues are ignored\n");
2095  }
2096  else{
2097  imax=(ITG)xmodal[10];
2098  }
2099  for(i=0; i<imax; i++){
2100  fric[i]=2.*sqrt(d[i])*xmodal[11+i];
2101  }
2102 
2103  }
2104 
2105  /* determining the load time history */
2106 
2107  NNEW(ampli,double,*nam); /* instantaneous amplitude */
2108 
2109  for(l=0;l<nfour;l++){
2110 
2111  time=tmin+(tmax-tmin)*(double)l/(double)nfour;
2112 
2113  FORTRAN(tempload,(xforcold,xforc,&xforcact[l**nforc],iamforc,nforc,
2114  xloadold,xload,&xloadact[l*2**nload],iamload,nload,ibody,xbody,
2115  nbody,xbodyold,&xbodyact[l*7**nbody],t1old,t1,t1act,
2116  iamt1,nk,amta,namta,nam,ampli,&time,&reltime,ttime,&dtime,
2117  ithermal,nmethod,xbounold,xboun,&xbounact[l**nboun],iamboun,nboun,
2118  nodeboun,ndirboun,nodeforc,ndirforc,istep,&iinc,co,vold,itg,&ntg,
2119  amname,ikboun,ilboun,nelemload,sideload,mi,
2120  ntrans,trab,inotr,veold,integerglob,doubleglob,tieset,istartset,
2121  iendset,ialset,&ntie,nmpc,ipompc,ikmpc,ilmpc,nodempc,coefmpc,
2122  ipobody,iponoel,inoel));
2123 
2124  }
2125 
2126  SFREE(ampli);
2127 
2128  for(i=0;i<l**nboun;i++){xbounacttime[i]=xbounact[i];}
2129 
2130  /* determining the load frequency history:
2131  frequency transform of the load time history */
2132 
2133  for(i=0;i<*nforc;i++){
2134  for(l=0;l<nfour;l++){
2135  r[l]=xforcact[l**nforc+i];
2136  }
2137  FORTRAN(drffti,(&nfour,wsave,isave));
2138  FORTRAN(drfftf,(&nfour,r,wsave,isave));
2139  for(l=0;l<nfour;l++){
2140  xforcact[l**nforc+i]=r[l]/nfour*2.;
2141  }
2142  xforcact[i]=xforcact[i]/2.;
2143  }
2144 
2145  for(i=0;i<*nload;i++){
2146  for(l=0;l<nfour;l++){
2147  r[l]=xloadact[l*2**nload+2*i];
2148  }
2149  FORTRAN(drffti,(&nfour,wsave,isave));
2150  FORTRAN(drfftf,(&nfour,r,wsave,isave));
2151  for(l=0;l<nfour;l++){
2152  xloadact[l*2**nload+2*i]=r[l]/nfour*2.;
2153  }
2154  xloadact[2*i]=xloadact[2*i]/2.;
2155  }
2156 
2157  for(i=0;i<*nbody;i++){
2158  for(l=0;l<nfour;l++){
2159  r[l]=xbodyact[l**nbody+7*i];
2160  }
2161  FORTRAN(drffti,(&nfour,wsave,isave));
2162  FORTRAN(drfftf,(&nfour,r,wsave,isave));
2163  for(l=0;l<nfour;l++){
2164  xbodyact[l**nbody+7*i]=r[l]/nfour*2.;
2165  }
2166  xbodyact[7*i]=xbodyact[7*i]/2.;
2167  }
2168 
2169  if(iprescribedboundary){
2170  for(i=0;i<*nboun;i++){
2171  for(l=0;l<nfour;l++){
2172  r[l]=xbounact[l**nboun+i];
2173  }
2174  FORTRAN(drffti,(&nfour,wsave,isave));
2175  FORTRAN(drfftf,(&nfour,r,wsave,isave));
2176  for(l=0;l<nfour;l++){
2177  xbounact[l**nboun+i]=r[l]/nfour*2.;
2178  }
2179  xbounact[i]=xbounact[i]/2.;
2180  }
2181 
2182  /* LU decomposition of the stiffness matrix */
2183 
2184  if(*isolver==0){
2185 #ifdef SPOOLES
2186  spooles_factor(ad,au,adb,aub,&sigma,icol,irow,&neq[1],&nzs[1],
2187  &symmetryflag,&inputformat,&nzs[2]);
2188 #else
2189  printf(" *ERROR in steadystate: the SPOOLES library is not linked\n\n");
2190  FORTRAN(stop,());
2191 #endif
2192  }
2193  else if(*isolver==4){
2194 #ifdef SGI
2195  token=1;
2196  sgi_factor(ad,au,adb,aub,&sigma,icol,irow,&neq[1],&nzs[1],token);
2197 #else
2198  printf(" *ERROR in steadystate: the SGI library is not linked\n\n");
2199  FORTRAN(stop,());
2200 #endif
2201  }
2202  else if(*isolver==5){
2203 #ifdef TAUCS
2204  tau_factor(ad,&au,adb,aub,&sigma,icol,&irow,&neq[1],&nzs[1]);
2205 #else
2206  printf(" *ERROR in steadystate: the TAUCS library is not linked\n\n");
2207  FORTRAN(stop,());
2208 #endif
2209  }
2210  else if(*isolver==7){
2211 #ifdef PARDISO
2212  pardiso_factor(ad,au,adb,aub,&sigma,icol,irow,&neq[1],&nzs[1],
2213  &symmetryflag,&inputformat,jq,&nzs[2]);
2214 #else
2215  printf(" *ERROR in steadystate: the PARDISO library is not linked\n\n");
2216  FORTRAN(stop,());
2217 #endif
2218  }
2219 
2220  }
2221 
2222  SFREE(r);SFREE(wsave);SFREE(isave);
2223 
2224  /* determining the frequency data points */
2225 
2226  NNEW(freqnh,double,ndata*(nev+1));
2227 
2228  ndatatot=0.;
2229  freqnh[0]=fmin;
2230  if(fabs(fmax-fmin)<1.e-10){
2231  ndatatot=1;
2232  }else{
2233 
2234  /* copy the eigenvalues and sort them in ascending order
2235  (important for values from distinct nodal diameters */
2236 
2237  NNEW(e,double,nev);
2238  for(i=0;i<nev;i++){e[i]=sqrt(d[i]);}
2239  FORTRAN(dsort,(e,&idummy,&nev,&iflag));
2240 
2241  for(i=0;i<nev;i++){
2242  if(i!=0){
2243  if(fabs(e[i]-e[i-1])<1.e-5){continue;}
2244  }
2245  if(e[i]>=fmin){
2246  if(e[i]<=fmax){
2247  for(j=1;j<ndata;j++){
2248  y=-1.+2.*j/((double)(ndata-1));
2249  if(fabs(y)<1.e-10){freqnh[ndatatot+j]=
2250  (freqnh[ndatatot]+e[i])/2.;}
2251  else{
2252  freqnh[ndatatot+j]=(freqnh[ndatatot]+e[i])/2.+
2253  (e[i]-freqnh[ndatatot])*pow(fabs(y),1./bias)
2254  *y/(2.*fabs(y));
2255  }
2256  }
2257  ndatatot+=ndata-1;
2258  }
2259  else{break;}
2260  }
2261  }
2262  SFREE(e);
2263  for(j=1;j<ndata;j++){
2264  y=-1.+2.*j/((double)(ndata-1));
2265  if(fabs(y)<1.e-10){freqnh[ndatatot+j]=
2266  (freqnh[ndatatot]+fmax)/2.;}
2267  else{
2268  freqnh[ndatatot+j]=(freqnh[ndatatot]+fmax)/2.+
2269  (fmax-freqnh[ndatatot])*pow(fabs(y),1./bias)*
2270  y/(2.*fabs(y));
2271  }
2272  }
2273  ndatatot+=ndata;
2274  }
2275  RENEW(freqnh,double,ndatatot);
2276 
2277  for(ii=0;ii<ndatatot;ii++){
2278  for(i=0;i<6*mi[0]**ne;i++){eme[i]=0.;}
2279 
2280  sprintf(description,"%12f",freqnh[ii]/(2.*pi));
2281 
2282  NNEW(xforcr,double,*nforc);
2283  NNEW(xloadr,double,2**nload);
2284  NNEW(xbodyr,double,7**nbody);
2285  for(k=0;k<7**nbody;k++){xbodyr[k]=xbody[k];}
2286  if(iprescribedboundary){
2287  NNEW(xbounr,double,*nboun);
2288  NNEW(fr,double,neq[1]); /* force corresponding to real particular solution */
2289  NNEW(ubr,double,neq[1]); /* real particular solution */
2290  NNEW(mubr,double,neq[1]); /* mass times real particular solution */
2291  }
2292 
2293  /* assigning the body forces to the elements */
2294 
2295  if(*nbody>0){
2296  ifreebody=*ne+1;
2297  NNEW(ipobody,ITG,2*ifreebody**nbody);
2298  for(k=1;k<=*nbody;k++){
2299  FORTRAN(bodyforce,(cbody,ibody,ipobody,nbody,set,istartset,
2300  iendset,ialset,&inewton,nset,&ifreebody,&k));
2301  RENEW(ipobody,ITG,2*(*ne+ifreebody));
2302  }
2303  RENEW(ipobody,ITG,2*(ifreebody-1));
2304  }
2305 
2306  NNEW(br,double,neq[1]); /* load rhs vector (real part) */
2307  NNEW(bi,double,neq[1]); /* load rhs vector (imaginary part) */
2308  NNEW(btot,double,nfour*neq[1]);
2309  NNEW(bp,double,nfour*neq[1]);
2310 
2311  NNEW(bjr,double,nev); /* real response modal decomposition */
2312  NNEW(bji,double,nev); /* imaginary response modal decomposition */
2313 
2314  NNEW(aa,double,nev); /* modal coefficients of the real loading */
2315  NNEW(bb,double,nev); /* modal coefficients of the imaginary loading */
2316 
2317  /* loop over all Fourier frequencies */
2318 
2319  NNEW(freq,double,nfour);
2320 
2321  for(l=0;l<nfour;l++){
2322 
2323  /* frequency */
2324 
2325  freq[l]=freqnh[ii]*floor((l+1.)/2.+0.1);
2326 
2327  /* calculating cc */
2328 
2329  if(dashpot){
2330  NNEW(adc,double,neq[1]);
2331  NNEW(auc,double,nzs[1]);
2332  FORTRAN(mafilldm,(co,nk,kon,ipkon,lakon,ne,nodeboun,
2333  ndirboun,xboun,nboun,
2334  ipompc,nodempc,coefmpc,nmpc,nodeforc,ndirforc,xforc,
2335  nforc,nelemload,sideload,xload,nload,xbody,ipobody,
2336  nbody,cgr,adc,auc,nactdof,icol,jq,irow,neq,nzl,nmethod,
2337  ikmpc,ilmpc,ikboun,ilboun,
2338  elcon,nelcon,rhcon,nrhcon,alcon,nalcon,alzero,ielmat,
2339  ielorien,norien,orab,ntmat_,
2340  t0,t0,ithermal,prestr,iprestr,vold,iperturb,sti,
2341  nzs,stx,adb,aub,iexpl,plicon,nplicon,plkcon,nplkcon,
2342  xstiff,npmat_,&dtime,matname,mi,ncmat_,
2343  ttime,&freq[l],istep,&iinc,ibody,clearini,&mortar,springarea,
2344  pslavsurf,pmastsurf,&reltime,&nasym));
2345 
2346  /* zc = damping matrix * eigenmodes */
2347 
2348  NNEW(zc,double,neq[1]*nev);
2349  for(i=0;i<nev;i++){
2350  FORTRAN(op,(&neq[1],&z[(long long)i*neq[1]],&zc[i*neq[1]],
2351  adc,auc,jq,irow));
2352  }
2353 
2354  /* cc is the reduced damping matrix (damping matrix mapped onto
2355  space spanned by eigenmodes) */
2356 
2357  for(i=0;i<nev*nev;i++){cc[i]=0.;}
2358  for(i=0;i<nev;i++){
2359  for(j=0;j<=i;j++){
2360  for(k=0;k<neq[1];k++){
2361  cc[i*nev+j]+=z[(long long)j*neq[1]+k]*zc[i*neq[1]+k];
2362  }
2363  }
2364  }
2365 
2366  /* symmetric part of cc matrix */
2367 
2368  for(i=0;i<nev;i++){
2369  for(j=i;j<nev;j++){
2370  cc[i*nev+j]=cc[j*nev+i];
2371  }
2372  }
2373  SFREE(zc);SFREE(adc);SFREE(auc);
2374  }
2375 
2376  /* loading for this frequency */
2377 
2378  for(i=0;i<*nforc;i++){
2379  xforcr[i]=xforcact[l**nforc+i];
2380  }
2381 
2382  for(i=0;i<*nload;i++){
2383  xloadr[2*i]=xloadact[l*2**nload+2*i];
2384  }
2385 
2386  for(i=0;i<*nbody;i++){
2387  xbodyr[7*i]=xbodyact[l**nbody+7*i];
2388  }
2389 
2390  /* calculating the instantaneous loading vector */
2391 
2392  FORTRAN(rhs,(co,nk,kon,ipkon,lakon,ne,
2393  ipompc,nodempc,coefmpc,nmpc,nodeforc,ndirforc,xforcr,
2394  nforc,nelemload,sideload,xloadr,nload,xbodyr,
2395  ipobody,nbody,cgr,br,nactdof,&neq[1],nmethod,
2396  ikmpc,ilmpc,elcon,nelcon,rhcon,nrhcon,
2397  alcon,nalcon,alzero,ielmat,ielorien,norien,orab,ntmat_,
2398  t0,t1act,ithermal,iprestr,vold,iperturb,iexpl,plicon,
2399  nplicon,plkcon,nplkcon,
2400  npmat_,ttime,&time,istep,&iinc,&dtime,physcon,ibody,
2401  xbodyold,&reltime,veold,matname,mi,ikactmech,&nactmech,
2402  ielprop,prop,sti,xstateini,xstate,nstate_));
2403 
2404  /* real modal coefficients */
2405 
2406  if(!iprescribedboundary){
2407  if(!cyclicsymmetry){
2408  for(i=0;i<nev;i++){
2409  i2=(long long)i*neq[1];
2410  aa[i]=0.;
2411  if(nactmech<neq[1]/2){
2412  for(j=0;j<nactmech;j++){
2413  aa[i]+=z[i2+ikactmech[j]]*br[ikactmech[j]];
2414  }
2415  }else{
2416  for(j=0;j<neq[1];j++){
2417  aa[i]+=z[i2+j]*br[j];
2418  }
2419  }
2420  }
2421  }else{
2422  for(i=0;i<nev;i++){aa[i]=0.;}
2423  for(j=0;j<nactmech;j++){
2424  for(i=0;i<nev;i++){
2425  FORTRAN(nident,(izdof,&ikactmech[j],&nzdof,&id));
2426  if(id!=0){
2427  if(izdof[id-1]==ikactmech[j]){
2428  aa[i]+=z[(long long)i*nzdof+id-1]*br[ikactmech[j]];
2429  }else{printf(" *ERROR in steadystate\n");FORTRAN(stop,());}
2430  }else{printf(" *ERROR in steadystate\n");FORTRAN(stop,());}
2431  }
2432  }
2433  }
2434 
2435  /* imaginary modal coefficients */
2436 
2437  for(i=0;i<nev;i++){
2438  bb[i]=0.;
2439  }
2440 
2441  }else{
2442 
2443  /* prescribed boundary conditions */
2444 
2445  /* next statement makes sure that br is reset to zero at the
2446  start of rhs.f */
2447 
2448  nactmech=neq[1];
2449 
2450  for(i=0;i<neq[1];i++){bi[i]=0.;}
2451 
2452  for(i=0;i<*nboun;i++){
2453  xbounr[i]=xbounact[l**nboun+i];
2454  }
2455 
2456  for(j=0;j<neq[1];j++){fr[j]=0.;ubr[j]=0.;}
2457  for(i=0;i<*nboun;i++){
2458  ic=neq[1]+i;
2459  for(j=jq[ic]-1;j<jq[ic+1]-1;j++){
2460  ir=irow[j]-1;
2461  fr[ir]=fr[ir]-au[j]*xbounr[i];
2462  ubr[ir]=fr[ir];
2463  }
2464  }
2465  if(*isolver==0){
2466 #ifdef SPOOLES
2467  spooles_solve(ubr,&neq[1]);
2468 #endif
2469  }
2470  else if(*isolver==4){
2471 #ifdef SGI
2472  sgi_solve(ubr,token);
2473 #endif
2474  }
2475  else if(*isolver==5){
2476 #ifdef TAUCS
2477  tau_solve(ubr,&neq[1]);
2478 #endif
2479  }
2480  else if(*isolver==7){
2481 #ifdef PARDISO
2482  pardiso_solve(ubr,&neq[1],&symmetryflag);
2483 #endif
2484  }
2485  FORTRAN(op,(&neq[1],ubr,mubr,adb,aub,jq,irow));
2486 
2487  for(i=0;i<neq[1];i++){
2488  br[i]+=freq[l]*(freq[l]*mubr[i]);
2489  bi[i]+=freq[l]*(-alpham*mubr[i]-betam*fr[i]);
2490  }
2491 
2492  /* real and imaginary modal coefficients */
2493 
2494  for(i=0;i<nev;i++){
2495  aa[i]=0.;
2496  for(j=0;j<neq[1];j++){
2497  aa[i]+=z[(long long)i*neq[1]+j]*br[j];
2498  }
2499  }
2500 
2501  for(i=0;i<nev;i++){
2502  bb[i]=0.;
2503  for(j=0;j<neq[1];j++){
2504  bb[i]+=z[(long long)i*neq[1]+j]*bi[j];
2505  }
2506  }
2507  }
2508 
2509  /* calculating the modal coefficients */
2510 
2511  if(dashpot==0){
2512  for(i=0;i<nev;i++){
2513  dd=pow(d[i]-pow(freq[l],2),2)+
2514  pow(fric[i],2)*pow(freq[l],2);
2515  bjr[i]=(aa[i]*(d[i]-freq[l]*freq[l])+
2516  bb[i]*fric[i]*freq[l])/dd;
2517  bji[i]=(bb[i]*(d[i]-freq[l]*freq[l])-
2518  aa[i]*fric[i]*freq[l])/dd;
2519  }
2520  }else{
2521  nev2=2*nev;
2522  NNEW(am,double,nev2*nev2);
2523  NNEW(bm,double,nev2);
2524  NNEW(ipiv,ITG,nev2);
2525 
2526  for(i=0;i<nev2;i++){
2527  for(j=0;j<nev2;j++){
2528  am[i*nev2+j]=0.;
2529  }
2530  bm[i]=0.;
2531  }
2532  for(i=0;i<nev;i++){
2533  am[i*nev2+i]=d[i]-freq[l]*freq[l];
2534  am[(i+nev)*nev2+i]=-fric[i]*freq[l];
2535  bm[i]=aa[i];
2536  am[i*nev2+nev+i]=-am[(i+nev)*nev2+i];
2537  am[(i+nev)*nev2+nev+i]=am[i*nev2+i];
2538  bm[nev+i]=bb[i];
2539  for(j=0;j<nev;j++){
2540  am[(j+nev)*nev2+i]=am[(j+nev)*nev2+i]
2541  -cc[i*nev+j]*freq[l];
2542  am[j*nev2+nev+i]=am[j*nev2+nev+i]
2543  +cc[i*nev+j]*freq[l];
2544  }
2545  }
2546 
2547  /* solving the system of equations */
2548 
2549  FORTRAN(dgesv,(&nev2,&nrhs,am,&nev2,ipiv,bm,&nev2,&info));
2550  if(info!=0){
2551  printf(" *ERROR in steadystate: fatal termination of dgesv\n");
2552  printf(" info=%" ITGFORMAT "\n",info);
2553 /* FORTRAN(stop,());*/
2554  }
2555 
2556  /* storing the solution in bjr and bji */
2557 
2558  for(i=0;i<nev;i++){
2559  bjr[i]=bm[i];
2560  bji[i]=bm[nev+i];
2561  }
2562 
2563  SFREE(am);SFREE(bm);SFREE(ipiv);
2564  }
2565 
2566  /* calculating the real response */
2567 
2568  if(iprescribedboundary){
2569  if(nmdnode==0){
2570  memcpy(&br[0],&ubr[0],sizeof(double)*neq[1]);
2571  }else{
2572  for(i=0;i<nmddof;i++){
2573  br[imddof[i]]=ubr[imddof[i]];
2574  }
2575  }
2576  }
2577  else{
2578  if(nmdnode==0){
2579  DMEMSET(br,0,neq[1],0.);
2580  }else{
2581  for(i=0;i<nmddof;i++){
2582  br[imddof[i]]=0.;
2583  }
2584  }
2585  }
2586 
2587  if(!cyclicsymmetry){
2588  if(nmdnode==0){
2589  for(i=0;i<neq[1];i++){
2590  for(j=0;j<nev;j++){
2591  br[i]+=bjr[j]*z[(long long)j*neq[1]+i];
2592  }
2593  }
2594  }else{
2595  for(i=0;i<nmddof;i++){
2596  for(j=0;j<nev;j++){
2597  br[imddof[i]]+=bjr[j]*z[(long long)j*neq[1]+imddof[i]];
2598  }
2599  }
2600  }
2601  }else{
2602  for(i=0;i<nmddof;i++){
2603  FORTRAN(nident,(izdof,&imddof[i],&nzdof,&id));
2604  if(id!=0){
2605  if(izdof[id-1]==imddof[i]){
2606  for(j=0;j<nev;j++){
2607  br[imddof[i]]+=bjr[j]*z[(long long)j*nzdof+id-1];
2608  }
2609  }else{printf(" *ERROR in steadystate\n");FORTRAN(stop,());}
2610  }else{printf(" *ERROR in steadystate\n");FORTRAN(stop,());}
2611  }
2612  }
2613 
2614  /* calculating the imaginary response */
2615 
2616  if(nmdnode==0){
2617  DMEMSET(bi,0,neq[1],0.);
2618  }else{
2619  for(i=0;i<nmddof;i++){
2620  bi[imddof[i]]=0.;
2621  }
2622  }
2623 
2624  if(!cyclicsymmetry){
2625  if(nmdnode==0){
2626  for(i=0;i<neq[1];i++){
2627  for(j=0;j<nev;j++){
2628  bi[i]+=bji[j]*z[(long long)j*neq[1]+i];
2629  }
2630  }
2631  }else{
2632  for(i=0;i<nmddof;i++){
2633  for(j=0;j<nev;j++){
2634  bi[imddof[i]]+=bji[j]*z[(long long)j*neq[1]+imddof[i]];
2635  }
2636  }
2637  }
2638  }else{
2639  for(i=0;i<nmddof;i++){
2640  FORTRAN(nident,(izdof,&imddof[i],&nzdof,&id));
2641  if(id!=0){
2642  if(izdof[id-1]==imddof[i]){
2643  for(j=0;j<nev;j++){
2644  bi[imddof[i]]+=bji[j]*z[(long long)j*nzdof+id-1];
2645  }
2646  }else{printf(" *ERROR in steadystate\n");FORTRAN(stop,());}
2647  }else{printf(" *ERROR in steadystate\n");FORTRAN(stop,());}
2648  }
2649  }
2650 
2651  if(nmdnode==0){
2652 
2653  /* magnitude and phase of the response */
2654 
2655  for(i=0;i<neq[1];i++){
2656  breal=br[i];
2657  br[i]=sqrt(br[i]*br[i]+bi[i]*bi[i]);
2658  if(fabs(breal)<1.e-10){
2659  if(bi[i]>0.){bi[i]=pi/2.;}
2660  else{bi[i]=-pi/2.;}
2661  }
2662  else{
2663  bi[i]=atan(bi[i]/breal);
2664  if(breal<0.){bi[i]+=pi;}
2665  }
2666  }
2667 
2668  /* correction for the sinus terms */
2669 
2670  if((l!=0)&&(2*(ITG)floor(l/2.+0.1)==l)){
2671  for(i=0;i<neq[1];i++){
2672 // bi[i]-=pi/2.;}
2673  bi[i]+=pi/2.;}
2674  }
2675 
2676  /* contribution to the time response */
2677 
2678  for(j=0;j<nfour;j++){
2679  time=tmin+2.*pi/freqnh[ii]*(double)j/(double)nfour;
2680  for(i=0;i<neq[1];i++){
2681  btot[j*neq[1]+i]+=br[i]*cos(freq[l]*time+bi[i]);
2682  bp[j*neq[1]+i]-=freq[l]*br[i]*sin(freq[l]*time+bi[i]);
2683  }
2684  }
2685  }else{
2686 
2687  /* magnitude and phase of the response */
2688 
2689  for(jj=0;jj<nmddof;jj++){
2690  i=imddof[jj];
2691  breal=br[i];
2692  br[i]=sqrt(br[i]*br[i]+bi[i]*bi[i]);
2693  if(fabs(breal)<1.e-10){
2694  if(bi[i]>0.){bi[i]=pi/2.;}
2695  else{bi[i]=-pi/2.;}
2696  }
2697  else{
2698  bi[i]=atan(bi[i]/breal);
2699  if(breal<0.){bi[i]+=pi;}
2700  }
2701  }
2702 
2703  /* correction for the sinus terms */
2704 
2705  if((l!=0)&&(2*(ITG)floor(l/2.+0.1)==l)){
2706  for(jj=0;jj<nmddof;jj++){
2707  i=imddof[jj];
2708 // bi[i]-=pi/2.;}
2709  bi[i]+=pi/2.;}
2710  }
2711 
2712  /* contribution to the time response */
2713 
2714  for(j=0;j<nfour;j++){
2715  time=tmin+2.*pi/freqnh[ii]*(double)j/(double)nfour;
2716  for(jj=0;jj<nmddof;jj++){
2717  i=imddof[jj];
2718  btot[j*neq[1]+i]+=br[i]*cos(freq[l]*time+bi[i]);
2719  bp[j*neq[1]+i]-=freq[l]*br[i]*sin(freq[l]*time+bi[i]);
2720  }
2721  }
2722  }
2723 
2724  /* resetting the part of br occupied by the variables to be printed
2725  to zero */
2726 
2727  if(!iprescribedboundary){
2728  if(nmdnode==0){
2729  DMEMSET(br,0,neq[1],0.);
2730  }else{
2731  for(i=0;i<nmddof;i++){
2732  br[imddof[i]]=0.;
2733  }
2734  }
2735  }
2736 
2737  }
2738 
2739  SFREE(xforcr);SFREE(xloadr);SFREE(xbodyr);SFREE(br);SFREE(bi);SFREE(freq);
2740  SFREE(bjr);SFREE(bji);SFREE(aa);SFREE(bb);
2741 
2742  if(*nbody>0) SFREE(ipobody);
2743  if(iprescribedboundary) {SFREE(xbounr);SFREE(fr);SFREE(ubr);SFREE(mubr);}
2744 
2745 
2746  /* result fields */
2747 
2748  NNEW(vr,double,mt**nk);
2749 
2750  if(intpointvar==1){
2751  NNEW(fn,double,mt**nk);
2752  NNEW(stn,double,6**nk);
2753  NNEW(stx,double,6*mi[0]**ne);
2754 
2755  if(*ithermal>1) {
2756  NNEW(qfn,double,3**nk);
2757  NNEW(qfx,double,3*mi[0]**ne);}
2758 
2759  if(strcmp1(&filab[261],"E ")==0) NNEW(een,double,6**nk);
2760  if(strcmp1(&filab[522],"ENER")==0) NNEW(enern,double,*nk);
2761  if(strcmp1(&filab[2697],"ME ")==0) NNEW(emn,double,6**nk);
2762 
2763  NNEW(eei,double,6*mi[0]**ne);
2764  if(*nener==1){
2765  NNEW(stiini,double,6*mi[0]**ne);
2766  NNEW(emeini,double,6*mi[0]**ne);
2767  NNEW(enerini,double,mi[0]**ne);}
2768  }
2769 
2770  /* storing the results */
2771 
2772  for(l=0;l<nfour;l++){
2773  time=tmin+2.*pi/freqnh[ii]*(double)l/(double)nfour;
2774  ptime=time;
2775 
2776  if(nmdnode==0){
2777  DMEMSET(vr,0,mt**nk,0.);
2778  }else{
2779  for(jj=0;jj<nmdnode;jj++){
2780  i=imdnode[jj]-1;
2781  for(j=1;j<4;j++){
2782  vr[mt*i+j]=0.;
2783  }
2784  }
2785  }
2786 
2787  /* calculating displacements/temperatures */
2788 
2789  *nmethod=4;
2790  FORTRAN(dynresults,(nk,vr,ithermal,nactdof,vold,nodeboun,
2791  ndirboun,&xbounacttime[l**nboun],nboun,ipompc,nodempc,
2792  coefmpc,labmpc,nmpc,&btot[l*neq[1]],&bp[l*neq[1]],veold,&dtime,mi,
2793  imdnode,&nmdnode,imdboun,&nmdboun,imdmpc,&nmdmpc,nmethod,&time));
2794  *nmethod=5;
2795 
2796  results(co,nk,kon,ipkon,lakon,ne,vr,stn,inum,
2797  stx,elcon,nelcon,rhcon,nrhcon,alcon,nalcon,alzero,
2798  ielmat,ielorien,norien,orab,ntmat_,t0,t1,
2799  ithermal,prestr,iprestr,filab,eme,emn,een,
2800  iperturb,f,fn,nactdof,&iout,qa,
2801  vold,&btot[l*neq[1]],nodeboun,ndirboun,
2802  &xbounacttime[l**nboun],nboun,
2803  ipompc,nodempc,coefmpc,labmpc,nmpc,nmethod,cam,&neq[1],
2804  veold,accold,&bet,&gam,&dtime,&time,&xnull,
2805  plicon,nplicon,plkcon,nplkcon,
2806  xstateini,xstiff,xstate,npmat_,epn,matname,mi,&ielas,
2807  &icmd,ncmat_,nstate_,stiini,vini,ikboun,ilboun,ener,
2808  enern,emeini,xstaten,eei,enerini,cocon,ncocon,
2809  set,nset,istartset,iendset,ialset,nprint,prlab,prset,
2810  qfx,qfn,trab,inotr,ntrans,fmpc,nelemload,nload,ikmpc,
2811  ilmpc,istep,&iinc,springarea,&reltime,&ne0,xforc,nforc,
2812  thicke,shcon,nshcon,
2813  sideload,xload,xloadold,&icfd,inomat,pslavsurf,pmastsurf,
2814  &mortar,islavact,cdn,islavnode,nslavnode,&ntie,clearini,
2815  islavsurf,ielprop,prop,energyini,energy,&iit,iponoel,
2816  inoel,nener,orname,&network,ipobody,xbodyact,ibody);
2817 
2818  (*kode)++;
2819  mode=-1;
2820 
2821  if(strcmp1(&filab[1044],"ZZS")==0){
2822  NNEW(neigh,ITG,40**ne);
2823  NNEW(ipneigh,ITG,*nk);
2824  }
2825 
2826  frd(co,&nkg,kon,ipkon,lakon,&neg,vr,stn,inum,nmethod,
2827  kode,filab,een,t1,fn,&ptime,epn,ielmat,matname,enern,xstaten,
2828  nstate_,istep,&iinc,ithermal,qfn,&mode,&noddiam,trab,inotr,
2829  ntrans,orab,ielorien,norien,description,ipneigh,neigh,
2830  mi,stx,vr,vi,stnr,stni,vmax,stnmax,&ngraph,veold,ener,&neg,
2831  cs,set,nset,istartset,iendset,ialset,eenmax,fnr,fni,emn,
2832  thicke,jobnamec,output,qfx,cdn,&mortar,cdnr,cdni,nmat);
2833 
2834  if(strcmp1(&filab[1044],"ZZS")==0){SFREE(ipneigh);SFREE(neigh);}
2835 
2836  }
2837 
2838  SFREE(vr);SFREE(btot);SFREE(bp);
2839 
2840  if(intpointvar==1){
2841  SFREE(fn);SFREE(stn);SFREE(stx);SFREE(eei);
2842  if(*ithermal>1) {SFREE(qfn);SFREE(qfx);}
2843 
2844  if(strcmp1(&filab[261],"E ")==0) SFREE(een);
2845  if(strcmp1(&filab[522],"ENER")==0) SFREE(enern);
2846  if(strcmp1(&filab[2697],"ME ")==0) SFREE(emn);
2847 
2848  if(*nener==1){SFREE(stiini);SFREE(emeini);SFREE(enerini);}
2849  }
2850 
2851  }
2852  SFREE(xforcact);SFREE(xloadact);SFREE(xbodyact);SFREE(xbounact);
2853  SFREE(xbounacttime);SFREE(freqnh);
2854  if(*ithermal==1) SFREE(t1act);
2855  if(iprescribedboundary){
2856  if(*isolver==0){
2857 #ifdef SPOOLES
2858  spooles_cleanup();
2859 #endif
2860  }
2861  else if(*isolver==4){
2862 #ifdef SGI
2863  sgi_cleanup(token);
2864 #endif
2865  }
2866  else if(*isolver==5){
2867 #ifdef TAUCS
2868  tau_cleanup();
2869 #endif
2870  }
2871  else if(*isolver==7){
2872 #ifdef PARDISO
2873  pardiso_cleanup(&neq[1],&symmetryflag);
2874 #endif
2875  }
2876  }
2877 
2878  SFREE(ikactmech);
2879 
2880  }
2881 
2882  SFREE(adb);SFREE(aub);SFREE(z);SFREE(d);SFREE(inum);
2883 
2884  if(!cyclicsymmetry){
2885  SFREE(ad);SFREE(au);
2886  }else{
2887  SFREE(izdof);SFREE(nm);
2888 
2889  *nk/=nsectors;
2890  *ne/=nsectors;
2891  *nboun/=nsectors;
2892  neq[1]=neq[1]*2/nsectors;
2893 
2894  RENEW(co,double,3**nk);
2895  if(*ithermal!=0){
2896  RENEW(t0,double,*nk);
2897  RENEW(t1old,double,*nk);
2898  RENEW(t1,double,*nk);
2899  if(*nam>0) RENEW(iamt1,ITG,*nk);
2900  }
2901  RENEW(nactdof,ITG,mt**nk);
2902  if(*ntrans>0) RENEW(inotr,ITG,2**nk);
2903  RENEW(kon,ITG,*nkon);
2904  RENEW(ipkon,ITG,*ne);
2905  RENEW(lakon,char,8**ne);
2906  RENEW(ielmat,ITG,mi[2]**ne);
2907  if(*norien>0) RENEW(ielorien,ITG,mi[2]**ne);
2908  RENEW(nodeboun,ITG,*nboun);
2909  RENEW(ndirboun,ITG,*nboun);
2910  if(*nam>0) RENEW(iamboun,ITG,*nboun);
2911  RENEW(xboun,double,*nboun);
2912  RENEW(xbounold,double,*nboun);
2913  RENEW(ikboun,ITG,*nboun);
2914  RENEW(ilboun,ITG,*nboun);
2915 
2916  /* recovering the original multiple point constraints */
2917 
2918  RENEW(ipompc,ITG,*nmpc);
2919  RENEW(nodempc,ITG,3**mpcend);
2920  RENEW(coefmpc,double,*mpcend);
2921  RENEW(labmpc,char,20**nmpc+1);
2922  RENEW(ikmpc,ITG,*nmpc);
2923  RENEW(ilmpc,ITG,*nmpc);
2924  RENEW(fmpc,double,*nmpc);
2925 
2926  *nmpc=nmpcold;
2927  *mpcend=mpcendold;
2928  for(i=0;i<*nmpc;i++){ipompc[i]=ipompcold[i];}
2929  for(i=0;i<3**mpcend;i++){nodempc[i]=nodempcold[i];}
2930  for(i=0;i<*mpcend;i++){coefmpc[i]=coefmpcold[i];}
2931  for(i=0;i<20**nmpc;i++){labmpc[i]=labmpcold[i];}
2932  for(i=0;i<*nmpc;i++){ikmpc[i]=ikmpcold[i];}
2933  for(i=0;i<*nmpc;i++){ilmpc[i]=ilmpcold[i];}
2934  SFREE(ipompcold);SFREE(nodempcold);SFREE(coefmpcold);
2935  SFREE(labmpcold);SFREE(ikmpcold);SFREE(ilmpcold);
2936 
2937  RENEW(vold,double,mt**nk);
2938  RENEW(veold,double,mt**nk);
2939  RENEW(eme,double,6*mi[0]**ne);
2940  if(*nener==1)RENEW(ener,double,mi[0]**ne);
2941 
2942 /* distributed loads */
2943 
2944  for(i=0;i<*nload;i++){
2945  if(nelemload[2*i]<=*ne*nsectors){
2946  nelemload[2*i]-=*ne*nelemload[2*i+1];
2947  }else{
2948  nelemload[2*i]-=*ne*(nsectors+nelemload[2*i+1]-1);
2949  }
2950  }
2951 
2952  /* sorting the elements with distributed loads */
2953 
2954  if(*nload>0){
2955  if(*nam>0){
2956  FORTRAN(isortiiddc,(nelemload,iamload,xload,xloadold,sideload,nload,&kflag));
2957  }else{
2958  FORTRAN(isortiddc,(nelemload,xload,xloadold,sideload,nload,&kflag));
2959  }
2960  }
2961 
2962 /* point loads */
2963 
2964  for(i=0;i<*nforc;i++){
2965  if(nodeforc[2*i]<=*nk*nsectors){
2966  nodeforc[2*i]-=*nk*nodeforc[2*i+1];
2967  }else{
2968  nodeforc[2*i]-=*nk*(nsectors+nodeforc[2*i+1]-1);
2969  }
2970  }
2971  }
2972 
2973  SFREE(xstiff);SFREE(fric);
2974 
2975  if(dashpot){SFREE(cc);}
2976 
2977  if(nherm!=1){SFREE(xmr);SFREE(xmi);}
2978 
2979  SFREE(imddof);SFREE(imdnode);SFREE(imdboun);SFREE(imdmpc);SFREE(imdelem);
2980 
2981  *cop=co;*konp=kon;*ipkonp=ipkon;*lakonp=lakon;*ielmatp=ielmat;
2982  *ielorienp=ielorien;*inotrp=inotr;*nodebounp=nodeboun;
2983  *ndirbounp=ndirboun;*iambounp=iamboun;*xbounp=xboun;*veoldp=veold;
2984  *xbounoldp=xbounold;*ikbounp=ikboun;*ilbounp=ilboun;*nactdofp=nactdof;
2985  *voldp=vold;*emep=eme;*enerp=ener;*ipompcp=ipompc;*nodempcp=nodempc;
2986  *coefmpcp=coefmpc;*labmpcp=labmpc;*ikmpcp=ikmpc;*ilmpcp=ilmpc;
2987  *fmpcp=fmpc;*iamt1p=iamt1;*t0p=t0;*t1oldp=t1old;*t1p=t1;
2988 
2989 // (*ttime)+=(*tper);
2990 
2991  return;
2992 }
#define ITGFORMAT
Definition: CalculiX.h:52
void spooles_solve(double *b, ITG *neq)
void frd(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne0, double *v, double *stn, ITG *inum, ITG *nmethod, ITG *kode, char *filab, double *een, double *t1, double *fn, double *time, double *epn, ITG *ielmat, char *matname, double *enern, double *xstaten, ITG *nstate_, ITG *istep, ITG *iinc, ITG *ithermal, double *qfn, ITG *mode, ITG *noddiam, double *trab, ITG *inotr, ITG *ntrans, double *orab, ITG *ielorien, ITG *norien, char *description, ITG *ipneigh, ITG *neigh, ITG *mi, double *stx, double *vr, double *vi, double *stnr, double *stni, double *vmax, double *stnmax, ITG *ngraph, double *veold, double *ener, ITG *ne, double *cs, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, double *eenmax, double *fnr, double *fni, double *emn, double *thicke, char *jobnamec, char *output, double *qfx, double *cdn, ITG *mortar, double *cdnr, double *cdni, ITG *nmat)
Definition: frd.c:32
subroutine drfftf(N, R, WSAVE, isave)
Definition: drfftf.f:467
subroutine mafilldm(co, nk, kon, ipkon, lakon, ne, nodeboun, ndirboun, xboun, nboun, ipompc, nodempc, coefmpc, nmpc, nodeforc, ndirforc, xforc, nforc, nelemload, sideload, xload, nload, xbody, ipobody, nbody, cgr, ad, au, nactdof, icol, jq, irow, neq, nzl, nmethod, ikmpc, ilmpc, ikboun, ilboun, elcon, nelcon, rhcon, nrhcon, alcon, nalcon, alzero, ielmat, ielorien, norien, orab, ntmat_, t0, t1, ithermal, prestr, iprestr, vold, iperturb, sti, nzs, stx, adb, aub, iexpl, plicon, nplicon, plkcon, nplkcon, xstiff, npmat_, dtime, matname, mi, ncmat_, ttime, time, istep, iinc, ibody, clearini, mortar, springarea, pslavsurf, pmastsurf, reltime, nasym)
Definition: mafilldm.f:31
void sgi_solve(double *b, ITG token)
ITG strcpy1(char *s1, const char *s2, ITG length)
Definition: strcpy1.c:24
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
subroutine elementpernode(iponoel, inoel, lakon, ipkon, kon, ne, inoelsize)
Definition: elementpernode.f:21
subroutine op(n, x, y, ad, au, jq, irow)
Definition: op.f:26
ITG strcmp1(const char *s1, const char *s2)
Definition: strcmp1.c:24
void pardiso_cleanup(ITG *neq, ITG *symmetryflag)
subroutine tempload(xforcold, xforc, xforcact, iamforc, nforc, xloadold, xload, xloadact, iamload, nload, ibody, xbody, nbody, xbodyold, xbodyact, t1old, t1, t1act, iamt1, nk, amta, namta, nam, ampli, time, reltime, ttime, dtime, ithermal, nmethod, xbounold, xboun, xbounact, iamboun, nboun, nodeboun, ndirboun, nodeforc, ndirforc, istep, iinc, co, vold, itg, ntg, amname, ikboun, ilboun, nelemload, sideload, mi, ntrans, trab, inotr, veold, integerglob, doubleglob, tieset, istartset, iendset, ialset, ntie, nmpc, ipompc, ikmpc, ilmpc, nodempc, coefmpc, ipobody, iponoel, inoel)
Definition: tempload.f:29
#define DMEMSET(a, b, c, d)
Definition: CalculiX.h:45
subroutine addimdnodedload(nelemload, sideload, ipkon, kon, lakon, iload, imdnode, nmdnode, ikmpc, ilmpc, ipompc, nodempc, nmpc, imddof, nmddof, nactdof, mi, imdmpc, nmdmpc, imdboun, nmdboun, ikboun, nboun, ilboun, ithermal)
Definition: addimdnodedload.f:23
subroutine dgesv(N, NRHS, A, LDA, IPIV, B, LDB, INFO)
Definition: dgesv.f:58
subroutine stop()
Definition: stop.f:20
void sgi_cleanup(ITG token)
void tau_cleanup()
void sgi_factor(double *ad, double *au, double *adb, double *aub, double *sigma, ITG *icol, ITG *irow, ITG *neq, ITG *nzs, ITG token)
void pardiso_factor(double *ad, double *au, double *adb, double *aub, double *sigma, ITG *icol, ITG *irow, ITG *neq, ITG *nzs, ITG *symmetryflag, ITG *inputformat, ITG *jq, ITG *nzs3)
subroutine writepf(d, bjr, bji, freq, nev, mode, nherm)
Definition: writepf.f:20
subroutine createmdelem(imdnode, nmdnode, xforc, ikmpc, ilmpc, ipompc, nodempc, nmpc, imddof, nmddof, nactdof, mi, imdmpc, nmdmpc, imdboun, nmdboun, ikboun, nboun, ilboun, ithermal, imdelem, nmdelem, iponoel, inoel, prlab, prset, nprint, lakon, set, nset, ialset, ipkon, kon, istartset, iendset, nforc, ikforc, ilforc)
Definition: createmdelem.f:26
#define RENEW(a, b, c)
Definition: CalculiX.h:40
#define SFREE(a)
Definition: CalculiX.h:41
static double * f1
Definition: objectivemain_se.c:47
subroutine nident(x, px, n, id)
Definition: nident.f:26
subroutine isortiiddc(ix1, ix2, dy1, dy2, cy, n, kflag)
Definition: isortiiddc.f:6
subroutine drffti(N, WSAVE, isave)
Definition: drfftf.f:534
void tau_solve(double *b, ITG *neq)
subroutine isortiddc(ix, dy1, dy2, cy, n, kflag)
Definition: isortiddc.f:6
subroutine createinum(ipkon, inum, kon, lakon, nk, ne, cflag, nelemload, nload, nodeboun, nboun, ndirboun, ithermal, co, vold, mi, ielmat)
Definition: createinum.f:21
void spooles_factor(double *ad, double *au, double *adb, double *aub, double *sigma, ITG *icol, ITG *irow, ITG *neq, ITG *nzs, ITG *symmetryflag, ITG *inputformat, ITG *nzs3)
subroutine addimdnodecload(nodeforc, iforc, imdnode, nmdnode, xforc, ikmpc, ilmpc, ipompc, nodempc, nmpc, imddof, nmddof, nactdof, mi, imdmpc, nmdmpc, imdboun, nmdboun, ikboun, nboun, ilboun, ithermal)
Definition: addimdnodecload.f:24
void spooles_cleanup()
void expand(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, char *labmpc, ITG *nmpc, ITG *nodeforc, ITG *ndirforc, double *xforc, ITG *nforc, ITG *nelemload, char *sideload, double *xload, ITG *nload, ITG *nactdof, ITG *neq, ITG *nmethod, ITG *ikmpc, ITG *ilmpc, ITG *ikboun, ITG *ilboun, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, ITG *ithermal, double *prestr, ITG *iprestr, double *vold, ITG *iperturb, double *sti, ITG *nzs, double *adb, double *aub, char *filab, double *eme, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstate, ITG *npmat_, char *matname, ITG *mi, ITG *ics, double *cs, ITG *mpcend, ITG *ncmat_, ITG *nstate_, ITG *mcs, ITG *nkon, double *ener, char *jobnamec, char *output, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nprint, char *prlab, char *prset, ITG *nener, double *trab, ITG *inotr, ITG *ntrans, double *ttime, double *fmpc, ITG *nev, double **z, ITG *iamboun, double *xbounold, ITG *nsectors, ITG *nm, ITG *icol, ITG *irow, ITG *nzl, ITG *nam, ITG *ipompcold, ITG *nodempcold, double *coefmpcold, char *labmpcold, ITG *nmpcold, double *xloadold, ITG *iamload, double *t1old, double *t1, ITG *iamt1, double *xstiff, ITG **icolep, ITG **jqep, ITG **irowep, ITG *isolver, ITG *nzse, double **adbep, double **aubep, ITG *iexpl, ITG *ibody, double *xbody, ITG *nbody, double *cocon, ITG *ncocon, char *tieset, ITG *ntie, ITG *imddof, ITG *nmddof, ITG *imdnode, ITG *nmdnode, ITG *imdboun, ITG *nmdboun, ITG *imdmpc, ITG *nmdmpc, ITG **izdofp, ITG *nzdof, ITG *nherm, double *xmr, double *xmi, char *typeboun, ITG *ielprop, double *prop, char *orname)
Definition: expand.c:33
subroutine rhs(co, nk, kon, ipkon, lakon, ne, ipompc, nodempc, coefmpc, nmpc, nodeforc, ndirforc, xforc, nforc, nelemload, sideload, xload, nload, xbody, ipobody, nbody, cgr, fext, nactdof, neq, nmethod, ikmpc, ilmpc, elcon, nelcon, rhcon, nrhcon, alcon, nalcon, alzero, ielmat, ielorien, norien, orab, ntmat_, t0, t1, ithermal, iprestr, vold, iperturb, iexpl, plicon, nplicon, plkcon, nplkcon, npmat_, ttime, time, istep, iinc, dtime, physcon, ibody, xloadold, reltime, veold, matname, mi, ikactmech, nactmech, ielprop, prop, sti, xstateini, xstate, nstate_)
Definition: rhs.f:29
subroutine dsort(dx, iy, n, kflag)
Definition: dsort.f:6
#define ITG
Definition: CalculiX.h:51
void results(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, double *v, double *stn, ITG *inum, double *stx, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, double *prestr, ITG *iprestr, char *filab, double *eme, double *emn, double *een, ITG *iperturb, double *f, double *fn, ITG *nactdof, ITG *iout, double *qa, double *vold, double *b, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, char *labmpc, ITG *nmpc, ITG *nmethod, double *vmax, ITG *neq, double *veold, double *accold, double *beta, double *gamma, double *dtime, double *time, double *ttime, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstateini, double *xstiff, double *xstate, ITG *npmat_, double *epl, char *matname, ITG *mi, ITG *ielas, ITG *icmd, ITG *ncmat_, ITG *nstate_, double *stiini, double *vini, ITG *ikboun, ITG *ilboun, double *ener, double *enern, double *emeini, double *xstaten, double *eei, double *enerini, double *cocon, ITG *ncocon, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nprint, char *prlab, char *prset, double *qfx, double *qfn, double *trab, ITG *inotr, ITG *ntrans, double *fmpc, ITG *nelemload, ITG *nload, ITG *ikmpc, ITG *ilmpc, ITG *istep, ITG *iinc, double *springarea, double *reltime, ITG *ne0, double *xforc, ITG *nforc, double *thicke, double *shcon, ITG *nshcon, char *sideload, double *xload, double *xloadold, ITG *icfd, ITG *inomat, double *pslavsurf, double *pmastsurf, ITG *mortar, ITG *islavact, double *cdn, ITG *islavnode, ITG *nslavnode, ITG *ntie, double *clearini, ITG *islavsurf, ITG *ielprop, double *prop, double *energyini, double *energy, ITG *kscale, ITG *iponoel, ITG *inoel, ITG *nener, char *orname, ITG *network, ITG *ipobody, double *xbodyact, ITG *ibody)
Definition: results.c:42
void tau_factor(double *ad, double **aup, double *adb, double *aub, double *sigma, ITG *icol, ITG **irowp, ITG *neq, ITG *nzs)
void pardiso_solve(double *b, ITG *neq, ITG *symmetryflag)
subroutine createmddof(imddof, nmddof, istartset, iendset, ialset, nactdof, ithermal, mi, imdnode, nmdnode, ikmpc, ilmpc, ipompc, nodempc, nmpc, imdmpc, nmdmpc, imdboun, nmdboun, ikboun, nboun, nset, ntie, tieset, set, lakon, kon, ipkon, labmpc, ilboun, filab, prlab, prset, nprint, ne, cyclicsymmetry)
Definition: createmddof.f:25
#define NNEW(a, b, c)
Definition: CalculiX.h:39
subroutine bodyforce(cbody, ibody, ipobody, nbody, set, istartset, iendset, ialset, inewton, nset, ifreebody, k)
Definition: bodyforce.f:21
subroutine dynresults(nk, v, ithermal, nactdof, vold, nodeboun, ndirboun, xboun, nboun, ipompc, nodempc, coefmpc, labmpc, nmpc, b, bp, veold, dtime, mi, imdnode, nmdnode, imdboun, nmdboun, imdmpc, nmdmpc, nmethod, time)
Definition: dynresults.f:23

◆ storecontactdof()

void storecontactdof ( ITG nope,
ITG nactdof,
ITG mt,
ITG konl,
ITG **  ikactcontp,
ITG nactcont,
ITG nactcont_,
double *  bcont,
double *  fnl,
ITG ikmpc,
ITG nmpc,
ITG ilmpc,
ITG ipompc,
ITG nodempc,
double *  coefmpc 
)
39  {
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 }
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
#define RENEW(a, b, c)
Definition: CalculiX.h:40
subroutine nident(x, px, n, id)
Definition: nident.f:26
#define ITG
Definition: CalculiX.h:51

◆ strcmp1()

ITG strcmp1 ( const char *  s1,
const char *  s2 
)
25 {
26  ITG a,b;
27 
28  do {
29  a=*s1++;
30  b=*s2++;
31 
32 /* the statement if((a=='\0')||(b=='\0')) has been treated separately
33  in order to avoid the first field (s1) to be defined one longer
34  than required; s1 is assumed to be a variable field, s2 is
35  assumed to be a fixed string */
36 
37  if(b=='\0'){
38  a='\0';
39  b='\0';
40  break;
41  }
42  if(a=='\0'){
43  a='\0';
44  b='\0';
45  break;
46  }
47  }while(a==b);
48  return(a-b);
49 }
#define ITG
Definition: CalculiX.h:51

◆ strcmp2()

ITG strcmp2 ( const char *  s1,
const char *  s2,
ITG  length 
)
25 {
26 
27 /* comparison of the first "length" characters unless s1
28  and/or s2 has less characters */
29 
30  ITG a,b,i;
31 
32  i=0;
33  do {
34  a=*s1++;
35  b=*s2++;
36 
37  if(b=='\0'){
38  a='\0';
39  b='\0';
40  break;
41  }
42  if(a=='\0'){
43  a='\0';
44  b='\0';
45  break;
46  }
47  i++;
48  }while((a==b)&&(i<length));
49  return(a-b);
50 }
#define ITG
Definition: CalculiX.h:51

◆ strcpy1()

ITG strcpy1 ( char *  s1,
const char *  s2,
ITG  length 
)
25 {
26  ITG b,i,blank=0;
27 
28  for(i=0;i<length;i++) {
29  if(blank==0){
30  b=*s2;
31  if(b=='\0')blank=1;
32  }
33  if(blank==0) {*s1=*s2;s2++;}
34  else *s1=' ';
35  s1++;
36  }
37  return 0;
38 }
#define ITG
Definition: CalculiX.h:51

◆ stress_sen()

void stress_sen ( double *  co,
ITG nk,
ITG kon,
ITG ipkon,
char *  lakon,
ITG ne,
double *  stn,
double *  elcon,
ITG nelcon,
double *  rhcon,
ITG nrhcon,
double *  alcon,
ITG nalcon,
double *  alzero,
ITG ielmat,
ITG ielorien,
ITG norien,
double *  orab,
ITG ntmat_,
double *  t0,
double *  t1,
ITG ithermal,
double *  prestr,
ITG iprestr,
char *  filab,
double *  emn,
double *  een,
ITG iperturb,
double *  f,
ITG nactdof,
double *  vold,
ITG nodeboun,
ITG ndirboun,
double *  xboun,
ITG nboun,
ITG ipompc,
ITG nodempc,
double *  coefmpc,
char *  labmpc,
ITG nmpc,
ITG nmethod,
double *  cam,
ITG neq,
double *  veold,
double *  accold,
double *  bet,
double *  gam,
double *  dtime,
double *  time,
double *  ttime,
double *  plicon,
ITG nplicon,
double *  plkcon,
ITG nplkcon,
double *  xstateini,
double *  xstate,
ITG npmat_,
double *  epn,
char *  matname,
ITG mi,
ITG ielas,
ITG ncmat_,
ITG nstate_,
double *  stiini,
double *  vini,
ITG ikboun,
ITG ilboun,
double *  enern,
double *  emeini,
double *  xstaten,
double *  enerini,
double *  cocon,
ITG ncocon,
char *  set,
ITG nset,
ITG istartset,
ITG iendset,
ITG ialset,
ITG nprint,
char *  prlab,
char *  prset,
double *  qfx,
double *  qfn,
double *  trab,
ITG inotr,
ITG ntrans,
double *  fmpc,
ITG nelemload,
ITG nload,
ITG ikmpc,
ITG ilmpc,
ITG istep,
ITG iinc,
double *  springarea,
double *  reltime,
ITG ne0,
double *  xforc,
ITG nforc,
double *  thicke,
double *  shcon,
ITG nshcon,
char *  sideload,
double *  xload,
double *  xloadold,
ITG icfd,
ITG inomat,
double *  pslavsurf,
double *  pmastsurf,
ITG mortar,
ITG islavact,
double *  cdn,
ITG islavnode,
ITG nslavnode,
ITG ntie,
double *  clearini,
ITG islavsurf,
ITG ielprop,
double *  prop,
double *  energyini,
double *  energy,
ITG kscale,
char *  orname,
ITG network,
ITG nestart,
ITG neend,
ITG jqs,
ITG irows,
ITG nodedesi,
double *  xdesi,
ITG ndesi,
ITG iobject,
ITG nobject,
char *  objectset,
double *  g0,
double *  dgdx,
ITG idesvara,
ITG idesvarb,
ITG nasym,
ITG isolver,
double *  distmin,
ITG nodeset,
double *  b 
)
61  {
62 
63  ITG symmetryflag=0,idesvar,mt=mi[1]+1,i,iactpos,calcul_fn,
64  calcul_qa,calcul_cauchy,ikin=0,nal,iout=2,icmd=3,nener=0,
65  *inum=NULL,nprintl=0;
66 
67  double *vnew=NULL,*conew=NULL,*dstn=NULL,*v=NULL,*fn=NULL,
68  *stx=NULL,*eei=NULL,qa[4]={0.,0.,-1.,0.},*xstiff=NULL,*ener=NULL,
69  *eme=NULL;
70 
71  if(*nasym!=0){symmetryflag=2;}
72 
73  NNEW(vnew,double,mt**nk);
74  NNEW(conew,double,3**nk);
75  NNEW(eme,double,6*mi[0]**ne);
76  NNEW(inum,ITG,*nk);
77 
78  for(idesvar=*idesvara-1;idesvar<*idesvarb;idesvar++){
79 
80  /* calculating the perturbed displacements */
81 
82  FORTRAN(resultsnoddir,(nk,vnew,nactdof,b,ipompc,nodempc,
83  coefmpc,nmpc,mi));
84 
85  for(i=0;i<mt**nk;i++){vnew[i]=vold[i]+(*distmin)*vnew[i];}
86 
87  /* copying the unperturbed coordinates */
88 
89  memcpy(&conew[0],&co[0],sizeof(double)*3**nk);
90 
91  /* if the coordinates are the design variables:
92  calculating the perturbed coordinates */
93 
94  iactpos=nodedesi[idesvar]-1;
95  for(i=0;i<3;i++){
96  conew[iactpos*3+i]=co[iactpos*3+i]+xdesi[idesvar*3+i];
97  }
98 
99  /* calculating the stress in the perturbed state */
100 
101  NNEW(v,double,mt**nk);
102  NNEW(fn,double,mt**nk);
103  NNEW(stx,double,6*mi[0]**ne);
104  NNEW(eei,double,6*mi[0]**ne);
105  NNEW(dstn,double,6**nk);
106 
107  memcpy(&v[0],&vnew[0],sizeof(double)*mt**nk);
108 
109  /* setting the output variables */
110 
111  calcul_fn=0;
112  calcul_qa=0;
113  calcul_cauchy=1;
114 
115  FORTRAN(resultsmech,(conew,kon,ipkon,lakon,ne,v,
116  stx,elcon,nelcon,rhcon,nrhcon,alcon,nalcon,alzero,
117  ielmat,ielorien,norien,orab,ntmat_,t0,t1,ithermal,prestr,
118  iprestr,eme,iperturb,fn,&iout,qa,vold,
119  nmethod,
120  veold,dtime,time,ttime,plicon,nplicon,plkcon,nplkcon,
121  xstateini,xstiff,xstate,npmat_,matname,mi,ielas,&icmd,
122  ncmat_,nstate_,stiini,vini,ener,eei,enerini,istep,iinc,
123  springarea,reltime,&calcul_fn,&calcul_qa,&calcul_cauchy,&nener,
124  &ikin,&nal,ne0,thicke,emeini,
125  pslavsurf,pmastsurf,mortar,clearini,nestart,neend,ielprop,
126  prop,kscale));
127 
128  /* storing results in the .dat file
129  extrapolation of integration point values to the nodes
130  interpolation of 3d results for 1d/2d elements */
131 
132  FORTRAN(resultsprint,(conew,nk,kon,ipkon,lakon,ne,v,dstn,inum,
133  stx,ielorien,norien,orab,t1,ithermal,filab,een,iperturb,fn,
134  nactdof,&iout,vold,nodeboun,ndirboun,nboun,nmethod,ttime,xstate,
135  epn,mi,
136  nstate_,ener,enern,xstaten,eei,set,nset,istartset,iendset,
137  ialset,&nprintl,prlab,prset,qfx,qfn,trab,inotr,ntrans,
138  nelemload,nload,&ikin,ielmat,thicke,eme,emn,rhcon,nrhcon,shcon,
139  nshcon,cocon,ncocon,ntmat_,sideload,icfd,inomat,pslavsurf,islavact,
140  cdn,mortar,islavnode,nslavnode,ntie,islavsurf,time,ielprop,prop,
141  veold,ne0,nmpc,ipompc,nodempc,labmpc,energyini,energy,orname,
142  xload));
143 
144  SFREE(v);SFREE(fn);SFREE(stx);SFREE(eei);
145 
146  /* calculate the stress sensitivity */
147 
148  for(i=0;i<6**nk;i++){dstn[i]=(dstn[i]-stn[i])/(*distmin);}
149 
150  FORTRAN(objective_stress_dx,(nodeset,istartset,iendset,
151  ialset,nk,&idesvar,iobject,dgdx,
152  ndesi,nobject,stn,dstn,objectset,g0));
153 
154  SFREE(dstn);
155 
156  }
157 
158  SFREE(vnew);SFREE(conew);SFREE(eme);SFREE(inum);
159 
160 }
subroutine resultsnoddir(nk, v, nactdof, b, ipompc, nodempc, coefmpc, nmpc, mi)
Definition: resultsnoddir.f:21
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
subroutine resultsprint(co, nk, kon, ipkon, lakon, ne, v, stn, inum, stx, ielorien, norien, orab, t1, ithermal, filab, een, iperturb, fn, nactdof, iout, vold, nodeboun, ndirboun, nboun, nmethod, ttime, xstate, epn, mi, nstate_, ener, enern, xstaten, eei, set, nset, istartset, iendset, ialset, nprint, prlab, prset, qfx, qfn, trab, inotr, ntrans, nelemload, nload, ikin, ielmat, thicke, eme, emn, rhcon, nrhcon, shcon, nshcon, cocon, ncocon, ntmat_, sideload, icfd, inomat, pslavsurf, islavact, cdn, mortar, islavnode, nslavnode, ntie, islavsurf, time, ielprop, prop, veold, ne0, nmpc, ipompc, nodempc, labmpc, energyini, energy, orname, xload)
Definition: resultsprint.f:29
#define SFREE(a)
Definition: CalculiX.h:41
subroutine resultsmech(co, kon, ipkon, lakon, ne, v, stx, elcon, nelcon, rhcon, nrhcon, alcon, nalcon, alzero, ielmat, ielorien, norien, orab, ntmat_, t0, t1, ithermal, prestr, iprestr, eme, iperturb, fn, iout, qa, vold, nmethod, veold, dtime, time, ttime, plicon, nplicon, plkcon, nplkcon, xstateini, xstiff, xstate, npmat_, matname, mi, ielas, icmd, ncmat_, nstate_, stiini, vini, ener, eei, enerini, istep, iinc, springarea, reltime, calcul_fn, calcul_qa, calcul_cauchy, nener, ikin, nal, ne0, thicke, emeini, pslavsurf, pmastsurf, mortar, clearini, nea, neb, ielprop, prop, kscale)
Definition: resultsmech.f:29
static ITG * nal
Definition: results.c:31
subroutine objective_stress_dx(nodeset, istartset, iendset, ialset, nk, idesvarc, iobject, dgdx, ndesi, nobject, stn, dstn, objectset, g0)
Definition: objective_stress_dx.f:21
#define ITG
Definition: CalculiX.h:51
#define NNEW(a, b, c)
Definition: CalculiX.h:39

◆ stress_senmt()

void* stress_senmt ( ITG i)
1231  {
1232 
1233  ITG idesvara,idesvarb,indexb;
1234 
1235  /* next design variable to tread (FORTRAN-notation) */
1236 
1237  idesvara=idesvar1+(*i)+1;
1238  idesvarb=idesvara;
1239  indexb=*i*neq1[1];
1240 
1260  &idesvara,&idesvarb,nasym1,isolver1,distmin1,&nodeset1,
1261  &b1[indexb]);
1262 
1263  return NULL;
1264 }
static double * g01
Definition: objectivemain_se.c:42
static double * emeini1
Definition: objectivemain_se.c:42
static ITG * ithermal1
Definition: objectivemain_se.c:29
static ITG * nprint1
Definition: objectivemain_se.c:29
static double * pmastsurf1
Definition: objectivemain_se.c:42
static double * co1
Definition: objectivemain_se.c:42
static double * xstateini1
Definition: objectivemain_se.c:42
static ITG * nstate1_
Definition: objectivemain_se.c:29
static double * dgdx1
Definition: objectivemain_se.c:42
static double * enerini1
Definition: objectivemain_se.c:42
static double * t01
Definition: objectivemain_se.c:42
static ITG * nmethod1
Definition: objectivemain_se.c:29
static double * coefmpc1
Definition: objectivemain_se.c:47
static double * qfx1
Definition: objectivemain_se.c:47
static ITG * nalcon1
Definition: objectivemain_se.c:29
static double * t11
Definition: objectivemain_se.c:42
static ITG * ielprop1
Definition: objectivemain_se.c:29
void stress_sen(double *co, ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, double *stn, double *elcon, ITG *nelcon, double *rhcon, ITG *nrhcon, double *alcon, ITG *nalcon, double *alzero, ITG *ielmat, ITG *ielorien, ITG *norien, double *orab, ITG *ntmat_, double *t0, double *t1, ITG *ithermal, double *prestr, ITG *iprestr, char *filab, double *emn, double *een, ITG *iperturb, double *f, ITG *nactdof, double *vold, ITG *nodeboun, ITG *ndirboun, double *xboun, ITG *nboun, ITG *ipompc, ITG *nodempc, double *coefmpc, char *labmpc, ITG *nmpc, ITG *nmethod, double *cam, ITG *neq, double *veold, double *accold, double *bet, double *gam, double *dtime, double *time, double *ttime, double *plicon, ITG *nplicon, double *plkcon, ITG *nplkcon, double *xstateini, double *xstate, ITG *npmat_, double *epn, char *matname, ITG *mi, ITG *ielas, ITG *ncmat_, ITG *nstate_, double *stiini, double *vini, ITG *ikboun, ITG *ilboun, double *enern, double *emeini, double *xstaten, double *enerini, double *cocon, ITG *ncocon, char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, ITG *nprint, char *prlab, char *prset, double *qfx, double *qfn, double *trab, ITG *inotr, ITG *ntrans, double *fmpc, ITG *nelemload, ITG *nload, ITG *ikmpc, ITG *ilmpc, ITG *istep, ITG *iinc, double *springarea, double *reltime, ITG *ne0, double *xforc, ITG *nforc, double *thicke, double *shcon, ITG *nshcon, char *sideload, double *xload, double *xloadold, ITG *icfd, ITG *inomat, double *pslavsurf, double *pmastsurf, ITG *mortar, ITG *islavact, double *cdn, ITG *islavnode, ITG *nslavnode, ITG *ntie, double *clearini, ITG *islavsurf, ITG *ielprop, double *prop, double *energyini, double *energy, ITG *kscale, char *orname, ITG *network, ITG *nestart, ITG *neend, ITG *jqs, ITG *irows, ITG *nodedesi, double *xdesi, ITG *ndesi, ITG *iobject, ITG *nobject, char *objectset, double *g0, double *dgdx, ITG *idesvara, ITG *idesvarb, ITG *nasym, ITG *isolver, double *distmin, ITG *nodeset, double *b)
Definition: stress_sen.c:26
static ITG * nload1
Definition: objectivemain_se.c:29
static ITG * ndesi1
Definition: objectivemain_se.c:29
static double * accold1
Definition: objectivemain_se.c:47
static double * alzero1
Definition: objectivemain_se.c:42
static ITG neend1
Definition: objectivemain_se.c:29
static ITG * ialset1
Definition: objectivemain_se.c:29
static double * xboun1
Definition: objectivemain_se.c:47
static ITG * ntmat1_
Definition: objectivemain_se.c:29
static double * xdesi1
Definition: objectivemain_se.c:42
static ITG * nplkcon1
Definition: objectivemain_se.c:29
static ITG * islavnode1
Definition: objectivemain_se.c:29
static ITG * nk1
Definition: objectivemain_se.c:29
static double * emn1
Definition: objectivemain_se.c:47
static ITG * ntie1
Definition: objectivemain_se.c:29
static ITG * ntrans1
Definition: objectivemain_se.c:29
static ITG * ncmat1_
Definition: objectivemain_se.c:29
static double * reltime1
Definition: objectivemain_se.c:42
static double * xloadold1
Definition: objectivemain_se.c:47
static ITG * ielas1
Definition: objectivemain_se.c:29
static double * cdn1
Definition: objectivemain_se.c:47
static double * clearini1
Definition: objectivemain_se.c:42
static double * energy1
Definition: objectivemain_se.c:47
static ITG idesvar1
Definition: objectivemain_se.c:29
static double * plicon1
Definition: objectivemain_se.c:42
static char * prset1
Definition: objectivemain_se.c:26
static ITG * isolver1
Definition: objectivemain_se.c:29
static ITG * inomat1
Definition: objectivemain_se.c:29
static double * time1
Definition: objectivemain_se.c:42
static ITG * norien1
Definition: objectivemain_se.c:29
static ITG * istartset1
Definition: objectivemain_se.c:29
static ITG * jqs1
Definition: objectivemain_se.c:29
static double * fmpc1
Definition: objectivemain_se.c:47
static ITG * irows1
Definition: objectivemain_se.c:29
static ITG kscale1
Definition: objectivemain_se.c:29
static double * plkcon1
Definition: objectivemain_se.c:42
static double * veold1
Definition: objectivemain_se.c:42
static char * sideload1
Definition: objectivemain_se.c:26
static ITG * npmat1_
Definition: objectivemain_se.c:29
static double * cam1
Definition: objectivemain_se.c:47
static double * alcon1
Definition: objectivemain_se.c:42
static ITG * istep1
Definition: objectivemain_se.c:29
static double * cocon1
Definition: objectivemain_se.c:47
static ITG * iperturb1
Definition: objectivemain_se.c:29
static ITG * ikmpc1
Definition: objectivemain_se.c:29
static char * objectset1
Definition: objectivemain_se.c:26
static double * b1
Definition: objectivemain_se.c:47
static ITG nodeset1
Definition: objectivemain_se.c:29
static double * prestr1
Definition: objectivemain_se.c:42
static double * een1
Definition: objectivemain_se.c:47
static double * xload1
Definition: objectivemain_se.c:47
static double * bet1
Definition: objectivemain_se.c:47
static double * ttime1
Definition: objectivemain_se.c:42
static double * enern1
Definition: objectivemain_se.c:47
static double * rhcon1
Definition: objectivemain_se.c:42
static double * orab1
Definition: objectivemain_se.c:42
static double * stiini1
Definition: objectivemain_se.c:42
static ITG * kon1
Definition: objectivemain_se.c:29
static char * set1
Definition: objectivemain_se.c:26
static ITG * nobject1
Definition: objectivemain_se.c:29
static char * orname1
Definition: objectivemain_se.c:26
static ITG * mi1
Definition: objectivemain_se.c:29
static double * dtime1
Definition: objectivemain_se.c:42
static ITG * nplicon1
Definition: objectivemain_se.c:29
static ITG network1
Definition: objectivemain_se.c:29
static double * pslavsurf1
Definition: objectivemain_se.c:42
static ITG * ne1
Definition: objectivemain_se.c:29
static ITG * ilboun1
Definition: objectivemain_se.c:29
static double * trab1
Definition: objectivemain_se.c:47
static double * xstaten1
Definition: objectivemain_se.c:47
static ITG * iendset1
Definition: objectivemain_se.c:29
static ITG * neq1
Definition: objectivemain_se.c:29
static ITG * nboun1
Definition: objectivemain_se.c:29
static double * f1
Definition: objectivemain_se.c:47
static ITG * ielmat1
Definition: objectivemain_se.c:29
static ITG * nasym1
Definition: objectivemain_se.c:29
static ITG * nshcon1
Definition: objectivemain_se.c:29
static double * vold1
Definition: objectivemain_se.c:42
static double * distmin1
Definition: objectivemain_se.c:42
static ITG * ikboun1
Definition: objectivemain_se.c:29
static ITG * iinc1
Definition: objectivemain_se.c:29
static double * xforc1
Definition: objectivemain_se.c:47
static ITG * icfd1
Definition: objectivemain_se.c:29
static ITG * nmpc1
Definition: objectivemain_se.c:29
static ITG * nodempc1
Definition: objectivemain_se.c:29
static char * labmpc1
Definition: objectivemain_se.c:26
static ITG * nforc1
Definition: objectivemain_se.c:29
static double * qfn1
Definition: objectivemain_se.c:47
static char * lakon1
Definition: objectivemain_se.c:26
static ITG * mortar1
Definition: objectivemain_se.c:29
static ITG * ndirboun1
Definition: objectivemain_se.c:29
static ITG * islavact1
Definition: objectivemain_se.c:29
static double * elcon1
Definition: objectivemain_se.c:42
static ITG * nelcon1
Definition: objectivemain_se.c:29
static ITG * ne01
Definition: objectivemain_se.c:29
static ITG * ncocon1
Definition: objectivemain_se.c:29
static double * epn1
Definition: objectivemain_se.c:47
static ITG * nslavnode1
Definition: objectivemain_se.c:29
static ITG * ilmpc1
Definition: objectivemain_se.c:29
static ITG * inotr1
Definition: objectivemain_se.c:29
static ITG * nodeboun1
Definition: objectivemain_se.c:29
static double * vini1
Definition: objectivemain_se.c:42
static ITG * nactdof1
Definition: objectivemain_se.c:29
static ITG * iprestr1
Definition: objectivemain_se.c:29
#define ITG
Definition: CalculiX.h:51
static ITG nestart1
Definition: objectivemain_se.c:29
static double * prop1
Definition: objectivemain_se.c:42
static double * thicke1
Definition: objectivemain_se.c:42
static double * energyini1
Definition: objectivemain_se.c:47
static ITG * islavsurf1
Definition: objectivemain_se.c:29
static char * matname1
Definition: objectivemain_se.c:26
static ITG * ielorien1
Definition: objectivemain_se.c:29
static char * filabl1
Definition: objectivemain_se.c:26
static ITG * nset1
Definition: objectivemain_se.c:29
static ITG iobject1
Definition: objectivemain_se.c:29
static ITG * nelemload1
Definition: objectivemain_se.c:29
static double * shcon1
Definition: objectivemain_se.c:47
static double * gam1
Definition: objectivemain_se.c:47
static double * stn1
Definition: objectivemain_se.c:47
static double * xstate1
Definition: objectivemain_se.c:42
static double * springarea1
Definition: objectivemain_se.c:42
static ITG * nrhcon1
Definition: objectivemain_se.c:29
static ITG * ipompc1
Definition: objectivemain_se.c:29
static ITG * nodedesi1
Definition: objectivemain_se.c:29
static char * prlab1
Definition: objectivemain_se.c:26
static ITG * ipkon1
Definition: objectivemain_se.c:29

◆ thicknessmt()

void* thicknessmt ( ITG i)
163  {
164 
165  ITG indexr,ndesia,ndesib,ndesidelta;
166 
167  indexr=*i*ifree1;
168 
169  ndesidelta=(ITG)ceil(ndesiboun1/(double)num_cpus);
170  ndesia=*i*ndesidelta+1;
171  ndesib=(*i+1)*ndesidelta;
172  if(ndesib>ndesiboun1) ndesib=ndesiboun1;
173 
174  //printf("indexr=%" ITGFORMAT","ndesia=%" ITGFORMAT",ndesib=%" ITGFORMAT"\n",indexr,ndesia,ndesib);
175 
177  xo1,yo1,zo1,x1,yy1,z1,nx1,ny1,nz1,co1,&ifree1,
178  &ndesia,&ndesib,iobject1,ndesi1,dgdxglob1,nk1));
179 
180  return NULL;
181 }
static ITG * iobject1
Definition: thicknessmain.c:39
static double * x1
Definition: thicknessmain.c:47
static ITG * nk1
Definition: thicknessmain.c:39
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
static double * co1
Definition: thicknessmain.c:47
static double * xo1
Definition: thicknessmain.c:47
static ITG * nobject1
Definition: thicknessmain.c:39
static ITG * nz1
Definition: thicknessmain.c:39
static double * yo1
Definition: thicknessmain.c:47
static char * objectset1
Definition: thicknessmain.c:37
static ITG * nx1
Definition: thicknessmain.c:39
static double * yy1
Definition: thicknessmain.c:47
static ITG * nodedesiboun1
Definition: thicknessmain.c:39
static double * dgdx1
Definition: thicknessmain.c:47
static double * dgdxglob1
Definition: thicknessmain.c:47
static double * z1
Definition: thicknessmain.c:47
static double * zo1
Definition: thicknessmain.c:47
static ITG ndesiboun1
Definition: thicknessmain.c:39
static ITG num_cpus
Definition: thicknessmain.c:39
#define ITG
Definition: CalculiX.h:51
static ITG * ny1
Definition: thicknessmain.c:39
subroutine thickness(dgdx, nobject, nodedesiboun, ndesiboun, objectset, xo, yo, zo, x, y, z, nx, ny, nz, co, ifree, ndesia, ndesib, iobject, ndesi, dgdxglob, nk)
Definition: thickness.f:22
static ITG ifree1
Definition: thicknessmain.c:39
static ITG * ndesi1
Definition: thicknessmain.c:39

◆ tiedcontact()

void tiedcontact ( ITG ntie,
char *  tieset,
ITG nset,
char *  set,
ITG istartset,
ITG iendset,
ITG ialset,
char *  lakon,
ITG ipkon,
ITG kon,
double *  tietol,
ITG nmpc,
ITG mpcfree,
ITG memmpc_,
ITG **  ipompcp,
char **  labmpcp,
ITG **  ikmpcp,
ITG **  ilmpcp,
double **  fmpcp,
ITG **  nodempcp,
double **  coefmpcp,
ITG ithermal,
double *  co,
double *  vold,
ITG cfd,
ITG nmpc_,
ITG mi,
ITG nk,
ITG istep,
ITG ikboun,
ITG nboun,
char *  kind1,
char *  kind2 
)
32  {
33 
34  char *labmpc=NULL;
35 
36  ITG *itietri=NULL,*koncont=NULL,nconf,i,k,*nx=NULL,im,
37  *ny=NULL,*nz=NULL,*ifaceslave=NULL,*istartfield=NULL,
38  *iendfield=NULL,*ifield=NULL,ntrimax,index,
39  ncont,ncone,*ipompc=NULL,*ikmpc=NULL,
40  *ilmpc=NULL,*nodempc=NULL,ismallsliding=0,neq,neqterms,
41  nmpctied,mortar=0,*ipe=NULL,*ime=NULL,*imastop=NULL,ifreeme;
42 
43  double *xo=NULL,*yo=NULL,*zo=NULL,*x=NULL,*y=NULL,*z=NULL,
44  *cg=NULL,*straight=NULL,*fmpc=NULL,*coefmpc=NULL;
45 
46  ipompc=*ipompcp;labmpc=*labmpcp;ikmpc=*ikmpcp;ilmpc=*ilmpcp;
47  fmpc=*fmpcp;nodempc=*nodempcp;coefmpc=*coefmpcp;
48 
49  /* identifying the slave surfaces as nodal or facial surfaces */
50 
51  NNEW(ifaceslave,ITG,*ntie);
52 
53  FORTRAN(identifytiedface,(tieset,ntie,set,nset,ifaceslave,kind1));
54 
55  /* determining the number of triangles of the triangulation
56  of the master surface and the number of entities on the
57  slave side */
58 
59  FORTRAN(allocont,(&ncont,ntie,tieset,nset,set,istartset,iendset,
60  ialset,lakon,&ncone,tietol,&ismallsliding,kind1,
61  kind2,&mortar,istep));
62 
63  if(ncont==0){
64  SFREE(ifaceslave);return;
65  }
66 
67  /* allocation of space for the triangulation;
68  koncont(1..3,i): nodes belonging to triangle i
69  koncont(4,i): face label to which the triangle belongs =
70  10*element+side number */
71 
72  NNEW(itietri,ITG,2**ntie);
73  NNEW(koncont,ITG,4*ncont);
74 
75  /* triangulation of the master surface */
76 
77  FORTRAN(triangucont,(&ncont,ntie,tieset,nset,set,istartset,iendset,
78  ialset,itietri,lakon,ipkon,kon,koncont,kind1,kind2,co,nk));
79 
80  /* catalogueing the neighbors of the master triangles */
81 
82  RENEW(ipe,ITG,*nk);
83  RENEW(ime,ITG,12*ncont);
84  DMEMSET(ipe,0,*nk,0.);
85  DMEMSET(ime,0,12*ncont,0.);
86  NNEW(imastop,ITG,3*ncont);
87 
88  FORTRAN(trianeighbor,(ipe,ime,imastop,&ncont,koncont,
89  &ifreeme));
90 
91  SFREE(ipe);SFREE(ime);
92 
93  /* allocation of space for the center of gravity of the triangles
94  and the 4 describing planes */
95 
96  NNEW(cg,double,3*ncont);
97  NNEW(straight,double,16*ncont);
98 
99  FORTRAN(updatecont,(koncont,&ncont,co,vold,cg,straight,mi));
100 
101  /* determining the nodes belonging to the slave face surfaces */
102 
103  NNEW(istartfield,ITG,*ntie);
104  NNEW(iendfield,ITG,*ntie);
105  NNEW(ifield,ITG,8*ncone);
106 
107  FORTRAN(nodestiedface,(tieset,ntie,ipkon,kon,lakon,set,istartset,
108  iendset,ialset,nset,ifaceslave,istartfield,iendfield,ifield,
109  &nconf,&ncone,kind1));
110 
111  /* determining the maximum number of equations neq */
112 
113  if(*cfd==1){
114  if(ithermal[1]<=1){
115  neq=4;
116  }else{
117  neq=5;
118  }
119  }else{
120  if(ithermal[1]<=1){
121  neq=3;
122  }else if(ithermal[1]==2){
123  neq=1;
124  }else{
125  neq=4;
126  }
127  }
128  neq*=(ncone+nconf);
129 
130  /* reallocating the MPC fields for the new MPC's
131  ncone: number of MPC'S due to nodal slave surfaces
132  nconf: number of MPC's due to facal slave surfaces */
133 
134  RENEW(ipompc,ITG,*nmpc_+neq);
135  RENEW(labmpc,char,20*(*nmpc_+neq)+1);
136  RENEW(ikmpc,ITG,*nmpc_+neq);
137  RENEW(ilmpc,ITG,*nmpc_+neq);
138  RENEW(fmpc,double,*nmpc_+neq);
139 
140  /* determining the maximum number of terms;
141  expanding nodempc and coefmpc to accommodate
142  those terms */
143 
144  neqterms=9*neq;
145  index=*memmpc_;
146  (*memmpc_)+=neqterms;
147  RENEW(nodempc,ITG,3**memmpc_);
148  RENEW(coefmpc,double,*memmpc_);
149  for(k=index;k<*memmpc_;k++){
150  nodempc[3*k-1]=k+1;
151  }
152  nodempc[3**memmpc_-1]=0;
153 
154  /* determining the size of the auxiliary fields */
155 
156  ntrimax=0;
157  for(i=0;i<*ntie;i++){
158  if(itietri[2*i+1]-itietri[2*i]+1>ntrimax)
159  ntrimax=itietri[2*i+1]-itietri[2*i]+1;
160  }
161  NNEW(xo,double,ntrimax);
162  NNEW(yo,double,ntrimax);
163  NNEW(zo,double,ntrimax);
164  NNEW(x,double,ntrimax);
165  NNEW(y,double,ntrimax);
166  NNEW(z,double,ntrimax);
167  NNEW(nx,ITG,ntrimax);
168  NNEW(ny,ITG,ntrimax);
169  NNEW(nz,ITG,ntrimax);
170 
171  /* generating the tie MPC's */
172 
173  FORTRAN(gentiedmpc,(tieset,ntie,itietri,ipkon,kon,
174  lakon,set,istartset,iendset,ialset,cg,straight,
175  koncont,co,xo,yo,zo,x,y,z,nx,ny,nz,nset,
176  ifaceslave,istartfield,iendfield,ifield,
177  ipompc,nodempc,coefmpc,nmpc,&nmpctied,mpcfree,ikmpc,ilmpc,
178  labmpc,ithermal,tietol,cfd,&ncont,imastop,ikboun,nboun,kind1));
179 
180  (*nmpc_)+=nmpctied;
181 
182  SFREE(xo);SFREE(yo);SFREE(zo);SFREE(x);SFREE(y);SFREE(z);SFREE(nx);
183  SFREE(ny);SFREE(nz);SFREE(imastop);
184 
185  SFREE(ifaceslave);SFREE(istartfield);SFREE(iendfield);SFREE(ifield);
186  SFREE(itietri);SFREE(koncont);SFREE(cg);SFREE(straight);
187 
188  /* reallocating the MPC fields */
189 
190  /* RENEW(ipompc,ITG,nmpc_);
191  RENEW(labmpc,char,20*nmpc_+1);
192  RENEW(ikmpc,ITG,nmpc_);
193  RENEW(ilmpc,ITG,nmpc_);
194  RENEW(fmpc,double,nmpc_);*/
195 
196  *ipompcp=ipompc;*labmpcp=labmpc;*ikmpcp=ikmpc;*ilmpcp=ilmpc;
197  *fmpcp=fmpc;*nodempcp=nodempc;*coefmpcp=coefmpc;
198 
199  /* for(i=0;i<*nmpc;i++){
200  j=i+1;
201  FORTRAN(writempc,(ipompc,nodempc,coefmpc,labmpc,&j));
202  }*/
203 
204  return;
205 }
subroutine triangucont(ncont, ntie, tieset, nset, set, istartset, iendset, ialset, itietri, lakon, ipkon, kon, koncont, kind1, kind2, co, nk)
Definition: triangucont.f:22
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
#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 gentiedmpc(tieset, ntie, itietri, ipkon, kon, lakon, set, istartset, iendset, ialset, cg, straight, koncont, co, xo, yo, zo, x, y, z, nx, ny, nz, nset, ifaceslave, istartfield, iendfield, ifield, ipompc, nodempc, coefmpc, nmpc, nmpctied, mpcfree, ikmpc, ilmpc, labmpc, ithermal, tietol, cfd, ncont, imastop, ikboun, nboun, kind)
Definition: gentiedmpc.f:25
subroutine trianeighbor(ipe, ime, imastop, ncont, koncont, ifreeme)
Definition: trianeighbor.f:21
subroutine updatecont(koncont, ncont, co, vold, cg, straight, mi)
Definition: updatecont.f:20
subroutine allocont(ncont, ntie, tieset, nset, set, istartset, iendset, ialset, lakon, ncone, tietol, ismallsliding, kind1, kind2, mortar, istep)
Definition: allocont.f:22
subroutine identifytiedface(tieset, ntie, set, nset, ifaceslave, kind)
Definition: identifytiedface.f:20
#define ITG
Definition: CalculiX.h:51
subroutine nodestiedface(tieset, ntie, ipkon, kon, lakon, set, istartset, iendset, ialset, nset, ifaceslave, istartfield, iendfield, ifield, nconf, ncone, kind)
Definition: nodestiedface.f:22
#define NNEW(a, b, c)
Definition: CalculiX.h:39

◆ transitionmain()

void transitionmain ( double *  co,
double *  dgdxglob,
ITG nobject,
ITG nk,
ITG nodedesi,
ITG ndesi,
char *  objectset,
ITG ipkon,
ITG kon,
char *  lakon,
ITG ipoface,
ITG nodface,
ITG nodedesiinv 
)
52  {
53 
54  /* reduction of the sensitivities in the transition from the design
55  space to the non-design space */
56 
57  ITG *nx=NULL,*ny=NULL,*nz=NULL,ifree,i,*ithread=NULL;
58 
59  double *xo=NULL,*yo=NULL,*zo=NULL,*x=NULL,*y=NULL,*z=NULL;
60 
61  if(*nobject==0){return;}
62  if(strcmp1(&objectset[20]," ")!=0){
63 
64  /* prepare for near3d */
65 
66  NNEW(xo,double,*nk);
67  NNEW(yo,double,*nk);
68  NNEW(zo,double,*nk);
69  NNEW(x,double,*nk);
70  NNEW(y,double,*nk);
71  NNEW(z,double,*nk);
72  NNEW(nx,ITG,*nk);
73  NNEW(ny,ITG,*nk);
74  NNEW(nz,ITG,*nk);
75 
76  FORTRAN(pretransition,(ipkon,kon,lakon,co,nk,ipoface,nodface,
77  nodedesiinv,xo,yo,zo,x,y,z,nx,ny,nz,&ifree));
78 
79  RENEW(xo,double,ifree);
80  RENEW(yo,double,ifree);
81  RENEW(zo,double,ifree);
82  RENEW(x,double,ifree);
83  RENEW(y,double,ifree);
84  RENEW(z,double,ifree);
85  RENEW(nx,ITG,ifree);
86  RENEW(ny,ITG,ifree);
87  RENEW(nz,ITG,ifree);
88 
89  /* variables for multithreading procedure */
90 
91  ITG sys_cpus;
92  char *env,*envloc,*envsys;
93 
94  num_cpus = 0;
95  sys_cpus=0;
96 
97  /* explicit user declaration prevails */
98 
99  envsys=getenv("NUMBER_OF_CPUS");
100  if(envsys){
101  sys_cpus=atoi(envsys);
102  if(sys_cpus<0) sys_cpus=0;
103  }
104 
105  /* automatic detection of available number of processors */
106 
107  if(sys_cpus==0){
108  sys_cpus = getSystemCPUs();
109  if(sys_cpus<1) sys_cpus=1;
110  }
111 
112  /* local declaration prevails, if strictly positive */
113 
114  envloc = getenv("CCX_NPROC_FILTER");
115  if(envloc){
116  num_cpus=atoi(envloc);
117  if(num_cpus<0){
118  num_cpus=0;
119  }else if(num_cpus>sys_cpus){
120  num_cpus=sys_cpus;
121  }
122 
123  }
124 
125  /* else global declaration, if any, applies */
126 
127  env = getenv("OMP_NUM_THREADS");
128  if(num_cpus==0){
129  if (env)
130  num_cpus = atoi(env);
131  if (num_cpus < 1) {
132  num_cpus=1;
133  }else if(num_cpus>sys_cpus){
134  num_cpus=sys_cpus;
135  }
136  }
137 
138  /* check that the number of cpus does not supercede the number
139  of design variables */
140 
141  if(*ndesi<num_cpus) num_cpus=*ndesi;
142 
143  pthread_t tid[num_cpus];
144 
145  dgdxglob1=dgdxglob;nobject1=nobject;nk1=nk;nodedesi1=nodedesi;
146  ndesi1=ndesi;objectset1=objectset;xo1=xo;yo1=yo;zo1=zo;
147  x1=x;yy1=y;z1=z;nx1=nx;ny1=ny;nz1=nz;
148  ifree1=ifree,co1=co;
149 
150  /* transition */
151 
152  printf(" Using up to %" ITGFORMAT " cpu(s) for transition to sensitivities.\n\n", num_cpus);
153 
154  /* create threads and wait */
155 
156  NNEW(ithread,ITG,num_cpus);
157  for(i=0; i<num_cpus; i++) {
158  ithread[i]=i;
159  pthread_create(&tid[i], NULL, (void *)transitionmt, (void *)&ithread[i]);
160  }
161  for(i=0; i<num_cpus; i++) pthread_join(tid[i], NULL);
162 
163  SFREE(xo);SFREE(yo);SFREE(zo);SFREE(ithread);
164  SFREE(x);SFREE(y);SFREE(z);SFREE(nx);SFREE(ny);SFREE(nz);
165 
166  }
167 
168  FORTRAN(posttransition,(dgdxglob,nobject,nk,nodedesi,ndesi,objectset));
169 
170  return;
171 
172 }
#define ITGFORMAT
Definition: CalculiX.h:52
static ITG * ny1
Definition: transitionmain.c:39
int pthread_create(pthread_t *thread_id, const pthread_attr_t *attributes, void *(*thread_function)(void *), void *arguments)
static double * zo1
Definition: transitionmain.c:47
static ITG * nodedesi1
Definition: transitionmain.c:39
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
static ITG * nobject1
Definition: transitionmain.c:39
ITG strcmp1(const char *s1, const char *s2)
Definition: strcmp1.c:24
subroutine pretransition(ipkon, kon, lakon, co, nk, ipoface, nodface, nodedesiinv, xo, yo, zo, x, y, z, nx, ny, nz, ifree)
Definition: pretransition.f:21
static ITG * ndesi1
Definition: transitionmain.c:39
ITG getSystemCPUs()
Definition: getSystemCPUs.c:40
static ITG ifree1
Definition: transitionmain.c:39
static char * objectset1
Definition: transitionmain.c:37
static double * yo1
Definition: transitionmain.c:47
static double * co1
Definition: transitionmain.c:47
static double * xo1
Definition: transitionmain.c:47
#define RENEW(a, b, c)
Definition: CalculiX.h:40
#define SFREE(a)
Definition: CalculiX.h:41
void * transitionmt(ITG *i)
Definition: transitionmain.c:176
static ITG * nk1
Definition: transitionmain.c:39
static ITG * nz1
Definition: transitionmain.c:39
static ITG num_cpus
Definition: transitionmain.c:39
int pthread_join(pthread_t thread, void **status_ptr)
static double * yy1
Definition: transitionmain.c:47
static double * x1
Definition: transitionmain.c:47
#define ITG
Definition: CalculiX.h:51
static ITG * nx1
Definition: transitionmain.c:39
subroutine posttransition(dgdxglob, nobject, nk, nodedesi, ndesi, objectset)
Definition: posttransition.f:21
static double * z1
Definition: transitionmain.c:47
#define NNEW(a, b, c)
Definition: CalculiX.h:39
static double * dgdxglob1
Definition: transitionmain.c:47

◆ transitionmt()

void* transitionmt ( ITG i)
176  {
177 
178  ITG ndesia,ndesib,ndesidelta;
179 
180  ndesidelta=(ITG)ceil(*ndesi1/(double)num_cpus);
181  ndesia=*i*ndesidelta+1;
182  ndesib=(*i+1)*ndesidelta;
183  if(ndesib>*ndesi1) ndesib=*ndesi1;
184 
187  &ndesia,&ndesib));
188 
189  return NULL;
190 }
static ITG * ny1
Definition: transitionmain.c:39
static double * zo1
Definition: transitionmain.c:47
static ITG * nodedesi1
Definition: transitionmain.c:39
void FORTRAN(actideacti,(char *set, ITG *nset, ITG *istartset, ITG *iendset, ITG *ialset, char *objectset, ITG *ipkon, ITG *ibject, ITG *ne))
static ITG * nobject1
Definition: transitionmain.c:39
static ITG * ndesi1
Definition: transitionmain.c:39
static ITG ifree1
Definition: transitionmain.c:39
static char * objectset1
Definition: transitionmain.c:37
static double * yo1
Definition: transitionmain.c:47
static double * co1
Definition: transitionmain.c:47
static double * xo1
Definition: transitionmain.c:47
static ITG * nk1
Definition: transitionmain.c:39
static ITG * nz1
Definition: transitionmain.c:39
static ITG num_cpus
Definition: transitionmain.c:39
static double * yy1
Definition: transitionmain.c:47
static double * x1
Definition: transitionmain.c:47
#define ITG
Definition: CalculiX.h:51
subroutine transition(dgdxglob, nobject, nk, nodedesi, ndesi, objectset, xo, yo, zo, x, y, z, nx, ny, nz, co, ifree, ndesia, ndesib)
Definition: transition.f:22
static ITG * nx1
Definition: transitionmain.c:39
static double * z1
Definition: transitionmain.c:47
static double * dgdxglob1
Definition: transitionmain.c:47

◆ u_calloc()

void* u_calloc ( size_t  num,
size_t  size,
const char *  file,
const int  line,
const char *  ptr_name 
)
29  {
30 
31  /* allocating num elements of size bytes and initializing them to zero */
32 
33  void *a;
34  char *env;
35 
36  if(num==0){
37  a=NULL;
38  return(a);
39  }
40 
41  a=calloc(num,size);
42  if(a==NULL){
43  printf("*ERROR in u_calloc: error allocating memory\n");
44  printf("variable=%s, file=%s, line=%d, num=%ld, size=%ld\n",ptr_name,file,line,num,size);
45  if(num<0){
46  printf("\n It looks like you may need the i8 (integer*8) version of CalculiX\n");
47  }
48  exit(16);
49  }
50  else {
51  if(log_realloc==-1) {
52  log_realloc=0;
53  env=getenv("CCX_LOG_ALLOC");
54  if(env) {log_realloc=atoi(env);}
55  }
56  if(log_realloc==1) {
57  printf("ALLOCATION of variable %s, file %s, line=%d, num=%ld, size=%ld, address= %ld\n",ptr_name,file,line,num,size,(long int)a);
58  }
59  return(a);
60  }
61 }
int log_realloc
Definition: u_calloc.c:23

◆ u_free()

void* u_free ( void *  num,
const char *  file,
const int  line,
const char *  ptr_name 
)
28  {
29 
30  /* freeing a field with pointer ptr */
31 
32  char *env;
33 
34  free(ptr);
35 
36  if(log_realloc==-1) {
37  log_realloc=0;
38  env=getenv("CCX_LOG_ALLOC");
39  if(env) {log_realloc=atoi(env);}
40  }
41  if(log_realloc==1) {
42  printf("FREEING of variable %s, file %s, line=%d: oldaddress= %ld\n",ptr_name,file,line,(long int)ptr);
43  }
44  return;
45 }
int log_realloc
Definition: u_calloc.c:23

◆ u_realloc()

void* u_realloc ( void *  num,
size_t  size,
const char *  file,
const int  line,
const char *  ptr_name 
)
28  {
29 
30  /* reallocating a field with pointer ptr to size bytes */
31 
32  void *a;
33  char *env;
34 
35  a=realloc(ptr,size);
36 
37  if(a==NULL && ptr!=NULL && size!=0){
38  printf("*ERROR in u_realloc: error allocating memory\n");
39  printf("variable=%s, file=%s, line=%d, size(bytes)=%ld, oldaddress=%ld\n",ptr_name,file,line,size,(long int)ptr);
40  exit(16);
41  }
42  else {
43  if(log_realloc==-1) {
44  log_realloc=0;
45  env=getenv("CCX_LOG_ALLOC");
46  if(env) {log_realloc=atoi(env);}
47  }
48  if(log_realloc==1) {
49  printf("REALLOCATION of variable %s, file %s, line=%d: size(bytes)=%ld, oldaddress= %ld,address= %ld\n",ptr_name,file,line,size,(long int)ptr,(long int)a);
50  }
51  return(a);
52  }
53 }
int log_realloc
Definition: u_calloc.c:23

◆ writeBasisParameter()

void writeBasisParameter ( FILE *  f,
ITG istep,
ITG iinc 
)

◆ writeheading()

void writeheading ( char *  jobnamec,
char *  heading,
ITG nheading 
)
24  {
25 
26  /* writes the headers in the frd-file */
27 
28  FILE *f1;
29 
30  char p1[6]=" 1",fneig[132]="",c[2]="C",
31  text[67]=" ";
32 
33  ITG i;
34 
35  strcpy(fneig,jobnamec);
36  strcat(fneig,".frd");
37 
38  if((f1=fopen(fneig,"ab"))==NULL){
39  printf("*ERROR in frd: cannot open frd file for writing...");
40  exit(0);
41  }
42 
43  /* first line */
44 
45  fprintf(f1,"%5s%1s\n",p1,c);
46 
47  /* header lines */
48 
49  for(i=0;i<*nheading_;i++){
50  strcpy1(text,&heading[66*i],66);
51  fprintf(f1,"%5sU%66s\n",p1,text);
52  }
53 
54  fclose(f1);
55 
56  return;
57 }
ITG strcpy1(char *s1, const char *s2, ITG length)
Definition: strcpy1.c:24
static double * f1
Definition: objectivemain_se.c:47
#define ITG
Definition: CalculiX.h:51
Hosted by OpenAircraft.com, (Michigan UAV, LLC)