grid_view_level {conmolfields}R Documentation

grid_view_level

Description

grid_view_level

Usage

grid_view_level(grid, level, alpha = 1, color_p = PT.Color[["O"]], color_n = PT.Color[["N"]], ...)

Arguments

grid
level
alpha
color_p
color_n
...

Examples

##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (grid, level, alpha = 1, color_p = PT.Color[["O"]], 
    color_n = PT.Color[["N"]], ...) 
{
    positive_present <- FALSE
    negative_present <- FALSE
    for (igridx in 1:grid$ngridx) {
        for (igridy in 1:grid$ngridy) {
            for (igridz in 1:grid$ngridz) {
                v <- grid$val[igridx, igridy, igridz]
                if (v > level) {
                  positive_present <- TRUE
                }
                if (-v > level) {
                  negative_present <- TRUE
                }
                if (positive_present && negative_present) 
                  break
            }
        }
    }
    val <- grid$val
    if (positive_present) {
        contour3d(grid$val, level, grid$gridx, grid$gridy, grid$gridz, 
            color = color_p, add = TRUE, alpha = alpha, ...)
    }
    if (negative_present) {
        contour3d(-val, level, grid$gridx, grid$gridy, grid$gridz, 
            color = color_n, add = TRUE, alpha = alpha, ...)
    }
  }

[Package conmolfields version 0.0-19 Index]