Skip to content
Snippets Groups Projects
Commit 8df3c192 authored by Dominic Kempf's avatar Dominic Kempf
Browse files

Add an application for convection/diffusion with a full tensor

parent d9b59b5b
No related branches found
No related tags found
No related merge requests found
add_subdirectory(convection_diffusion)
add_subdirectory(poisson_dg) add_subdirectory(poisson_dg)
dune_add_formcompiler_system_test(UFLFILE conv_diff_dg.ufl
BASENAME app_conv_diff
INIFILE conv_diff_dg.mini
NO_TESTS
)
dune_symlink_to_source_files(FILES donkey.sbatch)
__name = app_conv_diff_{__exec_suffix}
__exec_suffix = deg{formcompiler.ufl_variants.degree}
#__exec_suffix = deg{formcompiler.ufl_variants.degree}_{opcount_suffix}
#opcount_suffix = opcount, nonopcount | expand opcount
# Calculate the size of the grid to equlibritate it to 100 MB/rank
# Input parameters
dim = 3
#mbperrank = 100
#ranks = 16
mbperrank = .1
ranks = 1
floatingbytes = 8
# Metaini Calculations
memperrank = {mbperrank} * 1048576 | eval
dofsperdir = {formcompiler.ufl_variants.degree} + 1 | eval
celldofs = {dofsperdir} ** {dim} | eval
cellsperrank = {memperrank} / ({floatingbytes} * {celldofs}) | eval
cellsperdir = {cellsperrank} ** (1/{dim}) | eval | toint
firstdircells = {ranks} * {cellsperdir} | eval
dimminusone = {dim} - 1 | eval
ones = 1 | repeat {dimminusone}
otherdircells = {cellsperdir} | repeat {dimminusone}
# Setup the grid!
extension = 1.0 | repeat {dim}
cells = {firstdircells} {otherdircells}
partitioning = {ranks} {ones}
[wrapper.vtkcompare]
name = {__name}
extension = vtu
[formcompiler]
fastdg = 1
sumfact = 1
vectorize_quad = 1
vectorize_grads = 1
#instrumentation_level = 2
#opcounter = 1, 0 | expand opcount
#time_opcounter = 0, 1 | expand opcount
exact_solution_expression = g
compare_l2errorsquared = 1e-6
[formcompiler.ufl_variants]
cell = hexahedron
#degree = 2, 3, 4, 5, 6, 7, 8, 9, 10 | expand
degree = 2
x = SpatialCoordinate(cell)
g = x[0]*x[0] + x[1]*x[1] + x[2]*x[2]
I = Identity(3)
A = as_matrix([[x[i]*x[j] + I[i,j] for j in range(3)] for i in range(3)])
f = -6.
c = 10.
V = FiniteElement("DG", cell, degree)
u = TrialFunction(V)
v = TestFunction(V)
n = FacetNormal(cell)('+')
gamma = 1.0
theta = -1.0
r = (inner(A*grad(u), grad(v)) + (c*u-f)*v)*dx \
+ inner(n, A*avg(grad(u)))*jump(v)*dS \
+ gamma*jump(u)*jump(v)*dS \
+ theta*jump(u)*inner(A*avg(grad(v)), n)*dS \
- inner(n, A*grad(u))*v*ds \
+ gamma*u*v*ds \
- theta*u*inner(A*grad(v), n)*ds \
+ theta*g*inner(A*grad(v), n)*ds \
- gamma*g*v*ds
forms = [r]
#!/bin/bash
# Load modules
ml gcc/6.2
ml intelmpi
ml openblas
ml metis
ml suitesparse
# Set a name for the job
#SBATCH -J poisson_dg
# Number of processes
#SBATCH -n 16
# Choose the SLURM partition (sinfo for overview)
#SBATCH -p haswell16c
# Each process needs two PUs: circumvent hyperthreading
#SBATCH -c 2
# Pin processes to cores
# (Possible values: socket, core)
SRUNOPT="--cpu_bind=verbose,core"
# Run the opcount executables
srun $SRUNOPT ./app_poisson_dg_deg2_opcount app_poisson_dg_3d_deg2_opcount.ini
srun $SRUNOPT ./app_poisson_dg_deg3_opcount app_poisson_dg_3d_deg3_opcount.ini
srun $SRUNOPT ./app_poisson_dg_deg4_opcount app_poisson_dg_3d_deg4_opcount.ini
srun $SRUNOPT ./app_poisson_dg_deg5_opcount app_poisson_dg_3d_deg5_opcount.ini
srun $SRUNOPT ./app_poisson_dg_deg6_opcount app_poisson_dg_3d_deg6_opcount.ini
srun $SRUNOPT ./app_poisson_dg_deg7_opcount app_poisson_dg_3d_deg7_opcount.ini
srun $SRUNOPT ./app_poisson_dg_deg8_opcount app_poisson_dg_3d_deg8_opcount.ini
srun $SRUNOPT ./app_poisson_dg_deg9_opcount app_poisson_dg_3d_deg9_opcount.ini
srun $SRUNOPT ./app_poisson_dg_deg10_opcount app_poisson_dg_3d_deg10_opcount.ini
# Run the timing executables
COUNT=0
while [ $COUNT -lt 2 ]; do
srun $SRUNOPT ./app_poisson_dg_deg2_nonopcount app_poisson_dg_3d_deg2_nonopcount.ini
srun $SRUNOPT ./app_poisson_dg_deg3_nonopcount app_poisson_dg_3d_deg3_nonopcount.ini
srun $SRUNOPT ./app_poisson_dg_deg4_nonopcount app_poisson_dg_3d_deg4_nonopcount.ini
srun $SRUNOPT ./app_poisson_dg_deg5_nonopcount app_poisson_dg_3d_deg5_nonopcount.ini
srun $SRUNOPT ./app_poisson_dg_deg6_nonopcount app_poisson_dg_3d_deg6_nonopcount.ini
srun $SRUNOPT ./app_poisson_dg_deg7_nonopcount app_poisson_dg_3d_deg7_nonopcount.ini
srun $SRUNOPT ./app_poisson_dg_deg8_nonopcount app_poisson_dg_3d_deg8_nonopcount.ini
srun $SRUNOPT ./app_poisson_dg_deg9_nonopcount app_poisson_dg_3d_deg9_nonopcount.ini
srun $SRUNOPT ./app_poisson_dg_deg10_nonopcount app_poisson_dg_3d_deg10_nonopcount.ini
COUNT=$((COUNT + 1))
done
...@@ -17,7 +17,10 @@ def define_list_tensor(name, expr, visitor, stack=()): ...@@ -17,7 +17,10 @@ def define_list_tensor(name, expr, visitor, stack=()):
define_list_tensor(name, child, visitor, stack=stack + (i,)) define_list_tensor(name, child, visitor, stack=stack + (i,))
else: else:
instruction(assignee=prim.Subscript(prim.Variable(name), stack + (i,)), instruction(assignee=prim.Subscript(prim.Variable(name), stack + (i,)),
expression=visitor.call(child)) expression=visitor.call(child),
forced_iname_deps=frozenset(visitor.interface.quadrature_inames()),
tags=frozenset({"quad"}),
)
@kernel_cached @kernel_cached
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment