Permalink
Browse files

Add DGP2 for Transport equation

Change the rhs in DGTransport.h
Add regression testcase for gauss hump in both serial and parallel
  • Loading branch information...
WeizhaoLi2018 committed Jan 10, 2019
1 parent 30214f4 commit 00383f9b55adba3bf5edcfab68a5af1cf63b6231
@@ -27,6 +27,18 @@ add_regression_test(gauss_hump_dgp1 ${INCITER_EXECUTABLE}
TEXT_RESULT diag
TEXT_DIFF_PROG_CONF gauss_hump_diag.ndiff.cfg)

add_regression_test(gauss_hump_dgp2 ${INCITER_EXECUTABLE}
NUMPES 1
INPUTFILES gauss_hump_dgp2.q unitsquare_01_3.6k.exo
ARGS -c gauss_hump_dgp2.q -i unitsquare_01_3.6k.exo -v
BIN_BASELINE gauss_hump_dgp2.std.exo
BIN_RESULT out.e-s.0.1.0
BIN_DIFF_PROG_CONF exodiff.cfg
BIN_DIFF_PROG_ARGS -m
TEXT_BASELINE diag_dgp2.std
TEXT_RESULT diag
TEXT_DIFF_PROG_CONF gauss_hump_diag.ndiff.cfg)

add_regression_test(gauss_hump_dg ${INCITER_EXECUTABLE}
NUMPES 4
INPUTFILES gauss_hump.q unitsquare_01_3.6k.exo
@@ -63,6 +75,24 @@ add_regression_test(gauss_hump_dgp1 ${INCITER_EXECUTABLE}
TEXT_RESULT diag
TEXT_DIFF_PROG_CONF gauss_hump_diag.ndiff.cfg)

add_regression_test(gauss_hump_dgp2 ${INCITER_EXECUTABLE}
NUMPES 4
INPUTFILES gauss_hump_dgp2.q unitsquare_01_3.6k.exo
ARGS -c gauss_hump_dgp2.q -i unitsquare_01_3.6k.exo -v
BIN_BASELINE gauss_hump_dgp2_pe4.std.exo.0
gauss_hump_dgp2_pe4.std.exo.1
gauss_hump_dgp2_pe4.std.exo.2
gauss_hump_dgp2_pe4.std.exo.3
BIN_RESULT out.e-s.0.4.0
out.e-s.0.4.1
out.e-s.0.4.2
out.e-s.0.4.3
BIN_DIFF_PROG_ARGS -m
BIN_DIFF_PROG_CONF exodiff.cfg
TEXT_BASELINE diag_dgp2.std
TEXT_RESULT diag
TEXT_DIFF_PROG_CONF gauss_hump_diag.ndiff.cfg)

# Parallel + virtualization

add_regression_test(gauss_hump_dg_u0.5 ${INCITER_EXECUTABLE}
@@ -0,0 +1,9 @@
# 1:it 2:t 3:dt 4:L2(c0) 5:L2(c0-IC) 6:Linf(c0-IC)
5 5.000000e-04 1.000000e-04 1.253314e-01 7.049660e-05 1.890659e-03
10 1.000000e-03 1.000000e-04 1.253314e-01 7.058039e-05 1.905331e-03
15 1.500000e-03 1.000000e-04 1.253314e-01 7.071408e-05 1.919884e-03
20 2.000000e-03 1.000000e-04 1.253314e-01 7.089296e-05 1.934317e-03
25 2.500000e-03 1.000000e-04 1.253314e-01 7.111296e-05 1.948630e-03
30 3.000000e-03 1.000000e-04 1.253313e-01 7.137046e-05 1.962823e-03
35 3.500000e-03 1.000000e-04 1.253313e-01 7.166220e-05 1.976896e-03
40 4.000000e-03 1.000000e-04 1.253313e-01 7.198521e-05 1.990849e-03
@@ -0,0 +1,43 @@
# vim: filetype=sh:
# This is a comment
# Keywords are case-sensitive

title "Advection of 2D Gaussian hump"

inciter

nstep 40 # Max number of time steps
dt 1.0e-4 # Time step size
ttyi 5 # TTY output interval
ctau 1.0 # FCT mass diffusivity
scheme dgp2

transport
physics advection
problem gauss_hump
ncomp 1
depvar c

bc_extrapolate
sideset 1 end
end
bc_dirichlet
sideset 2 end
end
bc_outlet
sideset 3 end
end
end

diagnostics
interval 5
format scientific
error l2
error linf
end

plotvar
interval 20
end

end
Binary file not shown.
@@ -150,33 +150,50 @@ class Transport {
{ m_bcoutlet, Outlet },
{ m_bcdir, Dirichlet } }};

if (ndof == 1) { // DG(P0)

// compute internal surface flux integrals
tk::surfIntP0( m_system, m_ncomp, m_offset, fd, geoFace, Upwind::flux,
Problem::prescribedVelocity, U, R );
// compute boundary surface flux integrals
for (const auto& b : bctypes)
tk::sidesetIntP0( m_system, m_ncomp, m_offset, b.first, fd, geoFace,
t, Upwind::flux, Problem::prescribedVelocity, b.second, U, R );

} else if (ndof == 4) { // DG(P1)

// compute internal surface flux integrals
tk::surfIntP1( m_system, m_ncomp, m_offset, inpoel, coord, fd, geoFace,
Upwind::flux, Problem::prescribedVelocity, U, limFunc, R );
// compute volume integrals
tk::volIntP1( m_system, m_ncomp, m_offset, inpoel, coord, geoElem,
flux, Problem::prescribedVelocity, U, limFunc, R );
// compute boundary surface flux integrals
for (const auto& b : bctypes)
tk::sidesetIntP1( m_system, m_ncomp, m_offset, b.first, fd, geoFace,
inpoel, coord, t, Upwind::flux, Problem::prescribedVelocity,
b.second, U, limFunc, R );

} else
Throw( "dg::Transport::rhs() not defined for NDOF=" +
std::to_string(ndof) );
switch(ndof)
{
case 1: //DG(P0)
// compute internal surface flux integrals
tk::surfIntP0( m_system, m_ncomp, m_offset, fd, geoFace, Upwind::flux,
Problem::prescribedVelocity, U, R );
// compute boundary surface flux integrals
for (const auto& b : bctypes)
tk::sidesetIntP0( m_system, m_ncomp, m_offset, b.first, fd, geoFace,
t, Upwind::flux, Problem::prescribedVelocity, b.second, U, R );
break;

case 4: //DG(P1)
// compute internal surface flux integrals
tk::surfIntP1( m_system, m_ncomp, m_offset, inpoel, coord, fd, geoFace,
Upwind::flux, Problem::prescribedVelocity, U, limFunc, R );
// compute volume integrals
tk::volIntP1( m_system, m_ncomp, m_offset, inpoel, coord, geoElem,
flux, Problem::prescribedVelocity, U, limFunc, R );
// compute boundary surface flux integrals
for (const auto& b : bctypes)
tk::sidesetIntP1( m_system, m_ncomp, m_offset, b.first, fd, geoFace,
inpoel, coord, t, Upwind::flux, Problem::prescribedVelocity,
b.second, U, limFunc, R );
break;

case 10: //DG(P2)
// compute internal surface flux integrals
tk::surfIntP2( m_system, m_ncomp, m_offset, inpoel, coord, fd, geoFace,
Upwind::flux, Problem::prescribedVelocity, U, R );
// compute volume integrals
tk::volIntP2( m_system, m_ncomp, m_offset, inpoel, coord, geoElem,
flux, Problem::prescribedVelocity, U, R );
// compute boundary surface flux integrals
for (const auto& b : bctypes)
tk::sidesetIntP2( m_system, m_ncomp, m_offset, b.first, fd, geoFace,
inpoel, coord, t, Upwind::flux, Problem::prescribedVelocity,
b.second, U, R );
break;

default:
Throw( "dg::Transport::rhs() not defined for NDOF=" +
std::to_string(ndof) );
}
}

//! Compute the minimum time step size

0 comments on commit 00383f9

Please sign in to comment.