# Gridap.Fields

`Gridap.Fields.AffineMap`

— TypeA Field with this form y = x⋅G + y0

`Gridap.Fields.BroadcastOpFieldArray`

— TypeType that represents a broadcast operation over a set of `AbstractArray{<:Field}`

. The result is a sub-type of `AbstractArray{<:Field}`

`Gridap.Fields.Field`

— Type`abstract type Field <: Map`

Abstract 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 next paragraph is out-of-date:

Moreover, if the `gradient(f)`

is not provided, a default implementation that uses the following functions will be used.

Higher order derivatives require the implementation of

These four methods are only designed to be called by the default implementation of `field_gradient(f)`

and thus cannot be assumed that they are available for an arbitrary field. For this reason, these functions are not exported. The general way of evaluating a gradient of a field is to build the gradient with `gradient(f)`

and evaluating the resulting object. For evaluating the hessian, use two times `gradient`

.

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`

— TypeType that represents the gradient of a field. 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`

— TypeA 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`

— TypeA wrapper for objects that can act as fields, e.g., functions which implement the `Field`

API.

`Gridap.Fields.OperationField`

— TypeA `Field`

that is obtained as a given operation over a tuple of fields.

`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`

— TypeGiven 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.ZeroField`

— TypeIt represents `0.0*f`

for a field `f`

.

`Base.:∘`

— Method`f∘g`

It returns the composition of two fields, which is just `Operation(f)(g)`

`Gridap.Arrays.evaluate!`

— MethodImplementation 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.curl`

— Method`curl(f)`

`Gridap.Fields.divergence`

— Method`divergence(f)`

`Gridap.Fields.grad2curl`

— Method`grad2curl(∇f)`

`Gridap.Fields.gradient_type`

— Method`gradient_type(::Type{T},x::Point) where T`

`Gridap.Fields.integrate`

— MethodIntegration of a given array of fields in the "reference" space

`Gridap.Fields.integrate`

— MethodIntegration of a given array of fields in the "physical" space

`Gridap.Fields.integrate`

— MethodIntegration of a given field in the "reference" space

`Gridap.Fields.integrate`

— MethodIntegration of a given field in the "physical" space

`Gridap.Fields.laplacian`

— Method`laplacian(f)`

`Gridap.Fields.symmetric_gradient`

— Method`symmetric_gradient(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.Δ`

— Function`const Δ = laplacian`

Alias for the `laplacian`

function

`Gridap.Fields.ε`

— Function`const ε = symmetric_gradient`

Alias for the symmetric gradient

`Gridap.TensorValues.outer`

— Method`outer(f,∇)`

Equivalent to

`transpose(gradient(f))`

`Gridap.TensorValues.outer`

— Method`outer(∇,f)`

Equivalent to

`gradient(f)`

`LinearAlgebra.cross`

— Method`cross(∇,f)`

Equivalent to

`curl(f)`

`LinearAlgebra.dot`

— Method`∇⋅f`

Equivalent to

`divergence(f)`