Hello,
Suppose that we want to solve an 1D problem in the domain x = [0,1], the equation of which is
\frac{ds}{dx} = 0
After integration by parts in the FEM formulation, the weak form is
s φ^{|x=1}_{|x=0} - \int_{Ω} s \ \frac{dφ}{dx} \ dΩ
where φ is the basis function and the first term is the term that includes the values of s at nodes x=0 and x = 1. I want to include the first term in the weak formulation and especially I want to impose that
s_{|x=0} = p and s_{|x=1} = 0 , where p is a constant. Here is the sample of my code
Res = term1 - s*phi[0].dx(0)
How can I include term1 properly?
(Obviously I am trying to solve a quite complicated problem than that but I did want to present the whole problem here, I just want to include these nodal values)
Thanks
Perhaps you should consider posting the actual problem you wish to solve, or provide a different example, as the example you have posted has no solution. As I have indicated on your previous post, term1
in this example is 0 by definition.
(The solution to ds/dx=0 is s(x)=s_0, where s_0 is a constant, which cannot satisfy the boundary conditions you have specified.)
1 Like
Thanks for your answer. As already mentioned in the post, this is just a hypothetical problem of including such terms in weak form. My real problem is an FSI problem which is quite complicated and I think my question could not make sense. So my question is how to include nodal values after integrating by parts in a 1D domain. I think I need to construct the “ds” measurements for x = 0 and x = 1 and then include s \ φ \ ds (0) and s \ φ \ ds (1) in the weak form.