1 Introduction

The present work deals with simulations in domains with embedded cylindrical, or nearly cylindrical inclusions, with cross-section sizes much smaller than their length and than the domain scale. This kind of problem is typical of a large variety of applications, ranging from the study of living tissues, where the inclusions are constituted, e.g., by the capillaries or by the vessels of the lymphatic system [2, 12, 18], to the study of the interaction between plant roots and the soil [10, 20], or fibre-reinforced materials [16, 21], and geological applications [3, 6, 7]. In these cases, it is often convenient to treat the inclusions as one dimensional objects, thus actually collapsing the cross-sections on the centrelines, avoiding the complexity and the overhead of generating good quality meshes in the interior of the small inclusions. Such geometrical reduction is however non-trivial from a mathematical standpoint as it ends up in a 3D problem which is coupled to problems on the 1D domains, and non standard function spaces need to be used to allow the definition of a well posed trace operator for 3D functions on 1D manifolds.

An analysis of 3D problems with singular source terms is available in [4, 5], where the solution is placed in suitable weighted Sobolev spaces. In [4] a finite element based approach is used to solve the problem and optimal convergence trends for the error are observed in the used spaces. Problems with singular source terms are also considered in [22], where Dirac delta sources are replaced by regularizing terms, compactly supported. Regularizing techniques are suggested also in [9], and in [11] where line source terms are approximated by suitable kernel functions that distribute the source in a three dimensional neighbourhood of the line. A splitting technique is proposed in [8], where the solution is seen as the sum of a known low regularity term and a regular correction term that is computed solving an elliptic problem with source term and boundary data depending on a chosen extension operator for the singular source. In [13] a lifting technique is employed for the singular source term, whereas a domain decomposition approach based on the use of Lagrange multipliers is suggested in [14]. The derivation of a coupled 3D-1D problem, starting from an original equidimensional formulation is proposed in [15], under suitable assumptions on the behavior of the solution in the inclusions that allow the definition of averaging operators.

Here an extension of the approach described in [1] for 3D-1D coupled elliptic problems is proposed, allowing to deal with discontinuous solution at the interfaces. This is relevant for a large variety of practical applications, as e.g. in many biological processes, where the boundary between the 3D and the 1D domains is a semi-permeable membrane and the Starling equation applies [2, 11, 14, 15]. Discontinuous solutions also arise in the application of 3D-1D coupled models for the simulation of plant roots-soil interaction [10, 20] or in modeling natural and artificial wells in geological reservoirs [3, 7]. Similarly to [1], a well posed 3D-1D coupled problem is derived from the original 3D-3D problem through an appropriate choice of the functional space for the solution, which allows to define extension and trace operators between spaces on 3D and 1D domains. Further, a domain decomposition approach is employed, introducing additional interface unknowns to decouple the 3D problem from the problems on the 1D inclusions, and a cost functional is designed such that the solution is obtained as the minimum of the functional constrained by the constitutive equations on the subdomains. The original work in [1] deals with continuous solution at the boundary between the 3D and the 1D domains. Here, while keeping the same structure of this original method, different interface variables are introduced for the domain decomposition process, which result in a novel setting for the PDE constrained optimization problem described. In the approach proposed in [1], the control variables of the optimization approach represent the flux and the trace of the solution on the 1D interfaces, equal for the 3D and 1D solution. Here, instead, the interface variables are the two different traces of the solution at the interfaces. This difference has an impact on the definition of the functional and on the variables the functional depends on. The problem is discretized using finite elements on non conforming meshes, thus providing a great flexibility in the choice of the meshes that can be independently defined on each subdomain, and a numerical scheme suitable for parallel computing is obtained thanks to the use of domain decomposition combined to a gradient scheme for solving the resulting discrete problem. Despite the differences in problem formulation, the discretization of the method can be handled in a way similar to the one in [1], within the proposed framework, requiring different discrete operators, but keeping unchanged the overall structure of the method.

The problem considered is presented in Section 2 in equi-dimensional form, and in Section 3 its 3D-1D formulation is derived in weak form in ad-hoc function spaces. The problem is re-written as a PDE constrained optimization problem in Section 4, and presented in discrete form in Section 5. The approach used to solve the obtained linear system is discussed in Section 6, whereas some numerical tests are reported in Section 7 and finally conclusions are reported in Section 8.

2 Notation and formulation of the fully 3D coupled problem

Let \(\Omega {\subset } \mathbb {R}^3\) be a convex domain in which a generalized cylinder \(\Sigma {\subset } \mathbb {R}^3\) is embedded. We denote by \(\Lambda =\left\{ \varvec{\lambda }(s), s \in (0,S) \right\} \) the centerline of \(\Sigma \), while \(\Gamma =\left\{ \Gamma (s), ~s \in [0,S]\right\} \) is the lateral surface of \(\Sigma \). In the following we assume, for simplicity, that \(\Lambda \) is a rectilinear segment in the three-dimensional space. We denote by \(\Sigma (s)\) the transversal sections of the cylinder as s ranges in the interval [0, S] and by \(\Gamma (s)\) their boundary. We suppose the sections to have an elliptic shape, with R(s) being the maximum axes length of the ellipse centered in \(\varvec{\lambda }(s)\). For the two extreme sections of the cylinder we adopt the compact notation \(\Sigma _0=\Sigma (0)\) and \(\Sigma _S=\Sigma (S)\). For the derivation of the model problem we assume that \(\Sigma _0\) and \(\Sigma _S\) lie on the boundary \(\partial \Omega \), but the extension to more general cases is straightforward. The portion of \(\Omega \) that does not include the cylinder is denoted by \(D=\Omega \setminus \Sigma \). We define \(\partial D^e=\partial \Omega \setminus \left\{ \Sigma _0 \cup \Sigma _S\right\} \), referring to it as the external boundary of D, with \(\partial D =\partial D^e \cup \Gamma \). In case the extreme sections of \(\Sigma \) were inside \(\Omega \), \(\partial D^e\) would coincide with \(\partial \Omega \).

Let us now consider the following diffusion problem, with unknown pressures u in D and \(\tilde{u}\) in \(\Sigma \):

3D-problem on \(\varvec{D}\):

$$\begin{aligned} -\nabla \cdot (K \nabla u)=f \qquad \text {in} \; D \end{aligned}$$
(1)
$$\begin{aligned} u=0 \qquad \text {on}\; \partial D^e \end{aligned}$$
(2)
$$\begin{aligned} K\nabla u \cdot \varvec{n}=\beta (\tilde{u}_{|_{\Gamma }} -u_{|_{\Gamma }}) \qquad \text { on } \;\Gamma \end{aligned}$$
(3)

3D-problem on \(\varvec{\Sigma }\):

$$\begin{aligned} -\nabla \cdot ({\tilde{K}}\nabla \tilde{u})=g \quad \text { in } \Sigma \end{aligned}$$
(4)
$$\begin{aligned} \tilde{u}=0 \quad \text { on } \Sigma _0 \cup \Sigma _S \end{aligned}$$
(5)
$$\begin{aligned} \tilde{K}\nabla \tilde{u} \cdot \varvec{\tilde{n}}=\beta (u_{|_{\Gamma }}-\tilde{u}_{|_{\Gamma }}) \quad \text { on } \Gamma \end{aligned}$$
(6)

Vectors \(\varvec{n}\) and \(\varvec{\tilde{n}}=-\varvec{n}\) are the outward pointing unit normal vectors to \(\Gamma \), respectively for D and \(\Sigma \); K, \(\tilde{K}\) and \(\beta \) are positive scalars, while f and g denote source terms. For the sake of simplicity we consider homogeneous Dirichlet boundary conditions on \(\Sigma _0\) and \(\Sigma _S\) and on \(\partial D ^e\). Equations (3) and (6) allow us to couple the two problems imposing flux conservation. According to these equations, the flux across \(\Gamma \) is directly proportional to the jump of the pressures, with \(\beta \) denoting the permeability coefficient of the membrane \(\Gamma \). Different coupling conditions could be considered, for example adding a pressure continuity constraint and consequently not linking the flux definition to the pressure jump, as done in [1]. The choice of the interface condition depends of course on the properties of the interface, and thus on the kind of application.

Let us now suppose that R is much smaller than the size of \(\Omega \) and than the longitudinal length L of the cylinder itself, in particular. This allows us to assume that the variables defined on \(\Sigma \) or on \(\Gamma \) are actually only functions of the coordinate s, considering negligible their variation on the cross-sections of the inclusion. This is the key point that allows us, in the next section, to work out a well-posed 3D-1D coupled problem from equations (1)-(6).

3 Variational formulation of the 3D-1D problem

A 3D-1D coupled problem is obtained from problem (1)-(6), after writing it in variational form in suitable function spaces, as here described. Let us, thus, introduce the spaces

$$\begin{aligned} \begin{aligned}&H_0^1(D)=\left\{ v \in H^1(D) : v_{|_{\partial D^e}}=0 \right\} ,\\&H_0^1(\Sigma )=\left\{ v \in H^1(\Sigma ): v_{|_{\Sigma _0}}=v_{|_{\Sigma _S}}=0\right\} , \\&H_0^1(\Lambda )=\left\{ v \in H^1(\Lambda ): v(0)=v(S)=0\right\} , \end{aligned} \end{aligned}$$

a trace operator

$$\begin{aligned} \gamma _{_\Gamma }:H^1(D)\cup H^1(\Sigma )\rightarrow H^{\frac{1}{2}}(\Gamma ),\text { such that }\gamma _{_\Gamma }v=v_{|_\Gamma } ~\forall v \in H^1(D)\cup H^1(\Sigma ) \end{aligned}$$

and two extension operators

$$\begin{aligned} \mathcal {E}_{_\Sigma }: H^1(\Lambda ) \rightarrow H^1(\Sigma ) ~\text { and }~\mathcal {E}_{_\Gamma }: H^1(\Lambda ) \rightarrow H^{\frac{1}{2}}(\Gamma ) \end{aligned}$$

such that, given \(\hat{v} \in H_0^1(\Lambda )\), \(\mathcal {E}_{_\Sigma }\hat{v}(s)\) and \(\mathcal {E}_{_\Gamma }\hat{v}(s)\) are the uniform extension of \(\hat{v}(s)\) respectively to \(\Sigma (s)\) and to \(\Gamma (s)\). We observe that \(\mathcal {E}_{_\Gamma }=\gamma _{_\Gamma }\circ \mathcal {E}_{_\Sigma }\). Once denoted by \(\hat{V}\) the space \(H_0^1(\Lambda )\), let us further consider the spaces:

$$\begin{aligned} \begin{aligned}&\widetilde{V}=\lbrace v \in H_0^1(\Sigma ): v =\mathcal {E}_{_{\Sigma }}\hat{v}, ~\hat{v} \in \hat{V} \rbrace , \\&\mathcal {H}^{\Gamma }=\lbrace v \in H^{\frac{1}{2}}(\Gamma ): v =\mathcal {E}_{_{\Gamma }}\hat{v}, ~\hat{v} \in \hat{V} \rbrace ,\\&V_D=\left\{ v \in H_0^1(D): \gamma _{_\Gamma }v \in \mathcal {H}^{\Gamma }\right\} , \end{aligned} \end{aligned}$$

such that functions in \(\widetilde{V}\) and in \(\mathcal {H}^{\Gamma }\) are respectively the uniform extension to \(\Sigma \) and \(\Gamma \) of functions in \(\hat{V}\) and functions in \(V_D\) have trace on \(\Gamma \) belonging to \(\mathcal {H}^{\Gamma }\). Functions in such spaces fit the assumptions we have made on the negligible variation of the variables on the cross-sections of \(\Sigma \) and \(\Gamma \). Denoting by \((\cdot ,\cdot )_{X}\) the scalar product on a generic space X, the variational formulation of problem (1)-(6) can be written as: find \((u, \tilde{u}) \in V_D \times \widetilde{V}\) such that

$$\begin{aligned} ({K}\nabla u, \nabla v)_{L^2(D)}-\left( \beta (\gamma _{_{\Gamma }}\tilde{u} -\gamma _{_{\Gamma }}u),\gamma _{_\Gamma }v \right) _{\mathcal {H}^{\Gamma }}=(f,v)_{L^2(D)}~\forall v \in V_D \end{aligned}$$
(7)
$$\begin{aligned} ({\tilde{K}}\nabla \tilde{u}, \nabla \tilde{v})_{L^2(\Sigma )}+\left( \beta (\gamma _{_{\Gamma }}\tilde{u} -\gamma _{_{\Gamma }}u),\gamma _{_\Gamma }v \right) _{\mathcal {H}^{\Gamma }}=(g,\tilde{v})_{{L^2(\Sigma )}} \forall \tilde{v} \in \widetilde{V} \end{aligned}$$
(8)

Let us introduce two auxiliary variables \(\psi _{_D},\psi _{_\Sigma }\in \mathcal {H}^{\Gamma }\), in order to formally decouple the two equations. Denoting by \(X'\) the dual of the generic space X, the problem is thus rewritten as: find \((u, \tilde{u}) \in V_D \times \widetilde{V}\), \(\psi _{_D}\in \mathcal {H}^{\Gamma }\) and \(\psi _{_\Sigma }\in \mathcal {H}^{\Gamma }\) such that

$$\begin{aligned} ({K}\nabla u, \nabla v)_{L^2(D)}+\left( \beta \gamma _{_{\Gamma }}u,\gamma _{_\Gamma }v \right) _{\mathcal {H}^{\Gamma }}-\left( \beta \psi _{_\Sigma },\gamma _{_\Gamma }v \right) _{\mathcal {H}^{\Gamma }}=(f,v)_{{L^2(D)}}~\forall v \in V_D \end{aligned}$$
(9)
$$\begin{aligned} ({\tilde{K}}\nabla \tilde{u}, \nabla \tilde{v})_{L^2(\Sigma )}+\left( \beta \gamma _{_{\Gamma }}\tilde{u},\gamma _{_\Gamma }\tilde{v} \right) _{\mathcal {H}^{\Gamma }}-\left( \beta \psi _{_D},\gamma _{_\Gamma }\tilde{v} \right) _{\mathcal {H}^{\Gamma }}=(g,\tilde{v})_{L^2(\Sigma )} \forall \tilde{v} \in \widetilde{V} \end{aligned}$$
(10)
$$\begin{aligned} \left\langle \gamma _{_\Gamma }u-\psi _{_D},\eta \right\rangle _{\mathcal {H}^{\Gamma },{\mathcal {H}^{\Gamma }}'}=0~\forall \eta \in {\mathcal {H}^{\Gamma }}' \end{aligned}$$
(11)
$$\begin{aligned} \left\langle \gamma _{_\Gamma }\tilde{u}-\psi _{_\Sigma },\eta \right\rangle _{\mathcal {H}^{\Gamma },{\mathcal {H}^{\Gamma }}'}=0~\forall \eta \in {\mathcal {H}^{\Gamma }}'. \end{aligned}$$
(12)

Let us remark that Equations (9)-(10) could also be written as

$$\begin{aligned} \begin{aligned}&({K}\nabla u, \nabla v)_{L^2(D)}+\left( \beta \psi _{_D},\gamma _{_\Gamma }v \right) _{\mathcal {H}^{\Gamma }}-\left( \beta \psi _{_\Sigma },\gamma _{_\Gamma }v \right) _{\mathcal {H}^{\Gamma }}=(f,v)_{L^2(D)}~&\forall v \in V_D \\&({\tilde{K}}\nabla \tilde{u}, \nabla \tilde{v})_{L^2(\Sigma )}+\left( \beta \psi _{_\Sigma },\gamma _{_\Gamma }\tilde{v} \right) _{\mathcal {H}^{\Gamma }}-\left( \beta \psi _{_D},\gamma _{_\Gamma }\tilde{v} \right) _{\mathcal {H}^{\Gamma }}=(g,\tilde{v})_{L^2(\Sigma )}&\forall \tilde{v} \in \widetilde{V}. \end{aligned} \end{aligned}$$

However, formulation (9)-(10) is preferred, as it allows to have an empty Dirichlet boundary on either \(\partial D^e\) or \(\Sigma _0,\Sigma _s\). This is a desired property for domain decomposition purposes.

Thanks to the adopted functional spaces, problem (9)-(12) can be easily reduced to a 3D-1D coupled problem. Let us observe that, given \(\eta \in {\mathcal {H}^{\Gamma }}'\) and \(\rho \in \mathcal {H}^{\Gamma }\)

$$\begin{aligned} \left\langle \rho ,\eta \right\rangle _{{\mathcal {H}^{\Gamma }}, {\mathcal {H}^{\Gamma }}'}=\int _{\Gamma }\rho \eta ~d\Gamma =\int _0^S\Big ( \int _{\Gamma (s)}\rho \eta ~dl\Big ) ds. \end{aligned}$$

Since \(\rho \in \mathcal {H}^{\Gamma }\), there exists \(\hat{\rho } \in \hat{V}\) such that \(\mathcal {E}_{_{\Gamma }}\hat{\rho }=\rho \) and thus \(\int _{\Gamma (s)}\rho ~dl=|\Gamma (s)|\hat{\rho }(s)\). Hence we can introduce \(\overline{\eta }\in \hat{V}'\) such that

$$\begin{aligned} \int _0^S\Big ( \int _{\Gamma (s)}\rho \eta ~dl\Big ) ds=\int _0^S|\Gamma (s)|\hat{\rho }(s)\overline{\eta }(s)~ds=\left\langle \hat{\rho },{|\Gamma (\cdot )|}\overline{\eta }\right\rangle _{\hat{V}',\hat{V}}, \end{aligned}$$

where \(|\Gamma (s)|\) is the section perimeter size at \(s\in [0,S]\). Similarly, if we consider \(\rho ,w \in \mathcal {H}^{\Gamma }\), then

$$\begin{aligned} \left( \rho ,w \right) _{\mathcal {H}^{\Gamma }}=\int _0^S|\Gamma (s)|\hat{\rho }(s)\hat{w}(s)~ds=\left( {|\Gamma (\cdot )|}\hat{\rho },\hat{w}\right) _{L^2(\Lambda )} \end{aligned}$$

with \(\mathcal {E}_{_{\Gamma }}\hat{\rho }=\rho \) and \(\mathcal {E}_{_{\Gamma }}\hat{w}=w\). Finally let us observe that

$$\begin{aligned} ({\tilde{K}}\nabla \tilde{u}, \nabla \tilde{v})_{L^2(\Sigma )}=\int _{\Sigma }{\tilde{K}}\nabla \tilde{u}\nabla \tilde{v}~d\sigma =\int _0^S{\tilde{K}}|\Sigma (s)|\frac{d\hat{u}}{ds}~\frac{d\hat{v}}{ds}~ds \end{aligned}$$

where \(\hat{u},\hat{v} \in \hat{V}\) are such that \(\tilde{u}=\mathcal {E}_{_{\Sigma }}\hat{u}\), \(\tilde{v}=\mathcal {E}_{_{\Sigma }}\hat{v}\) and \(|\Sigma (s)|\) is the section area at \(s \in [0,S]\). Problem (9)-(12) can now be rewritten as a reduced 3D-1D coupled problem: Find \((u,\hat{u}) \in {V_D}\times \hat{V}\), \(\hat{\psi }_{_D}\in \hat{V}\) and \(\hat{\psi }_{_\Sigma }\in \hat{V}\) such that:

$$\begin{aligned} \begin{aligned} ({{K}}\nabla u, \nabla v)_{L^2(D)}+\left( {|\Gamma (\cdot )|}\beta \check{u},\check{v}\right) _{L^2(\Lambda )}-&\big ( {|\Gamma (\cdot )|}\beta \hat{\psi }_{_\Sigma },\check{v} \big ) _{L^2(\Lambda )}=(f,v)_{L^2(D)} \\&\forall v \in {V_D}, \check{v} \in \hat{V}: \gamma _{_\Gamma } v=\mathcal {E}_{_\Gamma }\check{v} \\ \end{aligned} \end{aligned}$$
(13)
$$\begin{aligned} \begin{aligned} \Big ( {\tilde{K}}{|\Sigma (\cdot )|}\frac{d\hat{u}}{ds},\frac{d\hat{v}}{ds}\Big )_{\hspace{-0.1cm}L^2(\Lambda )}+\big ( {|\Gamma (\cdot )|}\beta \hat{u},\hat{v} \big )_{L^2(\Lambda )}\hspace{-0.1cm}-\big ( {|\Gamma (\cdot )|}\beta \hat{\psi }_{_D},\hat{v}\big ) _{L^2(\Lambda )}&=({|\Sigma (\cdot )|}\overline{\overline{g}},\hat{v})_{{L^2(\Lambda )}} \\&\forall \hat{v} \in \hat{V} \end{aligned} \end{aligned}$$
(14)
$$\begin{aligned} \left\langle {|\Gamma (\cdot )|}(\check{u}-\hat{\psi }_{_D}),\overline{\eta }\right\rangle _{\hat{V},\hat{V}'}=0 \gamma _{_\Gamma }u=\mathcal {E}_{_{\Gamma }}\check{u},\forall \overline{\eta } \in \hat{V}' \end{aligned}$$
(15)
$$\begin{aligned} \left\langle {|\Gamma (\cdot )|}(\hat{u}-\hat{\psi }_{_\Sigma }),\overline{\eta }\right\rangle _{\hat{V},\hat{V}'}=0 \forall \overline{\eta } \in \hat{V}' \end{aligned}$$
(16)

with \(\overline{\overline{g}}(s)=\frac{1}{|\Sigma (s)|}\int _{\Sigma (s)}g~d\sigma \), being g sufficiently regular.

4 PDE-constrained optimization problem

Conditions (15) and (16) can be replaced by the minimization of a cost functional mimicking the error committed in the fulfillment of such constraints. At this aim let us define

$$\begin{aligned} \begin{aligned} J(\hat{\psi }_{_D},\hat{\psi }_{_\Sigma })&=\frac{1}{2}\left( ||\gamma _{_\Gamma }u(\hat{\psi }_{_\Sigma })-\psi _{_D}||_{\mathcal {H}^{\Gamma }}^2+||\gamma _{_\Gamma }\tilde{u}(\hat{\psi }_{_D})-\psi _{_\Sigma }||_{\mathcal {H}^{\Gamma }}^2\right) \\&=\frac{1}{2}\left( ||\gamma _{_\Gamma }u(\hat{\psi }_{_\Sigma })-\mathcal {E}_{_{\Gamma }}\hat{\psi }_{_D}||_{\mathcal {H}^{\Gamma }}^2+||\gamma _{_\Gamma }\mathcal {E}_{_{\Sigma }}\hat{u}(\psi _{_D})-\mathcal {E}_{_{\Gamma }}\hat{\psi }_{_\Sigma }||_{\mathcal {H}^{\Gamma }}^2\right) \end{aligned} \end{aligned}$$
(17)

to be minimized constrained by (13) and (14). In order to work out the PDE-constrained optimization formulation of the problem in a compact form, let us define the linear operators \(A: {V_D} \rightarrow {V_D'}\), \(\widehat{A}:\hat{V} \rightarrow \hat{V}'\), \(S:\hat{V}\rightarrow V_D'\) and \(\widehat{D}:\hat{V}\rightarrow \hat{V}'\) such that, for any \(u \in {V_D}, ~\check{u} \in \hat{V}: \gamma _{_{\Gamma }}u=\mathcal {E}_{_{\Gamma }}\check{u}\), \(\hat{u} \in \hat{V}\), \(\hat{\psi }_{_\Sigma },\hat{\psi }_{_D}\in \hat{V}\):

$$\begin{aligned} \begin{aligned}&\left\langle Au,v\right\rangle _{{V_D'},{V_D}}=({K}\nabla u, \nabla v)_{{L^2(D)}}+\left( {|\Gamma (\cdot )|}\beta \check{u},\check{v}\right) _{L^2(\Lambda )} \\&v \in {V_D}, ~\check{v} \in \hat{V}: \gamma _{_{\Gamma }}v=\mathcal {E}_{_{\Gamma }}\check{v} \end{aligned} \end{aligned}$$
(18)
$$\begin{aligned} \left\langle \widehat{A}\hat{u},\hat{v}\right\rangle _{\hat{V}',\hat{V}}=\Big ({\tilde{K}}{|\Sigma (\cdot )|}\frac{d\hat{u}}{ds},\frac{d\hat{v}}{ds}\Big )_{L^2(\Lambda )}+\left( {|\Gamma (\cdot )|}\beta \hat{u},\hat{v}\right) _{L^2(\Lambda )}\quad \hat{v} \in \hat{V} \end{aligned}$$
(19)
$$\begin{aligned} \left\langle S \hat{\psi }_{_\Sigma },v \right\rangle _{V_D',V_D}=({|\Gamma (\cdot )|}\beta \hat{\psi }_{_\Sigma },\check{v})_{L^2(\Lambda )} \quad v \in {V_D}, ~\check{v} \in \hat{V} :\gamma _{_{\Gamma }}v=\mathcal {E}_{_{\Gamma }}\check{v} \end{aligned}$$
(20)
$$\begin{aligned} \left\langle \widehat{D} \hat{\psi }_{_D},\hat{v} \right\rangle _{\hat{V}',\hat{V}}=({|\Gamma (\cdot )|} \beta \hat{\psi }_{_D},\hat{v})_{L^2(\Lambda )} \quad \hat{v} \in \hat{V}. \end{aligned}$$
(21)

The respective adjoints will be denoted as \(A^*: {V_D} \rightarrow {V_D'}\), \(\widehat{A}^*:\hat{V} \rightarrow \hat{V}'\), \(S:V_D \rightarrow \hat{V}'\) and \(\widehat{D}^*:\hat{V} \rightarrow \hat{V}'\). If we further define

$$\begin{aligned} F\in {V_D'} \text { s.t. } F(v)=(f,v)_{{L^2(D)}}, \quad v \in {V_D} \end{aligned}$$
(22)
$$\begin{aligned} G\in \hat{V}' \text { s.t. }G(\hat{v})=({|\Sigma (\cdot )|}\overline{\overline{g}},\hat{v})_{L^2(\Lambda )}, \quad \hat{v} \in \hat{V}, \end{aligned}$$
(23)

equations (13)-(14) can be written as:

$$\begin{aligned} Au-S\hat{\psi }_{_\Sigma }=F \end{aligned}$$
(24)
$$\begin{aligned} \widehat{A}\hat{u}-\widehat{D}\hat{\psi }_{_D}=G. \end{aligned}$$
(25)

Finally, the PDE-constrained optimization problem can be written as

$$\begin{aligned} \min _{\hat{\psi }_{_D},\hat{\psi }_{_\Sigma }\in \hat{V}}J(\hat{\psi }_{_D},\hat{\psi }_{_\Sigma }) \text { subject to } (24) - (25) \end{aligned}$$
(26)

We now provide some results on the optimal control and the stepsize of the steepest descent method for Problem (26).

Proposition 1

Let us consider the trace operator \(\gamma _{_\Gamma }:{V_D}\rightarrow \mathcal {H}^{\Gamma }\) and the extension operators \(\mathcal {E}_{_\Sigma }:\hat{V} \rightarrow \tilde{V}\) and \(\mathcal {E}_{_\Gamma }=\gamma _{_\Gamma }\circ \mathcal {E}_{_\Sigma }:\hat{V}\rightarrow \mathcal {H}^{\Gamma }\), whose respective adjoints are \(\gamma _{_\Gamma }^*:{\mathcal {H}^{\Gamma }}'\rightarrow {V_D'}\), \({\mathcal {E}_{_{\Sigma }}}^*:\tilde{V}'\rightarrow \hat{V}'\) and \(\mathcal {E}_{_{\Gamma }}^*:{\mathcal {H}^{\Gamma }}'\rightarrow \hat{V}'\) and let \(\Theta _{\hat{V}}:\hat{V}\rightarrow \hat{V}'\) and \(\Theta _{\mathcal {H}^{\Gamma }}:\mathcal {H}^{\Gamma }\rightarrow {\mathcal {H}^{\Gamma }}'\) be Riesz isomorphisms. Then the optimal control \((\hat{\psi }_{_D},\hat{\psi }_{_\Sigma })\) that provides the solution to (26) is such that

$$\begin{aligned} \Theta _{\hat{V}}^{-1}(\mathcal {E}_{_{\Gamma }}^*\Theta _{\mathcal {H}^{\Gamma }}(\mathcal {E}_{_{\Gamma }}\hat{\psi }_{_D}-\gamma _{_\Gamma }u(\hat{\psi }_{_\Sigma }))+\widehat{D}^*\hat{p})=0 \end{aligned}$$
(27)
$$\begin{aligned} \Theta _{\hat{V}}^{-1}(\mathcal {E}_{_{\Gamma }}^*\Theta _{\mathcal {H}^{\Gamma }}(\mathcal {E}_{_{\Gamma }}\hat{\psi }_{_\Sigma }-\mathcal {E}_{_{\Gamma }}\hat{u}(\hat{\psi }_{_D}))+S^*p)=0 \end{aligned}$$
(28)

where \(p \in {V_D}\) and \(\hat{p} \in \hat{V}\) are the solutions respectively to

$$\begin{aligned} A^*p=\gamma _{_\Gamma }^*\Theta _{\mathcal {H}^{\Gamma }}(\gamma _{_\Gamma }u(\hat{\psi }_{_\Sigma })-\mathcal {E}_{_{\Gamma }}\hat{\psi }_{_D}) \end{aligned}$$
(29)
$$\begin{aligned} \widehat{A}^* \hat{p}=\mathcal {E}_{_{\Gamma }}^*\Theta _{\mathcal {H}^{\Gamma }}(\mathcal {E}_{_{\Gamma }}\hat{u}(\hat{\psi }_{_D})-\mathcal {E}_{_{\Gamma }}\hat{\psi }_{_\Sigma }) \end{aligned}$$
(30)

Proof

Let us compute the Fréchet derivatives of J with respect to the control variables \(\hat{\psi }_{_D}\) and \(\hat{\psi }_{_\Sigma }\). To this end, we introduce the increments \(\delta \hat{\psi }_{_D}, \delta \hat{\psi }_{_\Sigma }\in \hat{V}\) and we recall that, for \(\star =D,\Sigma \), there exists \( \delta {\psi }_\star \in \mathcal {H}^{\Gamma }~:~\delta \psi _\star =\mathcal {E}_{_\Gamma }\delta \hat{ \psi }_\star \). We have:

$$\begin{aligned} \begin{aligned}&\frac{\partial J}{\partial \hat{\psi }_{_D}}\big (\hat{\psi }_{_D}+\delta \hat{\psi }_{_D},\hat{\psi }_{_\Sigma }\big ) =\left( \gamma _{_\Gamma }{u}(\hat{\psi }_{_\Sigma })-\psi _{_D},-\delta \psi _{_D}\right) _{\mathcal {H}^{\Gamma }}+\left( \gamma _{_\Gamma }\tilde{u}(\hat{\psi }_{_D})-\psi _{_\Sigma },\gamma _{_\Gamma }\tilde{u}(\delta \hat{\psi }_{_D})\right) _{\mathcal {H}^{\Gamma }}\\&=\left( \mathcal {E}_{_\Gamma }\hat{\psi }_{_D}-\gamma _{_\Gamma }u(\hat{\psi }_{_\Sigma }),\mathcal {E}_{_{\Gamma }}\delta \hat{\psi }_{_D}\right) _{\mathcal {H}^{\Gamma }}+\left( \gamma _{_{\Gamma }}\mathcal {E}_{_{\Sigma }}\hat{u}(\hat{\psi }_{_D})-\mathcal {E}_{_{\Gamma }}\hat{\psi }_{_\Sigma },\gamma _{_{\Gamma }}\mathcal {E}_{_{\Sigma }}\hat{u}(\delta \hat{\psi }_{_D}) \right) _{\mathcal {H}^{\Gamma }}=\\&=\left\langle \mathcal {E}_{_{\Gamma }}^*\Theta _{\mathcal {H}^{\Gamma }}(\mathcal {E}_{_{\Gamma }}\hat{\psi }_{_D}-\gamma _{_\Gamma }u(\hat{\psi }_{_\Sigma })),\delta \hat{\psi }_{_D}\right\rangle _{\hat{V}',\hat{V}}+\left\langle \mathcal {E}_{_{\Gamma }}^*\Theta _{\mathcal {H}^{\Gamma }}(\mathcal {E}_{_{\Gamma }}\hat{u}(\hat{\psi }_{_D})-\mathcal {E}_{_{\Gamma }}\hat{\psi }_{_\Sigma }),\hat{u}(\delta \hat{\psi }_{_D})\right\rangle _{\hat{V}',\hat{V}}\\&=\left\langle \mathcal {E}_{_{\Gamma }}^*\Theta _{\mathcal {H}^{\Gamma }}(\mathcal {E}_{_{\Gamma }}\hat{\psi }_{_D}-\gamma _{_\Gamma }u(\hat{\psi }_{_\Sigma })),\delta \hat{\psi }_{_D}\right\rangle _{\hat{V}',\hat{V}}+\left\langle \widehat{A}^*\hat{p},\widehat{A}^{-1}\widehat{D}\delta \hat{\psi }_{_D}\right\rangle _{\hat{V}',\hat{V}}=\\&=\left\langle \mathcal {E}_{_{\Gamma }}^*\Theta _{\mathcal {H}^{\Gamma }}(\mathcal {E}_{_{\Gamma }}\hat{\psi }_{_D}-\gamma _{_\Gamma }u(\hat{\psi }_{_\Sigma })),\delta \hat{\psi }_{_D}\right\rangle _{\hat{V}',\hat{V}} +\left\langle \widehat{D}^*\hat{p},\delta \hat{\psi }_{_D}\right\rangle _{{\hat{V}}',\hat{V}}=\\&=\left( \Theta _{\hat{V}}^{-1}(\mathcal {E}_{_{\Gamma }}^*\Theta _{\mathcal {H}^{\Gamma }}(\mathcal {E}_{_{\Gamma }}\hat{\psi }_{_D}-\gamma _{_\Gamma }u(\hat{\psi }_{_\Sigma }))+\widehat{D}^*\hat{p}),\delta \hat{\psi }_{_D}\right) _{{L^2(\Lambda )}}; \end{aligned} \end{aligned}$$
$$\begin{aligned} \begin{aligned}&\frac{\partial J}{\partial \hat{\psi }_{_\Sigma }}(\hat{\psi }_{_D},\hat{\psi }_{_\Sigma }+\delta \hat{\psi }_{_\Sigma })=\left( \gamma _{_\Gamma }{u}(\hat{\psi }_{_\Sigma })-\psi _{_D},\gamma _{_\Gamma }u(\delta \hat{\psi }_{_\Sigma })\right) _{\mathcal {H}^{\Gamma }}+\left( \gamma _{_\Gamma }\tilde{u}(\hat{\psi }_{_D})-\psi _{_\Sigma },-\delta \psi _{_\Sigma }\right) _{\mathcal {H}^{\Gamma }}\\&=\left\langle \gamma _{_{\Gamma }}^*\Theta _{\mathcal {H}^{\Gamma }}(\gamma _{_\Gamma }u(\hat{\psi }_{_\Sigma })-\mathcal {E}_{_{\Gamma }}\hat{\psi }_{_D}),u(\delta \hat{\psi }_{_\Sigma })\right\rangle _{V_D',V_D}+\left( \mathcal {E}_{_{\Gamma }}\hat{\psi }_{_\Sigma }-\gamma _{_\Gamma }\mathcal {E}_{_{\Sigma }}\hat{u}(\hat{\psi }_{_D}),\mathcal {E}_{_{\Gamma }}\delta \hat{\psi }_{_\Sigma }\right) _{\mathcal {H}^{\Gamma }}=\\&=\left\langle A^*p,A^{-1}S\delta \hat{\psi }_{_\Sigma }\right\rangle _{{V_D'},{V_D}}+\left\langle \mathcal {E}_{_{\Gamma }}^*\Theta _{\mathcal {H}^{\Gamma }}(\mathcal {E}_{_{\Gamma }}\hat{\psi }_{_\Sigma }-\mathcal {E}_{_{\Gamma }}\hat{u}(\hat{\psi }_{_D})),\delta \hat{\psi }_{_\Sigma }\right\rangle _{\hat{V}',\hat{V}}=\\&=\left\langle S^*p,\delta \hat{\psi }_{_\Sigma }\right\rangle _{{\hat{V}}',\hat{V}} +\left\langle \mathcal {E}_{_{\Gamma }}^*\Theta _{\mathcal {H}^{\Gamma }}(\mathcal {E}_{_{\Gamma }}\hat{\psi }_{_\Sigma }-\mathcal {E}_{_{\Gamma }}\hat{u}(\hat{\psi }_{_D})),\delta \hat{\psi }_{_\Sigma }\right\rangle _{\hat{V}',\hat{V}}=\\&=\left( \Theta _{\hat{V}}^{-1}(S^*p+\mathcal {E}_{_{\Gamma }}^*\Theta _{\mathcal {H}^{\Gamma }}(\mathcal {E}_{_{\Gamma }}\hat{\psi }_{_\Sigma }-\mathcal {E}_{_{\Gamma }}\hat{u}(\hat{\psi }_{_D})),\delta \hat{\psi }_{_\Sigma }\right) _{L^2(\Lambda )}, \end{aligned} \end{aligned}$$

which yield the thesis.

From the derivatives computed in Proposition 1, we now define the quantities

$$\begin{aligned} \delta \hat{\psi }_{_D}=\Theta _{\hat{V}}^{-1}(\mathcal {E}_{_{\Gamma }}^*\Theta _{\mathcal {H}^{\Gamma }}(\mathcal {E}_{_{\Gamma }}\hat{\psi }_{_D}-\gamma _{_\Gamma }u(\hat{\psi }_{_\Sigma }))+\widehat{D}^*\hat{p})\in \hat{V} \end{aligned}$$
(31)
$$\begin{aligned} \delta \hat{\psi }_{_\Sigma }=\Theta _{\hat{V}}^{-1}(\mathcal {E}_{_{\Gamma }}^*\Theta _{\mathcal {H}^{\Gamma }}(\mathcal {E}_{_{\Gamma }}\hat{\psi }_{_\Sigma }-\mathcal {E}_{_{\Gamma }}\hat{u}(\hat{\psi }_{_D}))+S^*p) \in \hat{V}. \end{aligned}$$
(32)

Then the following proposition holds:

Proposition 2

Given the variable \(\mathcal {X}\), let us increment it by a step \(\zeta \delta \mathcal {X}\), where \(\delta \mathcal {X}=(\delta \hat{\psi }_{_D}, \delta \hat{\psi }_{_\Sigma })\). The steepest descent method corresponds to the stepsize \(\zeta =-\frac{\mathcal {N}}{\mathcal {D}}\) with

$$\begin{aligned} \begin{aligned} \mathcal {N}=&\left( \delta \hat{\psi }_{_D},\delta \hat{\psi }_{_D}\right) _{L^2(\Lambda )}+\left( \delta \hat{\psi }_{_\Sigma },\delta \hat{\psi }_{_\Sigma }\right) _{L^2(\Lambda )}\\ \mathcal {D}=&\left\langle S\delta \hat{\psi }_{_\Sigma },\delta p \right\rangle _{{V_D'},{V_D}}-\left\langle \mathcal {E}_{_{\Gamma }}^*\Theta _{\mathcal {H}^{\Gamma }}(\gamma _{_{\Gamma }}\delta u\!-\!\mathcal {E}_{_{\Gamma }}\delta \hat{\psi }_{_D}),\delta \hat{\psi }_{_D}\right\rangle _{\hat{V}',\hat{V}}\!+\!\left\langle \widehat{D}\delta \hat{\psi }_{_D},\delta \hat{p} \right\rangle _{\hat{V}',\hat{V}}\!+\!\\ {}&-\left\langle \mathcal {E}_{_{\Gamma }}^*\Theta _{\mathcal {H}^{\Gamma }}(\mathcal {E}_{_{\Gamma }}\delta \hat{u}-\mathcal {E}_{_{\Gamma }}\delta \hat{\psi }_{_\Sigma }),\delta \hat{\psi }_{_\Sigma }\right\rangle _{\hat{V}',\hat{V}} \end{aligned} \end{aligned}$$

and where

$$\begin{aligned} \begin{aligned}&\delta u=u(\delta \hat{\psi }_{_\Sigma })=A^{-1}S\delta \hat{\psi }_{_\Sigma }\in {V_D},\\&\delta \hat{u}=\hat{u}(\delta \hat{\psi }_{_D})=\widehat{A}^{-1}\widehat{D}\delta \hat{\psi }_{_D}\in \hat{V} \end{aligned} \end{aligned}$$

and \(\delta p \in {V_D}\), \(\delta \hat{p} \in \hat{V}\) are such that:

$$\begin{aligned} \begin{aligned}&A^*\delta p=\gamma _{_\Gamma }^*\Theta _{\mathcal {H}^{\Gamma }}(\gamma _{_\Gamma }\delta u-\mathcal {E}_{_{\Gamma }}\delta \hat{\psi }_{_D})\\&\widehat{A}^* \delta \hat{p}=\mathcal {E}_{_{\Gamma }}^*\Theta _{\mathcal {H}^{\Gamma }}(\mathcal {E}_{_{\Gamma }}\delta \hat{u}-\mathcal {E}_{_{\Gamma }}\delta \hat{\psi }_{_\Sigma }) \end{aligned} \end{aligned}$$

Proof

It is sufficient to set to zero the derivative \(\frac{\partial J(\mathcal {X}+\zeta \delta \mathcal {X})}{\partial \zeta }\). In the computation that follows we adopt the lighter notation:

$$\begin{aligned} u=u(\hat{\psi }_{_\Sigma });~~\delta u=u(\delta \hat{\psi }_{_\Sigma });\qquad \hat{u}=\hat{u}(\hat{\psi }_{_D});~~\delta \hat{u}=\hat{u}(\delta \hat{\psi }_{_D}). \end{aligned}$$
$$\begin{aligned} \begin{aligned}&J(\mathcal {X}+\zeta \delta \mathcal {X})=J(\hat{\psi }_{_D}+\zeta \delta \hat{\psi }_{_D},\hat{\psi }_{_\Sigma }+\zeta \delta \hat{\psi }_{_\Sigma })=\\&=\frac{1}{2}\left( \gamma _{_\Gamma }u(\hat{\psi }_{_\Sigma }+\zeta \delta \hat{\psi }_{_\Sigma })-\psi _{_D}-\zeta \delta \psi _{_D},\gamma _{_\Gamma }u(\hat{\psi }_{_\Sigma }+\zeta \delta \hat{\psi }_{_\Sigma })-\psi _{_D}-\zeta \delta \psi _{_D}\right) _{\mathcal {H}^{\Gamma }}\\&+\frac{1}{2}\left( \gamma _{_\Gamma }\tilde{u}(\hat{\psi }_{_D}+\zeta \delta \hat{\psi }_{_D})-\psi _{_\Sigma }-\zeta \delta \psi _{_\Sigma },\gamma _{_\Gamma }\tilde{u}(\hat{\psi }_{_D}+\zeta \delta \hat{\psi }_{_D})-\psi _{_\Sigma }-\zeta \delta \psi _{_\Sigma }\right) _{\mathcal {H}^{\Gamma }}=\\&=\frac{1}{2}\left( \gamma _{_\Gamma } u+\zeta \gamma _{_\Gamma }\delta u-\mathcal {E}_{_{\Gamma }}\hat{\psi }_{_D}-\zeta \mathcal {E}_{_{\Gamma }}\delta \hat{\psi }_{_D},\gamma _{_\Gamma }u+\zeta \gamma _{_\Gamma }\delta u-\mathcal {E}_{_{\Gamma }}\hat{\psi }_{_D}-\zeta \mathcal {E}_{_{\Gamma }}\delta \hat{\psi }_{_D}\right) _{\mathcal {H}^{\Gamma }}+\\&+\frac{1}{2}\left( \gamma _{_\Gamma }\mathcal {E}_{_{\Sigma }}\hat{u}+\zeta \gamma _{_\Gamma }\mathcal {E}_{_{\Sigma }}\delta \hat{u}-\mathcal {E}_{_{\Gamma }}\hat{\psi }_{_\Sigma }-\zeta \mathcal {E}_{_{\Gamma }}\delta \hat{\psi }_{_\Sigma },\gamma _{_\Gamma }\mathcal {E}_{_{\Sigma }}\hat{u}+\zeta \gamma _{_\Gamma }\mathcal {E}_{_{\Sigma }}\delta \hat{u}-\mathcal {E}_{_{\Gamma }}\hat{\psi }_{_\Sigma }-\zeta \mathcal {E}_{_{\Gamma }}\delta \hat{\psi }_{_\Sigma }\right) _{\mathcal {H}^{\Gamma }}\\&=J(\hat{\psi }_{_D},\hat{\psi }_{_\Sigma })+\zeta \left( \gamma _{_\Gamma }u-\mathcal {E}_{_{\Gamma }}\hat{\psi }_{_D},\gamma _{_\Gamma }\delta u-\mathcal {E}_{_{\Gamma }}\delta \hat{\psi }_{_D}\right) _{\mathcal {H}^{\Gamma }}+\zeta \left( \mathcal {E}_{_{\Gamma }}(\hat{u}-\hat{\psi }_{_\Sigma }),\mathcal {E}_{_{\Gamma }}(\delta \hat{u}-\delta \hat{\psi }_{_\Sigma })\right) _{\mathcal {H}^{\Gamma }}\\&+ \frac{\zeta ^2}{2}\left( \gamma _{_\Gamma }\delta u-\mathcal {E}_{_{\Gamma }}\delta \hat{\psi }_{_D},\gamma _{_\Gamma }\delta u-\mathcal {E}_{_{\Gamma }}\delta \hat{\psi }_{_D}\right) _{\mathcal {H}^{\Gamma }}+\frac{\zeta ^2}{2}\left( \mathcal {E}_{_{\Gamma }}(\delta \hat{u}-\delta \hat{\psi }_{_\Sigma }),\mathcal {E}_{_{\Gamma }}(\delta \hat{u}-\delta \hat{\psi }_{_\Sigma })\right) _{\mathcal {H}^{\Gamma }} \end{aligned} \end{aligned}$$
$$\begin{aligned} \begin{aligned}&\frac{\partial J(\mathcal {X}+\zeta \delta \mathcal {X})}{\partial \zeta }=\left( \gamma _{_\Gamma }u-\mathcal {E}_{_{\Gamma }}\hat{\psi }_{_D},\gamma _{_\Gamma }\delta u-\mathcal {E}_{_{\Gamma }}\delta \hat{\psi }_{_D}\right) _{\mathcal {H}^{\Gamma }}+\left( \mathcal {E}_{_{\Gamma }}(\hat{u}-\hat{\psi }_{_\Sigma }),\mathcal {E}_{_{\Gamma }}(\delta \hat{u}-\delta \hat{\psi }_{_\Sigma })\right) _{\mathcal {H}^{\Gamma }}+\\&\quad +\zeta \left( \gamma _{_\Gamma }\delta u-\mathcal {E}_{_{\Gamma }}\delta \hat{\psi }_{_D},\gamma _{_\Gamma }\delta u-\mathcal {E}_{_{\Gamma }}\delta \hat{\psi }_{_D}\right) _{\mathcal {H}^{\Gamma }}+\zeta \left( \mathcal {E}_{_{\Gamma }}(\delta \hat{u}-\delta \hat{\psi }_{_\Sigma }),\mathcal {E}_{_{\Gamma }}(\delta \hat{u}-\delta \hat{\psi }_{_\Sigma })\right) _{\mathcal {H}^{\Gamma }}=0 \end{aligned} \end{aligned}$$
$$\begin{aligned} \begin{aligned} \Rightarrow ~\zeta =-\frac{\left( \gamma _{_\Gamma }u-\mathcal {E}_{_{\Gamma }}\hat{\psi }_{_D},\gamma _{_\Gamma }\delta u-\mathcal {E}_{_{\Gamma }}\delta \hat{\psi }_{_D}\right) _{\mathcal {H}^{\Gamma }}+\left( \mathcal {E}_{_{\Gamma }}\hat{u}-\mathcal {E}_{_{\Gamma }}\hat{\psi }_{_\Sigma },\mathcal {E}_{_{\Gamma }}\delta \hat{u}-\mathcal {E}_{_{\Gamma }}\delta \hat{\psi }_{_\Sigma }\right) _{\mathcal {H}^{\Gamma }}}{\left( \gamma _{_\Gamma }\delta u-\mathcal {E}_{_{\Gamma }}\delta \hat{\psi }_{_D},\gamma _{_\Gamma }\delta u-\mathcal {E}_{_{\Gamma }}\delta \hat{\psi }_{_D}\right) _{\mathcal {H}^{\Gamma }}+\left( \mathcal {E}_{_{\Gamma }}\delta \hat{u}-\mathcal {E}_{_{\Gamma }}\delta \hat{\psi }_{_\Sigma },\mathcal {E}_{_{\Gamma }}\delta \hat{u}-\mathcal {E}_{_{\Gamma }}\delta \hat{\psi }_{_\Sigma }\right) _{\mathcal {H}^{\Gamma }}} \end{aligned} \end{aligned}$$

Rearranging properly the terms we get \(\zeta =-\frac{\mathcal {N}}{\mathcal {D}}\) with

$$\begin{aligned} \begin{aligned} \mathcal {N}&=\left\langle A^*p,A^{-1}S\delta \hat{\psi }_{_\Sigma }\right\rangle _{{V_D'},{V_D}}-\left\langle \mathcal {E}_{_{\Gamma }}^*\Theta _{\mathcal {H}^{\Gamma }}(\gamma _{_{\Gamma }}u-\mathcal {E}_{_{\Gamma }}\hat{\psi }_{_D}),\delta \hat{\psi }_{_D}\right\rangle _{\hat{V}',\hat{V}}+\\&\qquad +\left\langle \widehat{A}^*\hat{p},\widehat{A}^{-1}\widehat{D}\delta \hat{\psi }_{_D}\right\rangle _{\hat{V}',\hat{V}}-\left\langle \mathcal {E}_{_{\Gamma }}^*\Theta _{\mathcal {H}^{\Gamma }}(\mathcal {E}_{_{\Gamma }}\hat{u}-\mathcal {E}_{_{\Gamma }}\hat{\psi }_{_\Sigma }),\delta \hat{\psi }_{_\Sigma }\right\rangle _{\hat{V}',\hat{V}}=\\&=\left\langle S^*p,\delta \hat{\psi }_{_\Sigma }\right\rangle _{{\hat{V}}',\hat{V}}-\left\langle \mathcal {E}_{_{\Gamma }}^*\Theta _{\mathcal {H}^{\Gamma }}(\gamma _{_{\Gamma }}u-\mathcal {E}_{_{\Gamma }}\hat{\psi }_{_D}),\delta \hat{\psi }_{_D}\right\rangle _{\hat{V}',\hat{V}}+\left\langle \widehat{D}^*\hat{p},\delta \hat{\psi }_{_D}\right\rangle _{{\hat{V}}',\hat{V}}+\\&\qquad -\left\langle \mathcal {E}_{_{\Gamma }}^*\Theta _{\mathcal {H}^{\Gamma }}(\mathcal {E}_{_{\Gamma }}\hat{u}-\mathcal {E}_{_{\Gamma }}\hat{\psi }_{_\Sigma }),\delta \hat{\psi }_{_\Sigma }\right\rangle _{\hat{V}',\hat{V}}=\\&=\left( \delta \hat{\psi }_{_D},\delta \hat{\psi }_{_D}\right) _{L^2(\Lambda )}+\left( \delta \hat{\psi }_{_\Sigma },\delta \hat{\psi }_{_\Sigma }\right) _{L^2(\Lambda )} \end{aligned} \end{aligned}$$

and

$$\begin{aligned} \begin{aligned} \mathcal {D}&=\left\langle A^{^{-1}}S\delta \hat{\psi }_{_\Sigma },A^{^*}\delta p\right\rangle _{{V_D},{V_D'}}-\left\langle \mathcal {E}_{_{\Gamma }}^*\Theta _{\mathcal {H}^{\Gamma }}(\gamma _{_{\Gamma }}\delta u-\mathcal {E}_{_{\Gamma }}\delta \hat{\psi }_{_D}),\delta \hat{\psi }_{_D}\right\rangle _{\hat{V}',\hat{V}}+\\&\quad +\left\langle \widehat{A}^{^{-1}}\widehat{D}\delta \hat{\psi }_{_D},\widehat{A}^*\delta \hat{p}\right\rangle _{\hat{V},\hat{V}'} -\left\langle \mathcal {E}_{_{\Gamma }}^*\Theta _{\mathcal {H}^{\Gamma }}(\mathcal {E}_{_{\Gamma }}\delta \hat{u}-\mathcal {E}_{_{\Gamma }}\delta \hat{\psi }_{_\Sigma }),\delta \hat{\psi }_{_\Sigma }\right\rangle _{\hat{V}',\hat{V}}=\\&=\left\langle S\delta \hat{\psi }_{_\Sigma },\delta p \right\rangle _{{V_D'},{V_D}}-\left\langle \mathcal {E}_{_{\Gamma }}^*\Theta _{\mathcal {H}^{\Gamma }}(\gamma _{_{\Gamma }}\delta u-\mathcal {E}_{_{\Gamma }}\delta \hat{\psi }_{_D}),\delta \hat{\psi }_{_D}\right\rangle _{\hat{V}',\hat{V}}+\left\langle \widehat{D}\delta \hat{\psi }_{_D},\delta \hat{p} \right\rangle _{\hat{V}',\hat{V}}+\\&\quad -\left\langle \mathcal {E}_{_{\Gamma }}^*\Theta _{\mathcal {H}^{\Gamma }}(\mathcal {E}_{_{\Gamma }}\delta \hat{u}-\mathcal {E}_{_{\Gamma }}\delta \hat{\psi }_{_\Sigma }),\delta \hat{\psi }_{_\Sigma }\right\rangle _{\hat{V}',\hat{V}} \end{aligned} \end{aligned}$$

that yields the thesis.

5 Discrete matrix formulation

In this section we work out the discrete matrix formulation of problem (26). In general, the 3D-1D coupling does not present particular issues in the discrete framework. Nonetheless our approach has the additional advantage of allowing for the use of non conforming meshes: thanks to the optimization framework, the partitions of the 1D inclusions can be defined in a completely independent manner from the surrounding 3D mesh, without any theoretical or practical constraint on mesh sizes. Further, the proposed formulation provides the direct computation of interface variables, and it allows to decouple the 3D problem from the 1D problems, thus paving the way to the use of possibly different constitutive equations and to the application of efficient solvers based on parallel computing techniques.

For the sake of generality, we consider \(\mathcal {I}\) segments of different length and orientation crossing the domain \(\Omega \). The segments are defined as \(\Lambda _i=\left\{ \varvec{\lambda }_i(s),s \in (0, S_i)\right\} \), \(i=1,...,\mathcal {I}\) and they represent the centerlines of \(\mathcal {I}\) cylindrical inclusions \(\Sigma _i\).

The proposed approach can easily handle intersections among inclusions centrelines. Intersecting segments are split into sub-segments in correspondence of their intersection point q. In this way, q always corresponds to a segment endpoint, in which pressure continuity and flux conservation are constrained. It is to remark that a variety of intersection modes is possible for the original three dimensional inclusions. As an example, 3D inclusions might partially overlap whereas the corresponding centrelines might not intersect. By considering here only intersections between centrelines, we implicitly assume that the intersection volume of the corresponding three dimensional inclusions is small and can be reduced to a point in the scale of the domain. A deeper investigation on the treatment of different intersection models is out of the scope of the present work.

After having extended the domain D to the whole \(\Omega \), let us consider a tetrahedral mesh \(\mathcal {T}\) of domain \(\Omega \), on which we define Lagrangian finite element basis functions \(\left\{ \varphi _k \right\} _{k=1}^{N}\), such that \(U=\sum _{k=1}^{N}U_k\varphi _k\) is the discrete approximation of pressure u. On each segment \(\Lambda _i\) we build three different partitions, independent from each other and from \(\mathcal {T}\). We denote them by \(\hat{\mathcal {T}_i}\), \(\tau ^{D}_i\) and \(\tau ^{\Sigma }_i\) and we define the basis functions \(\left\{ \hat{\varphi }_{i,k} \right\} _{k=1}^{\hat{N}_i}\) on \(\hat{\mathcal {T}_i}\), \(\left\{ \theta _{i,k}^D\right\} _{k=1}^{N_i^{D}}\) on \(\tau ^{D}_i\) and \(\left\{ \theta _{i,k}^\Sigma \right\} _{k=1}^{N_i^{\Sigma }}\) on \(\tau ^{\Sigma }_i\), with \(\hat{N}_i\), \(N_i^{D}\) and \(N_i^{\Sigma }\) denoting the number of DOFs of the discrete approximations of the variables \(\hat{u}_i\), \(\hat{\psi }_{_D,i}\) and \(\hat{\psi }_{_\Sigma ,i}\) respectively. Such approximations are defined as

$$\begin{aligned} \hat{U}_i=\sum _{k=1}^{\hat{N}_i}\hat{U}_{i,k}~\hat{\varphi }_{i,k}, \quad \Psi ^D_i=\sum _{k=1}^{N_i^{D}}\Psi _{i,k}^D~\theta _{i,k}^D, \quad \Psi ^\Sigma _i=\sum _{k=1}^{N_i^{\Sigma }}\Psi _{i,k}^\Sigma ~\theta _{i,k}^\Sigma . \end{aligned}$$

We then define the following matrices:

$$\begin{aligned} \begin{aligned}&\varvec{A} \in \mathbb {R}^{N\times N} \text { s.t. } (A)_{kl}=\int _{\Omega }K\nabla \varphi _k\nabla \varphi _l ~d\omega +\sum _{i=1}^{\mathcal {I}}\int _{\Lambda _i}\beta _i|\Gamma _i(s)|{\varphi _k}_{|_{\Lambda _i}}{\varphi _l}_{|_{\Lambda _i}} ds\\&\varvec{\hat{A}_i} \in \mathbb {R}^{\hat{N}_i\times \hat{N}_i} \text { s.t. } (\hat{A}_i)_{kl}=\int _{\Lambda _i}\tilde{K}_i|\Sigma _i(s)|\frac{d\hat{\varphi }_{i,k}}{ds}\frac{d\hat{\varphi }_{i,l}}{ds} ~ds+\int _{\Lambda _i}\beta _i|\Gamma _i(s)|\hat{\varphi }_{i,k}\hat{\varphi }_{i,l}~ds \end{aligned} \end{aligned}$$
$$\begin{aligned} \begin{aligned}&\varvec{\hat{D}_i}^{\beta } \in \mathbb {R}^{\hat{N}_i\times N_i^{D}} \text { s.t. } (\hat{D}_i^\beta )_{kl}=\int _{\Lambda _i}\beta _i|\Gamma _i(s)|{\hat{\varphi }_{i,k}~\theta _{i,l}^D}~ds\\&\varvec{S_i}^{\beta } \in \mathbb {R}^{N\times N_i^{\Sigma }} \text { s.t. } (S_i^{\beta })_{kl}=\int _{\Lambda _i}\beta _i|\Gamma _i(s)|{\varphi _k}_{|_{\Lambda _i}}\theta _{i,l}^{\Sigma }~ds, \end{aligned} \end{aligned}$$

and the vectors

$$\begin{aligned} f\in \mathbb {R}^N \text { s.t. } f_k=\int _{\Omega }f\varphi _k~d\omega ,\qquad \qquad g_i\in \mathbb {R}^{\hat{N}_i} \text { s.t. } (g_i)_k=\int _{\Lambda _i}|\Sigma _i(s)|\overline{\overline{g}}~\hat{\varphi }_{i,k}~ds. \end{aligned}$$

Setting \(\hat{N}=\sum _{i=1}^{\mathcal {I}}\hat{N}_i\), \(N_D=\sum _{i=1}^{\mathcal {I}}N_i^{D}\) and \(N_\Sigma =\sum _{i=1}^{\mathcal {I}}\ N_i^{\Sigma }\), we can group the matrices as follows:

$$\begin{aligned} \begin{aligned} \varvec{\hat{D}}^{\beta }=\text {diag}\left( \varvec{\hat{D}_1}^{\beta },...,\varvec{\hat{D}_{\mathcal {I}}^{\beta }}\right) \in \mathbb {R}^{\hat{N}\times N_D} \qquad \varvec{S}^{\beta }=\left[ \varvec{S_1}^{\beta }, \varvec{S_2}^{\beta },...,\varvec{S_{\mathcal {I}}}^{\beta }\right] \in \mathbb {R}^{N\times N_\Sigma } \end{aligned} \end{aligned}$$

and

$$\begin{aligned} \varvec{\hat{A}}=\left[ \begin{array}{cc} \text {diag}\left( \varvec{\hat{A}_1},...,\varvec{\hat{A}_{\mathcal {I}}}\right) &{} \varvec{Q}^T\\ \varvec{Q} &{} \varvec{0} \end{array}\right] =\left[ \begin{array}{cc} \varvec{\hat{A}^{\sharp }} &{} \varvec{Q}^T\\ \varvec{Q} &{} \varvec{0} \end{array} \right] \end{aligned}$$

where matrix \(\varvec{Q}\) simply equates the DOFs at the extrema of connected sub-segments and allow us to enforce continuity through Lagrange multipliers. Let us observe how \(\varvec{\hat{A}}=\varvec{\hat{A}^\sharp }\) in case no intersections occur among segments. Finally we can write

$$\begin{aligned} \varvec{A}U-\varvec{S}^\beta \Psi _{\Sigma }=f \end{aligned}$$
(33)
$$\begin{aligned} \varvec{\hat{A}}\hat{U}-\varvec{\hat{D}}^\beta \Psi _{D}=g \end{aligned}$$
(34)

with

$$\begin{aligned} \begin{aligned}&\hat{U}=\left[ \hat{U}_1^T,...,\hat{U}_{\mathcal {I}}^T \right] ^T \in \mathbb {R}^{\hat{N}}; \quad g=[g_1^T,g_2^T,...,g_{\mathcal {I}}^T]^T\in \mathbb {R}^{\hat{N}}\\&\Psi _D=\left[ (\Psi _1^D)^T,...,(\Psi _\mathcal {I}^D)^T \right] ^T \in \mathbb {R}^{N_D}; \quad \Psi _\Sigma =\left[ (\Psi _1^\Sigma )^T,...,(\Psi _\mathcal {I}^\Sigma )^T \right] ^T\in \mathbb {R}^{N_\Sigma }. \end{aligned} \end{aligned}$$

The discrete functional is derived from (17) replacing the norms in \(\mathcal {H}^{\Gamma }\) with norms in \(L^2(\Lambda )\) and summing over the \(\mathcal {I}\) inclusions. First we define matrices

$$\begin{aligned} \begin{aligned}&\varvec{G_i} \in \mathbb {R}^{N \times N} \text { s.t. } (G_i)_{kl}=\int _{\Lambda _i}{\varphi _k}_{|_{\Lambda _i}}{\varphi _l}_{|_{\Lambda _i}}ds,\\&\varvec{\hat{G}_i} \in \mathbb {R}^{\hat{N}_i \times \hat{N}_i} \text { s.t. } (\hat{G}_i)_{kl}=\int _{\Lambda _i}{\hat{\varphi }}_{i,k}~{\hat{\varphi }}_{i,l}~ds,\\&\varvec{{M}_i^{D}} \in \mathbb {R}^{N_i^{D} \times N_i^{D}} \text { s.t. } ({M}_i^{D})_{kl}=\int _{\Lambda _i}\theta _{i,k}^D~\theta _{i,l}^D~ds,\\&\varvec{{M}_i^{\Sigma }} \in \mathbb {R}^{N_i^{\Sigma } \times N_i^{\Sigma }} \text { s.t. } ({M}_i^{\Sigma })_{kl}=\int _{\Lambda _i}\theta _{i,k}^\Sigma ~\theta _{i,l}^\Sigma ~ds,\\&\varvec{D_i} \in \mathbb {R}^{N\times N_i^{D}} \text { s.t. } (D_i)_{kl}=\int _{\Lambda _i}{{\varphi _{k}}_{|_{\Lambda _i}}\theta _{i,l}^D}~ds,\\ {}&\varvec{\hat{S}_i} \in \mathbb {R}^{\hat{N}_i\times N_i^{\Sigma }} \text { s.t. } (\hat{S_i})_{kl}=\int _{\Lambda _i}{\hat{\varphi }}_{i,k}~\theta _{i,l}^\Sigma ~ds, \end{aligned} \end{aligned}$$

and then

$$\begin{aligned} \varvec{G}=\sum _{i=1}^{\mathcal {I}}\varvec{G}_i \in \mathbb {R}^{N \times N} \qquad \varvec{\hat{G}}=\text {diag}\left( \varvec{\hat{G}_1},...,\varvec{\hat{G}_{\mathcal {I}}}\right) \in \mathbb {R}^{\hat{N} \times \hat{N}} \end{aligned}$$
$$\begin{aligned} \varvec{M^D}\!=\!\text {diag}\left( \varvec{M_1^{D}},...,\varvec{M_{\mathcal {I}}^{D}} \right) \in \mathbb {R}^{N_{D}\times N_{D}}, \qquad \varvec{M^{\Sigma }}\!=\!\text {diag}\left( \varvec{M_1^{\Sigma }},...,\varvec{M_{\mathcal {I}}^{\Sigma }} \right) \in \mathbb {R}^{N_{\Sigma }\times N_{\Sigma }} \end{aligned}$$
$$\begin{aligned} \varvec{D}=\left[ \varvec{D_1}, \varvec{D_2},...,\varvec{D_{\mathcal {I}}}\right] \in \mathbb {R}^{N\times N_D} \qquad \varvec{\hat{S}}=\text {diag}\left( \varvec{\hat{S}_1},...,\varvec{\hat{S}_{\mathcal {I}}}\right) \in \mathbb {R}^{\hat{N}\times N_\Sigma } \end{aligned}$$

The discrete cost functional then reads:

$$\begin{aligned} \begin{aligned} \tilde{J}=\frac{1}{2}\Big ( U^T&\varvec{G}U-U^T\varvec{D}\Psi _D-\Psi _D^T\varvec{D}^TU+\Psi _D^T\varvec{M^D}\Psi _D+\\&+\hat{U}^T\varvec{\hat{G}}\hat{U}-\hat{U}^T\varvec{\hat{S}}\Psi _\Sigma -\Psi _\Sigma ^T\varvec{\hat{S}}^T\hat{U}+\Psi _\Sigma ^T\varvec{M^\Sigma }\Psi _\Sigma \Big ) \end{aligned} \end{aligned}$$
(35)

Finally, the discrete matrix formulation of the 3D-1D problem can be written as:

$$\begin{aligned} \min _{(\Psi _D,\Psi _\Sigma )}\tilde{J}(\Psi _D,\Psi _\Sigma ) \text { subject to } (33)-(34) \end{aligned}$$
(36)

We remark that the above derivation of the matrices for the discrete problem requires, first, to compute the intersections between the segments and the elements of the 3D mesh. This process can be performed very efficiently by exploiting information on cell neighborhood. Once such intersections are computed, line integrals are evaluated using composite 1D quadrature rules and, finally, standard assembly operations for finite elements matrices are performed. No modifications of mesh element vertices nor of segment points is required, and each segment can be processed independently from the others. The entire process also applies to higher order discretizations.

First order optimality conditions for problem (36) are collected in the saddle-point system

$$\begin{aligned} \varvec{\mathcal {K}}\hspace{-0.12cm}=\hspace{-0.12cm} \begin{bmatrix} \varvec{G} &{} \varvec{0} &{} -\varvec{D} &{} \varvec{0} &{}\varvec{A}^T &{}\varvec{0} \\ \varvec{0} &{} \varvec{\hat{G}} &{} \varvec{0} &{}-\varvec{\hat{S}} &{}\varvec{0} &{}\varvec{\hat{A}}^T \\ -\varvec{D}^T &{} \varvec{0} &{} \varvec{M^D} &{} \varvec{0} &{} \varvec{0} &{} (-\varvec{{\hat{D}}^{\beta }})^T \\ \varvec{0} &{}-\varvec{\hat{S}}^T &{} \varvec{0} &{} \varvec{M^\Sigma } &{} (-\varvec{S^\beta })^T &{}\varvec{0}\\ \varvec{A} &{} \varvec{0} &{} \varvec{0} &{} -\varvec{S^\beta } &{}\varvec{0} &{}\varvec{0}\\ \varvec{0} &{}\varvec{\hat{A}} &{} -\varvec{{\hat{D}}^{\beta }} &{} \varvec{0} &{} \varvec{0} &{}\varvec{0} \end{bmatrix}\hspace{-0.12cm}; \quad \varvec{\mathcal {K}} \begin{bmatrix} U\\ \hat{U}\\ \Psi _D \\ \Psi _\Sigma \\ -P\\ -\hat{P} \end{bmatrix}\hspace{-0.15cm}=\hspace{-0.15cm}\begin{bmatrix} 0 \\ 0 \\ 0 \\ 0 \\ f \\ g \end{bmatrix} \end{aligned}$$
(37)

Proposition 3

Matrix \(\varvec{\mathcal {K}}\) in (37) is non-singular and the unique solution of (37) is equivalent to the solution of the optimization problem (36).

The following lemma is used to prove Proposition 3.

Lemma 1

Let matrix \(\varvec{\mathcal {A}}\in \mathbb {R}^{(N+\hat{N})\times (N+\hat{N}+N_D+N_\Sigma )}\) be as

$$\begin{aligned} \varvec{\mathcal {A}}= \begin{bmatrix} \varvec{A} &{} ~\varvec{0} &{} \varvec{0} &{} -\varvec{S^\beta }\\ \varvec{0} &{} ~\varvec{\hat{A}} &{} -\varvec{{\hat{D}}^{\beta }} &{} \varvec{0} \end{bmatrix} \end{aligned}$$

and let \(\varvec{\mathcal {G}}\in \mathbb {R}^{(N+\hat{N}+N_D+N_\Sigma )\times (N+\hat{N}+N_D+N_\Sigma )}\) be defined as

$$\begin{aligned} \varvec{\mathcal {G}}= \begin{bmatrix} \varvec{G} &{} \varvec{0} &{} -\varvec{D} &{} \varvec{0}\\ \varvec{0} &{} \varvec{\hat{G}} &{} \varvec{0} &{}-\varvec{\hat{S}} \\ -\varvec{D}^T &{} \varvec{0} &{} \varvec{M^D} &{} \varvec{0} \\ \varvec{0} &{}-\varvec{\hat{S}}^T &{} \varvec{0} &{} \varvec{M^\Sigma } \end{bmatrix}. \end{aligned}$$

Then matrix \(\varvec{\mathcal {A}}\) is full rank and matrix \(\varvec{\mathcal {G}}\) is symmetric positive definite on \(\ker (\varvec{\mathcal {A}})\).

Proof

Let us denote the discrete approximation spaces as \(V_{\delta }=\text {span}\lbrace \varphi _k,~k=1,...,N\rbrace \), \(\hat{V}_{i,\delta }=\text {span}\lbrace \hat{\varphi }_{i,k},~k=1,...,\hat{N}_i\rbrace \) and \(\hat{V}_{\delta }=\prod _{i \in \mathcal {I}}\hat{V}_{i,\delta }\).

Matrix \(\varvec{\mathcal {A}}\) is full rank for the ellipticity of operators A in (18) and \(\hat{A}\) in (19), whereas matrix \(\varvec{\mathcal {G}}\) is symmetric positive semi-definite as, for any V such that

$$\begin{aligned} V=\begin{bmatrix} U\\ \hat{U}\\ \Psi _D \\ \Psi _\Sigma \end{bmatrix}, \quad V^T \varvec{\mathcal {G}} V = \frac{1}{2}\sum _{i=1}^\mathcal {I}\left( \Vert U_{|\Lambda _i} - \Psi _i^D \Vert ^2_{L^2(\Lambda _i)} + \Vert \hat{U}_i - \Psi _i^\Sigma \Vert ^2_{L^2(\Lambda _i)}\right) \ge 0. \end{aligned}$$
(38)

Let us assume that either \(\Omega \) has a non-empty Dirichlet boundary or \(\Lambda \) has at least a Dirichlet endpoint, and let us consider \(V \in \ker {(\varvec{\mathcal {G}})}\). Thus, according to (38), it follows that

$$\begin{aligned} U_{|_{\Lambda _i}}=\Psi _i^D \quad \text {and} \quad \hat{U}_i=\Psi _i^\Sigma \qquad \forall i \in \mathcal {I}. \end{aligned}$$
(39)

If \(V \in \ker {(\varvec{\mathcal {A}})}\) it follows, by the constraint equations, that

$$\begin{aligned} \begin{aligned}&\int _{\Omega }K\nabla U\nabla v~d\omega =\sum _{i \in \mathcal {I}} \int _{\Lambda _i}\beta _i|\Gamma _i(s)|(\Psi _i^\Sigma -U_{|{\Lambda _i}})v_{|_{\Lambda _i}}ds&\quad \forall v \in V_{\delta }\\&\int _{\Lambda _i}\tilde{K}_i|\Sigma _i(s)|\frac{d\hat{U}_i}{ds}\frac{d\hat{v}_i}{ds}~ds=\int _{\Lambda _i}\beta _i|\Gamma _i(s)|(\Psi _i^D-\hat{U}_i)\hat{v}_ids&\forall \hat{v}_i \in \hat{V}_{i,\delta },~ \forall i \in \mathcal {I} \end{aligned} \end{aligned}$$

Let us introduce the quantity \(\Phi _i=\hat{U}_i-U_{|_{\Lambda _i}}\). According to (39) we also that \(\Phi _i=\Psi _i^\Sigma -U_{|_{\Lambda _i}}=-(\Psi _i^D-\hat{U}_i)\). Choosing \(v=U\) and \(\hat{v}_i=\hat{U}_i~\forall i \in \mathcal {I}\) we obtain

$$\begin{aligned} \int _{\Omega }K\nabla U\nabla U~d\omega =\sum _{i \in \mathcal {I}} \int _{\Lambda _i}\beta _i|\Gamma _i(s)|\Phi _iU_{|_{\Lambda _i}}ds \end{aligned}$$
(40)
$$\begin{aligned} \int _{\Lambda _i}\tilde{K}_i|\Sigma _i(s)|\frac{d\hat{U}_i}{ds}\frac{d\hat{U}_i}{ds}~ds=- \int _{\Lambda _i}\beta _i|\Gamma _i(s)|\Phi _i\hat{U}_ids\quad \forall i \in \mathcal {I} \end{aligned}$$
(41)

Summing all the equations we get

$$\begin{aligned} \begin{aligned}&\int _{\Omega }K\nabla U\nabla U~d\omega + \sum _{i \in \mathcal {I}}\int _{\Lambda _i}\tilde{K}_i|\Sigma _i(s)|\frac{d\hat{U}_i}{ds}\frac{d\hat{U}_i}{ds}~ds+\sum _{i=1}\int _{\Lambda _i}\beta _i|\Gamma _i(s)|\Phi _i(\hat{U}-U_{|_{\Lambda _i}})ds=0,\\&\Rightarrow \int _{\Omega }K\nabla U\nabla U~d\omega + \sum _{i \in \mathcal {I}}\int _{\Lambda _i}\tilde{K}_i|\Sigma _i(s)|\frac{d\hat{U}_i}{ds}\frac{d\hat{U}_i}{ds}~ds+\sum _{i=1}\int _{\Lambda _i}\beta _i|\Gamma _i(s)|\Phi _i\Phi _ids=0, \end{aligned} \end{aligned}$$

which means that \(\Phi _i=0~\forall i \in \mathcal {I}\), U is constant, \(\hat{U}_i\) is constant \(\forall i \in \mathcal {I}\) and hence \(\hat{U}\) is constant since continuity is imposed at segment intersections. This implies that \(U_{|_{\Lambda _i}}=\hat{U}_i=\Psi _i^D=\Psi _i^\Sigma \). If the Dirichlet condition is imposed on a portion of \(\partial \Omega \) we conclude that \(U\equiv 0\) and hence \(U_{|_{\Lambda _i}}=\hat{U}_i=\Psi _i^D=\Psi _i^\Sigma =0\). Same consideration holds if the Dirichlet condition is instead imposed at one of the segment endpoints. Thus \(\ker {(\varvec{\mathcal {G}})}\cap \ker {(\varvec{\mathcal {A}})}=\textbf{0}\) which completes the proof.

The proof of Proposition 3 derives from classical arguments of quadratic programming, observing that

$$\begin{aligned} \varvec{\mathcal {K}}=\begin{bmatrix} \varvec{\mathcal {G}} &{} \varvec{\mathcal {A}}^T\\ \varvec{\mathcal {A}} &{} \varvec{0} \end{bmatrix}. \end{aligned}$$

6 Solving strategies

Solving system (37) is equivalent to solving the optimization problem (36). Here a different strategy is however proposed, based on an iterative solver and allowing to take full advantage of the decoupling introduced by the proposed method.

Let us formally replace in the cost functional (35) the expressions \(U=\varvec{A}^{-1}(\varvec{S^\beta }\Psi _{\Sigma }+f)\) and \(\hat{U}=\varvec{\hat{A}}^{-1}(\varvec{\hat{D}^\beta }\Psi _{D}+g)\) and let us set \(\mathcal {X}=[\Psi _D^T,\Psi _\Sigma ^T]^T\), obtaining

$$\begin{aligned}{} & {} J^\star (\Psi _D,\Psi _\Sigma )=\frac{1}{2}\Big ( (\varvec{A}^{-1}\varvec{S^\beta }\Psi _{\Sigma }+\varvec{A}^{-1}f)^T\varvec{G}(\varvec{A}^{-1}\varvec{S^\beta }\Psi _{\Sigma }+\varvec{A}^{-1}f)+\nonumber \\{} & {} -(\varvec{A}^{-1}\varvec{S^\beta }\Psi _{\Sigma }+\varvec{A}^{-1}f)^T\varvec{D}\Psi _D-\Psi _D^T\varvec{D}^T(\varvec{A}^{-1}\varvec{S^\beta }\Psi _{\Sigma }+\varvec{A}^{-1}f)+\nonumber \\{} & {} +\Psi _D^T\varvec{M^D}\Psi _D+(\varvec{\hat{A}}^{-1}\varvec{\hat{D}^\beta }\Psi _D+\varvec{\hat{A}}^{-1}g)^T\varvec{\hat{G}}(\varvec{\hat{A}}^{-1}\varvec{\hat{D}^\beta }\Psi _D+\varvec{\hat{A}}^{-1}g)+\nonumber \\{} & {} -(\varvec{\hat{A}}^{-1}\varvec{\hat{D}^\beta }\Psi _D+\varvec{\hat{A}}^{-1}g)^T\varvec{\hat{S}}\Psi _\Sigma -\Psi _\Sigma ^T\varvec{\hat{S}}^T(\varvec{\hat{A}}^{-1}\varvec{\hat{D}^\beta }\Psi _D+\varvec{\hat{A}}^{-1}g)+\nonumber \\{} & {} +\Psi _\Sigma ^T\varvec{M^\Sigma }\Psi _\Sigma \Big )=\nonumber \\= & {} \frac{1}{2}~\mathcal {X}^T\begin{bmatrix} (\varvec{\hat{D}^\beta })^T\varvec{\hat{A}}^{-T}\varvec{\hat{G}}\varvec{\hat{A}}^{-1}\varvec{\hat{D}^\beta }+\varvec{M^D} &{}\quad -\varvec{D}^T\varvec{A}^{-1}\varvec{S^\beta }-(\varvec{\hat{D}^\beta })^T\varvec{\hat{A}}^{-T}\varvec{\hat{S}}\\ \\ -(\varvec{S^\beta })^T\varvec{A}^{-T}\varvec{D}-\varvec{\hat{S}}^T\varvec{\hat{A}}^{-1}\varvec{\hat{D}^\beta } &{}(\varvec{S^\beta })^T\varvec{A}^{-T}\varvec{G}\varvec{A}^{-1}\varvec{S^\beta }+\varvec{M^\Sigma } \end{bmatrix}\mathcal {X}\nonumber \\{} & {} + \begin{bmatrix}g^T \varvec{\hat{A}}^{-T}\varvec{\hat{G}}\varvec{\hat{A}}^{-1}\varvec{\hat{D}^\beta }-f^T\varvec{A}^{-T}\varvec{D} \\ \\ f^T\varvec{A}^{-T}\varvec{G}\varvec{A}^{-1}\varvec{S^\beta }-g^T\varvec{\hat{A}}^{-T}\varvec{\hat{S}} \end{bmatrix}\mathcal {X}+\nonumber \\{} & {} +\frac{1}{2}\left( f^T\varvec{A}^{-T}\varvec{G}\varvec{A}^{-1}f+g^T\varvec{\hat{A}}^{-T}\varvec{\hat{G}}\varvec{\hat{A}}^{-1}g\right) =\nonumber \\= & {} \frac{1}{2}\left( \mathcal {X}^T\varvec{\mathcal {M}}\mathcal {X}+2d\mathcal {X}+q\right) . \end{aligned}$$
(42)

Matrix \(\varvec{\mathcal {M}}\) is symmetric positive definite, given the equivalence of this formulation with the saddle-point system (37). This allows us to perform the minimization of the unconstrained functional (42) via a gradient based scheme, looking for the minimum as the solution of

$$\begin{aligned} \nabla J^*=\varvec{\mathcal {M}}\mathcal {X}+d=0. \end{aligned}$$
(43)

A preconditioner \(\varvec{\mathcal {P}}\) can be defined for solving system (43). In particular we set

$$\begin{aligned} \varvec{\mathcal {P}}=\begin{bmatrix} (\varvec{\hat{D}^\beta })^T(\varvec{\hat{A}^\sharp })^{-T}\varvec{\hat{G}}(\varvec{\hat{A}}^\sharp )^{-1}\varvec{\hat{D}^\beta }+\varvec{M^D} &{}\varvec{0}\\ \\ \varvec{0} &{}\varvec{M^\Sigma } \end{bmatrix}. \end{aligned}$$
(44)

where \(\varvec{\hat{A}^\sharp }=\text {diag}\left( \varvec{\hat{A}_1},...,\varvec{\hat{A}_{\mathcal {I}}}\right) \). This means that the top-left block of matrix \(\varvec{\mathcal {P}}\) corresponds exactly to the top-left block of matrix \(\varvec{\mathcal {M}}\) in case no intersections among the segment occur. Otherwise, \((\varvec{\hat{A}^\sharp })^{-1}\) is an approximation of the inverse of matrix \(\varvec{\hat{A}}\) which can be built inverting independently the matrices related to the single segments and which maintains a block-diagonal structure, i.e. \((\varvec{\hat{A}}^\sharp )^{-1}=\text {diag}\left( \varvec{\hat{A}_1}^{-1},...,\varvec{\hat{A}_{\mathcal {I}}}^{-1}\right) \). For what concerns the bottom-right block, only matrix \(\varvec{M^{\Sigma }}\) is kept with respect to the same block of matrix \(\varvec{\mathcal {M}}\), so that even this portion of the preconditioner can be built block-diagonalwise, assembling matrices which are independently related to each single 1D inclusion.

The application of the conjugate gradient scheme to system Eq. 43 requires, at each iteration, the computation of quantity \(\varvec{\mathcal {M}}\delta \mathcal {X}\), where \(\delta \mathcal {X}=[\delta \Psi _D^T,\delta \Psi _\Sigma ^T]\) represents the descent direction. It is worth underlining that such quantity can actually be obtained without explicitly building matrix \(\varvec{\mathcal {M}}\). In fact, after easy computations we obtain

$$\begin{aligned} \varvec{\mathcal {M}}\delta \mathcal {X}=\begin{bmatrix} (\varvec{\hat{D}^\beta })^T\delta \hat{P}-\varvec{D}^T\delta U+\varvec{M}^D\delta \Psi _D\\ (\varvec{S}^\beta )^T\delta {P}-\varvec{\hat{S}}^T\delta \hat{U}+\varvec{M}^\Sigma \delta \Psi _\Sigma \end{bmatrix} \end{aligned}$$

where \(\delta U\), \(\delta \hat{U}\), \(\delta P\), \(\delta \hat{P}\) are the solutions of the linear systems

$$\begin{aligned} \begin{aligned}&\varvec{A}\delta U=\varvec{S}^\beta \delta \Psi _\Sigma \qquad&\varvec{\hat{A}}\delta \hat{U}=\varvec{\hat{D}}^\beta \delta \Psi _D\\&\varvec{A}\delta P=\varvec{G}\delta U-\varvec{D}\delta \Psi _D&\varvec{\hat{A}}\delta \hat{ P}=\varvec{\hat{G}}\delta \hat{U}-\varvec{\hat{S}}\delta \Psi _\Sigma \end{aligned} \end{aligned}$$

which require to solve local sub-problems on the 1D segments and on the 3D domain.

7 Numerical results

In this section we present three numerical examples to better highlight the characteristics of the proposed approach. The simulations are performed using linear finite elements on the 3D and 1D non-conforming meshes, independently generated on the sub-domains. Parameter h denotes the maximum diameter of the tetrahedra for the 3D mesh, while other three parameters, namely \(\hat{\delta }_{u,i}\), \(\delta _{D,i}\) and \(\delta _{\Sigma ,i}\) express the refinement level of the 1D meshes \(\hat{\mathcal {T}_i}\), \(\tau ^{D}_i\), \(\tau ^{\Sigma }_i\), \(i=1,...\mathcal {I}\), respectively. Each of these three parameters represents the ratio between the number of nodes in the 1D mesh and the number of intersections of the segment \(\Lambda _i\) with the faces of the tetrahedra in \(\mathcal {T}\). In the simulations, for simplicity, we adopt unique, but possibly different, values of \(\hat{\delta }_{u}\), \(\delta _{D}\) and \(\delta _{\Sigma }\) for the various segments: for this reason we drop, in the following, the segment index \(i=1,...\mathcal {I}\) for these parameters. In all cases, linear Lagrangian finite elements on tethrahedra are used in the 3D domains and piecewise continuous linear basis functions on equally spaced meshes are chosen for the 1D functions.

7.1 Test Problem 1 (TP1)

Let us consider a cube \(\Omega \) of edge \(l=2\) centered in the axes origin and whose faces are parallel to the coordinate axes. Let us further consider a cylinder \(\Sigma \) of radius \(\hat{R}=10^{-2}\) and height \(h=2\) whose centreline \(\Lambda \) lies on the z axis (see Fig. 1, on the left). Let us denote by \(\partial \Omega _{l}\), \(\partial \Omega _{+}\) and \(\partial \Omega _{-}\) respectively the lateral, the top and the bottom faces of the cube.

Fig. 1
figure 1

TP1: left: view of the numerical solution inside the cube; right: solution obtained on the segment and on a section of the cube parallel to the z-axis and containing \(\Lambda \) (section highlighted in the left figure). Parameters \(h = 0.083\), \(\hat{\delta }_u = 1\), \(\delta _D=\delta _{\Sigma } = 0.5\)

We aim at solving a problem in the form of (13)-(16), obtained by reducing \(\Sigma \) to its centerline, with the following data:

$$\begin{aligned} \begin{aligned}&K=1, \qquad f(x,y,z)=2-x^2-y^2-2z^2,\\ {}&\tilde{K}(z)=\frac{z^2}{3}+\frac{1}{2},\qquad \overline{\overline{g}}=3\\&\beta =\frac{2\hat{R}}{2+\hat{R}^2} \end{aligned} \end{aligned}$$

The problem is completed with appropriate boundary conditions such that the exact solution is:

$$\begin{aligned} u_{ex}(x,y,z)=\frac{1}{2}(x^2+y^2)(z^2-1)+1 \text { in } \Omega \end{aligned}$$
(45)
$$\begin{aligned} \hat{u}_{ex}(z)=2-z^2 \text { on } \Lambda . \end{aligned}$$
(46)

In particular we consider Neumann boundary conditions on \(\partial \Omega _{+}\) and \(\partial \Omega _{-}\), whereas Dirichlet boundary conditions are imposed on \(\partial \Omega _l\). Dirichlet boundary conditions equal to 1 are imposed at segment endpoints.

The obtained solution is shown in Fig. 1: on the left, the 3D solution is shown on a portion of the domain, whereas, on the right, the solution U on the \(y-z\) plane containing the z-axis is plotted along with the solution \(\hat{U}\), with solution values reported along the x-axis. The mesh used for this solution has parameters \(h=0.083\), \(\hat{\delta }_u=1\), \(\delta _{D}=0.5\) and \(\delta _{\Sigma }=0.5\), corresponding to \(N=4155\) DOFs in the cube and \(\hat{N}=57\) DOFs on the segment.

Errors indicators \(\mathcal {E}_{L^2}\), \(\mathcal {E}_{H^1}\) are chosen for the 3D solution and \(\widehat{\mathcal {E}}_{L^2}\) and \(\widehat{\mathcal {E}}_{H^1}\) for the 1D problem, defined as:

$$\begin{aligned} \begin{aligned}&\mathcal {E}_{L^2}=\frac{||u_{ex}-U||_{L^2(\Omega )}}{||u_{ex}||_{L^2(\Omega )}} ,\qquad \mathcal {E}_{H^1}=\frac{||u_{ex}-U||_{H^1(\Omega )}}{||u_{ex}||_{H^1(\Omega )}},\\&\widehat{\mathcal {E}}_{L^2}=\frac{||\hat{u}_{ex}-\hat{U}||_{L^2(\Lambda )}}{||\hat{u}_{ex}||_{L^2(\Lambda )}}, \qquad \widehat{\mathcal {E}}_{H^1}=\frac{||\hat{u}_{ex}-\hat{U}||_{H^1(\Lambda )}}{||\hat{u}_{ex}||_{H^1(\Lambda )}}. \end{aligned} \end{aligned}$$

Figure 2 displays the convergence trends for the above quantities against mesh refinement. Four meshes are considered, obtained by choosing \(h=0.208,0.131,\) 0.083, 0.052, which correspond to \(N=257,1026,4155,16545\) DOFs and \(\hat{N}=15,29,57,88\) DOFs, respectively. The parameters \(\hat{\delta }_u=1\) and \(\delta _D=\delta _\Sigma =0.5\) are fixed for all cases, hence a 3D mesh refinement induces a refinement of all the 1D meshes. Expected convergence rates are obtained for the above indicators. Indeed, given the regularity of the solution on the 3D and 1D domains, convergence rates close to 2/3 for \(\mathcal {E}_{L^2}\) against N and 1/3 for \(\mathcal {E}_{H^1}\) against N are observed, corresponding to the optimal values for 3D linear finite elements, and a rate of about 2 for \(\widehat{\mathcal {E}}_{L^2}\) against \(\hat{N}\) and of about 1 for \(\widehat{\mathcal {E}}_{H^1}\) against \(\hat{N}\) are achieved, corresponding to the optimal values for 1D linear finite elements.

Fig. 2
figure 2

TP1: trend of the \(L^2\) and \(H^1\)-norms of the relative errors under mesh refinement. On the left: error on the cube with respect to (45); on the right: error on the segment with respect to (46). Other parameters: \(\hat{\delta }_{u}=1\), \(\delta _{D}=\delta _{\Sigma }=0.5\)

Two additional error indicators are instead considered for the interface variables \(\Psi _D\) and \(\Psi _\Sigma \) as:

$$\begin{aligned} \widehat{\mathcal {E}}_{\psi }^D=\frac{||\check{u}_{ex}-\Psi _D||_{L^2(\Lambda )}}{||\check{u}_{ex}||_{L^2(\Lambda )}}., \qquad \widehat{\mathcal {E}}_{\psi }^\Sigma =\frac{||\hat{u}_{ex}-\Psi _\Sigma ||_{L^2(\Lambda )}}{||\hat{u}_{ex}||_{L^2(\Lambda )}}. \end{aligned}$$

where \(\mathcal {E}_{_{\Gamma }}\check{u}_{ex}=\gamma _{_{\Gamma }}u_{ex}=u_{ex}(\hat{R},z)\). The values of these errors indicators on the same meshes considered before, are reported in Fig. 3, on the left for \(\widehat{\mathcal {E}}_{\psi }^D\) and, on the right, for \(\widehat{\mathcal {E}}_{\psi }^\Sigma \). Despite no expected values are available for such indicators, the graphs clearly show that the control variables converge to the corresponding exact counterparts.

Fig. 3
figure 3

TP1: trend of the error indicators for \(\Psi _D\) and \(\Psi _\Sigma \) under mesh refinement. On the left \(\widehat{\mathcal {E}}_{\psi }^D\), on the right \(\widehat{\mathcal {E}}_{\psi }^\Sigma \). Other parameters: \(\hat{\delta }_{u}=1\), \(\delta _{D}=\delta _{\Sigma }=0.5\)

Figure 4 shows the trend of the condition number of matrix \(\mathcal {K}\), defined in (37), under the variation of the 1D-mesh parameters. On the left the conditioning is plotted under the variation of \(\delta _D\) and for different values of \(\hat{\delta }_u\), while a constant \(\delta _{\Sigma }=0.5\) is used; on the right \(\delta _{\Sigma }\) varies instead, while \(\delta _D=0.5\) is fixed, again for \(\hat{\delta }_u\) ranging between 0.05 and 2. In both cases we can observe how, in general, at the increase \(\hat{\delta }_u\), slightly higher conditioning values are registered, with some exceptions for very small values of the parameter. In all cases, however, the impact of this parameter is quite marginal on the conditioning of the system. Looking at the left plot we can see that the value of \(\delta _D\) has no impact on the conditioning. Looking instead at Fig. 4 on the right, it can be noticed that \(\delta _\Sigma \) has a larger impact on the conditioning, but only if very small values are used, and, at the same time, a value \(\hat{\delta }_u>\delta _\Sigma \) is chosen; in these cases an increase of up to two orders of magnitude in the conditioning is observed. However, for \(\delta _\Sigma >0.2\) the effect of \(\delta _\Sigma \) on the conditioning becomes almost irrelevant, independently from the choice of the other parameters. The behaviour here observed is quite different from the one observed in [1], where a larger effect of the mesh parameters on the conditioning was instead observed. Further, system (43) is known to be even better conditioned than the corresponding system (37), [19]. For this simple example it is possible to explicitly compute matrix \(\mathcal {M}\). Its conditioning is plotted in Fig. 5, against variations of the 1D mesh parameters. Trends similar to the ones of Fig. 4 are observed and the behaviour is almost the same for all the values of \(\hat{\delta }_u\) considered, but the conditioning of \(\mathcal {M}\) is, in general, between 4 and 5 orders of magnitude smaller than the one of \(\mathcal {K}\). This is expected to have a positive impact on the number of iterations of the conjugate gradient scheme, with few iterations required to reach the prescribed tolerance even without the use of a preconditioner. The analysis of the performances of the proposed iterative solver is deferred to the last example here proposed, in which a more complex setting is considered.

Fig. 4
figure 4

TP1: trend of the conditioning of the KKT system under the variation of the 1D mesh parameters. On the left variable \(\delta _D\) and different values of \(\hat{\delta } u\) while \(\delta _{\Sigma }=0.5\). On the right variable \(\delta _{\Sigma }\) and \(\delta _D=0.5\). In both cases \(h=0.083\)

Fig. 5
figure 5

TP1: trend of the conditioning of system (43) under the variation of the 1D mesh parameters. On the left variable \(\delta _D\) and different values of \(\hat{\delta } u\) while \(\delta _{\Sigma }=0.5\). On the right variable \(\delta _{\Sigma }\) and \(\delta _D=0.5\). In both cases \(h=0.083\)

7.2 Test Problem 2 (TP2)

For this numerical example we consider a set of 19 inclusions of radius \(\check{R}=10^{-2}\), whose centerlines intersect in 9 points. The resulting network is embedded in the same cube of edge \(l=2\) considered in Test Problem 1. We impose homogeneous Dirichlet boundary conditions on all the faces of the cube and at the dead ends of the network which intersect the cube at its top and bottom faces, as shown in Fig. 6. Homogeneous Neumann boundary conditions are imposed at segment endpoints lying inside the cube. For what concerns problem coefficients we consider \({K}=1\), \(f=0\) and \({\tilde{K}}_i=100\), \(\overline{\overline{g}}_i=100\), \(\beta _i=5e-2\), \(\forall i=1,...,19\).

Fig. 6
figure 6

TP2: Solution obtained on the centerlines of the inclusions for \(h=0.083\), \(\hat{\delta }_u=1\) and \(\delta _{D}=\delta _{\Sigma }=0.5\). The point marked in blue identify homogeneous Dirichlet boundary conditions

The problem is solved both with the method proposed in this article and with a different approach in which no auxiliary variables are introduced. The following 3D-1D coupled problem is derived from (7)-(8): find \((u, \hat{u}) \in V_D \times \hat{V}\) such that:

$$\begin{aligned} \begin{aligned}&({{K}}\nabla u, \nabla v)_{L^2(D)}+\left( {|\Gamma (\cdot )|}\beta \check{u},\check{v}\right) _{L^2(\Lambda )}-\left( {|\Gamma (\cdot )|}\beta \hat{u},\check{v} \right) _{L^2(\Lambda )}=(f,v)_{L^2(D)} \\&\hspace{7.5cm}\forall v \in {V_D}, \check{v} \in \hat{V}: \gamma _{_\Gamma } v=\mathcal {E}_{_\Gamma }\check{v} \\&\Big ( {\tilde{K}}{|\Sigma (\cdot )|}\frac{d\hat{u}}{ds},\frac{d\hat{v}}{ds}\Big )_{{L^2(\Lambda )}}+\left( {|\Gamma (\cdot )|}\beta \hat{u},\hat{v} \right) _{L^2(\Lambda )}-\left( {|\Gamma (\cdot )|}\beta \check{u},\hat{v}\right) _{L^2(\Lambda )}=({|\Sigma (\cdot )|}\overline{\overline{g}},\hat{v})_{{L^2(\Lambda )}} \\ {}&\forall \hat{v} \in \hat{V}, \end{aligned} \end{aligned}$$

which, after discretization yields the following global system

$$\begin{aligned} \begin{bmatrix} \varvec{A} &{}-\varvec{B}\\ -\varvec{B}^T &{} \varvec{\hat{A}} \end{bmatrix}\begin{bmatrix} U \\ \hat{U} \end{bmatrix}=\begin{bmatrix} f \\ g \end{bmatrix} \end{aligned}$$

where the nomenclature is the same of Section 5 and the new matrix \(\varvec{B}\) is defined as

$$\begin{aligned} \varvec{B}=\left[ \varvec{B_1}, \varvec{B_2},...,\varvec{B_{\mathcal {I}}}\right] \in \mathbb {R}^{N\times \hat{N}} \end{aligned}$$

with

$$\begin{aligned} \varvec{B_i} \in \mathbb {R}^{N\times \hat{N}_i} \text { s.t. } (B_i)_{kl}=\int _{\Lambda _i}{{\varphi _{k}}_{|_{\Lambda _i}}\hat{\varphi }_{i,l}}~ds .\end{aligned}$$

We will refer to this method as “coupled” and we will use it as a comparison term for our approach, which, instead, will be labelled as OPT (optimization based). The results shown in the following are obtained by considering a 3D mesh, non conforming to the inclusions, with \(h=0.083\) and \(N=3320\) and a 1D mesh with \(\hat{\delta }_{u}=1\), corresponding to \(\hat{N}=234\) DOFs. Parameters \(\delta _{D}=\delta _{\Sigma }=0.5\) are used in the OPT approach. Figure 6 reports the solutions obtained with both approaches on the network of segments, while Fig. 7 on the right proposes a comparison of the solutions on two selected segments (marked in Fig. 6), showing an almost perfect agreement. Figure 7 on the left, instead, reports the solution U obtained inside the cube on three different planes, located at \(z=-0.5\), \(z=0\) and \(z=0.5\) and all parallel to the \(x-y\) plane. Even in this Figure the solutions obtained with both the approaches are shown and appear to be almost perfectly overlapped.

Fig. 7
figure 7

TP2: On the left: solutions with OPT and coupled methods obtained on the inclusions and inside the cube on three different planes parallel to the \(x-y\) plane and located at \(z=-0.5\), \(z=0\) and \(z=0.5\). Solution amplified by a factor 50 with respect to domain size; on the right: comparison of the solution on two selected segments with the OPT and the coupled methods

In Figs. 8 and 9 the influence of the permeability coefficient \(\beta \) and of the transmissivity of the inclusions \(\tilde{K}\) is investigated. In Fig. 8, left, the 1D solution \(\hat{u}\) and the control variable \(\Psi _D\) are compared on segment 4 for \(\tilde{K}=100\), as in the previous simulations, and for values of \(\beta =0.05,500\). Figure 8, right, instead, compares the 3D solution obtained again for \(\tilde{K}=100\) and \(\beta =0.05,500\), on the plane (xy, 0). As expected (see e.g. the analysis in [17]), for the lowest value of \(\beta \), the 1D solution and \(\Psi _D\), corresponding to the trace of the 3D solution, are different, thus yielding a discontinuous solution. On the other hand, the distance between the 1D solution and the trace of the 3D solution gets much smaller for \(\beta =500\) (Fig. 8, left). Also, for \(\beta =500\), the effect of the inclusions on the 3D solution is stronger, as highlighted in Fig. 8, right. In Fig. 9 the same quantities are reported for \(\tilde{K}=1\) and, again, values of \(\beta =0.05,500\). Also in this case, the solution tends to become continuous at the interface when \(\beta \) is large, (Fig. 9, left). Figure 9, right, shows that, in this case, the impact of the presence of the segments on the overall 3D solution is similar for \(\beta =0.05\) and \(\beta =500\), since the transmissivity properties are the same in the 3D and in the 1D domains (\(K=\tilde{K}=1\)). We remark how the forcing term inside the inclusions is kept equal to \(\overline{\overline{g}}_i=100\) \(\forall i=1,...,19\). Given the chosen boundary conditions, the choice \(f=\overline{\overline{g}}_i=0\) would lead instead to a constant zero solution both in the 3D and in the 1D domain.

Fig. 8
figure 8

TP2, \(\tilde{K}=100\): On the left: comparison between \(\hat{u}\) and \(\Psi _D\) on segment 4 for \(\beta =5e-2\) (full and dotted red lines) and \(\beta =5e+2\) (full and dashed green lines); on the right: solution on the plane (xy, 0) for \(\beta =5e-2\) (solid surface) and \(\beta =5e+2\) (transparent surface). Both solutions amplified by a factor of 50 in the right Figure

Fig. 9
figure 9

TP2, \(\tilde{K}=1\): On the left: comparison between \(\hat{u}\) and \(\Psi _D\) on segment 4 for \(\beta =5e-2\) (full and dotted red lines) and \(\beta =5e+2\) (full and dashed green lines); on the right: solution on the plane (xy, 0) for \(\beta =5e-2\) and \(\beta =5e+2\) (almost superposed). Both solutions amplified by a factor of 1000 in the right Figure

7.3 Conjugate gradient test (CGtest)

We now consider a more complex numerical example, characterized by the presence of multiple intersecting inclusions. The setting of this example might be considered as realistic of a living tissue with a network of vessels. The purpose of the present example is to test the performances of the proposed solving strategy and preconditioner in a realistic setting. In particular we consider the domain of Fig. 10, where 873 segments organized into two connected clusters are immersed in a cubic domain \(\Omega \) of edge \(l=2\), as considered in the previous examples. On the faces of the cube we consider Neumann boundary conditions, namely \(K\nabla u\cdot \varvec{n}=2\cdot 10^{-5}, \) with \(\varvec{n}\) denoting, in this case, the outward pointing unit normal vector to \(\partial \Omega \). At the inlets of the two networks, i.e. the segment endpoints lying on the face \(z=-1\), we impose Dirichlet boundary conditions equal to \(5\cdot 10^{-3}\), and at all other segment endpoints we consider homogeneous Neumann conditions. Problem data are as follows:

$$\begin{aligned} K=2\cdot 10^{-4}, \qquad f(x,y,z)=0, \qquad \tilde{K}=3\cdot 10^{1},\qquad \overline{\overline{g}}=0\qquad \beta =1\cdot 10^{-2}. \end{aligned}$$
Fig. 10
figure 10

CGtest: Representation of the problem geometry. The blue spheres highlight the Dirichlet boundary conditions at the inlets of the two networks

Table 1 CGtest: mesh parameters, DOFs and corresponding CG iterations. In brackets value of the relative residual which defines the stopping criterion. For all the considered cases \(\hat{\delta }_u=1\)

The cluster of segments of this example is composed by many segments of small length, compared to domain size. Thus, a set of simulations is performed by varying both parameter h of the 3D mesh and parameters \(\delta _{D}\) and \(\delta _{\Sigma }\) of the 1D meshes, in order to control the meshsize independently, being, instead, \(\hat{\delta }_u=1\) fixed. The values of the parameters used in the simulations are reported in the first three columns of Table 1, whereas the fourth column reports the number of DOFs of the variables \(\Psi _D\) and \(\Psi _\Sigma \), corresponding to the size of the system (43). The coarsest and the finest mesh combination considered are shown in Fig. 11, whereas the solution on the finest mesh is reported in Fig. 12, on the left for the 1D network and on the right for the 3D solution on three planes orthogonal to the z-axis. The remaining columns of Table 1 report the number of iterations required by the conjugate gradient scheme to solve system (43) up to a relative residual of \(10^{-6}\) or \(10^{-9}\), without using a preconditioner (columns \(\varvec{CG_{it}}^{(10^{-6})}\) and \(\varvec{CG_{it}}^{(10^{-9})}\)) or using preconditioner (44) (columns \(\varvec{PCG_{it}}^{(10^{-6})}\) and \(\varvec{PCG_{it}}^{(10^{-9})}\)).

It can be seen that, in all cases, the number of iterations is small compared to the number of unknowns, and it only marginally grows as the stopping tolerance is reduced. The use of the preconditioner allows to further reduce the number of iterations, the obtained reduction ranging between \(15\%\) and \(30\%\). It is to be highlighted that the proposed preconditioner can be obtained and applied at a very low computational cost, as it only requires to solve local 1D problems and can be computed and used in parallel. The effectiveness of the proposed solving approach reflects the good conditioning of the obtained system, as it was pointed out in Test Problem 1.

Fig. 11
figure 11

CGtest: comparison between meshes. On the left, \(h=0.208\), \(\delta _{D}=\delta _{\Sigma }=0.5\); on the right, \(h=0.052\), \(\delta _{D}=\delta _{\Sigma }=0.5\)

Fig. 12
figure 12

CGtest: on the left, solution obtained inside the inclusions; on the right, solution obtained in the cube on three different planes perpendicular to the z-axis, namely \(z=-0.5\), \(z=0\) and \(z=0.5\). Parameters: \(h=0.052\), \(\delta _{D}=\delta _{\Sigma }=2\), \(\hat{\delta }_u=1\)

8 Conclusions

A PDE constrained formulation for 3D-1D coupled problems with discontinuous solution at the interfaces has been derived and proposed. The approach is based on the introduction of unknown interface variables to decouple the 3D and 1D problems and on the minimization of a cost functional to enforce interface conditions. The problem is discretized resorting to standard finite elements on non conforming meshes independently set on each subdomain. Well posedness results for the discrete problem are obtained independently of the choice of the mesh parameters of the various domains. The proposed test on a problem with known analytical solution shows that optimal convergence trends of the error are obtained for both the 3D and 1D solution. Also the linear system corresponding to the application of the method appears to be well conditioned for a wide range of choices of the mesh parameters. The examples on more complex domains reveal the applicability of the method to realistic configurations and also the good performances of the proposed gradient-based solver. Directions for future work include the development of error estimators, also in view of mesh adaptivity. The representation of the solution near the inclusions can be improved also by introducing local additional basis functions, as in the extended finite element method. Time dependent simulations of realistic problems will be addressed.