- Thank you received: 1
compute L2 error
4 years 2 months ago #3106
by dong
Replied by dong on topic compute L2 error
Assume that the domain split into two subregions 1 and 2. The exact solution on each region is u1 and u2, respectively. You can draw the exact solution on the domain by using the characteristic functions. For examples,
Code:
# Draw exact solution
char_1 = GridFunction(L2(mesh,order=0))
char_1.Set(CoefficientFunction([1,0]))
char_2 = GridFunction(L2(mesh,order=0))
char_2.Set(CoefficientFunction([0,1]))
u = char_1*u1+char_2*u2
Draw(u, mesh, "uexact")
The following user(s) said Thank You: wen jing
4 years 2 months ago #3107
by wen jing
Replied by wen jing on topic compute L2 error
Thank you for your constant reply! However, if the variable is only defined on one of the regions, can we draw?
4 years 2 months ago #3108
by wen jing
Replied by wen jing on topic compute L2 error
Dear dong
I've seen you ask some questions about Stokes - Darcy's code, I think you must be very good at dealing with interface problems. I have recently written IPDG for primal form of Stokes- Darcy and HDG for mixed form of Stokes- Darcy according to the ideas I have learned,but I have encountered difficulties. Have you ever written a complete program like this? What kind of difficulties have you encountered? Looking forward to your reply. Thanks!
Best regards,
JIng
I've seen you ask some questions about Stokes - Darcy's code, I think you must be very good at dealing with interface problems. I have recently written IPDG for primal form of Stokes- Darcy and HDG for mixed form of Stokes- Darcy according to the ideas I have learned,but I have encountered difficulties. Have you ever written a complete program like this? What kind of difficulties have you encountered? Looking forward to your reply. Thanks!
Best regards,
JIng
Time to create page: 0.098 seconds