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: G3DEntity

Definition of class Interface

Attributes:
intf_type

Connectivity interface type

size

Placeholder size

tag

tag (string) used for identification

Methods

add_face_def(a, b)

Add face definition to boundary placeholder

allocate_FMPs()

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

deallocate_FMPs()

De-allocates interface flux molecule placeholders

get_FMP_size()

Get interface accumulated boundary flux molecule placeholder size

get_face_count()

Get face count

get_face_defs()

Get interface face definitions

get_max_FMP_size()

Get max interface flux molecule placeholder size

get_n_ghost_cells()

Get number of allocated ghost cells

get_n_ghost_nodes()

Get number of allocated ghost nodes

ghost_report()

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

allocate_FMPs() → None[source]

Allocates interface flux molecule placeholders

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

deallocate_FMPs() → None[source]

De-allocates interface flux molecule placeholders

get_FMP_size() → int[source]

Get interface accumulated boundary flux molecule placeholder size

Returns:

size

Return type:

int

get_face_count() → int[source]

Get face count

Returns:

face count

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

ghost_report() → None[source]

Prints a ghost cell/node report

property intf_type: Any

Connectivity interface type

Returns:

interface type

Return type:

INTFTypes

print() → None[source]

prints entity data

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

update_FMP_metrics(x: ndarray, y: ndarray, z: ndarray) → None[source]

Update interface flux molecule metrics

Parameters:
  • x (ndarray :) – x coordinate vector

  • y (ndarray :) – y coordinate vector

  • z (ndarray :) – z coordinate vector

class g3d.flow.domain.glue.connectivity.InterfacePlaceHolder(*args: Any, **kwargs: Any)[source]

Bases: G3DEntity

Definition of class InterfacePlaceHolder

Attributes:
tag

tag (string) used for identification

Methods

add_interface(t)

Add interface container

allocate_placeholders()

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)

get_face_count()

Extract interface face count

get_interface(t)

Get interface

get_interface_array()

Get interface array

get_max_FMP_size()

Get maximum flux molecule placeholder size

get_max_ghost_cells()

Finds maximum number of ghost cells in an interface container

get_max_ghost_nodes()

Finds maximum number of ghost nodes in a boundary container

ghost_report()

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

allocate_placeholders() → None[source]

Allocate placeholder data containers

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_face_count() → int[source]

Extract interface face count

Returns:

face count

Return type:

int

get_interface(t: Any) → Interface | None[source]

Get interface

Parameters:

t (INTFTypes :) – interface type

Returns:

interface

Return type:

Interface or None

get_interface_array() → list[source]

Get interface array

Returns:

interface array

Return type:

list

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

ghost_report() → None[source]

Extracts boundary ghost cell/node report

print() → None[source]

prints entity data

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)

read_from_file(f: IO[str], intf_type: Any) → None[source]

Read interface definition from file

Parameters:
  • f (file :) – file handle

  • intf_type (INTFTypes :) – interface type

update_FMP_metrics(x: ndarray, y: ndarray, z: ndarray) → None[source]

Updates flux molecule metrics for stored interface containers

Parameters:
  • x (ndarray :) – x coordinate vector

  • y (ndarray :) – y coordinate vector

  • z (ndarray :) – z coordinate vector

class g3d.flow.domain.glue.connectivity.Intf(*args: Any, **kwargs: Any)[source]

Bases: Face

Definition of class Intf, extends class Face

Attributes:
FMP
return:

FMP_size
return:

X
return:

Y
return:

Z
return:

alfa

Angular separation, rotation about x-axis (for rotational periodic boundaries)

alpha
return:

check
return:

delta
return:

dx

Spatial separation in x-direction (for translational periodic boundaries)

dy

Spatial separation in y-direction (for translational periodic boundaries)

dz

Spatial 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:

tag

tag (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_delta()

Get face spatial separation in three coordinate directions (for translational periodic faces)

get_from_backup([reset_bak])

get_index(i, j)

get_n_ghost_cells()

Get number of ghost cells for interface

get_n_ghost_nodes()

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()

ghost_report()

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])

set_face_delta(d)

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

get_n_ghost_nodes() → int[source]

Get number of ghost nodes for interface

Returns:

number of ghost nodes

Return type:

int

ghost_report() → None[source]

Extracts interface ghost report

set_face_delta(d: ndarray | list) → None[source]

Get face spatial separation in three coordinate directions (for translational periodic faces)

Parameters:

d (ndarray) – spatial separation in three coordinates [dx, dy, dz]

Module contents

g3d/flow/domain/glue sub library

class g3d.flow.domain.glue.Interface(*args: Any, **kwargs: Any)[source]

Bases: G3DEntity

Definition of class Interface

Attributes:
intf_type

Connectivity interface type

size

Placeholder size

tag

tag (string) used for identification

Methods

add_face_def(a, b)

Add face definition to boundary placeholder

allocate_FMPs()

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

deallocate_FMPs()

De-allocates interface flux molecule placeholders

get_FMP_size()

Get interface accumulated boundary flux molecule placeholder size

get_face_count()

Get face count

get_face_defs()

Get interface face definitions

get_max_FMP_size()

Get max interface flux molecule placeholder size

get_n_ghost_cells()

Get number of allocated ghost cells

get_n_ghost_nodes()

Get number of allocated ghost nodes

ghost_report()

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

allocate_FMPs() → None[source]

Allocates interface flux molecule placeholders

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

deallocate_FMPs() → None[source]

De-allocates interface flux molecule placeholders

get_FMP_size() → int[source]

Get interface accumulated boundary flux molecule placeholder size

Returns:

size

Return type:

int

get_face_count() → int[source]

Get face count

Returns:

face count

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

ghost_report() → None[source]

Prints a ghost cell/node report

property intf_type: Any

Connectivity interface type

Returns:

interface type

Return type:

INTFTypes

print() → None[source]

prints entity data

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

update_FMP_metrics(x: ndarray, y: ndarray, z: ndarray) → None[source]

Update interface flux molecule metrics

Parameters:
  • x (ndarray :) – x coordinate vector

  • y (ndarray :) – y coordinate vector

  • z (ndarray :) – z coordinate vector

class g3d.flow.domain.glue.InterfacePlaceHolder(*args: Any, **kwargs: Any)[source]

Bases: G3DEntity

Definition of class InterfacePlaceHolder

Attributes:
tag

tag (string) used for identification

Methods

add_interface(t)

Add interface container

allocate_placeholders()

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)

get_face_count()

Extract interface face count

get_interface(t)

Get interface

get_interface_array()

Get interface array

get_max_FMP_size()

Get maximum flux molecule placeholder size

get_max_ghost_cells()

Finds maximum number of ghost cells in an interface container

get_max_ghost_nodes()

Finds maximum number of ghost nodes in a boundary container

ghost_report()

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

allocate_placeholders() → None[source]

Allocate placeholder data containers

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_face_count() → int[source]

Extract interface face count

Returns:

face count

Return type:

int

get_interface(t: Any) → Interface | None[source]

Get interface

Parameters:

t (INTFTypes :) – interface type

Returns:

interface

Return type:

Interface or None

get_interface_array() → list[source]

Get interface array

Returns:

interface array

Return type:

list

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

ghost_report() → None[source]

Extracts boundary ghost cell/node report

print() → None[source]

prints entity data

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)

read_from_file(f: IO[str], intf_type: Any) → None[source]

Read interface definition from file

Parameters:
  • f (file :) – file handle

  • intf_type (INTFTypes :) – interface type

update_FMP_metrics(x: ndarray, y: ndarray, z: ndarray) → None[source]

Updates flux molecule metrics for stored interface containers

Parameters:
  • x (ndarray :) – x coordinate vector

  • y (ndarray :) – y coordinate vector

  • z (ndarray :) – z coordinate vector

class g3d.flow.domain.glue.Intf(*args: Any, **kwargs: Any)[source]

Bases: Face

Definition of class Intf, extends class Face

Attributes:
FMP
return:

FMP_size
return:

X
return:

Y
return:

Z
return:

alfa

Angular separation, rotation about x-axis (for rotational periodic boundaries)

alpha
return:

check
return:

delta
return:

dx

Spatial separation in x-direction (for translational periodic boundaries)

dy

Spatial separation in y-direction (for translational periodic boundaries)

dz

Spatial 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:

tag

tag (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_delta()

Get face spatial separation in three coordinate directions (for translational periodic faces)

get_from_backup([reset_bak])

get_index(i, j)

get_n_ghost_cells()

Get number of ghost cells for interface

get_n_ghost_nodes()

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()

ghost_report()

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])

set_face_delta(d)

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

get_n_ghost_nodes() → int[source]

Get number of ghost nodes for interface

Returns:

number of ghost nodes

Return type:

int

ghost_report() → None[source]

Extracts interface ghost report

set_face_delta(d: ndarray | list) → None[source]

Get face spatial separation in three coordinate directions (for translational periodic faces)

Parameters:

d (ndarray) – spatial separation in three coordinates [dx, dy, dz]