Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
329 changes: 220 additions & 109 deletions src/IC/PointList.H

Large diffs are not rendered by default.

12 changes: 11 additions & 1 deletion tests/PointListIC/Readme.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@

This test is for the point list initial condition. It tests the IC by placing a rotated NACA 9612 airfoil on in the domain.
The point list IC works with a single closed polygon that can be rotated counter-clockwise about a center of rotation. See below for example figure
The point list IC works with one or more closed polygons that can be rotated counter-clockwise about a center of rotation. See below for example figure

.. figure:: ../../../tests/PointListIC/alpha_ic_img.png
:align: center

Each line of the input file gives a point as ``x y z ObjNum``. The ``ObjNum`` column is optional; if it is
omitted, every point in the file is treated as a single polygon. When it is present, a new polygon starts
wherever ``ObjNum`` changes by more than ``obj_num_threshold`` (default ``0.5``) from the previous point.

By default every polygon is unioned together (via a pointwise max) to form the solid field. Individual
polygons can instead be marked as void/negative regions using the ``invert`` parameter, which takes one
entry per polygon (nonzero = void). Void polygons are unioned separately and then multiplied into the
solid field, cutting holes wherever they overlap it. ``invert_all`` is a separate, single flag that flips
the whole finished field (solid field with voids cut out) at the end, e.g. to make the IC 1 outside the
solid region instead of inside it.

48 changes: 37 additions & 11 deletions tests/PointListIC/input
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,46 @@
#@ nprocs = 1
#@ check = true
#@ check-file = reference/reference-2d-serial.csv
#@ args = stop_time=0.0001
#@ args = stop_time=0.0001
#@ args = alpha.ic.pointlist.file.name = tests/PointListIC/NACA9612.xy
#@ args = alpha.ic.pointlist.mult = 0.9
#@ args = alpha.ic.pointlist.invert = 0
#@ args = alpha.ic.pointlist.x0 = 0.05_m 0.05_m 0.0_m
#@ args = alpha.ic.pointlist.rotation.center = 0.1_m 0.1_m 0.1_m
#@ args = alpha.ic.pointlist.rotation.angle = 45_deg
#@ args = alpha.ic.pointlist.eps = 0.03_m

#@ [2D-parallel]
#@ dim = 2
#@ nprocs = 2
#@ check = true
#@ check-file = reference/reference-2d-parallel.csv
#@ args = stop_time=0.0001
#@ args = alpha.ic.pointlist.file.name = tests/PointListIC/NACA9612.xy
#@ args = alpha.ic.pointlist.mult = 0.9
#@ args = alpha.ic.pointlist.invert = 0
#@ args = alpha.ic.pointlist.x0 = 0.05_m 0.05_m 0.0_m
#@ args = alpha.ic.pointlist.rotation.center = 0.1_m 0.1_m 0.1_m
#@ args = alpha.ic.pointlist.rotation.angle = 45_deg
#@ args = alpha.ic.pointlist.eps = 0.03_m

#@ [2D-serial-three-objs]
#@ dim = 2
#@ nprocs = 1
#@ check = true
#@ check-file = reference/reference-2d-serial-three-objs.csv
#@ args = stop_time=0.0001
#@ args = alpha.ic.pointlist.file.name = tests/PointListIC/three_objs.xyzo
#@ args = alpha.ic.pointlist.invert = 0 0 0 1
#@ args = alpha.ic.pointlist.invert_all = 1
#@ args = alpha.ic.pointlist.eps = 0.03_m
#@ args = alpha.ic.pointlist.mult = 0.4

alamo.program = allencahn

### OUTPUT ###

plot_file = output
plot_file = tests/PointListIC/output

### MESHING ###

Expand All @@ -30,7 +56,6 @@ amr.n_cell = 16 16 0

geometry.prob_lo = -0.1_m -0.2_m 0.0_m # [ m ]
geometry.prob_hi = 0.9_m 0.8_m 0.0_m # [ m ]

geometry.is_periodic = 0 0 0

timestep = 0.0001
Expand All @@ -46,15 +71,16 @@ alpha.bc.constant.val.ylo = 0.0
alpha.bc.constant.val.yhi = 0.0

alpha.ic.type = pointlist
alpha.ic.pointlist.file.name = tests/PointListIC/NACA9612.xy
alpha.ic.pointlist.file.unit = m
alpha.ic.pointlist.verbose = 0
alpha.ic.pointlist.mult = 0.9 # Scaling factor on polygon size, happens BEFORE rotation
alpha.ic.pointlist.invert = 0 # Don't invert the initial field
alpha.ic.pointlist.x0 = 0.05_m 0.05_m 0.0_m # X-offset
alpha.ic.pointlist.rotation.center = 0.1_m 0.1_m 0.1_m # Center of rotation of the polygon
alpha.ic.pointlist.rotation.angle = 45_deg # Rotatation angle of polygon
alpha.ic.pointlist.eps = 0.03_m # Diffuse boundary thickness
# alpha.ic.pointlist.file.name = tests/PointListIC/NACA9612.xy
# alpha.ic.pointlist.file.name = tests/PointListIC/three_objs.xyzo
# alpha.ic.pointlist.verbose = 0
# alpha.ic.pointlist.mult = 1.0 # Scaling factor on polygon size, happens BEFORE rotation
# alpha.ic.pointlist.invert = 0 0 0 1 # Don't invert the initial field
# alpha.ic.pointlist.x0 = 0.0_m 0.0_m 0.0_m # X-offset
# alpha.ic.pointlist.rotation.center = 0.0_m 0.0_m 0.0_m # Center of rotation of the polygon
# alpha.ic.pointlist.rotation.angle = 0_deg # Rotatation angle of polygon
# alpha.ic.pointlist.eps = 0.03_m # Diffuse boundary thickness

ch.direction_tstart = 0.0
ch.direction = 0
Expand Down
216 changes: 108 additions & 108 deletions tests/PointListIC/reference/reference-2d-parallel.csv
Original file line number Diff line number Diff line change
Expand Up @@ -6,111 +6,111 @@
4,0.0015624999999999944,-0.09843750000000001,0.5,0.0002318002929001528
5,0.017187499999999994,-0.08281250000000001,0.5,0.0006616138224033036
6,0.032812499999999994,-0.06718750000000001,0.5,0.001854519348727393
9,0.044531249999999994,-0.05546875000000001,0.5,0.003948196852520347
10,0.052343749999999994,-0.04765625000000001,0.5,0.00657734073601296
11,0.060156249999999994,-0.03984375000000001,0.5,0.010918639160583832
12,0.06796875,-0.03203125000000001,0.5,0.01802922766492765
13,0.07578125,-0.02421875000000001,0.5,0.029529333953399406
14,0.08359375,-0.01640625000000001,0.5,0.04780561387455723
15,0.09140625,-0.008593750000000011,0.5,0.07645342141186534
16,0.09921875,-0.0007812500000000111,0.5,0.12010322929435374
17,0.10703125,0.007031249999999989,0.5,0.18371672615172008
18,0.11484375,0.014843749999999989,0.5,0.27065936108296895
19,0.12265625,0.02265624999999999,0.5,0.3796125067366879
20,0.13046875,0.03046874999999999,0.5,0.49463981543599156
21,0.13828125,0.03828124999999999,0.5,0.5788321541488066
22,0.14609375,0.04609374999999999,0.5,0.6586769419279677
23,0.15390625,0.05390624999999999,0.5,0.7304341624011161
24,0.16171875,0.06171874999999999,0.5,0.7846984725469124
25,0.16953125,0.06953124999999999,0.5,0.8229205994684439
26,0.17734375,0.07734374999999999,0.5,0.847230461198419
27,0.18515625,0.08515624999999999,0.5,0.8455148058151292
28,0.19296875,0.09296874999999999,0.5,0.8435591017494757
29,0.20078125,0.10078124999999999,0.5,0.8362122454071443
30,0.20859375,0.10859374999999999,0.5,0.8285904710456162
31,0.21640625,0.11640624999999999,0.5,0.820690074931993
32,0.22421875,0.12421874999999999,0.5,0.8125079394494106
33,0.23203125,0.13203125,0.5,0.8040415913571235
34,0.23984375,0.13984375,0.5,0.7940424094195697
35,0.24765625,0.14765625,0.5,0.7819062995153754
36,0.25546875,0.15546875,0.5,0.7692628703838702
37,0.26328125,0.16328125,0.5,0.7561150919005333
38,0.27109375,0.17109375,0.5,0.7424689399482374
39,0.27890625,0.17890625,0.5,0.7283335779793829
40,0.28671875,0.18671875,0.5,0.7137215083289435
41,0.29453125,0.19453125,0.5,0.6981345223030677
42,0.30234375,0.20234375,0.5,0.6816777501402997
43,0.31015625,0.21015625,0.5,0.6647546293147262
44,0.31796875,0.21796875,0.5,0.647397188712797
45,0.32578125,0.22578125,0.5,0.6296417512177731
46,0.33359375,0.23359375,0.5,0.6115287267437071
47,0.34140625,0.24140625,0.5,0.5931023213406317
48,0.34921875,0.24921875,0.5,0.5744101644472573
49,0.35703125,0.25703125,0.5,0.5566222990937296
50,0.36484375,0.26484375,0.5,0.5388886489307291
51,0.37265625,0.27265625,0.5,0.5210560155381063
52,0.38046875,0.28046875,0.5,0.5031695580342339
53,0.38828125,0.28828125,0.5,0.4852749843472132
54,0.39609375,0.29609375,0.5,0.46741808537547963
55,0.40390625,0.30390625,0.5,0.44964426735131213
56,0.41171875,0.31171875,0.5,0.43199809252216026
57,0.41953125,0.31953125,0.5,0.41640826473554804
58,0.42734375,0.32734375,0.5,0.40205298772149384
59,0.43515625,0.33515625,0.5,0.38786368764438234
60,0.44296875,0.34296875,0.5,0.3738620548891373
61,0.45078125,0.35078125,0.5,0.3600685582238978
62,0.45859375,0.35859375,0.5,0.34650234081660813
63,0.46640625,0.36640625,0.5,0.33318113346248324
64,0.47421875,0.37421875,0.5,0.32012118550302443
65,0.48203125,0.38203125,0.5,0.30863621734476054
66,0.48984375,0.38984375,0.5,0.3003771984039658
67,0.49765625,0.39765625,0.5,0.29224576596917096
68,0.50546875,0.40546875,0.5,0.28424502476742347
69,0.51328125,0.41328125,0.5,0.2763777850739398
70,0.52109375,0.42109375,0.5,0.26864656462438863
71,0.52890625,0.42890625,0.5,0.261053591666886
72,0.53671875,0.43671875,0.5,0.25360080908273575
73,0.54453125,0.44453125,0.5,0.24931181529889684
74,0.55234375,0.45234375,0.5,0.2506880056794211
75,0.56015625,0.46015625,0.5,0.2520692417825159
76,0.56796875,0.46796875,0.5,0.25345551400012134
77,0.57578125,0.47578125,0.5,0.25484681238170437
78,0.58359375,0.48359375,0.5,0.2562431266326997
79,0.59140625,0.49140625,0.5,0.2576444461130052
80,0.59921875,0.49921875,0.5,0.25905075983549997
81,0.60703125,0.50703125,0.5,0.26928789853511303
82,0.61484375,0.51484375,0.5,0.27997650585350975
83,0.62265625,0.52265625,0.5,0.2909204574208397
84,0.63046875,0.53046875,0.5,0.3021127015189145
85,0.63828125,0.53828125,0.5,0.3135451325632611
86,0.64609375,0.54609375,0.5,0.32520858781387796
87,0.65390625,0.55390625,0.5,0.3387466117343422
88,0.66171875,0.56171875,0.5,0.3596867955870887
89,0.66953125,0.56953125,0.5,0.38117525301732547
90,0.67734375,0.57734375,0.5,0.4031392214553158
91,0.68515625,0.58515625,0.5,0.42549857463388197
92,0.69296875,0.59296875,0.5,0.4481668744993603
93,0.70078125,0.60078125,0.5,0.4729861336828578
94,0.70859375,0.60859375,0.5,0.5032252082909602
95,0.71640625,0.61640625,0.5,0.5334407072264759
96,0.72421875,0.62421875,0.5,0.563412840180084
97,0.73203125,0.63203125,0.5,0.5711433860220909
98,0.73984375,0.63984375,0.5,0.5092539059926106
99,0.74765625,0.64765625,0.5,0.44464812566627987
100,0.75546875,0.65546875,0.5,0.381860875299178
101,0.76328125,0.66328125,0.5,0.3223522604260433
102,0.77109375,0.67109375,0.5,0.266448703102271
103,0.77890625,0.67890625,0.5,0.20403800244651477
104,0.78671875,0.68671875,0.5,0.14243040734648316
105,0.79453125,0.69453125,0.5,0.09396646686190258
106,0.80234375,0.70234375,0.5,0.059801243372716584
107,0.81015625,0.71015625,0.5,0.03718671757021935
108,0.81796875,0.71796875,0.5,0.02278239625436912
109,0.82578125,0.72578125,0.5,0.01382457254813968
110,0.83359375,0.73359375,0.5,0.008337047270646103
111,0.84140625,0.74140625,0.5,0.0050073731781482556
112,0.84921875,0.74921875,0.5,0.0029993913190796695
113,0.85703125,0.75703125,0.5,0.001793315011063057
114,0.86484375,0.76484375,0.5,0.0010708326348215502
7,0.8765625,0.7765625,0.5,0.0004932893884479483
8,0.8921875,0.7921875,0.5,0.00017514620366221312
7,0.044531249999999994,-0.05546875000000001,0.5,0.003948196852520347
8,0.052343749999999994,-0.04765625000000001,0.5,0.00657734073601296
9,0.060156249999999994,-0.03984375000000001,0.5,0.010918639160583832
10,0.06796875,-0.03203125000000001,0.5,0.01802922766492765
11,0.07578125,-0.02421875000000001,0.5,0.029529333953399406
12,0.08359375,-0.01640625000000001,0.5,0.04780561387455723
13,0.09140625,-0.008593750000000011,0.5,0.07645342141186534
14,0.09921875,-0.0007812500000000111,0.5,0.12010322929435374
15,0.10703125,0.007031249999999989,0.5,0.18371672615172008
16,0.11484375,0.014843749999999989,0.5,0.27065936108296895
17,0.12265625,0.02265624999999999,0.5,0.3796125067366879
18,0.13046875,0.03046874999999999,0.5,0.49463981543599156
19,0.13828125,0.03828124999999999,0.5,0.5788321541488066
20,0.14609375,0.04609374999999999,0.5,0.6586769419279677
21,0.15390625,0.05390624999999999,0.5,0.7304341624011161
22,0.16171875,0.06171874999999999,0.5,0.7846984725469124
23,0.16953125,0.06953124999999999,0.5,0.8229205994684439
24,0.17734375,0.07734374999999999,0.5,0.847230461198419
25,0.18515625,0.08515624999999999,0.5,0.8455148058151292
26,0.19296875,0.09296874999999999,0.5,0.8435591017494757
27,0.20078125,0.10078124999999999,0.5,0.8362122454071443
28,0.20859375,0.10859374999999999,0.5,0.8285904710456162
29,0.21640625,0.11640624999999999,0.5,0.820690074931993
30,0.22421875,0.12421874999999999,0.5,0.8125079394494106
31,0.23203125,0.13203125,0.5,0.8040415913571235
32,0.23984375,0.13984375,0.5,0.7940424094195697
33,0.24765625,0.14765625,0.5,0.7819062995153754
34,0.25546875,0.15546875,0.5,0.7692628703838702
35,0.26328125,0.16328125,0.5,0.7561150919005333
36,0.27109375,0.17109375,0.5,0.7424689399482374
37,0.27890625,0.17890625,0.5,0.7283335779793829
38,0.28671875,0.18671875,0.5,0.7137215083289435
39,0.29453125,0.19453125,0.5,0.6981345223030677
40,0.30234375,0.20234375,0.5,0.6816777501402997
41,0.31015625,0.21015625,0.5,0.6647546293147262
42,0.31796875,0.21796875,0.5,0.647397188712797
43,0.32578125,0.22578125,0.5,0.6296417512177731
44,0.33359375,0.23359375,0.5,0.6115287267437071
45,0.34140625,0.24140625,0.5,0.5931023213406317
46,0.34921875,0.24921875,0.5,0.5744101644472573
47,0.35703125,0.25703125,0.5,0.5566222990937296
48,0.36484375,0.26484375,0.5,0.5388886489307291
49,0.37265625,0.27265625,0.5,0.5210560155381063
50,0.38046875,0.28046875,0.5,0.5031695580342339
51,0.38828125,0.28828125,0.5,0.4852749843472132
52,0.39609375,0.29609375,0.5,0.46741808537547963
53,0.40390625,0.30390625,0.5,0.44964426735131213
54,0.41171875,0.31171875,0.5,0.43199809252216026
55,0.41953125,0.31953125,0.5,0.41640826473554804
56,0.42734375,0.32734375,0.5,0.40205298772149384
57,0.43515625,0.33515625,0.5,0.38786368764438234
58,0.44296875,0.34296875,0.5,0.3738620548891373
59,0.45078125,0.35078125,0.5,0.3600685582238978
60,0.45859375,0.35859375,0.5,0.34650234081660813
61,0.46640625,0.36640625,0.5,0.33318113346248324
62,0.47421875,0.37421875,0.5,0.32012118550302443
63,0.48203125,0.38203125,0.5,0.30863621734476054
64,0.48984375,0.38984375,0.5,0.3003771984039658
65,0.49765625,0.39765625,0.5,0.29224576596917096
66,0.50546875,0.40546875,0.5,0.28424502476742347
67,0.51328125,0.41328125,0.5,0.2763777850739398
68,0.52109375,0.42109375,0.5,0.26864656462438863
69,0.52890625,0.42890625,0.5,0.261053591666886
70,0.53671875,0.43671875,0.5,0.25360080908273575
71,0.54453125,0.44453125,0.5,0.24931181529889684
72,0.55234375,0.45234375,0.5,0.2506880056794211
73,0.56015625,0.46015625,0.5,0.2520692417825159
74,0.56796875,0.46796875,0.5,0.25345551400012134
75,0.57578125,0.47578125,0.5,0.25484681238170437
76,0.58359375,0.48359375,0.5,0.2562431266326997
77,0.59140625,0.49140625,0.5,0.2576444461130052
78,0.59921875,0.49921875,0.5,0.25905075983549997
79,0.60703125,0.50703125,0.5,0.26928789853511303
80,0.61484375,0.51484375,0.5,0.27997650585350975
81,0.62265625,0.52265625,0.5,0.2909204574208397
82,0.63046875,0.53046875,0.5,0.3021127015189145
83,0.63828125,0.53828125,0.5,0.3135451325632611
84,0.64609375,0.54609375,0.5,0.32520858781387796
85,0.65390625,0.55390625,0.5,0.3387466117343422
86,0.66171875,0.56171875,0.5,0.3596867955870887
87,0.66953125,0.56953125,0.5,0.38117525301732547
88,0.67734375,0.57734375,0.5,0.4031392214553158
89,0.68515625,0.58515625,0.5,0.42549857463388197
90,0.69296875,0.59296875,0.5,0.4481668744993603
91,0.70078125,0.60078125,0.5,0.4729861336828578
92,0.70859375,0.60859375,0.5,0.5032252082909602
93,0.71640625,0.61640625,0.5,0.5334407072264759
94,0.72421875,0.62421875,0.5,0.563412840180084
95,0.73203125,0.63203125,0.5,0.5711433860220909
96,0.73984375,0.63984375,0.5,0.5092539059926106
97,0.74765625,0.64765625,0.5,0.44464812566627987
98,0.75546875,0.65546875,0.5,0.381860875299178
99,0.76328125,0.66328125,0.5,0.3223522604260433
100,0.77109375,0.67109375,0.5,0.266448703102271
101,0.77890625,0.67890625,0.5,0.20403800244651477
102,0.78671875,0.68671875,0.5,0.14243040734648316
103,0.79453125,0.69453125,0.5,0.09396646686190258
104,0.80234375,0.70234375,0.5,0.059801243372716584
105,0.81015625,0.71015625,0.5,0.03718671757021935
106,0.81796875,0.71796875,0.5,0.02278239625436912
107,0.82578125,0.72578125,0.5,0.01382457254813968
108,0.83359375,0.73359375,0.5,0.008337047270646103
109,0.84140625,0.74140625,0.5,0.0050073731781482556
110,0.84921875,0.74921875,0.5,0.0029993913190796695
111,0.85703125,0.75703125,0.5,0.001793315011063057
112,0.86484375,0.76484375,0.5,0.0010708326348215502
113,0.8765625,0.7765625,0.5,0.0004932893884479483
114,0.8921875,0.7921875,0.5,0.00017514620366221312
Loading
Loading