I have a derived type represented by:
struct BoundaryCondition
domain::MeshStructure
left::BorderValue
right::BorderValue
bottom::BorderValue
top::BorderValue
back::BorderValue
front::BorderValue
end
I want to create an array of this derived type, of size n_comp, which I have in my code as:
bc = Array{BoundaryCondition}(n_comp)
for i in 1:n_comp
bc[i] = createBC(m)
bc[i].left.a[:] = 0.0
bc[i].left.b[:] = 1.0
bc[i].left.c[:] = c_left[i]
end
But I receive an error:
ERROR: LoadError: MethodError: no method matching (Array{BoundaryCondition, N} where N)(::Int64)
What is the correct way to declare my array of type BoundaryCondition?