Tag Info

New answers tagged

1

For the specific parameters in the question, rmax = 15 kf^-1; mesh = ToElementMesh[Ball[{0, 0, 0}, rmax], MaxCellMeasure -> {"Length" -> 1.2}] (* ElementMesh[ ..., {TetrahedronElement[<10795>]}] *) MaxMemoryUsed[sol = NDSolveValue[{op == 0, DirichletCondition[u[x, y, z] == boundary[l, m, kf, x, y, z] , True]}, u, {x, y, z} ∈ mesh]] // ...


3

One way to do it is to specify an ExtralopationHandler (see section on extrapolation) and have it return 0. for queries outside the domain. For example: nds1 = NDSolveValue[{Inactive[Div][ Inactive[Grad][u[x, y], {x, y}], {x, y}] == 0, DirichletCondition[u[x, y] == 0, y == 0], DirichletCondition[u[x, y] == 1, y == 1]}, ...


3

For rmax = 5 kf^-1, ToElementMesh discretizes the region of integration by default into about 7000 elements. For rmax = 30 kf^-1, it does the same. Thus, resolution is much reduced, and this is the source of the inaccuracy for the larger rmax. To increase resolution and display the mesh, use mesh = ToElementMesh[Ball[{0, 0, 0}, rmax], MaxCellMeasure ...


6

Reverting to the old strategy of using Boole seems efficient on the test case: SeedRandom[0]; (* to give a reproducible result *) m1 = mesh[0.05, 10]; m1["Wireframe"] Clear[x, y, u]; nds1 = NDSolveValue[{Inactive[Div][Inactive[Grad][u[x, y], {x, y}], {x, y}] == 0, DirichletCondition[u[x, y] == 0, y == 0], DirichletCondition[u[x, y] == 1, ...



Top 50 recent answers are included