Suppose I have a spherical object projected onto a discrete square mesh. The dicretised circle can be represented by filling a logical matrix such that voxels in the interior of the sphere are filled with 1's where outside of the sphere the voxels are filled with 0's. Calculating the volume is easy as you simply add up the voxels filled with 1's to get the volume.
In the phase field (diffuse interface) formalism however, the edges of the sphere are diffuse interfaces, ie. the value varies smoothly 0 < value < 1 over several mesh points. How does one go about calculating the volume for such an object?
The only way I could think of was defining an artificial discrete boundary at value=0.5 and then summing as in the first case. Any ideas?