Utilities
Surface point utilities on bodies and body lists
ImmersedLayers.areas
— Methodareas(b::Body/BodyList)
Return ScalarData
filled with the 1-d areas (via midpoint rule) associated with b
.
ImmersedLayers.normals
— Methodnormals(b::Body/BodyList)
Return VectorData
filled with the normal vectors (via midpoint rule) associated with b
.
ImmersedLayers.points
— Methodpoints(b::Body/BodyList)
Return VectorData
filled with the coordinates of the points associated with b
.
ImmersedLayers.arcs
— Methodarcs(b::Body/BodyList)
Return ScalarData
filled with the arclength coordinates associated with b
.
Base.ones
— Methodones(u::PointData)
Returns PointData
of the same type as u
filled with ones.
Base.ones
— Methodones(u::VectorData/TensorData,dim::Int)
Returns point data of the same type as u
, filled with ones in component dim
.
LinearAlgebra.dot
— Methoddot(u1::PointData,u2::PointData,ds::ScalarData)
Return the inner product between u1
and u2
, weighted by ds
.
LinearAlgebra.dot
— Methoddot(u1::PointData,u2::PointData,ds::ScalarData,bl::BodyList,i)
Return the inner product between u1
and u2
, weighted by ds
, for only the data associated with body i
in body list bl
.
LinearAlgebra.norm
— Methodnorm(u::PointData,ds::ScalarData)
Return the norm of u
, weighted by ds
.
LinearAlgebra.norm
— Methodnorm(u::PointData,ds::ScalarData,bl::BodyList,i)
Return the norm of u
, weighted by ds
, for body i
in body list bl
CartesianGrids.integrate
— Methodintegrate(u::PointData,ds::ScalarData)
Calculate the discrete surface integral of data u
, using the surface element areas in ds
. This uses trapezoidal rule quadrature. If u
is VectorData
, then this returns a vector of the integrals in each coordinate direction.
CartesianGrids.integrate
— Methodintegrate(u::PointData,ds::ScalarData,bl::BodyList,i::Int)
Calculate the discrete surface integral of scalar data u
, restricting the integral to body i
in body list bl
, using the surface element areas in ds
. This uses trapezoidal rule quadrature. If u
is VectorData
, then this returns a vector of the integrals in each coordinate direction.
Base.copyto!
— Methodcopyto!(u::PointData,v::PointData,bl::BodyList,i::Int)
Copy the data in the elements of v
associated with body i
in body list bl
to the corresponding elements in u
. These data must be of the same type (e.g., ScalarData
or VectorData
) and have the same length.
Base.copyto!
— Methodcopyto!(u::ScalarData,v::AbstractVector,bl::BodyList,i::Int)
Copy the data in v
to the elements in u
associated with body i
in body list bl
. v
must have the same length as this subarray of u
associated with i
.
Base.view
— Methodview(v::VectorData,bl::BodyList,i::Int)
Provide a view of the range of values in VectorData
v
, corresponding to the points of the body with index i
in a BodyList bl
.
Grid utilities
Base.ones
— Methodones(u::GridData)
Returns GridData
of the same type as u
filled with ones.
Base.ones
— Methodones(u::VectorGridData/TensorGridData,dim::Int)
Returns grid data of the same type as u
, filled with ones in component dim
.
CartesianGrids.integrate
— Methodintegrate(u::GridData,g::PhysicalGrid)
Calculate the discrete integral of grid data u
, using the cell volumes of grid g
. If u
is VectorData
, then this returns a vector of the integrals in each coordinate direction.
LinearAlgebra.dot
— Methoddot(u1::GridData,u2::GridData,g::PhysicalGrid)
Return the inner product between u1
and u2
weighted by the volume (area) of the cell in grid g
.
LinearAlgebra.norm
— Methodnorm(u::GridData,g::PhysicalGrid)
Return the L2 norm of u
, weighted by the volume (area) of the cell in grid g
.