From 50c6358cacfbdefd3c8f6979400ca20ce967e273 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olli=20V=C3=A4in=C3=B6l=C3=A4?= Date: Tue, 1 Dec 2015 21:11:10 +0200 Subject: [PATCH] commenting and making minor fixes --- src/interfaces.jl | 18 +++++++++++------- test/test_api.jl | 2 +- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/interfaces.jl b/src/interfaces.jl index e604e88..57f5928 100644 --- a/src/interfaces.jl +++ b/src/interfaces.jl @@ -33,7 +33,7 @@ function solve!(model::Model, case_name::ASCIIString, time::Float64) model.elements[el_id].results = core_element end -# # Lisätään Neumann:nin reunaehdot ja listään field probleemaan + # Add Neumann boundary conditions to elements for each in neumann_bcs set_for_bc = each.set_name set_ids = model.elsets[set_for_bc] @@ -44,10 +44,13 @@ function solve!(model::Model, case_name::ASCIIString, time::Float64) end end dirile_arr = Any[] + # Create Dirichlet boundary conditions for each in dirichlet_bcs set_name = each.set_name value = each.value - problem = JuliaFEM.Core.DirichletProblem(value[1], 1) + problem = JuliaFEM.Core.DirichletProblem( + JuliaFEM.Core.get_unknown_field_name(field_problem), + JuliaFEM.Core.get_unknown_field_dimension(field_problem)) set_for_bc = each.set_name set_ids = model.elsets[set_for_bc] bc = each.value @@ -58,17 +61,18 @@ function solve!(model::Model, case_name::ASCIIString, time::Float64) end push!(dirile_arr, problem) end + + # Push all the elements, where the field problem is solved into the field_problem element_set = case.sets el_ids = model.elsets[element_set].elements for each in el_ids push!(field_problem, core_elements[each]) end - solver = JuliaFEM.Core.(case.solver)(field_problem, dirile_arr[1]) - solver(1.0) + # Creating the solver + solver = JuliaFEM.Core.(case.solver)(field_problem, dirile_arr...) + # Solving + solver(time) end -function foo() - return "bar" -end diff --git a/test/test_api.jl b/test/test_api.jl index d2b5861..379e255 100644 --- a/test/test_api.jl +++ b/test/test_api.jl @@ -79,5 +79,5 @@ function test_piston_8789() model = Model("Piston Calculation", abaqus_input) end - +test_basic() end