Skip to content

Instantly share code, notes, and snippets.

View ataias's full-sized avatar

Ataias Pereira Reis ataias

View GitHub Profile
@ataias
ataias / poisson.jl
Last active August 29, 2015 14:15
Module written in Julia to solve Poisson equation with Neumann conditions in a square of side 1. Includes a test problem and its solution for comparison. A staggered grid is used.
module Poisson
#This is used to solve the system Ax = b in step 2
export poissonNeumannSparseSolver, getANeumannSparse, testPoissonNeumannSparse
function getANeumannSparse(n)
spn = (n-2)*(n-2) #sparse n
#Definir matriz A
A = 4*speye(spn, spn)
k=0
@ataias
ataias / pgraphics.sty
Last active August 29, 2015 14:14
Staggered grid with Tikz
\ProvidesPackage{pgraphics}
\newcommand{\domainOne}[0]{
\begin{center}
\tikzstyle{help lines}+=[dashed]%
\begin{tikzpicture}
%axes
\draw[->] (0,5) -- (xyz cs:y=6);
\draw (0,6.3) node {$y(j)$};
\draw[->] (5,0) -- (xyz cs:x=6);