[Top][All Lists]

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

Re: [Getfem-users] Unable to use gf_asm for non-homogeneous Dirichlet co

From: Renard Yves
Subject: Re: [Getfem-users] Unable to use gf_asm for non-homogeneous Dirichlet conditions
Date: Sun, 05 Jul 2009 22:25:24 +0200
User-agent: Dynamic Internet Messaging Program (DIMP) H3 (1.1)

Dear Arvind,

Your computation is correct except

FF = N'*F;

which have to be completed by

FF = N'*F-N'*K*U0';

since you solve your system on the new unknown U-U0.


Arvind Ajoy <address@hidden> a écrit :

Dear users,

1 . I am trying to understand the null-space method for imposing constraints
on a system KU=F. I find that the convention used in the documentation is
different under the section for [H,R] =
at and
the example at
the matrix N and N' seem to be interchanged.

Could someone please direct me to a reference where I can understand the
theory behind
the null-space technique?


2. In order to figure out more, I tried a simple problem to solve \frac{d^2
u}{dx^2} = 1 on [0,1]
with boundary conditions u(0) = u(1) =2. However, the solution I obtain is
wrong. The dirichlet conditions
are not imposed correctly. The code is as under

clear all;

M = gf_mesh('cartesian',[0:0.025:1]);
MFU = gf_mesh_fem(M,1);
MIM = gf_mesh_im(M,gf_integ('IM_NC(1,1)'));

nbd = gf_mesh_fem_get(MFU,'nbdof');

A = gf_mesh_fem_get(MFU, 'eval', {-1}) ;
K = gf_asm('laplacian',MIM,MFU,MFU,A) ;
F = gf_asm('volumic source', MIM, MFU, MFU, -A) ;

border = gf_mesh_get(M,'outer faces');
[H,R] = gf_asm('dirichlet',100,MIM,MFU,MFU,ones(1,nbd),2*ones(1,nbd));

KK = N'*K*N;
FF = N'*F;

UU = KK \ FF;
U = (N * UU)' + U0;

x = linspace(0,1,100);
plot(x,0.5*x.^2 - 0.5*x + 2,'b');

hold on;


Thanks for any help!


PhD Student, Indian Institute of Technology Madras

reply via email to

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