Grids
Warning
This section is currently in development.
3D Cartesian geometry
- class picmistandard.PICMI_Cartesian3DGrid(*, number_of_dimensions: int = 3, number_of_cells: ~types.Annotated[~collections.abc.Sequence[int] | None, ~annotated_types.MinLen(min_length=3), ~annotated_types.MaxLen(max_length=3)] = None, lower_bound: ~types.Annotated[~collections.abc.Sequence[float] | None, ~annotated_types.MinLen(min_length=3), ~annotated_types.MaxLen(max_length=3)] = None, upper_bound: ~types.Annotated[~collections.abc.Sequence[float] | None, ~annotated_types.MinLen(min_length=3), ~annotated_types.MaxLen(max_length=3)] = None, lower_boundary_conditions: ~types.Annotated[~collections.abc.Sequence[str] | None, ~annotated_types.MinLen(min_length=3), ~annotated_types.MaxLen(max_length=3)] = None, upper_boundary_conditions: ~types.Annotated[~collections.abc.Sequence[str] | None, ~annotated_types.MinLen(min_length=3), ~annotated_types.MaxLen(max_length=3)] = None, nx: int | None = None, ny: int | None = None, nz: int | None = None, xmin: float | None = None, xmax: float | None = None, ymin: float | None = None, ymax: float | None = None, zmin: float | None = None, zmax: float | None = None, bc_xmin: str | None = None, bc_xmax: str | None = None, bc_ymin: str | None = None, bc_ymax: str | None = None, bc_zmin: str | None = None, bc_zmax: str | None = None, lower_bound_particles: ~types.Annotated[~collections.abc.Sequence[float] | None, ~annotated_types.MinLen(min_length=2), ~annotated_types.MaxLen(max_length=2)] = None, upper_bound_particles: ~types.Annotated[~collections.abc.Sequence[float] | None, ~annotated_types.MinLen(min_length=2), ~annotated_types.MaxLen(max_length=2)] = None, lower_boundary_conditions_particles: ~types.Annotated[~collections.abc.Sequence[str] | None, ~annotated_types.MinLen(min_length=2), ~annotated_types.MaxLen(max_length=2)] = None, upper_boundary_conditions_particles: ~types.Annotated[~collections.abc.Sequence[str] | None, ~annotated_types.MinLen(min_length=2), ~annotated_types.MaxLen(max_length=2)] = None, xmin_particles: float | None = None, xmax_particles: float | None = None, ymin_particles: float | None = None, ymax_particles: float | None = None, zmin_particles: float | None = None, zmax_particles: float | None = None, bc_xmin_particles: str | None = None, bc_xmax_particles: str | None = None, bc_ymin_particles: str | None = None, bc_ymax_particles: str | None = None, bc_zmin_particles: str | None = None, bc_zmax_particles: str | None = None, moving_window_velocity: ~collections.abc.Sequence[float] | None = None, refined_regions: list[list] = <factory>, guard_cells: ~collections.abc.Sequence[int] | None = None, pml_cells: ~collections.abc.Sequence[int] | None = None, **extra_data: ~typing.Any)[source]
Base class for all PICMI classes using Pydantic for validation and extensibility.
This class allows code-specific extensions (e.g., warpx_* kwargs) via Pydantic’s extra fields mechanism while maintaining type safety for standard attributes.
Implementation specific documentation
Three dimensional Cartesian grid. Parameters can be specified either as vectors or separately. (If both are specified, the vector is used.)
References
absorbing_silver_mueller: A local absorbing boundary condition that works best under normal incidence angle. Based on the Silver-Mueller Radiation Condition, e.g., in
A. K. Belhora and L. Pichon, “Maybe Efficient Absorbing Boundary Conditions for the Finite Element Solution of 3D Scattering Problems,” 1995, https://doi.org/10.1109/20.376322
B Engquist and A. Majdat, “Absorbing boundary conditions for numerical simulation of waves,” 1977, https://doi.org/10.1073/pnas.74.5.1765
R. Lehe, “Electromagnetic wave propagation in Particle-In-Cell codes,” 2016, US Particle Accelerator School (USPAS) Summer Session, Self-Consistent Simulations of Beam and Plasma Systems https://people.nscl.msu.edu/~lund/uspas/scs_2016/lec_adv/A1b_EM_Waves.pdf
- field number_of_dimensions: int = 3
- field number_of_cells: Sequence[int] | None = None
Vector of integers. Number of cells along each axis (number of nodes is number_of_cells+1). Either this or nx, ny, and nz must be specified (not both).
- Constraints:
min_length = 3
max_length = 3
- field lower_bound: Sequence[float] | None = None
Vector of floats. Position of the node at the lower bound [m]. Either this or xmin, ymin, and zmin must be specified (not both).
- Constraints:
min_length = 3
max_length = 3
- field upper_bound: Sequence[float] | None = None
Vector of floats. Position of the node at the upper bound [m]. Either this or xmax, ymax, and zmax must be specified (not both).
- Constraints:
min_length = 3
max_length = 3
- field lower_boundary_conditions: Sequence[str] | None = None
Vector of strings. Conditions at lower boundaries: periodic, open, dirichlet, absorbing_silver_mueller, or neumann. Either this or bc_xmin, bc_ymin, and bc_zmin must be specified (not both).
- Constraints:
min_length = 3
max_length = 3
- field upper_boundary_conditions: Sequence[str] | None = None
Vector of strings. Conditions at upper boundaries: periodic, open, dirichlet, absorbing_silver_mueller, or neumann. Either this or bc_xmax, bc_ymax, and bc_zmax must be specified (not both).
- Constraints:
min_length = 3
max_length = 3
- field nx: int | None = None
Integer. Number of cells along X (number of nodes=nx+1). Either this (along with ny and nz) or number_of_cells must be specified (not both).
- field ny: int | None = None
Integer. Number of cells along Y (number of nodes=ny+1). Either this (along with nx and nz) or number_of_cells must be specified (not both).
- field nz: int | None = None
Integer. Number of cells along Z (number of nodes=nz+1). Either this (along with nx and ny) or number_of_cells must be specified (not both).
- field xmin: float | None = None
Float. Position of first node along X [m]. Either this (along with ymin and zmin) or lower_bound must be specified (not both).
- field xmax: float | None = None
Float. Position of last node along X [m]. Either this (along with ymax and zmax) or upper_bound must be specified (not both).
- field ymin: float | None = None
Float. Position of first node along Y [m]. Either this (along with xmin and zmin) or lower_bound must be specified (not both).
- field ymax: float | None = None
Float. Position of last node along Y [m]. Either this (along with xmax and zmax) or upper_bound must be specified (not both).
- field zmin: float | None = None
Float. Position of first node along Z [m]. Either this (along with xmin and ymin) or lower_bound must be specified (not both).
- field zmax: float | None = None
Float. Position of last node along Z [m]. Either this (along with xmax and ymax) or upper_bound must be specified (not both).
- field bc_xmin: str | None = None
String. Boundary condition at min X: One of periodic, open, dirichlet, absorbing_silver_mueller, or neumann. Either this (along with bc_ymin and bc_zmin) or lower_boundary_conditions must be specified (not both).
- field bc_xmax: str | None = None
String. Boundary condition at max X: One of periodic, open, dirichlet, absorbing_silver_mueller, or neumann. Either this (along with bc_ymax and bc_zmax) or upper_boundary_conditions must be specified (not both).
- field bc_ymin: str | None = None
String. Boundary condition at min Y: One of periodic, open, dirichlet, absorbing_silver_mueller, or neumann. Either this (along with bc_xmin and bc_zmin) or lower_boundary_conditions must be specified (not both).
- field bc_ymax: str | None = None
String. Boundary condition at max Y: One of periodic, open, dirichlet, absorbing_silver_mueller, or neumann. Either this (along with bc_xmax and bc_zmax) or upper_boundary_conditions must be specified (not both).
- field bc_zmin: str | None = None
String. Boundary condition at min Z: One of periodic, open, dirichlet, absorbing_silver_mueller, or neumann. Either this (along with bc_xmin and bc_ymin) or lower_boundary_conditions must be specified (not both).
- field bc_zmax: str | None = None
String. Boundary condition at max Z: One of periodic, open, dirichlet, absorbing_silver_mueller, or neumann. Either this (along with bc_xmax and bc_ymax) or upper_boundary_conditions must be specified (not both).
- field lower_bound_particles: Sequence[float] | None = None
Vector of floats, optional. Position of particle lower bound [m]. By default, if not specified, particle boundary values are the same as field boundary values.
- Constraints:
min_length = 2
max_length = 2
- field upper_bound_particles: Sequence[float] | None = None
Vector of floats, optional. Position of particle upper bound [m]. By default, if not specified, particle boundary values are the same as field boundary values.
- Constraints:
min_length = 2
max_length = 2
- field lower_boundary_conditions_particles: Sequence[str] | None = None
Vector of strings, optional. Conditions at lower boundaries for particles: periodic, absorbing, reflect or thermal. By default, if not specified, particle boundary conditions are the same as field boundary conditions.
- Constraints:
min_length = 2
max_length = 2
- field upper_boundary_conditions_particles: Sequence[str] | None = None
Vector of strings, optional. Conditions at upper boundaries for particles: periodic, absorbing, reflect or thermal. By default, if not specified, particle boundary conditions are the same as field boundary conditions.
- Constraints:
min_length = 2
max_length = 2
- field xmin_particles: float | None = None
Float, optional. Position of min particle boundary along X [m].
- field xmax_particles: float | None = None
Float, optional. Position of max particle boundary along X [m].
- field ymin_particles: float | None = None
Float, optional. Position of min particle boundary along Y [m].
- field ymax_particles: float | None = None
Float, optional. Position of max particle boundary along Y [m].
- field zmin_particles: float | None = None
Float, optional. Position of min particle boundary along Z [m].
- field zmax_particles: float | None = None
Float, optional. Position of max particle boundary along Z [m].
- field bc_xmin_particles: str | None = None
String, optional. Boundary condition at min X for particles: One of periodic, absorbing, reflect, thermal.
- field bc_xmax_particles: str | None = None
String, optional. Boundary condition at max X for particles: One of periodic, absorbing, reflect, thermal.
- field bc_ymin_particles: str | None = None
String, optional. Boundary condition at min Y for particles: One of periodic, absorbing, reflect, thermal.
- field bc_ymax_particles: str | None = None
String, optional. Boundary condition at max Y for particles: One of periodic, absorbing, reflect, thermal.
- field bc_zmin_particles: str | None = None
String, optional. Boundary condition at min Z for particles: One of periodic, absorbing, reflect, thermal.
- field bc_zmax_particles: str | None = None
String, optional. Boundary condition at max Z for particles: One of periodic, absorbing, reflect, thermal.
- field moving_window_velocity: Sequence[float] | None = None
Vector of floats, optional. Moving frame velocity [m/s]
- field refined_regions: list [Optional]
List of lists, optional. List of refined regions, each element being a list of the format [level, lo, hi, refinement_factor], with level being the refinement level (1 being first, 2 being second etc), lo and hi being vectors of length 3 specifying the extent of the region, and refinement_factor defaulting to [2,2,2] (relative to next lower level).
- field guard_cells: Sequence[int] | None = None
Vector of integers, optional. Number of guard cells used along each direction
- field pml_cells: Sequence[int] | None = None
Vector of integers, optional. Number of Perfectly Matched Layer (PML) cells along each direction
- add_refined_region(level, lo, hi, refinement_factor=[2, 2, 2])[source]
Add a refined region.
- Parameters:
level (integer) – The refinement level, with 1 being the first level of refinement, 2 being the second etc.
lo (vectors of floats) – Each is a vector of length 3 specifying the extent of the region
hi (vectors of floats) – Each is a vector of length 3 specifying the extent of the region
refinement_factor (vector of integers, optional) – Defaulting to [2,2,2] (relative to next lower level)
2D Cartesian geometry
- class picmistandard.PICMI_Cartesian2DGrid(*, number_of_dimensions: int = 2, number_of_cells: ~types.Annotated[~collections.abc.Sequence[int] | None, ~annotated_types.MinLen(min_length=2), ~annotated_types.MaxLen(max_length=2)] = None, lower_bound: ~types.Annotated[~collections.abc.Sequence[float] | None, ~annotated_types.MinLen(min_length=2), ~annotated_types.MaxLen(max_length=2)] = None, upper_bound: ~types.Annotated[~collections.abc.Sequence[float] | None, ~annotated_types.MinLen(min_length=2), ~annotated_types.MaxLen(max_length=2)] = None, lower_boundary_conditions: ~types.Annotated[~collections.abc.Sequence[str] | None, ~annotated_types.MinLen(min_length=2), ~annotated_types.MaxLen(max_length=2)] = None, upper_boundary_conditions: ~types.Annotated[~collections.abc.Sequence[str] | None, ~annotated_types.MinLen(min_length=2), ~annotated_types.MaxLen(max_length=2)] = None, nx: int | None = None, ny: int | None = None, xmin: float | None = None, xmax: float | None = None, ymin: float | None = None, ymax: float | None = None, bc_xmin: str | None = None, bc_xmax: str | None = None, bc_ymin: str | None = None, bc_ymax: str | None = None, lower_bound_particles: ~types.Annotated[~collections.abc.Sequence[float] | None, ~annotated_types.MinLen(min_length=2), ~annotated_types.MaxLen(max_length=2)] = None, upper_bound_particles: ~types.Annotated[~collections.abc.Sequence[float] | None, ~annotated_types.MinLen(min_length=2), ~annotated_types.MaxLen(max_length=2)] = None, lower_boundary_conditions_particles: ~types.Annotated[~collections.abc.Sequence[str] | None, ~annotated_types.MinLen(min_length=2), ~annotated_types.MaxLen(max_length=2)] = None, upper_boundary_conditions_particles: ~types.Annotated[~collections.abc.Sequence[str] | None, ~annotated_types.MinLen(min_length=2), ~annotated_types.MaxLen(max_length=2)] = None, xmin_particles: float | None = None, xmax_particles: float | None = None, ymin_particles: float | None = None, ymax_particles: float | None = None, bc_xmin_particles: str | None = None, bc_xmax_particles: str | None = None, bc_ymin_particles: str | None = None, bc_ymax_particles: str | None = None, moving_window_velocity: ~collections.abc.Sequence[float] | None = None, refined_regions: list[list] = <factory>, guard_cells: ~collections.abc.Sequence[int] | None = None, pml_cells: ~collections.abc.Sequence[int] | None = None, **extra_data: ~typing.Any)[source]
Base class for all PICMI classes using Pydantic for validation and extensibility.
This class allows code-specific extensions (e.g., warpx_* kwargs) via Pydantic’s extra fields mechanism while maintaining type safety for standard attributes.
Implementation specific documentation
Two dimensional Cartesian grid. Parameters can be specified either as vectors or separately. (If both are specified, the vector is used.)
References
absorbing_silver_mueller: A local absorbing boundary condition that works best under normal incidence angle. Based on the Silver-Mueller Radiation Condition, e.g., in
A. K. Belhora and L. Pichon, “Maybe Efficient Absorbing Boundary Conditions for the Finite Element Solution of 3D Scattering Problems,” 1995, https://doi.org/10.1109/20.376322
B Engquist and A. Majdat, “Absorbing boundary conditions for numerical simulation of waves,” 1977, https://doi.org/10.1073/pnas.74.5.1765
R. Lehe, “Electromagnetic wave propagation in Particle-In-Cell codes,” 2016, US Particle Accelerator School (USPAS) Summer Session, Self-Consistent Simulations of Beam and Plasma Systems https://people.nscl.msu.edu/~lund/uspas/scs_2016/lec_adv/A1b_EM_Waves.pdf
- field number_of_dimensions: int = 2
- field number_of_cells: Sequence[int] | None = None
Vector of integers. Number of cells along each axis (number of nodes is number_of_cells+1). Either this or nx and ny must be specified (not both).
- Constraints:
min_length = 2
max_length = 2
- field lower_bound: Sequence[float] | None = None
Vector of floats. Position of the node at the lower bound [m]. Either this or xmin and ymin must be specified (not both).
- Constraints:
min_length = 2
max_length = 2
- field upper_bound: Sequence[float] | None = None
Vector of floats. Position of the node at the upper bound [m]. Either this or xmax and ymax must be specified (not both).
- Constraints:
min_length = 2
max_length = 2
- field lower_boundary_conditions: Sequence[str] | None = None
Vector of strings. Conditions at lower boundaries: periodic, open, dirichlet, absorbing_silver_mueller, or neumann. Either this or bc_xmin and bc_ymin must be specified (not both).
- Constraints:
min_length = 2
max_length = 2
- field upper_boundary_conditions: Sequence[str] | None = None
Vector of strings. Conditions at upper boundaries: periodic, open, dirichlet, absorbing_silver_mueller, or neumann. Either this or bc_xmax and bc_ymax must be specified (not both).
- Constraints:
min_length = 2
max_length = 2
- field nx: int | None = None
Integer. Number of cells along X (number of nodes=nx+1). Either this (along with ny) or number_of_cells must be specified (not both).
- field ny: int | None = None
Integer. Number of cells along Y (number of nodes=ny+1). Either this (along with nx) or number_of_cells must be specified (not both).
- field xmin: float | None = None
Float. Position of first node along X [m]. Either this (along with ymin) or lower_bound must be specified (not both).
- field xmax: float | None = None
Float. Position of last node along X [m]. Either this (along with ymax) or upper_bound must be specified (not both).
- field ymin: float | None = None
Float. Position of first node along Y [m]. Either this (along with xmin) or lower_bound must be specified (not both).
- field ymax: float | None = None
Float. Position of last node along Y [m]. Either this (along with xmax) or upper_bound must be specified (not both).
- field bc_xmin: str | None = None
String. Boundary condition at min X: One of periodic, open, dirichlet, absorbing_silver_mueller, or neumann. Either this (along with bc_ymin) or lower_boundary_conditions must be specified (not both).
- field bc_xmax: str | None = None
String. Boundary condition at max X: One of periodic, open, dirichlet, absorbing_silver_mueller, or neumann. Either this (along with bc_ymax) or upper_boundary_conditions must be specified (not both).
- field bc_ymin: str | None = None
String. Boundary condition at min Y: One of periodic, open, dirichlet, absorbing_silver_mueller, or neumann. Either this (along with bc_xmin) or lower_boundary_conditions must be specified (not both).
- field bc_ymax: str | None = None
String. Boundary condition at max Y: One of periodic, open, dirichlet, absorbing_silver_mueller, or neumann. Either this (along with bc_xmax) or upper_boundary_conditions must be specified (not both).
- field lower_bound_particles: Sequence[float] | None = None
Vector of floats, optional. Position of particle lower bound [m]. By default, if not specified, particle boundary values are the same as field boundary values.
- Constraints:
min_length = 2
max_length = 2
- field upper_bound_particles: Sequence[float] | None = None
Vector of floats, optional. Position of particle upper bound [m]. By default, if not specified, particle boundary values are the same as field boundary values.
- Constraints:
min_length = 2
max_length = 2
- field lower_boundary_conditions_particles: Sequence[str] | None = None
Vector of strings, optional. Conditions at lower boundaries for particles: periodic, absorbing, reflect or thermal. By default, if not specified, particle boundary conditions are the same as field boundary conditions.
- Constraints:
min_length = 2
max_length = 2
- field upper_boundary_conditions_particles: Sequence[str] | None = None
Vector of strings, optional. Conditions at upper boundaries for particles: periodic, absorbing, reflect or thermal. By default, if not specified, particle boundary conditions are the same as field boundary conditions.
- Constraints:
min_length = 2
max_length = 2
- field xmin_particles: float | None = None
Float, optional. Position of min particle boundary along X [m].
- field xmax_particles: float | None = None
Float, optional. Position of max particle boundary along X [m].
- field ymin_particles: float | None = None
Float, optional. Position of min particle boundary along Y [m].
- field ymax_particles: float | None = None
Float, optional. Position of max particle boundary along Y [m].
- field bc_xmin_particles: str | None = None
String, optional. Boundary condition at min X for particles: One of periodic, absorbing, reflect, thermal.
- field bc_xmax_particles: str | None = None
String, optional. Boundary condition at max X for particles: One of periodic, absorbing, reflect, thermal.
- field bc_ymin_particles: str | None = None
String, optional. Boundary condition at min Y for particles: One of periodic, absorbing, reflect, thermal.
- field bc_ymax_particles: str | None = None
String, optional. Boundary condition at max Y for particles: One of periodic, absorbing, reflect, thermal.
- field moving_window_velocity: Sequence[float] | None = None
Vector of floats, optional. Moving frame velocity [m/s]
- field refined_regions: list [Optional]
List of lists, optional. List of refined regions, each element being a list of the format [level, lo, hi, refinement_factor], with level being the refinement level (1 being first, 2 being second etc), lo and hi being vectors of length 2 specifying the extent of the region, and refinement_factor defaulting to [2,2] (relative to next lower level).
- field guard_cells: Sequence[int] | None = None
Vector of integers, optional. Number of guard cells used along each direction
- field pml_cells: Sequence[int] | None = None
Vector of integers, optional. Number of Perfectly Matched Layer (PML) cells along each direction
- add_refined_region(level, lo, hi, refinement_factor=[2, 2])[source]
Add a refined region. level: the refinement level, with 1 being the first level of refinement, 2 being the second etc. lo, hi: vectors of length 2 specifying the extent of the region refinement_factor: defaulting to [2,2] (relative to next lower level)
1D Cartesian geometry
- class picmistandard.PICMI_Cartesian1DGrid(*, number_of_dimensions: int = 1, number_of_cells: ~types.Annotated[~collections.abc.Sequence[int] | None, ~annotated_types.MinLen(min_length=1), ~annotated_types.MaxLen(max_length=1)] = None, lower_bound: ~types.Annotated[~collections.abc.Sequence[float] | None, ~annotated_types.MinLen(min_length=1), ~annotated_types.MaxLen(max_length=1)] = None, upper_bound: ~types.Annotated[~collections.abc.Sequence[float] | None, ~annotated_types.MinLen(min_length=1), ~annotated_types.MaxLen(max_length=1)] = None, lower_boundary_conditions: ~types.Annotated[~collections.abc.Sequence[str] | None, ~annotated_types.MinLen(min_length=1), ~annotated_types.MaxLen(max_length=1)] = None, upper_boundary_conditions: ~types.Annotated[~collections.abc.Sequence[str] | None, ~annotated_types.MinLen(min_length=1), ~annotated_types.MaxLen(max_length=1)] = None, nx: int | None = None, xmin: float | None = None, xmax: float | None = None, bc_xmin: str | None = None, bc_xmax: str | None = None, lower_bound_particles: ~types.Annotated[~collections.abc.Sequence[float] | None, ~annotated_types.MinLen(min_length=2), ~annotated_types.MaxLen(max_length=2)] = None, upper_bound_particles: ~types.Annotated[~collections.abc.Sequence[float] | None, ~annotated_types.MinLen(min_length=2), ~annotated_types.MaxLen(max_length=2)] = None, lower_boundary_conditions_particles: ~types.Annotated[~collections.abc.Sequence[str] | None, ~annotated_types.MinLen(min_length=2), ~annotated_types.MaxLen(max_length=2)] = None, upper_boundary_conditions_particles: ~types.Annotated[~collections.abc.Sequence[str] | None, ~annotated_types.MinLen(min_length=2), ~annotated_types.MaxLen(max_length=2)] = None, xmin_particles: float | None = None, xmax_particles: float | None = None, bc_xmin_particles: str | None = None, bc_xmax_particles: str | None = None, moving_window_velocity: ~collections.abc.Sequence[float] | None = None, refined_regions: list[list] = <factory>, guard_cells: ~collections.abc.Sequence[int] | None = None, pml_cells: ~collections.abc.Sequence[int] | None = None, **extra_data: ~typing.Any)[source]
Base class for all PICMI classes using Pydantic for validation and extensibility.
This class allows code-specific extensions (e.g., warpx_* kwargs) via Pydantic’s extra fields mechanism while maintaining type safety for standard attributes.
Implementation specific documentation
One-dimensional Cartesian grid. Parameters can be specified either as vectors or separately. (If both are specified, the vector is used.)
References
absorbing_silver_mueller: A local absorbing boundary condition that works best under normal incidence angle. Based on the Silver-Mueller Radiation Condition, e.g., in
A. K. Belhora and L. Pichon, “Maybe Efficient Absorbing Boundary Conditions for the Finite Element Solution of 3D Scattering Problems,” 1995, https://doi.org/10.1109/20.376322
B Engquist and A. Majdat, “Absorbing boundary conditions for numerical simulation of waves,” 1977, https://doi.org/10.1073/pnas.74.5.1765
R. Lehe, “Electromagnetic wave propagation in Particle-In-Cell codes,” 2016, US Particle Accelerator School (USPAS) Summer Session, Self-Consistent Simulations of Beam and Plasma Systems https://people.nscl.msu.edu/~lund/uspas/scs_2016/lec_adv/A1b_EM_Waves.pdf
- field number_of_dimensions: int = 1
- field number_of_cells: Sequence[int] | None = None
Vector of integers. Number of cells along each axis (number of nodes is number_of_cells+1). Either this or nx must be specified (not both).
- Constraints:
min_length = 1
max_length = 1
- field lower_bound: Sequence[float] | None = None
Vector of floats. Position of the node at the lower bound [m]. Either this or xmin must be specified (not both).
- Constraints:
min_length = 1
max_length = 1
- field upper_bound: Sequence[float] | None = None
Vector of floats. Position of the node at the upper bound [m]. Either this or xmax must be specified (not both).
- Constraints:
min_length = 1
max_length = 1
- field lower_boundary_conditions: Sequence[str] | None = None
Vector of strings. Conditions at lower boundaries: periodic, open, dirichlet, absorbing_silver_mueller, or neumann. Either this or bc_xmin must be specified (not both).
- Constraints:
min_length = 1
max_length = 1
- field upper_boundary_conditions: Sequence[str] | None = None
Vector of strings. Conditions at upper boundaries: periodic, open, dirichlet, absorbing_silver_mueller, or neumann. Either this or bc_xmax must be specified (not both).
- Constraints:
min_length = 1
max_length = 1
- field nx: int | None = None
Integer. Number of cells along X (number of nodes=nx+1). Either this or number_of_cells must be specified (not both).
- field xmin: float | None = None
Float. Position of first node along X [m]. Either this or lower_bound must be specified (not both).
- field xmax: float | None = None
Float. Position of last node along X [m]. Either this or upper_bound must be specified (not both).
- field bc_xmin: str | None = None
String. Boundary condition at min X: One of periodic, open, dirichlet, absorbing_silver_mueller, or neumann. Either this or lower_boundary_conditions must be specified (not both).
- field bc_xmax: str | None = None
String. Boundary condition at max X: One of periodic, open, dirichlet, absorbing_silver_mueller, or neumann. Either this or upper_boundary_conditions must be specified (not both).
- field lower_bound_particles: Sequence[float] | None = None
Vector of floats, optional. Position of particle lower bound [m]. By default, if not specified, particle boundary values are the same as field boundary values.
- Constraints:
min_length = 2
max_length = 2
- field upper_bound_particles: Sequence[float] | None = None
Vector of floats, optional. Position of particle upper bound [m]. By default, if not specified, particle boundary values are the same as field boundary values.
- Constraints:
min_length = 2
max_length = 2
- field lower_boundary_conditions_particles: Sequence[str] | None = None
Vector of strings, optional. Conditions at lower boundaries for particles: periodic, absorbing, reflect or thermal. By default, if not specified, particle boundary conditions are the same as field boundary conditions.
- Constraints:
min_length = 2
max_length = 2
- field upper_boundary_conditions_particles: Sequence[str] | None = None
Vector of strings, optional. Conditions at upper boundaries for particles: periodic, absorbing, reflect or thermal. By default, if not specified, particle boundary conditions are the same as field boundary conditions.
- Constraints:
min_length = 2
max_length = 2
- field xmin_particles: float | None = None
Float, optional. Position of min particle boundary along X [m].
- field xmax_particles: float | None = None
Float, optional. Position of max particle boundary along X [m].
- field bc_xmin_particles: str | None = None
String, optional. Boundary condition at min X for particles: One of periodic, absorbing, reflect, thermal.
- field bc_xmax_particles: str | None = None
String, optional. Boundary condition at max X for particles: One of periodic, absorbing, reflect, thermal.
- field moving_window_velocity: Sequence[float] | None = None
Vector of floats, optional. Moving frame velocity [m/s]
- field refined_regions: list [Optional]
List of lists, optional. List of refined regions, each element being a list of the format [level, lo, hi, refinement_factor], with level being the refinement level (1 being first, 2 being second etc), lo and hi being vectors of length 1 specifying the extent of the region, and refinement_factor defaulting to [2] (relative to next lower level).
- field guard_cells: Sequence[int] | None = None
Vector of integers, optional. Number of guard cells used along each direction
- field pml_cells: Sequence[int] | None = None
Vector of integers, optional. Number of Perfectly Matched Layer (PML) cells along each direction
- add_refined_region(level, lo, hi, refinement_factor=[2])[source]
Add a refined region. level: the refinement level, with 1 being the first level of refinement, 2 being the second etc. lo, hi: vectors of length 2 specifying the extent of the region refinement_factor: defaulting to [2,2] (relative to next lower level)
Cylindrical geometry
- class picmistandard.PICMI_CylindricalGrid(*, number_of_dimensions: int = 2, number_of_cells: ~types.Annotated[~collections.abc.Sequence[int] | None, ~annotated_types.MinLen(min_length=2), ~annotated_types.MaxLen(max_length=2)] = None, lower_bound: ~types.Annotated[~collections.abc.Sequence[float] | None, ~annotated_types.MinLen(min_length=2), ~annotated_types.MaxLen(max_length=2)] = None, upper_bound: ~types.Annotated[~collections.abc.Sequence[float] | None, ~annotated_types.MinLen(min_length=2), ~annotated_types.MaxLen(max_length=2)] = None, lower_boundary_conditions: ~types.Annotated[~collections.abc.Sequence[str] | None, ~annotated_types.MinLen(min_length=2), ~annotated_types.MaxLen(max_length=2)] = None, upper_boundary_conditions: ~types.Annotated[~collections.abc.Sequence[str] | None, ~annotated_types.MinLen(min_length=2), ~annotated_types.MaxLen(max_length=2)] = None, nr: int | None = None, nz: int | None = None, n_azimuthal_modes: int | None = None, rmin: float | None = None, rmax: float | None = None, zmin: float | None = None, zmax: float | None = None, bc_rmin: str | None = None, bc_rmax: str | None = None, bc_zmin: str | None = None, bc_zmax: str | None = None, lower_bound_particles: ~types.Annotated[~collections.abc.Sequence[float] | None, ~annotated_types.MinLen(min_length=2), ~annotated_types.MaxLen(max_length=2)] = None, upper_bound_particles: ~types.Annotated[~collections.abc.Sequence[float] | None, ~annotated_types.MinLen(min_length=2), ~annotated_types.MaxLen(max_length=2)] = None, lower_boundary_conditions_particles: ~types.Annotated[~collections.abc.Sequence[str] | None, ~annotated_types.MinLen(min_length=2), ~annotated_types.MaxLen(max_length=2)] = None, upper_boundary_conditions_particles: ~types.Annotated[~collections.abc.Sequence[str] | None, ~annotated_types.MinLen(min_length=2), ~annotated_types.MaxLen(max_length=2)] = None, rmin_particles: float | None = None, rmax_particles: float | None = None, zmin_particles: float | None = None, zmax_particles: float | None = None, bc_rmin_particles: str | None = None, bc_rmax_particles: str | None = None, bc_zmin_particles: str | None = None, bc_zmax_particles: str | None = None, moving_window_velocity: ~collections.abc.Sequence[float] | None = None, refined_regions: list[list] = <factory>, guard_cells: ~collections.abc.Sequence[int] | None = None, pml_cells: ~collections.abc.Sequence[int] | None = None, **extra_data: ~typing.Any)[source]
Base class for all PICMI classes using Pydantic for validation and extensibility.
This class allows code-specific extensions (e.g., warpx_* kwargs) via Pydantic’s extra fields mechanism while maintaining type safety for standard attributes.
Implementation specific documentation
Axisymmetric, cylindrical grid. Parameters can be specified either as vectors or separately. (If both are specified, the vector is used.)
References
absorbing_silver_mueller: A local absorbing boundary condition that works best under normal incidence angle. Based on the Silver-Mueller Radiation Condition, e.g., in
A. K. Belhora and L. Pichon, “Maybe Efficient Absorbing Boundary Conditions for the Finite Element Solution of 3D Scattering Problems,” 1995, https://doi.org/10.1109/20.376322
B Engquist and A. Majdat, “Absorbing boundary conditions for numerical simulation of waves,” 1977, https://doi.org/10.1073/pnas.74.5.1765
R. Lehe, “Electromagnetic wave propagation in Particle-In-Cell codes,” 2016, US Particle Accelerator School (USPAS) Summer Session, Self-Consistent Simulations of Beam and Plasma Systems https://people.nscl.msu.edu/~lund/uspas/scs_2016/lec_adv/A1b_EM_Waves.pdf
- field number_of_dimensions: int = 2
- field number_of_cells: Sequence[int] | None = None
Vector of integers. Number of cells along each axis (number of nodes is number_of_cells+1). Either this or nr and nz must be specified (not both).
- Constraints:
min_length = 2
max_length = 2
- field lower_bound: Sequence[float] | None = None
Vector of floats. Position of the node at the lower bound [m]. Either this or rmin and zmin must be specified (not both).
- Constraints:
min_length = 2
max_length = 2
- field upper_bound: Sequence[float] | None = None
Vector of floats. Position of the node at the upper bound [m]. Either this or rmax and zmax must be specified (not both).
- Constraints:
min_length = 2
max_length = 2
- field lower_boundary_conditions: Sequence[str] | None = None
Vector of strings. Conditions at lower boundaries: periodic, open, dirichlet, absorbing_silver_mueller, or neumann. Either this or bc_rmin and bc_zmin must be specified (not both). Note: bc_rmin may be None since it will usually be the axis.
- Constraints:
min_length = 2
max_length = 2
- field upper_boundary_conditions: Sequence[str] | None = None
Vector of strings. Conditions at upper boundaries: periodic, open, dirichlet, absorbing_silver_mueller, or neumann. Either this or bc_rmax and bc_zmax must be specified (not both).
- Constraints:
min_length = 2
max_length = 2
- field nr: int | None = None
Integer. Number of cells along R (number of nodes=nr+1). Either this (along with nz) or number_of_cells must be specified (not both).
- field nz: int | None = None
Integer. Number of cells along Z (number of nodes=nz+1). Either this (along with nr) or number_of_cells must be specified (not both).
- field n_azimuthal_modes: int | None = None
Integer. Number of azimuthal modes
- field rmin: float | None = None
Float. Position of first node along R [m]. Either this (along with zmin) or lower_bound must be specified (not both).
- field rmax: float | None = None
Float. Position of last node along R [m]. Either this (along with zmax) or upper_bound must be specified (not both).
- field zmin: float | None = None
Float. Position of first node along Z [m]. Either this (along with rmin) or lower_bound must be specified (not both).
- field zmax: float | None = None
Float. Position of last node along Z [m]. Either this (along with rmax) or upper_bound must be specified (not both).
- field bc_rmin: str | None = None
String. Boundary condition at min R: One of open, dirichlet, absorbing_silver_mueller, or neumann. Either this (along with bc_zmin) or lower_boundary_conditions must be specified (not both). May be None since it will usually be the axis.
- field bc_rmax: str | None = None
String. Boundary condition at max R: One of open, dirichlet, absorbing_silver_mueller, or neumann. Either this (along with bc_zmax) or upper_boundary_conditions must be specified (not both).
- field bc_zmin: str | None = None
String. Boundary condition at min Z: One of periodic, open, dirichlet, absorbing_silver_mueller, or neumann. Either this (along with bc_rmin) or lower_boundary_conditions must be specified (not both).
- field bc_zmax: str | None = None
String. Boundary condition at max Z: One of periodic, open, dirichlet, absorbing_silver_mueller, or neumann. Either this (along with bc_rmax) or upper_boundary_conditions must be specified (not both).
- field lower_bound_particles: Sequence[float] | None = None
Vector of floats, optional. Position of particle lower bound [m]. By default, if not specified, particle boundary values are the same as field boundary values.
- Constraints:
min_length = 2
max_length = 2
- field upper_bound_particles: Sequence[float] | None = None
Vector of floats, optional. Position of particle upper bound [m]. By default, if not specified, particle boundary values are the same as field boundary values.
- Constraints:
min_length = 2
max_length = 2
- field lower_boundary_conditions_particles: Sequence[str] | None = None
Vector of strings, optional. Conditions at lower boundaries for particles: periodic, absorbing, reflect or thermal. By default, if not specified, particle boundary conditions are the same as field boundary conditions.
- Constraints:
min_length = 2
max_length = 2
- field upper_boundary_conditions_particles: Sequence[str] | None = None
Vector of strings, optional. Conditions at upper boundaries for particles: periodic, absorbing, reflect or thermal. By default, if not specified, particle boundary conditions are the same as field boundary conditions.
- Constraints:
min_length = 2
max_length = 2
- field rmin_particles: float | None = None
Float, optional. Position of min particle boundary along R [m].
- field rmax_particles: float | None = None
Float, optional. Position of max particle boundary along R [m].
- field zmin_particles: float | None = None
Float, optional. Position of min particle boundary along Z [m].
- field zmax_particles: float | None = None
Float, optional. Position of max particle boundary along Z [m].
- field bc_rmin_particles: str | None = None
String, optional. Boundary condition at min R for particles: One of periodic, absorbing, reflect, thermal.
- field bc_rmax_particles: str | None = None
String, optional. Boundary condition at max R for particles: One of periodic, absorbing, reflect, thermal.
- field bc_zmin_particles: str | None = None
String, optional. Boundary condition at min Z for particles: One of periodic, absorbing, reflect, thermal.
- field bc_zmax_particles: str | None = None
String, optional. Boundary condition at max Z for particles: One of periodic, absorbing, reflect, thermal.
- field moving_window_velocity: Sequence[float] | None = None
Vector of floats, optional. Moving frame velocity [m/s]
- field refined_regions: list [Optional]
List of lists, optional. List of refined regions, each element being a list of the format [level, lo, hi, refinement_factor], with level being the refinement level (1 being first, 2 being second etc), lo and hi being vectors of length 2 specifying the extent of the region, and refinement_factor defaulting to [2,2] (relative to next lower level).
- field guard_cells: Sequence[int] | None = None
Vector of integers, optional. Number of guard cells used along each direction
- field pml_cells: Sequence[int] | None = None
Vector of integers, optional. Number of Perfectly Matched Layer (PML) cells along each direction
- add_refined_region(level, lo, hi, refinement_factor=[2, 2])[source]
Add a refined region. level: the refinement level, with 1 being the first level of refinement, 2 being the second etc. lo, hi: vectors of length 2 specifying the extent of the region refinement_factor: defaulting to [2,2] (relative to next lower level)