Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
6b84b26
Initial commit of Phonon_BvK_PG and test instrument
lefmann Feb 24, 2026
fd9ff3b
Suppress (unused) Avery mergesort in Phonon_BvK_PG.
willend Feb 24, 2026
9156ac3
Removed unused mergesort from J Avery
willend Feb 24, 2026
6d7377a
Transport J Avery eigen "lib" to mcstas-comps/share and %include
willend Feb 24, 2026
dec85d4
Remove eigen-types.h, was added top of eigen.h
willend Feb 24, 2026
7b0914c
Remove OUTPUT and DEFINITION pars (McStas 2.x style)
willend Feb 24, 2026
470e7d9
Use mccode-style single-line %include import
willend Feb 24, 2026
308ace4
Protecti for multiple imports via defines
willend Feb 24, 2026
bacaad9
Add headers mentioning James Avery contribution
willend Feb 24, 2026
4eb771f
Mark component NOACC (execute CPU only for now)
willend Feb 24, 2026
6351866
Use mccode-complex-lib
willend Feb 25, 2026
578de7c
Let J Avery solver use mccode-complex-lib cdouble type
willend Feb 25, 2026
0b98c9e
Apply clangformat for reability/structure
willend Feb 25, 2026
9ef6b2e
AI-assisted rewrite of central functions to use mccode-complex-lib wr…
willend Feb 25, 2026
93b54b8
Add %Example expectation value
willend Feb 25, 2026
3d6754e
Merge branch 'main' into main
willend May 18, 2026
e84c7f2
Rewrite of original comp to use mccode-complex-lib
willend Jun 20, 2026
06e0701
Merge branch 'main' into main
willend Jun 21, 2026
d6c563e
egenvalues are NOT complex, findroots never returns value -> void
willend Jun 21, 2026
8b1b4d5
Merge branch 'main' into main
willend Aug 29, 2026
9bd0001
Merge branch 'main' into main
willend Oct 4, 2026
caa72ef
Merge branch 'main' into main
willend Oct 20, 2026
62c8658
Merge branch 'main' into main
willend Oct 20, 2026
b81cd26
Merge branch 'main' into main
willend Oct 27, 2026
fe2c228
Merge branch 'main' into main
willend Oct 29, 2026
d3793dd
Phonon_BvK_PG: bound root list, guard nf, own SHARE guard (port of #2…
willend Nov 1, 2026
bd2d044
Phonon_BvK_PG: drop "#pragma acc routine" from the NOACC component's …
willend Nov 1, 2026
b49a15d
Phonon_BvK_PG: OpenACC port of the component and the eigen solver, dr…
willend Nov 1, 2026
3a6b482
Phonon_BvK_PG: make sqrt3 a double literal (nvc: unsupported X87TODP)
willend Nov 1, 2026
0ad719f
Merge branch 'main' into main
willend Nov 1, 2026
cfe4e8a
Merge branch 'main' into 2026-11-bvk-openacc
willend Nov 1, 2026
dc99f30
Phonon_BvK_PG: no exit() on the device (nvlink: undefined reference t…
willend Nov 3, 2026
ccc9717
Merge branch 'main' into main
willend Nov 3, 2026
fc5269e
Merge branch 'main' into main
willend Nov 7, 2026
92fcd0d
Merge branch 'main' into 2026-11-bvk-openacc
willend Nov 7, 2026
09c93ea
Merge branch 'main' into main
willend Nov 8, 2026
22eab3a
Merge branch 'main' into 2026-11-bvk-openacc
willend Nov 8, 2026
cc73d2e
Merge branch 'main' into 2026-11-bvk-openacc
willend Nov 8, 2026
39b6152
Merge branch 'main' into main
willend Nov 8, 2026
9b8d178
Merge branch 'main' into main
willend Nov 14, 2026
9763576
Merge branch 'main' into 2026-11-bvk-openacc
willend Nov 14, 2026
ece922c
Counter-vars should never be DECLARED as comp vars for thread-safetly.
willend Nov 15, 2026
2238aae
Phonon_BvK_PG: fix eigen.c leaks, macro clashes and random mode range
willend Nov 15, 2026
6757727
Phonon_BvK_PG: per-instance state, validation and numerical guards
willend Nov 15, 2026
266fc1d
Phonon_BvK_PG: cleanup
willend Nov 15, 2026
c399016
Merge #2344 fixes (2238aae7e, 67577276e, 266fc1d58) into 2026-11-bvk-…
willend Nov 15, 2026
b82d13d
Merge branch 'main' into 2026-11-bvk-openacc
willend Nov 15, 2026
a33edef
mccode-complex-lib: make the wrappers static inline
willend Nov 15, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions common/lib/share/mccode-complex-lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,25 @@
// Note: leave two spaces between double and cdouble because double->float
// in generate._convert_type is not clever enough.
typedef complex double cdouble;
inline cdouble cplx(const double x, const double y) { return x + y*I; }
inline cdouble cneg(const cdouble a) { return -a; }
inline cdouble radd(const double a, const cdouble b) { return a+b; }
inline cdouble rmul(const double a, const cdouble b) { return a*b; }
inline cdouble cadd(const cdouble a, const cdouble b) { return a+b; }
inline cdouble csub(const cdouble a, const cdouble b) { return a-b; }
inline cdouble cmul(const cdouble a, const cdouble b) { return a*b; }
inline cdouble cdiv(const cdouble a, const cdouble b) { return a/b; }
static inline cdouble cplx(const double x, const double y) { return x + y*I; }
static inline cdouble cneg(const cdouble a) { return -a; }
static inline cdouble radd(const double a, const cdouble b) { return a+b; }
static inline cdouble rmul(const double a, const cdouble b) { return a*b; }
static inline cdouble cadd(const cdouble a, const cdouble b) { return a+b; }
static inline cdouble csub(const cdouble a, const cdouble b) { return a-b; }
static inline cdouble cmul(const cdouble a, const cdouble b) { return a*b; }
static inline cdouble cdiv(const cdouble a, const cdouble b) { return a/b; }
#else
// MSVC
typedef _Dcomplex cdouble;
inline cdouble cplx(const double x, const double y) { cdouble z = _Cbuild(x,y); return z; }
inline cdouble cneg(const cdouble a) { return cplx( -creal(a) , -cimag(a) ); }
inline cdouble radd(const double a, const cdouble b) { return cplx(a+creal(b),cimag(b)); }
inline cdouble rmul(const double a, const cdouble b) { return cplx(a*creal(b),a*cimag(b)); }
inline cdouble cadd(const cdouble a, const cdouble b) { return cplx(creal(a)+creal(b),cimag(a)+cimag(b)); }
inline cdouble csub(const cdouble a, const cdouble b) { return cplx(creal(a)-creal(b),cimag(a)-cimag(b)); }
inline cdouble cmul(const cdouble a, const cdouble b) { return cplx(creal(a)*creal(b) - cimag(a)*cimag(b), cimag(a)*creal(b) + creal(a)*cimag(b)); }
inline cdouble cdiv(const cdouble a, const cdouble b) { return cplx((creal(a)*creal(b)+cimag(a)*cimag(b))/(creal(b)*creal(b)+cimag(b)*cimag(b)),(cimag(a)*creal(b)-creal(a)*cimag(b))/(creal(b)*creal(b)+cimag(b)*cimag(b))); }
static inline cdouble cplx(const double x, const double y) { cdouble z = _Cbuild(x,y); return z; }
static inline cdouble cneg(const cdouble a) { return cplx( -creal(a) , -cimag(a) ); }
static inline cdouble radd(const double a, const cdouble b) { return cplx(a+creal(b),cimag(b)); }
static inline cdouble rmul(const double a, const cdouble b) { return cplx(a*creal(b),a*cimag(b)); }
static inline cdouble cadd(const cdouble a, const cdouble b) { return cplx(creal(a)+creal(b),cimag(a)+cimag(b)); }
static inline cdouble csub(const cdouble a, const cdouble b) { return cplx(creal(a)-creal(b),cimag(a)-cimag(b)); }
static inline cdouble cmul(const cdouble a, const cdouble b) { return cplx(creal(a)*creal(b) - cimag(a)*cimag(b), cimag(a)*creal(b) + creal(a)*cimag(b)); }
static inline cdouble cdiv(const cdouble a, const cdouble b) { return cplx((creal(a)*creal(b)+cimag(a)*cimag(b))/(creal(b)*creal(b)+cimag(b)*cimag(b)),(cimag(a)*creal(b)-creal(a)*cimag(b))/(creal(b)*creal(b)+cimag(b)*cimag(b))); }
#endif

#endif
Expand Down
Loading
Loading