Immersed boundary-conformal isogeometric methods for magnetostatics Journal: Computer Methods in Applied Mechanics and Engineering Yusuf T. Elbadry, Giuliano Guarino, Pablo Antolín, Oliver Weeger Abstract Isogeometric analysis was proposed to bridge the gap between computer-aided design and numerical discretization. However, standard multi-patch isogeometric analysis mandates conformal discretizations across patch interfaces, posing challenges for multi-material domain problems. In the context of electric machines, this requirement becomes evident in a large number of patches needed to represent machines consisting of several domains and materials. In this work, we adopt, extend, and evaluate three non-conformal discretization strategies for magnetostatic problems: a fully immersed approach, the union with non-conformal patches, and the union with conformal layers. In all three methods, boundary-conformal high-order quadrature rules are employed for integration over trimmed boundary and interface elements. In the two union approaches, material regions are, as far as possible, represented by independent non-conformal spline patches that are embedded within a background patch and coupled weakly through Nitsche’s method. In the latter framework, critical interfaces are additionally surrounded by conformal layers that enable the strong imposition of boundary conditions and improved resolution of interface behavior. The proposed approaches are assessed through several magnetostatic benchmark problems and an industrial application. The numerical results show that the union methods achieve highly accurate solutions, while the fully immersed approach struggles with discontinuities in field gradients across material interfaces. Nevertheless, these methods significantly reduce the geometric preprocessing effort compared to conventional, conformal multi-patch analysis and require substantially fewer patches. Overall, this demonstrates that our immersed boundary-conformal isogeometric framework possesses great potential for efficient simulation of complex electromagnetic devices. † † graphicalabstract: † † highlights: Accurate integration over trimmed elements via boundary-conformal quadrature method Reduced geometry preprocessing effort through minimization of the required patch count Mitigated need for Lagrange multiplier-type methods for coupling Accurate solution for complex geometries without imposing conformality conditions Demonstrated efficacy of the proposed method for magnetostatic applications 1 Introduction Numerical simulation has become an essential tool in engineering and applied sciences, reducing overall design time, and enabling detailed analysis across a wide range of applications, such as solid mechanics [ 7 , 22 , 2 , 40 ] , fluid dynamics [ 66 , 8 , 42 ] , and electric machines [ 65 , 52 , 17 ] . However, geometry preprocessing still constitutes a significant portion of the overall simulation process. The finite element method (FEM) represents one of the cornerstones of numerical simulation and is widely used across a broad range of engineering applications. Nonetheless, it suffers from limitations related to the approximation of geometric representations, particularly in the presence of curved boundaries and complex features. To address this issue, isogeometric analysis (IGA) was introduced to establish a tighter integration between computer-aided design (CAD) and finite element simulations [ 48 , 23 ] , by employing Non-Uniform Rational B-Splines (NURBS) for the simultaneous representation of both geometry and solution fields [ 75 ] . Despite these advances, geometric preprocessing remains a time-consuming step, especially for complex domains. Generation of body-fitted finite element meshes typically requires substantial manual intervention. In the context of IGA, conformal multi-patch discretizations must be employed [ 73 ] . This limits the degree of automation achievable in the overall simulation workflow, also in view of upcoming agent-based and large language model-empowered computer-aided engineering [ 41 ] . To mitigate the meshing effort, immersed boundary methods (IBM) provide an alternative approach to body-fitted, conformal meshes. A large number of methods adopt this concept, including the level-set method [ 74 , 71 ] , marker-and-cell methods [ 43 , 37 ] , volume-of-fluid methods [ 44 , 76 ] , cut-cell methods [ 62 ] , fictitious domain and penalty methods [ 77 , 14 ] , the eXtended finite element method [ 82 , 34 , 9 , 81 ] , CutFEM [ 21 ] , and the finite cell method [ 72 ] . However, the main challenge with such approaches lies in accurately resolving the geometry, particularly the interfaces between domains, either with adaptive discretizations or just the integration scheme, which are both also challenging. Moreover, Dirichlet boundary conditions must typically be imposed weakly while maintaining stability of the formulation. In the context of magnetostatics and electric machine analysis, simulations typically involve multiple computational domains composed of different materials with strong material property contrasts, e.g., of the magnetic permeability of air vs. iron. Consequently, the meshing process becomes increasingly challenging, as material interfaces must be explicitly identified and accurately resolved. When multi-patch discretizations are employed, this results in a large number of patches, as the patches must be topologically square and the spline discretizations conformal across interfaces [ 73 , 88 , 54 ] . Constructing these patches, enforcing conformity conditions, and assembling them into a multi-patch mesh constitutes a tedious and time-consuming process, which may require several hours or even days of manual labor to complete for geometries with complex features. Alternatively, to loosen at least the conformity requirement, Nitsche’s method [ 68 ] can be used to couple multi-patches in a weak manner [ 67 ] . However, this can be applied to domains topologically equivalent to a square, a condition that is not met in complex geometries. Hence, such a technique eliminates the conformity condition, but large number of patches will be needed to represent a complex geometry. Furthermore, when rotational motion is considered, as in rotor–stator configurations, the coupling of interfaces between rotating and stationary subdomains becomes particularly challenging, since maintaining mesh conformity typically necessitates repeated re-meshing of the rotating regions [ 79 , 17 ] . Multiple methods have addressed the coupling of rotating subdomains effectively by weakly coupling the interface between the rotor-stator subdomains. Mortar-type methods [ 12 , 13 ] were applied to Maxwell’s equations, including non-overlapping mortar formulations [ 10 , 79 , 11 ] . For overlapping subdomains, mortar-based techniques have been applied to coupled magneto-mechanical problems [ 78 ] . A local discontinuous Galerkin method was proposed to treat the air-gap region in electric machine simulations [ 1 ] . In addition, interface treatment based on Lagrange multipliers has been investigated in [ 56 , 57 , 16 ] , adopting non-conformal mapping approaches in [ 18 , 29 ] . Beyond Lagrange multiplier-based techniques, an implicit boundary finite element method was proposed in [ 90 ] for magnetostatic analysis; in this method, material interfaces are handled without explicitly conforming meshes. In the context of IGA for electric machines, harmonic rotor-stator coupling techniques [ 24 ] have been combined with mortar methods [ 17 ] . In these approaches, the rotor and stator are constructed independently using conforming multi-patch discretizations that are subsequently coupled weakly through harmonic basis functions. However, while these methods effectively address the interface coupling between rotating and stationary domains, they generally still require mesh conformity within each subdomain (e.g., within the rotor and stator regions). This limits their applicability to complex geometries and reduces the overall level of automation. To overcome challenges related to geometric pre-processing, patch conformity, and the accurate resolution of interfaces between geometric patches, the concept of the immersed boundary conformal method (IBCM) was introduced [ 86 , 39 ] . The method was applied to linear elasticity [ 86 ] , contact problems [ 58 ] , and linear shell theory [ 39 ] . In this concept, multiple non-conforming patches are coupled weakly by means of Nitsche’s method, thereby avoiding the need for fully matching discretizations at interfaces. For integration over trimmed elements and interfaces, a high-order quadrature rule is employed. The approach can be further extended by surrounding the non-conformal patches with conformal boundary layers, which enables the strong imposition of Dirichlet boundary conditions, and smooths the transition between different material domains. In the present work, we transfer three different concepts to two-dimensional magnetostatics, namely: fully immersed isogeometric analysis [ 30 ] , the union with non-conformal patches (“Union NC”), and the union with conformal layers (“Union CL”) [ 86 , 39 ] . We aim to establish a computational framework, in which complex geometries involving multiple materials can be represented using a minimal number of patches, without enforcing discretization conformity between them. In this way, strict multi-patch and conformal meshing requirements are circumvented while maintaining solution accuracy. The performance of the proposed approaches is assessed through a series of benchmark problems that feature, in contrast to previous works on heat diffusion or linear elasticity [ 86 , 39 ] , multiple material subdomains with challenges such as discontinuous material coefficients, abrupt variations in current density across subdomain interfaces, and a remanence source term that involves the gradient of the test functions. The remainder of this manuscript is organized as follows: Section 2 introduces the governing equations of magnetostatics as foundational model, the bilinear form, and the usage of Nitsche’s method for weakly imposition of essential boundary conditions and multi-domain coupling. A brief overview of isogeometric finite element analysis is presented in Section 3 , in addition to the discretized weak form. Section 4 then describes the three different numerical techniques, namely: fully immersed , union with non-conformal patches , and union with conformal layers . Moreover, a note is given on the topic of stability and conditioning. In Section 5 , the proposed techniques are numerically evaluated through a series of benchmark examples, including configurations with impressed currents, material discontinuities, and a complex, industry-relevant multi-material geometry. Finally, Section 6 concludes the paper and outlines directions for future research. 2 Fundamentals of magnetostatics 2.1 Basics of magnetostatics The mathematical modeling of electric machines is governed by Maxwell’s equations. However, in the case of low-frequency rotating machines, particularly when displacement currents and induced eddy currents can be neglected, the full set of Maxwell’s equations can be reduced to the magnetostatic formulation [ 83 , 19 ] . We consider a physical domain \Omega\subset\mathbb{R}^{3} , on which the magnetostatic formulation is given by: \displaystyle\nabla\times\textbf{H} \displaystyle=\textbf{J}, (1a) \displaystyle\nabla\cdot\textbf{B} \displaystyle=0, (1b) where H denotes the magnetic field strength, B is the magnetic flux density, and J represents the source current density. In this work, we assume all materials to be isotropic and linear. Thus, the field strength H and the flux density B are linked through the constitutive equation: \textbf{B}=\mu\textbf{H}, (2) where \mu is the material’s magnetic permeability. It is independent of the field strength and given as \mu=\mu_{r}\mu_{0} , with \mu_{r} denoting the relative permeability of the material and \mu_{0}=4\pi\cdot 10^{-7}\,\mathrm{H/m} being the permeability of air. For materials exhibiting remanent behavior, such as permanent magnets, the constitutive relation reads [ 38 ] : \textbf{B}=\mu\textbf{H}+\textbf{B}_{r}, (3) where \textbf{B}_{r} denotes the permanent magnet’s remanence. To explicitly satisfy the divergence-free property of the magnetic flux density B , we introduce the vector potential function A such that: \textbf{B}=\nabla\times\textbf{A}. (4) Plugging Eq. 4 and the constitutive relation Eq. 3 into Eq. 1 yields: \nabla\times\left(\nu\left(\nabla\times\textbf{A}-\textbf{B}_{r}\right)\right)=\textbf{J}, (5) where \nu=\mu^{-1} is the magnetic reluctivity. As commonly done for modeling rotating electric machines with uniform cross-sections, we restrict our analysis to two-dimensional geometries \Omega\subset\mathbb{R}^{2} [ 80 , 83 ] . Accordingly, for the two-dimensional formulation, only the out-of-plane, z -components of the magnetic vector potential A_{z} and the current density J_{z} are considered. Under these assumptions, the strong form of the magnetostatic problem reads: -\nabla\cdot\left(\nu\left(\nabla A_{z}-\textbf{B}_{r}^{\perp}\right)\right)=J_{z}\quad\text{in }\Omega, (6) where the in-plane remanence \textbf{B}_{r}^{\perp} is parameterized as \textbf{B}_{r}^{\perp}=B_{r}\,(-\sin{\theta_{r}},\cos{\theta_{r}})^{\top} with B_{r} being the remanence magnitude and \theta_{r} the remanence direction. To complete the boundary value problem, the following boundary conditions are imposed: \displaystyle A_{z} \displaystyle=g\quad\text{on }\Gamma_{\mathrm{D}}\subset\partial\Omega, (7a) \displaystyle\mathbf{n}\cdot\big(\nabla A_{z}\big) \displaystyle=0\quad\text{on }\Gamma_{\mathrm{N}}\subset\partial\Omega, (7b) where \mathbf{n} is the outward unit normal to the boundary and \Gamma_{\mathrm{D}}\cup\Gamma_{\mathrm{N}}=\partial\Omega with \Gamma_{\mathrm{D}}\cap\Gamma_{\mathrm{N}}=\emptyset . 2.2 Weak form of 2D magnetostatics Applying the standard procedure of multiplying the strong form of the partial differential equation ( 6 ) with a test function v , integrating over the domain \Omega , performing integration by parts, applying the divergence theorem, and exploiting the boundary conditions given in Eq. 7 , one obtains the weak form of the 2D magnetostatic problem: Find A_{z}\in{H}^{1}_{g} such that \int_{\Omega}\nu\,\nabla v\cdot\nabla A_{z}\ \mathrm{d}\Omega=\int_{\Omega}vJ_{z}\,\mathrm{d}\Omega+\int_{\Omega}\nu\nabla v\cdot\textbf{B}^{\perp}_{r}\ \mathrm{d}\Omega\quad\forall\,v\in{H}^{1}_{0}. (8) Here, the boundary integral resulting from the integration by parts vanishes due to the imposition of the homogeneous Neumann condition on \Gamma_{\mathrm{N}} , which physically represents a boundary where the magnetic flux is directed purely in the normal direction. Furthermore, the trial and test function spaces are defined as: \displaystyle{H}^{1}_{g}=\{u\in H^{1}(\Omega):u=g\quad\text{on }\,\Gamma_{\mathrm{D}}\}, (9a) \displaystyle{H}^{1}_{0}=\{v\in H^{1}(\Omega):v=0\quad\text{on }\,\Gamma_{\mathrm{D}}\}. (9b) Using from now on u=A_{z} , the weak form in Eq. 8 can be written in a more concise, abstract mathematical form as: Find u\in{H}^{1}_{g} such that a(u,v)=l(v)\quad\forall\,v\in{H}^{1}_{0}, (10) with the symmetric positive definite bilinear form: a(u,v)=\int_{\Omega}\nu\,\nabla v\cdot\nabla u\ \mathrm{d}\Omega, (11) and the linear form: l(v)=\int_{\Omega}vJ_{z}\,\mathrm{d}\Omega+\int_{\Omega}\nu\nabla v\cdot\textbf{B}^{\perp}_{r}\ \mathrm{d}\Omega. (12) Note here that, as linear elliptic partial differential equations, the bilinear forms of heat diffusion, linear elasticity, and magnetostatics are similar, but magnetostatics poses the additional challenges that (i) usually subdomains with different material properties must be modeled, resulting in discontinuously varying reluctivity \nu , source current density J_{z} , and remanence \textbf{B}_{r}^{\perp} (which are often non-zero) and (ii) the remanence term in the linear form includes the gradient of the test function \nabla v . 2.3 Weak imposition of Dirichlet boundary conditions In immersed boundary method settings, coincidence of the physical domain boundaries with the computational domain boundaries is not guaranteed. In such cases, strong imposition of the Dirichlet boundary conditions is not possible. There are different methods for weak imposition of the Dirichlet boundary conditions, such as the penalty method [ 6 ] , Nitsche’s method [ 68 ] , and Lagrange multiplier methods [ 5 ] . In this work, in case that strong imposition of Dirichlet boundary conditions u=g\;\text{on}\;\Gamma_{\text{D}} is not possible, we apply Nitsche’s method for preserving the consistency and symmetry of the weak form. Consequently, the bilinear form and linear form given in Eqs. 10 to 12 are amended to incorporate the additional penalty, consistency, and symmetry terms: Find u\in{H}^{1} such that a(u,v)+a_{g}(u,v)=l(v)+l_{g}(v)\quad\forall\,v\in{H}^{1}, (13) where \displaystyle a_{g}(u,v)=-\int_{\Gamma_{\text{D}}}\nu(\nabla u\cdot\textbf{n})v\,\mathrm{d}\Gamma-\int_{\Gamma_{\text{D}}}\nu(\nabla v\cdot\textbf{n})u\,\mathrm{d}\Gamma+\beta\int_{\Gamma_{\text{D}}}\nu\,vu\,\mathrm{d}\Gamma, (14) and l_{g}(v)=-\int_{\Gamma_{\text{D}}}\nu(\nabla v\cdot\textbf{n})g\,\mathrm{d}\Gamma+\beta\int_{\Gamma_{\text{D}}}\nu vg\,\mathrm{d}\Gamma. (15) Here, \beta>0 represents the stabilization parameter, which needs to be selected sufficiently large to impose the prescribed Dirichlet boundary condition. 2.4 Weak coupling of non-conformal domains For coupling non-conformal domains along their interface, e.g., in the setting of non-conformal multi-patch discretizations, we also employ Nitsche’s method [ 68 ] , leveraging its consistent and symmetric formulation to weakly enforce interface continuity conditions. \Gamma_{LR} \Omega^{L} \nu^{L},\textbf{B}_{r}^{L},J_{z}^{L} \Omega^{R} \nu^{R},\textbf{B}_{r}^{R},J_{z}^{R} \partial\Omega^{L} \partial\Omega^{R} \textbf{n}^{L} \textbf{n}^{R} Figure 1 : Coupling of two domains \Omega^{L} and \Omega^{R} across their common interface \Gamma_{LR} via Nitsche’s method For illustrating the concept in the two-dimensional magnetostatic setting, we consider the coupling of two disjunct domains \Omega^{L} and \Omega^{R} , \Omega^{L}\cap\Omega^{R}=\emptyset , across their interface \Gamma_{LR}=\partial\Omega^{L}\cap\partial\Omega^{R} , see Fig. 1 . Though discontinuities in material parameters, magnetic remanences or source current densities can arise at the interfaces, the normal component of the magnetic flux density B and the tangential component of the magnetic field strength H should be continuous [ 49 , Ch. I5] : \displaystyle[[\textbf{B}]]\cdot\textbf{n} \displaystyle=0\quad\Rightarrow \displaystyle\textbf{n}\times[[A_{z}]] \displaystyle=0 on \displaystyle\Gamma_{LR}, (16a) \displaystyle\textbf{n}\times[[\textbf{H}]] \displaystyle=0\quad\Rightarrow \displaystyle\textbf{n}\times[[\nu\nabla\times A_{z}]] \displaystyle=0 on \displaystyle\Gamma_{LR}, (16b) with interface jumps on \Gamma_{LR} defined as [[\bullet]]=\bullet^{R}-\bullet^{L} . The outward unit normal to the interface \Gamma_{LR} is defined as \textbf{n}=\textbf{n}^{R}=-\textbf{n}^{L} , where \textbf{n}^{L} and \textbf{n}^{R} are the outward unit normals to \partial\Omega^{L} and \partial\Omega^{R} , respectively. In terms of the magnetic scalar potential u=A_{z} , these conditions translate as: \displaystyle[[u]]=u^{L}-u^{R}=0\quad \displaystyle\text{on}\quad\Gamma_{LR}, (17a) \displaystyle[[\nu\nabla u]]\cdot\textbf{n}=\nu^{L}\nabla u^{L}\cdot\textbf{n}+\nu^{R}\nabla u^{R}\cdot\textbf{n}=0\quad \displaystyle\text{on}\quad\Gamma_{LR}, (17b) where u^{R}=u|_{\Omega^{R}} and u^{L}=u|_{\Omega^{L}} denote the potentials in their corresponding domains, and \nu^{L} and \nu^{R} are the magnetic reluctivities in \Omega^{L} and \Omega^{R} , respectively. To weakly enforce these two conditions using Nitsche’s method, the bilinear form in Eq. 10 is adapted: Find u\in{V}^{g} such that: a(u,v)+a_{n}(u,v)=l(v),\quad\forall\,v\in{V}^{0}. (18) Here, the global trial and test function space are defined as: {V}^{\alpha}=\left\{v\in{H}^{1}(\Omega^{L}):v|_{\Gamma_{D}\cap\partial\Omega^{L}}=\alpha\right\}\oplus\left\{v\in{H}^{1}(\Omega^{R}):v|_{\Gamma_{D}\cap\partial\Omega^{R}}=\alpha\right\}, (19) where \alpha:\Gamma_{D}\to\mathbb{R} denotes the prescribed Dirichlet boundary condition on the joint Dirichlet boundary of \partial\Omega^{L} and \partial\Omega^{R} , such that it is \alpha=g for {V}^{g} and \alpha=0 for {V}^{0} , respectively. More importantly, the additional bilinear form to weakly enforce Eq. 17 by Nitsche’s method is given as: \displaystyle a_{n}(u,v)= \displaystyle-\int_{\Gamma_{LR}}\big\{\nu\nabla u\cdot\mathbf{n}\big\}_{\gamma_{2}}\,[[v]]\,d\Gamma-\gamma_{1}\int_{\Gamma_{LR}}\big\{\nu\nabla v\cdot\mathbf{n}\big\}_{\gamma_{2}}\,[[u]]\,d\Gamma (20) \displaystyle+\beta\,(h_{R}^{-1}+h_{L})\int_{\Gamma_{LR}}\nu_{\text{max}}\,[[u]]\,[[v]]\,d\Gamma, with: \big\{\nu\nabla u\cdot\mathbf{n}\big\}_{\gamma_{2}}:=\gamma_{2}\big(\nu^{R}\nabla u^{R}\cdot\mathbf{n}\big)+(1-\gamma_{2})\big(\nu^{L}\nabla u^{L}\cdot\mathbf{n}\big). (21) This latter expression represents a weighted flux jump on the interface \Gamma_{LR} , compare Eq. 17b . The parameter \gamma_{2}\in[0,1] controls the weighting of the average operator and determines toward which domain the average is biased. In the present formulation, if we assumed that \Omega^{R} is discretized in an untrimmed, boundary-conformal fashion, i.e., as an individual patch, whereas domain \Omega^{L} is immersed and thus trimmed, then the choice \gamma_{2}=1 leads to a one-sided flux evaluation, thereby eliminating the symmetric averaging procedure. Consequently, the penalty term depends solely on the mesh size h_{R} of the untrimmed “master” domain \Omega^{R} , rather than on an averaged mesh parameter that also considers the mesh size h_{L} of the trimmed domain \Omega^{L} . In our formulation, it will be essential that the selected master domain remains untrimmed in order to preserve stability. More elaboration on the trimming process and the union approach will be discussed in Sections 4.1 and 4.2 . In Eq. 20 , the parameter \gamma_{1}\in\left\{-1,0,1\right\} controls the symmetry of the formulation. Here, we set \gamma_{1}=1 to maintain symmetry of the bilinear form a_{n} . Furthermore, the stabilization parameter \beta>0 in the last term of Eq. 20 is required to ensure coercivity. It must be chosen sufficiently large to enforce the interface condition in a stable and consistent manner. Here, we select \beta\in[10,10^{4}] . Additionally, the reluctivity used in the stabilization term is chosen as the maximum value of the reluctivity of the two domains in order to ensure robustness of the formulation, \nu_{\text{max}}=\max\{\nu^{L},\nu^{R}\} . 3 Isogeometric analysis This section introduces the basic concepts of isogeometric finite element analysis and fixes the notation used throughout the manuscript. Further details can be found in [ 75 , 48 , 23 ] . First, we introduce B-splines, followed by an isogeometric finite element discretization of the magnetostatic weak form Eq. 8 . 3.1 B-splines Let \{\xi_{1},\ldots,\xi_{n+p+1}\} be a knot vector defining the parametric domain \Omega_{\xi}=[\xi_{1},\xi_{n+p+1}] . The Cox–de Boor recursion formula is used to define the n B-spline basis functions N_{i}^{p}:\Omega_{\xi}\rightarrow\mathbb{R} of degree p\geq 0 as: \displaystyle N_{i}^{0}(\xi) \displaystyle=\begin{cases}1,&\text{if }\xi_{i}\leq\xi<\xi_{i+1},\\ 0,&\text{otherwise},\end{cases} (22) \displaystyle N_{i}^{p}(\xi) \displaystyle=\frac{\xi-\xi_{i}}{\xi_{i+p}-\xi_{i}}\,N_{i}^{p-1}(\xi)+\frac{\xi_{i+p+1}-\xi}{\xi_{i+p+1}-\xi_{i+1}}\,N_{i+1}^{p-1}(\xi). Here, it is assumed that any quotient of the form 0/0 is taken to be zero. The B-spline basis functions possess several important properties, including non-negativity, linear independence, and partition of unity. Moreover, their regularity can be controlled by the knot multiplicity; in particular, they are (p-1) -times continuously differentiable at interior knots of multiplicity one. To enforce the interpolation property at the boundary, open knot vectors are employed, for which the first and last knots are repeated (p+1) -times. Bivariate B-splines basis functions N_{i}(\boldsymbol{\xi}) with \boldsymbol{\xi}=(\xi,\eta) can be constructed by the tensor product of two univariate B-spline basis functions as \displaystyle N_{i}(\xi,\eta)=N_{j,p}(\xi)\cdot N_{k,q}(\eta)\quad\text{for}\quad i=(j-1)l+k\quad\text{with}\quad\left\{\begin{array}[]{l}j=1,\ldots,l,\\ k=1,\ldots,m\end{array}\right.. (23) Here, N_{j,p}:\Omega_{\xi}\to\mathbb{R} and N_{k,q}:\Omega_{\eta}\to\mathbb{R} are the l and m univariate B-spline basis functions of degree p and q , respectively, as defined in Eq. 22 . The n=l\cdot m bivariate B-splines basis functions N_{i}(\boldsymbol{\xi}):\hat{\Omega}\to\mathbb{R} are then defined on the two-dimensional parameter domain \hat{\Omega}=\Omega_{\xi}\times\Omega_{\eta} . For simplicity of the notation, i=1,\ldots,n is used as a combined index and the dependence of N_{i} on the degrees p and q is dropped. In the following, for the sake of clarity, we always set p=q . 3.2 Isogeometric discretization A two-dimensional B-spline surface \Omega\ \subset\mathbb{R}^{2} is represented through the mapping \mathcal{F}:\hat{\Omega}\to\Omega as a linear combination of n bivariate B-splines basis functions N_{i}(\boldsymbol{\xi}) with control points \textbf{x}_{i}\in\mathbb{R}^{2} : \mathcal{F}(\boldsymbol{\xi})=\textbf{x}^{h}(\boldsymbol{\xi})=\sum_{i=1}^{n}N_{i}(\boldsymbol{\xi})\,\textbf{x}_{i}. (24) The B-splines surface parametrization is not limited to describe the geometry in terms of the position vector \textbf{x}^{h}\in\Omega , but also to discretize and approximate the field variable and test functions: A_{z}\approx u^{h}(\boldsymbol{\xi})=\sum_{i=1}^{n}N_{i}(\boldsymbol{\xi})\,{u}_{i},\qquad v\approx v^{h}(\boldsymbol{\xi})=\sum_{i=1}^{n}N_{i}(\boldsymbol{\xi})\,{v}_{i}. (25) Here, u_{i},v_{i}\,\in\mathbb{R} are the n control points of the discretized scalar potential field u^{h}:\hat{\Omega}\to\mathbb{R} and the scalar test function v^{h}:\hat{\Omega}\to\mathbb{R} , respectively. Under the isoparametric assumption, the field variables on the physical domain \Omega are obtained by composing the discrete field with the inverse of the geometric mapping Eq. 24 , e.g., u^{h}(\textbf{x})=u^{h}(\boldsymbol{\xi})\circ\mathcal{F}(\boldsymbol{\xi})^{-1} , such that u^{h},v^{h}\in H^{1}(\Omega) . Hence, the gradients with respect to the physical domain coordinates needs to be computed using the chain rule, e.g., \nabla_{\textbf{x}}u^{h}(\boldsymbol{\xi})=\nabla_{\boldsymbol{\xi}}u^{h}(\boldsymbol{\xi})\cdot(\nabla_{\boldsymbol{\xi}}\mathcal{F}(\boldsymbol{\xi}))^{-1}, (26) with \nabla_{\boldsymbol{\xi}}u^{h}(\boldsymbol{\xi})=\sum_{i=1}^{n}\nabla_{\boldsymbol{\xi}}N_{i}(\boldsymbol{\xi})\,{u}_{i},\qquad\textbf{J}(\boldsymbol{\xi})=\nabla_{\boldsymbol{\xi}}\mathcal{F}(\boldsymbol{\xi})=\sum_{i=1}^{n}\nabla_{\boldsymbol{\xi}}N_{i}(\boldsymbol{\xi})\,\textbf{x}_{i}, (27) where \textbf{J}(\boldsymbol{\xi}) here refers to the Jacobian of the geometric parameterization (not to be confused with the source current density, which is also denoted as J in Eq. 1 , but reduced to the use of J_{z} for 2D magnetostatics, see Eqs. 6 and 8 ). 3.3 Isogeometric finite elements Now, the discretization introduced in Eq. 25 is substituted into the magnetostatic weak form given in Eq. 8 , such that the bilinear and linear form can be written as: \displaystyle a(u^{h},v^{h}) \displaystyle=\int_{\Omega}\nu\,\nabla_{\textbf{x}}v^{h}\cdot\nabla_{\textbf{x}}u^{h}\,\mathrm{d}\Omega=\int_{\hat{\Omega}}\nu\left(\nabla_{\boldsymbol{\xi}}v^{h}\cdot\textbf{J}^{-1}\right)\cdot\left(\nabla_{\boldsymbol{\xi}}u^{h}\cdot\textbf{J}^{-1}\right)\,\det\textbf{J}~\mathrm{d}\hat{\Omega} (28) \displaystyle=\sum_{i=1}^{n}v_{i}\sum_{j=1}^{n}u_{j}\int_{\hat{\Omega}}\nu\left(\nabla_{\boldsymbol{\xi}}N_{i}\cdot\textbf{J}^{-1}\right)\cdot\,\left(\nabla_{\boldsymbol{\xi}}N_{j}\cdot\textbf{J}^{-1}\right)\,\det\textbf{J}~\mathrm{d}\hat{\Omega}, \displaystyle l(v^{h}) \displaystyle=\int_{\Omega}v^{h}\,J_{z}\,\mathrm{d}\Omega+\int_{\Omega}\nu\,\nabla v^{h}\cdot\textbf{B}^{\perp}_{r}\,\mathrm{d}\Omega=\int_{\hat{\Omega}}v^{h}\,J_{z}\,\det\textbf{J}~\mathrm{d}\hat{\Omega}+\int_{\hat{\Omega}}\nu\left(\nabla_{\boldsymbol{\xi}}v^{h}\cdot\textbf{J}^{-1}\right)\cdot\,\textbf{B}^{\perp}_{r}\,\det\textbf{J}~\mathrm{d}\hat{\Omega} (29) \displaystyle=\sum_{i=1}^{n}v_{i}\int_{\hat{\Omega}}\left(N_{i}\,J_{z}+\nu\left(\nabla_{\boldsymbol{\xi}}N_{i}\cdot\textbf{J}^{-1}\right)\cdot\textbf{B}^{\perp}_{r}\right)\,\det\textbf{J}~\mathrm{d}\hat{\Omega}. Here, the integration over the physical domain \Omega and the evaluation of all shape functions and fields is pulled back to the parametric domain \hat{\Omega} , as \Omega=\mathcal{F}(\hat{\Omega}) . Since a(u^{h},v^{h})=l(v^{h}) must hold for all v^{h} , the v_{i} can be chosen arbitrarily, which results in the linear system of equations \textbf{K}\textbf{u}=\textbf{b} , where \textbf{u}=(u_{1},\ldots,u_{n})^{\top}\in\mathbb{R}^{n} is the sought vector of the control points of the scalar magnetic potential and the coefficients of the system matrix K and the RHS vector b are given as: \displaystyle K_{ij} \displaystyle=\int_{\hat{\Omega}}\nu\left(\nabla_{\boldsymbol{\xi}}N_{i}\cdot\textbf{J}^{-1}\right)\cdot\,\left(\nabla_{\boldsymbol{\xi}}N_{j}\cdot\textbf{J}^{-1}\right)\,\det\textbf{J}~\mathrm{d}\hat{\Omega}, (30) \displaystyle b_{i} \displaystyle=\int_{\hat{\Omega}}\left(N_{i}\,J_{z}+\nu\left(\nabla_{\boldsymbol{\xi}}N_{i}\cdot\textbf{J}^{-1}\right)\cdot\textbf{B}^{\perp}_{r}\right)\,\det\textbf{J}~\mathrm{d}\hat{\Omega}. (31) Thanks to the piecewise polynomial definition and limited support of the B-spline shape functions N_{i} , for the numerical evaluation of the integrals arising from the discretized weak form, the parametric domain \hat{\Omega} is partitioned into n_{e} disjoint elements \hat{\Omega}^{e}\subset\hat{\Omega} such that \bigcup_{e=1}^{n_{e}}\hat{\Omega}^{e}=\hat{\Omega} . These elements are defined by the knot spans of the non-repeated knot vectors \{\xi_{1},\dots,\xi_{l+p+1}\}\times\{\eta_{1},\dots,\eta_{m+q+1}\} , for example \hat{\Omega}^{e}=[\xi_{j},\xi_{j+1}]\times[\eta_{k},\eta_{k+1}] . The corresponding elements in the physical domain are given by \Omega^{e}=\mathcal{F}(\hat{\Omega}^{e}) . Analogously to the isoparametric finite element method, a tensor-product Gauss-Legendre quadrature rule with n_{qp}=(p+1)^{2} quadrature points is employed on each element [ 47 , 48 ] . Ultimately, the numerical integration of Eqs. 30 and 31 leads to: \displaystyle K_{ij} \displaystyle\approx\sum_{e=1}^{n_{e}}\sum_{r=1}^{n_{qp}}w_{r}^{e}\,\nu(\boldsymbol{\xi}_{r}^{e})\left(\nabla_{\boldsymbol{\xi}}N_{i}(\boldsymbol{\xi}_{r}^{e})\cdot\textbf{J}^{-1}(\boldsymbol{\xi}_{r}^{e})\right)\cdot\,\left(\nabla_{\boldsymbol{\xi}}N_{j}(\boldsymbol{\xi}_{r}^{e})\cdot\textbf{J}^{-1}(\boldsymbol{\xi}_{r}^{e})\right)\,\det\textbf{J}(\boldsymbol{\xi}_{r}^{e}), (32) \displaystyle b_{i} \displaystyle\approx\sum_{e=1}^{n_{e}}\sum_{r=1}^{n_{qp}}w_{r}^{e}\left(N_{i}(\boldsymbol{\xi}_{r}^{e})\,J_{z}(\boldsymbol{\xi}_{r}^{e})+\nu\left(\nabla_{\boldsymbol{\xi}}N_{i}(\boldsymbol{\xi}_{r}^{e})\cdot\textbf{J}^{-1}(\boldsymbol{\xi}_{r}^{e})\right)\cdot\textbf{B}^{\perp}_{r}(\boldsymbol{\xi}_{r}^{e})\right)\det\textbf{J}(\boldsymbol{\xi}_{r}^{e}). (33) where w_{r}^{e} are the weights and \boldsymbol{\xi}_{r}^{e} are the points of a standard, n_{qp} -point Gauss-Legendre quadrature rule on the parameter element \hat{\Omega}^{e} . Note that in practice, the element-wise contributions to the coefficients K_{ij} and b_{i} are only evaluated on elements within the support of N_{i} and N_{j} , as otherwise they are zero anyway. Importantly, the Dirichlet boundary conditions contained in the definition of the trial and test functions spaces, see Eq. 9 , still must be enforced on the linear system \textbf{K}\textbf{u}=\textbf{b} . In conformal IGA and FEM, this is typically done by elimination, resulting in a smaller, positive definite system to be solved. Similarly, also anti-periodic Dirichlet boundary conditions can be applied. If a weak enforcement of Dirichlet boundary conditions or of multi-domain coupling conditions using Nitsche’s method is necessary, see Sections 2.3 and 2.4 , the additional terms appearing in the formulations of the bilinear forms and linear forms must be discretized accordingly, which is not discussed in detail here. 4 Immersed boundary conformal methods In conformal isogeometric finite element discretizations, the physical domain \Omega is represented by a B-spline surface through the mapping defined in Eq. 24 . However, for such a mapping \mathcal{F}:\hat{\Omega}\to\Omega to exist, \Omega must be topologically equivalent to a square. For most engineering applications with complex geometries and multi-material domains, this requirement is not satisfied. Within the framework of isogeometric analysis, decomposing the domain into a multi-patch geometry offers an alternative approach [ 73 ] . However, as noted previously, this process is generally cumbersome and requires significant manual effort, especially when conformity of the patches is to be maintained. In this work, we adopt a hierarchy of three immersed isogeometric concepts to overcome this limitation: 1. Fully immersed , see Section 4.1 and [ 30 ] : Spline-based boundary representations (B-rep) of the material subdomains of the physical domain are constructed and subsequently immersed into a single background patch, the extended domain, over which the problem solution is discretized. A boundary-conformal quadrature strategy is used to accurately resolve the integration over the different regions that are trimmed from the background patch through the boundary curves of the subdomains. 2. Union with non-conformal patches (“Union NC”), see Section 4.2 and [ 4 , 50 ] : To minimize the preprocessing effort, as far as desired and possible, each topologically square material subdomain of the physical domain is represented by an individual patch, which all overlay the extended domain. Thus, the overall domain consists of the union of the non-conformal patches with the trimmed regions on background patch. Nitsche’s method is used to couple non-conformal patches of the subdomains and the boundary-conformal quadrature strategy is used on the trimmed background patch. 3. Union with conformal layers (“Union CL”), see Section 4.3 and [ 39 , 86 ] : In addition to the union of non-conformal patches , selected interfaces between individual patches of the subdomains and the background patch are wrapped with a conformal, overlaying patch that smoothens the transition between adjacent regions and is further trimmed from the background patch. In the following, these three approaches are presented in more detail. Generally, we assume that the overall problem domain \Omega is composed of several subdomains \Omega_{i} such that \Omega=\bigcup_{i}\Omega_{i} and \Omega_{i}\cap\Omega_{j}=\emptyset . For the parameterization, the background patch \Omega^{\square} is defined such that it contains the whole domain, \Omega\subseteq\Omega^{\square} . Each subdomain \Omega_{i} is parameterized either by immersion into the background patch \Omega^{\square} and trimming of the parameter domain \hat{\Omega}^{\square} , where the “trimmed region” corresponding to the subdomain \Omega_{i} is then denoted as \hat{\Omega}^{\square}_{i} , or by an individual patch with parameter domain \hat{\Omega}_{i}^{p} . The subdomain itself is then either obtained by the mapping of the background patch, \Omega_{i}=\mathcal{F}^{\square}(\hat{\Omega}_{i}^{\square}) or by the mapping of its individual patch, \Omega_{i}=\mathcal{F}^{p}_{i}(\hat{\Omega}_{i}^{p}) , respectively. Without loss of generality, in the following we assume a physical domain consisting of two disjunct material subdomains, \Omega=\Omega_{1}\cup\Omega_{2} . 4.1 Fully immersed First, we adopt the immersed IGA concept with boundary conformal quadrature, see [ 30 ] . We immerse the physical domain \Omega into a background domain \mathcal{F}^{\square}:\hat{\Omega}^{\square}\to\Omega^{\square} such that \Omega\subseteq\Omega^{\square} . Each subdomain \Omega_{1} and \Omega_{2} is then represented in the parameter domain of the background patch by a region \hat{\Omega}^{\square}_{1} and \hat{\Omega}^{\square}_{2} . Each region is identified in the parametric domain by the closed loop representing its B-rep, \partial\hat{\Omega}_{i}=\bigcup_{k}\hat{\gamma}_{i}^{k} , see [ 3 ] , as illustrated in Fig. 2 . Here, each curve \hat{\gamma}_{i}^{k}={\mathcal{F}^{\square}}^{-1}({\gamma}_{i}^{k}) represents the pull-backward of the boundary curves of the physical subdomain \partial\Omega_{i} . While this transformation may appear cumbersome, in practice it can be trivially realized by choosing \mathcal{F} as the identity, i.e., \hat{\Omega}^{\square} is identical to \Omega^{\square} , or as an affine transformation or scaling, which simply translates to an affine transformation or scaling of the control points of \gamma_{i}^{k} . For each region constructed through trimming the background patch \hat{\Omega}^{\square} with the trimming loop \partial\hat{\Omega}_{i} , we accordingly restrict our mapping into that active region, hence the associated spline space over that region is defined as: \mathcal{N}|_{\Omega_{i}^{\square}}=\mathrm{span}\Big\{N_{j}\circ\mathcal{F^{\square}}^{-1}(\textbf{x}):j\in\mathcal{I},\,\mathrm{supp}(N_{j})\cap\mathcal{F^{\square}}^{-1}\big(\Omega_{i}^{\square}\big)\neq\emptyset\Big\}, (34) where \mathrm{supp}(N_{j})\subseteq\hat{\Omega}^{\square} is the support portion of the shape function N_{j}(\boldsymbol{\xi}) . This basis function can have high continuity across material interfaces, which can cause cross-talk between different subdomains, as discontinuities cannot be correctly represented. This will be further discussed and evaluated numerically in Section 5 . {\Omega}^{\square} \Omega_{1} \Omega_{2} x y \xi \eta \hat{\Omega}_{1}^{\square} \hat{\Omega}^{\square} \hat{\gamma}^{1}_{1} \hat{\gamma}^{2}_{1} \hat{\gamma}^{3}_{1} \partial\hat{\Omega}_{1} \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \mathcal{F}^{\square} \xi \eta \hat{\gamma}^{1}_{2} \hat{\gamma}^{2}_{2} \hat{\gamma}^{3}_{2} \hat{\gamma}^{4}_{2} \partial\hat{\Omega}_{1} \hat{\Omega}_{2}^{\square} \hat{\Omega}^{\square} \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \mathcal{F}^{\square} Figure 2 : Illustration of the fully immersed concept. The physical domain \Omega=\Omega_{1}\cup\Omega_{2} is immersed into an extended domain, the background patch \Omega^{\square} , here consisting of 4\times 4 elements in its parameter domain \hat{\Omega}^{\square} . B-reps of the subdomains \Omega_{i} consisting of loops of boundary curves \partial\Omega_{i}=\bigcup_{k}\gamma^{k}_{i} are used to determine the immersed trimmed regions \hat{\Omega}_{i}^{\square} . To determine the boundary-conformal quadrature points, the trimmed elements of each region \hat{\Omega}_{i}^{\square} are re-parameterized To achieve accurate numerical integration over the physical domain \Omega , we perform the integration over each region \hat{\Omega}^{\square}_{i} through the following procedure. Based on the representation of \partial\hat{\Omega}_{i} , the intersections between the B-rep and the vertical and horizontal knot lines of the parametric domain, i.e., the elements, are computed, see Fig. 2 left and right. This operation, referred to as slicing , must be performed with sufficiently high precision, since subsequent operations, including the accuracy of the ensuing PDE analysis, are governed by this precision 1 1 1 For computing those intersections we use the irit library [ 31 ] that allows to compute them up to the desired precision. Note that most CAD kernels limit the maximum precision achievable in such operations. E.g., the open source kernel Open CASCADE [ 69 ] limits the maximum precision of such operations to 10^{-9} , what would preclude the level of accuracy reached in the convergence analyses included in Section 5 . . As a result of the slicing procedure, the elements of the background patch, \hat{\Omega}^{\square}=\bigcup_{e}\hat{\Omega}^{e} , are categorized into three distinct groups with respect to each region, as illustrated by different colors in Fig. 2 , e.g. with respect to the region \hat{\Omega}^{\square}_{1} : active where |\hat{\Omega}^{e}\cap\hat{\Omega}^{\square}_{1}|=|\hat{\Omega}^{e}| , trimmed are those with 0<|\hat{\Omega}^{e}\cap\hat{\Omega}^{\square}_{1}|<|\hat{\Omega}^{e}| with an active portion \hat{\Omega}^{e}\cap\hat{\Omega}^{\square}_{1} , and non-active elements with |\hat{\Omega}^{e}\cap\hat{\Omega}^{\square}_{1}|=0 , where |\bullet| represents the area. The same procedure is subsequently applied to the subdomain \Omega_{2} , see Fig. 2 . Its boundary \partial\Omega_{2} is represented by a spline-based B-rep, and the slicing operation is performed accordingly. This results in a corresponding classification of elements into active , trimmed , and non-active categories with respect to \hat{\Omega}^{\square}_{2} . On active non-trimmed elements, the standard Gauss-Legendre quadrature rule is used to integrate the discretized weak form, c.f. Eqs. 32 and 33 . For the active portions of the trimmed elements, that are represented again through B-reps, we adopt the boundary conformal quadrature method [ 86 ] . The technique depends on a re-parameterization of the trimmed elements and consists of three stages: 1. Approximation. For every trimmed element, the B-rep segment of the boundary of the physical domain is approximated by a Bézier curve with a polynomial degree p of the same order as the spline discretization in Eq. 24 . This allows to keep consistency under control and ensure optimal convergence for elliptic problems, as discussed in [ 3 ] .. 2. Decomposition. Every trimmed element is partitioned into active and non-active regions, distinguished by the varying colors in Fig. 2 . When an integration cell does not conform to a standard topological triangle or quadrilateral, such as the two pentagonal active regions along the diagonal in Fig. 2 (right), it is further subdivided along the trimming curve into triangular or quadrilateral sub-cells. Comprehensive details of this procedure are available in [ 86 ] . 3. Re-parametrization. In the final step, the integration cells are re-parameterized as B-spline surfaces of degree p and quadrature points are then distributed within these cells according to a standard Gauss-Legendre rule with n_{qp}=(p+1)^{2} points, see Fig. 2 . In this way, the boundaries \partial\Omega_{1},\partial\Omega_{2} and the integration over \Omega_{1},\Omega_{2} are resolved numerically exact up to the approximation errors that stems from the re-parameterization of the trimmed cell boundaries and the quadrature order employed. It is important to note that the decomposition and re-parameterization of trimmed elements are performed solely for the purposes of quadrature and do not alter the discretization or the number of degrees of freedom. When employing the fully immersed technique, imposing Dirichlet boundary conditions u=g on \Gamma_{\text{D}}\subset\partial\Omega , can be tricky if \partial\Omega does not coincide with \partial\Omega^{\square} . In such case, Dirichlet boundary conditions cannot be imposed strongly. In our work, we impose Dirichlet boundary conditions via Nitsche’s method [ 68 ] , see Section 2.3 . \xi \eta \hat{\Omega}_{1}^{\square} \hat{\Omega}^{\square} \hat{\gamma}^{1}_{1} \hat{\gamma}^{2}_{1} \hat{\gamma}^{3}_{1} \partial\hat{\Omega}_{1} \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \mathcal{F}^{\square} x y \Omega_{1} \Omega_{2} \Gamma_{12} \xi \eta \hat{\Omega}_{2}^{p} \mathcal{F}_{2}^{p} Figure 3 : Illustration of the union with non-conformal patches concept. As in the fully immersed method, the subdomain \Omega_{1} is immersed into the background patch \Omega^{\square} . However, here \Omega_{2} is parameterized by an individual patch with the mapping \mathcal{F}_{2}^{p} . Thus, continuity at the interface \Gamma_{12}=\partial\Omega_{1}\cap\partial\Omega_{2} is weakly enforced using Nitsche’s method 4.2 Union with non-conformal patches To improve the accuracy of the discretization at interfaces between subdomains, but nonetheless avoid the effort of generating a conformal multi-patch representation with only topologically square patches, we adopt the concept of overlapping, non-conformal patches, see also [ 4 , 86 , 87 , 59 , 60 ] . In Fig. 3 , we illustrate this method again for the physical domain consisting of two material subdomains, \Omega=\Omega_{1}\cup\Omega_{2} . As in the fully immersed method, the (not topologically square) subdomain \Omega_{1} is immersed into the background patch \Omega^{\square} as a trimmed region \hat{\Omega}_{1}^{\square} . The trimming operation and the mapping back to the physical domain as \Omega_{1}=\mathcal{F}^{\square}(\hat{\Omega}^{\square}_{1}) are conducted in accordance with Section 4.1 . However, now the topologically square subdomain \Omega_{2} is parameterized by its own individual patch with the spline mapping \mathcal{F}_{2}^{p}:\hat{\Omega}_{2}^{p}\rightarrow\Omega_{2} . Thus, the active part of the background patch \Omega^{\square} corresponding to \Omega_{1} is combined with the overlaying patch of \Omega_{2} to construct the overall computational domain as \Omega=\Omega_{1}\cup\Omega_{2} , see Fig. 3 . The fundamental concept of the union with non-conformal patches consists of weakly coupling the active parts of the background patch and the overlapping patches across their interfaces. Here, this means the continuity conditions of Eq. 17 have to be enforced on the interface \Gamma_{12}=\partial\Omega_{1}\cap\partial\Omega_{2} . As described in Section 2.4 , this is realized by means of Nitsche’s method [ 68 ] . Importantly, along the interface \Gamma_{12} , the discretization of the overlaying patch \Omega_{2} is conformal with the interface, whereas \Omega_{1} is a trimmed region of the background patch \Omega^{\square} . Thus, the weighting introduced in Nitsche’s method is always put on the untrimmed, overlaying patches as master domains, i.e., here \Omega_{2} , see Eq. 21 . A comprehensive discussion on the construction of interface quadrature schemes used for the evaluation of interface integrals can be found in [ 86 , 4 ] . Note further that while the interface conditions between the background patch and overlaying patches must be enforced weakly, the union with non-conformal patches provides the opportunity to strongly enforce Dirichlet boundary conditions on the outer boundaries of the overlaying patches, e.g., here on \Gamma_{\text{D}}\cap\partial\Omega_{2} . 4.3 Union with conformal layers In the union with non-conformal patches , spurious effects may still occur at interfaces with strong material discontinuities, since the discretization of immersed subdomains are no conformal with the interface. To further improve the accuracy in such cases, we adopt the union with conformal layers approach, which is called “immersed boundary conformal method” in [ 86 , 87 , 39 ] . As in the union with non-conformal patches method, the subdomain \Omega_{2} is parameterized by an individual patch with parameter domain \hat{\Omega}_{2}^{p} and mapping \mathcal{F}_{2}^{p} . However, as illustrated in Fig. 4 , the subdomain \Omega_{1} is now partitioned into two parts: \Omega_{1}=\bar{\Omega}_{1}\cup\Omega_{L} . Along the interface with \Omega_{2} , the new subdomain \Omega_{L} forms a geometrically conformal layer, which is generated by extruding \Gamma_{12} into \Omega_{1} , yielding a new interface curve \Gamma_{1L} . This subdomain is also parameterized by an individual patch with the mapping \mathcal{F}_{L}^{p}:\hat{\Omega}_{L}^{p}\rightarrow\Omega_{L} and maintains the same material parameters as \Omega_{1} . The cropped subdomain \bar{\Omega}_{1}=\Omega_{1}\backslash\Omega_{L} remains immersed into the background domain as region \hat{\bar{\Omega}}_{1}^{\square} . It is defined by a modified set of boundary curves \partial\hat{\bar{\Omega}}_{1}=\bigcup_{k}\hat{\bar{\gamma}}^{k}_{1} , which is determined from the original boundary \partial\Omega_{1} through the extrusion operation that establishes \Omega_{L} . Here, continuity at the two interfaces \Gamma_{1L}=\partial\bar{\Omega}_{1}\cap\partial\Omega_{L} and \Gamma_{L2}=\partial\Omega_{L}\cap\partial\Omega_{2} is again weakly enforced using Nitsche’s method, as described in Section 2.4 . For \Gamma_{1L} , \Omega_{L} must be the master domain, as it is discretized conformal with the interface, whereas \bar{\Omega}_{1} is trimmed. For \Gamma_{L2} , either patch could be the master, as both \Omega_{L} and \Omega_{2} are geometrically conformal. We emphasize, however, that conformity is understood purely in a geometric sense: the boundary layer \Omega_{L} inherits the geometric shape of the interface \Gamma_{12} , but no constraint is imposed on the discrete function spaces. In particular, the discretization of \Omega_{L} is not required to be conforming with that of \Omega_{2} , i.e., the degrees and number of elements along the interface direction may vary in each patch. Thus, a weak enforcement of the interface conditions is also applied on \Gamma_{L2} . \xi \eta \hat{\Omega}^{\square} \hat{\bar{\gamma}}^{1}_{1} \hat{\bar{\gamma}}^{2}_{1} \hat{\bar{\gamma}}^{3}_{1} \partial\hat{\bar{\Omega}}_{1}^{\square} \hat{\bar{\Omega}}_{1}^{\square} \mathcal{F}^{\square} x y \Gamma_{L2}=\Gamma_{12} \Gamma_{1L} \Omega_{L} \bar{\Omega}_{1} \Omega_{2} \xi \eta \hat{\Omega}_{2}^{p} \mathcal{F}_{2}^{p} \xi \eta \hat{\Omega}_{L}^{p} \mathcal{F}_{L}^{p} Figure 4 : Illustration of the union with conformal layers concept. As in the union with non-conformal patches method, the subdomain \Omega_{2} is parameterized by an individual patch with the mapping \mathcal{F}_{2}^{p} . Beyond, here the subdomain \Omega_{1} is partitioned into two parts: Along the interface with \Omega_{2} , the new subdomain \Omega_{L} forms a geometrically conformal layer, which is offset from the boundary \Gamma_{12} and also parameterized by an individual patch with the mapping \mathcal{F}_{L}^{p} . The cropped subdomain \bar{\Omega}_{1}=\Omega_{1}\backslash\Omega_{L} remains immersed in the background domain as region \hat{\bar{\Omega}}_{1}^{\square} , which is defined by a modified set of boundary curves \partial\hat{\bar{\Omega}}_{1}=\bigcup_{k}\hat{\bar{\gamma}}^{k}_{1} . Continuity at the two interfaces \Gamma_{1L}=\partial\bar{\Omega}_{1}\cap\partial\Omega_{L} and \Gamma_{L2}=\partial\Omega_{L}\cap\partial\Omega_{2} is again weakly enforced using Nitsche’s method 4.4 Preconditioning and stability The application of immersed methods in FEM/IGA is often associated with stability issues and ill-conditioning [ 28 ] . Although these issues are closely related, their treatment generally requires different techniques. Both issues are directly related to the small cut element problem, where elements are trimmed, leaving only a tiny active part. In the context of stability, this becomes evident when Dirichlet boundary conditions need to be imposed on a boundary that trims the background domain, resulting in tiny active parts. In such configurations, the weak imposition of Dirichlet boundary conditions via, e.g., Nitsche’s method leads to an ill-posed numerical formulation, requiring a penalty parameter that tends to infinity to maintain coercivity of the formulation. In the context of immersed and trimmed IGA, several unstable configurations were investigated, including cases where trimming produces high aspect ratio rectangular trimmed elements [ 20 ] . In such cases, instabilities were observed to be associated with the flux term. In the framework of unfitted FEM, similar stability issues have been reported, and the reader is referred to [ 27 ] . Additional discussions on stability aspects in immersed and trimmed spline methods can be found in [ 45 , 32 , 51 , 64 , 63 ] . However, in the present work, no additional stabilization technique is required in the union methods, as the weighted flux term in Nitsche’s method is evaluated exclusively from the untrimmed domain, see Eq. 21 in Section 2.4 , as discussed in [ 4 ] . Furthermore, ill-conditioning in immersed methods arises due to the small cut element problem, where some basis functions lose a significant portion of their support, leading to near-linear dependencies in the discrete system. Detailed discussions on this phenomenon can be found in [ 55 , 61 , 26 , 25 ] . In the present work, diagonal scaling in the form of Jacobi preconditioning is applied to improve the conditioning of the system matrix. Furthermore, a sparse direct solver is used in MATLAB , and no conditioning issues are observed in the numerical investigation. 5 Numerical results In the following, we apply immersed IGA with the three aforementioned concepts to two-dimensional magnetostatic problems to demonstrate their efficiency and accuracy. The current work is implemented within the framework of the open-source MATLAB code geoPDEs [ 84 , 85 ] and an in-house library based on irit [ 31 ] and Open CASCADE [ 69 ] for obtaining the boundary conformal quadrature points. Throughout this manuscript, the “ k -version” of IGA is adopted as the default refinement strategy, i.e., k -refinement is used by increasing the smoothness at internal knots along with the degree [ 48 ] . Any deviation from this approach, such as the use of the FEM p -refinement, will be explicitly stated where applicable. In the following, we evaluate the accuracy of the obtained numerical solutions u^{h} against reference solutions u^{ref} , which could be either analytical or highly-refined multipatch IGA solutions, using the L^{2} -norm and the H^{1}_{s} -seminorm of the error, defined as follows: \displaystyle\left\|u^{h}-u^{ref}\right\|_{L^{2}}^{2} \displaystyle=\int_{\Omega}\left\|u^{h}-u^{ref}\right\|_{2}^{2}\,\mathrm{d}\Omega, (35) \displaystyle\left\|u^{h}-u^{ref}\right\|_{H_{s}^{1}}^{2} \displaystyle=\int_{\Omega}\left\|\nabla u^{h}-\nabla u^{ref}\right\|_{2}^{2}\,\mathrm{d}\Omega. 5.1 Coaxial cable First, we consider a coaxial cable as benchmark problem, see Fig. 5(a) and [ 90 , 38 , 46 ] for similar studies. The geometry consists of three concentric cylindrical regions: an inner conducting core (gold), a surrounding insulating layer (green), and an outer conductor (orchid). Due to the double symmetry of the problem, we only solve quarter of the cable geometry. The core has radius r_{1} , the insulator occupies the annular region r_{1}1 are not optimal. This can be attributed to the different inter-patch continuity properties. In the union formulation, only C^{0} continuity is enforced weakly across the patch interfaces. By contrast, in the fully immersed approach, both the solution and its gradients (i.e., the flux density) are represented by basis functions exhibiting C^{p-1} continuity across the regions’ interfaces, as we are solving on a single patch. This explains the similarity in accuracy for the case p=1 , as the gradients are represented by non-smooth basis functions. This can be seen clearly in Figs. 6(c) and 6(d) , where the errors are nearly identical in terms of the H^{1}_{s} -seminorm and remain very close in the L^{2} -norm for the case p=1 . Overall, the union approach provides higher accuracy for higher polynomial orders while maintaining a comparable number of degrees of freedom. (a) Contours of scalar potential A_{z} (from union ) (b) Contours of magnitude of flux density B_{\theta} (from union ) 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0.0 1.0 2.0 3.0 \cdot 10^{-4} r A_{z} Exact Fully immersed Union NC (c) Comparison of scalar potential A_{z} along x=y 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0.0 2.0 4.0 6.0 \cdot 10^{-4} r B_{\theta} Exact Fully immersed Union NC 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0.0 2.0 4.0 6.0 \cdot 10^{-4} r B_{\theta} Exact Fully immersed Union NC 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0.0 2.0 4.0 6.0 \cdot 10^{-4} r B_{\theta} Exact Fully immersed Union NC (d) Comparison of magnitude of flux density B_{\theta} along x=y Figure 7 : Comparison of the scalar potential A_{z} and the magnitude of the flux density B_{\theta} between the analytical solution and the numerical results obtained using the fully immersed and union with non-conformal patches methods with p=2 and 32\times 32 elements for each patch Additionally, Figs. 7(a) and 7(b) shows the contours of the scalar potential A_{z} and the magnitude of the flux density B_{\theta} for a discretization with degree p=2 and 32\times 32 elements for each patch for the union method. To further assess the performance, we compare the exact solution along the line y=x with the corresponding numerical results obtained using both methods. Figure 7 demonstrates excellent agreement between the analytical and numerical solutions already for this coarse, low-degree discretization for the fully immersed and union of non-conformal patches methods. However, as the insets show, the kinks of B_{\theta} at the interfaces are less well resolved by the fully immersed approach, which may explain the lack of higher-order convergence. 5.2 Horseshoe magnet To further assess the performance of the three proposed methods on a more complex problem, we consider a straight horseshoe magnet. The problem consists of two soft iron rods, one of which is connected to two permanent magnets (PMs) having opposite remanence directions, as illustrated in Fig. 8 . The computational domain has a width of W=0.15 mm and a height of H=0.13 mm. Each soft iron rod has a width of W_{\text{iron}}=0.02 mm and a height of H_{\text{iron}}=0.09 mm. The permanent magnets each have dimensions W_{\text{PM}}=0.05 mm and H_{\text{PM}}=0.02 mm. The magnitude of the remanence of each magnet is prescribed as B_{r}=1.4 . The relative permeability of the permanent magnets is \mu_{r}^{\text{PM}}=1.05 , such that their permeability is given by \mu_{\text{PM}}=\mu_{r}^{\text{PM}}\mu_{0} , where \mu_{0} denotes the vacuum permeability. The soft iron rods are modeled with a relative permeability of \mu_{r}^{\text{iron}}=4000 , while the surrounding air region is assigned the vacuum permeability, i.e., \mu^{\text{air}}=\mu_{0} . A Dirichlet boundary condition is defined on the outer boundary of the computational domain with A_{z}=0 . Here, we compare all three immersed IGA methods, see Fig. 9 for illustrations of the meshes. To have a reference solution u^{ref} , we solve the horseshoe magnet problem with conformal multi-patch IGA using 30 conformal patches with each patch being discretized with 20\times 20 elements and polynomial degree p=5 , with a total of 17,545 DOFs, see Fig. 9(a) . To compare the numerical solution of the fully immersed approach with the conformal multi-patch solution, we evaluate the error norms, see Eq. 35 , as well as the magnitude of the flux density over the horizontal line y=0.1 , which is indicated in blue in Fig. 8 . W H W_{\text{iron}} H_{\text{iron}} H_{\text{PM}} W_{\text{PM}} \textbf{B}_{r} \textbf{B}_{r} y=0.1 A_{z}=0 Figure 8 : Schematic drawing of the horseshoe magnet problem. The red rectangular regions denote permanent magnets with different magnetization directions \textbf{B}_{r} . The gray rectangular regions correspond to soft iron rods. The surrounding blue domain represents the air region (a) Standard multi-patch IGA : The domain is represented by 30 conformal patches (b) Fully immersed : The subdomains of the magnets and iron rods are immersed in the air background grid (c) Union NC : Each magnet and iron component is defined by its own patch, and then union with the remaining active part of the air patch (d) Union CL : Two boundary layers are wrapping the magnet and iron rod patches Figure 9 : Schematic drawings for the discretizations of the horseshoe magnet problem with standard multi-patch IGA and the three proposed immersed IGA methods First, we start with the fully immersed approach, where trimming loops are defined for each soft iron rod and permanent magnet component. We follow the same procedure as in Section 4.1 , where every active and trimmed element corresponding to a specific region is classified. The system matrix and RHS vector, see Eqs. 32 and 33 , are then obtained by integrating over the corresponding elements for all the different regions/components (magnets, iron rods, air). The results shown in Fig. 10 demonstrate that, for both k - and p -refinement strategies, with a background grid of 128\times 128 knot spans, the magnetic flux density magnitude is largely consistent with the reference solution within each material subdomain and sufficiently far from the material interfaces. However, for the cases employing k -refinement with highly smooth basis functions with C^{p-1} -continuity across knot spans, a significant discrepancy compared to the reference solution arises in the vicinity of the material interfaces. In particular, the lowest polynomial order p=1 exhibits the smallest deviation from the reference solution relative to the higher orders p=\{2,5\} . This behavior can be explained by the low continuity of the basis functions at p=1 , where the gradients are discontinuous across element boundaries. Since the magnetic flux density is obtained as the spatial derivative of the magnetic potential, this discontinuity enables a more accurate representation of the magnetic flux density at material interfaces. In contrast, higher polynomial orders combined with high inter-element continuity enforce smoothness of both the solution and its derivatives, i.e., also the magnetic flux density, across knot spans. As a consequence, the magnetic flux density is approximated by overly smooth basis functions across interfaces where discontinuities in material properties occur. This leads to spurious oscillations characteristic of Gibbs-type phenomena, as observed in Fig. 10 . These spurious oscillations can be mitigated by employing p -refinement with C^{0} -continuity, where the continuity across knot spans is reduced to C^{0} . The lower inter-element continuity allows for a more flexible representation of gradient variations at material interfaces, thereby reducing non-physical oscillatory behavior. Nevertheless, if a material interface is located within the interior of an element rather than coinciding with element boundaries, spurious oscillations may still arise, as observed in Fig. 10 in the magnifiers at x=0.02 and x=0.13 . In such cases, the approximation space remains smooth within the element, preventing an accurate representation of the discontinuity in the material coefficients and consequently leading to localized oscillatory artifacts. Thus, it is evident that the fully immersed strategy is not suitable for accurately handling multiple materials within the same patch. 0 0.02 0.04 0.09 0.11 0.13 0.15 0 0.5 1 1.5 Air Iron Magnet Air Iron Air x \|\mathbf{B}\| [T] Multi-patch IGA k/p -ref. ( p=1 ) k -ref. ( p=2 ) k -ref. ( p=5 ) p -ref. ( p=5 ) 0 0.02 0.04 0.09 0.11 0.13 0.15 0 0.5 1 1.5 Air Iron Magnet Air Iron Air x \|\mathbf{B}\| [T] Multi-patch IGA k/p -ref. ( p=1 ) k -ref. ( p=2 ) k -ref. ( p=5 ) p -ref. ( p=5 ) 0 0.02 0.04 0.09 0.11 0.13 0.15 0 0.5 1 1.5 Air Iron Magnet Air Iron Air x \|\mathbf{B}\| [T] Multi-patch IGA k/p -ref. ( p=1 ) k -ref. ( p=2 ) k -ref. ( p=5 ) p -ref. ( p=5 ) 0 0.02 0.04 0.09 0.11 0.13 0.15 0 0.5 1 1.5 Air Iron Magnet Air Iron Air x \|\mathbf{B}\| [T] Multi-patch IGA k/p -ref. ( p=1 ) k -ref. ( p=2 ) k -ref. ( p=5 ) p -ref. ( p=5 ) 0 0.02 0.04 0.09 0.11 0.13 0.15 0 0.5 1 1.5 Air Iron Magnet Air Iron Air x \|\mathbf{B}\| [T] Multi-patch IGA k/p -ref. ( p=1 ) k -ref. ( p=2 ) k -ref. ( p=5 ) p -ref. ( p=5 ) Figure 10 : Evaluation of the magnetic flux density magnitude along the line y=0.1 for different polynomial orders p={1,2,5} for both k - and p -refinement strategies with a background grid of 128\times 128 knot spans for the fully immersed method 0 0.02 0.04 0.09 0.11 0.13 0.15 0 0.5 1 1.5 Air Iron Magnet Air Iron Air x \|\mathbf{B}\| [T] Multi-patch IGA Union NC ( p=5 ) Union CL ( p=5 ) 0 0.02 0.04 0.09 0.11 0.13 0.15 0 0.5 1 1.5 Air Iron Magnet Air Iron Air x \|\mathbf{B}\| [T] Multi-patch IGA Union NC ( p=5 ) Union CL ( p=5 ) 0 0.02 0.04 0.09 0.11 0.13 0.15 0 0.5 1 1.5 Air Iron Magnet Air Iron Air x \|\mathbf{B}\| [T] Multi-patch IGA Union NC ( p=5 ) Union CL ( p=5 ) 0 0.02 0.04 0.09 0.11 0.13 0.15 0 0.5 1 1.5 Air Iron Magnet Air Iron Air x \|\mathbf{B}\| [T] Multi-patch IGA Union NC ( p=5 ) Union CL ( p=5 ) 0 0.02 0.04 0.09 0.11 0.13 0.15 0 0.5 1 1.5 Air Iron Magnet Air Iron Air x \|\mathbf{B}\| [T] Multi-patch IGA Union NC ( p=5 ) Union CL ( p=5 ) Figure 11 : Evaluation of the magnetic flux density magnitude along the line y=0.1 for polynomial order p=5 for the union with non-conformal patches approach and the union with conformal layers method with two conformal layers, both with element size h=0.01 To mitigate the fictitious oscillations over the material interfaces, we employ the union with non-conformal patches approach and the union with conformal layers approach. In the former approach, we couple four non-conformal patches alongside the trimmed background patch, following the procedures in Section 4.2 , as illustrated in Fig. 9(c) . For the latter method, the non-conformal patches are further enclosed with two conformal layers, as introduced in Section 4.3 and illustrated in Fig. 9(d) . The results in Fig. 11 show a comparison of the evaluation of the magnetic flux density over the line y=0.1 for both methods with the reference solution. The union NC numerical solution is evaluated with a polynomial degree of p=5 and each patch is discretized with uniform element size h=0.01 , resulting in a total number of 13,288 DOFs. For the union CL solution, we use the same elements size and polynomial degree, resulting in a slightly higher total number of 16,638 DOFs. Here, it can clearly be observed that both methods align perfectly with the multi-patch IGA evaluation. It is evident that both methods mitigate the fictitious oscillations over the interfaces at a high polynomial degree, even with a smaller number of DOFs compared with the reference solution, which has 17,545 degrees of freedom. 10^{-2} 10^{-1} 10^{-4} 10^{-3} 10^{-2} \mathcal{O}(h^{-1}) Element size h H^{1}_{s} -seminorm error (a) H^{1}_{s} -seminorm error over h 10^{-2} 10^{-1} 10^{-7} 10^{-6} 10^{-5} 10^{-4} \mathcal{O}(h^{-4/3}) Element size h L^{2} -norm error Union NC ( p=2 ) Union NC ( p=4 ) Union NC ( p=6 ) Union CL ( p=2 ) Union CL ( p=4 ) Union CL ( p=6 ) (b) L^{2} -norm error over h Figure 12 : Comparison of convergence behaviors of the union with non-conformal patches and the union with conformal layers methods for the horseshoe magnet problem To further evaluate the performance of both approaches, we perform an h -ref analysis study for both methods for different polynomial orders p=\left\{2,4,6\right\} . The stabilization parameter is set to \beta\nu_{max}p/h , where \beta=10^{4} , \nu_{\max} denotes the maximum reluctivity (corresponding to air in the present configuration), p is the polynomial order, and h corresponds to the element size, as every patch is discretized with uniform element size h . The L^{2} -norm and H^{1}_{s} -seminorm error measures as defined in Eq. 35 are considered in comparison to the conformal multi-patch IGA reference solution, as the horseshoe magnet problem has no exact solution. For the calculations of the error norms, a (p+10)\times(p+10) Gauss-Legendre quadrature rule is used within each element. The results shown in Fig. 12 indicate that, for the union NC method, mesh refinement through knot insertion improves accuracy in both the L^{2} -norm and the H_{s}^{1} -seminorm errors. In contrast, increasing the polynomial order does not lead to a noticeable improvement in accuracy for this approach. For the union CL method, however, the error decreases with increasing polynomial order, indicating a more effective exploitation of higher-order basis functions. Nevertheless, neither method achieves the optimal theoretical convergence rate. This behavior can be attributed to geometric discontinuities at the rectangles’ corners, which reduce the regularity of the solution. Consequently, the convergence rate is limited by the reduced solution regularity rather than by the order of the basis functions. (a) A_{z} for reference multi-patch IGA (b) \|\textbf{B}\| for reference multi-patch IGA (c) A_{z} for union with non-conformal patches ( h=0.01 ) (d) \|\textbf{B}\| for union with non-conformal patches ( h=0.01 ) (e) A_{z} for union with conformal layers ( h=0.01 ) (f) \|\textbf{B}\| for union with conformal layers ( h=0.01 ) Figure 13 : Contours of scalar potential (left) and magnetic flux density (right) for horseshoe magnet problem Finally, Fig. 13 shows the contours of the scalar potential field A_{z} and the magnitude of the magnetic flux density \|\textbf{B}\| for the conformal multi-patch IGA reference solution, as well as the union methods. The union CL demonstrate an improved capability to capture singular field behavior compared to the union NC method. In particular, the singularities occurring at the corners of the left boundary of the right iron rod are clearly resolved in Figs. 13(b) and 13(f) . In contrast, these localized singular features are not adequately captured by the union NC method, as observed in Fig. 13(d) . 5.3 Permanent magnet assembly for a magnetocaloric cooling device As a final benchmark, we apply the union methods to an industry-related problem: the simulation of a permanent magnet assembly of a magnetocaloric cooling device. Magnetocaloric systems can adopt different design configurations; in this study, we consider a co-rotary configuration consisting of an inner rotor and an outer rotor separated by an air gap (see Fig. 14 ). The air gap typically hosts the active magnetic regenerator units, where heat exchange occurs between the working fluid (e.g., water) and the magnetocaloric material [ 53 ] . In the present work, however, the air gap is assumed to contain only air [ 89 ] . Consequently, assessing the cooling performance of such a device requires an accurate evaluation of the magnetic field along a fixed radius within the air gap [ 15 , 89 ] . In this study, the analysis is limited to the accurate evaluation of the magnetic field distribution, whereas a subsequent thermodynamic performance analysis lies beyond the scope. In the following, we briefly describe the main geometric dimensions of the design. The permanent magnet assembly shown in Fig. 14 consists of an inner rotor with an inner radius of r_{1}=30 mm and an outer radius of r_{2}=130 mm, as well as an outer rotor with an inner radius of r_{3}=155 mm and an outer radius of r_{4}=300 mm. Both permanent magnets have a dimension of 60\text{ mm}\times 60 mm. The flux collector in the outer rotor has a height of H_{\text{ORFC}}=5 mm, while it is H_{\text{IRFC}}=15 mm for the inner rotor. Dirichlet boundary conditions A_{z}=0 are imposed strongly by elimination on the inner radius of the inner rotor and on the outer radius of the outer rotor, which physically implies that no magnetic flux crosses these boundaries. Additionally, an anti-periodic boundary conditions are imposed on the sides \Gamma^{+} and \Gamma^{-} . The material properties of the permanent magnets, iron, and air are the same as those used in the horseshoe magnet problem, see Section 5.2 . For comparison, we solve the problem using conformal multi-patch IGA with 21 conformal patches, each being discretized with 30\times 30 knot spans and polynomial order of p=2 , resulting in a total number of 20,492 DOFs. We evaluate the magnetic flux density over the mean radius between both rotors at r_{a}=142.5 mm, as highlighted by the blue dashed curve in Fig. 14 . x y A_{z}=0 A_{z}=0 Iron bridge Iron core Anti-periodic BC \Gamma^{-} Anti-periodic BC \Gamma^{+} r_{4} r_{1} r_{3} r_{2} W_{\text{PM}} H_{\text{PM}} H_{\text{OFRC}} H_{\text{IFRC}} Figure 14 : Schematic representation of the permanent magnet assembly. The permanent magnets are shown in red, the iron components in gray, and the air regions in light blue. Each magnet a magnetization direction with \theta=45^{o} measured from the x -axis For illustration purposes, examples of the spatial discretization for the considered approaches are shown in Fig. 15 . In Fig. 15(a) , the geometry is parametrized using 21 conformal patches, each discretized with 4\times 4 knot spans. Constructing such a parametrization is a cumbersome process, as the corner points of each patch must be carefully identified and conformity between adjacent patches must be ensured. In contrast, for the union with non-conformal patches approach shown in Fig. 15(b) , the geometry can be parametrized by unifying six non-conformal patches over a trimmed background patch, which significantly reduces the parametrization effort. For the union with conformal layers , two configurations are considered for constructing the conformal layers. In the first configuration, see Fig. 15(c) , the conformal layer is constructed only along the outer boundaries of the flux collectors in the inner and outer rotors. In the second configuration, see Fig. 15(d) , the conformal layers wrap around the flux collectors and part of the permanent magnets in both the inner and outer rotors. The total number of patches for both configurations is nine (eight non-conformal patches unified with a trimmed background patch). (a) Multi-patch IGA (b) Union with non-conformal patches (c) Union with conformal layers (version 1) (d) Union with conformal layers (version 2) Figure 15 : Illustration of the different geometric discretizations of the permanent magnet assembly For the union with non-conformal patches approach, the number of elements used for the discretization of each patch is shown in Table 1 . The total number of degrees of freedom is 23,869 . For the union with conformal layers configurations, the total number of degrees of freedom is 25,621 for version 1 and 24,477 for version 2. The conformal layers in version 2 are constructed in such a way to allow the solution field to be resolved more accurately in the vicinity of the singularities. Consequently, a coarser background mesh is used in this configuration, resulting in fewer degrees of freedom compared to version 1, see Table 1 . For all three methods, basis functions with a polynomial degree of p=2 are used, and the stabilization parameter for Nitsche’s method was set to \beta\nu p/h=5\cdot 10^{11} . Patch Union NC Union CL (v1) Union CL (v2) Iron core 20\times 30 20\times 30 20\times 30 PM1 40\times 40 40\times 40 40\times 40 Iron IRFC 20\times 40 20\times 40 20\times 40 Iron ORFC 20\times 40 20\times 40 20\times 40 PM2 40\times 40 40\times 40 40\times 40 Iron bridge 50\times 50 50\times 50 50\times 50 Boundary layers – 20\times 40 10\times 80 Air (Background) 100\times 100 100\times 100 60\times 60 Table 1 : Space discretization for each approach in terms of knot spans The evaluation of the magnitudes of the flux field \|\textbf{B}\| at r_{a}=142.5 mm shown in Fig. 16 indicates that the union with non-conformal patches approach yields the lowest accuracy, with the largest discrepancies occurring in the high field region between the two flux collectors (inner and outer rotors), where the flux density is overestimated. Along the circumferential angle \theta , the field is generally underestimated, except near both ends of the profile, where the solution again exhibits overestimation. Overall, these trends suggest that the union NC approach requires a finer discretization of the trimmed background patch to achieve a more accurate field evaluation. For version 1 of the union with conformal layers , the predicted field closely matches the multi-patch IGA reference solution, with only a very slight overestimation in the angular interval \theta\in[35,55] . This deviation can be reduced by additional refinement of the conformal boundary layers. Finally, the version 2 configuration exhibits an almost perfect agreement with the multi-patch IGA solution, despite employing fewer degrees of freedom than version 1. 0 10 20 30 40 50 60 70 80 90 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 Circumferential angle \theta [°] \|\textbf{B}\| [T] Multi-patch IGA Union NC Union CL (v1) Union CL (v2) 0 10 20 30 40 50 60 70 80 90 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 Circumferential angle \theta [°] \|\textbf{B}\| [T] Multi-patch IGA Union NC Union CL (v1) Union CL (v2) 0 10 20 30 40 50 60 70 80 90 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 Circumferential angle \theta [°] \|\textbf{B}\| [T] Multi-patch IGA Union NC Union CL (v1) Union CL (v2) Figure 16 : Evaluation of flux density magnitude in the air gap of the permanent magnet assembly at r_{a}=142.5 mm To finalize the comparison, the contours of the magnetic flux density magnitude \|\textbf{B}\| are shown in Fig. 17 . For the union NC approach, the contours generally agree with those of the reference solution. However, small but noticeable discrepancies are observed within the air gap and in the vicinity of the flux collectors. As discussed earlier, these discrepancies could be mitigated by further refinement of the background patch. In contrast, both union CL configurations show excellent agreement with the reference contours throughout the domain. (a) Conformal multi-patch IGA reference solution (b) Union with non-conformal patches (c) Union with conformal layers (version 1) (d) Union with conformal layers (version 2) Figure 17 : Contours of magnetic flux density of the permanent magnet assembly for different methods 5.4 Discussion Overall, the three examples presented pose different challenges to the three immersed IGA approaches adopted in this work ( fully immersed , union with non-conformal patches , and union with conformal layers ). The coaxial cable problem introduces a discontinuous source current density across different subdomains. Here, the fully immersed approach is able to accurately predict the magnetic potential and the flux density within each subdomain. However, it cannot capture the flux density profile across subdomain interfaces exactly. This is due to the inability to represent the discontinuities in the solution gradient through smooth basis functions across the interfaces. On the contrary, the Union NC approach accurately resolves the flux density over subdomain interfaces. In addition, the approach exhibits optimal convergence rates in the h -refinement analysis for different polynomial orders, unlike the fully immersed approach. The horseshoe magnet problem introduces a different challenge compared to the coaxial cable problem: discontinuous material parameters across several subdomains. The fully immersed approach with k -refinement was able to represent the scalar potential and the magnetic flux density within each material well. However, as the magnetic flux density, i.e., a gradient field, is approximated with highly continuous basis function, Gibbs-type phenomena are observed at material interfaces. Although this can be reduced when p -refinement is employed, the Gibbs-type phenomena can still be observed within the first few knot spans around the interfaces. For the Union NC approach, these oscillations were suppressed, as each material is represented by an independent patch and thus independent basis functions. However, the method requires refinement, mainly near singularities, to accurately capture them. This is possible with the implementation of the Union CL method, where critical areas are wrapped with conformal layers to accurately capture local features and accurately resolve the magnetic flux density. This can be seen in particular at the corners of the iron rods, where singularities occur, indicated by spikes in the high flux density. Overall, the Union CL has shown to have less error in both L^{2} -norm and H^{1}_{s} -seminorm by approximately one order of magnitude. The permanent magnet assembly problem features similar challenges as the horseshoe magnet problem, however, the geometry is more complex. Here, the industry-related target was to accurately evaluate the magnetic field within the air gap. This requires an accurate representation of the geometry and ensuring that no cross-talk occurs between different materials/subdomains. The Union NC and Union CL approaches were examined against a reference solution obtained by conventional conformal multi-patch IGA. The Union NC was found to overestimate the field at the high-field region, and slightly underestimate the field near the low-field region. However, with two different boundary conformal configurations, the Union CL was able to accurately evaluate the gap field. 6 Conclusions and future work In this work, we developed an isogeometric immersed boundary-conformal framework for two-dimensional magnetostatic problems, in which three different methods are employed, namely: fully immersed , union with non-conformal patches , and union with conformal layers . In all three approaches, trimmed elements in the immersed background patch are efficiently handled by adopting a boundary-conformal quadrature method, leading to accurate integration with a low number of quadrature points. Coupling non-conformal patches is enabled by employing Nitsche’s method while ensuring stability by considering the flux from the non-trimmed patches, which alleviates the need for additional stabilization methods. The results demonstrate that the proposed framework achieves accuracy comparable to conformal multi-patch IGA while significantly reducing the geometry preprocessing effort. We investigated the application of the aforementioned methods for three different problems, each presenting distinct challenges. The coaxial cable problem is intended to represent a discontinuous current field between several regions. For the horseshoe magnet problem, discontinuous material parameters, i.e., permeability, introduce difficulties in treating Gibbs-type phenomena. In the last example, the geometry represents a cross-section of an industrial application, where accurate evaluation of the field in the air gap plays a crucial role in predicting the cooling power of the device. The proposed immersed IGA framework with non-conformal patches and conformal layers offers several advantages compared to conventional frameworks, e.g., multi-patch IGA: 1. By employing the union approaches, multiple subdomains can be described directly by immersing their B-rep – which can be extracted from CAD – and conformal layers can then be generated automatically without human intervention. This is not the case for standard multi-patch IGA, where conforming patches must be constructed manually. 2. The geometric preprocessing effort and the number of patches required are significantly reduced, e.g., from 30 to 5 in the horseshoe magnet problem and from 21 to 7 for the permanent magnet assembly. 3. The method circumvents the requirement for conformity between independent patches, unlike multi-patch IGA, thereby reducing the effort associated with generating a conformal multi-patch mesh. This also applies to weakly coupled multi-patch IGA based on Nitsche’s method [ 67 ] . However, such approaches are typically limited to regions that are topologically equivalent to a square, e.g., making it difficult to represent the air region in Section 5.3 using a single patch. 4. The framework removes the need for Lagrange multiplier methods or harmonic mortaring methods to couple different subdomains, resulting in a system with fewer unknowns. 5. The union concept (used in the Union NC and Union CL methods) allows for strong imposition of Dirichlet boundary conditions on domain boundaries, unlike the fully immersed fictitious domain procedure, where this is only possible when the physical domain boundaries coincide with the extended domain boundaries. 6. The Union CL enables accurate capture of solution singularities, resulting in improved accuracy. 7. The Union CL demonstrates its effectiveness in mitigating spurious oscillations across material interfaces due to the construction of a conformal layer within the trimmed field, which leads to smoother transitions across interfaces. 8. Both the Union NC and Union CL provide accurate evaluation of the field within critical regions (e.g., the air gap in Section 5.3 ). Overall, the union with non-conformal patches method provides accurate results for the coaxial cable problem. However, for the horseshoe magnet problem and the permanent magnet assembly problem, the method requires refinement near critical regions to mitigate over- or underestimation of the field. In contrast, the union with conformal layers provides highly accurate results for all considered problems, demonstrating its accuracy, efficacy, and robustness for two-dimensional magnetostatic simulations. Future work will investigate the effect of local refinement strategies, such as Truncated Hierarchical B-splines [ 35 , 81 , 36 ] , particularly near critical regions, which may reduce the number of conformal layers required. Furthermore, the method will be extended to three-dimensional magnetostatic problems and applied to additional electric machine configurations [ 33 ] . CRediT authorship contribution statement Yusuf T. Elbadry: Writing – original draft, Visualization, Validation, Software, Investigation, Conceptualization; Giuliano Guarino: Writing – review & editing, Visualization, Validation, Software, Conceptualization; Pablo Antolín: Writing – review & editing, Software, Methodology, Conceptualization; Oliver Weeger: writing—review & editing, Visualization, Methodology, Supervision, Resources, Funding acquisition, Conceptualization. Data Availability None. Disclosure Statement The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper. Declaration of generative AI and AI-assisted technologies in the writing process The authors disclose the use of ChatGPT, a large language model developed by OpenAI [ 70 ] , as a language editing tool to enhance the clarity and readability of the manuscript. The authors are solely responsible for the content of this work.