Skip to content

Provide SCATTER_func for libraries to replicate SCATTER functionality#2535

Merged
willend merged 1 commit into
mccode-dev:mainfrom
mads-bertelsen:scatter_function
Jun 29, 2026
Merged

Provide SCATTER_func for libraries to replicate SCATTER functionality#2535
willend merged 1 commit into
mccode-dev:mainfrom
mads-bertelsen:scatter_function

Conversation

@mads-bertelsen

@mads-bertelsen mads-bertelsen commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Free-form text area

Please describe what your PR is adding in terms of features or bugfixes:
The SCATTER keyword works in components and provides the current position of the ray to plotting.

That makro is however not available within .c and .h files in share, so components that do most work there can not visualize the ray path in mcdisplay. Here a small function that replicate SCATTER is added to McStas and McXtrace. It is used in conic.h to show the ray path within nested mirror optics.

The function is called SCATTER_func and takes a pointer to the particle, _particle. It returns void.


Development OS / boundary conditions

Please describe what OS you developed and tested your additions on, and if any special dependencies are required:
OS X


PR Checklist for contributing to McStas/McXtrace

For a coherent and useful contribution to McStas/McXtrace, please fill in relevant parts of the checklist:

  • My work touches / adds to the runtime lib code (.c,.h etc in multiple locations

    • I am have added reasoning and documentation for the change below
    • [] I am attaching test output in the comments

…tion of the ray to plotting.

That makro is however not available within .c and .h files in share, so components that do most
work there can not visualize the ray path in mcdisplay.
Here a small function that replicate SCATTER is added to McStas and McXtrace. It is used
in conic.h to show the ray path within nested mirror optics.
@willend

willend commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Nice! I thought you mentioned something about a similar solution in use in ESS_butterfly-related share code, yet I don’t seem to find anything like that now?

@mads-bertelsen

Copy link
Copy Markdown
Contributor Author

The library used in the butterfly component just had mcdisplay function calls, making me realize we could do things like this

@willend

willend commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

OK. Then I will merge like this.

@willend willend merged commit d0129ee into mccode-dev:main Jun 29, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants