← Back to team overview

dolfin team mailing list archive

Re: [Question #152565]: Setting up a point source linear form

 

Question #152565 on DOLFIN changed:
https://answers.launchpad.net/dolfin/+question/152565

Anders Logg proposed the following answer:
On Tue, Apr 19, 2011 at 06:36:17PM -0000, Neilen Marais wrote:
> Question #152565 on DOLFIN changed:
> https://answers.launchpad.net/dolfin/+question/152565
>
> Neilen Marais posted a new comment:
> Anders,
>
> Moving in the right direction, by for my application the source needs to
> be applicable to a vector function.
>
> One could extend the PointSource object to accept a vector value instead
> of magnitude I assume?
>
> I'm going to see if I can hack this in, but my C++foo is sorely lacking.
> Don't hold your breath :)

I suggest applying the point source for each component. I thought about
this when I added the PointSource class and decided that was the best
design.

ps0 = PointSource(V.sub(0), x)
ps1 = PointSource(V.sub(1), x)

ps0.apply(b)
ps1.apply(b)

I haven't tested this (and someone will blame me for not writing a
unit test yet) but I hope it works.

--
Anders

-- 
You received this question notification because you are a member of
DOLFIN Team, which is an answer contact for DOLFIN.