
where
x
is the coordinate,
Ω
is the domain of interest,
u∂Ω(x)
is the general solution at the boundary
∂Ω, and l∂Ω(x)is an extended distance function which satisfies:
l∂Ω(x) = 0 if x∈∂Ω,
>0 otherwise.(4)
In the case of Eq.
(1)
(where
x= (x1, x2)
,
Ω = [0,1]2
), the general solution is exactly
g(x2)
, and
we can use the following ansatz (which automatically satisfies the BC in Eq. (1b)):
ˆu(x1, x2;θ) = g(x2) + x1NN(x1, x2;θ).(5)
However, it is hard to directly extend this method to more general cases of Robin BCs (see Eq.
(7)
),
since we cannot obtain the general solution
u∂Ω(x)
analytically. Existing attempts are either mesh-
dependent [
10
,
47
], which are time-consuming for high-dimensional and geometrically complex
PDEs, or ad hoc methods for specific (geometrically simple) physical systems [
30
]. It is still lacking
a unified hard-constraint framework for both geometrically complex PDEs and the most commonly
used Dirichlet, Neumann, and Robin BCs.
3 Methodology
We first introduce the problem setup of geometrically complex PDEs considered in this paper and
then reformulate the PDEs via the extra fields, followed by presenting our unified hard-constraint
framework for embedding Dirichlet, Neumann, and Robin BCs into the ansatz.
3.1 Problem Setup
We consider a physical system governed by the following PDEs defined on a geometrically complex
domain: Ω⊂Rd
F[u(x)] = 0,x= (x1, . . . , xd)∈Ω,(6)
where
F= (F1,...,FN)
includes
N
PDE operators which map
u
to a function of
x
,
u
and
u
’s
derivatives. Here,
u(x)=(u1(x), . . . , un(x))
is the unknown solution, which represents physical
quantities of interest. For each uj, j = 1, . . . , n, we impose suitable boundary conditions (BCs) as:
aj,i(x)uj+bj,i(x)nj,i(x)· ∇uj=gj,i(x),x∈γj,i,∀i= 1, . . . , mj,(7)
where
{γj,i}mj
i=1
are subsets of the boundary
∂Ω
whose closures are disjoint,
aj,i, bj,i :γj,i →R
satisfy that
a2
j,i(x) + b2
j,i(x)̸= 0,∀x∈γj,i
,
nj,i :γj,i →Rd
is the (outward facing) unit normal
of
γj,i
at each location, and
gj,i :γj,i →R
. It is noted that Eq.
(7)
represents a Dirichlet BC if
aj,i ≡1, bj,i ≡0
, a Neumann BC if
aj,i ≡0, bj,i ≡1
, and a Robin BC otherwise. In the following,
we drop some of the subscripts in Eq. (7) for clarity 2.
For such geometrically complex PDEs, if we directly resort to PINNs (see Section 2.1), there would
be a difficult multi-task learning with at least
(Pn
j=1 mj+N)
terms in the loss function. As discussed
in the previous analyses [
41
,
42
], it will severely affect the convergence of the training due to the
unbalanced competition between those loss terms. Hence, in this paper, we will discuss how to
embed the BCs into the ansatz, where every instance automatically satisfies the BCs. However, it is
infeasible to directly follow the pipeline of hard-constraint methods (see Eq.
(3)
) since Eq.
(7)
does
not have a general solution of analytical form. Therefore, a new approach is needed to address this
intractable problem.
3.2 Reformulating PDEs via Extra Fields
In this subsection, we present the general solutions of the BCs, which will be used to construct
the hard-constraint ansatz subsequently. We first introduce the extra fields from the mixed finite
element method [
23
,
4
] to equivalently reformulate the PDEs. Let
pj(x)=(pj1(x), . . . , pjd(x)) =
∇uj, j = 1, . . . , n. We substitute them into Eq. (6) and Eq. (7) to obtain the equivalent PDEs:
˜
F[u(x),p1(x),...,pn(x)] = 0,x∈Ω,(8a)
pj(x) = ∇uj,x∈Ω∪∂Ω,∀j= 1, . . . , n, (8b)
2We simplify γj,i , aj,i(x), bj,i(x),nj,i(x), gj,i(x)to γi, ai(x), bi(x),n(x), gi(x).
4