From a0d0b48434efcdda14c47e46425ee79edbe5ebe3 Mon Sep 17 00:00:00 2001 From: Jukka Aho Date: Sun, 3 Jul 2016 21:45:22 +0300 Subject: [PATCH] docstrings + 0.5 --- src/fields.jl | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) 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} -