Improvements to preprocess scripts

* convert several elements to node sets in one command

* possibility to find particular node from mesh filtered by node set
This commit is contained in:
Jukka Aho
2017-02-27 07:33:06 +02:00
parent 4a471b5cb7
commit 6248887189
3 changed files with 30 additions and 7 deletions
+13
View File
@@ -6,6 +6,8 @@ using JuliaFEM.Preprocess
using JuliaFEM.Postprocess
using JuliaFEM.Testing
datadir = first(splitext(basename(@__FILE__)))
@testset "renumber element nodes" begin
mesh = Mesh()
add_element!(mesh, 1, :Tet10, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
@@ -31,3 +33,14 @@ end
@test mesh.elements[1] == vec
@test mesh.elements[11] == vec
end
@testset "find nearest nodes from mesh" begin
meshfile = joinpath(datadir, "block_2d.med")
mesh = aster_read_mesh(meshfile)
create_node_set_from_element_set!(mesh, "LOWER_LEFT", "UPPER_BOTTOM")
# nid 1 coords = (0.0, 0.5), nid 13 coords = (0.0, 0.5)
nid = find_nearest_nodes(mesh, [0.0, 0.5]; node_set="LOWER_LEFT")
@test first(nid) == 1
nid = find_nearest_nodes(mesh, [0.0, 0.5]; node_set="UPPER_BOTTOM")
@test first(nid) == 13
end