### How to implement variable boundary condition?

91

views

0

Hi, all

Thanks to our community, and thanks to the experts here.

My new question comes again,

I want to solve the Poisson equation with variable boundary conditions. The problem can be expressed as follows.

for i in range(9):

$\Delta m^i=f^i$Δ

$m^i=u^i-\nabla\phi^i$

where $u^i,\quad\phi^i$

My code related to this part is

bcs = DirichletBC(V, U_i - grad_phi_i, Boundary)

solve(a1 == L1, M_j, bcs)

Is my code right?

Best, Hamilton

Thanks to our community, and thanks to the experts here.

My new question comes again,

I want to solve the Poisson equation with variable boundary conditions. The problem can be expressed as follows.

for i in range(9):

$\Delta m^i=f^i$Δ

`m`^{i}=`ƒ`^{i}# in $\Omega$Ω$m^i=u^i-\nabla\phi^i$

`m`^{i}=`u`^{i}−∇`ϕ`^{i}# on $\partial\Omega$∂Ωwhere $u^i,\quad\phi^i$

`u`^{i},`ϕ`^{i}is functions defined in the domain and is known from the previous step.My code related to this part is

bcs = DirichletBC(V, U_i - grad_phi_i, Boundary)

solve(a1 == L1, M_j, bcs)

Is my code right?

Best, Hamilton

Community: FEniCS Project

1

Please provide a minimal working example.

written
4 months ago by
pf4d

Please login to add an answer/comment or follow this question.