HARM
harm and utilities
 All Data Structures Files Functions Variables Typedefs Macros Pages
Functions
fluxct.c File Reference

TOTH CT method for preserving divb=0 (FLUXB==FLUXCTTOTH) More...

#include "decs.h"
Include dependency graph for fluxct.c:

Go to the source code of this file.

Functions

int vpot2field_centeredfield (FTYPE(*A)[NSTORE1+SHIFTSTORE1][NSTORE2+SHIFTSTORE2][NSTORE3+SHIFTSTORE3], FTYPE(*pfield)[NSTORE2][NSTORE3][NPR], FTYPE(*ufield)[NSTORE2][NSTORE3][NPR])
 compute field at CENT from vector potential A at CORN1,2,3 assumes normal field p More...
 

Detailed Description

TOTH CT method for preserving divb=0 (FLUXB==FLUXCTTOTH)

//////////////////////////////

Notes on sign conventions:

/////////////////////////////

flux part is just average of same emf term at 4 different edge locations of (B^2 v^1 - B^1 v^2) COMPEMFZLOOP{ COMPCOMPLOOPINFP1{ // constrain or control better? GODMARK B^i = ^{it} E_i = - [ijk] v^j B^k , such that ( B^i),t = - ((B^i v^j - B^j v^i)),j = - ( [ijk] E_k),j = ([ijk] emf[k]),j

-> E_1 = v^3 B^2 - v^2 B^3 -> E_2 = v^1 B^3 - v^3 B^1 -> E_3 = v^2 B^1 - v^1 B^2

emf[i] = - E_i

And notice that Fj[Bi] = ^{ij} = B^i v^j - B^j v^i , where j=dir

so: emf_1 = B^3 v^2 - B^2 v^3 = F2[B3] or -F3[B2] emf_2 = B^1 v^3 - B^3 v^1 = F3[B1] or -F1[B3] emf_3 = B^2 v^1 - B^1 v^2 = F1[B2] or -F2[B1]

Notice only 6 independent ways. The diagonal terms vanish (e.g. Fi[Bi]=0).

Definition in file fluxct.c.

Function Documentation

int vpot2field_centeredfield ( FTYPE(*)  A[NSTORE1+SHIFTSTORE1][NSTORE2+SHIFTSTORE2][NSTORE3+SHIFTSTORE3],
FTYPE(*)  pfield[NSTORE2][NSTORE3][NPR],
FTYPE(*)  ufield[NSTORE2][NSTORE3][NPR] 
)

compute field at CENT from vector potential A at CORN1,2,3 assumes normal field p

Definition at line 38 of file fluxct.c.

Here is the caller graph for this function: