Commit 1b491a47 authored by Alex Breuer's avatar Alex Breuer

Added EDGE-configs of SGT test case.

parent f56aa9a8
......@@ -42,6 +42,12 @@
# NetCDF-files: Kinematic sources
*.nc filter=lfs diff=lfs merge=lfs -text
# Descriptions of HDF5 files
*.dmp filter=lfs diff=lfs merge=lfs -text
# ASCII representations (e.g., for HDF5 files)
*.ascii filter=lfs diff=lfs merge=lfs -text
# HDF5 files: Point sources
*.h5 filter=lfs diff=lfs merge=lfs -text
......
gen/hom/point_forces/hom_point_forces_100_16_1.xml filter=lfs diff=lfs merge=lfs -text
gen/hom/point_forces/hom_point_forces_100_16_2.xml filter=lfs diff=lfs merge=lfs -text
gen/hom/point_forces/hom_point_forces_50_128_7.xml filter=lfs diff=lfs merge=lfs -text
gen/hom/point_forces/hom_point_forces_50_128_9.xml filter=lfs diff=lfs merge=lfs -text
gen/hom/forward/hom_forward_100_16.xml filter=lfs diff=lfs merge=lfs -text
gen/hom/point_forces/hom_point_forces_100_16_0.xml filter=lfs diff=lfs merge=lfs -text
gen/hom/point_forces/hom_point_forces_100_16_3.xml filter=lfs diff=lfs merge=lfs -text
gen/hom/point_forces/hom_point_forces_100_16_4.xml filter=lfs diff=lfs merge=lfs -text
gen/hom/point_forces/hom_point_forces_50_128_5.xml filter=lfs diff=lfs merge=lfs -text
gen/hom/point_forces/hom_point_forces_50_128_6.xml filter=lfs diff=lfs merge=lfs -text
gen/hom/point_forces/hom_point_forces_50_128_8.xml filter=lfs diff=lfs merge=lfs -text
gen/hom/forward/hom_forward_50_128.xml filter=lfs diff=lfs merge=lfs -text
[![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:
* `receivers.csv`
This work is published from: United States.
# Configs
This directory contains EDGE's configs for the SGT test case.
Used commands:
```
TMP_FILE=$(mktemp)
gmt grdtrack ../meshes/out_pe/receivers.csv -G../meshes/out_pe/topo.xyz > ${TMP_FILE}
awk -F, '{print $4,$1,$2,$5}' FS="[ \t]+" OFS=, "${TMP_FILE}" > receivers.csv
./gen_hom_configs.js
```
<?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
Config for mountain topography with homogeneous material parameters.
-->
<edge>
<cfr>
<mesh>
<files>
<in>{{i_mesh}}</in>
</files>
<options>
<read>PARALLEL=READ_PART;PARALLEL_RESOLVE_SHARED_ENTS;PARTITION=PARALLEL_PARTITION;</read>
</options>
<boundary>
<free_surface>101</free_surface>
<outflow>105</outflow>
</boundary>
</mesh>
{% if i_velocityModel %}
<velocity_model>
<domain>
<half_space>
<origin>
<x>{{i_velocityModel.origin.x}}</x>
<y>{{i_velocityModel.origin.y}}</y>
<z>{{i_velocityModel.origin.z}}</z>
</origin>
<normal>
<x>{{i_velocityModel.normal.x}}</x>
<y>{{i_velocityModel.normal.y}}</y>
<z>{{i_velocityModel.normal.z}}</z>
</normal>
</half_space>
<rho>{{i_velocityModel.rho}}</rho>
<lambda>{{i_velocityModel.lambda}}</lambda>
<mu>{{i_velocityModel.mu}}</mu>
</domain>
</velocity_model>
{% endif %}
<setups>
<point_sources>
{% for l_so in i_sources %}
<file>sources/{{l_so}}</file>
{% endfor %}
</point_sources>
<end_time>25.0</end_time>
</setups>
<output>
<receivers>
<path_to_dir>{{i_outRe}}</path_to_dir>
<freq>0.01</freq>
{% for l_re in i_recvs %}
<receiver>
<name>{{l_re[0]}}</name>
<coords>
<x>{{l_re[1]}}</x>
<y>{{l_re[2]}}</y>
<z>{{l_re[3]}}</z>
</coords>
</receiver>
{% endfor %}
<receiver>
<name>hypocenter</name>
<coords>
<x>0</x>
<y>0</y>
<z>-7622.4</z>
</coords>
</receiver>
</receivers>
<wave_field>
<type>vtk_binary</type>
<file>{{i_outWf}}</file>
<sparse_type>101</sparse_type>
<int>0.25</int>
</wave_field>
</output>
</cfr>
</edge>
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');
console.log( 'parsing receivers..' )
// read csv of receivers
var l_recvs = l_fs.readFileSync(
'receivers.csv','UTF-8',
function(l_err) {
if(l_err) return console.log( l_err );
}
)
// split by new line
l_recvs = l_recvs.split('\n')
// remove empty last line
l_recvs = l_recvs.slice( 0, -1 )
// split by comma
for( var l_re = 0; l_re < l_recvs.length; l_re++ ) {
l_recvs[l_re] = l_recvs[l_re].split(',')
}
// generate the configs for the forward simulations
var l_forwardMeshes = [ '100_16', '50_128']
var l_vmHom = { origin: {x: 0, y: 0, z: 9999},
normal: {x: 0, y: 0, z: -1},
rho: 2800,
lambda: 1.7136000000000000E10,
mu: 4.0320000000000000E9 }
for( var l_fm = 0; l_fm < l_forwardMeshes.length; l_fm++ ) {
console.log( 'generating forward config for mesh: '+l_forwardMeshes[l_fm] )
l_fs.outputFile(
'gen/hom/forward/hom_forward_' + l_forwardMeshes[l_fm] + '.xml',
nunjucks.render(
'config.njk', {
i_mesh: 'meshes/gen/volume_hom/hdf5/volume_hom_' + l_forwardMeshes[l_fm] + '.h5m',
i_velocityModel: l_vmHom,
i_sources: ['ricker_forward.h5'],
i_outWf: 'hom_forward_' + l_forwardMeshes[l_fm] + '/wf',
i_outRe: 'hom_forward_' + l_forwardMeshes[l_fm],
i_recvs: l_recvs
}
),
function(l_err) {
if(l_err) return console.log( l_err );
}
)
}
// generate configs for the point forces in x- and y-direction
var l_forces = l_recvs
// sort the point forces by distance to the hypocenter
l_forces.sort(function(a, b) {
var l_distA = a[1]**2 + a[2]**2 + (a[3]+8000)**2
var l_distB = b[1]**2 + b[2]**2 + (b[3]+8000)**2
return l_distA - l_distB
});
// iterate over the point forces
var l_fused = []
var l_dims = ['x', 'y']
var l_config = 0
var l_nFused = 0
for( var l_fm = 0; l_fm < l_forwardMeshes.length; l_fm++ ) {
for( var l_pf = 0; l_pf < l_forces.length; l_pf++ ) {
for( var l_di = 0; l_di < 2; l_di++ ) {
l_nFused++;
l_fused.push( 'point_forces/' + l_forces[l_pf][0] + '_' + l_dims[l_di] + '.h5' )
if( l_nFused == 16 || (l_pf == l_forces.length-1 && l_di == 1) ) {
l_fs.outputFile(
'gen/hom/point_forces/hom_point_forces_' + l_forwardMeshes[l_fm] + '_' + l_config + '.xml',
nunjucks.render(
'config.njk', {
i_mesh: 'meshes/gen/volume_hom/hdf5/volume_hom_' + l_forwardMeshes[l_fm] + '.h5m',
i_velocityModel: l_vmHom,
i_sources: l_fused,
i_outWf: 'hom_forward_' + l_forwardMeshes[l_fm] + '_' + l_config + '/wf',
i_outRe: 'hom_forward_' + l_forwardMeshes[l_fm] + '_' + l_config,
i_recvs: l_recvs
}
),
function(l_err) {
if(l_err) return console.log( l_err );
}
)
l_config++
l_fused = []
l_nFused = 0
}
}
}
}
\ No newline at end of file
This source diff could not be displayed because it is stored in LFS. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment