Skip to content

[Feature💡] n_transverse_cells is hardcoded to 1 — should it be a user-configurable parameter? #62

Description

@saraadastan

Hi,
During Wakefield simulations of scraper geometries for the Elettra 2.0 synchrotron, I found that n_transverse_cells is effectively hardcoded to 1 in two places:

wakeSolver.py: self.n_transverse_cells = 1 (default, never exposed to the user)
routines.py: xx, yy = slice(self.ixt-1, self.ixt+2), slice(self.iyt-1, self.iyt+2) (hardcoded ±1, ignores the attribute above)

When I changed both to use n=3 (7×7 transverse grid), the transverse wake potentials WPx(s) and WPy(s) improved significantly compared to CST Wakefield Solver. With the default 3×3 grid, the gradient W is undersampled and the results are noisy.
The appropriate value of n depends on the geometry, for example, for scrapers and collimators a larger grid is needed, while for symmetric cavities n=1 may be sufficient.
My question: would it make sense to expose n_transverse_cells as a proper user-configurable parameter, so the user can set it based on their geometry before running the simulation?

I would be happy to contribute a PR if this is of interest.

Thanks,
Sara

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Fields

No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions