mirror of
https://github.com/JuliaFEM/JuliaFEM.jl.git
synced 2026-09-26 11:51:31 +00:00
med node ordering
This commit is contained in:
+4
-1
@@ -22,7 +22,7 @@ export DCTI
|
||||
|
||||
### ELEMENTS ###
|
||||
include("elements.jl") # common element routines
|
||||
export Node, AbstractElement, Element, update!
|
||||
export Node, AbstractElement, Element, update!, get_connectivity
|
||||
include("lagrange_macro.jl") # Continuous Galerkin (Lagrange) elements generated using macro
|
||||
export Seg2, Tri3, Tri6, Quad4, Hex8, Tet4, Tet10
|
||||
|
||||
@@ -77,6 +77,9 @@ end
|
||||
|
||||
module Postprocess
|
||||
include("xdmf.jl")
|
||||
export xdmf_new_temporal_collection, xdmf_new_grid,
|
||||
xdmf_new_mesh!, xdmf_new_nodal_field!,
|
||||
xdmf_save_model, xdmf_new_model
|
||||
end
|
||||
|
||||
""" JuliaFEM testing routines. """
|
||||
|
||||
@@ -23,6 +23,10 @@ function setindex!(element::Element, data, field_name::ASCIIString)
|
||||
element.fields[field_name] = Field(data)
|
||||
end
|
||||
|
||||
function call(element::Element, field_name::ASCIIString, time=0.0)
|
||||
return element[field_name](time)
|
||||
end
|
||||
|
||||
function call(element::Element, xi::Vector, time=0.0)
|
||||
get_basis(element, xi, time)
|
||||
end
|
||||
|
||||
+1
-1
@@ -207,7 +207,7 @@ function get_integration_points(element::LinearElement; order=2)
|
||||
get_integration_points(element, Val{order})
|
||||
end
|
||||
|
||||
function get_integration_points(element::QuadraticElement; order=3)
|
||||
function get_integration_points(element::QuadraticElement; order=2)
|
||||
get_integration_points(element, Val{order})
|
||||
end
|
||||
|
||||
|
||||
@@ -6,11 +6,15 @@ using JuliaFEM
|
||||
|
||||
function aster_create_elements(mesh, element_set, element_type=nothing; reverse_connectivity=false)
|
||||
elements = Element[]
|
||||
mapping = Dict(:QU4 => Quad4, :TR3 => Tri3, :SE2 => Seg2, :HE8 => Hex8, :TE4 => Tet4)
|
||||
mapping = Dict(
|
||||
:SE2 => Seg2,
|
||||
:TR3 => Tri3,
|
||||
:TR6 => Tri6,
|
||||
:QU4 => Quad4,
|
||||
:HE8 => Hex8,
|
||||
:TE4 => Tet4,
|
||||
:T10 => Tet10)
|
||||
for (elid, (eltype, elset, elcon)) in mesh["connectivity"]
|
||||
if !haskey(mapping, eltype)
|
||||
error("aster_create_elements: unknown element mapping $eltype")
|
||||
end
|
||||
elset == element_set || continue
|
||||
if !isa(element_type, Void)
|
||||
if isa(element_type, Tuple)
|
||||
@@ -24,6 +28,9 @@ function aster_create_elements(mesh, element_set, element_type=nothing; reverse_
|
||||
if reverse_connectivity
|
||||
elcon = reverse(elcon)
|
||||
end
|
||||
if !haskey(mapping, eltype)
|
||||
error("aster_create_elements: unknown element mapping $eltype")
|
||||
end
|
||||
element = Element(mapping[eltype], elcon)
|
||||
push!(elements, element)
|
||||
end
|
||||
@@ -290,10 +297,16 @@ end
|
||||
# hex8 nodes rotating cw first in yz plane then x+1
|
||||
|
||||
global const med_elmap = Dict{Symbol, Vector{Int}}(
|
||||
:HE8 => [4, 8, 7, 3, 1, 5, 6, 2],
|
||||
:TE4 => [2, 3, 4, 1],
|
||||
:SE2 => [1, 2],
|
||||
:SE3 => [1, 2, 3],
|
||||
:TR3 => [1, 2, 3],
|
||||
:TR6 => [1, 2, 3, 4, 5, 6],
|
||||
:QU4 => [1, 2, 3, 4],
|
||||
# :SE2 => [2, 1]
|
||||
:HE8 => [4, 8, 7, 3, 1, 5, 6, 2], # ..?
|
||||
:TE4 => [3, 2, 1, 4],
|
||||
:T10 => [3, 2, 1, 4, 6, 5, 7, 10, 9, 8]
|
||||
# :T10 => [3, 4, 1, 2, 10, 8, 7, 6, 9, 5]
|
||||
# :T10 => [5, 9, 6, 7, 8, 10, 2, 1, 4, 3]
|
||||
)
|
||||
|
||||
function get_connectivity(med::MEDFile, elsets, mesh_name)
|
||||
@@ -318,8 +331,8 @@ function get_connectivity(med::MEDFile, elsets, mesh_name)
|
||||
if haskey(med_elmap, eltype)
|
||||
elco = elco[med_elmap[eltype]]
|
||||
else
|
||||
#warn("no element mapping info found for element type $eltype")
|
||||
#warn("consider this as a warning: element may have french nodal ordering")
|
||||
warn("no element mapping info found for element type $eltype")
|
||||
warn("consider this as a warning: element may have french nodal ordering")
|
||||
end
|
||||
d[element_ids[i]] = (eltype, elset, elco)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user