From 9809ddbc18dafb72ded86369f6c3e75ad0cbd740 Mon Sep 17 00:00:00 2001 From: Francis Russell Date: Wed, 13 Feb 2013 15:45:01 +0000 Subject: [PATCH] Initial work on PSL slides. --- .gitignore | 13 ++++++ Makefile | 56 ++++++++++++++++++++++++ code/laplacian.ufl | 6 +++ presentation.tex | 106 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 181 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 code/laplacian.ufl create mode 100644 presentation.tex diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..411f539 --- /dev/null +++ b/.gitignore @@ -0,0 +1,13 @@ +#Vim swap +.*.swp + +#Generated +/pygments.sty +/*.aux +/*.log +/*.nav +/*.out +/*.pdf +/*.snm +/*.toc +/code/*.tex diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..5d5d199 --- /dev/null +++ b/Makefile @@ -0,0 +1,56 @@ +IMAGE_FILES=$(wildcard images/*) + +SVG_FOLDER=images-svg +SVG_SOURCES=$(wildcard $(SVG_FOLDER)/*.svg) +SVG_OUTPUTS=${patsubst %.svg,%.pdf,$(SVG_SOURCES)} + +CODE_FOLDER=code +CODE_F90_TEX_FILES=${patsubst %.F90,%.tex,$(wildcard $(CODE_FOLDER)/*.F90)} +CODE_UFL_TEX_FILES=${patsubst %.ufl,%.tex,$(wildcard $(CODE_FOLDER)/*.ufl)} +CODE_TEX_FILES=$(CODE_F90_TEX_FILES) $(CODE_UFL_TEX_FILES) + + +PDFLATEX_OUTPUT_LOG=pdflatex_output.log + +all: presentation.pdf + +display: presentation.pdf + xpdf presentation.pdf + +display-4up: presentation-4up.pdf + xpdf presentation-4up.pdf + +4up: presentation-4up.pdf + +presentation-4up.pdf: presentation.pdf + pdfnup --nup 2x2 --a4paper --scale 0.95 --frame true presentation.pdf -o presentation-4up.pdf + +presentation.pdf: $(IMAGE_FILES) $(SVG_OUTPUTS) $(CODE_TEX_FILES) $(wildcard *.tex *.sty) pygments.sty + pdflatex -draftmode presentation &&\ + while(pdflatex presentation | tee $(PDFLATEX_OUTPUT_LOG) && grep "Rerun to get cross-references right" $(PDFLATEX_OUTPUT_LOG)); do true; done &&\ + rm -f $(PDFLATEX_OUTPUT_LOG) + +clean: + rm -f *.aux *.log *.out *.pdf *.bbl *.blg *.toc *.lot *.lof *.nav *.snm \ + $(SVG_FOLDER)/*.pdf \ + $(BASIS_FUNCTIONS_FOLDER)/*.pdf \ + $(BASIS_FUNCTIONS_BUILD_STAMP) \ + $(CODE_TEX_FILES) \ + pygments.sty + +upload: presentation.pdf + rsync -C --progress presentation.pdf shell3.doc.ic.ac.uk:~/public_html/psl_onetep_presentation.pdf + +%.pdf: %.svg + inkscape -D -A $@ $< + +pygments.sty: + pygmentize -S friendly -f latex > $@ + +%.tex: %.F90 + pygmentize -f latex -l fortran -o $@ $< + +%.tex: %.ufl + pygmentize -f latex -l python -o $@ $< + +.PHONY: all display clean upload 4up display-4up diff --git a/code/laplacian.ufl b/code/laplacian.ufl new file mode 100644 index 0000000..62120d5 --- /dev/null +++ b/code/laplacian.ufl @@ -0,0 +1,6 @@ +element = FiniteElement("Lagrange", triangle, 2) + +v = TestFunction(element) +u = TrialFunction(element) + +a = dot(grad(v), grad(u))*dx diff --git a/presentation.tex b/presentation.tex new file mode 100644 index 0000000..d056f77 --- /dev/null +++ b/presentation.tex @@ -0,0 +1,106 @@ +% vim:tw=80 + +\documentclass{beamer} +\usetheme{Madrid} +\usepackage{graphicx} +\usepackage{verbatim} +\usepackage{fancyvrb} +\usepackage{ucs} +\usepackage{alltt} +\usepackage[utf8x]{inputenc} + +\input{pygments.sty} + +\title[PSL Meeting]{PSL Meeting Presentation} +\subtitle{Domain Specific Languages for Quantum Chemistry} + +\author[F. Russell]{Francis Russell \\ Joint work with Chris-Kriton Skylaris \& Karl Wilkinson} +\date{25/02/2013} +\institute[ICL \& Soton]{Imperial College London \& Southampton University} + +\begin{document} + +\frame{\titlepage} + +\frame{ + +\frametitle{DSLs for Computational Science} + +\itemize{ + +\item A formal, machine-interpretable notation for specifying a problem +using a domain-oriented syntax. + +\item Allow scientists to concentrate on the problems they're solving rather +than the implementation. + +\item Reduce time and effort taken to go from decision to compute some value to +having efficient code that implements it. + +\item Allow computer scientists to work on optimised implementations without +having to understand the subtleties mathematics. + +\item Target code to multiple platforms/architectures/instruction sets via +changes to the code generator rather than the high-level description. + +} + +} + +\frame{ + +\frametitle{The Domain of Variability} + +\itemize{ + +\item The primary value of DSLs is their machine readability, making it +possible to apply automated tools to them (typically a DSL compiler). + +\item In order for a DSL to provide benefit, it is important to +understand the associated \emph{domains of variability}. + +\item Variability in the problem description should be expressible in +the DSL, making it practical to use a DSL based code generator across +multple problems. + +\item Variability in the implementation can be explored via alternative +strategies for code generation implemented inside a DSL compiler. + +} + +} + +\frame{ + +\frametitle{Input variability in UFL (Unified Form Language)} + +\begin{itemize} + +\item The Unified Form Language (UFL) is a DSL for specifying finite element +variational forms developed by the FEniCS project. + +\item Mathematically, we might write the finite element variational form for the +Laplacian as follows: + +\begin{equation*} +a(u,v) = \int_\Omega \nabla u(x) \cdot \nabla v(x)\,dx +\end{equation*} + +\item In UFL (specifying physical discretisation) we would write: + +\input{code/laplacian} + +\end{itemize} + +} + +\frame{ + +\frametitle{Implementation variablity in FFC} + +} + + + + +\end{document} -- 2.47.3