Order of basis functions of vector function space

Asked by Yi Jiang

Hi all,

I have a basic question about the assembly process. Suppose we are working in a vector function space, say

mesh = UnitSquare(8,8)
W = VectorFunctionSpace(mesh, 'CG', 1)
u = TrialFunction(W)
v = TestFunction(W)

So mathematically, W can be regarded as V*V, where V is a usual scale function space defined on the mesh. If there are n vertices of the mesh, then the basis functions of V can be denoted by (phi_1, phi_2, ..., phi_n).

My question is, when we assemble variational forms (say, a bilinear form a(u, v) and a linear form l(v)) defined by u and v (i.e., in the vector function space), what is the order of basis functions used (to substitute v) to generate the 2n*2n stiffness matrix A and the right hand side vector b?

(phi_1, 0), (phi_2, 0), ..., (phi_n, 0), (0, phi_1), (0, phi_2), ..., (0, phi_n)
or
(phi_1, 0), (0, phi_1), ..., (phi_n, 0), (0, phi_n)

I guess it is the first one, however, I need to confirm it. The question was raised when I was trying to apply some point source functions (Dirac Delta) in my linear form. Since the PointSource object can only be used in a scale function space, say W.sub(0), I wanna make sure that the PointSource object modifies the correct component of the right hand side vector b.

Thank you for your time.

Best wishes,

Question information

Language:
English Edit question
Status:
Solved
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Solved by:
Anders Logg
Solved:
Last query:
Last reply:
Revision history for this message
Best Anders Logg (logg) said :
#1

On Fri, Jan 06, 2012 at 04:50:42PM -0000, Yi Jiang wrote:
> New question #183912 on DOLFIN:
> https://answers.launchpad.net/dolfin/+question/183912
>
> Hi all,
>
> I have a basic question about the assembly process. Suppose we are working in a vector function space, say
>
> mesh = UnitSquare(8,8)
> W = VectorFunctionSpace(mesh, 'CG', 1)
> u = TrialFunction(W)
> v = TestFunction(W)
>
> So mathematically, W can be regarded as V*V, where V is a usual scale function space defined on the mesh. If there are n vertices of the mesh, then the basis functions of V can be denoted by (phi_1, phi_2, ..., phi_n).
>
> My question is, when we assemble variational forms (say, a bilinear form a(u, v) and a linear form l(v)) defined by u and v (i.e., in the vector function space), what is the order of basis functions used (to substitute v) to generate the 2n*2n stiffness matrix A and the right hand side vector b?
>
> (phi_1, 0), (phi_2, 0), ..., (phi_n, 0), (0, phi_1), (0, phi_2), ..., (0, phi_n)
> or
> (phi_1, 0), (0, phi_1), ..., (phi_n, 0), (0, phi_n)

It is the first one.

--
Anders

> I guess it is the first one, however, I need to confirm it. The question was raised when I was trying to apply some point source functions (Dirac Delta) in my linear form. Since the PointSource object can only be used in a scale function space, say W.sub(0), I wanna make sure that the PointSource object modifies the correct component of the right hand side vector b.
>
> Thank you for your time.
>
> Best wishes,
>

Revision history for this message
Yi Jiang (yijiang) said :
#2

Thanks Anders Logg, that solved my question.