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*

22
  • $\begingroup$ I am adapting your code to my problem - how do I modify guess = 1.; to more complicated boundary conditions with more complicated Dirichlet conditions and some Neumann? $\endgroup$ Commented Mar 23, 2017 at 15:58
  • $\begingroup$ This line uOld[[diriPos]] = dBC["DirichletValues"]; is setting the boundary conditions to what you have. guess=1 is to the the initial guess inside the domain. - With the NeumannValue I don't know. You should create an example to which you know the solution and experiment (and tell me ;-) $\endgroup$ Commented Mar 23, 2017 at 16:17
  • $\begingroup$ My actual boundary conditions look something like that: boundaries = {-y, 0.25^2 - (x)^2 - y^2, -x, y - 1, x - 1}; op = -Laplacian[u[x, y], {x, y}] + NeumannValue[0, boundaries[[1]] == 0.] + NeumannValue[0, boundaries[[5]] == 0.] == 0; conditions = { DirichletCondition[u[x, y] == 0, boundaries[[4]] == 0.], DirichletCondition[u[x, y] == 0, boundaries[[3]] == 0.], DirichletCondition[u[x, y] == 1/(1 + x), boundaries[[2]] == 0.]}; I would like generate 'guess' array to be consistent with that. How would I do that? $\endgroup$ Commented Mar 23, 2017 at 17:35
  • $\begingroup$ You can ignore the Neumann 0. The code should work as is else I'll have a look tomorrow. $\endgroup$ Commented Mar 23, 2017 at 18:06
  • $\begingroup$ @MaximLyutikov, could you figure this out? $\endgroup$ Commented Mar 24, 2017 at 6:52