Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion applications/clawpack/clawpack.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
44 changes: 44 additions & 0 deletions applications/clawpack/euler/2d/triple/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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_OBJECTS:triple_f>
)

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)
51 changes: 51 additions & 0 deletions applications/clawpack/euler/2d/triple/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
## 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 \
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/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_triple_triple_CPPFLAGS = \
$(AM_CPPFLAGS) \
$(FCLAW_CLAWPACK46_CPPFLAGS) \
$(FCLAW_CLAWPACK5_CPPFLAGS) \
$(FCLAW_CLAWPATCH_CPPFLAGS)

applications_clawpack_euler_2d_triple_triple_LDADD = \
$(LDADD) \
$(FCLAW_CLAWPACK46_LDADD) \
$(FCLAW_CLAWPACK5_LDADD) \
$(FCLAW_CLAWPATCH_LDADD) \
$(FCLAW_LDADD)


118 changes: 118 additions & 0 deletions applications/clawpack/euler/2d/triple/fclaw_options.ini
Original file line number Diff line number Diff line change
@@ -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 = 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

70 changes: 70 additions & 0 deletions applications/clawpack/euler/2d/triple/fdisc.f
Original file line number Diff line number Diff line change
@@ -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
Loading