Skip to content

Commit bc16347

Browse files
authored
Merge pull request #2550 from gforney/vcenter
add option to visualize slice vectors using CELL U, CELL V and CELL W data (preliminary)
2 parents a9bbc76 + 2122a83 commit bc16347

6 files changed

Lines changed: 285 additions & 46 deletions

File tree

Source/shared/options_common.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
#ifndef _DEFAULT_SOURCE
1111
#define _DEFAULT_SOURCE
1212
#endif
13+
//#define pp_VCELLUVW // add add uvw to menu label for CELL U/V/W vector slice files
14+
1315

1416
#ifdef __INTEL_COMPILER
1517
#define INTEL_COMPILER_ANY

Source/shared/readhvac.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,8 @@ int ReadHVACData0(hvacdatacollection *hvaccoll, int flag,
654654

655655
ducttimes = hvaccoll->hvacductvalsinfo->times;
656656
nodetimes = hvaccoll->hvacnodevalsinfo->times;
657+
max_node_buffer = 100;
658+
NewMemory((void **)&node_buffer, max_node_buffer * sizeof(float));
657659
for(iframe = 0; iframe < nframes; iframe++) {
658660
int j;
659661
float time;
@@ -665,8 +667,8 @@ int ReadHVACData0(hvacdatacollection *hvaccoll, int flag,
665667
nodetimes[iframe] = time;
666668
if(n_node_vars > max_node_buffer) {
667669
FREEMEMORY(node_buffer);
668-
NewMemory((void **)&node_buffer, (n_node_vars + 100) * sizeof(float));
669670
max_node_buffer = n_node_vars + 100;
671+
NewMemory((void **)&node_buffer, max_node_buffer * sizeof(float));
670672
}
671673
for(j = 0; j < n_nodes; j++) {
672674
int k;

Source/shared/shared_structures.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ typedef struct _slicedata {
598598
float position_orig;
599599
int blocknumber;
600600
int cell_center_edge;
601-
int vec_comp;
601+
int vec_comp, cellvec_comp;
602602
int skipdup;
603603
int setvalmin, setvalmax;
604604
float globalmin_slice, globalmax_slice;
@@ -686,6 +686,7 @@ typedef struct _vslicedata {
686686
int finalize;
687687
int loaded,display;
688688
float valmin, valmax;
689+
int cellvec_comp;
689690
int vslice_filetype;
690691
int vslicefile_labelindex;
691692
char menulabel[128];

Source/shared/string_util.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1631,11 +1631,30 @@ int ReadLabels(flowlabels *flowlabel, BFILE *stream, char *suffix_label){
16311631
TrimBack(buffer);
16321632
len = strlen(buffer);
16331633
if(suffix_label!=NULL)len_suffix_label = strlen(suffix_label);
1634+
#ifdef pp_VCELLUVW
1635+
if(flowlabel!=NULL){
1636+
if(NewMemory((void **)&flowlabel->longlabel, (unsigned int)(len+len_suffix_label+4+len_skip_label+1))==0)return LABEL_ERR;
1637+
STRCPY(flowlabel->longlabel, buffer);
1638+
if(suffix_label != NULL && strlen(suffix_label) > 0){
1639+
int appended = 0;
1640+
1641+
if(strcmp(buffer, "CELL U") == 0 ||
1642+
strcmp(buffer, "CELL V") == 0 ||
1643+
strcmp(buffer, "CELL W") == 0){
1644+
if(strcmp(suffix_label, "(cell centered)") == 0){
1645+
STRCAT(flowlabel->longlabel, "(cell uvw centered)");
1646+
appended = 1;
1647+
}
1648+
}
1649+
if(appended==0)STRCAT(flowlabel->longlabel, suffix_label);
1650+
}
1651+
#else
16341652
if(flowlabel!=NULL){
16351653
if(NewMemory((void **)&flowlabel->longlabel, (unsigned int)(len+len_suffix_label+len_skip_label+1))==0)return LABEL_ERR;
16361654
STRCPY(flowlabel->longlabel, buffer);
16371655
if(suffix_label!=NULL&&strlen(suffix_label)>0)STRCAT(flowlabel->longlabel, suffix_label);
16381656
}
1657+
#endif
16391658

16401659
if(FGETS(buffer2, 255, stream)==NULL){
16411660
strcpy(buffer2, "**");

0 commit comments

Comments
 (0)