mirror of
https://github.com/JuliaFEM/JuliaFEM.jl.git
synced 2026-09-19 09:54:55 +00:00
c307c1482c
Change the code coverage to green. * removed duplicate code * Removed unused code * removed unmaintained code * DCTI + DVTI refactored * discrete fields refactored and tested * fields are now tested quite well. * Removed obsolete code not used anywhere * Element descriptions to common dictionary * size in global const dictionary also * Added coverage to sparse tools and removed couple unused functions * get nonzero rows from SparseMatrixCSC * bugfix: extending element basis now working and tested * Removed two unused functions from elements.jl * removed useless function * Useless conversion * remove elasticity assembly using ForwardDiff because it's not used anywhere' * Added basic testing for NURBS. Fixed bug in NSolid interpolation. * removed unused functions * Removed some debug stuff * renamed file * removed field assembly posthook, i think not good idea at all * test for nnz(K) == 0 and automatic determination of dofs * Testing that solver is throwing error if having problems with boundary assembly * Removed some unused options. Refactoring. * Moved solver non-related code to elements.jl * Removed custom exception (no need) * unneeded postprocess code * More tests for NURBS elements. * Removed unfinished .mail parser * proper use of Logging package * also read results * renamed test file * create_surface_elements accepts surface name in String now * bugfix: remove zero rows from constraint matrix after manually removing dofs from some boundary assemblies. * New test, displacement 3d patch test * skip displacement field in surface element splitting if not defined * test element splitting and linear surface elements, fails. * Bugfix: Xdmf, not XDMF * removed nonworking tests, requires bugfix * abaqus_read_results is not working -> bug
46 lines
1.8 KiB
Julia
46 lines
1.8 KiB
Julia
# This file is a part of JuliaFEM.
|
|
# License is MIT: see https://github.com/JuliaFEM/JuliaFEM.jl/blob/master/LICENSE.md
|
|
|
|
using JuliaFEM
|
|
using JuliaFEM.Preprocess
|
|
using JuliaFEM.Postprocess
|
|
using JuliaFEM.Testing
|
|
using JuliaFEM.Abaqus: create_surface_elements
|
|
|
|
@testset "test that interface transfers constant field without error" begin
|
|
meshfile = Pkg.dir("JuliaFEM") * "/test/testdata/block_3d.med"
|
|
mesh = aster_read_mesh(meshfile)
|
|
|
|
upper = Problem(Heat, "upper", 1)
|
|
upper.elements = create_elements(mesh, "UPPER")
|
|
update!(upper, "temperature thermal conductivity", 1.0)
|
|
lower = Problem(Heat, "lower", 1)
|
|
lower.elements = create_elements(mesh, "LOWER")
|
|
update!(lower, "temperature thermal conductivity", 1.0)
|
|
|
|
bc_upper = Problem(Dirichlet, "upper boundary", 1, "temperature")
|
|
bc_upper.elements = create_elements(mesh, "UPPER_TOP")
|
|
update!(bc_upper, "temperature 1", 0.0)
|
|
|
|
bc_lower = Problem(Dirichlet, "lower boundary", 1, "temperature")
|
|
bc_lower.elements = create_elements(mesh, "LOWER_BOTTOM")
|
|
update!(bc_lower, "temperature 1", 1.0)
|
|
|
|
interface = Problem(Mortar, "interface between upper and lower block", 1, "temperature")
|
|
interface_slave_elements = create_elements(mesh, "LOWER_TOP")
|
|
interface_master_elements = create_elements(mesh, "UPPER_BOTTOM")
|
|
update!(interface_slave_elements, "master elements", interface_master_elements)
|
|
interface.elements = [interface_master_elements; interface_slave_elements]
|
|
|
|
solver = LinearSolver(upper, lower, bc_upper, bc_lower, interface)
|
|
solver()
|
|
|
|
node_ids, temperature = get_nodal_vector(interface.elements, "temperature", 0.0)
|
|
T = [t[1] for t in temperature]
|
|
minT = minimum(T)
|
|
maxT = maximum(T)
|
|
info("minT = $minT, maxT = $maxT")
|
|
@test isapprox(minT, 0.5)
|
|
@test isapprox(maxT, 0.5)
|
|
end
|