streamlines {RGeostats} | R Documentation |
Calculate the set of streamlines from Drop points in a Grid Db
streamlines(dbgrid, dbpoint=NA, step = NA, niter = 100, flag.norm=FALSE, use.grad = FALSE, save.grad = FALSE, flag.draw = FALSE, ..., radix = "StreamLines", modify.target = db.locmod())
dbgrid |
The |
dbpoint |
The |
step |
Value of the step when following the steepest gradient |
niter |
Maximum number of steps from the drop point to the end point. This is interrupted if the streamline hits the edge of the grid. |
flag.norm |
When TRUE, the gradients are normalized before usage: it means that they only provide the direction of the gradients, but not their amplitude. |
use.grad |
When TRUE, the Gradient components must be contained in the 'dbgrid'. These variables must correspond to the locator "G". If not present, an error is generated. When FALSE, the Gradient components are calculated in this function. |
save.grad |
When TRUE, the Gradient components (if calculated by this function) are saved in the returned Db. When FALSE, the Gradients components (if calculated by this function) are deleted at the end of the procedure. |
flag.draw |
Optional graphic representation. |
... |
Argument passed to the following function |
radix |
Radix of the name given to the variables storing the results in the target Db. |
modify.target |
Decides whether or not the newly created variables will have their
locator defined or not. For more information, see |
Use the solution: set_keypair("Streamline",1) to specify the slipping ratio on the active samples of 'dbpoint' (default=1).
The input db-class
Grid structure is returned with
several variables added.
The streamline information is provided typing get.keypair("Streamlines").
It corresponds to a matrix where the columns are:
The coordinates of the vertices of the streamlines
The cell number to which the streamline belongs
The rank of the vertex within the streamline
Each streamline ends by a record where all variables are set to NA.
# Create a grid 100 x 100 grid = db.create(nx=c(100,100)) # Create a K-Bessel Model model = model.create(vartype=8,range=50,sill=1,param=2) # Perform a non-conditional simulation on the grid grid = spde(,grid,model) # Calculate the streamlines (for one node every 190) and represent them set.keypair("Streamline_Skip",190) a = streamlines(grid,flag.draw=TRUE,niter=100,step=10, title="Topography and Streamlines") rm(grid,model,a)