I am trying to work with a simulation of Brain Tumor growth and I was fortunate to get a very great example at http://community.wolfram.com/. However, I need clarifications on some of the code. I want to know what it does and how it works. Here are the piece that I do not understand:
1.
diffcoeff = ListInterpolation[ImageData[img3], InterpolationOrder -> 3]
2.
boundaries = {-y, y - 1, -x, x - 1};
Ω = ImplicitRegion[And @@ (# <= 0 & /@ boundaries), {x, y}];
3.
sols = NDSolveValue[{{Div[
1./500.*(diffcoeff[798.*x, 654*y])^4* Grad[u[t, x, y], {x, y}], {x, y}] - D[u[t, x, y], t] + 0.025*u[t, x, y] == NeumannValue[0., x >= 1. || x <= 0. || y <= 0. || y >= 1.]},
{u[0, x, y] == Exp[-1000. ((x - 0.6)^2 + (y - 0.6)^2)]}},
u,
{x, y}∈ Ω,
{t, 0, 20},
Method -> {"FiniteElement",
"MeshOptions" -> {
"BoundaryMeshGenerator" -> "Continuation",
MaxCellMeasure -> 0.002
}
}
]
I really would like to understand each element of these code pieces (and probably the rationale behind their use). Your kind and expert contributions would be greatly appreciated. Since the web page does not load anymore, I have the pdf copy I earlier saved, here!.
Ωhas been defined to be, say, a hexagon in some other case or that this code partially originates from pre-v10 era, but in the case of a unit square... you can just sayΩ = Rectangle[]. (RegionEqual[With[{boundaries = {-y, y - 1, -x, x - 1}}, ImplicitRegion[And @@ (# <= 0 & /@ boundaries), {x, y}]], Rectangle[]]evaluates toTrue.) – kirma Sep 02 '18 at 03:55Truein the Neumann condition this may work in this case but it would not work for a geometry that had internal boundaries. It is more general to explicitly specify the boundaries on which a BC is active, similar to this – user21 Sep 03 '18 at 05:30