Skip to content

Commit

Permalink
Merge pull request firemodels#1850 from gforney/master
Browse files Browse the repository at this point in the history
set -1x as the default on the mac, remove several preprocessing directives
  • Loading branch information
gforney authored Mar 27, 2024
2 parents 2a0a70d + fd7dcac commit 5d75c27
Showing 12 changed files with 16 additions and 250 deletions.
15 changes: 0 additions & 15 deletions Source/smokeview/IOboundary.c
Original file line number Diff line number Diff line change
@@ -2323,7 +2323,6 @@ FILE_SIZE ReadBoundaryBndf(int ifile, int flag, int *errorcode){

patchstart = patchi->ntimes_old*meshi->npatchsize;

#ifdef pp_BOUNDS
if(meshi->boundary_mask == NULL&&patchi->patch_filetype==PATCH_STRUCTURED_CELL_CENTER){
MakeBoundaryMask(patchi);
}
@@ -2343,14 +2342,6 @@ FILE_SIZE ReadBoundaryBndf(int ifile, int flag, int *errorcode){
patchmax_global = MAX(patchmax_global, meshi->patchval[i]);
}
}
#else
patchmin_global = 10000000000000.0;
patchmax_global = -patchmin_global;
for(i = 0; i<npatchvals; i++){
patchmin_global = MIN(patchmin_global, meshi->patchval[i]);
patchmax_global = MAX(patchmax_global, meshi->patchval[i]);
}
#endif
patchi->valmin_patch = patchmin_global;
patchi->valmax_patch = patchmax_global;
if(patchi->have_bound_file==NO){
@@ -2394,11 +2385,9 @@ FILE_SIZE ReadBoundaryBndf(int ifile, int flag, int *errorcode){
if(runscript == 0){
THREADcontrol(patchbound_threads, THREAD_JOIN);
}
#ifdef pp_BOUNDS
int set_valmin_save, set_valmax_save;
float qmin_save, qmax_save;
GLUIGetMinMax(BOUND_PATCH, patchi->label.shortlabel, &set_valmin_save, &qmin_save, &set_valmax_save, &qmax_save);
#endif
if(force_bound_update==1||patch_bounds_defined==0 || BuildGbndFile(BOUND_SLICE) == 1){
GetGlobalPatchBounds(1,DONOT_SET_MINMAX_FLAG);
SetLoadedPatchBounds(NULL, 0);
@@ -2415,7 +2404,6 @@ FILE_SIZE ReadBoundaryBndf(int ifile, int flag, int *errorcode){
GLUIPatchBoundsCPP_CB(BOUND_UPDATE_COLORS);
}
}
#ifdef pp_BOUNDS
if(set_valmin_save == 0){
SetPatchMin(set_valmin_save, qmin_save, patchi->label.shortlabel);
}
@@ -2425,7 +2413,6 @@ FILE_SIZE ReadBoundaryBndf(int ifile, int flag, int *errorcode){
if(set_valmin_save == 0 || set_valmax_save == 0){
UpdateAllBoundaryColors(0);
}
#endif
#define BOUND_PERCENTILE_DRAW 120
GLUIPatchBoundsCPP_CB(BOUND_PERCENTILE_DRAW);
}
@@ -3479,7 +3466,6 @@ void DrawBoundaryThresholdCellcenter(const meshdata *meshi){
glEnd();
}

#ifdef pp_BOUNDS
/* ------------------ MakeBoundaryMask ------------------------ */

void MakeBoundaryMask(patchdata *patchi){
@@ -3504,7 +3490,6 @@ void MakeBoundaryMask(patchdata *patchi){
}
}
}
#endif

/* ------------------ DrawBoundaryCellCenter ------------------------ */

20 changes: 0 additions & 20 deletions Source/smokeview/IOplot3d.c
Original file line number Diff line number Diff line change
@@ -365,22 +365,7 @@ void ReadPlot3D(char *file, int ifile, int flag, int *errorcode){
qmaxptr = qmax;
}
getplot3dq(file, nx, ny, nz, meshi->qdata, qminptr, qmaxptr, &error, isotest);
#ifdef pp_BOUNDS
update_plot3d_bnd = 1;
#else
if(p->have_bound_file == 0){
FILE *bound_stream;

bound_stream = fopen(p->bound_file, "w");
if(bound_stream != NULL){
for(i = 0;i < 6;i++){
fprintf(bound_stream, " %f %f\n", qmin[i], qmax[i]);
}
update_plot3d_bnd = 1;
fclose(bound_stream);
}
}
#endif
if(NewMemoryMemID((void **)&meshi->iqdata,numplot3dvars*ntotal*sizeof(unsigned char), p->memory_id)==0){
*errorcode=1;
ReadPlot3D("",ifile,UNLOAD,&error);
@@ -464,17 +449,12 @@ void ReadPlot3D(char *file, int ifile, int flag, int *errorcode){
if(p->finalize==1){
if(update_plot3d_bnd==1){
update_plot3d_bnd = 0;
#ifdef pp_BOUNDS
float valmin_loaded[6], valmax_loaded[6];

void BoundsUpdate(int file_type);
BoundsUpdate(BOUND_PLOT3D);
ComputeLoadedPlot3DBounds(valmin_loaded, valmax_loaded);
GLUISetLoadedMinMaxAll(BOUND_PLOT3D, valmin_loaded, valmax_loaded, plot3dinfo->nplot3dvars);
#else
GetGlobalPlot3DBounds();
SetLoadedPlot3DBounds();
#endif
}
UpdateAllPlot3DColors(0);
}
82 changes: 1 addition & 81 deletions Source/smokeview/IOslice.c
Original file line number Diff line number Diff line change
@@ -1005,22 +1005,6 @@ void ReadFed(int file_index, int time_frame, float *time_value, int flag, int fi
// regenerate if either the FED slice or isosurface file does not exist or is older than
// either the CO, CO2 or O2 slice files

#ifndef pp_BOUNDS
if(file_type==FED_SLICE){
FILE *stream;

stream = fopen(slicei->bound_file, "r");
if(stream!=NULL){
slicei->have_bound_file = 1;
fclose(stream);
UpdateGlobalFEDSliceBounds();
}
else{
slicei->have_bound_file = 0;
regenerate_fed = 1;
}
}
#endif
if(regenerate_fed==1||
(file_type==FED_SLICE&&(IsFileNewer(fed_slice->file,o2->file)!=1||
IsFileNewer(fed_slice->file,co2->file)!=1||
@@ -1256,9 +1240,7 @@ void ReadFed(int file_index, int time_frame, float *time_value, int flag, int fi
else{
ReadIsoOrig(fed_iso->file,file_index,flag,&error_local);
}
#ifdef pp_BOUNDS
UpdateGlobalFEDSliceBounds();
#endif
{
colorbardata *cb;

@@ -1369,7 +1351,6 @@ FILE_SIZE ReadVSlice(int ivslice, int time_frame, float *time_value, int flag, i
return return_filesize;
}
if(vd->finalize==0)set_slicecolor = DEFER_SLICECOLOR;
#ifdef pp_BOUNDS

int set_valmin_save, set_valmax_save;
float qmin_save, qmax_save;
@@ -1379,7 +1360,6 @@ FILE_SIZE ReadVSlice(int ivslice, int time_frame, float *time_value, int flag, i
sd = sliceinfo + vd->ival;
GLUIGetMinMax(BOUND_SLICE, sd->label.shortlabel, &set_valmin_save, &qmin_save, &set_valmax_save, &qmax_save);
}
#endif
if(vd->iu!=-1){
slicedata *u=NULL;

@@ -1530,7 +1510,6 @@ FILE_SIZE ReadVSlice(int ivslice, int time_frame, float *time_value, int flag, i
}
}
max_velocity = MAX(ABS(valmax),ABS(valmin));
#ifdef pp_BOUNDS
if(vd->ival != -1){
slicedata *sd = NULL;

@@ -1562,7 +1541,6 @@ FILE_SIZE ReadVSlice(int ivslice, int time_frame, float *time_value, int flag, i
}
}
}
#endif
}
PushVSliceLoadstack(ivslice);

@@ -2004,44 +1982,6 @@ void UpdateAllSliceColors(int slicetype, int *errorcode){
SliceBounds2Glui(slicetype);
}

#ifdef pp_SLICE_MENU_DEBUG
/* ------------------ PrintSliceInfo ------------------------ */
int NewMultiSlice(slicedata *sd1, slicedata *sc2);
void PrintSliceInfo(void){
int i, lenfile=500;
FILE *stream;
char sliceinfofile[256];

if(nsliceinfo==0)return;
if(fdsprefix != NULL)lenfile = strlen(fdsprefix) + strlen("_sliceinfo.csv") + 1;
if(fdsprefix != NULL && lenfile<256){
strcpy(sliceinfofile, fdsprefix);
strcat(sliceinfofile, "_sliceinfo.csv");
}
else{
strcpy(sliceinfofile, "sliceinfo.csv");
}
stream = fopen(sliceinfofile, "w");
if(stream == NULL)return;
fprintf(stream, ",file,long label,volslice,idir,position,filetype,index\n");
for(i = 0; i < nsliceinfo; i++){
slicedata *sd;
char label[32];

sd = sliceinfo + sliceorderindex[i];
strcpy(label, "");
if(i == 0 ||
NewMultiSlice(sliceinfo + sliceorderindex[i-1], sliceinfo + sliceorderindex[i]) == 1){
strcpy(label, "***");
}
fprintf(stream, "%s,%s,%s,%i,%i,%f,%i,%i\n",
label, sd->reg_file, sd->label.longlabel, sd->volslice, sd->idir, sd->position_orig,
sd->slice_filetype, sd->slcf_index);
}
fclose(stream);
}
#endif

/* ------------------ SliceCompare ------------------------ */

int SliceCompare( const void *arg1, const void *arg2 ){
@@ -3070,23 +3010,10 @@ void UpdateFedinfo(sliceparmdata *sp){
void GetSliceParams(sliceparmdata *sp){
int i;
int error;

int build_cache=0;
int build_cache;
FILE *stream=NULL;

#ifdef pp_SINFO
if(IfFirstLineBlank(sliceinfo_filename)==1){
build_cache=1;
stream=fopen(sliceinfo_filename,"w");
}
else{
build_cache=0;
stream=fopen(sliceinfo_filename,"r");
}
#else
build_cache=1;
#endif

INIT_PRINT_TIMER(timer_getsliceparams1);
for(i=0;i<sp->nsliceinfo;i++){
slicedata *sd;
@@ -3139,9 +3066,6 @@ void GetSliceParams(sliceparmdata *sp){
nk = ks2+1-ks1;
sd->volslice = volslice;
error = 0;
#ifdef pp_SINFO
if(stream!=NULL&&doit_anyway==0)fprintf(stream,"%i %i %i %i %i %i %i %i %i %i %i\n",sd->seq_id,is1,is2,js1,js2,ks1,ks2,ni,nj,nk,sd->volslice);
#endif
}
}
else if(sd->compression_type!=UNCOMPRESSED){
@@ -5066,11 +4990,9 @@ FILE_SIZE ReadSlice(const char *file, int ifile, int time_frame, float *time_val
if(runscript == 0){
THREADcontrol(slicebound_threads, THREAD_JOIN);
}
#ifdef pp_BOUNDS
int set_valmin_save, set_valmax_save;
float qmin_save, qmax_save;
GLUIGetMinMax(BOUND_SLICE, sd->label.shortlabel, &set_valmin_save, &qmin_save, &set_valmax_save, &qmax_save);
#endif
if(force_bound_update==1||slice_bounds_defined==0|| BuildGbndFile(BOUND_SLICE) ==1){
#ifdef pp_RECOMPUTE_DEBUG
recompute = 1;
@@ -5079,7 +5001,6 @@ FILE_SIZE ReadSlice(const char *file, int ifile, int time_frame, float *time_val
SetLoadedSliceBounds(NULL, 0);
}
GLUIGetMinMax(BOUND_SLICE, sd->label.shortlabel, &set_valmin, &qmin, &set_valmax, &qmax);
#ifdef pp_BOUNDS
float valmin_loaded = 1.0, valmax_loaded = 0;
if(set_valmin != 0 || set_valmax != 0){
int i;
@@ -5115,7 +5036,6 @@ FILE_SIZE ReadSlice(const char *file, int ifile, int time_frame, float *time_val
qmax = valmax_loaded;
SetSliceMax(BOUND_LOADED_MAX, valmax_loaded, sd->label.shortlabel);
}
#endif
#define BOUND_PERCENTILE_DRAW 120
GLUIHVACSliceBoundsCPP_CB(BOUND_PERCENTILE_DRAW);
colorbar_slice_min = qmin;
10 changes: 0 additions & 10 deletions Source/smokeview/IOvolsmoke.c
Original file line number Diff line number Diff line change
@@ -99,16 +99,6 @@ struct colourSystem{

#define GAMMA_REC709 0 /* Rec. 709 */

#ifdef pp_BLACKBODY_SYSTEM
static struct colourSystem
/* Name xRed yRed xGreen yGreen xBlue yBlue White point Gamma */
NTSCsystem = {"NTSC", 0.67, 0.33, 0.21, 0.71, 0.14, 0.08, IlluminantC, GAMMA_REC709},
EBUsystem = {"EBU (PAL/SECAM)", 0.64, 0.33, 0.29, 0.60, 0.15, 0.06, IlluminantD65, GAMMA_REC709},
SMPTEsystem = {"SMPTE", 0.630, 0.340, 0.310, 0.595, 0.155, 0.070, IlluminantD65, GAMMA_REC709},
HDTVsystem = {"HDTV", 0.670, 0.330, 0.210, 0.710, 0.150, 0.060, IlluminantD65, GAMMA_REC709},
CIEsystem = {"CIE", 0.7355, 0.2645, 0.2658, 0.7243, 0.1669, 0.0085, IlluminantE, GAMMA_REC709},
Rec709system = {"CIE REC 709", 0.64, 0.33, 0.30, 0.60, 0.15, 0.06, IlluminantD65, GAMMA_REC709};
#endif
//static struct colourSystem SMPTEsystem = {"SMPTE", 0.630, 0.340, 0.310, 0.595, 0.155, 0.070, IlluminantD65, GAMMA_REC709};
//static struct colourSystem CIEsystem = {"CIE", 0.7355, 0.2645, 0.2658, 0.7243, 0.1669, 0.0085, IlluminantE, GAMMA_REC709};
static struct colourSystem HDTVsystem = {"HDTV", 0.670, 0.330, 0.210, 0.710, 0.150, 0.060, IlluminantD65, GAMMA_REC709};
Loading

0 comments on commit 5d75c27

Please sign in to comment.