diff --git a/src/fields.jl b/src/fields.jl index a73d113..8c2409d 100644 --- a/src/fields.jl +++ b/src/fields.jl @@ -10,10 +10,13 @@ abstract Variable <: AbstractField abstract TimeVariant <: AbstractField abstract TimeInvariant <: AbstractField + type Field{A<:Union{Discrete,Continuous}, B<:Union{Constant,Variable}, C<:Union{TimeVariant,TimeInvariant}} data end +typealias FieldSet Dict{ASCIIString, Field} + ### Basic data structure for discrete field type Increment{T} @@ -210,20 +213,20 @@ function Base.(:-)(f1::DVTI, f2::DVTI) return DVTI(f1.data - f2.data) end -""" Multiply DCTI field with a constant ``c``. """ function Base.(:*){T<:Real}(c::T, field::DVTI) return DVTI(c*field.data) end -""" Interpolate with basis functions. """ function Base.(:*)(N::Matrix, f::DCTI) return f.data*N' end -""" Multiply DVTI field with another vector T. Vector length -must match to the field length and this can be used mainly -for interpolation purposes, i.e., u = ∑ Nᵢuᵢ -""" + +# +# Multiply DVTI field with another vector T. Vector length +# must match to the field length and this can be used mainly +# for interpolation purposes, i.e., u = ∑ Nᵢuᵢ +# function Base.(:*)(T::Vector, f::DVTI) @assert length(T) == length(f) return sum([T[i]*f[i] for i=1:length(f)]) @@ -407,7 +410,3 @@ function Base.(:*)(grad::Matrix, field::DVTI) return sum([kron(grad[:,i], field[i]') for i=1:length(field)])' end -### FIELDSET ### - -typealias FieldSet Dict{ASCIIString, Field} -