Save magnitude of vector field

Numerical methods and mathematical models of Elmer
Post Reply
sato
Posts: 13
Joined: 09 May 2020, 05:23
Antispam: Yes

Save magnitude of vector field

Post by sato »

Dear, all


I'm planning a simple electromagnetic analysis with WhitneyAVHarmonicSolver.

The computation of the model itself was done well but I had a problem with saving values.

To get mean value of magnitude of electric field and magnetic flux density, I wrote code below.

Code: Select all

Solver 3
  Equation = SaveScalars
  Procedure = "SaveData" "SaveScalars"

  Variable 1 = Electric Field Re e
  Operator 1 = body int mean
  Mask Name 1 = probe

  Variable 2 = Electric Field Im e
  Operator 2 = body int mean
  Mask Name 2 = probe

  Variable 3 = Magnetic Flux Density Re e
  Operator 3 = body int mean
  Mask Name 3 = probe

  Variable 4 = Magnetic Flux Density Im e
  Operator 4 = body int mean
  Mask Name 4 = probe
 End 

Comparing .dat file by savescalars with the field value, it seemed that the saved value was not the magnitude but x component of the field.

I guess

Code: Select all

  Variable 1 = Electric Field Re e 
is not a magnitude value.


Could anyone tell me how to save magnitude of vector values?

Satoshi
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Save magnitude of vector field

Post by raback »

Hi Satoshi,

The operators were meant for scalar fields. If this was a vector field the results do not really make sense as the indexing goes wrong.

You assumed that scalar operators working on vector field would work on the length. It is not a bad convention, certainly better than the above.

I will soonish commit a fix. Just running some tests.

-Peter
Post Reply