mirror of
https://github.com/JuliaFEM/JuliaFEM.jl.git
synced 2026-08-06 04:21:33 +00:00
Remove functions used rarely
A new problem can be defined with 8(!) different styles. Let's remove the ones not used often.
This commit is contained in:
@@ -106,9 +106,6 @@ julia> prob2 = Problem(Elasticity, 3)
|
|||||||
function Problem{P<:FieldProblem}(::Type{P}, name::AbstractString, dimension::Int64)
|
function Problem{P<:FieldProblem}(::Type{P}, name::AbstractString, dimension::Int64)
|
||||||
return Problem{P}(name, dimension, "none", [], Dict(), Assembly(), Dict(), Vector(), P())
|
return Problem{P}(name, dimension, "none", [], Dict(), Assembly(), Dict(), Vector(), P())
|
||||||
end
|
end
|
||||||
function Problem{P<:FieldProblem}(::Type{P}, dimension::Int64)
|
|
||||||
return Problem(P, "$P problem", dimension)
|
|
||||||
end
|
|
||||||
|
|
||||||
""" Construct a new boundary problem.
|
""" Construct a new boundary problem.
|
||||||
|
|
||||||
@@ -122,12 +119,6 @@ solver.
|
|||||||
function Problem{P<:BoundaryProblem}(::Type{P}, name, dimension, parent_field_name)
|
function Problem{P<:BoundaryProblem}(::Type{P}, name, dimension, parent_field_name)
|
||||||
return Problem{P}(name, dimension, parent_field_name, [], Dict(), Assembly(), Dict(), Vector(), P())
|
return Problem{P}(name, dimension, parent_field_name, [], Dict(), Assembly(), Dict(), Vector(), P())
|
||||||
end
|
end
|
||||||
function Problem{P<:BoundaryProblem}(::Type{P}, main_problem::Problem)
|
|
||||||
name = "$P problem"
|
|
||||||
dimension = get_unknown_field_dimension(main_problem)
|
|
||||||
parent_field_name = get_unknown_field_name(main_problem)
|
|
||||||
return Problem{P}(name, dimension, parent_field_name, [], Dict(), Assembly(), Dict(), Vector(), P())
|
|
||||||
end
|
|
||||||
|
|
||||||
function get_formulation_type(problem::Problem)
|
function get_formulation_type(problem::Problem)
|
||||||
return :incremental
|
return :incremental
|
||||||
|
|||||||
@@ -25,10 +25,10 @@ function get_model()
|
|||||||
update!(e2, "displacement 1" => 0.0)
|
update!(e2, "displacement 1" => 0.0)
|
||||||
update!(e2, "displacement 2" => 0.0)
|
update!(e2, "displacement 2" => 0.0)
|
||||||
update!(e2, "displacement 3" => 0.0)
|
update!(e2, "displacement 3" => 0.0)
|
||||||
p1 = Problem(Elasticity, 3)
|
p1 = Problem(Elasticity, "test problem", 3)
|
||||||
p1.properties.finite_strain = false
|
p1.properties.finite_strain = false
|
||||||
p1.properties.geometric_stiffness = false
|
p1.properties.geometric_stiffness = false
|
||||||
p2 = Problem(Dirichlet, p1)
|
p2 = Problem(Dirichlet, "boundary condition", 3, "displacement")
|
||||||
push!(p1, e1)
|
push!(p1, e1)
|
||||||
push!(p2, e2)
|
push!(p2, e2)
|
||||||
solver = Solver(Modal)
|
solver = Solver(Modal)
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ using JuliaFEM.Testing
|
|||||||
|
|
||||||
@testset "test initialize scalar field problem" begin
|
@testset "test initialize scalar field problem" begin
|
||||||
el = Element(Seg2, [1, 2])
|
el = Element(Seg2, [1, 2])
|
||||||
pr = Problem(Heat, 1)
|
pr = Problem(Heat, "heat problem", 1)
|
||||||
push!(pr, el)
|
push!(pr, el)
|
||||||
initialize!(pr)
|
initialize!(pr)
|
||||||
@test haskey(el, "temperature")
|
@test haskey(el, "temperature")
|
||||||
@@ -19,7 +19,7 @@ end
|
|||||||
|
|
||||||
@testset "test initialize vector field problem" begin
|
@testset "test initialize vector field problem" begin
|
||||||
el = Element(Seg2, [1, 2])
|
el = Element(Seg2, [1, 2])
|
||||||
pr = Problem(Elasticity, 2)
|
pr = Problem(Elasticity, "elasticity problem", 2)
|
||||||
push!(pr, el)
|
push!(pr, el)
|
||||||
initialize!(pr)
|
initialize!(pr)
|
||||||
@test haskey(el, "displacement")
|
@test haskey(el, "displacement")
|
||||||
|
|||||||
Reference in New Issue
Block a user