Normalising a vector field

Asked by L Nagy on 2013-02-26

Hello,

I have a vector field which is the solution of a PDE (i.e. a Function object). I would like to normalise the vector field at each degree of freedom is this possible and if so how?

Kindest regards
Les

Question information

Language:
English Edit question
Status:
Solved
For:
FEniCS Project Edit question
Assignee:
No assignee Edit question
Solved by:
L Nagy
Solved:
2013-02-26
Last query:
2013-02-26
Last reply:
2013-02-26
Anders Logg (logg) said : #1

On Tue, Feb 26, 2013 at 12:11:13PM -0000, L Nagy wrote:
> New question #222877 on FEniCS Project:
> https://answers.launchpad.net/fenics/+question/222877
>
> Hello,
>
> I have a vector field which is the solution of a PDE (i.e. a Function object). I would like to normalise the vector field at each degree of freedom is this possible and if so how?

Try projecting the normalized field:

n = project(v / sqrt(dot(v, v)), V)

--
Anders

L Nagy (l-nagy) said : #2

Thanks Anders! That solved my problem.