#include <stdlib.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include "CalculiX.h"
#include "exodusII.h"
#include "exo.h"
Go to the source code of this file.
|
#define | min(a, b) ((a) <= (b) ? (a) : (b)) |
|
#define | max(a, b) ((a) >= (b) ? (a) : (b)) |
|
|
void | exoselect (double *field1, double *field2, ITG *iset, ITG *nkcoords, ITG *inum, ITG *istartset, ITG *iendset, ITG *ialset, ITG *ngraph, ITG *ncomp, ITG *ifield, ITG *icomp, ITG *nfield, ITG *iselect, ITG exoid, ITG time_step, int countvar, ITG nout) |
|
◆ max
#define max |
( |
|
a, |
|
|
|
b |
|
) |
| ((a) >= (b) ? (a) : (b)) |
◆ min
#define min |
( |
|
a, |
|
|
|
b |
|
) |
| ((a) <= (b) ? (a) : (b)) |
◆ exoselect()
void exoselect |
( |
double * |
field1, |
|
|
double * |
field2, |
|
|
ITG * |
iset, |
|
|
ITG * |
nkcoords, |
|
|
ITG * |
inum, |
|
|
ITG * |
istartset, |
|
|
ITG * |
iendset, |
|
|
ITG * |
ialset, |
|
|
ITG * |
ngraph, |
|
|
ITG * |
ncomp, |
|
|
ITG * |
ifield, |
|
|
ITG * |
icomp, |
|
|
ITG * |
nfield, |
|
|
ITG * |
iselect, |
|
|
ITG |
exoid, |
|
|
ITG |
time_step, |
|
|
int |
countvar, |
|
|
ITG |
nout |
|
) |
| |
47 ITG i,j,k,l,m,o,nksegment;
61 float *nodal_var_vals;
62 nodal_var_vals = (
float *) calloc (nout,
sizeof(
float));
65 for(j=0;j<*ncomp;j++){
68 for(i=0;i<*nkcoords;i++){
73 if(inum[i]<=0)
continue;
74 }
else if(*iselect==-1){
75 if(inum[i]>=0)
continue;
77 if(inum[i]==0)
continue;
82 nodal_var_vals[m]=field1[i*nfield[0]+icomp[j]];
84 nodal_var_vals[m]=field2[i*nfield[1]+icomp[j]];
89 nksegment=(*nkcoords)/(*ngraph);
91 for(k=istartset[*iset-1]-1;k<iendset[*iset-1];k++){
94 for(l=0;l<*ngraph;l++){
95 i=ialset[k]+l*nksegment-1;
101 if(inum[i]<=0)
continue;
102 }
else if(*iselect==-1){
103 if(inum[i]>=0)
continue;
105 if(inum[i]==0)
continue;
110 nodal_var_vals[m]=field1[i*nfield[0]+icomp[j]];
112 nodal_var_vals[m]=field2[i*nfield[1]+icomp[j]];
120 if(l>=ialset[k-1])
break;
122 for(m=0;m<*ngraph;m++){
129 if(inum[i]<=0)
continue;
130 }
else if(*iselect==-1){
131 if(inum[i]>=0)
continue;
133 if(inum[i]==0)
continue;
138 nodal_var_vals[o]=field1[i*nfield[0]+icomp[j]];
140 nodal_var_vals[o]=field2[i*nfield[1]+icomp[j]];
144 printf (
"%f\n",nodal_var_vals[m]);
155 int errr = ex_put_nodal_var (exoid, time_step, k+1+countvar, nout, nodal_var_vals);
156 if (errr) printf (
"ERROR exoselect data for dim %i record %i.\n", j, countvar+j);
159 free(nodal_var_vals);
#define ITG
Definition: CalculiX.h:51