-
Notifications
You must be signed in to change notification settings - Fork 98
/
DirichletFESpaces.jl
74 lines (56 loc) · 1.72 KB
/
DirichletFESpaces.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
"""
struct DirichletFESpace <: SingleFieldFESpace
space::SingleFieldFESpace
end
"""
struct DirichletFESpace{S<:SingleFieldFESpace} <: SingleFieldFESpace
space::S
function DirichletFESpace(space::SingleFieldFESpace)
new{typeof(space)}(space)
end
end
ConstraintStyle(::Type{DirichletFESpace{B}}) where B = ConstraintStyle(B)
CellField(t::DirichletFESpace,cell_vals) = CellField(t.space,cell_vals)
get_cell_isconstrained(f::DirichletFESpace) = get_cell_isconstrained(f.space)
get_cell_constraints(f::DirichletFESpace) = get_cell_constraints(f.space)
function get_free_dof_ids(f::DirichletFESpace)
get_dirichlet_dof_ids(f.space)
end
function get_vector_type(f::DirichletFESpace)
get_vector_type(f.space)
end
function get_cell_dof_ids(f::DirichletFESpace)
lazy_map(Broadcasting(-),get_cell_dof_ids(f.space))
end
function get_dirichlet_dof_ids(f::DirichletFESpace)
get_free_dof_ids(f.space)
end
function num_dirichlet_tags(f::DirichletFESpace)
1
end
function get_dirichlet_dof_tag(f::DirichletFESpace)
ones(Int8,num_dirichlet_dofs(f))
end
function scatter_free_and_dirichlet_values(f::DirichletFESpace,fv,dv)
scatter_free_and_dirichlet_values(f.space,dv,fv)
end
function gather_free_and_dirichlet_values!(fv,dv,f::DirichletFESpace,cv)
gather_free_and_dirichlet_values!(dv,fv,f.space,cv)
(fv,dv)
end
function TrialFESpace(f::DirichletFESpace)
U = TrialFESpace(f.space)
DirichletFESpace(U)
end
function get_fe_basis(f::DirichletFESpace)
get_fe_basis(f.space)
end
function get_trial_fe_basis(f::DirichletFESpace)
get_trial_fe_basis(f.space)
end
function get_fe_dof_basis(f::DirichletFESpace)
get_fe_dof_basis(f.space)
end
function get_triangulation(f::DirichletFESpace)
get_triangulation(f.space)
end