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

Go to the source code of this file.

Functions

void exovector (double *v, ITG *iset, ITG *ntrans, char *filabl, ITG *nkcoords, ITG *inum, ITG *inotr, double *trab, double *co, ITG *istartset, ITG *iendset, ITG *ialset, ITG *mi, ITG *ngraph, int exoid, ITG time_step, int countvar, ITG nout)
 

Function Documentation

void exovector ( double *  v,
ITG iset,
ITG ntrans,
char *  filabl,
ITG nkcoords,
ITG inum,
ITG inotr,
double *  trab,
double *  co,
ITG istartset,
ITG iendset,
ITG ialset,
ITG mi,
ITG ngraph,
int  exoid,
ITG  time_step,
int  countvar,
ITG  nout 
)

Definition at line 28 of file exovector.c.

32  {
33 
34  ITG nksegment;
35  ITG i,j,k,l,m,n,ii,jj,kk;
36 
37  double a[9];
38 
39  /* When initializing parameter values:
40  "g" (or "G")
41  For global variables.
42  "n" (or "N")
43  For nodal variables.
44  "e" (or "E")
45  For element variables.
46  "m" (or "M")
47  For nodeset variables.
48  "s" (or "S")
49  For sideset variables.
50  */
51 
52  int errr;
53 
54  int num_nod_vars=3;
55 
56  float *nodal_var_vals;
57  nodal_var_vals = (float *) calloc (nout, sizeof(float));
58 
59  for (j=1; j<=num_nod_vars; j++){ // For each direction
60  if(*iset==0){
61  if((*ntrans==0)||(strcmp1(&filabl[5],"G")==0)){
62  m=0;
63  for(i=0;i<*nkcoords;i++){
64  if(inum[i]<=0) continue;
65  nodal_var_vals[m++]=v[(mi[1]+1)*i+j];
66  }
67  }else{
68  m=0;
69  for(i=0;i<*nkcoords;i++){
70  if(inum[i]<=0) continue;
71  if(inotr[2*i]==0){
72  nodal_var_vals[m++]=v[(mi[1]+1)*i+j];
73  }else{
74  ii=(mi[1]+1)*i+1;
75  jj=(mi[1]+1)*i+2;
76  kk=(mi[1]+1)*i+3;
77  FORTRAN(transformatrix,(&trab[7*(inotr[2*i]-1)],&co[3*i],a));
78  nodal_var_vals[m++]=v[ii]*a[0+(j-1)*3]+v[jj]*a[1+(j-1)*3]+v[kk]*a[2+(j-1)*3];
79  }
80  }
81  }
82  }else{
83  nksegment=(*nkcoords)/(*ngraph);
84  for(k=istartset[*iset-1]-1;k<iendset[*iset-1];k++){
85  if(ialset[k]>0){
86  m=0;
87  for(l=0;l<*ngraph;l++){
88  i=ialset[k]+l*nksegment-1;
89  if(inum[i]<=0) continue;
90  if((*ntrans==0)||(strcmp1(&filabl[5],"G")==0)||(inotr[2*i]==0)){
91  nodal_var_vals[m++]=v[(mi[1]+1)*i+j];
92  }else{
93  FORTRAN(transformatrix,(&trab[7*(inotr[2*i]-1)],&co[3*i],a));
94  ii=(mi[1]+1)*i+1;
95  jj=(mi[1]+1)*i+2;
96  kk=(mi[1]+1)*i+3;
97  nodal_var_vals[m++]=v[ii]*a[0+(j-1)*3]+v[jj]*a[1+(j-1)*3]+v[kk]*a[2+(j-1)*3];
98  }
99  }
100  }else{
101  l=ialset[k-2];
102  do{
103  l-=ialset[k];
104  if(l>=ialset[k-1]) break;
105  n=0;
106  for(m=0;m<*ngraph;m++){
107  i=l+m*nksegment-1;
108  if(inum[i]<=0) continue;
109  if((*ntrans==0)||(strcmp1(&filabl[5],"G")==0)||(inotr[2*i]==0)){
110  nodal_var_vals[n++]=v[(mi[1]+1)*i+j];
111  }else{
112  FORTRAN(transformatrix,(&trab[7*(inotr[2*i]-1)],&co[3*i],a));
113  ii=(mi[1]+1)*i+1;
114  jj=(mi[1]+1)*i+2;
115  kk=(mi[1]+1)*i+3;
116  nodal_var_vals[n++]=v[ii]*a[0+(j-1)*3]+v[jj]*a[1+(j-1)*3]+v[kk]*a[2+(j-1)*3];
117  }
118  }
119  }while(1);
120  }
121  }
122  }
123 
124 
125  errr = ex_put_nodal_var (exoid, time_step, j+countvar, nout, nodal_var_vals);
126  if (errr) printf ("ERROR storing vector data into exo file.\n");
127  }
128 
129  free(nodal_var_vals);
130  return;
131 
132 }
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))
ITG strcmp1(const char *s1, const char *s2)
Definition: strcmp1.c:24
subroutine transformatrix(xab, p, a)
Definition: transformatrix.f:19
#define ITG
Definition: CalculiX.h:51
Hosted by OpenAircraft.com, (Michigan UAV, LLC)