CalculiX  2.8 A Free Software Three-Dimensional Structural Finite Element Program
frdvector.c File Reference
#include <stdlib.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include "CalculiX.h"
Include dependency graph for frdvector.c:

Go to the source code of this file.

## Functions

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)

## Function Documentation

 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 at line 24 of file frdvector.c.

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