39 const Field<Type>& positiveC,
40 const Field<Type>& positiveP,
41 const Field<Type>& negativeC,
42 const Field<Type>& negativeP
46 Field<Type>& result = tResult.ref();
51 polyMeshTetDecomposition::cellTetIndices(
mesh, cI);
56 forAll(cellTetIs, cellTetI)
58 const triFace triIs = cellTetIs[cellTetI].faceTriIs(
mesh);
60 const FixedList<point, 4>
68 const FixedList<scalar, 4>
76 const cutTriTet::volumeIntegrateOp<Type>
77 positive = FixedList<Type, 4>
84 const cutTriTet::volumeIntegrateOp<Type>
85 negative = FixedList<Type, 4>
93 v += cutTriTet::volumeOp()(tet);
95 r +=
tetCut(tet, level, positive, negative);
108 const fvPatch& patch,
111 const Field<Type>& positiveF,
112 const Field<Type>& positiveP,
113 const Field<Type>& negativeF,
114 const Field<Type>& negativeP
117 tmp<Field<Type>> tResult(
new Field<Type>(patch.size(),
Zero));
118 Field<Type>& result = tResult.ref();
122 const face&
f = patch.poly().localFaces()[fI];
127 for(
label eI = 0; eI <
f.size(); ++ eI)
129 const edge
e =
f.faceEdge(eI);
131 const FixedList<point, 3>
134 patch.poly().faceCentres()[fI],
135 patch.poly().localPoints()[
e[0]],
136 patch.poly().localPoints()[
e[1]]
138 const FixedList<scalar, 3>
145 const cutTriTet::areaMagIntegrateOp<Type>
146 positive = FixedList<Type, 3>
152 const cutTriTet::areaMagIntegrateOp<Type>
153 negative = FixedList<Type, 3>
160 a += cutTriTet::areaMagOp()(tri);
162 r +=
triCut(tri, level, positive, negative);
178 const VolField<Type>& positiveC,
179 const PointField<Type>& positiveP,
180 const VolField<Type>& negativeC,
181 const PointField<Type>& negativeP
184 const fvMesh&
mesh = levelC.mesh();
186 tmp<VolField<Type>> tResult
190 positiveC.name() +
":levelSetAverage",
192 dimensioned<Type>(
"0", positiveC.dimensions(),
Zero)
195 VolField<Type>& result = tResult.ref();
197 result.primitiveFieldRef() =
201 levelC.primitiveField(),
202 levelP.primitiveField(),
203 positiveC.primitiveField(),
204 positiveP.primitiveField(),
205 negativeC.primitiveField(),
206 negativeP.primitiveField()
211 result.boundaryFieldRef()[
patchi] =
215 levelC.boundaryField()[
patchi],
216 levelP.boundaryField()[
patchi].patchInternalField()(),
217 positiveC.boundaryField()[
patchi],
218 positiveP.boundaryField()[
patchi].patchInternalField()(),
219 negativeC.boundaryField()[
patchi],
220 negativeP.boundaryField()[
patchi].patchInternalField()()
#define forAll(list, i)
Loop across all elements in list.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
Motion of the mesh specified as a list of pointMeshMovers.
virtual const pointField & points() const
Return raw points.
const vectorField & cellCentres() const
A class for managing temporary objects.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
volScalarField scalarField(fieldObject, mesh)
const dimensionedScalar e
Elementary charge.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
PointField< scalar > pointScalarField
VolField< scalar > volScalarField
cutTriTet::opAddResult< AboveOp, BelowOp >::type triCut(const FixedList< Point, 3 > &tri, const FixedList< scalar, 3 > &level, const AboveOp &aboveOp, const BelowOp &belowOp)
Cut a triangle along the zero plane defined by the given levels. Templated.
cutTriTet::opAddResult< AboveOp, BelowOp >::type tetCut(const FixedList< Point, 4 > &tet, const FixedList< scalar, 4 > &level, const AboveOp &aboveOp, const BelowOp &belowOp)
As triCut, but for a tetrahedron.
tmp< DimensionedField< TypeR, GeoMesh, Field > > New(const tmp< DimensionedField< TypeR, GeoMesh, Field >> &tdf1, const word &name, const dimensionSet &dimensions)
tmp< Field< Type > > levelSetAverage(const fvMesh &mesh, const scalarField &levelC, const scalarField &levelP, const Field< Type > &positiveC, const Field< Type > &positiveP, const Field< Type > &negativeC, const Field< Type > &negativeP)
Calculate the average value of two fields, one on each side of a level set.