Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Updated viewer and added a new test case
  • Loading branch information
daminton committed Feb 25, 2022
1 parent fefd820 commit 5c931f1
Show file tree
Hide file tree
Showing 9 changed files with 1,565 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,4 @@ examples/global-lunar-bombardment/scale.ipynb
*.png

python/ctem/ctem.egg-info/
.idea/*
1 change: 0 additions & 1 deletion examples/morphology_test_cases/complex/ctem.in
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ saveshaded T ! Output shaded relief images
saverego F ! Output regolith map images
savepres F ! Output simplified console display images (presentation-compatible images)
savetruelist T ! Save the true cumulative crater distribution for each interval (large file size)
sfdcompare LOLASethCraterCatalogv8gt20-binned.dat ! File name for the SFD comparison file used in the console display
shadedminh -5000.0 ! Minimum height for shaded relief map (m) (Default - automatic)
shadedmaxh 5000.0 ! Maximum height for shaded relief map (m) (Default - automatic)
runtype single ! Run type: options are normal / statistical
Expand Down
1 change: 1 addition & 0 deletions examples/morphology_test_cases/transition/CTEM
1,418 changes: 1,418 additions & 0 deletions examples/morphology_test_cases/transition/NPFextrap.dat

Large diffs are not rendered by default.

76 changes: 76 additions & 0 deletions examples/morphology_test_cases/transition/ctem.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
! CTEM Input file


! Testing input. These are used to perform non-Monte Carlo tests.
testflag T ! Set to T to create a single crater with user-defined impactor properties
testimp 975.0 r ! Diameter of test impactor (m)
testvel 15.0e3 ! Velocity of test crater (m/s)
testang 90.0 ! Impact angle of test crater (deg) - Default 90.0
testxoffset 0.0e0 ! x-axis offset of crater center from grid center (m) - Default 0.0
testyoffset 0.0e0 ! y-axis offset of crater center from grid center (m) - Default 0.0
tallyonly F ! Tally the craters without generating any craters
testtally F
quasimc F ! MC run constrained by non-MC 'real' craters given in a list
realcraterlist craterlist.in ! list of 'real' craters for Quasi-MC runs



! IDL driver in uts
interval 1.0
numintervals 1 ! Total number of intervals
restart F ! Restart a previous run
impfile NPFextrap.dat ! Impactor SFD rate file (col 1: Dimp (m), col 2: ! impactors > D (m**(-2) y**(-1))
popupconsole F ! Pop up console window every output interval
saveshaded T ! Output shaded relief images
saverego F ! Output regolith map images
savepres F ! Output simplified console display images (presentation-compatible images)
savetruelist T ! Save the true cumulative crater distribution for each interval (large file size)
shadedminh -5000.0 ! Minimum height for shaded relief map (m) (Default - automatic)
shadedmaxh 5000.0 ! Maximum height for shaded relief map (m) (Default - automatic)
runtype single ! Run type: options are normal / statistical
! single: craters accumulate in successive intervals
! statistical: surface is reset between intervals

! CTEM required inputs
seed 23790 ! Random number generator seed
gridsize 1000 ! Size of grid in pixels
numlayers 10 ! Number of perched layers
pix 1.0e2 ! Pixel size (m)
mat rock ! Material (rock or ice)
! Bedrock scaling parameters
mu_b 0.55e0 ! Experimentally derived parameter for bedrock crater scaling law
kv_b 0.20e0 ! Experimentally derived parameter for bedrock crater scaling law
trho_b 2250.0e0 ! Target density (bedrock) (kg/m**3)
ybar_b 0.0e6 ! Bedrock strength (Pa)
! Regolith scaling parameters
mu_r 0.55e0 ! Experimentally derived parameter for regolith crater scaling law
kv_r 0.20e0 ! Experimentally derived parameter for regolith crater scaling law
trho_r 2250.0e0 ! Target density (regolith) (kg/m**3)
ybar_r 0.00e6 ! Regolith strength (Pa)
! Body parameters
gaccel 1.62e0 ! Gravitational acceleration at target (m/s**2)
trad 1737.35e3 ! Target radius (m)
prho 2500.0e0 ! Projectile density (kg/m**3)
sfdfile production.dat ! Impactor SFD file (col 1: Dimp (m), col 2: ! impactors > D
velfile lunar-MBA-impactor-velocities.dat ! Impactor velocity dist file

! Seismic shaking input (required if seismic shaking is set to T, otherwise ignored)
doseismic F ! Perform seismic shaking calculations with each impact - Default F

! Optional inputF These have internally set default values that work reasonable well. Comment them out with
deplimit 9e99 ! Depth limit for craters (m) - Default is to ignore.
maxcrat 1.00e-98 ! Fraction of gridsize that maximum crater can be - Default 1.0
killatmaxcrater F ! Stop the run if a crater larger than the maximum is produced - Default F
basinimp 35.0e3 ! Size of impactor to switch to lunar basin scaling law - Default is to ignore
docollapse T ! Do slope collapse - Default T
dosoftening F ! Do ejecta softening - Default T
doangle T ! Vary the impact angle. Set to F to have only vertical impacts - Default T
Kd1 0.0001
psi 2.000
fe 4.00
ejecta_truncation 4.0
dorays F
superdomain F
doregotrack F
dorealistic T

Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
6000 41.000000 0.002861
7000 200.000000 0.016817
8000 541.000000 0.054567
9000 793.000000 0.109902
10000 822.000000 0.167260
11000 974.000000 0.235224
12000 978.000000 0.303468
13000 973.000000 0.371363
14000 901.000000 0.434233
15000 1034.000000 0.506385
16000 1036.000000 0.578676
17000 934.000000 0.643849
18000 784.000000 0.698556
19000 644.000000 0.743493
20000 467.000000 0.776080
21000 356.000000 0.800921
22000 285.000000 0.820808
23000 239.000000 0.837485
24000 232.000000 0.853674
25000 319.000000 0.875933
26000 368.000000 0.901612
27000 240.000000 0.918359
28000 162.000000 0.929663
29000 132.000000 0.938874
30000 84.000000 0.944735
31000 82.000000 0.950457
32000 83.000000 0.956249
33000 79.000000 0.961761
34000 81.000000 0.967413
35000 50.000000 0.970902
36000 63.000000 0.975298
37000 66.000000 0.979904
38000 43.000000 0.982904
39000 41.000000 0.985765
40000 44.000000 0.988835
41000 28.000000 0.990789
42000 37.000000 0.993371
43000 19.000000 0.994697
44000 20.000000 0.996092
45000 19.000000 0.997418
46000 5.000000 0.997767
47000 10.000000 0.998465
48000 5.000000 0.998814
49000 3.000000 0.999023
50000 2.000000 0.999163
51000 1.000000 0.999232
52000 0.000000 0.999232
53000 1.000000 0.999302
54000 0.000000 0.999302
55000 1.000000 0.999372
56000 1.000000 0.999442
57000 1.000000 0.999512
58000 0.000000 0.999512
59000 0.000000 0.999512
60000 1.000000 0.999581
61000 0.000000 0.999581
62000 1.000000 0.999651
63000 1.000000 0.999721
64000 0.000000 0.999721
65000 1.000000 0.999791
66000 2.000000 0.999930
67000 0.000000 0.999930
68000 0.000000 0.999930
69000 1.000000 1.000000
3 changes: 0 additions & 3 deletions python/.idea/.gitignore

This file was deleted.

3 changes: 0 additions & 3 deletions python/ctem/.idea/.gitignore

This file was deleted.

9 changes: 5 additions & 4 deletions python/ctem/ctem/viewer3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ def ctem2blockmesh(self):
y3.flatten())
zvals = np.append(
np.append(
np.append(self.dem.flatten(),
self.dem.flatten()),
self.dem.flatten()),
self.dem.flatten())
np.append(self.surface_dem.flatten(),
self.surface_dem.flatten()),
self.surface_dem.flatten()),
self.surface_dem.flatten())
verts = np.array((xvals, yvals, zvals)).T
nface_triangles = 10
faces = np.full([nface_triangles*s**2, 3], -1, dtype=np.int64)
Expand Down Expand Up @@ -116,6 +116,7 @@ def visualize(self):

if __name__ == '__main__':
sim = Polysurface()
sim.surface_dem *= 10
sim.ctem2trimesh()
sim.visualize()

Expand Down

0 comments on commit 5c931f1

Please sign in to comment.