42 const DimensionedField<Type, volMesh>& positiveC,
43 const DimensionedField<Type, pointMesh>& positiveP,
44 const DimensionedField<Type, volMesh>& negativeC,
45 const DimensionedField<Type, pointMesh>& negativeP
48 tmp<DimensionedField<Type, volMesh>> tResult
50 new DimensionedField<Type, volMesh>
54 positiveC.name() +
":levelSetAverage",
55 mesh.time().timeName(),
59 dimensioned<Type>(positiveC.dimensions(),
Zero)
62 DimensionedField<Type, volMesh>& result = tResult.ref();
66 const List<tetIndices> cellTetIs =
67 polyMeshTetDecomposition::cellTetIndices(
mesh, cI);
72 forAll(cellTetIs, cellTetI)
74 const triFace triIs = cellTetIs[cellTetI].faceTriIs(
mesh);
76 const FixedList<point, 4>
79 mesh.cellCentres()[cI],
80 mesh.points()[triIs[0]],
81 mesh.points()[triIs[1]],
82 mesh.points()[triIs[2]]
84 const FixedList<scalar, 4>
92 const cut::volumeIntegrateOp<Type>
93 positive = FixedList<Type, 4>
100 const cut::volumeIntegrateOp<Type>
101 negative = FixedList<Type, 4>
109 v += cut::volumeOp()(tet);
111 r +=
tetCut(tet, level, positive, negative);
124 const fvPatch&
patch,
127 const Field<Type>& positiveF,
128 const Field<Type>& positiveP,
129 const Field<Type>& negativeF,
130 const Field<Type>& negativeP
135 tmp<Field<Type>> tResult(
new Field<Type>(
patch.size(),
Zero));
136 Field<Type>& result = tResult.ref();
140 const face&
f =
patch.patch().localFaces()[fI];
145 for (label edgei = 0; edgei <
f.nEdges(); ++edgei)
147 const edge
e =
f.edge(edgei);
149 const FixedList<point, 3>
152 patch.patch().faceCentres()[fI],
153 patch.patch().localPoints()[
e[0]],
154 patch.patch().localPoints()[
e[1]]
156 const FixedList<scalar, 3>
163 const cut::areaIntegrateOp<Type>
164 positive = FixedList<Type, 3>
170 const cut::areaIntegrateOp<Type>
171 negative = FixedList<Type, 3>
178 a += cut::areaOp()(tri);
180 r +=
triCut(tri, level, positive, negative);
183 result[fI] = a/
magSqr(a) & r;