From 3fb76fd9416d753fb13b7a87cf99f1f1289a0e80 Mon Sep 17 00:00:00 2001 From: Damyn Chipman Date: Fri, 26 Jan 2024 09:31:31 -0700 Subject: [PATCH 1/6] Adding triple point files. --- applications/clawpack/clawpack.cmake | 2 +- .../clawpack/euler/2d/triple/CMakeLists.txt | 44 +++ .../clawpack/euler/2d/triple/Makefile.am | 51 ++++ .../euler/2d/triple/fclaw_options.ini | 118 ++++++++ applications/clawpack/euler/2d/triple/fdisc.f | 70 +++++ .../clawpack/euler/2d/triple/setprob.data | 7 + .../clawpack/euler/2d/triple/setprob.f | 65 +++++ .../clawpack/euler/2d/triple/triple.cpp | 159 +++++++++++ .../clawpack/euler/2d/triple/triple_options.c | 128 +++++++++ .../clawpack/euler/2d/triple/triple_user.cpp | 121 ++++++++ .../clawpack/euler/2d/triple/triple_user.h | 71 +++++ .../clawpack/euler/2d/triple/user_4.6/bc2.f | 264 ++++++++++++++++++ .../clawpack/euler/2d/triple/user_4.6/qinit.f | 145 ++++++++++ .../euler/2d/triple/user_4.6/setaux.f | 20 ++ .../clawpack/euler/2d/triple/user_4.6/src2.f | 59 ++++ .../clawpack/euler/2d/triple/user_5.0/bc2.f90 | 233 ++++++++++++++++ .../euler/2d/triple/user_5.0/qinit.f90 | 53 ++++ .../euler/2d/triple/user_5.0/setaux.f90 | 20 ++ .../euler/2d/triple/user_5.0/src2.f90 | 55 ++++ .../2d/triple/user_5.0/tag4coarsening.f90 | 50 ++++ .../2d/triple/user_5.0/tag4refinement.f90 | 36 +++ 21 files changed, 1770 insertions(+), 1 deletion(-) create mode 100644 applications/clawpack/euler/2d/triple/CMakeLists.txt create mode 100644 applications/clawpack/euler/2d/triple/Makefile.am create mode 100644 applications/clawpack/euler/2d/triple/fclaw_options.ini create mode 100644 applications/clawpack/euler/2d/triple/fdisc.f create mode 100644 applications/clawpack/euler/2d/triple/setprob.data create mode 100644 applications/clawpack/euler/2d/triple/setprob.f create mode 100644 applications/clawpack/euler/2d/triple/triple.cpp create mode 100644 applications/clawpack/euler/2d/triple/triple_options.c create mode 100644 applications/clawpack/euler/2d/triple/triple_user.cpp create mode 100644 applications/clawpack/euler/2d/triple/triple_user.h create mode 100644 applications/clawpack/euler/2d/triple/user_4.6/bc2.f create mode 100644 applications/clawpack/euler/2d/triple/user_4.6/qinit.f create mode 100644 applications/clawpack/euler/2d/triple/user_4.6/setaux.f create mode 100644 applications/clawpack/euler/2d/triple/user_4.6/src2.f create mode 100644 applications/clawpack/euler/2d/triple/user_5.0/bc2.f90 create mode 100644 applications/clawpack/euler/2d/triple/user_5.0/qinit.f90 create mode 100644 applications/clawpack/euler/2d/triple/user_5.0/setaux.f90 create mode 100644 applications/clawpack/euler/2d/triple/user_5.0/src2.f90 create mode 100644 applications/clawpack/euler/2d/triple/user_5.0/tag4coarsening.f90 create mode 100644 applications/clawpack/euler/2d/triple/user_5.0/tag4refinement.f90 diff --git a/applications/clawpack/clawpack.cmake b/applications/clawpack/clawpack.cmake index 6bcf9add8..935aab388 100644 --- a/applications/clawpack/clawpack.cmake +++ b/applications/clawpack/clawpack.cmake @@ -104,7 +104,7 @@ add_subdirectory(clawpack/shallow/2d/bump) ## Euler add_subdirectory(clawpack/euler/2d/shockbubble) add_subdirectory(clawpack/euler/2d/quadrants) - +add_subdirectory(clawpack/euler/2d/triple) ## --------------------- Miscellaneous ---------------------------- ## Example : Don't using the 'app' for configuring options; diff --git a/applications/clawpack/euler/2d/triple/CMakeLists.txt b/applications/clawpack/euler/2d/triple/CMakeLists.txt new file mode 100644 index 000000000..0931c6a7b --- /dev/null +++ b/applications/clawpack/euler/2d/triple/CMakeLists.txt @@ -0,0 +1,44 @@ +set(rp ${PROJECT_SOURCE_DIR}/clawpack/euler/2d/rp) + +add_library(triple_f OBJECT + fdisc.f + setprob.f + user_4.6/qinit.f + user_4.6/setaux.f + user_4.6/bc2.f + user_4.6/src2.f + user_5.0/qinit.f90 + user_5.0/setaux.f90 + user_5.0/bc2.f90 + user_5.0/src2.f90 + ${rp}/clawpack46_rpn2_euler4.f + ${rp}/clawpack46_rpt2_euler4.f + ${rp}/clawpack46_rpn2_euler5.f + ${rp}/clawpack46_rpt2_euler5.f + ${rp}/clawpack5_rpn2_euler4.f90 + ${rp}/clawpack5_rpt2_euler4.f90 + ${rp}/clawpack5_rpn2_euler5.f90 + ${rp}/clawpack5_rpt2_euler5.f90 +) + +add_executable(triple + triple.cpp + triple_options.c + triple_user.cpp + $ +) + +target_include_directories(triple PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ${rp} +) + +target_link_libraries(triple PRIVATE + FORESTCLAW::CLAWPACK4.6 + FORESTCLAW::CLAWPACK5 +) + +add_test(NAME clawpack_euler_2d_triple COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/regressions.sh WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) +set_tests_properties(clawpack_euler_2d_triple PROPERTIES ENVIRONMENT "${FCLAW_TEST_ENVIRONMENT}") + +configure_file(fclaw_options.ini fclaw_options.ini COPYONLY) \ No newline at end of file diff --git a/applications/clawpack/euler/2d/triple/Makefile.am b/applications/clawpack/euler/2d/triple/Makefile.am new file mode 100644 index 000000000..b1e30f471 --- /dev/null +++ b/applications/clawpack/euler/2d/triple/Makefile.am @@ -0,0 +1,51 @@ +## Makefile.am in applications/clawpack/euler/2d/shockbubble + +bin_PROGRAMS += applications/clawpack/euler/2d/shockbubble/shockbubble + +TESTS += applications/clawpack/euler/2d/shockbubble/regressions.sh + +applications_clawpack_euler_2d_shockbubble_shockbubble_SOURCES = \ + applications/clawpack/euler/2d/shockbubble/shockbubble.cpp \ + applications/clawpack/euler/2d/shockbubble/shockbubble_options.c \ + applications/clawpack/euler/2d/shockbubble/shockbubble_user.cpp \ + applications/clawpack/euler/2d/shockbubble/shockbubble_user.h \ + applications/clawpack/euler/2d/shockbubble/fdisc.f \ + applications/clawpack/euler/2d/shockbubble/setprob.f \ + applications/clawpack/euler/2d/shockbubble/user_4.6/qinit.f \ + applications/clawpack/euler/2d/shockbubble/user_4.6/setaux.f \ + applications/clawpack/euler/2d/shockbubble/user_4.6/bc2.f \ + applications/clawpack/euler/2d/shockbubble/user_4.6/src2.f \ + applications/clawpack/euler/2d/shockbubble/user_5.0/qinit.f90 \ + applications/clawpack/euler/2d/shockbubble/user_5.0/setaux.f90 \ + applications/clawpack/euler/2d/shockbubble/user_5.0/bc2.f90 \ + applications/clawpack/euler/2d/shockbubble/user_5.0/src2.f90 \ + applications/clawpack/euler/2d/rp/euler_user_fort.h \ + applications/clawpack/euler/2d/rp/clawpack46_rpn2_euler4.f \ + applications/clawpack/euler/2d/rp/clawpack46_rpt2_euler4.f \ + applications/clawpack/euler/2d/rp/clawpack46_rpn2_euler5.f \ + applications/clawpack/euler/2d/rp/clawpack46_rpt2_euler5.f \ + applications/clawpack/euler/2d/rp/clawpack5_rpn2_euler4.f90 \ + applications/clawpack/euler/2d/rp/clawpack5_rpt2_euler4.f90 \ + applications/clawpack/euler/2d/rp/clawpack5_rpn2_euler5.f90 \ + applications/clawpack/euler/2d/rp/clawpack5_rpt2_euler5.f90 + +EXTRA_DIST += \ + applications/clawpack/euler/2d/shockbubble/fclaw_options.ini \ + applications/clawpack/euler/2d/shockbubble/regression.ini \ + applications/clawpack/euler/2d/shockbubble/afterframe.m \ + applications/clawpack/euler/2d/shockbubble/setplot2.m + +applications_clawpack_euler_2d_shockbubble_shockbubble_CPPFLAGS = \ + $(AM_CPPFLAGS) \ + $(FCLAW_CLAWPACK46_CPPFLAGS) \ + $(FCLAW_CLAWPACK5_CPPFLAGS) \ + $(FCLAW_CLAWPATCH_CPPFLAGS) + +applications_clawpack_euler_2d_shockbubble_shockbubble_LDADD = \ + $(LDADD) \ + $(FCLAW_CLAWPACK46_LDADD) \ + $(FCLAW_CLAWPACK5_LDADD) \ + $(FCLAW_CLAWPATCH_LDADD) \ + $(FCLAW_LDADD) + + diff --git a/applications/clawpack/euler/2d/triple/fclaw_options.ini b/applications/clawpack/euler/2d/triple/fclaw_options.ini new file mode 100644 index 000000000..9040d8fa5 --- /dev/null +++ b/applications/clawpack/euler/2d/triple/fclaw_options.ini @@ -0,0 +1,118 @@ +[user] + gamma = 1.5 + + x0 = 0.5 + y0 = 0.0 + r0 = 0.2 + rhoin = 0.1 + pinf = 5.0 + + claw-version = 4 + +[clawpatch] + # Grid dimensions + mx = 16 + my = 16 + mbc = 2 # Number of ghost cells + maux = 0 + + # Clawpatch tagging criteria + # value : value exceeds threshold + # minmax : qmax-qmin exceeds threshold + # difference : difference (e.g. dqx = q(i+1,j)-q(i-1,j)) exceeds threshold + # gradient : gradient exceeds threshold + # user : User defined criteria + refinement-criteria = difference + + + meqn = 5 # Number of equations + + +[Options] + +# Regridding information + minlevel = 0 # Minimum level + maxlevel = 5 # Maximum levels of refinement + regrid_interval = 1 # Regrid every 'regrid_interval' time steps. + refine_threshold = 0.5 + coarsen_threshold = 0.25 + smooth-refine = T + smooth-level = 0 + coarsen-delay = 0 + +# Time stepping + tfinal = 5 # Since we are not scaling the results + initial_dt = 0.01 # Initial time step for 'minlevel' + + use_fixed_dt = F # Take a fixed time step + max_cfl = 1.0 + desired_cfl = 0.9 + + outstyle = 1 # OutputStyle = 1,2,3 (see below, e.g. [OutputStyle_1] + nout = 50 # Used for all three out styles + nstep = 30 # Only used if outstyle is 3 + + subcycle = T # subcycle in time ( = T or F). + advance-one-step = F + outstyle-uses-maxlevel = T + +# File and console IO + verbosity = production # verbosity + output = T # + run-user-diagnostics = F + conservation-check = F + report-timing = T + report-timing-verbosity=summary + + # ----------- + # Tikz output + # ----------- + tikz-out = F + tikz-figsize = 4 1 # Each block is 1 in x 1 in ; Final figure is 4 in x 1 in + tikz-plot-fig = T # Set to true if you have figure 'plot_0000.png' available. + tikz-plot-prefix = 'plot' + tikz-plot-suffix = 'png' + + +# Debugging and diagnostics + trapfpe = F + mpi_debug = F + +# Mapping and topology + manifold = F # Manifold + + mi = 7 + mj = 3 + + ax = 0 + bx = 7 + ay = -1.5 + by = 1.5 + +[clawpack46] + order = 2 2 # normal and transverse order + mcapa = 0 # mcapa + src_term = 0 # src_term + + mwaves = 5 # mwaves + mthlim = 4 4 4 4 1 # mthlim (is a vector in general, with 'mwaves' entries) + mthbc = 3 3 3 3 # mthbc(1) (left edge), etc. + + # output + ascii-out = T + vtk-out = T + + +[clawpack5] + order = 2 2 # normal and transverse order + mcapa = 0 # mcapa + src_term = 1 # src_term + + mwaves = 5 # mwaves + mthlim = 4 4 4 4 1 # mthlim (is a vector in general, with 'mwaves' entries) + mthbc = 3 3 3 3 # mthbc(1) (left edge), etc. + + # output + ascii-out = T + vtk-out = T + diff --git a/applications/clawpack/euler/2d/triple/fdisc.f b/applications/clawpack/euler/2d/triple/fdisc.f new file mode 100644 index 000000000..8acfed06f --- /dev/null +++ b/applications/clawpack/euler/2d/triple/fdisc.f @@ -0,0 +1,70 @@ +c +c +c +c ================================================= + double precision function fdisc(blockno,xc,yc) +c ================================================= + implicit none + + double precision xc,yc + integer blockno + + double precision x0, y0, alf, beta, r0 + integer idisc + common/cdisc/ x0,y0,alf,beta,r0,idisc + + + double precision x, y, f1,f2 + +c +c # for computing cell averages for initial data that has a +c # discontinuity along some curve. fdisc should be negative to the +c # left of the curve and positive to the right +c # idisc specifies the nature of the discontinuity for two +c # particular cases (a straight line and circle) but this routine +c # can be modified for any other curve. +c + + x = xc + y = yc + + go to (10,20,30,40) idisc +c + 10 continue +c # straight line through (x0,y0) with normal (alf,beta) pointing +c # into right state +c + fdisc = (x-x0)*alf + (y-y0)*beta + return +c + 20 continue +c # circle of radius r0: + fdisc = (x-x0)**2 + (y-y0)**2 - r0**2 + return + + 30 continue + f1 = (x-x0)**2 + (y-y0+0.5d0)**2 - r0**2 + f2 = (x-x0)**2 + (y-y0-0.5d0)**2 - r0**2 + if (f1 .lt. 0) then + fdisc = f1 + elseif (f2 .lt. 0) then + fdisc = f2 + else + fdisc = min(f1,f2) + endif + return + + 40 continue + f1 = (x-x0)**2 + (y-y0+0.5d0)**2 - (r0/sqrt(2.d0))**2 + f2 = (x-x0)**2 + (y-y0-0.5d0)**2 - (r0/sqrt(2.d0))**2 + if (f1 .lt. 0) then + fdisc = f1 + elseif (f2 .lt. 0) then + fdisc = f2 + else + fdisc = min(f1,f2) + endif + + + return + end diff --git a/applications/clawpack/euler/2d/triple/setprob.data b/applications/clawpack/euler/2d/triple/setprob.data new file mode 100644 index 000000000..3d8629791 --- /dev/null +++ b/applications/clawpack/euler/2d/triple/setprob.data @@ -0,0 +1,7 @@ +2 % idisc +1.3999999999999999 % gamma +0.5000000000000000 % x0 +0.0000000000000000 % y0 +0.2000000000000000 % r0 +0.1000000000000000 % rhoin +5.0000000000000000 % pinf diff --git a/applications/clawpack/euler/2d/triple/setprob.f b/applications/clawpack/euler/2d/triple/setprob.f new file mode 100644 index 000000000..bd6882c0b --- /dev/null +++ b/applications/clawpack/euler/2d/triple/setprob.f @@ -0,0 +1,65 @@ + subroutine setprob() + + implicit none + + double precision qin(5), qout(5) + common /comic/ qin,qout + + double precision gamma, gamma1 + common /cparam/ gamma,gamma1 + + double precision x0, y0, alf, beta, r0 + integer idisc + common/cdisc/ x0,y0,alf,beta,r0,idisc + + double precision rinf, vinf, einf + common /cominf/ rinf,vinf,einf + + double precision rhoin, rhoout, pout, pin, pinf + + + open(10,file='setprob.data') + +c # set idisc for cellave routines (see function fdisc) + read(10,*) idisc +c + +c # These should be read in as options + read(10,*) gamma + gamma1 = gamma - 1.d0 + + read(10,*) x0 + read(10,*) y0 + read(10,*) r0 + read(10,*) rhoin + read(10,*) pinf + close(10) + + +c # density outside bubble and pressure ahead of shock are fixed: + rhoout = 1.d0 + pout = 1.d0 + pin = 1.d0 + + qin(1) = rhoin + qin(2) = 0.d0 + qin(3) = 0.d0 + qin(4) = pin/gamma1 + qin(5) = 1.d0 + + qout(1) = rhoout + qout(2) = 0.d0 + qout(3) = 0.d0 + qout(4) = pout/gamma1 + qout(5) = 0.d0 +c +c # Compute density and velocity behind shock from Hugoniot relations: +c # ------------------------------------------------------------------ + + rinf = ( gamma1 + (gamma+1)*pinf )/( (gamma+1) + gamma1*pinf ) + vinf = (1.0d0/sqrt(gamma)) * (pinf - 1.d0)/ + & sqrt( 0.5d0*((gamma+1)/gamma) * pinf + 0.5d0*gamma1/gamma ) + einf = 0.5d0*rinf*vinf*vinf + pinf/gamma1 + + return + end diff --git a/applications/clawpack/euler/2d/triple/triple.cpp b/applications/clawpack/euler/2d/triple/triple.cpp new file mode 100644 index 000000000..7e07858f7 --- /dev/null +++ b/applications/clawpack/euler/2d/triple/triple.cpp @@ -0,0 +1,159 @@ +/* +Copyright (c) 2012-2022 Carsten Burstedde, Donna Calhoun, Scott Aiton +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. + * 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. + +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. +*/ + +#include "triple_user.h" + +#include + +#include +#include + +#include +#include + +#include +#include + +static +void create_domain_map (fclaw2d_global_t *glob, + fclaw_options_t *fclaw_opt) +{ + /* Mapped, multi-block domain */ + fclaw2d_domain_t *domain = NULL; + fclaw2d_map_context_t *cont = NULL, *brick = NULL; + + /* Build a rectangle that may have periodic boundaries */ + int mi, mj, a, b; + mi = fclaw_opt->mi; + mj = fclaw_opt->mj; + a = fclaw_opt->periodic_x; + b = fclaw_opt->periodic_y; + + /* Construct and store domain */ + domain = fclaw2d_domain_new_brick (glob->mpicomm, mi, mj, a, b, + fclaw_opt->minlevel); + fclaw2d_domain_list_levels (domain, FCLAW_VERBOSITY_ESSENTIAL); + fclaw2d_domain_list_neighbors (domain, FCLAW_VERBOSITY_DEBUG); + fclaw2d_global_store_domain (glob, domain); + + /* Construct and store map */ + brick = fclaw2d_map_new_brick (domain, mi, mj, a, b); + cont = fclaw2d_map_new_nomap_brick (brick); + fclaw2d_global_store_map (glob, cont); +} + +static +void run_program(fclaw2d_global_t* glob) +{ + const user_options_t *user_opt; + + /* --------------------------------------------------------------- + Set domain data. + --------------------------------------------------------------- */ + fclaw2d_domain_data_new(glob->domain); + + user_opt = triple_get_options(glob); + + /* Initialize virtual table for ForestClaw */ + fclaw2d_vtables_initialize(glob); + + /* Initialize virtual tables for solvers */ + if (user_opt->claw_version == 4) + { + fc2d_clawpack46_solver_initialize(glob); + } + else if (user_opt->claw_version == 5) + { + fc2d_clawpack5_solver_initialize(glob); + } + + triple_link_solvers(glob); + + /* --------------------------------------------------------------- + Run + --------------------------------------------------------------- */ + fclaw2d_initialize(glob); + fclaw2d_run(glob); + fclaw2d_finalize(glob); +} + +int +main (int argc, char **argv) +{ + fclaw_app_t *app; + int first_arg; + fclaw_exit_type_t vexit; + + /* Options */ + sc_options_t *options; + user_options_t *user_opt; + fclaw_options_t *fclaw_opt; + fclaw2d_clawpatch_options_t *clawpatch_opt; + fc2d_clawpack46_options_t *claw46_opt; + fc2d_clawpack5_options_t *claw5_opt; + + int retval; + + /* Initialize application */ + app = fclaw_app_new (&argc, &argv, NULL); + + /* Create new options packages */ + fclaw_opt = fclaw_options_register(app, NULL, "fclaw_options.ini"); + clawpatch_opt = fclaw2d_clawpatch_options_register(app, "clawpatch", "fclaw_options.ini"); + claw46_opt = fc2d_clawpack46_options_register(app, "clawpack46", "fclaw_options.ini"); + claw5_opt = fc2d_clawpack5_options_register(app, "clawpack5", "fclaw_options.ini"); + user_opt = triple_options_register(app, "fclaw_options.ini"); + + /* Read configuration file(s) and command line, and process options */ + options = fclaw_app_get_options (app); + retval = fclaw_options_read_from_file(options); + vexit = fclaw_app_options_parse (app, &first_arg,"fclaw_options.ini.used"); + + if (!retval & !vexit) + { + /* Options have been checked and are valid */ + + int size, rank; + sc_MPI_Comm mpicomm = fclaw_app_get_mpi_size_rank (app, &size, &rank); + fclaw2d_global_t * glob = fclaw2d_global_new_comm (mpicomm, size, rank); + create_domain_map (glob, fclaw_opt); + + /* Store option packages in glob */ + fclaw2d_options_store (glob, fclaw_opt); + fclaw2d_clawpatch_options_store (glob, clawpatch_opt); + fc2d_clawpack46_options_store (glob, claw46_opt); + fc2d_clawpack5_options_store (glob, claw5_opt); + triple_options_store (glob, user_opt); + + /* Run the program */ + run_program(glob); + + fclaw2d_global_destroy(glob); + } + + fclaw_app_destroy (app); + + return 0; +} diff --git a/applications/clawpack/euler/2d/triple/triple_options.c b/applications/clawpack/euler/2d/triple/triple_options.c new file mode 100644 index 000000000..516a9110d --- /dev/null +++ b/applications/clawpack/euler/2d/triple/triple_options.c @@ -0,0 +1,128 @@ +/* +Copyright (c) 2012-2022 Carsten Burstedde, Donna Calhoun, Scott Aiton +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. + * 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. + +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. +*/ + +#include "triple_user.h" + +#include + +static void * +triple_register (user_options_t* user, sc_options_t * opt) +{ + + /* [user] User options */ + sc_options_add_int (opt, 0, "idisc", &user->idisc, 2, "[user] idisc [2]"); + sc_options_add_double (opt, 0, "gamma", &user->gamma, 1.4, "[user] gamma [1.4]"); + + sc_options_add_double (opt, 0, "x0", &user->x0, 0.5, "[user] x0 [0.5]"); + sc_options_add_double (opt, 0, "y0", &user->y0, 0.0, "[user] y0 [0.0]"); + sc_options_add_double (opt, 0, "r0", &user->r0, 0.2, "[user] r0 [0.2]"); + sc_options_add_double (opt, 0, "rhoin", &user->rhoin, 0.1, "[user] rhoin [0.1]"); + sc_options_add_double (opt, 0, "pinf", &user->pinf, 5.0, "[user] pinf [5.0x]"); + + sc_options_add_int (opt, 0, "claw-version", &user->claw_version, 5, + "Clawpack_version (4 or 5) [4]"); + + user->is_registered = 1; + return NULL; +} + +static void +triple_destroy(user_options_t *user) +{ + /* Nothing to destroy */ +} + +/* ------- Generic option handling routines that call above routines ----- */ +static void* +options_register (fclaw_app_t * app, void *package, sc_options_t * opt) +{ + user_options_t *user; + + FCLAW_ASSERT (app != NULL); + FCLAW_ASSERT (package != NULL); + FCLAW_ASSERT (opt != NULL); + + user = (user_options_t*) package; + + return triple_register(user,opt); +} + +static void +options_destroy (fclaw_app_t * app, void *package, void *registered) +{ + user_options_t *user; + + FCLAW_ASSERT (app != NULL); + FCLAW_ASSERT (package != NULL); + FCLAW_ASSERT (registered == NULL); + + user = (user_options_t*) package; + FCLAW_ASSERT (user->is_registered); + + triple_destroy (user); + + FCLAW_FREE (user); +} + + +static const fclaw_app_options_vtable_t options_vtable_user = +{ + options_register, + NULL, + NULL, + options_destroy +}; + +/* ------------- User options access functions --------------------- */ + +user_options_t* triple_options_register (fclaw_app_t * app, + const char *configfile) +{ + user_options_t *user; + FCLAW_ASSERT (app != NULL); + + user = FCLAW_ALLOC (user_options_t, 1); + fclaw_app_options_register (app,"user", configfile, &options_vtable_user, + user); + + fclaw_app_set_attribute(app,"user",user); + return user; +} + +void triple_options_store (fclaw2d_global_t* glob, user_options_t* user) +{ + FCLAW_ASSERT(fclaw_pointer_map_get(glob->options,"user") == NULL); + fclaw_pointer_map_insert(glob->options, "user", user, NULL); +} + +user_options_t* triple_get_options(fclaw2d_global_t* glob) +{ + user_options_t* user = (user_options_t*) + fclaw_pointer_map_get(glob->options, "user"); + FCLAW_ASSERT(user != NULL); + return user; +} + + diff --git a/applications/clawpack/euler/2d/triple/triple_user.cpp b/applications/clawpack/euler/2d/triple/triple_user.cpp new file mode 100644 index 000000000..b4fb44915 --- /dev/null +++ b/applications/clawpack/euler/2d/triple/triple_user.cpp @@ -0,0 +1,121 @@ +/* +Copyright (c) 2012-2022 Carsten Burstedde, Donna Calhoun, Scott Aiton +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. + * 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. + +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. +*/ + +#include "triple_user.h" + +#include + +#include + +#include +#include + +#include +#include + +#include "../rp/euler_user_fort.h" + + +void triple_problem_setup(fclaw2d_global_t* glob) +{ + const user_options_t* user = triple_get_options(glob); + + if (glob->mpirank == 0) + { + FILE *f = fopen("setprob.data","w"); + fprintf(f, "%-24d %s", user->idisc,"\% idisc\n"); + fprintf(f, "%-24.16f %s", user->gamma,"\% gamma\n"); + fprintf(f, "%-24.16f %s",user->x0,"\% x0\n"); + fprintf(f, "%-24.16f %s",user->y0,"\% y0\n"); + fprintf(f, "%-24.16f %s",user->r0,"\% r0\n"); + fprintf(f, "%-24.16f %s",user->rhoin,"\% rhoin\n"); + fprintf(f, "%-24.16f %s",user->pinf,"\% pinf\n"); + fclose(f); + } + + /* We want to make sure node 0 gets here before proceeding */ + fclaw2d_domain_barrier (glob->domain); /* redundant? */ + SETPROB(); +} + +void triple_link_solvers(fclaw2d_global_t *glob) +{ + const user_options_t* user = triple_get_options(glob); + fclaw2d_vtable_t *fclaw_vt = fclaw2d_vt(glob); + + fclaw_vt->problem_setup = &triple_problem_setup; + + if (user->claw_version == 4) + { + fc2d_clawpack46_vtable_t *claw46_vt = fc2d_clawpack46_vt(glob); + fc2d_clawpack46_options_t *clawopt = fc2d_clawpack46_get_options(glob); + + claw46_vt->fort_qinit = &CLAWPACK46_QINIT; + claw46_vt->fort_setaux = &CLAWPACK46_SETAUX; + claw46_vt->fort_bc2 = &CLAWPACK46_BC2; /* Special BCs at left edge */ + claw46_vt->fort_src2 = &CLAWPACK46_SRC2; /* To simulate axis-symmetric */ + + switch (clawopt->mwaves) + { + case 4: + /* Requires meqn=4 */ + claw46_vt->fort_rpn2 = &CLAWPACK46_RPN2_EULER4; /* No tracer */ + claw46_vt->fort_rpt2 = &CLAWPACK46_RPT2_EULER4; + break; + case 5: + /* Requires meqn=5 */ + claw46_vt->fort_rpn2 = &CLAWPACK46_RPN2_EULER5; /* Includes a tracer */ + claw46_vt->fort_rpt2 = &CLAWPACK46_RPT2_EULER5; + break; + default: + SC_ABORT_NOT_REACHED (); + } + } + else if (user->claw_version == 5) + { + fc2d_clawpack5_vtable_t *claw5_vt = fc2d_clawpack5_vt(glob); + fc2d_clawpack5_options_t *clawopt = fc2d_clawpack5_get_options(glob); + + claw5_vt->fort_qinit = &CLAWPACK5_QINIT; + claw5_vt->fort_setaux = &CLAWPACK5_SETAUX; + claw5_vt->fort_bc2 = &CLAWPACK5_BC2; /* Special BCs at left edge */ + claw5_vt->fort_src2 = &CLAWPACK5_SRC2; /* To simulate axis-symmetric */ + switch (clawopt->mwaves) + { + case 4: + /* Requires meqn=4 */ + claw5_vt->fort_rpn2 = &CLAWPACK5_RPN2_EULER4; /* no tracer */ + claw5_vt->fort_rpt2 = &CLAWPACK5_RPT2_EULER4; + break; + case 5: + /* Requires meqn=5 */ + claw5_vt->fort_rpn2 = &CLAWPACK5_RPN2_EULER5; /* Includes a tracer */ + claw5_vt->fort_rpt2 = &CLAWPACK5_RPT2_EULER5; + break; + default: + SC_ABORT_NOT_REACHED (); + } + } +} \ No newline at end of file diff --git a/applications/clawpack/euler/2d/triple/triple_user.h b/applications/clawpack/euler/2d/triple/triple_user.h new file mode 100644 index 000000000..30e0816a1 --- /dev/null +++ b/applications/clawpack/euler/2d/triple/triple_user.h @@ -0,0 +1,71 @@ +/* + Copyright (c) 2012-2021 Carsten Burstedde, Donna Calhoun + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * 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. + + 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. +*/ + +#ifndef TRIPLE_USER_HPP +#define TRIPLE_USER_HPP + +#include + +#ifdef __cplusplus +extern "C" +{ +#if 0 +} +#endif +#endif + +typedef struct user_options +{ + int idisc; + double gamma; + double x0; + double y0; + double r0; + double rhoin; + double pinf; + + int claw_version; + + int is_registered; +} user_options_t; + + +void triple_link_solvers(fclaw2d_global_t *glob); + +user_options_t* triple_options_register (fclaw_app_t * app, + const char *configfile); + +void triple_options_store (fclaw2d_global_t* glob, user_options_t* user); + +user_options_t* triple_get_options(fclaw2d_global_t* glob); + +#ifdef __cplusplus +#if 0 +{ +#endif +} +#endif + +#endif diff --git a/applications/clawpack/euler/2d/triple/user_4.6/bc2.f b/applications/clawpack/euler/2d/triple/user_4.6/bc2.f new file mode 100644 index 000000000..dadd11e0c --- /dev/null +++ b/applications/clawpack/euler/2d/triple/user_4.6/bc2.f @@ -0,0 +1,264 @@ + subroutine clawpack46_bc2(maxmx,maxmy,meqn,mbc, + & mx,my,xlower,ylower, + & dx,dy,q,maux,aux,t,dt,mthbc) +c ===================================================== +c +c # Standard boundary condition choices for claw2 +c +c # Modified for shock-bubble problem to impose inflow at left edge +c # Values of inflow density,velocity,energy must be set in setprob.f +c # and passed in the common block /cominf/ rinf,vinf,einf +c +c # At each boundary k = 1 (left), 2 (right), 3 (top), 4 (bottom): +c # mthbc(k) = 0 for user-supplied BC's (must be inserted!) +c # = 1 for zero-order extrapolation +c # = 2 for periodic boundary coniditions +c # = 3 for solid walls, assuming this can be implemented +c # by reflecting the data about the boundary and then +c # negating the 2'nd (for k=1,2) or 3'rd (for k=3,4) +c # component of q. +c ------------------------------------------------ +c +c # Extend the data from the interior cells (1:mx, 1:my) +c # to the ghost cells outside the region: +c # (i, 1-jbc) for jbc = 1,mbc, i = 1-mbc, mx+mbc +c # (i, my+jbc) for jbc = 1,mbc, i = 1-mbc, mx+mbc +c # (1-ibc, j) for ibc = 1,mbc, j = 1-mbc, my+mbc +c # (mx+ibc, j) for ibc = 1,mbc, j = 1-mbc, my+mbc +c + implicit none + + integer maxmx, maxmy, meqn, mbc, mx,my,maux + double precision xlower, ylower, dx, dy, t, dt + double precision q(1-mbc:maxmx+mbc, 1-mbc:maxmy+mbc, meqn) + double precision aux(1-mbc:maxmx+mbc, 1-mbc:maxmy+mbc, *) + integer mthbc(4) + + double precision rinf, vinf, einf + common /cominf/ rinf,vinf,einf + + integer ibc, jbc, i, j, m + +c +c +c------------------------------------------------------- +c # left boundary: +c------------------------------------------------------- + go to (100,110,120,130) mthbc(1)+1 + + goto 199 +c + 100 continue +c # user-specified boundary conditions go here in place of error output + do ibc=1,mbc + do j=1-mbc,my+mbc + q(1-ibc,j,1) = rinf + q(1-ibc,j,2) = rinf*vinf + q(1-ibc,j,3) = 0.d0 + q(1-ibc,j,4) = einf + end do + end do + go to 199 +c + 110 continue +c # zero-order extrapolation: + do m=1,meqn + do ibc=1,mbc + do j = 1-mbc, my+mbc + q(1-ibc,j,m) = q(1,j,m) + end do + end do + end do + go to 199 + + 120 continue +c # periodic: + do m=1,meqn + do ibc=1,mbc + do j = 1-mbc, my+mbc + q(1-ibc,j,m) = q(mx+1-ibc,j,m) + end do + end do + end do + go to 199 + + 130 continue +c # solid wall (assumes 2'nd component is velocity or momentum in x): + do m=1,meqn + do ibc=1,mbc + do j = 1-mbc, my+mbc + q(1-ibc,j,m) = q(ibc,j,m) + end do + end do + end do +c # negate the normal velocity: + do ibc=1,mbc + do j = 1-mbc, my+mbc + q(1-ibc,j,2) = -q(ibc,j,2) + end do + end do + go to 199 + + 199 continue +c +c------------------------------------------------------- +c # right boundary: +c------------------------------------------------------- + go to (200,210,220,230) mthbc(2)+1 + goto 299 +c + 200 continue +c # user-specified boundary conditions go here in place of error output + write(6,*) '*** ERROR *** mthbc(2)=0 and no BCs specified in bc2' + stop + go to 299 + + 210 continue +c # zero-order extrapolation: + do m=1,meqn + do ibc=1,mbc + do j = 1-mbc, my+mbc + q(mx+ibc,j,m) = q(mx,j,m) + end do + end do + end do + go to 299 + + 220 continue +c # periodic: + do m=1,meqn + do ibc=1,mbc + do j = 1-mbc, my+mbc + q(mx+ibc,j,m) = q(ibc,j,m) + end do + end do + end do + go to 299 + + 230 continue +c # solid wall (assumes 2'nd component is velocity or momentum in x): + do m=1,meqn + do ibc=1,mbc + do j = 1-mbc, my+mbc + q(mx+ibc,j,m) = q(mx+1-ibc,j,m) + end do + end do + end do +c # negate the normal velocity: + do ibc=1,mbc + do j = 1-mbc, my+mbc + q(mx+ibc,j,2) = -q(mx+1-ibc,j,2) + end do + end do + go to 299 + + 299 continue +c +c------------------------------------------------------- +c # bottom boundary: +c------------------------------------------------------- + go to (300,310,320,330) mthbc(3)+1 + goto 399 +c + 300 continue +c # user-specified boundary conditions go here in place of error output + write(6,*) '*** ERROR *** mthbc(3)=0 and no BCs specified in bc2' + stop + go to 399 +c + 310 continue +c # zero-order extrapolation: + do m=1,meqn + do jbc=1,mbc + do i = 1-mbc, mx+mbc + q(i,1-jbc,m) = q(i,1,m) + end do + end do + end do + go to 399 + + 320 continue +c # periodic: + do m=1,meqn + do jbc=1,mbc + do i = 1-mbc, mx+mbc + q(i,1-jbc,m) = q(i,my+1-jbc,m) + end do + end do + end do + go to 399 + + 330 continue +c # solid wall (assumes 3'rd component is velocity or momentum in y): + do m=1,meqn + do jbc=1,mbc + do i = 1-mbc, mx+mbc + q(i,1-jbc,m) = q(i,jbc,m) + end do + end do + end do +c # negate the normal velocity: + do jbc=1,mbc + do i = 1-mbc, mx+mbc + q(i,1-jbc,3) = -q(i,jbc,3) + end do + end do + go to 399 + + 399 continue +c +c------------------------------------------------------- +c # top boundary: +c------------------------------------------------------- + goto (400,410,420,430) mthbc(4)+1 + goto 499 +c + 400 continue +c # user-specified boundary conditions go here in place of error output + write(6,*) '*** ERROR *** mthbc(4)=0 and no BCs specified in bc2' + stop + go to 499 + + 410 continue +c # zero-order extrapolation: + do m=1,meqn + do jbc=1,mbc + do i = 1-mbc, mx+mbc + q(i,my+jbc,m) = q(i,my,m) + end do + end do + end do + go to 499 + + 420 continue +c # periodic: + do m=1,meqn + do jbc=1,mbc + do i = 1-mbc, mx+mbc + q(i,my+jbc,m) = q(i,jbc,m) + end do + end do + end do + go to 499 + + 430 continue +c # solid wall (assumes 3'rd component is velocity or momentum in y): + do m=1,meqn + do jbc=1,mbc + do i = 1-mbc, mx+mbc + q(i,my+jbc,m) = q(i,my+1-jbc,m) + end do + end do + end do +c # negate the normal velocity: + do jbc=1,mbc + do i = 1-mbc, mx+mbc + q(i,my+jbc,3) = -q(i,my+1-jbc,3) + end do + end do + go to 499 + + 499 continue + + return + end diff --git a/applications/clawpack/euler/2d/triple/user_4.6/qinit.f b/applications/clawpack/euler/2d/triple/user_4.6/qinit.f new file mode 100644 index 000000000..beeb60f78 --- /dev/null +++ b/applications/clawpack/euler/2d/triple/user_4.6/qinit.f @@ -0,0 +1,145 @@ + subroutine clawpack46_qinit(maxmx,maxmy,meqn,mbc, + & mx,my,xlower,ylower,dx,dy,q,maux,aux) +c ===================================================== +c +c # Set initial conditions for q. +c + implicit double precision (a-h,o-z) + dimension q(1-mbc:maxmx+mbc, 1-mbc:maxmy+mbc, meqn) + + integer i, j, blockno, fc2d_clawpack46_get_block + double precision xi, yj, win, qin(5), qout(5) + double precision r1_xlower, r1_xupper + double precision r1_ylower, r1_yupper + double precision r2_xlower, r2_xupper + double precision r2_ylower, r2_yupper + double precision r3_xlower, r3_xupper + double precision r3_ylower, r3_yupper + + common /comic/ qin, qout + common /cparam/ gamma, gamma1 + + blockno = fc2d_clawpack46_get_block() + + ! Region 1 Boundaries + r1_xlower = 0 + r1_xupper = 1 + r1_ylower = -1.5 + r1_yupper = 1.5 + + ! Region 2 Boundaries + r2_xlower = 1 + r2_xupper = 7 + r2_ylower = 0 + r2_yupper = 1.5 + + ! Region 3 Boundaries + r3_xlower = 1 + r3_xupper = 7 + r3_ylower = -1.5 + r3_yupper = 0 + + do i = 1-mbc,mx+mbc + xi = xlower + (i - 0.5d0)*dx + do j = 1-mbc,my+mbc + yj = ylower + (j - 0.5d0)*dy + + call cellave2(blockno, xi, yj, dx, dy, win) + do m = 1,meqn + q(i,j,m) = win*qin(m) + (1.0d0 - win)*qout(m) + enddo + + ! Region 1 + if (xi .gt. r1_xlower .and. xi .lt. r1_xupper) then + if (yj .gt. r1_ylower .and. yj .lt. r1_yupper) then + q(i,j,1) = 1.0d0 ! Density + q(i,j,2) = 0.0d0 ! x-momentum + q(i,j,3) = 0.0d0 ! y-momentum + q(i,j,4) = 1.0d0 / gamma ! Energy + if (meqn .eq. 5) then + q(i,j,5) = 1.0d0 ! Tracer + endif + endif + endif + + ! Region 2 + if (xi .gt. r2_xlower .and. xi .lt. r2_xupper) then + if (yj .gt. r2_ylower .and. yj .lt. r2_yupper) then + q(i,j,1) = 0.125d0 ! Density + q(i,j,2) = 0.0d0 ! x-momentum + q(i,j,3) = 0.0d0 ! y-momentum + q(i,j,4) = 0.1d0 / gamma ! Energy + if (meqn .eq. 5) then + q(i,j,5) = 2.0d0 ! Tracer + endif + endif + endif + + ! Region 3 + if (xi .gt. r3_xlower .and. xi .lt. r3_xupper) then + if (yj .gt. r3_ylower .and. yj .lt. r3_yupper) then + q(i,j,1) = 1.0d0 ! Density + q(i,j,2) = 0.0d0 ! x-momentum + q(i,j,3) = 0.0d0 ! y-momentum + q(i,j,4) = 0.1d0 / gamma ! Energy + if (meqn .eq. 5) then + q(i,j,5) = 3.0d0 ! Tracer + endif + endif + endif + + enddo + enddo + + ! idisc_example = idisc +! do i = 1-mbc,mx+mbc +! xclow = xlower + (i-1)*dx +! do j = 1-mbc,my+mbc +! yclow = ylower + (j-1)*dy +! c # set (xlow,ylow) to lower left corner of grid cell: + +! if (idisc_example .eq. 3) then +! idisc = 3 +! call cellave2(blockno,xclow,yclow,dx,dy,win) +! c # win is now the fraction of the cell that lies inside the +! c # circle +! do m = 1,meqn +! q(i,j,m) = win*qin(m) + (1.d0-win)*qout(m) +! enddo +! idisc = 4 +! call cellave2(blockno,xclow,yclow,dx,dy,win) +! q(i,j,5) = q(i,j,5) + win +! else +! call cellave2(blockno,xclow,yclow,dx,dy,win) +! c # win is now the fraction of the cell that lies inside the +! c # circle +! do m=1,meqn +! q(i,j,m) = win*qin(m) + (1.d0-win)*qout(m) +! enddo +! endif +! enddo + +! c # behind shock: +! do j=1-mbc,my+mbc +! if (xclow .lt. 0.2d0) then +! q(i,j,1) = rinf +! q(i,j,2) = rinf*vinf +! q(i,j,3) = 0.d0 +! q(i,j,4) = einf +! if (meqn .eq. 5) then +! q(i,j,5) = 1.d0 +! endif +! endif +! enddo +! c +! if (xclow .lt. 0.5d0 .and. meqn .eq. 5) then +! c # to give two different values of tracer in bubble +! c # for better visualization of motion: +! do j=1,my +! q(i,j,5) = 2.d0*q(i,j,5) +! enddo + ! end if +! enddo + + return + end diff --git a/applications/clawpack/euler/2d/triple/user_4.6/setaux.f b/applications/clawpack/euler/2d/triple/user_4.6/setaux.f new file mode 100644 index 000000000..be1b14c7e --- /dev/null +++ b/applications/clawpack/euler/2d/triple/user_4.6/setaux.f @@ -0,0 +1,20 @@ + subroutine clawpack46_setaux(maxmx,maxmy,mbc,mx,my, + & xlower,ylower,dx,dy,maux,aux) + implicit none + + integer maxmx, maxmy,mbc,mx,my,maux + double precision xlower,ylower,dx,dy + double precision aux(1-mbc:maxmx+mbc,1-mbc:maxmy+mbc, maux) + + integer i,j + double precision yj + + ! do i = 1-mbc,mx+mbc + ! do j = 1-mbc,my+mbc + ! yj = ylower + (j-0.5d0)*dy + ! aux(i,j,1) = yj + ! enddo + ! enddo + + return + end diff --git a/applications/clawpack/euler/2d/triple/user_4.6/src2.f b/applications/clawpack/euler/2d/triple/user_4.6/src2.f new file mode 100644 index 000000000..ea9bf65fa --- /dev/null +++ b/applications/clawpack/euler/2d/triple/user_4.6/src2.f @@ -0,0 +1,59 @@ + subroutine clawpack46_src2(maxmx,maxmy,meqn,mbc,mx,my, + & xlower,ylower,dx,dy,q,maux,aux,t,dt) +c ========================================================= + implicit double precision(a-h,o-z) + dimension q(1-mbc:maxmx+mbc, 1-mbc:maxmy+mbc, meqn) + dimension aux(1-mbc:maxmx+mbc, 1-mbc:maxmy+mbc, maux) +c +c # source terms for cylindrical symmetry in 2d Euler equations +c # about y = 0, so radius = y +c # y value at cell center is stored in aux(i,j,1) +c + dimension qstar(4) + common /cparam/ gamma,gamma1 +c +c # 2-stage Runge-Kutta method +c +! dt2 = dt/2.d0 +! press = 0.d0 +! ndim = 2 + +! do i=1,mx +! do j=1,my +! rad = aux(i,j,1) +! rho = q(i,j,1) +! u = q(i,j,2)/q(i,j,1) +! v = q(i,j,3)/q(i,j,1) +! press = gamma1*(q(i,j,4) - 0.5d0*rho*(u**2 + v**2)) + +! if (rad.eq.0.d0) write(6,*) 'rad = 0 in src2' +! if (rho.eq.0.d0) write(6,*) 'rho = 0 in q' + +! qstar(1) = q(i,j,1) - dt2*(ndim-1)/rad * q(i,j,3) +! qstar(2) = q(i,j,2) - dt2*(ndim-1)/rad * +! & (rho*u*v) +! qstar(3) = q(i,j,3) - dt2*(ndim-1)/rad * +! & (rho*v*v) +! qstar(4) = q(i,j,4) - dt2*(ndim-1)/rad * +! & v*(q(i,j,4) + press) +! c +! c # second stage +! c +! rho = qstar(1) +! u = qstar(2)/qstar(1) +! v = qstar(3)/qstar(1) +! press = gamma1*(qstar(4) - 0.5d0*rho*(u**2 + v**2)) +! if (rho.eq.0.d0) write(6,*) 'rho = 0 in qstar' + +! q(i,j,1) = q(i,j,1) - dt*(ndim-1)/rad * qstar(3) +! q(i,j,2) = q(i,j,2) - dt*(ndim-1)/rad * +! & (rho*u*v) +! q(i,j,3) = q(i,j,3) - dt*(ndim-1)/rad * +! & (rho*v*v) +! q(i,j,4) = q(i,j,4) - dt*(ndim-1)/rad * +! & v*(qstar(4) + press) +! end do +! end do + + return + end diff --git a/applications/clawpack/euler/2d/triple/user_5.0/bc2.f90 b/applications/clawpack/euler/2d/triple/user_5.0/bc2.f90 new file mode 100644 index 000000000..d037e468f --- /dev/null +++ b/applications/clawpack/euler/2d/triple/user_5.0/bc2.f90 @@ -0,0 +1,233 @@ +SUBROUTINE clawpack5_bc2(meqn,mbc,mx,my,xlower,ylower, & + dx,dy,q,maux,aux,t,dt,mthbc) + + IMPLICIT NONE + INTEGER meqn,mbc,mx,my,maux,mthbc(4) + DOUBLE PRECISION xlower,ylower,dx,dy,t,dt + + DOUBLE PRECISION q(meqn,1-mbc:mx+mbc,1-mbc:my+mbc) + DOUBLE PRECISION aux(maux,1-mbc:mx+mbc,1-mbc:my+mbc) + + INTEGER i,j,ibc,jbc,m + + + !!------------------------------------------------------- + !! # left boundary: + !!------------------------------------------------------- + GOTO (100,110,120,130) mthbc(1)+1 +!! this is how we skip over this side... if (mthbc(1)+1 +!! is not 1,2,3 or 4, then the goto above falls through to here... + goto 199 + + 100 continue +!! # user-specified boundary conditions go here in place of error output + WRITE(6,*) '*** ERROR *** mthbc(1)=0 and no BCs specified in bc2' + STOP + go to 199 + + 110 continue + !! # zero-order extrapolation: + DO j = 1-mbc, my+mbc + DO ibc=1,mbc + DO m=1,meqn + q(m,1-ibc,j) = q(m,1,j) + ENDDO + ENDDO + ENDDO + go to 199 + + 120 continue + !! # periodic: + DO j = 1-mbc, my+mbc + DO ibc=1,mbc + DO m=1,meqn + q(m,1-ibc,j) = q(m,mx+1-ibc,j) + ENDDO + ENDDO + ENDDO + GOTO 199 + + 130 continue + !! # solid wall (assumes 2'nd component is velocity or momentum in x): + DO j = 1-mbc, my+mbc + DO ibc=1,mbc + DO m=1,meqn + q(m,1-ibc,j) = q(m,ibc,j) + ENDDO + ENDDO + ENDDO + + !! # negate the normal velocity: + DO j = 1-mbc, my+mbc + DO ibc=1,mbc + q(2,1-ibc,j) = -q(2,ibc,j) + ENDDO + ENDDO + go to 199 + + 199 continue + + !!------------------------------------------------------- + !! # right boundary: + !!------------------------------------------------------- + GOTO (200,210,220,230) mthbc(2)+1 + GOTO 299 + +200 CONTINUE + !! # user-specified boundary conditions go here in place of error output + WRITE(6,*) '*** ERROR *** mthbc(2)=0 and no BCs specified in bc2' + STOP + go to 299 + + 210 continue + !! # zero-order extrapolation: + DO j = 1-mbc, my+mbc + DO ibc=1,mbc + DO m=1,meqn + q(m,mx+ibc,j) = q(m,mx,j) + ENDDO + ENDDO + ENDDO + go to 299 + +220 CONTINUE + !! # periodic: + DO j = 1-mbc, my+mbc + DO ibc=1,mbc + DO m=1,meqn + q(m,mx+ibc,j) = q(m,ibc,j) + ENDDO + ENDDO + ENDDO + go to 299 + + 230 continue + !! # solid wall (assumes 2'nd component is velocity or momentum in x): + DO j = 1-mbc, my+mbc + DO ibc=1,mbc + DO m=1,meqn + q(m,mx+ibc,j) = q(m,mx+1-ibc,j) + ENDDO + ENDDO + ENDDO + + !! # negate the normal velocity: + DO j = 1-mbc, my+mbc + DO ibc=1,mbc + q(2,mx+ibc,j) = -q(2,mx+1-ibc,j) + ENDDO + ENDDO + go to 299 + +299 CONTINUE + + !!------------------------------------------------------- + !! # bottom boundary: + !!------------------------------------------------------- + GOTO (300,310,320,330) mthbc(3)+1 + GOTO 399 + +300 CONTINUE + !! # user-specified boundary conditions go here in place of error output + WRITE(6,*) '*** ERROR *** mthbc(3)=0 and no BCs specified in bc2' + STOP + go to 399 + +310 CONTINUE + !! # zero-order extrapolation: + DO jbc=1,mbc + DO i = 1-mbc, mx+mbc + DO m=1,meqn + q(m,i,1-jbc) = q(m,i,1) + ENDDO + ENDDO + ENDDO + go to 399 + +320 CONTINUE + !! # periodic: + DO jbc=1,mbc + DO i = 1-mbc, mx+mbc + DO m=1,meqn + q(m,i,1-jbc) = q(m,i,my+1-jbc) + ENDDO + ENDDO + ENDDO + go to 399 + +330 CONTINUE + !! # solid wall (assumes 3'rd component is velocity or momentum in y): + DO jbc=1,mbc + DO i = 1-mbc, mx+mbc + DO m=1,meqn + q(m,i,1-jbc) = q(m,i,jbc) + ENDDO + ENDDO + ENDDO + + !! # negate the normal velocity: + DO jbc=1,mbc + DO i = 1-mbc, mx+mbc + q(3,i,1-jbc) = -q(3,i,jbc) + ENDDO + ENDDO + go to 399 + +399 CONTINUE + + !!------------------------------------------------------- + !! # top boundary: + !!------------------------------------------------------- + GOTO (400,410,420,430) mthbc(4)+1 + GOTO 499 + +400 CONTINUE +!! # user-specified boundary conditions go here in place of error output + WRITE(6,*) '*** ERROR *** mthbc(4)=0 and no BCs specified in bc2' + STOP + go to 499 + +410 CONTINUE + !! # zero-order extrapolation: + DO jbc=1,mbc + DO i = 1-mbc, mx+mbc + DO m=1,meqn + q(m,i,my+jbc) = q(m,i,my) + ENDDO + ENDDO + ENDDO + go to 499 + +420 CONTINUE + !! # periodic: + DO jbc=1,mbc + DO i = 1-mbc, mx+mbc + DO m=1,meqn + q(m,i,my+jbc) = q(m,i,jbc) + ENDDO + ENDDO + ENDDO + go to 499 + + 430 continue + !! # solid wall (assumes 3'rd component is velocity or momentum in y): + DO jbc=1,mbc + DO i = 1-mbc, mx+mbc + DO m=1,meqn + q(m,i,my+jbc) = q(m,i,my+1-jbc) + ENDDO + ENDDO + ENDDO + + !! # negate the normal velocity: + DO jbc=1,mbc + DO i = 1-mbc, mx+mbc + q(3,i,my+jbc) = -q(3,i,my+1-jbc) + ENDDO + ENDDO + go to 499 + +499 CONTINUE + + RETURN +END SUBROUTINE clawpack5_bc2 diff --git a/applications/clawpack/euler/2d/triple/user_5.0/qinit.f90 b/applications/clawpack/euler/2d/triple/user_5.0/qinit.f90 new file mode 100644 index 000000000..64045522c --- /dev/null +++ b/applications/clawpack/euler/2d/triple/user_5.0/qinit.f90 @@ -0,0 +1,53 @@ +SUBROUTINE clawpack5_qinit(meqn,mbc, & + mx,my,xlower,ylower,dx,dy,q,maux,aux) + IMPLICIT NONE + + INTEGER meqn,mbc,mx,my,maux + DOUBLE PRECISION xlower,ylower,dx,dy + DOUBLE PRECISION q(meqn,1-mbc:mx+mbc, 1-mbc:my+mbc) + DOUBLE PRECISION aux(maux,1-mbc:mx+mbc, 1-mbc:my+mbc) + + INTEGER blockno, fc2d_clawpack5_get_block + + DOUBLE PRECISION qin(5),qout(5),rinf,vinf,einf + COMMON /comic/ qin,qout + COMMON /cominf/ rinf,vinf,einf + + INTEGER i,j,m + DOUBLE PRECISION xclow,yclow,win + + blockno = fc2d_clawpack5_get_block() + + DO i = 1-mbc,mx+mbc + xclow = xlower + (i-1)*dx + DO j = 1-mbc,my+mbc + yclow = ylower + (j-1)*dy + CALL cellave2(blockno,xclow,yclow,dx,dy,win) + DO m = 1,meqn + q(m,i,j) = win*qin(m) + (1.d0-win)*qout(m) + ENDDO + ENDDO + + IF (xclow .LT. 0.2d0) THEN + DO j=1-mbc,my+mbc + q(1,i,j) = rinf + q(2,i,j) = rinf*vinf + q(3,i,j) = 0.d0 + q(4,i,j) = einf + IF (meqn .EQ. 5) THEN + q(5,i,j) = 1.d0 + ENDIF + ENDDO + END IF + + IF (meqn .EQ. 5) THEN + IF (xclow .LT. 0.5d0) THEN + DO j = 1,my + q(5,i,j) = 2.d0*q(5,i,j) + ENDDO + END IF + END IF + ENDDO + + RETURN +END SUBROUTINE clawpack5_qinit diff --git a/applications/clawpack/euler/2d/triple/user_5.0/setaux.f90 b/applications/clawpack/euler/2d/triple/user_5.0/setaux.f90 new file mode 100644 index 000000000..b618289a6 --- /dev/null +++ b/applications/clawpack/euler/2d/triple/user_5.0/setaux.f90 @@ -0,0 +1,20 @@ +SUBROUTINE clawpack5_setaux(mbc,mx,my, & + xlower,ylower,dx,dy,maux,aux) + IMPLICIT NONE + + INTEGER mbc,mx,my,maux + DOUBLE PRECISION xlower,ylower,dx,dy + DOUBLE PRECISION aux(maux,1-mbc:mx+mbc,1-mbc:my+mbc) + + INTEGER i,j + DOUBLE PRECISION yj + + DO i = 1-mbc,mx+mbc + DO j = 1-mbc,my+mbc + yj = ylower + (j-0.5d0)*dy + aux(1,i,j) = yj + ENDDO + ENDDO + + RETURN +END SUBROUTINE clawpack5_setaux diff --git a/applications/clawpack/euler/2d/triple/user_5.0/src2.f90 b/applications/clawpack/euler/2d/triple/user_5.0/src2.f90 new file mode 100644 index 000000000..4a6eac97a --- /dev/null +++ b/applications/clawpack/euler/2d/triple/user_5.0/src2.f90 @@ -0,0 +1,55 @@ +SUBROUTINE clawpack5_src2(meqn,mbc,mx,my,xlower,ylower, & + dx,dy,q,maux,aux,t,dt) + IMPLICIT NONE + + INTEGER meqn,mbc,mx,my,maux + DOUBLE PRECISION xlower,ylower,dx,dy,t,dt + DOUBLE PRECISION q(meqn,1-mbc:mx+mbc, 1-mbc:my+mbc) + DOUBLE PRECISION aux(maux,1-mbc:mx+mbc, 1-mbc:my+mbc) + + DOUBLE PRECISION qstar(4) + DOUBLE PRECISION gamma,gamma1 + COMMON /cparam/ gamma,gamma1 + + INTEGER i,j,ndim + DOUBLE PRECISION dt2,press,rad,rho,u,v + + !! # 2-stage Runge-Kutta method + + dt2 = dt/2.d0 + press = 0.d0 + ndim = 2 + + DO i = 1,mx + DO j = 1,my + rad = aux(1,i,j) + rho = q(1,i,j) + u = q(2,i,j)/q(1,i,j) + v = q(3,i,j)/q(1,i,j) + press = gamma1*(q(4,i,j) - 0.5d0*rho*(u**2 + v**2)) + + IF (rad.EQ.0.d0) WRITE(6,*) 'rad = 0 in src2' + IF (rho.EQ.0.d0) WRITE(6,*) 'rho = 0 in q' + + qstar(1) = q(1,i,j) - dt2*(ndim-1)/rad * q(3,i,j) + qstar(2) = q(2,i,j) - dt2*(ndim-1)/rad * (rho*u*v) + qstar(3) = q(3,i,j) - dt2*(ndim-1)/rad * (rho*v*v) + qstar(4) = q(4,i,j) - dt2*(ndim-1)/rad * v*(q(4,i,j) + press) + + !! # second stage + + rho = qstar(1) + u = qstar(2)/qstar(1) + v = qstar(3)/qstar(1) + press = gamma1*(qstar(4) - 0.5d0*rho*(u**2 + v**2)) + IF (rho.EQ.0.d0) WRITE(6,*) 'rho = 0 in qstar' + + q(1,i,j) = q(1,i,j) - dt*(ndim-1)/rad * qstar(3) + q(2,i,j) = q(2,i,j) - dt*(ndim-1)/rad * (rho*u*v) + q(3,i,j) = q(3,i,j) - dt*(ndim-1)/rad * (rho*v*v) + q(4,i,j) = q(4,i,j) - dt*(ndim-1)/rad * v*(qstar(4) + press) + ENDDO + ENDDO + + RETURN +END SUBROUTINE clawpack5_src2 diff --git a/applications/clawpack/euler/2d/triple/user_5.0/tag4coarsening.f90 b/applications/clawpack/euler/2d/triple/user_5.0/tag4coarsening.f90 new file mode 100644 index 000000000..ba77bf3c0 --- /dev/null +++ b/applications/clawpack/euler/2d/triple/user_5.0/tag4coarsening.f90 @@ -0,0 +1,50 @@ +SUBROUTINE clawpack5_tag4coarsening(mx,my,mbc,meqn, & + xlower,ylower,dx,dy, blockno, q0, q1, q2, q3, & + coarsen_threshold, tag_patch) + IMPLICIT NONE + + INTEGER mx,my, mbc, meqn, tag_patch + INTEGER blockno + DOUBLE PRECISION xlower(0:3), ylower(0:3), dx, dy + DOUBLE PRECISION coarsen_threshold + DOUBLE PRECISION q0(meqn,1-mbc:mx+mbc,1-mbc:my+mbc) + DOUBLE PRECISION q1(meqn,1-mbc:mx+mbc,1-mbc:my+mbc) + DOUBLE PRECISION q2(meqn,1-mbc:mx+mbc,1-mbc:my+mbc) + DOUBLE PRECISION q3(meqn,1-mbc:mx+mbc,1-mbc:my+mbc) + + INTEGER mq + DOUBLE PRECISION qmin, qmax, dq + + tag_patch = 0 + dq = 0 + DO mq = 1,1 + CALL clawpack5_get_minmax(mx,my,mbc,meqn,mq,q0,dq) + CALL clawpack5_get_minmax(mx,my,mbc,meqn,mq,q1,dq) + CALL clawpack5_get_minmax(mx,my,mbc,meqn,mq,q2,dq) + CALL clawpack5_get_minmax(mx,my,mbc,meqn,mq,q3,dq) + ENDDO + IF (dq .LT. coarsen_threshold) THEN + tag_patch = 1 + RETURN + ENDIF + +END SUBROUTINE clawpack5_tag4coarsening + +SUBROUTINE clawpack5_get_minmax(mx,my,mbc,meqn,mq,q,dq) + + IMPLICIT NONE + INTEGER mx,my,mbc,meqn,mq + DOUBLE PRECISION qmin,qmax,dq + DOUBLE PRECISION q(meqn,1-mbc:mx+mbc,1-mbc:my+mbc) + INTEGER i,j + DOUBLE PRECISION dqi, dqj + + DO i = 1,mx + DO j = 1,my + dqi = dabs(q(mq,i+1,j) - q(mq,i-1,j)) + dqj = dabs(q(mq,i,j+1) - q(mq,i,j-1)) + dq = dmax1(dq,dqi, dqj) + ENDDO + ENDDO + +END SUBROUTINE clawpack5_get_minmax diff --git a/applications/clawpack/euler/2d/triple/user_5.0/tag4refinement.f90 b/applications/clawpack/euler/2d/triple/user_5.0/tag4refinement.f90 new file mode 100644 index 000000000..d30f83f45 --- /dev/null +++ b/applications/clawpack/euler/2d/triple/user_5.0/tag4refinement.f90 @@ -0,0 +1,36 @@ +SUBROUTINE clawpack5_tag4refinement(mx,my,mbc, & + meqn, xlower,ylower,dx,dy,blockno, & + q, tag_threshold, init_flag,tag_patch) + IMPLICIT NONE + + INTEGER mx,my, mbc, meqn, tag_patch, init_flag + INTEGER blockno + DOUBLE PRECISION xlower, ylower, dx, dy + DOUBLE PRECISION tag_threshold + DOUBLE PRECISION q(meqn,1-mbc:mx+mbc,1-mbc:my+mbc) + + INTEGER i,j, mq + DOUBLE PRECISION qmin, qmax + DOUBLE PRECISION dq, dqi, dqj + + tag_patch = 0 + + !! # Refine based only on first variable in system. + qmin = q(1,1,1) + qmax = q(1,1,1) + DO j = 2-mbc,my+mbc-1 + DO i = 2-mbc,mx+mbc-1 + dq = 0 + DO mq = 1,1 + dqi = dabs(q(mq,i+1,j) - q(mq,i-1,j)) + dqj = dabs(q(mq,i,j+1) - q(mq,i,j-1)) + dq = dmax1(dq, dqi, dqj) + IF (dq .GT. tag_threshold) THEN + tag_patch = 1 + RETURN + ENDIF + ENDDO + ENDDO + ENDDO + +END SUBROUTINE clawpack5_tag4refinement From 6f4bc6b82513e893ee64154884b79deb89322f1a Mon Sep 17 00:00:00 2001 From: Damyn Chipman Date: Fri, 26 Jan 2024 10:10:08 -0700 Subject: [PATCH 2/6] Adding triple point files. --- applications/clawpack/euler/2d/triple/fclaw_options.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/applications/clawpack/euler/2d/triple/fclaw_options.ini b/applications/clawpack/euler/2d/triple/fclaw_options.ini index 9040d8fa5..05bae5365 100644 --- a/applications/clawpack/euler/2d/triple/fclaw_options.ini +++ b/applications/clawpack/euler/2d/triple/fclaw_options.ini @@ -11,8 +11,8 @@ [clawpatch] # Grid dimensions - mx = 16 - my = 16 + mx = 8 + my = 8 mbc = 2 # Number of ghost cells maux = 0 From fa96c8306f98b034c40efb76e8ee746b5fd46483 Mon Sep 17 00:00:00 2001 From: Damyn Chipman Date: Fri, 26 Jan 2024 11:57:57 -0700 Subject: [PATCH 3/6] Adding regression test files. --- .../clawpack/euler/2d/triple/regression.ini | 118 ++++++++++++++++++ .../clawpack/euler/2d/triple/regressions.sh | 10 ++ 2 files changed, 128 insertions(+) create mode 100644 applications/clawpack/euler/2d/triple/regression.ini create mode 100755 applications/clawpack/euler/2d/triple/regressions.sh diff --git a/applications/clawpack/euler/2d/triple/regression.ini b/applications/clawpack/euler/2d/triple/regression.ini new file mode 100644 index 000000000..53fba47f9 --- /dev/null +++ b/applications/clawpack/euler/2d/triple/regression.ini @@ -0,0 +1,118 @@ +[user] + gamma = 1.5 + + x0 = 0.5 + y0 = 0.0 + r0 = 0.2 + rhoin = 0.1 + pinf = 5.0 + + claw-version = 4 + +[clawpatch] + # Grid dimensions + mx = 8 + my = 8 + mbc = 2 # Number of ghost cells + maux = 0 + + # Clawpatch tagging criteria + # value : value exceeds threshold + # minmax : qmax-qmin exceeds threshold + # difference : difference (e.g. dqx = q(i+1,j)-q(i-1,j)) exceeds threshold + # gradient : gradient exceeds threshold + # user : User defined criteria + refinement-criteria = difference + + + meqn = 5 # Number of equations + + +[Options] + +# Regridding information + minlevel = 0 # Minimum level + maxlevel = 3 # Maximum levels of refinement + regrid_interval = 1 # Regrid every 'regrid_interval' time steps. + refine_threshold = 0.5 + coarsen_threshold = 0.25 + smooth-refine = T + smooth-level = 0 + coarsen-delay = 0 + +# Time stepping + tfinal = 5 # Since we are not scaling the results + initial_dt = 0.01 # Initial time step for 'minlevel' + + use_fixed_dt = F # Take a fixed time step + max_cfl = 1.0 + desired_cfl = 0.9 + + outstyle = 1 # OutputStyle = 1,2,3 (see below, e.g. [OutputStyle_1] + nout = 50 # Used for all three out styles + nstep = 30 # Only used if outstyle is 3 + + subcycle = T # subcycle in time ( = T or F). + advance-one-step = F + outstyle-uses-maxlevel = T + +# File and console IO + verbosity = production # verbosity + output = T # + run-user-diagnostics = F + conservation-check = F + report-timing = T + report-timing-verbosity=summary + + # ----------- + # Tikz output + # ----------- + tikz-out = F + tikz-figsize = 4 1 # Each block is 1 in x 1 in ; Final figure is 4 in x 1 in + tikz-plot-fig = T # Set to true if you have figure 'plot_0000.png' available. + tikz-plot-prefix = 'plot' + tikz-plot-suffix = 'png' + + +# Debugging and diagnostics + trapfpe = F + mpi_debug = F + +# Mapping and topology + manifold = F # Manifold + + mi = 7 + mj = 3 + + ax = 0 + bx = 7 + ay = -1.5 + by = 1.5 + +[clawpack46] + order = 2 2 # normal and transverse order + mcapa = 0 # mcapa + src_term = 0 # src_term + + mwaves = 5 # mwaves + mthlim = 4 4 4 4 1 # mthlim (is a vector in general, with 'mwaves' entries) + mthbc = 3 3 3 3 # mthbc(1) (left edge), etc. + + # output + ascii-out = T + vtk-out = T + + +[clawpack5] + order = 2 2 # normal and transverse order + mcapa = 0 # mcapa + src_term = 1 # src_term + + mwaves = 5 # mwaves + mthlim = 4 4 4 4 1 # mthlim (is a vector in general, with 'mwaves' entries) + mthbc = 3 3 3 3 # mthbc(1) (left edge), etc. + + # output + ascii-out = T + vtk-out = T + diff --git a/applications/clawpack/euler/2d/triple/regressions.sh b/applications/clawpack/euler/2d/triple/regressions.sh new file mode 100755 index 000000000..4860ce380 --- /dev/null +++ b/applications/clawpack/euler/2d/triple/regressions.sh @@ -0,0 +1,10 @@ +#!/bin/sh +# absolute path to application we are testing +application=$FCLAW_APPLICATIONS_BUILD_DIR/clawpack/euler/2d/triple/triple + +# change to source dir for working directory +cd $FCLAW_APPLICATIONS_SRC_DIR/clawpack/euler/2d/triple/ + +# run programs, exit script with nonzero on failure (or else script will exit with value of last program run) +$FCLAW_MPIRUN $FCLAW_MPI_TEST_FLAGS $application -F regression.ini --user:claw-version=4 || exit 1 +$FCLAW_MPIRUN $FCLAW_MPI_TEST_FLAGS $application -F regression.ini --user:claw-version=5 || exit 1 \ No newline at end of file From d16045e3e9b829ac15b9684e4ee6160c32f9043e Mon Sep 17 00:00:00 2001 From: Damyn Chipman Date: Fri, 26 Jan 2024 13:19:00 -0700 Subject: [PATCH 4/6] Triple only works with clawpack v4. --- applications/clawpack/euler/2d/triple/regressions.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/applications/clawpack/euler/2d/triple/regressions.sh b/applications/clawpack/euler/2d/triple/regressions.sh index 4860ce380..57862d4cd 100755 --- a/applications/clawpack/euler/2d/triple/regressions.sh +++ b/applications/clawpack/euler/2d/triple/regressions.sh @@ -6,5 +6,4 @@ application=$FCLAW_APPLICATIONS_BUILD_DIR/clawpack/euler/2d/triple/triple cd $FCLAW_APPLICATIONS_SRC_DIR/clawpack/euler/2d/triple/ # run programs, exit script with nonzero on failure (or else script will exit with value of last program run) -$FCLAW_MPIRUN $FCLAW_MPI_TEST_FLAGS $application -F regression.ini --user:claw-version=4 || exit 1 -$FCLAW_MPIRUN $FCLAW_MPI_TEST_FLAGS $application -F regression.ini --user:claw-version=5 || exit 1 \ No newline at end of file +$FCLAW_MPIRUN $FCLAW_MPI_TEST_FLAGS $application -F regression.ini --user:claw-version=4 || exit 1 \ No newline at end of file From d79ad79a5914d540ce2b265917dee6687716cd9a Mon Sep 17 00:00:00 2001 From: Damyn Chipman Date: Fri, 26 Jan 2024 15:39:31 -0700 Subject: [PATCH 5/6] Removing file writing when running regression tests. --- applications/clawpack/euler/2d/triple/regression.ini | 8 ++++---- applications/clawpack/euler/2d/triple/regressions.sh | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/applications/clawpack/euler/2d/triple/regression.ini b/applications/clawpack/euler/2d/triple/regression.ini index 53fba47f9..47756e010 100644 --- a/applications/clawpack/euler/2d/triple/regression.ini +++ b/applications/clawpack/euler/2d/triple/regression.ini @@ -99,8 +99,8 @@ mthbc = 3 3 3 3 # mthbc(1) (left edge), etc. # output - ascii-out = T - vtk-out = T + ascii-out = F + vtk-out = F [clawpack5] @@ -113,6 +113,6 @@ mthbc = 3 3 3 3 # mthbc(1) (left edge), etc. # output - ascii-out = T - vtk-out = T + ascii-out = F + vtk-out = F diff --git a/applications/clawpack/euler/2d/triple/regressions.sh b/applications/clawpack/euler/2d/triple/regressions.sh index 57862d4cd..659bfc0af 100755 --- a/applications/clawpack/euler/2d/triple/regressions.sh +++ b/applications/clawpack/euler/2d/triple/regressions.sh @@ -6,4 +6,4 @@ application=$FCLAW_APPLICATIONS_BUILD_DIR/clawpack/euler/2d/triple/triple cd $FCLAW_APPLICATIONS_SRC_DIR/clawpack/euler/2d/triple/ # run programs, exit script with nonzero on failure (or else script will exit with value of last program run) -$FCLAW_MPIRUN $FCLAW_MPI_TEST_FLAGS $application -F regression.ini --user:claw-version=4 || exit 1 \ No newline at end of file +$FCLAW_MPIRUN $FCLAW_MPI_TEST_FLAGS $application -F regression.ini || exit 1 \ No newline at end of file From d95b94dd434da73a2bd30301fe80f1a6ff774dc6 Mon Sep 17 00:00:00 2001 From: Scott Aiton Date: Wed, 31 Jan 2024 17:27:07 -0700 Subject: [PATCH 6/6] update automake files --- .../clawpack/euler/2d/triple/Makefile.am | 54 +++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/applications/clawpack/euler/2d/triple/Makefile.am b/applications/clawpack/euler/2d/triple/Makefile.am index b1e30f471..b417d4083 100644 --- a/applications/clawpack/euler/2d/triple/Makefile.am +++ b/applications/clawpack/euler/2d/triple/Makefile.am @@ -1,24 +1,24 @@ -## Makefile.am in applications/clawpack/euler/2d/shockbubble - -bin_PROGRAMS += applications/clawpack/euler/2d/shockbubble/shockbubble - -TESTS += applications/clawpack/euler/2d/shockbubble/regressions.sh - -applications_clawpack_euler_2d_shockbubble_shockbubble_SOURCES = \ - applications/clawpack/euler/2d/shockbubble/shockbubble.cpp \ - applications/clawpack/euler/2d/shockbubble/shockbubble_options.c \ - applications/clawpack/euler/2d/shockbubble/shockbubble_user.cpp \ - applications/clawpack/euler/2d/shockbubble/shockbubble_user.h \ - applications/clawpack/euler/2d/shockbubble/fdisc.f \ - applications/clawpack/euler/2d/shockbubble/setprob.f \ - applications/clawpack/euler/2d/shockbubble/user_4.6/qinit.f \ - applications/clawpack/euler/2d/shockbubble/user_4.6/setaux.f \ - applications/clawpack/euler/2d/shockbubble/user_4.6/bc2.f \ - applications/clawpack/euler/2d/shockbubble/user_4.6/src2.f \ - applications/clawpack/euler/2d/shockbubble/user_5.0/qinit.f90 \ - applications/clawpack/euler/2d/shockbubble/user_5.0/setaux.f90 \ - applications/clawpack/euler/2d/shockbubble/user_5.0/bc2.f90 \ - applications/clawpack/euler/2d/shockbubble/user_5.0/src2.f90 \ +## Makefile.am in applications/clawpack/euler/2d/triple + +bin_PROGRAMS += applications/clawpack/euler/2d/triple/triple + +TESTS += applications/clawpack/euler/2d/triple/regressions.sh + +applications_clawpack_euler_2d_triple_triple_SOURCES = \ + applications/clawpack/euler/2d/triple/triple.cpp \ + applications/clawpack/euler/2d/triple/triple_options.c \ + applications/clawpack/euler/2d/triple/triple_user.cpp \ + applications/clawpack/euler/2d/triple/triple_user.h \ + applications/clawpack/euler/2d/triple/fdisc.f \ + applications/clawpack/euler/2d/triple/setprob.f \ + applications/clawpack/euler/2d/triple/user_4.6/qinit.f \ + applications/clawpack/euler/2d/triple/user_4.6/setaux.f \ + applications/clawpack/euler/2d/triple/user_4.6/bc2.f \ + applications/clawpack/euler/2d/triple/user_4.6/src2.f \ + applications/clawpack/euler/2d/triple/user_5.0/qinit.f90 \ + applications/clawpack/euler/2d/triple/user_5.0/setaux.f90 \ + applications/clawpack/euler/2d/triple/user_5.0/bc2.f90 \ + applications/clawpack/euler/2d/triple/user_5.0/src2.f90 \ applications/clawpack/euler/2d/rp/euler_user_fort.h \ applications/clawpack/euler/2d/rp/clawpack46_rpn2_euler4.f \ applications/clawpack/euler/2d/rp/clawpack46_rpt2_euler4.f \ @@ -30,18 +30,18 @@ applications_clawpack_euler_2d_shockbubble_shockbubble_SOURCES = \ applications/clawpack/euler/2d/rp/clawpack5_rpt2_euler5.f90 EXTRA_DIST += \ - applications/clawpack/euler/2d/shockbubble/fclaw_options.ini \ - applications/clawpack/euler/2d/shockbubble/regression.ini \ - applications/clawpack/euler/2d/shockbubble/afterframe.m \ - applications/clawpack/euler/2d/shockbubble/setplot2.m + applications/clawpack/euler/2d/triple/fclaw_options.ini \ + applications/clawpack/euler/2d/triple/regression.ini \ + applications/clawpack/euler/2d/triple/afterframe.m \ + applications/clawpack/euler/2d/triple/setplot2.m -applications_clawpack_euler_2d_shockbubble_shockbubble_CPPFLAGS = \ +applications_clawpack_euler_2d_triple_triple_CPPFLAGS = \ $(AM_CPPFLAGS) \ $(FCLAW_CLAWPACK46_CPPFLAGS) \ $(FCLAW_CLAWPACK5_CPPFLAGS) \ $(FCLAW_CLAWPATCH_CPPFLAGS) -applications_clawpack_euler_2d_shockbubble_shockbubble_LDADD = \ +applications_clawpack_euler_2d_triple_triple_LDADD = \ $(LDADD) \ $(FCLAW_CLAWPACK46_LDADD) \ $(FCLAW_CLAWPACK5_LDADD) \