Skip to content

Commit

Permalink
Merge pull request #2139 from gforney/timeframe
Browse files Browse the repository at this point in the history
fix to routine getting time interval when t=tend
  • Loading branch information
gforney authored Dec 31, 2024
2 parents 11620ce + ccac257 commit 05dd5bb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 33 deletions.
2 changes: 1 addition & 1 deletion Source/smokeview/smv_geometry.c
Original file line number Diff line number Diff line change
Expand Up @@ -1016,7 +1016,7 @@ void GetScreenMapping(float *xyz0, float *screen_perm){
int GetTimeInterval(float val, float *array, int n){
if(n <= 1)return 0;
if(val<array[1])return 0;
if(val>array[n-2])return n-2;
if(val>=array[n-1])return n-1;
return GetInterval(val, array, n);
}

Expand Down
32 changes: 0 additions & 32 deletions Source/smokeview/update.c
Original file line number Diff line number Diff line change
Expand Up @@ -690,38 +690,6 @@ void UpdateShow(void){
}
}

/* ------------------ GetItime ------------------------ */

int GetItime(int n, int *timeslist, unsigned char *times_map, float *times, int ntimes){
int istart=0;

if(n>0)istart=timeslist[n-1];
if(times_map == NULL){
while(1){
if(istart < ntimes - 1 && times[istart] <= global_times[n]){
istart++;
continue;
}
break;
}
}
else{
while(1){
if(times_map != NULL && istart >= 0 && istart < ntimes - 1 && times_map[istart] == 0){
istart++;
continue;
}
if(istart < ntimes - 1 && times[istart] <= global_times[n]){
istart++;
continue;
}
break;
}
}
istart=CLAMP(istart,0,ntimes-1);
return istart;
}

/* ------------------ GetDataTimeFrame ------------------------ */

int GetDataTimeFrame(float time, unsigned char *times_map, float *times, int ntimes){
Expand Down

0 comments on commit 05dd5bb

Please sign in to comment.