41 const DimensionedField<Type, volMesh>& positiveC,
42 const DimensionedField<Type, pointMesh>& positiveP,
43 const DimensionedField<Type, volMesh>& negativeC,
44 const DimensionedField<Type, pointMesh>& negativeP
47 tmp<DimensionedField<Type, volMesh>> tResult
49 new DimensionedField<Type, volMesh>
53 positiveC.name() +
":levelSetAverage",
54 mesh.time().timeName(),
58 dimensioned<Type>(positiveC.dimensions(),
Zero)
61 DimensionedField<Type, volMesh>& result = tResult.ref();
65 const List<tetIndices> cellTetIs =
66 polyMeshTetDecomposition::cellTetIndices(
mesh, cI);
71 forAll(cellTetIs, cellTetI)
73 const triFace triIs = cellTetIs[cellTetI].faceTriIs(
mesh);
75 const FixedList<point, 4>
78 mesh.cellCentres()[cI],
79 mesh.points()[triIs[0]],
80 mesh.points()[triIs[1]],
81 mesh.points()[triIs[2]]
83 const FixedList<scalar, 4>
91 const cut::volumeIntegrateOp<Type>
92 positive = FixedList<Type, 4>
99 const cut::volumeIntegrateOp<Type>
100 negative = FixedList<Type, 4>
108 v += cut::volumeOp()(tet);
110 r +=
tetCut(tet, level, positive, negative);
123 const fvPatch&
patch,
126 const Field<Type>& positiveF,
127 const Field<Type>& positiveP,
128 const Field<Type>& negativeF,
129 const Field<Type>& negativeP
134 tmp<Field<Type>> tResult(
new Field<Type>(
patch.size(),
Zero));
135 Field<Type>& result = tResult.ref();
139 const face&
f =
patch.patch().localFaces()[fI];
144 for (label eI = 0; eI <
f.size(); ++eI)
146 const edge
e =
f.faceEdge(eI);
148 const FixedList<point, 3>
151 patch.patch().faceCentres()[fI],
152 patch.patch().localPoints()[
e[0]],
153 patch.patch().localPoints()[
e[1]]
155 const FixedList<scalar, 3>
162 const cut::areaIntegrateOp<Type>
163 positive = FixedList<Type, 3>
169 const cut::areaIntegrateOp<Type>
170 negative = FixedList<Type, 3>
177 a += cut::areaOp()(tri);
179 r +=
triCut(tri, level, positive, negative);
182 result[fI] = a/
magSqr(a) & r;