g3d.flow.domain.glue package
Submodules
g3d.flow.domain.glue.connectivity module
Connectivity placeholders. Intf class definition.
- class g3d.flow.domain.glue.connectivity.Interface(*args: Any, **kwargs: Any)[source]
Bases:
G3DEntityDefinition of class Interface
- Attributes:
Methods
add_face_def(a, b)Add face definition to boundary placeholder
Allocates interface flux molecule placeholders
check_FMP_cell_metrics(ic, check_sum)Check interface flux molecule cell metrics
check_FMP_metrics(x, y, z)Check interface flux molecule metrics
copy(intf)Copies data from prototype Interface object
De-allocates interface flux molecule placeholders
Get interface accumulated boundary flux molecule placeholder size
Get face count
Get interface face definitions
Get max interface flux molecule placeholder size
Get number of allocated ghost cells
Get number of allocated ghost nodes
Prints a ghost cell/node report
print()prints entity data
print_FMP_data([face_type, face_tag, f])Prints interface flux molecule data
read_from_file(f, n_faces, intf_type, intf_tag)Read face definition from file
set(*args, **kwargs)sets entity parameters according to specifications input: args, kwargs example: set(args, kwargs)
set_from_key_value(key, value)sets entity parameters from specified key => value data input: key, value valid keys for G3DCode base class: 'tag' example: set_from_key_value(key, value)
update_FMP_metrics(x, y, z)Update interface flux molecule metrics
- add_face_def(a: Intf, b: Intf)[source]
Add face definition to boundary placeholder
- Parameters:
a (Intf :) – face definition A-side
b (Intf :) – face definition B-side
- check_FMP_cell_metrics(ic: int, check_sum: list | ndarray) None[source]
Check interface flux molecule cell metrics
- Parameters:
ic (int :) – cell index
check_sum (ndarray :) – check sum array
- check_FMP_metrics(x: ndarray, y: ndarray, z: ndarray) None[source]
Check interface flux molecule metrics
- Parameters:
x (ndarray :) – x coordinate vector
y (ndarray :) – y coordinate vector
z (ndarray :) – z coordinate vector
- copy(intf: Interface) None[source]
Copies data from prototype Interface object
- Parameters:
intf (Interface) – prototype Interface object
- get_FMP_size() int[source]
Get interface accumulated boundary flux molecule placeholder size
- Returns:
size
- Return type:
int
- get_face_defs() Tuple[list, list][source]
Get interface face definitions
- Returns:
face definitions
- Return type:
list
- get_max_FMP_size() int[source]
Get max interface flux molecule placeholder size
- Returns:
size
- Return type:
int
- get_n_ghost_cells() int[source]
Get number of allocated ghost cells
- Returns:
ghost cell count
- Return type:
int
- get_n_ghost_nodes() int[source]
Get number of allocated ghost nodes
- Returns:
ghost node count
- Return type:
int
- print_FMP_data(face_type: Any = INTFTypes.UNDEFINED, face_tag: str = 'all', f: IO[str] | None = None) None[source]
Prints interface flux molecule data
- Parameters:
face_type (INTFTypes :) – interface type (Default value = INTFTypes.UNDEFINED)
face_tag (str :) – interface tag (Default value = ‘all’)
f (file :) – file handle (Default value = None)
- read_from_file(f: IO[str], n_faces: int, intf_type: Any, intf_tag: str) None[source]
Read face definition from file
- Parameters:
f (file) – file handle
n_faces (int) – number of faces
intf_type (INTFTypes) – interface type
intf_tag (str) – interface tag
- property size: int
Placeholder size
- Returns:
size
- Return type:
int
- class g3d.flow.domain.glue.connectivity.InterfacePlaceHolder(*args: Any, **kwargs: Any)[source]
Bases:
G3DEntityDefinition of class InterfacePlaceHolder
- Attributes:
tagtag (string) used for identification
Methods
Add interface container
Allocate placeholder data containers
check_FMP_cell_metrics(ic, check_sum)Checks flux molecule cell metrics
check_FMP_metrics(x, y, z)Checks flux molecule metrics for stored interface containers
copy(e)copies data from specified entity input: entity example: copy(e)
Extract interface face count
Get interface
Get interface array
Get maximum flux molecule placeholder size
Finds maximum number of ghost cells in an interface container
Finds maximum number of ghost nodes in a boundary container
Extracts boundary ghost cell/node report
print()prints entity data
print_FMP_data([face_type, face_tag, f])Prints flux molecule data
read_from_file(f, intf_type)Read interface definition from file
set(*args, **kwargs)sets entity parameters according to specifications input: args, kwargs example: set(args, kwargs)
set_from_key_value(key, value)sets entity parameters from specified key => value data input: key, value valid keys for G3DCode base class: 'tag' example: set_from_key_value(key, value)
update_FMP_metrics(x, y, z)Updates flux molecule metrics for stored interface containers
- add_interface(t: Any) Interface | None[source]
Add interface container
- Parameters:
t (INTFTypes :) – interface type
- Returns:
interface
- Return type:
Interface or None
- check_FMP_cell_metrics(ic: int, check_sum: ndarray) None[source]
Checks flux molecule cell metrics
- Parameters:
ic (int :) – cell index
check_sum (ndarray :) – check sum array
- check_FMP_metrics(x: ndarray, y: ndarray, z: ndarray) None[source]
Checks flux molecule metrics for stored interface containers
- Parameters:
x (ndarray :) – x coordinate vector
y (ndarray :) – y coordinate vector
z (ndarray :) – z coordinate vector
- get_interface(t: Any) Interface | None[source]
Get interface
- Parameters:
t (INTFTypes :) – interface type
- Returns:
interface
- Return type:
Interface or None
- get_max_FMP_size() int[source]
Get maximum flux molecule placeholder size
- Returns:
size
- Return type:
int
- get_max_ghost_cells() int[source]
Finds maximum number of ghost cells in an interface container
- Returns:
ghost cell count
- Return type:
int
- get_max_ghost_nodes() int[source]
Finds maximum number of ghost nodes in a boundary container
- Returns:
ghost node count
- Return type:
int
- print_FMP_data(face_type=INTFTypes.UNDEFINED, face_tag='all', f=None) None[source]
Prints flux molecule data
- Parameters:
face_type (INTFTypes :) – interface type (Default value = INTFTypes.UNDEFINED)
face_tag (str :) – interface tag (Default value = ‘all’)
f (file) – file handle (Default value = None)
- class g3d.flow.domain.glue.connectivity.Intf(*args: Any, **kwargs: Any)[source]
Bases:
FaceDefinition of class Intf, extends class Face
- Attributes:
FMP- return:
FMP_size- return:
X- return:
Y- return:
Z- return:
alfaAngular separation, rotation about x-axis (for rotational periodic boundaries)
alpha- return:
check- return:
delta- return:
dxSpatial separation in x-direction (for translational periodic boundaries)
dySpatial separation in y-direction (for translational periodic boundaries)
dzSpatial separation in z-direction (for translational periodic boundaries)
face_type- return:
i0- return:
idir- return:
im- return:
it- return:
j0- return:
jdir- return:
k0- return:
npi- return:
npj- return:
size- return:
tagtag (string) used for identification
x_max- return:
x_min- return:
y_max- return:
y_min- return:
z_max- return:
z_min- return:
Methods
allocate_FMP([mp])Allocates flux molecule placeholders
allocate_XYZ([N])backup_is_allocated()check_FMP_cell_metrics(ic, check_sum)copy(intf)Copies data from prototype Intf object
copy_X(*args)copy_XYZ(*args)copy_Y(*args)copy_Z(*args)copy_def(f)generate_offset_Face(offset)get_X([lp])get_XYZ([lp])get_Y([lp])get_Z([lp])get_cell_count()get_def([normal])get_delta()get_extreme_values()get_face_count()Get face spatial separation in three coordinate directions (for translational periodic faces)
get_from_backup([reset_bak])get_index(i, j)Get number of ghost cells for interface
Get number of ghost nodes for interface
get_node(i, j)get_node_count()get_x_min_x_max()get_y_min_y_max()get_z_min_z_max()Extracts interface ghost report
print()prints entity data
read_def_from_file(f)read_from_file(f)rotate(**kwargs)scale(sf)scatter_XY(plt[, m])scatter_XZ(plt[, m])scatter_YZ(plt[, m])set(*args, **kwargs)sets entity parameters according to specifications input: args, kwargs example: set(args, kwargs)
set_X(x[, lp])set_XYZ(x, y, z[, lp])set_Y(y[, lp])set_Z(z[, lp])set_def([f])Get face spatial separation in three coordinate directions (for translational periodic faces)
set_from_key_value(key, value)sets entity parameters from specified key => value data input: key, value valid keys for G3DCode base class: 'tag' example: set_from_key_value(key, value)
shift(**kwargs)write_to_file(f)backup
deallocate_FMP
nullify
print_extreme_values
reset_XYZ
swap_normal
- property alfa: float
Angular separation, rotation about x-axis (for rotational periodic boundaries)
- Returns:
alfa
- Return type:
float
- allocate_FMP(mp: int = 2) None[source]
Allocates flux molecule placeholders
- Parameters:
mp (int :) – (Default value = 2)
- copy(intf: Intf)[source]
Copies data from prototype Intf object
- Parameters:
intf (Intf) – prototype Intf object
- property dx: float
Spatial separation in x-direction (for translational periodic boundaries)
- Returns:
dx
- Return type:
float
- property dy: float
Spatial separation in y-direction (for translational periodic boundaries)
- Returns:
dy
- Return type:
float
- property dz: float
Spatial separation in z-direction (for translational periodic boundaries)
- Returns:
dz
- Return type:
float
- get_face_delta() ndarray[source]
Get face spatial separation in three coordinate directions (for translational periodic faces)
- Returns:
[dx, dy, dz]
- Return type:
ndarray
- get_n_ghost_cells() int[source]
Get number of ghost cells for interface
- Returns:
number of ghost cells
- Return type:
int
Module contents
g3d/flow/domain/glue sub library
- class g3d.flow.domain.glue.Interface(*args: Any, **kwargs: Any)[source]
Bases:
G3DEntityDefinition of class Interface
- Attributes:
Methods
add_face_def(a, b)Add face definition to boundary placeholder
Allocates interface flux molecule placeholders
check_FMP_cell_metrics(ic, check_sum)Check interface flux molecule cell metrics
check_FMP_metrics(x, y, z)Check interface flux molecule metrics
copy(intf)Copies data from prototype Interface object
De-allocates interface flux molecule placeholders
Get interface accumulated boundary flux molecule placeholder size
Get face count
Get interface face definitions
Get max interface flux molecule placeholder size
Get number of allocated ghost cells
Get number of allocated ghost nodes
Prints a ghost cell/node report
print()prints entity data
print_FMP_data([face_type, face_tag, f])Prints interface flux molecule data
read_from_file(f, n_faces, intf_type, intf_tag)Read face definition from file
set(*args, **kwargs)sets entity parameters according to specifications input: args, kwargs example: set(args, kwargs)
set_from_key_value(key, value)sets entity parameters from specified key => value data input: key, value valid keys for G3DCode base class: 'tag' example: set_from_key_value(key, value)
update_FMP_metrics(x, y, z)Update interface flux molecule metrics
- add_face_def(a: Intf, b: Intf)[source]
Add face definition to boundary placeholder
- Parameters:
a (Intf :) – face definition A-side
b (Intf :) – face definition B-side
- check_FMP_cell_metrics(ic: int, check_sum: list | ndarray) None[source]
Check interface flux molecule cell metrics
- Parameters:
ic (int :) – cell index
check_sum (ndarray :) – check sum array
- check_FMP_metrics(x: ndarray, y: ndarray, z: ndarray) None[source]
Check interface flux molecule metrics
- Parameters:
x (ndarray :) – x coordinate vector
y (ndarray :) – y coordinate vector
z (ndarray :) – z coordinate vector
- copy(intf: Interface) None[source]
Copies data from prototype Interface object
- Parameters:
intf (Interface) – prototype Interface object
- get_FMP_size() int[source]
Get interface accumulated boundary flux molecule placeholder size
- Returns:
size
- Return type:
int
- get_face_defs() Tuple[list, list][source]
Get interface face definitions
- Returns:
face definitions
- Return type:
list
- get_max_FMP_size() int[source]
Get max interface flux molecule placeholder size
- Returns:
size
- Return type:
int
- get_n_ghost_cells() int[source]
Get number of allocated ghost cells
- Returns:
ghost cell count
- Return type:
int
- get_n_ghost_nodes() int[source]
Get number of allocated ghost nodes
- Returns:
ghost node count
- Return type:
int
- print_FMP_data(face_type: Any = INTFTypes.UNDEFINED, face_tag: str = 'all', f: IO[str] | None = None) None[source]
Prints interface flux molecule data
- Parameters:
face_type (INTFTypes :) – interface type (Default value = INTFTypes.UNDEFINED)
face_tag (str :) – interface tag (Default value = ‘all’)
f (file :) – file handle (Default value = None)
- read_from_file(f: IO[str], n_faces: int, intf_type: Any, intf_tag: str) None[source]
Read face definition from file
- Parameters:
f (file) – file handle
n_faces (int) – number of faces
intf_type (INTFTypes) – interface type
intf_tag (str) – interface tag
- property size: int
Placeholder size
- Returns:
size
- Return type:
int
- class g3d.flow.domain.glue.InterfacePlaceHolder(*args: Any, **kwargs: Any)[source]
Bases:
G3DEntityDefinition of class InterfacePlaceHolder
- Attributes:
tagtag (string) used for identification
Methods
Add interface container
Allocate placeholder data containers
check_FMP_cell_metrics(ic, check_sum)Checks flux molecule cell metrics
check_FMP_metrics(x, y, z)Checks flux molecule metrics for stored interface containers
copy(e)copies data from specified entity input: entity example: copy(e)
Extract interface face count
Get interface
Get interface array
Get maximum flux molecule placeholder size
Finds maximum number of ghost cells in an interface container
Finds maximum number of ghost nodes in a boundary container
Extracts boundary ghost cell/node report
print()prints entity data
print_FMP_data([face_type, face_tag, f])Prints flux molecule data
read_from_file(f, intf_type)Read interface definition from file
set(*args, **kwargs)sets entity parameters according to specifications input: args, kwargs example: set(args, kwargs)
set_from_key_value(key, value)sets entity parameters from specified key => value data input: key, value valid keys for G3DCode base class: 'tag' example: set_from_key_value(key, value)
update_FMP_metrics(x, y, z)Updates flux molecule metrics for stored interface containers
- add_interface(t: Any) Interface | None[source]
Add interface container
- Parameters:
t (INTFTypes :) – interface type
- Returns:
interface
- Return type:
Interface or None
- check_FMP_cell_metrics(ic: int, check_sum: ndarray) None[source]
Checks flux molecule cell metrics
- Parameters:
ic (int :) – cell index
check_sum (ndarray :) – check sum array
- check_FMP_metrics(x: ndarray, y: ndarray, z: ndarray) None[source]
Checks flux molecule metrics for stored interface containers
- Parameters:
x (ndarray :) – x coordinate vector
y (ndarray :) – y coordinate vector
z (ndarray :) – z coordinate vector
- get_interface(t: Any) Interface | None[source]
Get interface
- Parameters:
t (INTFTypes :) – interface type
- Returns:
interface
- Return type:
Interface or None
- get_max_FMP_size() int[source]
Get maximum flux molecule placeholder size
- Returns:
size
- Return type:
int
- get_max_ghost_cells() int[source]
Finds maximum number of ghost cells in an interface container
- Returns:
ghost cell count
- Return type:
int
- get_max_ghost_nodes() int[source]
Finds maximum number of ghost nodes in a boundary container
- Returns:
ghost node count
- Return type:
int
- print_FMP_data(face_type=INTFTypes.UNDEFINED, face_tag='all', f=None) None[source]
Prints flux molecule data
- Parameters:
face_type (INTFTypes :) – interface type (Default value = INTFTypes.UNDEFINED)
face_tag (str :) – interface tag (Default value = ‘all’)
f (file) – file handle (Default value = None)
- class g3d.flow.domain.glue.Intf(*args: Any, **kwargs: Any)[source]
Bases:
FaceDefinition of class Intf, extends class Face
- Attributes:
FMP- return:
FMP_size- return:
X- return:
Y- return:
Z- return:
alfaAngular separation, rotation about x-axis (for rotational periodic boundaries)
alpha- return:
check- return:
delta- return:
dxSpatial separation in x-direction (for translational periodic boundaries)
dySpatial separation in y-direction (for translational periodic boundaries)
dzSpatial separation in z-direction (for translational periodic boundaries)
face_type- return:
i0- return:
idir- return:
im- return:
it- return:
j0- return:
jdir- return:
k0- return:
npi- return:
npj- return:
size- return:
tagtag (string) used for identification
x_max- return:
x_min- return:
y_max- return:
y_min- return:
z_max- return:
z_min- return:
Methods
allocate_FMP([mp])Allocates flux molecule placeholders
allocate_XYZ([N])backup_is_allocated()check_FMP_cell_metrics(ic, check_sum)copy(intf)Copies data from prototype Intf object
copy_X(*args)copy_XYZ(*args)copy_Y(*args)copy_Z(*args)copy_def(f)generate_offset_Face(offset)get_X([lp])get_XYZ([lp])get_Y([lp])get_Z([lp])get_cell_count()get_def([normal])get_delta()get_extreme_values()get_face_count()Get face spatial separation in three coordinate directions (for translational periodic faces)
get_from_backup([reset_bak])get_index(i, j)Get number of ghost cells for interface
Get number of ghost nodes for interface
get_node(i, j)get_node_count()get_x_min_x_max()get_y_min_y_max()get_z_min_z_max()Extracts interface ghost report
print()prints entity data
read_def_from_file(f)read_from_file(f)rotate(**kwargs)scale(sf)scatter_XY(plt[, m])scatter_XZ(plt[, m])scatter_YZ(plt[, m])set(*args, **kwargs)sets entity parameters according to specifications input: args, kwargs example: set(args, kwargs)
set_X(x[, lp])set_XYZ(x, y, z[, lp])set_Y(y[, lp])set_Z(z[, lp])set_def([f])Get face spatial separation in three coordinate directions (for translational periodic faces)
set_from_key_value(key, value)sets entity parameters from specified key => value data input: key, value valid keys for G3DCode base class: 'tag' example: set_from_key_value(key, value)
shift(**kwargs)write_to_file(f)backup
deallocate_FMP
nullify
print_extreme_values
reset_XYZ
swap_normal
- property alfa: float
Angular separation, rotation about x-axis (for rotational periodic boundaries)
- Returns:
alfa
- Return type:
float
- allocate_FMP(mp: int = 2) None[source]
Allocates flux molecule placeholders
- Parameters:
mp (int :) – (Default value = 2)
- copy(intf: Intf)[source]
Copies data from prototype Intf object
- Parameters:
intf (Intf) – prototype Intf object
- property dx: float
Spatial separation in x-direction (for translational periodic boundaries)
- Returns:
dx
- Return type:
float
- property dy: float
Spatial separation in y-direction (for translational periodic boundaries)
- Returns:
dy
- Return type:
float
- property dz: float
Spatial separation in z-direction (for translational periodic boundaries)
- Returns:
dz
- Return type:
float
- get_face_delta() ndarray[source]
Get face spatial separation in three coordinate directions (for translational periodic faces)
- Returns:
[dx, dy, dz]
- Return type:
ndarray
- get_n_ghost_cells() int[source]
Get number of ghost cells for interface
- Returns:
number of ghost cells
- Return type:
int