Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

10
  • $\begingroup$ A possible work-around just come to my mind: axx = Inverse[mat\[Phi]\[Phi]] . (mat\[Phi]\[Phi]x) . Inverse[mat\[Phi]\[Phi]] . (mat\[Phi]\[Phi]x) . f1i :) $\endgroup$ Commented Dec 16, 2024 at 10:06
  • $\begingroup$ @xzczd Thanks for your clever workaround. Works fine! How do you justify this workaround $\endgroup$ Commented Dec 16, 2024 at 10:18
  • $\begingroup$ I'm first inspired by this observation of mine. Then, by checking Partial Differential Equations and Boundary Conditions section of the tutorial Solving Partial Differential Equations with Finite Elements, I notice the discretization of convection term doesn't seem to involve integration by parts i.e. the zero Neumann value isn't imposed when a pure first order derivative (e.g. $\frac\partial{\partial x}$) is discretized. $\endgroup$ Commented Dec 16, 2024 at 10:32
  • $\begingroup$ @xzczd Very clever. I'm just trying the 2D workaround, actually without succes $\endgroup$ Commented Dec 16, 2024 at 10:35
  • $\begingroup$ $\frac{\partial^2}{\partial x \partial y}$ can be calculated like this: {mat\[Phi]\[Phi]x, mat\[Phi]\[Phi]y} = (initCoeffs = InitializePDECoefficients[vd, sd, "ConvectionCoefficients" -> {{{#}}}]; methodData = InitializePDEMethodData[vd, sd]; DiscretizePDE[initCoeffs, methodData, sd]["StiffnessMatrix"]) & /@ {{1, 0}, {0, 1}};f2 = Function[{x, y}, Sin[2 Pi (x - Pi/2)] Cos[Pi y]]; func = LinearSolve[mat\[Phi]\[Phi]]; axy = func[mat\[Phi]\[Phi]y . func[mat\[Phi]\[Phi]x . Map[Apply[f2, #] &, punkte]]]; but still, the precision isn't good enough… (The simple $f(x,y)=x y$ case is good, though. ) $\endgroup$ Commented Dec 17, 2024 at 11:53