(
        self,
        irad: float,
        orad: float,
        mesh_size: float = None,
        R=np.eye(3),
        x0=np.array([0.0, 0.0, 0.0]),
    )
return vol
Create Gmsh code for the torus in the x-y plane under the coordinate
        transformation

        .. math::
            \\hat{x} = R x + x_0.

        :param irad: inner radius of the torus
        :param orad: outer radius of the torus
Create Gmsh code for the torus in the x-y plane under the coordinate
        transformation
Create Gmsh code for the torus in the x - y plane under the coordinate transformation
def _add_torus_extrude_lines(
        self,
        irad: float,
        orad: float,
        mesh_size: float = None,
        R=np.eye(3),
        x0=np.array([0.0, 0.0, 0.0]),
    ):
        """Create Gmsh code for the torus in the x-y plane under the coordinate
        transformation

        .. math::
            \\hat{x} = R x + x_0.

        :param irad: inner radius of the torus
        :param orad: outer radius of the torus
        """
        # Add circle
        x0t = np.dot(R, np.array([0.0, orad, 0.0]))
        # Get circles in y-z plane
        Rc = np.array([[0.0, 0.0, 1.0], [0.0, 1.0, 0.0], [1.0, 0.0, 0.0]])
        c = self.add_circle(x0 + x0t, irad, mesh_size=mesh_size, R=np.dot(R, Rc))

        rot_axis = [0.0, 0.0, 1.0]
        rot_axis = np.dot(R, rot_axis)
        point_on_rot_axis = [0.0, 0.0, 0.0]
        point_on_rot_axis = np.dot(R, point_on_rot_axis) + x0

        # Form the torus by extruding the circle three times by 2/3*pi. This
        # works around the inability of Gmsh to extrude by pi or more. The
        # Extrude() macro returns an array; the first [0] entry in the array is
        # the entity that has been extruded at the far end. This can be used
        # for the following Extrude() step.  The second [1] entry of the array
        # is the surface that was created by the extrusion.
        previous = c.curve_loop.curves
        angle = 2 * np.pi / 3
        all_surfaces = []
        for _ in range(3):
            for k, p in enumerate(previous):
                # ts1[] = Extrude {{0,0,1}, {0,0,0}, 2*Pi/3}{Line{tc1};};
                # ...
                top, surf, _ = self.revolve(
                    p,
                    rotation_axis=rot_axis,
                    point_on_axis=point_on_rot_axis,
                    angle=angle,
                )
                all_surfaces.append(surf)
                previous[k] = top

        # compound_surface = CompoundSurface(all_surfaces)

        surface_loop = self.add_surface_loop(all_surfaces)
        vol = self.add_volume(surface_loop)
        return vol
def _add_torus_extrude_lines ( self , irad : float , orad : float , mesh_size : float = None , R = np . eye ( 3 ) , x0 = np . array ( [ 0.0 , 0.0 , 0.0 ] ) , ) : # Add circle x0t = np . dot ( R , np . array ( [ 0.0 , orad , 0.0 ] ) ) # Get circles in y-z plane Rc = np . array ( [ [ 0.0 , 0.0 , 1.0 ] , [ 0.0 , 1.0 , 0.0 ] , [ 1.0 , 0.0 , 0.0 ] ] ) c = self . add_circle ( x0 + x0t , irad , mesh_size = mesh_size , R = np . dot ( R , Rc ) ) rot_axis = [ 0.0 , 0.0 , 1.0 ] rot_axis = np . dot ( R , rot_axis ) point_on_rot_axis = [ 0.0 , 0.0 , 0.0 ] point_on_rot_axis = np . dot ( R , point_on_rot_axis ) + x0 # Form the torus by extruding the circle three times by 2/3*pi. This # works around the inability of Gmsh to extrude by pi or more. The # Extrude() macro returns an array; the first [0] entry in the array is # the entity that has been extruded at the far end. This can be used # for the following Extrude() step.  The second [1] entry of the array # is the surface that was created by the extrusion. previous = c . curve_loop . curves angle = 2 * np . pi / 3 all_surfaces = [ ] for _ in range ( 3 ) : for k , p in enumerate ( previous ) : # ts1[] = Extrude {{0,0,1}, {0,0,0}, 2*Pi/3}{Line{tc1};}; # ... top , surf , _ = self . revolve ( p , rotation_axis = rot_axis , point_on_axis = point_on_rot_axis , angle = angle , ) all_surfaces . append ( surf ) previous [ k ] = top # compound_surface = CompoundSurface(all_surfaces) surface_loop = self . add_surface_loop ( all_surfaces ) vol = self . add_volume ( surface_loop ) return vol