From a first principles bandstructure calculation I get an energy scalar field in three dimensions $E(x,y,z)$. It's now easy to plot a constant energy (contour)-surface for dedicated values $\epsilon=E(x,y,z)$ by using ListContourPlot3D
.
Lets assume the following example scalar field (e.g. the case of a graviatation potential field):
data = Table[1/Sqrt[x^2 + y^2 + z^2], {x, -1, 1, 0.1}, {y, -1, 1, 0.1}, {z, -1, 1,0.1}]
/. ComplexInfinity -> 10^16 // Quiet;
I exchanged the infinite value at $x=y=z=0$ with a finite one to prevent any error messages coming from the visualisation routines. Now the iso-surfaces can be easily plotted for e.g. $\epsilon=2.0$
ListContourPlot3D[data, Contours -> {2.0}, DataRange -> {{-1, 1}, {-1, 1}, {-1, 1}}]
Coming back to the bandstructure calculation, the energy surfaces are much more complicated and cannot be described analytically for the general case as can be seen from the following plot of an energy surface for Silicon:
An important electronic property, the DOS (Density of States) is calculated through the integral $$\oint \limits_{E(x,y,z)=\epsilon}\frac{dS}{\lvert\nabla E(x,y,z)\rvert}.$$
and additional integrals of interest have the general form
$$\oint \limits_{E(x,y,z)=\epsilon}\frac{dS}{\lvert\nabla(\Delta E(x,y,z))\rvert}A(x,y,z)$$
with $A(x,y,z)$ as some additional scalar function (e.g. for effective mass tensor, $A(x,y,z)$ is the tensor product of the gradients of the energy).
Now for the question. How to most efficiently implement such integrals on numerically specified data (see above) over iso-surfaces in Mathematica?
EDIT: Trying out the proposal by Mastrok I run into convergence problems for e.g. $\epsilon$ = 2.0 of the integration (most probably due to the singularity in the coordinate center and the additional derivatives on the interpolation function when using Gauss' Theorem):
e = ListInterpolation[data, {{-1, 1}, {-1, 1}, {-1, 1}}];
dive = Simplify[Div[#/Norm[#]^2& @ Grad[e[x, y, z], {x, y, z}], {x, y, z}] /.
Derivative[1][Abs][x_] :> x/Abs[x] /. {x->#1, y->#2, z->#3} &];
NIntegrate[Piecewise[{{dive[x, y, z], e[x, y, z] < 2.0}}, 0] ,
{x, -1, 1}, {y, -1, 1}, {z, -1, 1}
]
(*Output*)
NIntegrate::slwcon: Numerical integration converging too slowly;
suspect one of the following: singularity, value of the integration is 0,
highly oscillatory integrand, or WorkingPrecision too small.
Integrate[1/Norm[Grad[e[x, y, z], {x, y, z}]], {x, y, z} ∈ ImplicitRegion[e[x, y, z] == ϵ, {x, y, z}]]
seems to work when $E$ is given analytically, but not when it is anInterpolatingFunction
constructed from the data. $\endgroup$