# HG changeset patch # User gedeone-octave # Date 1372975883 -7200 # Node ID 1974b68095fc1cd1d2d5dbe81f5ea267693e6033 # Parent d5ad40b62356ebf3086706560f4f90e8201053cc Maint: create a new folder for all the test needed by TDD diff -r d5ad40b62356 -r 1974b68095fc test/laplace.m --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/laplace.m Fri Jul 05 00:11:23 2013 +0200 @@ -0,0 +1,28 @@ +#Example of how we expect the Octave interface to look like +#This file is our test for the TDD + +# Create mesh +init_dolfin (); + +x = y = linspace (0, 1, 32) ; +msho = msh2m_structured_mesh (x, y, 1, [ 1 1 2 2 ]) +mshd = dolfin_mesh (msho); + +#Compile the problem defined in the .ufl file +ffc ("Laplace.ufl"); + +#Import the problem inside Octave +V = FunctionSpace (mshd, "Laplace"); +sd = SubDomain (mshd, @(x, y) abs (x - 1.0) < eps, "Laplace"); +bc = DirichletBC (V, @(x, y) 0.0, sd, "Laplace"); + +#Get the matrices +A = BilinearForm (V, V, bc, "Laplace"); +L = LinearForm (V, bc, "Laplace"); + +#Solve it +u = A\L; + +#Plot +uf = Function (V, u); +dolfin_plot (uf, "Solution")