diff options
Diffstat (limited to 'src/physics.h')
-rw-r--r-- | src/physics.h | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/physics.h b/src/physics.h index 38a6100..2557d3c 100644 --- a/src/physics.h +++ b/src/physics.h @@ -4,11 +4,15 @@ #include "common.h" #include "itc.h" +#define LIGHT_SPEED (299792458.0f) +#define MU_ZERO (4.0f * M_PI * 10e-7f) +#define EPS_ZERO (1.0f / (MU_ZERO * LIGHT_SPEED * LIGHT_SPEED)) +#define IMPEDANCE_ZERO (sqrt(MU_ZERO/EPS_ZERO)) + typedef struct { size_t width, height, depth; size_t zstr, ystr, xstr, size; // strides in no. of points (not bytes) - size_t zstr1, ystr1, xstr1, size1; // same as above but for associated - // scalar fields + size_t zstr1, ystr1, xstr1, size1; // same as above but for aux float spacing; // in meters } phy_field_info; @@ -17,18 +21,28 @@ typedef struct { float *H; } phy_field_em; +typedef struct { + float eps, mu; // permittivity and permeability + + vec3_t curl_E, curl_H; + + vec3_t int_E, int_H; + vec3_t int_curl_E, int_curl_H; +} phy_field_aux_point; + enum { PHY_CMD_QUIT, PHY_CMD_PAUSE, PHY_CMD_RESUME, PHY_CMD_STEP, - PHY_CMD_RESET + PHY_CMD_RESET, + PHY_CMD_DEBUG }; typedef struct { phy_field_info field_info; phy_field_em fields[3]; - float *field_eps, *field_mu; //permittivity and permeability + phy_field_aux_point *aux; float time, time_delta; // UI stuff |