Consider the definition of the geometrical domain in N-dimensional space, meshed into sub-domains. And if we want to keep its boundary mesh (e.g. for boundary conditions) we would want to write something like this:
type Domain{N}
volumes :: Array{Float64, N}
boundaryareas :: Array{Float64, N-1}
...
end
(a bit artificial, but it illustrates the problem) Notice, boundaryareas
must be one dimension smaller compared to volumes. But currently Julia will throw an error on N-1
. Is there any other way to express the idea “I want this to be of dimension N
and this of dimension N-1
(or N+1
) and this relation should always be satisfied”?