f4enix.input.ww_gvr.geometry.Geometry#

class f4enix.input.ww_gvr.geometry.Geometry(header: WWHeader, coarse_vectors: Vectors, fine_vectors: Vectors)#

Bases: object

Class that contains all the geometrical information and methods associated to a WW file, including a pyvista mesh.

Parameters:
  • header (WWHeader) – The header of the WW file.

  • coarse_vectors (Vectors) – The coarse vectors of the WW file.

  • fine_vectors (Vectors) – The fine vectors of the WW file.

Methods

__init__(header, coarse_vectors, fine_vectors)

Class that contains all the geometrical information and methods associated to a WW file, including a pyvista mesh.

export_as_vtk(file_path)

Exports the grid as a VTK file.

fill_grid_array(array, name)

Fills the grid with an array given in K, J, I order.

fill_grid_ratios(ratios_by_particle)

Fills the grid with the ratios of the WW file.

fill_grid_values(values_by_particle)

Fills the grid with the values of the WW file.

plot()

Plots the grid with the values of the WW file in an interactive window

Attributes

b2_vectors

Returns a Vectors object of the vectors in the b2 format of the WW file

coordinate_type

director_1

Returns the director 1 vector (axis) of the cylinder if the grid is cylindrical.

director_2

Returns the director 2 vector (radius) of the cylinder if the grid is cylindrical.

i_coarse_ints

Returns the number of coarse intervals in the i direction

i_ints

Returns the number of intervals in the i direction

j_coarse_ints

Returns the number of coarse intervals in the j direction

j_ints

Returns the number of intervals in the j direction

k_coarse_ints

Returns the number of coarse intervals in the k direction

k_ints

Returns the number of intervals in the k direction

origin

vectors

Returns a Vectors object (1D) with the coarse and fine vectors combined

property b2_vectors: Vectors#

Returns a Vectors object of the vectors in the b2 format of the WW file

property director_1: list[float] | None#

Returns the director 1 vector (axis) of the cylinder if the grid is cylindrical.

property director_2: list[float] | None#

Returns the director 2 vector (radius) of the cylinder if the grid is cylindrical.

export_as_vtk(file_path: Path) None#

Exports the grid as a VTK file.

Parameters:

file_path (Path) – The path to create the VTK file.

fill_grid_array(array: ndarray[Any, dtype[_ScalarType_co]], name: str) None#

Fills the grid with an array given in K, J, I order.

If the grid is cylindrical, it properly manages the theta dimension even if it was extended with _extend_theta_intervals from the meshgrids module.

Parameters:
  • array (NDArray) – The array to fill the grid with.

  • name (str) – The name of the array, key.

fill_grid_ratios(ratios_by_particle: dict[ParticleType, dict[float, ndarray]]) None#

Fills the grid with the ratios of the WW file.

Parameters:

ratios_by_particle (ValuesByParticle) – The ratios of the WW file grouped by particle.

Return type:

None

fill_grid_values(values_by_particle: dict[ParticleType, dict[float, ndarray]]) None#

Fills the grid with the values of the WW file.

Parameters:

values_by_particle (ValuesByParticle) – The values of the WW file grouped by particle.

Return type:

None

property i_coarse_ints: int#

Returns the number of coarse intervals in the i direction

property i_ints: int#

Returns the number of intervals in the i direction

property j_coarse_ints: int#

Returns the number of coarse intervals in the j direction

property j_ints: int#

Returns the number of intervals in the j direction

property k_coarse_ints: int#

Returns the number of coarse intervals in the k direction

property k_ints: int#

Returns the number of intervals in the k direction

plot() None#

Plots the grid with the values of the WW file in an interactive window

property vectors: Vectors#

Returns a Vectors object (1D) with the coarse and fine vectors combined