CalculiX  2.13
A Free Software Three-Dimensional Structural Finite Element Program
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, char *m1, ITG *inotr, double *trab, double *co, ITG *istartset, ITG *iendset, ITG *ialset, ITG *mi, ITG *ngraph, FILE *f1, char *output, char *m3, int exoid, ITG time_step, int countvar, ITG nout)
 

Function Documentation

◆ exovector()

void exovector ( 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,
int  exoid,
ITG  time_step,
int  countvar,
ITG  nout 
)
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  m=0;
62  if((*ntrans==0)||(strcmp1(&filabl[5],"G")==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  for(i=0;i<*nkcoords;i++){
69  if(inum[i]<=0) continue;
70  if(inotr[2*i]==0){
71  nodal_var_vals[m++]=v[(mi[1]+1)*i+j];
72  }else{
73  ii=(mi[1]+1)*i+1;
74  jj=(mi[1]+1)*i+2;
75  kk=(mi[1]+1)*i+3;
76  FORTRAN(transformatrix,(&trab[7*(inotr[2*i]-1)],&co[3*i],a));
77  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];
78  }
79  }
80  }
81  }else{
82  nksegment=(*nkcoords)/(*ngraph);
83  m=0;
84  for(k=istartset[*iset-1]-1;k<iendset[*iset-1];k++){
85  if(ialset[k]>0){
86  for(l=0;l<*ngraph;l++){
87  i=ialset[k]+l*nksegment-1;
88  if(inum[i]<=0) continue;
89  if((*ntrans==0)||(strcmp1(&filabl[5],"G")==0)||(inotr[2*i]==0)){
90  nodal_var_vals[m++]=v[(mi[1]+1)*i+j];
91  }else{
92  FORTRAN(transformatrix,(&trab[7*(inotr[2*i]-1)],&co[3*i],a));
93  ii=(mi[1]+1)*i+1;
94  jj=(mi[1]+1)*i+2;
95  kk=(mi[1]+1)*i+3;
96  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];
97  }
98  }
99  }else{
100  l=ialset[k-2];
101  do{
102  l-=ialset[k];
103  if(l>=ialset[k-1]) break;
104  n=0;
105  for(m=0;m<*ngraph;m++){
106  i=l+m*nksegment-1;
107  if(inum[i]<=0) continue;
108  if((*ntrans==0)||(strcmp1(&filabl[5],"G")==0)||(inotr[2*i]==0)){
109  nodal_var_vals[n++]=v[(mi[1]+1)*i+j];
110  }else{
111  FORTRAN(transformatrix,(&trab[7*(inotr[2*i]-1)],&co[3*i],a));
112  ii=(mi[1]+1)*i+1;
113  jj=(mi[1]+1)*i+2;
114  kk=(mi[1]+1)*i+3;
115  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];
116  }
117  }
118  }while(1);
119  }
120  }
121  }
122 
123  errr = ex_put_nodal_var (exoid, time_step, j+countvar, nout, nodal_var_vals);
124  if (errr) printf ("ERROR storing vector data into exo file.\n");
125  }
126 
127  free(nodal_var_vals);
128  return;
129 
130 }
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
#define ITG
Definition: CalculiX.h:51
Hosted by OpenAircraft.com, (Michigan UAV, LLC)