getfem-users
[Top][All Lists]

[Getfem-users] Bloch boundary conditions

 From: Arvind Ajoy Subject: [Getfem-users] Bloch boundary conditions Date: Tue, 7 Jul 2009 14:52:18 +0530

Dear Users,

I need to impose Bloch periodic boundary conditions in order
to solve schrodinger's equation for a periodic potential.

On a domain x = [0,L], I need to impose
\psi(0) = exp(-i k L) \psi(L).

A snippet of what I have tried ...
====================================================
L = 1; k = pi/2;

border = gf_mesh_get(M,'outer faces');
gf_mesh_set(M,'boundary',100,border);

nbd=gf_mesh_fem_get(mfu,'nbdof'); %deg of freedom

[C,R] = gf_asm('dirichlet',100,MIM,mfu,mfu,ones(1,nbd),zeros(1,nbd));
C(nbd,1) = -exp(i * pi/2);
C(1,nbd) = -exp(-i* pi/2);

[N,psi_0]=gf_spmat_get(C,'dirichlet_nullspace',R);
psi_0 = psi_0'; %psi_0 generated by the gf_spmat command is a row. Convert to column.
HH0 = N' * H0 * N;
SS = N' * S * N;

[psi,D]=eigs(HH0,SS,5,0,OPT);
psi = (N * psi);
=================================================================

I find that :
1. HH0 has no imag entries! Hence, psi has no imag entries. The eigvalues are wrong.
2. N is of size nbdof X (nbdof-2) though I have imposed only one condition! If I had imposed
the condition \psi(0) = (some real) * \psi(1), then N is of size nbdof X nbdof -1.

Is it possible to impose Bloch periodic conditions in getfem?

Thanks for any help!

Regards

Arvind