Calculates the groupwise cross product of integration points in different dimensions and multiplies their weights accordingly. If the object defining points in a particular dimension has no weights attached to it all weights are assumed to be 1.
Legacy wrapper for fm_cprod()
Arguments
- ...
data.frame
,sf
, orSpatialPointsDataFrame
objects, each one usually obtained by a call to anfm_int()
method.- na.rm
logical; if
TRUE
, the rows with weightNA
from the non-overlapping full_join will be removed; ifFALSE
, set the undefined weights toNA
. IfNULL
(default), act asTRUE
, but warn if any elements needed removing.- .blockwise
logical; if
FALSE
, computes full tensor product integration. IfTRUE
, computes within-block tensor product integration (used internally byfm_int()
). DefaultFALSE
Value
A data.frame
, sf
, or SpatialPointsDataFrame
of multidimensional
integration points and their weights
Examples
# \donttest{
# Create integration points in dimension 'myDim' and 'myDiscreteDim'
ips1 <- fm_int(fm_mesh_1d(0:20),
rbind(c(0, 3), c(3, 8)),
name = "myDim"
)
ips2 <- fm_int(domain = c(1, 2, 4), name = "myDiscreteDim")
# Calculate the cross product
ips <- cprod(ips1, ips2)
#> Warning: `cprod()` was deprecated in inlabru 2.8.0.
#> ℹ Please use `fmesher::fm_cprod()` instead.
# Plot the integration points
plot(ips$myDim, ips$myDiscreteDim, cex = 10 * ips$weight)
# }