Move Abaqus-related functions to own file (#137)

This commit is contained in:
Jukka Aho
2017-07-29 10:51:19 +03:00
committed by GitHub
parent e46c0a1ad4
commit cbc85ee665
3 changed files with 47 additions and 44 deletions
+3
View File
@@ -138,6 +138,9 @@ export create_elements, Mesh, add_node!, add_nodes!, add_element!,
find_nearest_nodes, find_nearest_node, reorder_element_connectivity!,
create_node_set_from_element_set!
include("preprocess_abaqus_reader.jl")
export abaqus_read_mesh, create_surface_elements
include("preprocess_aster_reader.jl")
export aster_create_elements, parse_aster_med_file, is_aster_mail_keyword,
parse_aster_header, aster_parse_nodes, aster_renumber_nodes!,
-44
View File
@@ -228,47 +228,3 @@ function JuliaFEM.Problem{P<:BoundaryProblem}(mesh::Mesh, ::Type{P}, name, dimen
problem.elements = create_elements(mesh, name)
return problem
end
using AbaqusReader
function abaqus_read_mesh(fn::String)
m = AbaqusReader.abaqus_read_mesh(fn)
return Mesh(m)
end
"""
create_surface_elements(mesh::Mesh, surface_name::Symbol)
Create a set of surface elements from solid elements.
Notation follow what is defined in ABAQUS. For example, if solid elements
are Tet10, surface elements will be Tri6 and they can be used to define
boundary conditions.
"""
function create_surface_elements(mesh::Mesh, surface_name::Symbol)
elements = Element[]
for (elid, elsi) in mesh.surface_sets[surface_name]
elty = mesh.element_types[elid]
elco = mesh.elements[elid]
chel, chcon = AbaqusReader.create_surface_element(elty, elsi, elco)
ch = Element(getfield(JuliaFEM, chel), chcon)
push!(elements, ch)
end
update!(elements, "geometry", mesh.nodes)
return elements
end
"""
create_surface_elements(mesh::Mesh, surface_name::String)
Create a set of surface elements from solid elements.
Notation follow what is defined in ABAQUS. For example, if solid elements
are Tet10, surface elements will be Tri6 and they can be used to define
boundary conditions.
"""
function create_surface_elements(mesh::Mesh, surface_name::String)
return create_surface_elements(mesh, Symbol(surface_name))
end
export abaqus_read_mesh, create_surface_elements
+44
View File
@@ -0,0 +1,44 @@
# This file is a part of JuliaFEM.
# License is MIT: see https://github.com/JuliaFEM/JuliaFEM.jl/blob/master/LICENSE.md
using AbaqusReader
function abaqus_read_mesh(fn::String)
m = AbaqusReader.abaqus_read_mesh(fn)
return Mesh(m)
end
"""
create_surface_elements(mesh::Mesh, surface_name::Symbol)
Create a set of surface elements from solid elements.
Notation follow what is defined in ABAQUS. For example, if solid elements
are Tet10, surface elements will be Tri6 and they can be used to define
boundary conditions.
"""
function create_surface_elements(mesh::Mesh, surface_name::Symbol)
elements = Element[]
for (elid, elsi) in mesh.surface_sets[surface_name]
elty = mesh.element_types[elid]
elco = mesh.elements[elid]
chel, chcon = AbaqusReader.create_surface_element(elty, elsi, elco)
ch = Element(getfield(JuliaFEM, chel), chcon)
push!(elements, ch)
end
update!(elements, "geometry", mesh.nodes)
return elements
end
"""
create_surface_elements(mesh::Mesh, surface_name::String)
Create a set of surface elements from solid elements.
Notation follow what is defined in ABAQUS. For example, if solid elements
are Tet10, surface elements will be Tri6 and they can be used to define
boundary conditions.
"""
function create_surface_elements(mesh::Mesh, surface_name::String)
return create_surface_elements(mesh, Symbol(surface_name))
end