Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DG1d.jl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DG
DG1d.jl
Commits
3b660313
Commit
3b660313
authored
2 years ago
by
Florian Atteneder
Browse files
Options
Downloads
Patches
Plain Diff
wip: extend test, but failing due to discontinuous index
parent
bebc0ac1
Branches
hilbert
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/dg1dTests/src/test_tree.jl
+51
-47
51 additions, 47 deletions
test/dg1dTests/src/test_tree.jl
with
51 additions
and
47 deletions
test/dg1dTests/src/test_tree.jl
+
51
−
47
View file @
3b660313
...
@@ -187,54 +187,58 @@ end
...
@@ -187,54 +187,58 @@ end
@testset
"Tree"
begin
@testset
"Tree"
begin
t1d
=
Tree1d
(
5
)
for
layout
in
[
:
snake
,
:
hilbert
]
t2d
=
Tree2d
(
5
,
6
)
t3d
=
Tree3d
(
5
,
6
,
7
)
t1d
=
Tree1d
(
4
,
layout
=
layout
)
t2d
=
Tree2d
(
2
,
4
,
layout
=
layout
)
@test
n_cells
(
t1d
)
==
5
t3d
=
Tree3d
(
2
,
4
,
8
,
layout
=
layout
)
@test
n_cells
(
t2d
)
==
5
*
6
@test
n_cells
(
t3d
)
==
5
*
6
*
7
@test
n_cells
(
t1d
)
==
4
@test
n_cells
(
t2d
)
==
2
*
4
# t1d = Tree1d(5, periodic=(true,))
@test
n_cells
(
t3d
)
==
2
*
4
*
8
# t2d = Tree2d(5,6, periodic=(true,false))
# t3d = Tree3d(5,6,7, periodic=(true,false,true))
# t1d = Tree1d(5, periodic=(true,))
# t2d = Tree2d(5,6, periodic=(true,false))
# call show
# t3d = Tree3d(5,6,7, periodic=(true,false,true))
println
(
t1d
)
println
(
t2d
)
# call show
println
(
t3d
)
println
(
t1d
)
println
(
t2d
)
# iterator interface
println
(
t3d
)
length_t1d
=
0
for
c
in
t1d
# iterator interface
length_t1d
+=
1
length_t1d
=
0
end
for
c
in
t1d
@test
length_t1d
==
n_cells
(
t1d
)
length_t1d
+=
1
end
length_t2d
=
0
@test
length_t1d
==
n_cells
(
t1d
)
for
c
in
t2d
length_t2d
+=
1
length_t2d
=
0
end
for
c
in
t2d
@test
length_t2d
==
n_cells
(
t2d
)
length_t2d
+=
1
end
@test
length_t2d
==
n_cells
(
t2d
)
length_t3d
=
0
for
c
in
t3d
length_t3d
+=
1
end
@test
length_t3d
==
n_cells
(
t3d
)
x_extends
,
y_extends
,
z_extends
=
(
-
2.0
,
2.0
),
(
-
10.0
,
0.0
),
(
1.0
,
3.0
)
boxes1d
=
place_boxes
(
t1d
,
x_extends
)
boxes2d
=
place_boxes
(
t2d
,
x_extends
,
y_extends
)
boxes3d
=
place_boxes
(
t3d
,
x_extends
,
y_extends
,
z_extends
)
# # TODO Visualize generated trees to check for correctness
# # TODO How to check if periodic boundaries are connected?
# # Perhaps also save is_boundarycell info and color boundary cells.
# # for (name, tree) in [ ("tree1d", t1d), ("tree2d", t2d), ("tree3d", t3d) ]
# # open(filename, "w") do file
# # writedlm(file, tree.coords)
# # end
# # end
length_t3d
=
0
for
c
in
t3d
length_t3d
+=
1
end
end
@test
length_t3d
==
n_cells
(
t3d
)
x_extends
,
y_extends
,
z_extends
=
(
-
2.0
,
2.0
),
(
-
10.0
,
0.0
),
(
1.0
,
3.0
)
boxes1d
=
place_boxes
(
t1d
,
x_extends
)
boxes2d
=
place_boxes
(
t2d
,
x_extends
,
y_extends
)
boxes3d
=
place_boxes
(
t3d
,
x_extends
,
y_extends
,
z_extends
)
# # TODO Visualize generated trees to check for correctness
# # TODO How to check if periodic boundaries are connected?
# # Perhaps also save is_boundarycell info and color boundary cells.
# # for (name, tree) in [ ("tree1d", t1d), ("tree2d", t2d), ("tree3d", t3d) ]
# # open(filename, "w") do file
# # writedlm(file, tree.coords)
# # end
# # end
end
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment