The basic information required for the data_streamer is the input data set plus a specified starting point. The starting point is specified either by absolute x-y-z position or by location. By location is meant the particular method of specifying a "cell" or "element" in the geometry. For example, in a structured_grid_set, the location is a i-j-k index into the grid, whereas in an unstructured_grid_set, the location is an element number.
The streamer will propagate until either it exits the geometry, or a user specified termination condition is met. These conditions may be specified either by number of integration steps, distance, or elapsed time.
time if the stream line termination condition is based on elapsed time, (i.e., time limited), the total time for the stream trace.
distance if the stream line termination condition is based on distance travelled, (i.e., distance limited), the total distance for the stream trace.
step_length the length of each line segment making up the total polyline that represents the stream line.
integration_step_length integration step length based on the fraction of the maximum element length. Hence if the integration_step_length is 0.25, and the (approximate)
element size is 0.8, a value of 0.2 is used for the integration step size.
start_position the starting position in x-y-z global coordinates of the streamline.
start_location the starting location in cell coordinates (e.g., i,j,k for structured grid or element number for unstrucutred grid).
normal an arbitrary specified normal to the streamline. Can be used to orient ribbons and tubes around the streamline.
vorticity boolean value indicating whether vorticiy (and hence normals) should be calculated along the streamline.
terminal_speed termination condition based on vector magnitude (i.e., speed). If speed at end of streamline falls below this value, the streamline integration terminates.
steps= value Set the number of steps to take.
steps+ value Add to the number of steps to take.
steps_taken? Obtain the number of steps taken thus far.
time? Get the maximum time for the particle to move.
time= value Set the maximum time for the particle to move.
time+ value Add to the maximum time for the particle to move.
distance? Get the maximum distance for the particle to move.
distance= value Set the maximum distance for the particle to move.
distance+ value Add to the maximum distance for the particle to move.
step_length? Get the current step length.
step_length= value Set the current step length.
integration_step_length? Get the integration step length.
integration_step_length= value Set the integration step length.
start_location? Get the start location.
start_location= value Set the start location. Value(s) depend upon type of data set.
start_location+ value Add to the current start location.
start_position? Get the current start position.
start_position= (x,y,z) Set the start position using global coordinates.
start_position+ (dx,dy,dz) Add to the current start position.
position? Get the current position at the end of the streamline. Returns x,y,z global position.
normal? Get the current normal. Used to orient line normal if computing vorticity.
normal= (nx,ny,nz) Set the line normal.
vorticity_on! Turn normal computation (hence normals) on.
vorticity_off! Turn normal computation (hence normals) off.
vorticity? Get the vorticity flag. If !=0, compute vorticity.
vorticity=? value" Set the vorticity flag.
terminal_speed? Get the terminal speed.
terminal_speed= value Set a terminal speed for streamline computation. If the velocity magnitude during streamline computation falls below this threshold, streamer propagation stops.
free! Release memory and delete object.
step_limited! Limit streamer propagation by the number of steps taken.
time_limited! Limit streamer propagation by total time.
distance_limited! Limit streamer propagation by total distance.
boundary_limited! Limit streamer propagation by exiting boundary. Of course, this is always the case but this method serves to remove other limits.
exited? Returns a non-zero value is the streamer has exited the boundary.
jump: value Moves the starting position of the streamer ahead by value number of steps. Can be used in a loop to simulate flow along a streamline.
continue: value Extends the length of the streamer by value number of steps. Can be used in a loop to animate flow along a streamline.
plot3d_reader new: areader file_prefix=data_name read! ; /*
* Set up the data set */ string new: data_set = data_name + "_gridset01";
object# data_set compute_properties! ; /* * set up some displays: outline and streamer */ data_outline new: outline data_in= data_set ; display_lines new: draw_outline data_in=outline ; actor new: outline_actor modeller= draw_outline ;
data_streamer new: astreamer data_in= data_set start_location= (1,10,10) step_limited! steps=1000 vorticity_on! ; tube_filter new: atube data_in= astreamer num_sides=6 radius= 0.1 ; display_all new: draw_tube data_in= atube ; actor new: tube_actor modeller= draw_tube ;
/* * Rendering stuff */ vector new: bbox dimension=6; bbox = ([object# data_set bounds?]); camera new: acamera position=(1,1,1) x_range=([bbox @1 ?],[bbox @2 ?]) y_range=([bbox @3 ?],[bbox @4 ?]) z_range=([bbox @5 ?],[bbox @6 ?]) default! on! ;
light new: alight
position=(30,30,50) on! ;
logic new: test; environment new: _env variable="LYMB_RENDERER"; test = [_env defined?] false: "#Environment variable LYMB_RENDERER must be set." false: "parser exit!;" ; string new: current_renderer = [_env value?];
object# current_renderer new: main_renderer actors=([actor instances?]) lights=alight cameras=acamera render! ;