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();
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];
115 for (label pi = 1; pi <
nPoints; pi++)
118 fCentre_d += p_d[pi];
124 for (label pi = 0; pi <
nPoints; pi++)
129 vector c =
p[pi] + nextPoint + fCentre;
130 vector c_d = p_d[pi] + nextPoint_d + fCentre_d;
132 vector n = (nextPoint -
p[pi])^(fCentre -
p[pi]);
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];
221 for (label pi = 1; pi <
nPoints; pi++)
224 fCentre_d += p_d[pi];
230 for (label pi = 0; pi <
nPoints; pi++)
235 vector c =
p[pi] + nextPoint + fCentre;
236 tensor c_d = p_d[pi] + nextPoint_d + fCentre_d;
238 vector n = (nextPoint -
p[pi])^(fCentre -
p[pi]);
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;
291 auto& C_d = tC_d.ref();
299 const label pointFaceI = pointFaces[pfI];
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];
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
void size(const label n)
Older name for setAddressableSize.
A cell is defined as a list of faces with extra functionality.
Differentiation of the mesh data structure.
pT makeCellCentres_d(const vectorField &fAreas, const vectorField &fCtrs, const Field< pT > &fAreas_d, const Field< pT > &fCtrs_d)
const fvMesh & mesh_
Reference to the mesh.
tmp< tensorField > cellCenters_d(const label pointI)
vectorField makeFaceCentresAndAreas_d(const pointField &p, const pointField &p_d)
A face is a list of labels corresponding to mesh vertices.
pointField points(const UList< point > &pts) const
Return the points corresponding to this face.
Mesh data needed to do the Finite Volume discretisation.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
const surfaceVectorField & Cf() const
Return face centres as surfaceVectorField.
const surfaceVectorField & Sf() const
Return cell face area vectors.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Smooth ATC in cells having a point to a set of patches supplied by type.
label whichPatch(const label faceIndex) const
Return patch index for a given face label.
virtual const faceList & faces() const
Return raw faces.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
virtual const pointField & points() const
Return raw points.
const labelListList & pointCells() const
label nInternalFaces() const noexcept
Number of internal faces.
const labelListList & pointFaces() const
const cellList & cells() const
Tensor of scalars, i.e. Tensor<scalar>.
A class for managing temporary objects.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
#define WarningInFunction
Report a warning using Foam::Warning.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
static constexpr const zero Zero
Global zero (0)
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.