AxiShell¶
- class AxiShell(n_azi, n_longi, angle, ctrl_pts_x, ctrl_pts_r, angle_min=None)[source]¶
Bases:
kokiy.shell_2d.Shell2D
An x-axisymmetric computational shell.
Some attributes are based on u and v, defined as the curvilinear longitudinal (x/r) abscissa and curvilinear azimutal (theta) abscissa respectively.
- Parameters
n_azi (
int
) – Number of azimuthal shell points.n_longi (
int
) – Number of longitudinal shell points.angle (
float
) – Range angle of the axicylindrical geometry.ctrl_pts_x (numpy.ndarray) – x-coordinates of the points defining the spline of shape (n,).
ctrl_pts_r (numpy.ndarray) – r-coordinates of the points defining the spline of shape (n,).
angle_min (
float
) – Minimum angle of the shell.
(x_n, r_n) _____X_____ ___---- | ----___ Cylindrical system \ | / Example longi/u <=> r \ | / \ | / r - longi/u \ | / ^ \ | (x_0, r_0) | \ _X_ / | \__--- ---__/ X-----> theta - azi/v x ................ ... .. Cylindrical system .. . Example longi/u <=> x/r . . . ................ r . . ^ . ................... | .. | ...................... X-----> x <-- theta - azi/v x/r - longi/u
Methods
__init__
(n_azi, n_longi, angle, ctrl_pts_x, ...)add_curviwidth
(label, points)Add a 2D width matrix of shell shape extruded from points spline.
average_on_shell_over_dirs
(variable, directions)Performs an integration (average) over one or multiple directions.
bake_millefeuille
(width_matrix_label, n_layers)Create a millefeuille-like shell.
dump
([filename, fields])Dump shell geometrical and physical properties into hdf file.
dump_shell
([name, fields])Dump shell geometrical properties into hdf file.
export_geo
(filename[, show_all])Exports simplified boundary representation for visualization.
export_mesh
(filename, elem_type, **kwargs)Exports mesh.
get_mesh
(elem_type)Returns a yamio.Mesh.
Invert directions of normal vectors.
operate_on_shell_over_dirs
(variable, directions)Applies an operator over one or multiple direction.
plot
([savefile])Plot 2D curve of the Shell.
rad_theta_components
(vect_y, vect_z)Computes the radial and azimuthal components of a vect y, z.
replicate
(shape)Creates a similar instance, but possibly with different shape.
set_mask_on_shell
(point_cloud, tol)Create a mask on the shell from a point cloud.
Attributes
geom_type
n_xyz
Normals with same shape as xyz.
u_adim
Deprecated since version 0.2.0.
uv
uv matrix of shape self.shape.
v_adim
Deprecated since version 0.2.0.
xyz
xyz matrix of shape (*self.shape, 3).
Methods¶
- AxiShell.add_curviwidth(label, points)¶
Add a 2D width matrix of shell shape extruded from points spline.
- Parameters
label (
str
) – Label of the width matrix.points (
array-like
) – Coordinates with shape (n, 2).Notes
This method makes this object stateful. Avoid it if you can.
- AxiShell.average_on_shell_over_dirs(variable, directions, scale=True)¶
Performs an integration (average) over one or multiple directions.
- Parameters
variable (numpy.ndarray) – Data to be averaged of shape (n_time, n_v, n_u).
directions (
array-like
) – A list() of directions on which the average process is to be performed. Contains keywords from [‘time’, ‘v’, ‘u’].scale (
bool
) – Keeps nominal averaging (if False) or takes into account surface element (if True).- Returns
Averaged data on given directions.
- Return type
np.array
- AxiShell.bake_millefeuille(width_matrix_label, n_layers, shift=0.0)¶
Create a millefeuille-like shell.
Extrude a 2D shell in the normal direction up pointwise height given by “width_matrix_label” matrix.
- Parameters
- Returns
ThickShell
Notes
Use Thickshell.bake_from_shell when possible.
“Bon appetit!”
- AxiShell.dump(filename='shell', fields=None)¶
Dump shell geometrical and physical properties into hdf file.
- AxiShell.dump_shell(name='shell', fields=None)¶
Dump shell geometrical properties into hdf file.
- Parameters
Deprecated since version 0.2.0: Use dump instead.
- AxiShell.export_geo(filename, show_all=False, **kwargs)¶
Exports simplified boundary representation for visualization.
Uses ensight gold format.
- Parameters
show_all (
bool
) – Show all boundary edges?kwargs – will be passed to writer.write method.
Notes
If goal is to proper export original mesh use export_mesh.
- AxiShell.export_mesh(filename, elem_type, **kwargs)¶
Exports mesh.
- Parameters
Notes
hip does not allow 3d surface meshes.
- AxiShell.get_mesh(elem_type)¶
Returns a yamio.Mesh.
- AxiShell.invert_normals()¶
Invert directions of normal vectors.
- AxiShell.operate_on_shell_over_dirs(variable, directions, operator=<function mean>)¶
Applies an operator over one or multiple direction.
Notes
Directions are not commutative for non-linear operators.
- AxiShell.plot(savefile=None)¶
Plot 2D curve of the Shell.
- Parameters
savefile (
str
) – filename. If None, the figure is only plotted.
- AxiShell.rad_theta_components(vect_y, vect_z)¶
Computes the radial and azimuthal components of a vect y, z.
- AxiShell.set_mask_on_shell(point_cloud, tol)¶
Create a mask on the shell from a point cloud.
- Parameters
point_cloud (numpy.ndarray) – Coordinates with shape (n, 3).
tol (
float
) – Tolerance.Notes
The mask value is 0 for shell points located near cloud points. Otherwise the mask value is 1.