create_surface_elements() moved to abaqus.jl and tested

This commit is contained in:
Tero Frondelius
2016-10-26 23:10:38 +03:00
parent 2b0124041c
commit cdcb3f580d
4 changed files with 29 additions and 24 deletions
+2 -2
View File
@@ -119,7 +119,7 @@ module Preprocess
include("preprocess.jl")
export create_elements, Mesh, add_node!, add_nodes!, add_element!,
add_elements!, add_element_to_element_set!, add_node_to_node_set!,
find_nearest_nodes, reorder_element_connectivity!, create_surface_elements
find_nearest_nodes, reorder_element_connectivity!
include("preprocess_abaqus_reader.jl")
export parse_abaqus, parse_section, parse_element_section,
abaqus_read_mesh, abaqus_read_model
@@ -156,7 +156,7 @@ export Postprocessor
module Abaqus
include("abaqus.jl")
export abaqus_read_model, abaqus_run_model, abaqus_open_results
export abaqus_read_model, abaqus_run_model, abaqus_open_results, create_surface_elements
end
end #
+24
View File
@@ -733,3 +733,27 @@ function abaqus_run_model(name; fetch=false, verbose=false)
return status
end
"""
This function gerates surface elements from solid elements
slave = create_surface_elements(mesh, :slave_surf)
master = create_surface_elements(mesh, :master_surf)
"""
function create_surface_elements(mesh::Mesh, surface_name::Symbol)
elements = []
for (parent_element_id, parent_element_side) in mesh.surfaces[surface_name]
parent_element_type = mesh.element_types[parent_element_id]
parent_element_connectivity = mesh.elements[parent_element_id]
child_element_type, child_element_lconn, child_element_connectivity =
get_child_element(parent_element_type, parent_element_side,
parent_element_connectivity)
child_element = Element(JuliaFEM.(child_element_type), child_element_connectivity)
push!(elements, child_element)
end
update!(elements, "geometry", mesh.nodes)
return elements
end
-22
View File
@@ -132,28 +132,6 @@ function create_elements(mesh::Mesh, element_sets::AbstractString...; element_ty
return create_elements(mesh, element_sets...; element_type=element_type)
end
"""
This function gerates surface elements from solid elements
slave = create_surface_elements(mesh, :slave_surf)
master = create_surface_elements(mesh, :master_surf)
"""
function create_surface_elements(mesh::Mesh, surface_name::Symbol)
elements = []
for (parent_element_id, parent_element_side) in mesh.surfaces[surface_name]
parent_element_type = mesh.element_types[parent_element_id]
parent_element_connectivity = mesh.elements[parent_element_id]
child_element_type, child_element_lconn, child_element_connectivity =
get_child_element(parent_element_type, parent_element_side,
parent_element_connectivity)
child_element = Element(JuliaFEM.(child_element_type), child_element_connectivity)
push!(elements, child_element)
end
update!(elements, "geometry", mesh.nodes)
return elements
end
""" find npts nearest nodes from mesh and return id numbers as list. """
function find_nearest_nodes(mesh::Mesh, coords::Vector, npts=1)
+3
View File
@@ -3,6 +3,7 @@
using JuliaFEM
using JuliaFEM.Preprocess
using JuliaFEM.Abaqus
using JuliaFEM.Testing
@testset "read inp file" begin
@@ -51,4 +52,6 @@ end
@test mesh.surfaces[:LOAD][1] == (16, :S1)
@test mesh.surface_types[:LOAD] == :ELEMENT
@test length(Set(map(size, values(mesh.nodes)))) == 1
elements = create_surface_elements(mesh,:LOAD)
@test get_connectivity(elements[1]) == [8,9,10]
end