# differential equations – Defining mesh size for NDSolve

I want to see the effect of mesh size on the solution curves while simulating convection-diffusion – point sink via NDSolve FEM.

In the following code (ref also related to this post):

I’d like to know how to visualize the mesh size distribution i.e mesh element size defined in `mesh = ToElementMesh(region, "IncludePoints" -> includePoints, "MaxCellMeasure" -> 1);`. Also, from what I read here, I understand `MaxCellMeasure` sets the upper limit of the mesh element size. I want to know if there is a similar option
for defining the minimum size of mesh elements. e.g. `MinCellMeasure` argument ? I couldn’t find this in the documentation.

``````Needs("NDSolve`FEM`")
region = Line({{0}, {100}});
includePoints = {{10}};
mesh = ToElementMesh(region, "IncludePoints" -> includePoints,
"MaxCellMeasure" -> 1);
vars = {c(t, x), t, {x}};
RegularizedDeltaPoint(g_, X_List, Xs_List) :=
Piecewise({{Times @@ Thread(1/(4 g) (1 + Cos((Pi)/(2 g) (X - Xs)))),
And @@ Thread(RealAbs(X - Xs) <= 2 g)}, {0, True}})
Subscript(h, mesh) = Sqrt(Min(mesh("MeshElementMeasure")));
Subscript(gamma, reg) = Subscript(h, mesh)/2;
temp = RegularizedDeltaPoint(Subscript(gamma, reg), {x},
includePoints((1)));
parameters = {kappa -> {{1000}}, v1 -> 100,
gamma -> Subscript(gamma, reg), Qp -> 3};
pde = {Derivative(1, 0)(c)(t, x) +
Inactive(
c(t, x), {x}), {x}) + {v1}.Inactive(Grad)(c(t, x), {x}) +
Qp*RegularizedDeltaPoint(gamma, {x}, {10}) == 0,
c(0, x) == 1} /. parameters;

tEnd = 3;
cfun = NDSolveValue(
pde~Join~{DirichletCondition(c(t, x) == 4 (1 - Exp(-1000 t)) + 1,
x == 0)}, c, {t, 0, tEnd}, {x} (Element) mesh);
With({i = Flatten({0}~Join~includePoints)},
Plot(Evaluate(cfun(t, #) & /@ i), {t, 0, tEnd},
PlotRange -> {{0, tEnd}, {0, 5.1}},
PlotLegends -> (StringTemplate("c(t,``)") /@ i)))
ListPlot(Table(cfun(t, x), {x, 0, 100, 10}, {t, 0, tEnd, tEnd/100}),
Joined -> True, DataRange -> {0, tEnd})
``````