I have been trying to integrate over a surface of a 3D Mesh. The sample code looks like this
l0 = 0.1;
COD = 0.2;
X1 = 0.0;
Y1 = 0.0;
Z1 = 0.0;
X2 = 1.0;
Y2 = 8.0;
Z2 = 1.0;
Ymid = 0.5 (Y2 + Y1);
aDim = 0.5;
reg1=Rectangle[{X1,Y1},{X2,Y2}];
reg2=Triangle[{{X1,Ymid+COD},{X1,Ymid-COD},{aDim,Ymid}}];
reg3=RegionDifference[reg1,reg2];
reg4=RegionProduct[reg3,Line[{{Z1},{Z2}}]];
elVol =5(l0/2)^3/(6\[Sqrt]2);
MeshIn = ToElementMesh[reg4, MaxCellMeasure -> {"Volume" -> 0.0125},
"MeshOrder" -> 1,
MeshRefinementFunction ->
Function[{vertices, Vol},
Block[{x, y, z, tol}, {x, y, z} = Mean[vertices]; tol = 0.05;
If[y < Ymid + tol && y > Ymid - tol && x > aDim - tol ,
Vol > elVol, Vol > 5]]]]
I want to integrate a function
f[x_,y_,z_] = x y^2 + z^2;
over the surface x = 1
. I can directly integrate using the command
NIntegrate[f[x,y,z],{y,0,8},{z,0,1}];
Is it possible to integrate over the finite element mesh using something like this
NIntegrate[f[x,y,z], {x, y, z} \[Element] MeshIn]
and I also want to choose x = 1
. I need this because i want to integrate the finite element solution which is a global interpolation function over the surface of the mesh. I would appreciate any help in this regard.
Thanks