createGrid: Create a Mesh for the Integration

View source: R/createGrid.R

createGridR Documentation

Create a Mesh for the Integration

Description

Create a mesh for the integration.

Usage

createGrid(n, xmin, xmax, d.y, d.z, zmax, fine, double)

Arguments

n

[integer >0] the number of points for the mesh in the x direction.

xmin

[numeric] the minimal x value.

xmax

[numeric] the maximal x value.

d.y

[integer >0] the number of dimensions for the triangle.

d.z

[integer >0] the number of dimensions.

zmax

[numeric >0] the maximal z value (in absolute value).

fine

[logical] should the mesh be displayed?

double

[logical] should the grid be just outside the region of interest? Otherwise it will be just inside.

Details

This create a mesh for integrating over a triangular surface using rectangles. The domain is define by constrains on three types of variables:

  • the x variable: [unidimensional] that varies freely between [-xmax,-xmin] U [xmin,xmax].

  • the y variables: [dimension d.y] constrained to be lower in absolute value than the x variable. In 2D this corresponds to 2 triangles, and in higher dimension to cones/hypercones.

  • the z variables: [dimension d.z] constrained to vary between [-zmax,zmax].

The intersection of these three conditions define the domain.

The mesh is obtained slicing the triangles using rectangles.

Value

A list containing:

  • grid: a data.frame where each line corresponds to a point.

  • seqNames.min: a character giving the name of the x,y variables (min).

  • seqNames.max: a character giving the name of the x,y variables (max).

Examples

createGrid <- lavaSearch2:::createGrid

## no z 
gridInt_2d <- createGrid(5, d.y = 1, xmin = 0, xmax = 4, 
                         d.z = 0, fine = FALSE, double = FALSE)
gridExt_2d <- createGrid(5, d.y = 1, xmin = 0, xmax = 4, 
                         d.z = 0, fine = FALSE, double = TRUE)

gridInt_4d <- createGrid(5, d.y = 3, xmin = 0, xmax = 4, 
                         d.z = 0, fine = FALSE, double = FALSE)
gridExt_4d <- createGrid(5, d.y = 3, xmin = 0, xmax = 4, 
                         d.z = 0, fine = FALSE, double = TRUE)

gridInt_2d <- createGrid(5, d.y = 1, xmin = 0, xmax = 4, 
                         d.z = 0, fine = TRUE, double = FALSE)

##  z
gridIntZ1_2d <- createGrid(5, d.y = 1, xmin = 0, xmax = 4, 
                           d.z = 1, zmax = 2, fine = FALSE, double = FALSE)
gridExtZ1_2d <- createGrid(5, d.y = 1, xmin = 0, xmax = 4, 
                           d.z = 1, zmax = 2, fine = FALSE, double = TRUE)
 
gridIntZ2_4d <- createGrid(5, d.y = 3, xmin = 0, xmax = 4, 
                           d.z = 2, zmax = 2, fine = FALSE, double = FALSE)
gridExtZ2_4d <- createGrid(5, d.y = 3, xmin = 0, xmax = 4, 
                           d.z = 2, zmax = 2, fine = FALSE, double = TRUE)


bozenne/lavaSearch2 documentation built on Feb. 13, 2024, 10:18 p.m.