help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Octave forge] [bim package]


From: c.
Subject: Re: [Octave forge] [bim package]
Date: Sun, 4 Feb 2018 17:55:17 +0100


> On 4 Feb 2018, at 17:02, c. <address@hidden> wrote:
> 
> 
> 
>> On 4 Feb 2018, at 10:17, JuanPi <address@hidden> wrote:
>> 
>> Hi all,
>> 
>> I've been plain with the bim package and the 1D laplacian.
>> Can it be that the functions bim1a_* only work with evenly spaced +D meshes?
>> Or should they work with any 1D mesh?
> 
> They should work for non-uniform meshes.
> Actually they have been extensively tested on layer-adapted meshes [1,2].
> Can you show an example that is not working?


This code snippet for example:

>> pkg load bim
>> x = [linspace(0, .5, 100), linspace(.5, 1, 200)(2:end)].';
>> A = bim1a_laplacian (x, 1, 1);
>> b = bim1a_rhs (x, 1, 1);
>> u = zeros (size (x));
>> u(2:end-1) = A(2:end-1, 2:end-1) \ b(2:end-1);
>> plot (x, u, 'x-')

solves 

- u''(x) = 1    in 0 < x < 1
u(0) = u(1) = 0

on a piece-wise uniform mesh.

>> Cheers
> 
> c.
> 
> [1] http://www.math.ualberta.ca/ijnam/Volume-7-2010/No-3-10/2010-03-04.pdf
> [2] https://link.springer.com/chapter/10.1007/978-3-642-00605-0_9
> 
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]