Pieces

Base classes for cylindrical GMSH pieces.

Also contains useful functions for these classes. Author: Duncan Hunter

class pipemesh.pieces.ChangeRadius(length, change_length, in_radius, out_radius, direction, lcar)

Class representing a cylinder with a change in radius.

class pipemesh.pieces.Curve(radius, in_direction, out_direction, bend_radius, lcar)

Class representing a GMSH curve by revolution.

class pipemesh.pieces.Cylinder(length, radius, direction, lcar)

Class representing a GMSH cylinder with base at 0,0,0 facing upwards.

class pipemesh.pieces.Mitered(radius, in_direction, out_direction, lcar)

Class representing a mitered (sharp) pipe bend.

Piece creation is done by masking (intersect) a cylinder with a chamfered box. The piece is then mirrored, rotated and fused.

The piece is then rotated to face the direction of the outflow. It is then rotated about the direction of outflow to match the new direction

class pipemesh.pieces.PipePiece(radius, vol_tag, in_tag, out_tag, in_direction, out_direction, lcar)

Parent class of pieces.

Pieces are GMSH objects that can be used in creating pipes. This class has common information that all pieces have, such as radius. It also has functions that all the classes use, such as the need to update centres of pieces after they have been transformed.

class pipemesh.pieces.Surface(dimtag, centre, direction, radius)

Class representing a surface of a piece.

Pieces are PipePieces, and are all cylindrical in nature, which is why the pieces have radius.

class pipemesh.pieces.TJunction(radius, t_radius, direction, t_direction, lcar)

Class representing a T-junction in GMSH

pipemesh.pieces.proj(vec1, vec2)

Returns the component of vec1 along vec2

Parameters:vec2 (vec1,) – (np.array shape 3) xyz vector.
pipemesh.pieces.vec_angle(vec1, vec2)

Returns the angle between two numpy array vectors