mirror of
https://github.com/JuliaFEM/JuliaFEM.jl.git
synced 2026-09-21 10:23:37 +00:00
Make code 0.6 compatible (#128)
* running v0.6 conversion code proposed by @ovainola in #108. * change travis so that build is done using 0.6 * documentation is build from 0.6 * fix most of deprecation warnings * fix test to pass 0.6
This commit is contained in:
+1
-1
@@ -2,7 +2,7 @@ language: julia
|
||||
os:
|
||||
- linux
|
||||
julia:
|
||||
- 0.5
|
||||
- 0.6
|
||||
notifications:
|
||||
email: false
|
||||
webhooks:
|
||||
|
||||
+1
-1
@@ -7,4 +7,4 @@ using JuliaFEM
|
||||
deploydocs(
|
||||
deps = Deps.pip("mkdocs", "python-markdown-math"),
|
||||
repo = "github.com/JuliaFEM/JuliaFEM.jl.git",
|
||||
julia = "0.5")
|
||||
julia = "0.6")
|
||||
|
||||
+8
-8
@@ -9,12 +9,12 @@ using JuliaFEM.Postprocess
|
||||
|
||||
### Model definitions for ABAQUS data model
|
||||
|
||||
abstract AbstractMaterial
|
||||
abstract AbstractMaterialProperty
|
||||
abstract AbstractProperty
|
||||
abstract AbstractStep
|
||||
abstract AbstractBoundaryCondition
|
||||
abstract AbstractOutputRequest
|
||||
abstract type AbstractMaterial end
|
||||
abstract type AbstractMaterialProperty end
|
||||
abstract type AbstractProperty end
|
||||
abstract type AbstractStep end
|
||||
abstract type AbstractBoundaryCondition end
|
||||
abstract type AbstractOutputRequest end
|
||||
|
||||
type Model
|
||||
path :: AbstractString
|
||||
@@ -261,12 +261,12 @@ end
|
||||
@register_abaqus_keyword("CLOAD")
|
||||
@register_abaqus_keyword("DLOAD")
|
||||
@register_abaqus_keyword("DSLOAD")
|
||||
typealias BOUNDARY_CONDITIONS Union{BOUNDARY, CLOAD, DLOAD, DSLOAD}
|
||||
const BOUNDARY_CONDITIONS = Union{BOUNDARY,CLOAD,DLOAD,DSLOAD}
|
||||
|
||||
@register_abaqus_keyword("NODE PRINT")
|
||||
@register_abaqus_keyword("EL PRINT")
|
||||
@register_abaqus_keyword("SECTION PRINT")
|
||||
typealias OUTPUT_REQUESTS Union{NODE_PRINT, EL_PRINT, SECTION_PRINT}
|
||||
const OUTPUT_REQUESTS = Union{NODE_PRINT,EL_PRINT,SECTION_PRINT}
|
||||
|
||||
## Properties
|
||||
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
# This file is a part of JuliaFEM.
|
||||
# License is MIT: see https://github.com/JuliaFEM/JuliaFEM.jl/blob/master/LICENSE.md
|
||||
|
||||
abstract AbstractElement
|
||||
abstract type AbstractElement end
|
||||
|
||||
type Element{E<:AbstractElement}
|
||||
id :: Int
|
||||
|
||||
+17
-17
@@ -1,31 +1,31 @@
|
||||
# This file is a part of JuliaFEM.
|
||||
# License is MIT: see https://github.com/JuliaFEM/JuliaFEM.jl/blob/master/LICENSE.md
|
||||
|
||||
abstract AbstractField
|
||||
abstract type AbstractField end
|
||||
|
||||
abstract Discrete <: AbstractField
|
||||
abstract Continuous <: AbstractField
|
||||
abstract Constant <: AbstractField
|
||||
abstract Variable <: AbstractField
|
||||
abstract TimeVariant <: AbstractField
|
||||
abstract TimeInvariant <: AbstractField
|
||||
abstract type Discrete<:AbstractField end
|
||||
abstract type Continuous<:AbstractField end
|
||||
abstract type Constant<:AbstractField end
|
||||
abstract type Variable<:AbstractField end
|
||||
abstract type TimeVariant<:AbstractField end
|
||||
abstract type TimeInvariant<:AbstractField end
|
||||
|
||||
type Field{A<:Union{Discrete,Continuous}, B<:Union{Constant,Variable}, C<:Union{TimeVariant,TimeInvariant}}
|
||||
data
|
||||
end
|
||||
|
||||
typealias FieldSet Dict{String, Field}
|
||||
const FieldSet = Dict{String,Field}
|
||||
|
||||
### Different field combinations and other typealiases
|
||||
|
||||
typealias DCTI Field{Discrete, Constant, TimeInvariant}
|
||||
typealias DVTI Field{Discrete, Variable, TimeInvariant}
|
||||
typealias DCTV Field{Discrete, Constant, TimeVariant}
|
||||
typealias DVTV Field{Discrete, Variable, TimeVariant}
|
||||
typealias CCTI Field{Continuous, Constant, TimeInvariant}
|
||||
typealias CVTI Field{Continuous, Variable, TimeInvariant} # can be used to interpolate in spatial dimension
|
||||
typealias CCTV Field{Continuous, Constant, TimeVariant} # can be used to interpolate in time
|
||||
typealias CVTV Field{Continuous, Variable, TimeVariant}
|
||||
const DCTI = Field{Discrete,Constant,TimeInvariant}
|
||||
const DVTI = Field{Discrete,Variable,TimeInvariant}
|
||||
const DCTV = Field{Discrete,Constant,TimeVariant}
|
||||
const DVTV = Field{Discrete,Variable,TimeVariant}
|
||||
const CCTI = Field{Continuous,Constant,TimeInvariant}
|
||||
const CVTI = Field{Continuous,Variable,TimeInvariant} # can be used to interpolate in spatial dimension
|
||||
const CCTV = Field{Continuous,Constant,TimeVariant} # can be used to interpolate in time
|
||||
const CVTV = Field{Continuous,Variable,TimeVariant}
|
||||
|
||||
# Discrete fields
|
||||
|
||||
@@ -199,7 +199,7 @@ end
|
||||
""" Take dot product of DVTI field and vector T. Vector length must match to the
|
||||
field length and this can be used mainly for interpolation purposes, i.e., u = ∑ Nᵢuᵢ.
|
||||
"""
|
||||
function *(T::Vector, f::DVTI)
|
||||
function *(T::Union{Vector, RowVector}, f::DVTI)
|
||||
@assert length(T) <= length(f)
|
||||
return sum([T[i]*f[i] for i=1:length(T)])
|
||||
end
|
||||
|
||||
+9
-9
@@ -62,9 +62,9 @@ function get_integration_points(element::Poi1)
|
||||
[ (1.0, [] ) ]
|
||||
end
|
||||
|
||||
typealias CartesianLineElement Union{Seg2, Seg3, NSeg}
|
||||
typealias CartesianSurfaceElement Union{Quad4, Quad8, Quad9, NSurf}
|
||||
typealias CartesianVolumeElement Union{Hex8, Hex20, Hex27, NSolid}
|
||||
const CartesianLineElement = Union{Seg2,Seg3,NSeg}
|
||||
const CartesianSurfaceElement = Union{Quad4,Quad8,Quad9,NSurf}
|
||||
const CartesianVolumeElement = Union{Hex8,Hex20,Hex27,NSolid}
|
||||
|
||||
function get_integration_points(element::CartesianLineElement, order::Int64)
|
||||
w, xi = get_integration_points(order)
|
||||
@@ -86,7 +86,7 @@ end
|
||||
# http://math2.uncc.edu/~shaodeng/TEACHING/math5172/Lectures/Lect_15.PDF
|
||||
# http://libmesh.github.io/doxygen/quadrature__gauss__2D_8C_source.html
|
||||
|
||||
typealias TriangularElement Union{Tri3, Tri6, Tri7}
|
||||
const TriangularElement = Union{Tri3,Tri6,Tri7}
|
||||
|
||||
function get_integration_points(element::TriangularElement, ::Type{Val{1}})
|
||||
weights = [0.5]
|
||||
@@ -203,7 +203,7 @@ end
|
||||
|
||||
### 3d elements
|
||||
|
||||
typealias TetrahedralElement Union{Tet4, Tet10}
|
||||
const TetrahedralElement = Union{Tet4,Tet10}
|
||||
|
||||
function get_integration_points(element::TetrahedralElement, ::Type{Val{1}})
|
||||
weights = 1.0/6.0*[1.0]
|
||||
@@ -273,7 +273,7 @@ end
|
||||
|
||||
# http://www.colorado.edu/engineering/CAS/courses.d/AFEM.d/AFEM.Ch12.d/AFEM.Ch12.pdf
|
||||
|
||||
typealias PyramidalElement Union{Pyr5,}
|
||||
const PyramidalElement = Union{Pyr5,}
|
||||
|
||||
function get_integration_points(element::PyramidalElement, ::Type{Val{2}})
|
||||
g1 = 0.5842373946721771876874344
|
||||
@@ -292,7 +292,7 @@ function get_integration_points(element::PyramidalElement, ::Type{Val{2}})
|
||||
return zip(weights, points)
|
||||
end
|
||||
|
||||
typealias PrismaticElement Union{Wedge6, Wedge15}
|
||||
const PrismaticElement = Union{Wedge6,Wedge15}
|
||||
|
||||
function get_integration_points(element::PrismaticElement, ::Type{Val{2}})
|
||||
weights = 1/6*[1.0, 1.0, 1.0, 1.0, 1.0, 1.0]
|
||||
@@ -436,9 +436,9 @@ end
|
||||
### default number of integration points for each element
|
||||
### 2 for linear elements, 3 for quadratic
|
||||
|
||||
typealias LinearElement Union{Seg2, Tri3, Quad4, Tet4, Pyr5, Wedge6, Hex8}
|
||||
const LinearElement = Union{Seg2, Tri3, Quad4, Tet4, Pyr5, Wedge6, Hex8}
|
||||
|
||||
typealias QuadraticElement Union{Seg3, Tri6, Tri7, Tet10, Quad8, Quad9, Wedge15, Hex20, Hex27}
|
||||
const QuadraticElement = Union{Seg3,Tri6,Tri7,Tet10,Quad8,Quad9,Wedge15,Hex20,Hex27}
|
||||
|
||||
function get_integration_order(element::LinearElement)
|
||||
return 2
|
||||
|
||||
+4
-4
@@ -1,10 +1,10 @@
|
||||
# This file is a part of JuliaFEM.
|
||||
# License is MIT: see https://github.com/JuliaFEM/JuliaFEM.jl/blob/master/LICENSE.md
|
||||
|
||||
abstract AbstractProblem
|
||||
abstract FieldProblem <: AbstractProblem
|
||||
abstract BoundaryProblem <: AbstractProblem
|
||||
abstract MixedProblem <: AbstractProblem
|
||||
abstract type AbstractProblem end
|
||||
abstract type FieldProblem<:AbstractProblem end
|
||||
abstract type BoundaryProblem<:AbstractProblem end
|
||||
abstract type MixedProblem<:AbstractProblem end
|
||||
|
||||
"""
|
||||
General linearized problem to solve
|
||||
|
||||
@@ -72,4 +72,4 @@ function assemble!(problem::Problem{Contact}, time::Real)
|
||||
problem.properties.iteration += 1
|
||||
end
|
||||
|
||||
typealias ContactElements2D Union{Seg2}
|
||||
const ContactElements2D = Union{Seg2}
|
||||
|
||||
@@ -41,7 +41,7 @@ function create_contact_segmentation(problem::Problem{Contact}, slave_element::E
|
||||
# 3.1 calculate segmentation
|
||||
xi1a = project_from_master_to_slave(slave_element, x2[1], time)
|
||||
xi1b = project_from_master_to_slave(slave_element, x2[2], time)
|
||||
xi1 = clamp([xi1a; xi1b], -1.0, 1.0)
|
||||
xi1 = clamp.([xi1a; xi1b], -1.0, 1.0)
|
||||
l = 1/2*abs(xi1[2]-xi1[1])
|
||||
if isapprox(l, 0.0)
|
||||
continue # no contribution in this master element
|
||||
|
||||
@@ -36,8 +36,8 @@ function project_from_master_to_slave{E<:MortarElements2D}(
|
||||
dxi1 = 0.0
|
||||
for i=1:max_iterations
|
||||
dxi1 = -R(xi1)/dR(xi1)
|
||||
dxi1 = clamp(dxi1, -0.3, 0.3)
|
||||
xi1_next = clamp(xi1 + dxi1, -1.0, 1.0)
|
||||
dxi1 = clamp.(dxi1, -0.3, 0.3)
|
||||
xi1_next = clamp.(xi1 + dxi1, -1.0, 1.0)
|
||||
if norm(xi1_next - xi1) < tol
|
||||
return xi1_next
|
||||
end
|
||||
@@ -176,7 +176,7 @@ function assemble!(problem::Problem{Contact}, time::Float64,
|
||||
# calculate segmentation: we care only about endpoints
|
||||
xi1a = project_from_master_to_slave(slave_element, x1, n1, x2[1])
|
||||
xi1b = project_from_master_to_slave(slave_element, x1, n1, x2[2])
|
||||
xi1 = clamp([xi1a; xi1b], -1.0, 1.0)
|
||||
xi1 = clamp.([xi1a; xi1b], -1.0, 1.0)
|
||||
l = 1/2*abs(xi1[2]-xi1[1])
|
||||
isapprox(l, 0.0) && continue # no contribution in this master element
|
||||
|
||||
@@ -211,7 +211,7 @@ function assemble!(problem::Problem{Contact}, time::Float64,
|
||||
# calculate segmentation: we care only about endpoints
|
||||
xi1a = project_from_master_to_slave(slave_element, x1, n1, x2[1])
|
||||
xi1b = project_from_master_to_slave(slave_element, x1, n1, x2[2])
|
||||
xi1 = clamp([xi1a; xi1b], -1.0, 1.0)
|
||||
xi1 = clamp.([xi1a; xi1b], -1.0, 1.0)
|
||||
l = 1/2*abs(xi1[2]-xi1[1])
|
||||
isapprox(l, 0.0) && continue # no contribution in this master element
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# This file is a part of JuliaFEM.
|
||||
# License is MIT: see https://github.com/JuliaFEM/JuliaFEM.jl/blob/master/LICENSE.md
|
||||
|
||||
typealias ContactElements3D Union{Tri3, Tri6, Quad4, Quad8, Quad9}
|
||||
const ContactElements3D = Union{Tri3,Tri6,Quad4,Quad8,Quad9}
|
||||
|
||||
function create_orthogonal_basis(n)
|
||||
I = eye(3)
|
||||
|
||||
@@ -66,15 +66,15 @@ function assemble!(assembly::Assembly, problem::Problem{Elasticity}, element::El
|
||||
add!(assembly.f, gdofs, f)
|
||||
end
|
||||
|
||||
typealias Elasticity2DSurfaceElements Union{Poi1, Seg2, Seg3}
|
||||
typealias Elasticity2DVolumeElements Union{Tri3, Tri6, Quad4, Quad8, Quad9}
|
||||
typealias Elasticity3DSurfaceElements Union{Poi1, Tri3, Tri6, Quad4, Quad8, Quad9}
|
||||
typealias Elasticity3DVolumeElements Union{Tet4, Pyr5, Wedge6, Wedge15, Hex8, Tet10, Hex20, Hex27}
|
||||
const Elasticity2DSurfaceElements = Union{Poi1,Seg2,Seg3}
|
||||
const Elasticity2DVolumeElements = Union{Tri3,Tri6,Quad4,Quad8,Quad9}
|
||||
const Elasticity3DSurfaceElements = Union{Poi1,Tri3,Tri6,Quad4,Quad8,Quad9}
|
||||
const Elasticity3DVolumeElements = Union{Tet4, Pyr5, Wedge6, Wedge15, Hex8, Tet10, Hex20, Hex27}
|
||||
|
||||
function initialize_internal_params!(params, ip, type_) #::Type{Val{:type_2d}})
|
||||
param_keys = keys(params)
|
||||
all_keys = ip.fields.keys
|
||||
ip_fields = filter(x->isdefined(all_keys, x), collect(1:length(all_keys)))
|
||||
ip_fields = filter(x->isassigned(all_keys, x), collect(1:length(all_keys)))
|
||||
|
||||
if !("params_initialized" in ip_fields)
|
||||
for key in param_keys
|
||||
@@ -96,7 +96,7 @@ end
|
||||
|
||||
function get_keys(element)
|
||||
all_keys = element.fields.keys
|
||||
idx = filter(x->isdefined(all_keys, x), collect(1:length(all_keys)))
|
||||
idx = filter(x->isassigned(all_keys, x), collect(1:length(all_keys)))
|
||||
map(x -> all_keys[x], idx)
|
||||
end
|
||||
|
||||
|
||||
@@ -67,8 +67,8 @@ function assemble!{E}(assembly::Assembly, problem::Problem{Heat}, element::Eleme
|
||||
info("Unknown element type $E for 3d heat problem!")
|
||||
end
|
||||
|
||||
typealias Heat3DVolumeElements Union{Tet4, Tet10, Pyr5, Hex8, Hex20, Hex27}
|
||||
typealias Heat3DSurfaceElements Union{Tri3, Tri6, Quad4, Quad8, Quad9}
|
||||
const Heat3DVolumeElements = Union{Tet4, Tet10, Pyr5, Hex8, Hex20, Hex27}
|
||||
const Heat3DSurfaceElements = Union{Tri3,Tri6,Quad4,Quad8,Quad9}
|
||||
|
||||
function assemble!{E<:Heat3DVolumeElements}(assembly::Assembly, problem::Problem{Heat}, element::Element{E}, time, ::Type{Val{Symbol("3D")}})
|
||||
gdofs = get_gdofs(problem, element)
|
||||
@@ -179,8 +179,8 @@ function assemble!{E}(assembly::Assembly, problem::Problem{Heat}, element::Eleme
|
||||
info("Unknown element type $E for 2d heat problem!")
|
||||
end
|
||||
|
||||
typealias Heat2DVolumeElements Union{Tri3, Tri6, Quad4}
|
||||
typealias Heat2DSurfaceElements Union{Seg2, Seg3}
|
||||
const Heat2DVolumeElements = Union{Tri3,Tri6,Quad4}
|
||||
const Heat2DSurfaceElements = Union{Seg2,Seg3}
|
||||
|
||||
function assemble!{E<:Heat2DVolumeElements}(assembly::Assembly, problem::Problem{Heat}, element::Element{E}, time, ::Type{Val{Symbol("2D")}})
|
||||
gdofs = get_gdofs(problem, element)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# This file is a part of JuliaFEM.
|
||||
# License is MIT: see https://github.com/JuliaFEM/JuliaFEM.jl/blob/master/LICENSE.md
|
||||
|
||||
typealias MortarElements2D Union{Seg2, Seg3}
|
||||
const MortarElements2D = Union{Seg2,Seg3}
|
||||
|
||||
function newton(f, df, x; tol=1.0e-6, max_iterations=10)
|
||||
for i=1:max_iterations
|
||||
@@ -137,7 +137,7 @@ function assemble!(problem::Problem{Mortar}, time::Float64, ::Type{Val{1}}, ::Ty
|
||||
# 3.1 calculate segmentation
|
||||
xi1a = project_from_master_to_slave(slave_element, X2[1], time)
|
||||
xi1b = project_from_master_to_slave(slave_element, X2[2], time)
|
||||
xi1 = clamp([xi1a; xi1b], -1.0, 1.0)
|
||||
xi1 = clamp.([xi1a; xi1b], -1.0, 1.0)
|
||||
l = 1/2*abs(xi1[2]-xi1[1])
|
||||
isapprox(l, 0.0) && continue # no contribution in this master element
|
||||
|
||||
|
||||
@@ -144,7 +144,7 @@ function assemble!(problem::Problem{Mortar}, time::Float64, ::Type{Val{1}}, ::Ty
|
||||
xi1b = project_from_master_to_slave(slave_element, x1, n1, x2[2], time)
|
||||
# xi1a = project_from_master_to_slave(slave_element, X2[1], time)
|
||||
# xi1b = project_from_master_to_slave(slave_element, X2[2], time)
|
||||
xi1 = clamp([xi1a; xi1b], -1.0, 1.0)
|
||||
xi1 = clamp.([xi1a; xi1b], -1.0, 1.0)
|
||||
l = 1/2*abs(xi1[2]-xi1[1])
|
||||
isapprox(l, 0.0) && continue # no contribution in this master element
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# This file is a part of JuliaFEM.
|
||||
# License is MIT: see https://github.com/JuliaFEM/JuliaFEM.jl/blob/master/LICENSE.md
|
||||
|
||||
typealias MortarElements3D Union{Tri3, Tri6, Quad4}
|
||||
const MortarElements3D = Union{Tri3,Tri6,Quad4}
|
||||
|
||||
function project_vertex_to_auxiliary_plane(p::Vector, x0::Vector, n0::Vector)
|
||||
return p - dot(p-x0, n0)*n0
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
# This file is a part of JuliaFEM.
|
||||
# License is MIT: see https://github.com/JuliaFEM/JuliaFEM.jl/blob/master/LICENSE.md
|
||||
|
||||
abstract AbstractSolver
|
||||
abstract type AbstractSolver end
|
||||
|
||||
type Solver{S<:AbstractSolver}
|
||||
name :: AbstractString # some descriptive name for problem
|
||||
|
||||
+15
-3
@@ -10,7 +10,7 @@ type SparseMatrixCOO{T<:Real}
|
||||
V :: Vector{T}
|
||||
end
|
||||
|
||||
typealias SparseVectorCOO SparseMatrixCOO
|
||||
const SparseVectorCOO = SparseMatrixCOO
|
||||
|
||||
function SparseMatrixCOO()
|
||||
return SparseMatrixCOO{Float64}([], [], [])
|
||||
@@ -39,8 +39,20 @@ Parameters
|
||||
tol
|
||||
used to drop near zero values less than tol.
|
||||
"""
|
||||
function sparse(A::SparseMatrixCOO, args...; tol=1.0e-12)
|
||||
B = sparse(A.I, A.J, A.V, args...)
|
||||
function sparse(A::SparseMatrixCOO; tol=1.0e-12)
|
||||
B = sparse(A.I, A.J, A.V)
|
||||
SparseArrays.droptol!(B, tol)
|
||||
return B
|
||||
end
|
||||
|
||||
function sparse(A::SparseMatrixCOO, n::Int, m::Int; tol=1.0e-12)
|
||||
B = sparse(A.I, A.J, A.V, n, m)
|
||||
SparseArrays.droptol!(B, tol)
|
||||
return B
|
||||
end
|
||||
|
||||
function sparse(A::SparseMatrixCOO, n::Int, m::Int, f::Function; tol=1.0e-12)
|
||||
B = sparse(A.I, A.J, A.V, n, m, f)
|
||||
SparseArrays.droptol!(B, tol)
|
||||
return B
|
||||
end
|
||||
|
||||
+3
-3
@@ -1,9 +1,9 @@
|
||||
# This file is a part of JuliaFEM.
|
||||
# License is MIT: see https://github.com/JuliaFEM/JuliaFEM.jl/blob/master/LICENSE.md
|
||||
|
||||
typealias Node Vector{Float64}
|
||||
const Node = Vector{Float64}
|
||||
|
||||
abstract AbstractPoint
|
||||
abstract type AbstractPoint end
|
||||
|
||||
type Point{P<:AbstractPoint}
|
||||
id :: Int
|
||||
@@ -52,7 +52,7 @@ end
|
||||
type IntegrationPoint <: AbstractPoint
|
||||
end
|
||||
|
||||
typealias IP Point{IntegrationPoint}
|
||||
const IP = Point{IntegrationPoint}
|
||||
|
||||
function IP(id, weight, coords)
|
||||
return IP(id, weight, coords, Dict(), IntegrationPoint())
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ using JuliaFEM.Testing
|
||||
@test isapprox(f, 1.0)
|
||||
@test 2*f == 2.0 # multiply by constant
|
||||
@test f(1.0) == 1.0 # time interpolation
|
||||
@test isapprox([2.0]''*f, 2.0) # wanted behavior?
|
||||
@test isapprox(reshape([2.0],1,1)*f, 2.0) # wanted behavior?
|
||||
end
|
||||
|
||||
@testset "discrete, variable, time invariant field" begin
|
||||
|
||||
@@ -59,7 +59,7 @@ end
|
||||
push!(s, p)
|
||||
get_field_assembly(s)
|
||||
@test s.ndofs == 0
|
||||
add!(p.assembly.K, [4], [4], [4.0]'')
|
||||
add!(p.assembly.K, [4], [4], reshape([4.0],1,1))
|
||||
get_field_assembly(s)
|
||||
@test s.ndofs == 4
|
||||
end
|
||||
@@ -70,8 +70,8 @@ end
|
||||
p1 = Problem(Dirichlet, "bc1", 2, "displacement")
|
||||
p2 = Problem(Dirichlet, "bc2", 2, "displacement")
|
||||
# third dofs constrained
|
||||
add!(p1.assembly.C2, [3], [3], [1.0]'')
|
||||
add!(p2.assembly.C2, [3], [4], [1.0]'')
|
||||
add!(p1.assembly.C2, [3], [3], reshape([1.0],1,1))
|
||||
add!(p2.assembly.C2, [3], [4], reshape([1.0],1,1))
|
||||
s.ndofs = 4
|
||||
push!(s, p1, p2)
|
||||
@test_throws ErrorException get_boundary_assembly(s)
|
||||
|
||||
Reference in New Issue
Block a user