Commit 11ead5d3 authored by Alex Breuer's avatar Alex Breuer

Added surface meshes of SGT test case.

parent 1b491a47
# Meshes for the SGT test case
This directory contains the meshes for the SGT test case.
The origin (0,0,0) is at sea level above the hypocenter.
The epicenter is at (0,0,377.6m).
## Used Commands
* DEM download:
```
bash get_grids.sh 2>&1 | tee get_grids.sh.log
```
* DEM prep:
```
bash project_extract.sh 2>&1 | tee project_extract.sh.log
```
* Surface meshes:
```
./gen_surface_configs.js
bash gen_surface_meshes.sh
./gen_volume_hom_configs.js
./gen_volume_hom_meshes.sh
./gen_volume_hom_parts.sh
./gen_volume_hom_parts_cont.sh
./gen_volume_hom_parts_cont_2.sh
```
[![CC0](http://i.creativecommons.org/p/zero/1.0/88x31.png)](http://creativecommons.org/publicdomain/zero/1.0/)
To the extent possible under law, [Alexander Nikolas Breuer](http://dial3343.org) has waived all copyright and related or neighboring rights to the following work:
* `off.tar.bz2`
* `stl.tar.bz2`
This work is published from: United States.
surface_config_50.xml filter=lfs diff=lfs merge=lfs -text
surface_config_100.xml filter=lfs diff=lfs merge=lfs -text
surface_config_200.xml filter=lfs diff=lfs merge=lfs -text
surface_config_300.xml filter=lfs diff=lfs merge=lfs -text
surface_config_400.xml filter=lfs diff=lfs merge=lfs -text
surface_config_500.xml filter=lfs diff=lfs merge=lfs -text
This source diff could not be displayed because it is stored in LFS. You can view the blob instead.
This source diff could not be displayed because it is stored in LFS. You can view the blob instead.
This source diff could not be displayed because it is stored in LFS. You can view the blob instead.
This source diff could not be displayed because it is stored in LFS. You can view the blob instead.
This source diff could not be displayed because it is stored in LFS. You can view the blob instead.
This source diff could not be displayed because it is stored in LFS. You can view the blob instead.
This source diff could not be displayed because it is stored in LFS. You can view the blob instead.
This source diff could not be displayed because it is stored in LFS. You can view the blob instead.
This source diff could not be displayed because it is stored in LFS. You can view the blob instead.
This source diff could not be displayed because it is stored in LFS. You can view the blob instead.
This source diff could not be displayed because it is stored in LFS. You can view the blob instead.
This source diff could not be displayed because it is stored in LFS. You can view the blob instead.
This source diff could not be displayed because it is stored in LFS. You can view the blob instead.
This source diff could not be displayed because it is stored in LFS. You can view the blob instead.
This source diff could not be displayed because it is stored in LFS. You can view the blob instead.
This source diff could not be displayed because it is stored in LFS. You can view the blob instead.
This source diff could not be displayed because it is stored in LFS. You can view the blob instead.
This source diff could not be displayed because it is stored in LFS. You can view the blob instead.
This source diff could not be displayed because it is stored in LFS. You can view the blob instead.
This source diff could not be displayed because it is stored in LFS. You can view the blob instead.
This source diff could not be displayed because it is stored in LFS. You can view the blob instead.
This source diff could not be displayed because it is stored in LFS. You can view the blob instead.
This source diff could not be displayed because it is stored in LFS. You can view the blob instead.
This source diff could not be displayed because it is stored in LFS. You can view the blob instead.
#!/usr/bin/env node
/**
* @file This file is part of EDGE.
*
* @author Alexander Breuer (anbreuer AT ucsd.edu)
*
* @section LICENSE
* Copyright (c) 2018, Regents of the University of California
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* @section DESCRIPTION
* Generates the EDGE-cut configs.
**/
'use strict';
var nunjucks = require('nunjucks');
var l_fs = require('fs-extra');
// minimum edge lengths
var l_approxMin = [500, 400, 300, 200, 100, 50];
// generate the runtime configs for the test runs
for( var l_am = 0; l_am < l_approxMin.length; l_am++ ) {
l_fs.outputFile(
'gen/surface/configs/surface_config_' + l_approxMin[l_am] + '.xml',
nunjucks.render(
'surface.njk', {
i_topoIn: '../../out_pe/topo.xyz',
i_topoOut: 'off/free_surface_' + l_approxMin[l_am] + '.off',
i_bndOut: 'off/outflow_' + l_approxMin[l_am] + '.off',
i_refApprox: l_approxMin[l_am],
i_refEdge: l_approxMin[l_am]*2,
i_refFacet: l_approxMin[l_am]*2,
i_refAngle: 30
}
),
function(l_err) {
if(l_err) return console.log( l_err );
}
)
}
\ No newline at end of file
#!/bin/bash
##
# @file This file is part of EDGE.
#
# @author Alexander Breuer (anbreuer AT ucsd.edu)
#
# @section LICENSE
# Copyright (c) 2018, Regents of the University of California
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# @section DESCRIPTION
# Generates the surface meshes.
##
cd gen/surface
rm -r logs
rm -r off
rm -r stl
mkdir logs
mkdir off
mkdir stl
for am in 500 400 300 200 100 50
do
edge_cut configs/surface_config_${am}.xml 2>&1 | tee logs/edge_cut_${am}.log
meshio-convert off/free_surface_${am}.off stl/free_surface_${am}.stl 2>&1 | tee logs/free_surface_${am}.log
meshio-convert off/outflow_${am}.off stl/outflow_${am}.stl 2>&1 | tee logs/outflow_${am}.log
done
\ No newline at end of file
#!/usr/bin/env node
/**
* @file This file is part of EDGE.
*
* @author Alexander Breuer (anbreuer AT ucsd.edu)
*
* @section LICENSE
* Copyright (c) 2018, Regents of the University of California
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* @section DESCRIPTION
* Generates the EDGE-cut configs.
**/
'use strict';
var nunjucks = require('nunjucks');
var l_fs = require('fs-extra');
// minimum edge lengths
var l_approxMin = [500, 400, 300, 200, 100, 50];
// generate the runtime configs for the test runs
for( var l_am = 0; l_am < l_approxMin.length; l_am++ ) {
l_fs.outputFile(
'gen/volume_hom/configs/volume_hom_' + l_approxMin[l_am] + '.xml',
nunjucks.render(
'volume_hom.njk', {
i_freeSurface: '../../surface/stl/free_surface_' + l_approxMin[l_am] + '.stl',
i_outFlow: '../../surface/stl/outflow_' + l_approxMin[l_am] + '.stl',
i_clIn: l_approxMin[l_am]*2,
i_clOut: l_approxMin[l_am]*16,
i_refAngle: 30
}
),
function(l_err) {
if(l_err) return console.log( l_err );
}
)
}
\ No newline at end of file
#!/bin/bash
##
# @file This file is part of EDGE.
#
# @author Alexander Breuer (anbreuer AT ucsd.edu)
#
# @section LICENSE
# Copyright (c) 2018, Regents of the University of California
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# @section DESCRIPTION
# Generates the homogeneous volume meshes.
##
cd gen/volume_hom
rm -r logs
rm -r ascii
mkdir logs
mkdir ascii
for am in 500 400 300 200 100 50
do
gmsh -3 configs/volume_hom_${am}.xml -o ascii/volume_hom_${am}.msh 2>&1 | tee logs//volume_hom_${am}.msh.log
done
\ No newline at end of file
#!/bin/bash
##
# @file This file is part of EDGE.
#
# @author Alexander Breuer (anbreuer AT ucsd.edu)
#
# @section LICENSE
# Copyright (c) 2018, Regents of the University of California
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# @section DESCRIPTION
# Generates the paritioned homogeneous volume meshes.
##
cd gen/volume_hom
rm -r hdf5
mkdir hdf5
for parts in 2 4 8 16 32 64 128 256
do
mbpart -T --imbalance 1.05 --metis ML_KWAY --reorder ${parts} ascii/volume_hom_100.msh hdf5/volume_hom_100_${parts}.h5m 2>&1 | tee logs/volume_hom_100_${parts}.h5m.log
done
for parts in 8 16 32 64 128 256 512 1024
do
mbpart -T --imbalance 1.05 --metis ML_KWAY --reorder ${parts} ascii/volume_hom_50.msh hdf5/volume_hom_50_${parts}.h5m | tee logs/volume_hom_100_${parts}.h5m.log
done
\ No newline at end of file
#!/bin/bash
##
# @file This file is part of EDGE.
#
# @author Alexander Breuer (anbreuer AT ucsd.edu)
#
# @section LICENSE
# Copyright (c) 2018, Regents of the University of California
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# @section DESCRIPTION
# Continuation of previous partitioning.
##
cd gen/volume_hom
rm -r hdf5
mkdir hdf5
for parts in 512 1024 1536 2048 2560 3072
do
mbpart -T --imbalance 1.05 --metis ML_KWAY --reorder ${parts} ascii/volume_hom_50.msh hdf5/volume_hom_50_${parts}.h5m | tee logs/volume_hom_100_${parts}.h5m.log
done
#!/bin/bash
##
# @file This file is part of EDGE.
#
# @author Alexander Breuer (anbreuer AT ucsd.edu)
#
# @section LICENSE
# Copyright (c) 2018, Regents of the University of California
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# @section DESCRIPTION
# Continuation of previous partitioning.
##
cd gen/volume_hom
rm -r hdf5
mkdir hdf5
for parts in 8 16 32 64 128 256
do
mbpart -T --imbalance 1.05 --metis ML_KWAY --reorder ${parts} ascii/volume_hom_50.msh hdf5/volume_hom_50_${parts}.h5m | tee logs/volume_hom_50_${parts}.h5m.log
done
#!/bin/bash
##
# @file This file is part of EDGE.
#
# @author Alexander Breuer (anbreuer AT ucsd.edu)
#
# @section LICENSE
# Copyright (c) 2018, Regents of the University of California
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# @section DESCRIPTION
# Downloads and unzips the grids.
##
date
mkdir grids
cd grids
for msh in n36w122 n36w121 n36w120 n37w122 n37w121 n37w120
do
wget -q https://prd-tnm.s3.amazonaws.com/StagedProducts/Elevation/13/ArcGrid/${msh}.zip
unzip ${msh}.zip -d ${msh}
rm ${msh}.zip
done
cd ..
This source diff could not be displayed because it is stored in LFS. You can view the blob instead.
[![CC0](http://i.creativecommons.org/p/zero/1.0/88x31.png)](http://creativecommons.org/publicdomain/zero/1.0/)
To the extent possible under law, [Alexander Nikolas Breuer](http://dial3343.org) has waived all copyright and related or neighboring rights to the following work:
* `blend.pdf`
* `map.pdf`
* `poi.csv`
* `receivers.csv`
* `topo.xyz.tar.bz2`
This work is published from: United States.
This source diff could not be displayed because it is stored in LFS. You can view the blob instead.
This source diff could not be displayed because it is stored in LFS. You can view the blob instead.
#!/bin/bash
##
# @file This file is part of EDGE.
#
# @author Alexander Breuer (anbreuer AT ucsd.edu)
#
# @section LICENSE
# Copyright (c) 2018, Regents of the University of California
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# @section DESCRIPTION
# Plots and projects the data.
##
# points of interest in lon/lat
poi_lonlat=../poi_lonlat.csv
# receivers in lon/lat
receivers_lonlat=../receivers_lonlat.csv
# create output directory
out_dir=out_pe
mkdir ${out_dir}
# points of interest in meters
poi=${out_dir}/poi.csv
# receivers in meters
receivers=${out_dir}/receivers.csv
# region of interest cut from the mesh
region_cut=-80000/80000/-80000/80000
# sampling of the topo mesh (50m)
region_sampling=50/50
# projection center is the epicenter of the 2004 Parfield earthquake
projection="tmerc/-120.365/35.817"
grids=(grids/n36w122/grdn36w122_13/w001001.adf grids/n36w121/grdn36w121_13/w001001.adf grids/n36w120/grdn36w120_13/w001001.adf grids/n37w122/grdn37w122_13/w001001.adf grids/n37w121/grdn37w121_13/w001001.adf grids/n37w120/grdn37w120_13/w001001.adf)
# blend region
blend_region=-122/-118.9/35/37
# blend sampling
blend_sampling=1e-04/1e-04
# create work directory
tmp_dir=$(mktemp -d)
# generate a color table
gmt makecpt -Cgray -T-1000/1500 > ${tmp_dir}/gmt_colors.cpt
# blend the two grids together
gmt grdblend ${grids[*]} -R${blend_region} -I${blend_sampling} -G${tmp_dir}/blend.nc -V2
# plot topography in lon/lat
gmt grdimage -C${tmp_dir}/colors.cpt -J${projection}/8c ${tmp_dir}/blend.nc -Ba -K -C${tmp_dir}/gmt_colors.cpt > ${tmp_dir}/blend.ps
# convert receiver coordinates
cat ${receivers_lonlat} | cs2cs +proj=latlong +datum=WGS84 +to +proj=tmerc +units=m +axis=end +no_defs +ellps=GRS80 +k=0.9996 +lon_0=-120.365 +lat_0=35.817 -f %.12f > ${receivers}
# add receivers (symbols only)
gmt psxy ${receivers} -R${blend_region} -Z -J${projection}/8c -Sd.1 -Gblack -O -K -V2 >> ${tmp_dir}/blend.ps
# add points of interests
gmt psxy ${poi_lonlat} -R${blend_region} -Z -J${projection}/8c -Sd.25 -Gblack -O -K -V2 >> ${tmp_dir}/blend.ps
# add captions
gmt pstext ${poi_lonlat} -R${blend_region} -J${projection}/8c -F+f7+jL -D0.2/0c -O -V2 >> ${tmp_dir}/blend.ps
# convert to pdf
ps2pdf ${tmp_dir}/blend.ps ${out_dir}/blend.pdf
# project grid
gmt grdproject ${tmp_dir}/blend.nc -J${projection}/0.9996 -C -G${tmp_dir}/proj.nc -Fe -V2
# extract and resample mesh
gmt grdsample ${tmp_dir}/proj.nc -I${region_sampling} -R${region_cut} -G${tmp_dir}/topo.nc -r -V2
# convert to ascii
gmt grd2xyz ${tmp_dir}/topo.nc > ${out_dir}/topo.xyz
# convert point of interests
cat ${poi_lonlat} | cs2cs +proj=latlong +datum=WGS84 +to +proj=tmerc +units=m +axis=end +no_defs +ellps=GRS80 +k=0.9996 +lon_0=-120.365 +lat_0=35.817 -f %.12f > ${poi}
# plot topography
gmt grdimage -JX6.5i -C${tmp_dir}/colors.cpt ${tmp_dir}/topo.nc -Ba -K -C${tmp_dir}/gmt_colors.cpt -V2 > ${tmp_dir}/map.ps
# add receivers
gmt psxy ${receivers} -Z -JX6.5i -R${region_cut} -Sd.1 -Gblack -O -K -V2 >> ${tmp_dir}/map.ps
gmt pstext ${receivers} -Z -R${region_cut} -JX6.5i -F+f3+jL -D0.05/0c -O -K -V2 >> ${tmp_dir}/map.ps
# add points of interests
gmt psxy ${poi} -Z -JX6.5i -R${region_cut} -Sd.25 -Gblack -O -K -V2 >> ${tmp_dir}/map.ps
gmt pstext ${poi} -Z -R${region_cut} -JX6.5i -F+f7+jL -D0.2/0c -O -V2 >> ${tmp_dir}/map.ps
# convert to pdf
ps2pdf ${tmp_dir}/map.ps ${out_dir}/map.pdf
# remove work directory
rm -r ${tmp_dir}
This source diff could not be displayed because it is stored in LFS. You can view the blob instead.
<?xml version="1.0" encoding="UTF-8"?>
<!--
@file This file is part of EDGE.
@author Alexander Breuer (anbreuer AT ucsd.edu)
@section LICENSE
Copyright (c) 2018, Regents of the University of California
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@section DESCRIPTION
Template for the parkfield surface meshes.
-->
<edge_cut>
<io>
<topography>
<in>{{i_topoIn}}</in>
<out>{{i_topoOut}}</out>
</topography>
<boundary>
<out>{{i_bndOut}}</out>
</boundary>
</io>
<bounding_box>
<xMin>-79975</xMin>
<xMax>79975</xMax>
<yMin>-79975</yMin>
<yMax>79975</yMax>
<zMin>-40000</zMin>
<zMax>5000</zMax>
</bounding_box>
<refine>
<edge>{{i_refEdge}}</edge>
<facet>{{i_refFacet}}</facet>
<approx>{{i_refApprox}}</approx>
<angle>{{i_refAngle}}</angle>
</refine>
<region>
<inner_radius>10000</inner_radius>
<outer_radius>50000</outer_radius>
<center>
<x>-6000</x>
<y>6000</y>
<z>0</z>
</center>
<scale>8</scale>
</region>
<optimize>
<time_limit>0</time_limit>
</optimize>
</edge_cut>
/**
* @file This file is part of EDGE.
*
* @author Alexander Breuer (anbreuer AT ucsd.edu)
*
* @section LICENSE
* Copyright (c) 2018, Regents of the University of California
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* @section DESCRIPTION
* Template for the homogeneous volume mesh.
**/
Mesh.Optimize = 1;
Mesh.OptimizeNetgen=1;
//Geometry.Tolerance = 1.e-6;
// read topo mesh
Merge "free_surface.stl";
Surface Loop(1) = {1};
Physical Surface(101) = {1};
// read surrounding box
Merge "outflow.stl";
Surface Loop(2) = {2};
Physical Surface(105) = {2};
// create volume
Coherence Mesh;
Volume(1) = {1,2};
Physical Volume(1) = {1};
// set characteristic length
Mesh.CharacteristicLengthExtendFromBoundary = 0;
cl1 = 100;
cl2 = 800;
// high res topo
Point(100) = {-6000, 6000, 0};
Field[1] = Attractor;
Field[1].NodesList = {100};
Field[2] = Threshold;
Field[2].IField = 1;
Field[2].LcMin = cl1;
Field[2].LcMax = cl2;
Field[2].DistMin = 10000;
Field[2].DistMax = 50000;
Field[3] = Min;
Field[3].FieldsList = {2};
Background Field = 3;
/**
* @file This file is part of EDGE.
*
* @author Alexander Breuer (anbreuer AT ucsd.edu)
*
* @section LICENSE
* Copyright (c) 2018, Regents of the University of California
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* @section DESCRIPTION
* Template for the homogeneous volume mesh.
**/
Mesh.OptimizeNetgen=1;
Mesh.Optimize = 10;
// read topo mesh
Merge "{{i_freeSurface}}";
Surface Loop(1) = {1};
Physical Surface(101) = {1};
// read surrounding box
Merge "{{i_outFlow}}";
Surface Loop(2) = {2};
Physical Surface(105) = {2};
// create volume
Coherence Mesh;
Volume(1) = {1,2};
Physical Volume(1) = {1};
// set characteristic length
Mesh.CharacteristicLengthExtendFromBoundary = 0;
cl1 = {{i_clIn}};
cl2 = {{i_clOut}};
// high res topo
Point(100) = {-6000, 6000, 0};