Gridap.Fields
Gridap.Fields — Module
Exported names
AffineField, ArrayBlock, ArrayBlockView, BlockMap, ConstantField, DIV, DensifyInnerMostBlockLevelMap, Field, FieldGradient, FieldGradientArray, GenericField, IntegrationMap, MatrixBlock, MatrixBlockView, MockField, MockFieldArray, Point, VectorBlock, VectorBlockView, VoidBasis, VoidBasisMap, VoidField, VoidFieldMap, ZeroField, affine_map, constant_field, curl, divergence, evaluate, evaluate!, grad2curl, gradient, gradient_type, integrate, inverse_map, laplacian, linear_combination, pinvJt, push_∇, push_∇∇, return_cache, return_type, symmetric_gradient, test_field, test_field_array, Δ, ε, ∇, ∇∇,
Gridap.Fields.AffineField — Type
struct AffineField{D1,D2,T,L} <: FieldA Field with the form:
y = x⋅G + y0with G::TensorValue{D1,D2,T,L} and y0::Point{D2,T}.
Gridap.Fields.AffineMap — Type
struct AffineMap <: MapGridap.Fields.BroadcastOpFieldArray — Type
Type that represents a broadcast operation over a set of AbstractArray{<:Field}. The result is a sub-type of AbstractArray{<:Field}
Gridap.Fields.ConstantField — Type
struct ConstantField{T<:Number} <: FieldConstant field with value of type T.
Gridap.Fields.DensifyInnerMostBlockLevelMap — Type
struct DensifyInnerMostBlockLevelMap <: MapGridap.Fields.Field — Type
abstract type Field <: MapAbstract type representing a physical (scalar, vector, or tensor) field. The domain is a Point and the range a scalar (i.e., a sub-type of Julia Number), a VectorValue, or a TensorValue.
These different cases are distinguished by the return value obtained when evaluating them. E.g., a physical field returns a vector of values when evaluated at a vector of points, and a basis of nf fields returns a 2d matrix (np x nf) when evaluated at a vector of np points.
The following functions (i.e., the Map API) need to be overloaded:
and optionally
A Field can also provide its gradient if the following function is implemented
Higher derivatives can be obtained if the resulting object also implements this method.
The interface can be tested with
For performance, the user can also consider a vectorised version of the Field API that evaluates the field in a vector of points (instead of only one point). E.g., the evaluate! function for a vector of points returns a vector of scalar, vector or tensor values.
Gridap.Fields.FieldGradient — Type
struct FieldGradient{N,F} <: FieldType that represents the gradient of a field F. The wrapped field must implement evaluate_gradient! and return_gradient_cache for this gradient to work.
N is how many times the gradient is applied.
Gridap.Fields.FieldGradientArray — Type
A wrapper that represents the broadcast of gradient over an array of fields. Ng is the number of times the gradient is applied
Gridap.Fields.GenericField — Type
struct GenericField{T} <: FieldA wrapper for objects that can act as fields, e.g., functions which implement the Field API.
Gridap.Fields.IntegrationMap — Type
struct IntegrationMap <: MapMap for low level integrate, that is computation of vectorized discrete quadratures.
Gridap.Fields.MockField — Type
struct MockField{T<:Number} <: FieldFor tests.
Gridap.Fields.MockFieldArray — Type
struct MockFieldArray{N,A} <: AbstractArray{GenericField{Nothing},N}For tests.
Gridap.Fields.OperationField — Type
struct OperationField{O,F} <: FieldA Field that is obtained as a given operation op::O over a tuple of fields fields::F.
Gridap.Fields.Point — Type
const Point{D,T} = VectorValue{D,T}Type representing a point of D dimensions with coordinates of type T. Fields are evaluated at vectors of Point objects.
Gridap.Fields.TransposeFieldIndices — Type
Given a matrix np x nf1 x nf2 result of the evaluation of a field vector on a vector of points, it returns an array in which the field axes (second and third axes) are permuted. It is equivalent as Base.permutedims(A,(1,3,2)) but more performant, since it does not involve allocations.
Gridap.Fields.VoidBasis — Type
struct VoidBasis{T,N,A} <: AbstractArray{T,N}Gridap.Fields.VoidBasisMap — Type
struct VoidBasisMap <: MapGridap.Fields.VoidField — Type
struct VoidField{F} <: FieldGridap.Fields.VoidFieldMap — Type
struct VoidFieldMap <: MapGridap.Fields.ZeroField — Type
struct ZeroField{F} <: FieldIt represents 0.0*f for a field f::F.
Gridap.Arrays.evaluate! — Method
Implementation of return_cache for a array of Field.
If the field vector has length nf and it is evaluated in one point, it returns an nf vector with the result. If the same array is applied to a vector of np points, it returns a matrix np x nf.
Gridap.Fields.DIV — Method
DIV(f)Reference space divergence.
Gridap.Fields.affine_map — Method
affine_map(gradient, origin) = AffineField(gradient, origin)See AffineField.
Gridap.Fields.constant_field — Method
constant_field(value) = ConstantField(value)See ConstantField.
Gridap.Fields.curl — Method
curl(f)Abstract curl operator, formally equivalent to
f -> ∂₁f₂ - ∂₂f₁for 2D vector functions, orf -> ∇×ffor 3D vector functions.
Gridap.Fields.divergence — Method
divergence(f)Abstract divergence operator, formally equivalent to f -> ∇⋅f.
Gridap.Fields.grad2curl — Method
grad2curl(∇f)Return
∇f[1,2] - ∇f[2,1]for 2×2 input tensor, orVectorValue(∇f[2,3] - ∇f[3,2], ∇f[3,1] - ∇f[1,3], ∇f[1,2] - ∇f[2,1])for 3×3 input tensor.
Gridap.Fields.gradient — Function
function gradient endAbstract gradient operator, see Field.
Gridap.Fields.gradient_type — Method
gradient_type(::Type{T}, x::Point) where TTensor type of the gradient of a T valued function.
Gridap.Fields.integrate — Method
integrate(a::AbstractArray{<:Field},q::AbstractVector{<:Point},w::AbstractVector{<:Real},j::Field)Integration of a given array of fields in the "reference" space
Gridap.Fields.integrate — Method
integrate(a::AbstractArray{<:Field},x::AbstractVector{<:Point},w::AbstractVector{<:Real})Integration of a given array of fields in the "physical" space
Gridap.Fields.integrate — Method
integrate(a::Field,q::AbstractVector{<:Point},w::AbstractVector{<:Real},j::Field)Numerical integration of a given field in the "reference" space. j is the Jacobian field of the geometrical mapping .
Gridap.Fields.integrate — Method
integrate(a::Field,x::AbstractVector{<:Point},w::AbstractVector{<:Real})Numerical integration of a given field in the "physical" space. a is the field, x the quadrature points and w the quadrature weights.
Gridap.Fields.laplacian — Method
laplacian(f)Abstract laplacian operator, equivalent to tr(∇∇(f)).
Gridap.Fields.linear_combination — Method
linear_combination(a::AbstractVector{<:Number}, b::AbstractVector{<:Field})
linear_combination(a::AbstractMatrix{<:Number}, b::AbstractVector{<:Field})Gridap.Fields.pinvJt — Method
function pinvJt(Jt::MultiValue{Tuple{D,D}}) = inv(Jt)
function pinvJt(Jt::MultiValue{Tuple{D1,D2}}) = transpose(inv(Jt⋅transpose(J))⋅Jt)Gridap.Fields.push_∇ — Method
push_∇(∇a::Field, ϕ::Field) = pinvJt(∇(ϕ))⋅∇aPushforward of ∇a by the mapping ϕ, or covariant Piola transform.
Gridap.Fields.push_∇∇ — Method
Gridap.Fields.skew_symmetric_gradient — Method
skew_symmetric_gradient(f)Abstract skew symmetric gradient operator, formally equivalent to f -> ½(∇f - (∇f)ᵀ).
Gridap.Fields.symmetric_gradient — Method
symmetric_gradient(f)Abstract symmetric gradient operator, formally equivalent to f -> ½(∇f + (∇f)ᵀ).
Gridap.Fields.test_field — Function
test_field(
f::Union{Field,AbstractArray{<:Field}},
x,
v,
cmp=(==);
grad=nothing,
gradgrad=nothing)Function used to test the field interface. v is an array containing the expected result of evaluating the field f at the point or vector of points x. The comparison is performed using the cmp function. For fields objects that support the gradient function, the keyword argument grad can be used. It should contain the result of evaluating gradient(f) at x. Idem for gradgrad. The checks are performed with the @test macro.
Gridap.Fields.test_field_array — Function
test_field_array(f::AbstractArray{<:Field}, x, v, cmp=(==); grad=nothing, gradgrad=nothing)For tests.
Gridap.Fields.Δ — Function
const Δ = laplacianAlias for laplacian.
Gridap.Fields.ε — Function
const ε = symmetric_gradientAlias for the symmetric_gradient.
Gridap.Fields.∇∇ — Method
∇∇(f) = gradient(gradient(f))Abstract hessian operator.
Gridap.TensorValues.outer — Method
outer(f,∇)
f⊗∇Equivalent to transpose(gradient(f)).
Gridap.TensorValues.outer — Method
outer(∇,f)
∇⊗fEquivalent to gradient(f).
LinearAlgebra.cross — Method
cross(∇,f)
∇×fEquivalent to curl(f).
LinearAlgebra.dot — Method
∇⋅fEquivalent to divergence(f).