getfem-users
[Top][All Lists]
Advanced

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

Re: [Getfem-users] assembling Matrix


From: julien pommier
Subject: Re: [Getfem-users] assembling Matrix
Date: Fri, 31 Mar 2006 18:21:15 +0200
User-agent: Debian Thunderbird 1.0.7 (X11/20051017)

Hello Mario,
The simplest way to set the Dirichlet boundary condition is, (if you use Lagrange finite element such as PK or QK fem), to simply eliminate the columns and rows of the matrix that correspound to the imposed dof, for example

ddof=gf_mesh_fem_get(mf, 'dof on boundary', ibound);
M(ddof, ddof) = []
K(ddof, ddof) = []

A "better" (more general) way would be to eliminate the Dirichlet unknowns this way
(taken from the demo_tripod_alt.m of getfem-interface-2.0):
% handle Dirichlet condition
[H,R]=gf_asm('dirichlet', 2, mim, mfu, mfd, repmat(eye(3),[1,1,nbd]), zeros(3, nbd));
[N,U0]=gf_spmat_get(H, 'dirichlet_nullspace', R);
% build the reduced system
KK=N'*K*N;
FF=N'*F;
UU=KK\FF;
% get back to the unreduced solution
U=(N*UU).'+U0;

--
julien



reply via email to

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