From c2e8cec665e633fa61d515a839fbd08a778cac86 Mon Sep 17 00:00:00 2001 From: Alexander Nikolas Breuer Date: Mon, 22 Feb 2021 17:23:12 +0100 Subject: [PATCH] Added configs of 2D convergence tests for the advection equation. --- .../convergence_2d/configs/README.rst | 8 + .../convergence_2d/configs/config.njk | 217 ++++++++++++++++++ .../convergence_2d/configs/gen.tar.xz | 3 + .../convergence_2d/configs/gen_configs.js | 73 ++++++ .../convergence_2d/meshes/README.rst | 10 + .../convergence_2d/meshes/edge_v.njk | 49 ++++ .../convergence_2d/meshes/gen.tar.xz | 3 + .../convergence_2d/meshes/gen_configs.js | 94 ++++++++ .../convergence_2d/meshes/generate.sh | 61 +++++ .../convergence_2d/meshes/gts_base.geo | 51 ++++ .../convergence_2d/meshes/lts_base.geo | 88 +++++++ .../convergence_2d/meshes/quad4r.njk | 27 +++ .../advection/convergence_2d/meshes/tria3.njk | 24 ++ bench/advection/convergence_2d/runs/configs | 1 + bench/advection/convergence_2d/runs/meshes | 1 + .../advection/convergence_2d/runs/run_all.sh | 99 ++++++++ 16 files changed, 809 insertions(+) create mode 100644 bench/advection/convergence_2d/configs/README.rst create mode 100644 bench/advection/convergence_2d/configs/config.njk create mode 100644 bench/advection/convergence_2d/configs/gen.tar.xz create mode 100755 bench/advection/convergence_2d/configs/gen_configs.js create mode 100644 bench/advection/convergence_2d/meshes/README.rst create mode 100644 bench/advection/convergence_2d/meshes/edge_v.njk create mode 100644 bench/advection/convergence_2d/meshes/gen.tar.xz create mode 100755 bench/advection/convergence_2d/meshes/gen_configs.js create mode 100755 bench/advection/convergence_2d/meshes/generate.sh create mode 100644 bench/advection/convergence_2d/meshes/gts_base.geo create mode 100644 bench/advection/convergence_2d/meshes/lts_base.geo create mode 100644 bench/advection/convergence_2d/meshes/quad4r.njk create mode 100644 bench/advection/convergence_2d/meshes/tria3.njk create mode 120000 bench/advection/convergence_2d/runs/configs create mode 120000 bench/advection/convergence_2d/runs/meshes create mode 100755 bench/advection/convergence_2d/runs/run_all.sh diff --git a/bench/advection/convergence_2d/configs/README.rst b/bench/advection/convergence_2d/configs/README.rst new file mode 100644 index 0000000..7f71d45 --- /dev/null +++ b/bench/advection/convergence_2d/configs/README.rst @@ -0,0 +1,8 @@ +Configs for the 2D Advection Convergence Setting +================================================ + +Used commands: + +.. code-block:: bash + + ./gen_configs.js diff --git a/bench/advection/convergence_2d/configs/config.njk b/bench/advection/convergence_2d/configs/config.njk new file mode 100644 index 0000000..8bac6c0 --- /dev/null +++ b/bench/advection/convergence_2d/configs/config.njk @@ -0,0 +1,217 @@ + + + + + + + {{i_meshBase}} + {{i_meshExt}} + + + 106 + + + + + + + + + + + + + + + + + 20 + + + + + + + + + + + + + + + + + sout_file + {{i_errorXml}} + + + + diff --git a/bench/advection/convergence_2d/configs/gen.tar.xz b/bench/advection/convergence_2d/configs/gen.tar.xz new file mode 100644 index 0000000..92e9426 --- /dev/null +++ b/bench/advection/convergence_2d/configs/gen.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:26bd7173335a8e9c1471005caf6caf33c0e3b219cb51784784c4072b96766e6a +size 3540 diff --git a/bench/advection/convergence_2d/configs/gen_configs.js b/bench/advection/convergence_2d/configs/gen_configs.js new file mode 100755 index 0000000..591213d --- /dev/null +++ b/bench/advection/convergence_2d/configs/gen_configs.js @@ -0,0 +1,73 @@ +#!/usr/bin/env node +/** + * @file This file is part of EDGE. + * + * @author Alexander Breuer (breuer AT mytum.de) + * + * @section LICENSE + * Copyright (c) 2021, Friedrich Schiller University Jena + * 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 gmsh- and EDGE-V configs. + **/ +'use strict'; + +var nunjucks = require('nunjucks'); +var l_fs = require('fs-extra'); +const { exit } = require('process'); + +for( var l_ty of ['quad4r', 'tria3'] ) { + for( var l_ts of ['lts', 'gts'] ) { + for( var l_cl of [2, 1.25, 1, 0.625, 0.5, 0.4, 0.3125, 0.25, 0.2, 0.1] ) { + if( l_ts == 'lts' && l_ty != 'tria3' ) { + continue; + } + + for( var l_pa of ['1', '8'] ) { + for( var l_ro of ['0', '1' ] ) { + var l_id = l_ty + '_' + l_ts + '_cl_' + l_cl + '_pa_' + l_pa; + if( l_ro == 1 ) { + if( l_pa == '1' ) { + continue; + } + l_id = l_id + '_reorder_only'; + } + + console.log( 'generating EDGE config for char length / element_type / ts / #parts / reorder only:', l_cl, '/', l_ty, '/', l_ts, '/', l_pa, '/', l_ro ) + + var l_meshBase = 'meshes/gen/edge_v/' + l_id; + var l_meshExt = '.msh'; + var l_config = 'gen/' + l_id + '.xml'; + + l_fs.outputFile( + l_config, + nunjucks.render( + 'config.njk', { + i_meshBase: l_meshBase, + i_meshExt: l_meshExt, + i_waveField: 'wave_field/' + l_id + '/wf', + i_receivers: 'receivers/' + l_id, + i_errorXml: 'errors/' + l_id + '.xml' + } + ), + function(l_err) { + if(l_err) return console.log( l_err ); + } + ) + } + } + } + } +} +console.log( 'done' ) diff --git a/bench/advection/convergence_2d/meshes/README.rst b/bench/advection/convergence_2d/meshes/README.rst new file mode 100644 index 0000000..2097493 --- /dev/null +++ b/bench/advection/convergence_2d/meshes/README.rst @@ -0,0 +1,10 @@ +Meshes for the 2D Advection Convergence Setting +=============================================== + +The "reorder_only" GTS-versions of the tria3-mmeshes went through the same reordering as the parallel versions but only have a single partition. + +Used commands: + +.. code-block:: bash + + ./generate.sh diff --git a/bench/advection/convergence_2d/meshes/edge_v.njk b/bench/advection/convergence_2d/meshes/edge_v.njk new file mode 100644 index 0000000..39065d1 --- /dev/null +++ b/bench/advection/convergence_2d/meshes/edge_v.njk @@ -0,0 +1,49 @@ + + + + + 106 + {{i_reorderOnly}} +{%- if i_nParts > 1 %} + {{i_nParts}} +{%- endif %} + 1 + + {{i_meshIn}} + + {{i_meshOut}} + .msh + + + + + + diff --git a/bench/advection/convergence_2d/meshes/gen.tar.xz b/bench/advection/convergence_2d/meshes/gen.tar.xz new file mode 100644 index 0000000..aab958b --- /dev/null +++ b/bench/advection/convergence_2d/meshes/gen.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5d0cf439359f00b2ceb3f12d5bb00222d36a027773eb42b0d68555d40b293411 +size 11973448 diff --git a/bench/advection/convergence_2d/meshes/gen_configs.js b/bench/advection/convergence_2d/meshes/gen_configs.js new file mode 100755 index 0000000..5489c3d --- /dev/null +++ b/bench/advection/convergence_2d/meshes/gen_configs.js @@ -0,0 +1,94 @@ +#!/usr/bin/env node +/** + * @file This file is part of EDGE. + * + * @author Alexander Breuer (breuer AT mytum.de) + * + * @section LICENSE + * Copyright (c) 2021, Friedrich Schiller University Jena + * Copyright (c) 2019, Alexander Breuer + * 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 gmsh- and EDGE-V configs. + **/ +'use strict'; + +var nunjucks = require('nunjucks'); +var l_fs = require('fs-extra'); +const { exit } = require('process'); + +for( var l_ty of ['quad4r', 'tria3'] ) { + for( var l_ts of ['lts', 'gts'] ) { + for( var l_cl of [2, 1.25, 1, 0.625, 0.5, 0.4, 0.3125, 0.25, 0.2, 0.1] ) { + if( l_ts == 'lts' && l_ty != 'tria3' ) { + continue; + } + + console.log( 'generating gmsh config for char length / element_type / ts:', l_cl, '/', l_ty, '/', l_ts ) + + l_fs.outputFile( + 'gen/configs/gmsh/' + l_ty + '_' + l_ts + '_' + l_cl + '.geo', + nunjucks.render( + l_ty+'.njk', { + i_cl: l_cl, + i_meshBase: '../../../' + l_ts + '_base.geo' + } + ), + function(l_err) { + if(l_err) return console.log( l_err ); + } + ) + + for( var l_pa of ['1', '8'] ) { + for( var l_ro of ['0', '1' ] ) { + var l_id = l_ty + '_' + l_ts + '_cl_' + l_cl + '_pa_' + l_pa; + if( l_ro == 1 ) { + if( l_pa == '1' ) { + continue; + } + l_id = l_id + '_reorder_only'; + } + + console.log( 'generating EDGE-V config for char length / element_type / ts / #parts / reorder only:', l_cl, '/', l_ty, '/', l_ts, '/', l_pa, '/', l_ro ) + + var l_configOut = 'gen/configs/edge_v/' + l_id + '.xml'; + var l_nTimeGroups = 1; + if( l_ts == 'lts' ) { + l_nTimeGroups = 5; + } + var l_meshOut = 'gen/edge_v/' + l_id; + var l_statsOut = 'gen/stats/edge_v_' + l_id + '.csv'; + + l_fs.outputFile( + l_configOut, + nunjucks.render( + 'edge_v.njk', { + i_meshIn: 'gen/gmsh/' + l_ty + '_' + l_ts + '_' + l_cl + '.msh', + i_nParts: l_pa, + i_nTimeGroups: l_nTimeGroups, + i_reorderOnly: l_ro, + i_meshOut: l_meshOut, + i_statsOut: l_statsOut, + } + ), + function(l_err) { + if(l_err) return console.log( l_err ); + } + ) + } + } + } + } +} +console.log( 'done' ) diff --git a/bench/advection/convergence_2d/meshes/generate.sh b/bench/advection/convergence_2d/meshes/generate.sh new file mode 100755 index 0000000..9bd8adf --- /dev/null +++ b/bench/advection/convergence_2d/meshes/generate.sh @@ -0,0 +1,61 @@ +#!/bin/bash +## +# @file This file is part of EDGE. +# +# @author Alexander Breuer (breuer AT mytum.de) +# +# @section LICENSE +# Copyright (c) 2021, Friedrich Schiller University Jena +# Copyright (c) 2019, Alexander Breuer +# 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 meshes. +## +echo "hostname: $(hostname)" +echo "gmsh-version:" +gmsh --version + +rm -r gen 2> /dev/null +mkdir -p gen/gmsh gen/edge_v gen/logs + +./gen_configs.js + +for l_cl in 2 1.25 1 0.625 0.5 0.4 0.3125 0.25 0.2 0.1 +do + for l_ty in tria3 quad4r + do + for l_ts in gts lts + do + if [[ ${l_ty} == 'quad4r' && ${l_ts} == 'lts' ]] + then + continue + fi + + echo "$(date) running gmsh char length ${l_cl} for type ${l_ty}_${l_ts}" + gmsh -2 -format msh2 gen/configs/gmsh/${l_ty}_${l_ts}_${l_cl}.geo -o gen/gmsh/${l_ty}_${l_ts}_${l_cl}.msh 2>&1 > gen/logs/${l_ty}_${l_ts}_${l_cl}_gmsh.log + + for l_pa in 1 8 + do + echo "$(date) running EDGE-V for char length ${l_cl} for nParts ${l_pa}" + edge_v -x gen/configs/edge_v/${l_ty}_${l_ts}_cl_${l_cl}_pa_${l_pa}.xml > gen/logs/${l_ty}_${l_ts}_cl_${l_cl}_pa_${l_pa}_edge_v.log 2>&1 + + if [[ l_pa -gt 1 && ${l_ts} == 'gts' ]] + then + echo "$(date) running EDGE-V for char length ${l_cl} for nParts ${l_pa} (reorder only)" + edge_v -x gen/configs/edge_v/${l_ty}_${l_ts}_cl_${l_cl}_pa_${l_pa}_reorder_only.xml > gen/logs/${l_ty}_${l_ts}_cl_${l_cl}_pa_${l_pa}_reorder_only_edge_v.log 2>&1 + fi + done + done + done +done diff --git a/bench/advection/convergence_2d/meshes/gts_base.geo b/bench/advection/convergence_2d/meshes/gts_base.geo new file mode 100644 index 0000000..e4ca82b --- /dev/null +++ b/bench/advection/convergence_2d/meshes/gts_base.geo @@ -0,0 +1,51 @@ +/** + * @file This file is part of EDGE. + * + * @author Alexander Breuer (anbreuer AT ucsd.edu) + * + * @section LICENSE + * Copyright (c) 2021, Friedrich Schiller University Jena + * Copyright (c) 2016, 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 + * Simple square domain with periodic boundaries. + **/ +// define mesh size +size = 10; + +// +// construct the square +// +Point(1) = { 0, 0, 0, cl }; +Point(2) = { size, 0, 0, cl }; +Point(3) = { size, size, 0, cl }; +Point(4) = { 0, size, 0, cl }; + +Line(1) = {1, 2}; +Line(2) = {2, 3}; +Line(3) = {3, 4}; +Line(4) = {4, 1}; + +Line Loop(101) = { 1, 2, 3, 4}; +Plane Surface(201) = {101}; + +// volume +Physical Surface("region_0") = {201}; + +// periodic boundaries +Periodic Line {1} = {-3}; +Periodic Line {2} = {-4}; + +// here's the boundary tag. +Physical Line(106) = {1, 2, 3, 4}; \ No newline at end of file diff --git a/bench/advection/convergence_2d/meshes/lts_base.geo b/bench/advection/convergence_2d/meshes/lts_base.geo new file mode 100644 index 0000000..46130a2 --- /dev/null +++ b/bench/advection/convergence_2d/meshes/lts_base.geo @@ -0,0 +1,88 @@ +/** + * @file This file is part of EDGE. + * + * @author Alexander Breuer (breuer AT mytum.de) + * + * @section LICENSE + * Copyright (c) 2021, Friedrich Schiller University Jena + * Copyright (c) 2019, Alexander Breuer + * 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 + * LTS mesh. + **/ +// define mesh size +size = 10; + +// +// construct the square +// +Point(1) = { 0, 0, 0, cl }; +Point(2) = { size, 0, 0, cl }; +Point(3) = { size, size, 0, cl }; +Point(4) = { 0, size, 0, cl }; + +Line(1) = {1, 2}; +Line(2) = {2, 3}; +Line(3) = {3, 4}; +Line(4) = {4, 1}; + +Line Loop(101) = { 1, 2, 3, 4}; +Plane Surface(201) = {101}; + +// volume +Physical Surface("region_0") = {201}; + +// add mesh refinement to trigger LTS +Field[1] = Box; +Field[1].VIn = cl/4; +Field[1].VOut = cl; +Field[1].XMin = 6.0; +Field[1].XMax = 7.0; +Field[1].YMin = 6.5; +Field[1].YMax = 8.0; +Field[1].ZMin = 0; +Field[1].ZMax = 0; + +Point(101) = {4.0, 1.0, 0}; +Field[2] = Attractor; +Field[2].NodesList = {101}; + +Field[3] = Threshold; +Field[3].IField = 2; +Field[3].LcMin = cl/8; +Field[3].LcMax = cl; +Field[3].DistMin = 0.2; +Field[3].DistMax = 1.0; + +Field[4] = Box; +Field[4].VIn = cl/3; +Field[4].VOut = cl; +Field[4].XMin = 0; +Field[4].XMax = 2.0; +Field[4].YMin = 8.0; +Field[4].YMax = 9.0; +Field[4].ZMin = 0; +Field[4].ZMax = 0; + +Field[5] = Min; +Field[5].FieldsList = {1,3,4}; + +Background Field = 5; + +// periodic boundaries +Periodic Line {1} = {-3}; +Periodic Line {2} = {-4}; + +// here's the boundary tag. +Physical Line(106) = {1, 2, 3, 4}; \ No newline at end of file diff --git a/bench/advection/convergence_2d/meshes/quad4r.njk b/bench/advection/convergence_2d/meshes/quad4r.njk new file mode 100644 index 0000000..e1afbd1 --- /dev/null +++ b/bench/advection/convergence_2d/meshes/quad4r.njk @@ -0,0 +1,27 @@ +/** + * @file This file is part of EDGE. + * + * @author Alexander Breuer (anbreuer AT ucsd.edu) + * + * @section LICENSE + * Copyright (c) 2021, Friedrich Schiller University Jena + * 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 a quad4r-mesh. + **/ +Mesh.Algorithm = 8; +cl={{i_cl}}; +Include "{{i_meshBase}}"; +Transfinite Surface {201}; +Recombine Surface {201}; \ No newline at end of file diff --git a/bench/advection/convergence_2d/meshes/tria3.njk b/bench/advection/convergence_2d/meshes/tria3.njk new file mode 100644 index 0000000..f9ac674 --- /dev/null +++ b/bench/advection/convergence_2d/meshes/tria3.njk @@ -0,0 +1,24 @@ +/** + * @file This file is part of EDGE. + * + * @author Alexander Breuer (anbreuer AT ucsd.edu) + * + * @section LICENSE + * Copyright (c) 2021, Friedrich Schiller University Jena + * 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 a tria3-mesh. + **/ +cl={{i_cl}}; +Include "{{i_meshBase}}"; \ No newline at end of file diff --git a/bench/advection/convergence_2d/runs/configs b/bench/advection/convergence_2d/runs/configs new file mode 120000 index 0000000..271eaab --- /dev/null +++ b/bench/advection/convergence_2d/runs/configs @@ -0,0 +1 @@ +../configs \ No newline at end of file diff --git a/bench/advection/convergence_2d/runs/meshes b/bench/advection/convergence_2d/runs/meshes new file mode 120000 index 0000000..4b19886 --- /dev/null +++ b/bench/advection/convergence_2d/runs/meshes @@ -0,0 +1 @@ +../meshes \ No newline at end of file diff --git a/bench/advection/convergence_2d/runs/run_all.sh b/bench/advection/convergence_2d/runs/run_all.sh new file mode 100755 index 0000000..32d60c2 --- /dev/null +++ b/bench/advection/convergence_2d/runs/run_all.sh @@ -0,0 +1,99 @@ +#!/bin/bash +## +# @file This file is part of EDGE. +# +# @author Alexander Breuer (alex.breuer AT uni-jena.de) +# +# @section LICENSE +# Copyright (c) 2021, Friedrich Schiller University Jena +# 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 +# Runs all 2D convergence settings for the advection equation. +## + +help() { +cat << EOF +Usage: ${0##*/} [-h] [-t ELEMENT_TYPE -e EDGE_PATH] +Runs all 2D convergence settings for the advection equation. + -h This help message. + -t element type either tria3 order quad4r + -e EDGE_PATH path to the EDGE-executable. +EOF +} + +while getopts "ht:e:" opt; do + case "$opt" in + h) + help + exit 0 + ;; + t) + ELEMENT_TYPE=$OPTARG + ;; + e) + EDGE_PATH=$OPTARG + ;; + '?') + help >&2 + exit 1 + ;; + esac +done +shift "$((OPTIND-1))" + +if [[ ${ELEMENT_TYPE} != "tria3" && ${ELEMENT_TYPE} != "quad4r" ]] +then + echo "Only quad4r and tria3 allowed as element type: ${ELEMENT_TYPE}" + help >&2 + exit 1 +fi + +if [[ ${EDGE_PATH:0:1} != "/" ]] +then + echo "Error patch is required or not absolute: ${EDGE_PATH}" + help >&2 + exit 1 +fi + +mkdir logs +mkdir errors + +for l_cl in 2 1.25 1 0.625 0.5 0.4 0.3125 0.25 0.2 0.1 +do + for l_ts in gts lts + do + if [[ ${ELEMENT_TYPE} == 'quad4r' && ${l_ts} == 'lts' ]] + then + continue + fi + + for l_pa in 1 8 + do + if [[ ${l_pa} == 1 ]] + then + echo "$(date) running EDGE for ${ELEMENT_TYPE}, ${l_ts}, char length ${l_cl} and for nParts ${l_pa}" + ${EDGE_PATH} -x configs/gen/${ELEMENT_TYPE}_${l_ts}_cl_${l_cl}_pa_${l_pa}.xml 2>&1 > logs/edge_${ELEMENT_TYPE}_${l_ts}_cl_${l_cl}_pa_${l_pa}.log + else + echo "$(date) running EDGE for ${ELEMENT_TYPE}, ${l_ts}, char length ${l_cl} and for nParts ${l_pa}" + mpiexec --oversubscribe -n ${l_pa} ${EDGE_PATH} -x configs/gen/${ELEMENT_TYPE}_${l_ts}_cl_${l_cl}_pa_${l_pa}.xml 2>&1 > logs/edge_${ELEMENT_TYPE}_${l_ts}_cl_${l_cl}_pa_${l_pa}.log + + if [[ ${l_ts} == 'gts' ]] + then + echo "$(date) running EDGE for ${ELEMENT_TYPE}, ${l_ts}, char length ${l_cl} and for nParts ${l_pa} (reorder only)" + ${EDGE_PATH} -x configs/gen/${ELEMENT_TYPE}_${l_ts}_cl_${l_cl}_pa_${l_pa}_reorder_only.xml 2>&1 > logs/edge_${ELEMENT_TYPE}_${l_ts}_cl_${l_cl}_pa_${l_pa}_reorder_only.log + fi + fi + done + done +done -- GitLab