## 1 Introduction  
The Finite Element Method (FEM) is a mature tool used to obtain the numerical solution of partial differential equations (PDEs) used in multiple engineering fields and physics [1, 2, 3, 4]. Apart from the solid mathematical foundation of FEM, one of the main advantages of this technique is the use of adaptive refinement to improve the error convergence in the approximation of the field. This leads to better use of the computational resources since we obtain automatically more accurate solutions with fewer unknowns to solve. Additionally, the use of these techniques provides an estimation of the error in the problem. In FEM, we can perform \(h\) refinements (decreasing the size of the elements used for discretizing the original domain) and \(p\) refinements (increasing the order of basis functions that approximate the field under study). The combination of these two refinements leads to the so-called \(hp\) refinement [5, 6, 7], which might lead to exponential convergence when appropriate estimators are used. The \(p\) refinements are especially effective when approximating smooth solutions, whereas \(h\) (also called mesh adaptive) refinements are more general and adapt to non-smooth solutions (e.g., bends, corners, or other special geometries). A good compromise is the use of second-order basis functions [8], as in [9, 10]. The field of application of \(h\) and \(hp\) adaptivity, [11, 12, 13, 14, 15, 16], is quite broad: multigroup neutron diffusion [17], brittle fracture modeling [18], tomography [19], inverse scattering problems in electromagnetics [20], electromagnetic cloaking [21], acoustics [22], metamaterials [23], or mechanics [24]. However, these techniques are specific to hexahedral and tetrahedral meshes. The use of different shapes depending on the geometry of the problem is advantageous from the computational point of view. We should use tetrahedra for irregular and unstructured geometries and hexahedra for rectangular-like geometries. The triangular prism can be considered as a hybrid of these two, and it can be used to connect hexahedral and tetrahedral meshes [25], whereas it is also well suited for planar geometries with an irregular pattern on the surface, e.g., laminates and sandwich structures [26; 27] integrated circuit package designs [28], planar microwave circuits and antennas [29], waveguide sections [30], or coating for irregular volumes meshed with tetrahedra. Additionally, the generation of volumetric meshes for prisms is typically easy since we only need to extrude a 2D triangular mesh. We need to introduce adaptivity techniques to all the different shapes to choose the most suitable shape for each problem. Unfortunately, the application of adaptivity techniques to triangular prisms is not so frequent in the literature apart from [31; 32]. Whereas the formulation and the definition of the estimator do not depend on the discretization shape, the development of marking strategies and the application of different \(h\) refinements need to be particularized for the different shapes. Here, we suggest to take the fundamental ideas from 2D refinement and apply them rigorously to the adaptivity with triangular prisms, solving the particularities (especially related to maintaining admissible meshes in the sense of having conformal solutions from the FEM point of view straightforwardly) that arise from the application of these ideas to volumetric meshes. First, we use the Method of Manufactured Solutions, MMS [33], to show the significance of the mesh quality indicators we have introduced and to experiment with five different marking strategies of the elements to be refined. Then, we validate our implementation with a propagation problem (specifically, a WR-90 rectangular waveguide). Finally, we show with an L-shaped waveguide section the effectiveness of the adaptivity algorithm. The rest of the paper is structured as follows: In Section 2, we detail each different step of the adaptivity algorithm.