Normalising a vector field

Asked by L Nagy

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:
Last query:
Last reply:
Revision history for this message
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

Revision history for this message
L Nagy (l-nagy) said :
#2

Thanks Anders! That solved my problem.