Files
JuliaFEM.jl/src/problems.jl
T

37 lines
950 B
Julia
Raw Normal View History

# This file is a part of JuliaFEM.
# License is MIT: see https://github.com/JuliaFEM/JuliaFEM.jl/blob/master/LICENSE.md
2015-11-27 10:10:00 +02:00
abstract AbstractProblem
2015-11-27 10:10:00 +02:00
type Problem{T<:AbstractProblem}
dim :: Int
elements :: Vector{Element}
2015-10-20 15:54:47 +03:00
end
2015-11-27 10:10:00 +02:00
type BoundaryProblem{T<:AbstractProblem}
parent_field_name :: ASCIIString
parent_field_dim :: Int
dim :: Int
elements :: Vector{Element}
end
2015-11-27 10:10:00 +02:00
typealias AllProblems Union{Problem, BoundaryProblem}
2015-10-28 04:29:14 +02:00
2015-11-27 10:10:00 +02:00
function get_elements(problem::AllProblems)
return problem.elements
2015-10-09 23:45:28 +03:00
end
2015-11-27 10:10:00 +02:00
""" Return the dimension of the unknown field of this problem. """
function get_unknown_field_dimension(problem::Problem)
return problem.dim
2015-10-28 04:29:14 +02:00
end
2015-11-27 10:10:00 +02:00
""" Return the name of the unknown field of this problem. """
function get_unknown_field_name{P<:AbstractProblem}(problem::Problem{P})
return get_unknown_field_name(P)
2015-10-28 04:29:14 +02:00
end
2015-11-27 10:10:00 +02:00
function Base.push!(problem::AllProblems, element::Element)
push!(problem.elements, element)
2015-10-28 04:29:14 +02:00
end