47 res.xx() = res1.x(); res.yx() = res1.y(); res.zx() = res1.z();
51 res.xy() = res2.x(); res.yy() = res2.y(); res.zy() = res2.z();
55 res.xz() = res3.x(); res.yz() = res3.y(); res.zz() = res3.z();
63 deltaBoundary::deltaBoundary(
const fvMesh&
mesh)
91 vector fAreas = 0.5*((
p[1] -
p[0])^(
p[2] -
p[0]));
93 fCtrs_d = (1.0/3.0)*(p_d[0] + p_d[1] + p_d[2]);
95 0.5*((p_d[1] - p_d[0])^(
p[2] -
p[0]))
96 + 0.5*((
p[1] -
p[0])^(p_d[2] - p_d[0]));
97 scalar ds =
mag(fAreas);
98 unitVector_d = fAreas_d/ds - (fAreas*(fAreas&fAreas_d))/ds/ds/ds;
100 deltaVecs[0] = fCtrs_d;
101 deltaVecs[1] = fAreas_d;
102 deltaVecs[2] = unitVector_d;
114 point fCentre_d = p_d[0];
118 fCentre_d += p_d[
pi];
130 vector c_d = p_d[
pi] + nextPoint_d + fCentre_d;
134 ((nextPoint_d - p_d[
pi])^(fCentre -
p[
pi]))
135 + ((nextPoint -
p[
pi])^(fCentre_d - p_d[
pi]));
143 <<
"Zero area face sub triangle found " <<
endl 144 <<
p[
pi] <<
" " << nextPoint <<
" " << fCentre <<
endl 145 <<
"Neglecting contributions of this element " <<
endl;
149 scalar a_d = (
n&n_d)/
mag(
n);
158 sumAc_d += a_d*
c + a*c_d;
164 fCtrs_d = (1.0/3.0)*(sumAc_d*sumA - sumAc*sumA_d)/sumA/sumA;
165 fAreas_d = 0.5*sumN_d;
166 scalar ds =
mag(fAreas);
167 unitVector_d = fAreas_d/ds - (fAreas*(fAreas&fAreas_d))/ds/ds/ds;
169 deltaVecs[0] = fCtrs_d;
170 deltaVecs[1] = fAreas_d;
171 deltaVecs[2] = unitVector_d;
196 vector fAreas = 0.5*((
p[1] -
p[0])^(
p[2] -
p[0]));
198 fCtrs_d = (1.0/3.0)*(p_d[0] + p_d[1] + p_d[2]);
200 0.5*tensorCrossVector(p_d[1] - p_d[0],
p[2] -
p[0])
202 - 0.5*tensorCrossVector(p_d[2] - p_d[0],
p[1] -
p[0]);
203 scalar ds =
mag(fAreas);
204 unitVector_d = fAreas_d/ds - (fAreas*(fAreas&fAreas_d))/ds/ds/ds;
206 deltaVecs[0] = fCtrs_d;
207 deltaVecs[1] = fAreas_d;
208 deltaVecs[2] = unitVector_d;
220 tensor fCentre_d = p_d[0];
224 fCentre_d += p_d[
pi];
236 tensor c_d = p_d[
pi] + nextPoint_d + fCentre_d;
240 tensorCrossVector(nextPoint_d - p_d[
pi], fCentre -
p[
pi])
242 - tensorCrossVector(fCentre_d - p_d[
pi], nextPoint -
p[
pi]);
250 <<
"Zero area face sub triangle found " <<
nl 251 <<
p[
pi] <<
" " << nextPoint <<
" " << fCentre <<
nl 252 <<
"Neglecting contributions of this element " <<
endl;
266 sumAc_d += (
c*a_d) + a*c_d;
271 fCtrs_d = (1.0/3.0)*(sumAc_d/sumA - (sumAc*sumA_d)/
sqr(sumA));
272 fAreas_d = 0.5*sumN_d;
273 scalar ds =
mag(fAreas);
274 unitVector_d = fAreas_d/ds - (fAreas*(fAreas&fAreas_d))/ds/ds/ds;
276 deltaVecs[0] = fCtrs_d;
277 deltaVecs[1] = fAreas_d;
278 deltaVecs[2] = unitVector_d;
288 const labelList& pointCellsI(pointCells[pointI]);
291 auto& C_d = tC_d.ref();
299 const label pointFaceI = pointFaces[pfI];
300 const face& faceI =
mesh_.
faces()[pointFaceI];
304 if (faceI[pI] == pointI)
315 Cf_d[pfI] = dFace[0];
316 Sf_d[pfI] = dFace[1];
322 const label pointCellI = pointCellsI[pcI];
330 const label globalFaceI = cellI[fI];
335 fAreas[fI] =
mesh_.
Sf()[globalFaceI];
336 fCtrs[fI] =
mesh_.
Cf()[globalFaceI];
340 const label whichPatch =
343 const label patchStart =
patch.patch().start();
344 const label localFace = globalFaceI - patchStart;
345 fAreas[fI] =
patch.Sf()[localFace];
346 fCtrs[fI] =
patch.Cf()[localFace];
352 if (pointFaces[pfI] == globalFaceI)
354 fAreas_d[fI] = Sf_d[pfI];
355 fCtrs_d[fI] = Cf_d[pfI];
const surfaceVectorField & Sf() const
Return cell face area vectors.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
const surfaceVectorField & Cf() const
Return face centres as surfaceVectorField.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
tmp< tensorField > cellCenters_d(const label pointI)
Compute the change of the cell centers of the pointCells of pointI, for a unitary movement of pointI ...
vectorField makeFaceCentresAndAreas_d(const pointField &p, const pointField &p_d)
Given a face and the points to be moved in the normal direction, find faceArea, faceCentre and unitVe...
const cellList & cells() const
List< labelList > labelListList
List of labelList.
virtual const pointField & points() const
Return raw points.
#define forAll(list, i)
Loop across all elements in list.
vectorField pointField
pointField is a vectorField.
static const Identity< scalar > I
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
constexpr scalar pi(M_PI)
label nInternalFaces() const noexcept
Number of internal faces.
virtual const faceList & faces() const
Return raw faces.
label whichPatch(const label meshFacei) const
Return patch index for a given mesh face index. Uses binary search.
const labelListList & pointCells() const
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
const fvMesh & mesh_
Reference to the mesh.
Field< tensor > tensorField
Specialisation of Field<T> for tensor.
vector point
Point is a vector.
#define WarningInFunction
Report a warning using Foam::Warning.
Mesh data needed to do the Finite Volume discretisation.
const dimensionedScalar c
Speed of light in a vacuum.
const std::string patch
OpenFOAM patch number as a std::string.
const labelListList & pointFaces() const
const fvBoundaryMesh & boundary() const noexcept
Return reference to boundary mesh.
Field< vector > vectorField
Specialisation of Field<T> for vector.
List< label > labelList
A List of labels.
pT makeCellCentres_d(const vectorField &fAreas, const vectorField &fCtrs, const Field< pT > &fAreas_d, const Field< pT > &fCtrs_d)
Compute cell center variation wrt given face movement or derivative.
static constexpr const zero Zero
Global zero (0)