Class pypfc_grid¶
Provides the foundational grid management functionality for PFC simulations.
Functions¶
__init__ ¶
Initialize the grid setup with domain size and grid divisions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
domain_size
|
ndarray of float, shape (3,)
|
Physical size of the simulation domain in each direction [Lx, Ly, Lz]. Specified in lattice parameter units for crystal simulations. |
required |
ndiv
|
ndarray of int, shape (3,)
|
Number of grid divisions along each coordinate axis [nx, ny, nz]. All values must be even numbers for FFT compatibility. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If any element in |
copy_from ¶
Copy grid parameters from another grid object.
This method copies all grid configuration parameters from another setup_grid instance, including domain size, grid divisions, and derived parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
grid
|
setup_grid
|
Another setup_grid instance to copy parameters from. |
required |
get_ddiv ¶
Get the grid spacing in each direction.
Returns:
| Type | Description |
|---|---|
ndarray
|
Grid spacing [dx, dy, dz] for each coordinate axis. |
get_domain_size ¶
Get the physical domain size in each direction.
Returns:
| Type | Description |
|---|---|
ndarray
|
Physical domain size [Lx, Ly, Lz] in lattice parameters. |
get_ndiv ¶
Get the number of grid divisions in each direction.
Returns:
| Type | Description |
|---|---|
ndarray
|
Number of grid divisions [nx, ny, nz] along each axis. |
set_ddiv ¶
Set the grid spacing in each direction.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ddiv
|
array_like of float, shape (3,)
|
Grid spacing in each direction [dx, dy, dz]. |
required |
set_ndiv ¶
Set the number of grid divisions in each direction.
Updates the grid division parameters and related grid point counts. All divisions must be even numbers for FFT compatibility.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ndiv
|
array_like of int, shape (3,)
|
Number of grid divisions in each direction [nx, ny, nz]. Must be even numbers. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If any value in ndiv is not an even number. |