Compiled cores¶
The C++ kernels the solvers build on install (python -m kicad2ems.mom25d.core.build, python -m kicad2ems.gfdtd.core.build), from
their sources through Doxygen. Without a built core each falls back to NumPy.
mom25d¶
The method of moments’ kernels: the singular and near-singular integrals and the matrix fill (OpenMP).
Functions
-
static inline double bessel_j0(double x)¶
-
static inline double dist(const double *c, int p, int q)¶
-
void fill_far_half(py::array_t<cd> Zh, arr<i64> rowptr, arr<i64> c0, py::dict geom, py::dict tabs, double w)¶
-
static inline bool rule_over_p(double ap, double aq, int p, int q)¶
-
static inline double tri_area(const double *nd, const int *tr, int t)¶
-
static inline void offplane_one(const double *V, const double *P6, const double *W6, double d, double &m0, double mro[2], double mrs[2], double &mrr)¶
-
py::tuple offplane_pairs(arr<double> nodes, arr<int> tris, arr<double> P6, arr<double> W6, arr<int> P, arr<int> Q, double d)¶
-
void near_core(const Mesh &g, const Tables &tb, const double *nodes, const int *tris, const double *P3, const double *W3, const double *P6, const double *W6, const int *P, const int *Q, int n, double w, NearOut &o)¶
-
py::array_t<cd> near_into_dense(py::array Z, py::dict geom, py::dict tabs, py::dict quad, arr<int> P, arr<int> Q, double w)¶
-
py::array_t<cd> near_into_half(py::array_t<cd> Zh, arr<i64> rowptr, arr<i64> c0, py::dict geom, py::dict tabs, py::dict quad, arr<int> P, arr<int> Q, double w)¶
-
py::array_t<cd> near_matvec(arr<cd> x, py::dict geom, py::dict tabs, py::dict quad, arr<int> P, arr<int> Q, double w)¶
-
py::array_t<cd> near_q(py::dict geom, py::dict tabs, py::dict quad, arr<int> P, arr<int> Q, double w)¶
-
static TreeView tree_view(arr<int> &node, arr<int> &parent, arr<int> &branch, arr<double> &sig, arr<int> &roots, arr<int> &cot, arr<int> &cu, arr<int> &cv, int n_nodes)¶
-
void tree_cols(py::array_t<cd> X, arr<int> node, arr<int> parent, arr<int> branch, arr<double> sig, arr<int> roots, arr<int> cot, arr<int> cu, arr<int> cv, int n_nodes)¶
-
void tree_rows(py::array_t<cd> X, arr<int> node, arr<int> parent, arr<int> branch, arr<double> sig, arr<int> roots, arr<int> cot, arr<int> cu, arr<int> cv, int n_nodes)¶
-
void lt_half_step(py::array_t<cd> data, arr<i64> rp, arr<i64> c0, arr<uint8_t> is_tree, int step, arr<int> node, arr<int> parent, arr<int> branch, arr<double> sig, arr<int> roots, arr<int> cot, arr<int> cu, arr<int> cv, int n_nodes)¶
-
template<class Off, class First>
static void charge_rows(cd *z, Off off, First first, const cd *M, i64 nf, int f0, const int *tr, const int *pu, const int *pv, int nt, const double *ar, int g)¶
-
void charge_into(py::array_t<cd> Z, arr<cd> Mq, arr<int> tree, arr<int> u, arr<int> v, arr<double> area, int g, int f0)¶
-
void charge_into_half(py::array_t<cd> data, arr<i64> rp, arr<i64> c0, arr<cd> Mq, arr<int> tree, arr<int> u, arr<int> v, arr<double> area, int g, int f0)¶
-
int num_threads()¶
-
py::array_t<cd> radial_table_sum(arr<double> px, arr<double> py_, arr<double> W, arr<double> vx, arr<double> vy, arr<cd> table, double dr)¶
-
static inline void cross3(const double *a, const double *b, double *c)¶
-
static inline double dot3(const double *a, const double *b)¶
-
py::object pair_moments3d(arr<double> Vo, arr<double> Vs, arr<double> bar, arr<double> wq, bool scalar_only)¶
-
py::tuple sides_blocks(arr<double> Po, arr<double> Wo, arr<int> olay, arr<double> sp, arr<int> slay, arr<int> lt, py::list tabs, arr<double> drs, arr<i64> sptr, arr<int> sfn, arr<double> sfx, arr<double> sfy, arr<double> sdq, arr<i64> nptr, arr<int> nfn, arr<double> d1, arr<double> dx, arr<double> dy, arr<double> dz, arr<cd> dq, arr<i64> hptr, arr<int> htgt, arr<double> hal, arr<double> hv, arr<int> fpos, i64 Nrow, i64 N, i64 nF, double w, i64 chunk, i64 skip_o, i64 skip_p, double far)¶
-
static void sub_rule(int level, std::vector<double> &bar, std::vector<double> &w)¶
-
py::array_t<cd> slot_coupling(arr<double> Vt, arr<double> At, arr<double> St, arr<double> Vu, arr<double> Au, arr<double> Su, double dz, arr<cd> tabP, arr<cd> tabU, double dr, double near, int sub_max)¶
-
static inline double bessel_j1(double x)¶
-
static inline double bessel_jn(int n, double x)¶
-
py::array_t<cd> bessel_jn_complex(int n, py::array_t<cd, py::array::c_style | py::array::forcecast> z)¶
-
void loop_transform(py::array_t<cd, py::array::c_style> Z, arr<i64> V, arr<i64> idx, arr<double> cw)¶
-
template<class T>
void pack_half_t(py::array_t<T, py::array::c_style> Z, arr<double> d, py::array_t<cf> out, int nb)¶
-
void ldl_diag(py::array_t<cf> A, py::array_t<cf> pack, py::array_t<cf> linvt, py::array_t<cf> dinv, py::array_t<cf> linv)¶
-
template<class C>
py::array_t<C> project_t(py::array_t<C, py::array::c_style> Z, arr<int> keep, arr<int> elim, arr<int> cp, arr<int> ci, arr<double> cv, arr<int> tp, arr<int> ti, arr<double> tv, int Nr)¶
-
PYBIND11_MODULE(_core, m)¶
Variables
-
static const int NEAR_STAT = 12¶
-
struct Tables¶
Public Functions
-
struct Mesh¶
-
struct NearOut¶
-
struct TreeView¶
-
template<class Sc>
class BLRFactorT¶ Public Functions
-
inline BLRFactorT(arr<int> order, arr<int> start, arr<uint8_t> far, py::dict geom, py::dict tabs, double w, arr<i64> nptr, arr<int> nidx, arr<cd> nval, arr<cd> B, arr<cd> C, arr<double> dsc, double atol, int max_rank, bool factor_it, double max_bytes, bool symmetric)¶
-
inline py::dict stats() const¶
Private Functions
-
inline size_t bytes() const¶
-
inline void schur(blrk::Tile<Sc> &c, const blrk::Tile<Sc> &a, const blrk::Tile<Sc> &b, int max_rank)¶
-
inline void factor(int max_rank)¶
Private Members
-
int N_ = 0¶
-
int nb_ = 0¶
-
double atol_ = 0¶
-
double t_assemble_ = 0¶
-
double t_factor_ = 0¶
-
bool factored_ = true¶
-
std::atomic<bool> over_ = {false}¶
-
bool sym_ = false¶
-
std::atomic<size_t> held_ = {0}¶
-
std::atomic<size_t> done_ = {0}¶
-
std::vector<int> order_¶
-
std::vector<int> start_¶
-
std::vector<std::vector<int>> piv_¶
-
int dense0_ = 0¶
-
int lowrank0_ = 0¶
-
int singular_ = 0¶
-
long rank0_ = 0¶
-
size_t bytes0_ = 0¶
-
inline BLRFactorT(arr<int> order, arr<int> start, arr<uint8_t> far, py::dict geom, py::dict tabs, double w, arr<i64> nptr, arr<int> nidx, arr<cd> nval, arr<cd> B, arr<cd> C, arr<double> dsc, double atol, int max_rank, bool factor_it, double max_bytes, bool symmetric)¶
-
namespace blrk¶
Functions
-
static double wall()¶
-
static void *capsule(const char *mod, const std::string &name)¶
-
template<class Sc>
static void gemm(char ta, char tb, int m, int n, int k, Sc alpha, const Sc *A, int lda, const Sc *B, int ldb, Sc beta, Sc *C, int ldc)¶
-
template<class Sc>
static void trsm(char side, char uplo, char trans, char diag, int m, int n, const Sc *A, int lda, Sc *B, int ldb)¶
-
template<class T>
struct Lapack¶ Public Types
-
template<class Sc>
struct Tile¶
-
static double wall()¶
gfdtd¶
The FDTD update, shared by the GPU kernels (Vulkan) and the CPU core.
Typedefs
-
typedef long long idx_t¶
Functions
-
inline void gf_h_node(int i, int j, int k, idx_t t, const float *V, float *I, const float *G, Dims D, float kh)¶
-
template<typename C>
inline void gf_e_comp(int a, idx_t t, float c, float geo, float *V, const C *code, const float *tvv, const float *ts, const int *tpole, const float *tkb, const float *tka, const float *th, int P, const int *slot, float *pol, float dt, idx_t n)¶
-
template<typename C>
inline void gf_e_node(int i, int j, int k, idx_t t, float *V, const float *I, const C *code, const float *tvv, const float *ts, const int *tpole, const float *tkb, const float *tka, const float *th, int P, const int *slot, float *pol, const float *G, Dims D, float ke, float dt)¶
-
template<typename C>
inline double gf_energy_node(int i, int j, int k, idx_t t, const float *V, const float *I, const C *code, const float *ts, const float *G, Dims D, float ke, float kh)¶
-
inline void gf_pml_e(idx_t e, idx_t m, float *V, const float *I, float *psi, const float *b, const float *c, const float *k1, const float *k2, Dims D, int a, int s0, int cnt)¶
-
inline void gf_pml_h(idx_t e, idx_t m, const float *V, float *I, float *psi, const float *b, const float *c, const float *k1, const float *k2, Dims D, int a, int s0, int cnt)¶
-
inline void gf_ferrite_cell(idx_t c, int nc, const int *ce, const float *ck, float *cs, float *cd, const idx_t *ei, const float *eli, const float *em, const float *I)¶
-
inline void gf_ferrite_cell3(idx_t c, int nc, const int *ce, const float *ck, float *cs, float *cd, const idx_t *ei, const float *eli, const float *em, const float *I)¶
-
inline void gf_ferrite_edge(idx_t e, const int *ec, const float *ew, const float *cd, float *em, float *I, const idx_t *ei, const float *el)¶
-
template<typename C>
inline void gf_e_row_comp(int a, idx_t t0, int kn, float *Vr, const float *Pp, const float *Pm, const float *Qp, const float *Qm, const float *geo_k, float f, const C *code, const float *tvv, const float *ts, const int *tpole, const float *tkb, const float *tka, const float *th, int P, const int *slot, float *pol, float dt, idx_t n, float *old, bool poles)¶
-
template<typename C>
inline void gf_e_row(int i, int j, float *V, const float *I, const C *code, const float *tvv, const float *ts, const int *tpole, const float *tkb, const float *tka, const float *th, int P, const int *slot, float *pol, const float *G, Dims D, float ke, float dt, float *scratch, bool poles)¶
-
struct Dims¶
- #include <fdtd_core.h>
Typedefs
-
template<typename T>
using arr = py::array_t<T, py::array::c_style | py::array::forcecast>
Functions
-
template<typename C>
static void update_e(arr<float> V, arr<float> I, arr<C> code, arr<float> tvv, arr<float> ts, arr<int32_t> tpole, arr<float> tkb, arr<float> tka, arr<float> th, int P, arr<int32_t> slot, arr<float> pol, arr<float> G, int nx, int ny, int nz, float ke, float dt)¶
-
static void mur_post(arr<float> V, arr<int64_t> i0, arr<int64_t> i1, arr<float> k, arr<float> o0, arr<float> o1)¶
-
template<typename C>
static double energy(arr<float> V, arr<float> I, arr<C> code, arr<float> ts, arr<float> G, int nx, int ny, int nz, float ke, float kh)¶
-
template<bool E>
static void pml(arr<float> V, arr<float> I, arr<float> psi, arr<float> b, arr<float> c, arr<float> k1, arr<float> k2, int nx, int ny, int nz, int a, int s0, int cnt)¶
-
template<int NA>
static void ferrite(arr<float> I, arr<int32_t> ce, arr<float> ck, arr<float> cs, arr<float> cd, arr<int64_t> ei, arr<float> el, arr<float> eli, arr<int32_t> ec, arr<float> ew, arr<float> em)¶
-
PYBIND11_MODULE(_core, m)
-
struct FlushDenormals¶