32 #include "volFields.H"
33 #include "surfaceFields.H"
34 #include "fvcSnGrad.H"
35 #include "volPointInterpolation.H"
36 #include "processorFvPatch.H"
37 #include "processorFvPatchFields.H"
43 volPointInterpolation::
New(mesh)
45 nfRef_(mesh.thisDb().lookupObject<surfaceVectorField>(
"nf")),
46 bgfid_(mesh.boundary().size()),
47 processorPatch_(mesh.boundary().size(), false),
53 bqf_(mesh.boundary().size()),
54 baqx_(mesh.boundary().size()),
55 baqy_(mesh.boundary().size()),
56 baqz_(mesh.boundary().size()),
57 bvq_(mesh.boundary().size()),
63 btf_(mesh.boundary().size()),
64 batx_(mesh.boundary().size()),
65 baty_(mesh.boundary().size()),
66 batz_(mesh.boundary().size()),
67 bvt_(mesh.boundary().size()),
68 bmvON_(mesh.boundary().size()),
70 bof_(mesh.boundary().size())
74 if (isA<processorFvPatch>(mesh.boundary()[iPatch]))
76 processorPatch_[iPatch] =
true;
78 const fvPatch& fvp = mesh.boundary()[iPatch];
79 bgfid_[iPatch].resize(fvp.size());
82 bgfid_[iPatch][i] = mesh.boundary()[iPatch].start() + i;
87 const faceList& faces = mesh.faces();
91 if (mesh.isInternalFace(i))
93 if (faces[i].size() == 3)
97 else if (faces[i].size() == 4)
109 const fvPatch& fvp = mesh.boundary()[iPatch];
112 if (faces[bgfid_[iPatch][i]].size() == 3)
114 btf_[iPatch].append(i);
116 else if (faces[bgfid_[iPatch][i]].size() == 4)
118 bqf_[iPatch].append(i);
122 bof_[iPatch].append(i);
129 vectorField vO(mesh.boundary()[iPatch].size(), vector::zero);
130 vectorField vN(mesh.boundary()[iPatch].size(), vector::zero);
132 vO = mesh.boundary()[iPatch].Cn();
133 if (processorPatch_[iPatch])
135 vN = refCast<const processorFvPatch>(mesh.boundary()[iPatch]).
136 procPolyPatch().neighbFaceCellCentres();
142 mesh.boundary()[iPatch].Cf()
161 const pointField& points = mesh.points();
162 const faceList& faces = mesh.faces();
164 atx_.resize(tf_.size());
165 aty_.resize(tf_.size());
166 atz_.resize(tf_.size());
167 vt_.resize(tf_.size());
170 label p1 = -1, p2 = -1, p3 = -1;
171 const scalar OneBySix = (1.0 / 6.0);
176 own = mesh.owner()[facei];
177 nei = mesh.neighbour()[facei];
178 p1 = faces[facei][0];
179 p2 = faces[facei][1];
180 p3 = faces[facei][2];
186 (points[p2] - points[p1]) ^ (points[p3] - points[p1])
187 ) & (mesh.C()[own] - mesh.C()[nei]);
192 atx_[i][0] = OneBySix*((mesh.C()[own].z() - mesh.C()[nei].z())*(points[p2].y() - points[p3].y()) +
193 (mesh.C()[nei].y() - mesh.C()[own].y())*(points[p2].z() - points[p3].z()));
194 atx_[i][1] = OneBySix*((mesh.C()[nei].y() - mesh.C()[own].y())*(points[p3].z() - points[p1].z()) +
195 (mesh.C()[own].z() - mesh.C()[nei].z())*(points[p3].y() - points[p1].y()));
196 atx_[i][2] = OneBySix*((mesh.C()[nei].y() - mesh.C()[own].y())*(points[p1].z() - points[p2].z()) +
197 (mesh.C()[own].z() - mesh.C()[nei].z())*(points[p1].y() - points[p2].y()));
198 atx_[i][3] = OneBySix*(points[p1].z()*(points[p2].y() - points[p3].y()) +
199 points[p2].z()*(points[p3].y() - points[p1].y()) +
200 points[p3].z()*(points[p1].y() - points[p2].y()));
201 atx_[i][4] = -atx_[i][3];
205 aty_[i][0] = OneBySix*((mesh.C()[own].x() - mesh.C()[nei].x())*(points[p2].z() - points[p3].z()) +
206 (mesh.C()[nei].z() - mesh.C()[own].z())*(points[p2].x() - points[p3].x()));
207 aty_[i][1] = OneBySix*((mesh.C()[nei].z() - mesh.C()[own].z())*(points[p3].x() - points[p1].x()) +
208 (mesh.C()[own].x() - mesh.C()[nei].x())*(points[p3].z() - points[p1].z()));
209 aty_[i][2] = OneBySix*((mesh.C()[nei].z() - mesh.C()[own].z())*(points[p1].x() - points[p2].x()) +
210 (mesh.C()[own].x() - mesh.C()[nei].x())*(points[p1].z() - points[p2].z()));
211 aty_[i][3] = OneBySix*(points[p1].x()*(points[p2].z() - points[p3].z()) +
212 points[p2].x()*(points[p3].z() - points[p1].z()) +
213 points[p3].x()*(points[p1].z() - points[p2].z()));
214 aty_[i][4] = -aty_[i][3];
218 atz_[i][0] = OneBySix*((mesh.C()[own].y() - mesh.C()[nei].y())*(points[p2].x() - points[p3].x()) +
219 (mesh.C()[nei].x() - mesh.C()[own].x())*(points[p2].y() - points[p3].y()));
220 atz_[i][1] = OneBySix*((mesh.C()[nei].x() - mesh.C()[own].x())*(points[p3].y() - points[p1].y()) +
221 (mesh.C()[own].y() - mesh.C()[nei].y())*(points[p3].x() - points[p1].x()));
222 atz_[i][2] = OneBySix*((mesh.C()[nei].x() - mesh.C()[own].x())*(points[p1].y() - points[p2].y()) +
223 (mesh.C()[own].y() - mesh.C()[nei].y())*(points[p1].x() - points[p2].x()));
224 atz_[i][3] = OneBySix*(points[p1].y()*(points[p2].x() - points[p3].x()) +
225 points[p2].y()*(points[p3].x() - points[p1].x()) +
226 points[p3].y()*(points[p1].x() - points[p2].x()));
227 atz_[i][4] = -atz_[i][3];
232 batx_[iPatch].resize(btf_[iPatch].size());
233 baty_[iPatch].resize(btf_[iPatch].size());
234 batz_[iPatch].resize(btf_[iPatch].size());
235 bvt_[iPatch].resize(btf_[iPatch].size());
237 vectorField v5(mesh.boundary()[iPatch].size(), vector::zero);
238 vectorField v4(mesh.boundary()[iPatch].size(), vector::zero);
240 v5 = mesh.boundary()[iPatch].Cn();
241 if (processorPatch_[iPatch])
243 v4 = refCast<const processorFvPatch>(mesh.boundary()[iPatch]).
244 procPolyPatch().neighbFaceCellCentres();
250 mesh.boundary()[iPatch].Cf()
260 facei = btf_[iPatch][k];
261 gFaceId = bgfid_[iPatch][facei];
263 p1 = faces[gFaceId][0];
264 p2 = faces[gFaceId][1];
265 p3 = faces[gFaceId][2];
271 ((points[p2] - points[p1]) ^ (points[p3] - points[p1]))
272 & (v5[facei] - v4[facei]);
274 bvt_[iPatch][k] *= OneBySix;
277 batx_[iPatch][k].resize(5);
278 batx_[iPatch][k][0] = OneBySix*((v5[facei].z() - v4[facei].z())*(points[p2].y() - points[p3].y()) +
279 (v4[facei].y() - v5[facei].y())*(points[p2].z() - points[p3].z()));
280 batx_[iPatch][k][1] = OneBySix*((v4[facei].y() - v5[facei].y())*(points[p3].z() - points[p1].z()) +
281 (v5[facei].z() - v4[facei].z())*(points[p3].y() - points[p1].y()));
282 batx_[iPatch][k][2] = OneBySix*((v4[facei].y() - v5[facei].y())*(points[p1].z() - points[p2].z()) +
283 (v5[facei].z() - v4[facei].z())*(points[p1].y() - points[p2].y()));
284 batx_[iPatch][k][3] = OneBySix*(points[p1].z()*(points[p2].y() - points[p3].y()) +
285 points[p2].z()*(points[p3].y() - points[p1].y()) +
286 points[p3].z()*(points[p1].y() - points[p2].y()));
287 batx_[iPatch][k][4] = -batx_[iPatch][k][3];
290 baty_[iPatch][k].resize(5);
291 baty_[iPatch][k][0] = OneBySix*((v5[facei].x() - v4[facei].x())*(points[p2].z() - points[p3].z()) +
292 (v4[facei].z() - v5[facei].z())*(points[p2].x() - points[p3].x()));
293 baty_[iPatch][k][1] = OneBySix*((v4[facei].z() - v5[facei].z())*(points[p3].x() - points[p1].x()) +
294 (v5[facei].x() - v4[facei].x())*(points[p3].z() - points[p1].z()));
295 baty_[iPatch][k][2] = OneBySix*((v4[facei].z() - v5[facei].z())*(points[p1].x() - points[p2].x()) +
296 (v5[facei].x() - v4[facei].x())*(points[p1].z() - points[p2].z()));
297 baty_[iPatch][k][3] = OneBySix*(points[p1].x()*(points[p2].z() - points[p3].z()) +
298 points[p2].x()*(points[p3].z() - points[p1].z()) +
299 points[p3].x()*(points[p1].z() - points[p2].z()));
300 baty_[iPatch][k][4] = -baty_[iPatch][k][3];
303 batz_[iPatch][k].resize(5);
304 batz_[iPatch][k][0] = OneBySix*((v5[facei].y() - v4[facei].y())*(points[p2].x() - points[p3].x()) +
305 (v4[facei].x() - v5[facei].x())*(points[p2].y() - points[p3].y()));
306 batz_[iPatch][k][1] = OneBySix*((v4[facei].x() - v5[facei].x())*(points[p3].y() - points[p1].y()) +
307 (v5[facei].y() - v4[facei].y())*(points[p3].x() - points[p1].x()));
308 batz_[iPatch][k][2] = OneBySix*((v4[facei].x() - v5[facei].x())*(points[p1].y() - points[p2].y()) +
309 (v5[facei].y() - v4[facei].y())*(points[p1].x() - points[p2].x()));
310 batz_[iPatch][k][3] = OneBySix*(points[p1].y()*(points[p2].x() - points[p3].x()) +
311 points[p2].y()*(points[p3].x() - points[p1].x()) +
312 points[p3].y()*(points[p1].x() - points[p2].x()));
313 batz_[iPatch][k][4] = -batz_[iPatch][k][3];
320 const pointField& points = mesh.points();
321 const faceList& faces = mesh.faces();
322 const scalar OneBySix = (1.0 / 6.0);
324 aqx_.resize(qf_.size());
325 aqy_.resize(qf_.size());
326 aqz_.resize(qf_.size());
327 vq_.resize(qf_.size());
330 label p4 = -1, p1 = -1, p2 = -1, p3 = -1;
335 own = mesh.owner()[facei];
336 nei = mesh.neighbour()[facei];
337 p1 = faces[facei][0];
338 p2 = faces[facei][1];
339 p3 = faces[facei][2];
340 p4 = faces[facei][3];
344 vq_[i] = (points[p3] - points[p1]) &
346 (points[p4] - points[p2]) ^ (mesh.C()[own] - mesh.C()[nei])
352 aqx_[i][0] = OneBySix*((mesh.C()[nei].y() - mesh.C()[own].y())*(points[p2].z() - points[p4].z())
353 - (mesh.C()[nei].z() - mesh.C()[own].z())*(points[p2].y() - points[p4].y()));
354 aqx_[i][1] = OneBySix*((mesh.C()[nei].y() - mesh.C()[own].y())*(points[p3].z() - points[p1].z())
355 - (mesh.C()[nei].z() - mesh.C()[own].z())*(points[p3].y() - points[p1].y()));
356 aqx_[i][5] = OneBySix*((points[p1].y() - points[p3].y())*(points[p2].z() - points[p4].z())
357 - (points[p1].z() - points[p3].z())*(points[p2].y() - points[p4].y()));
359 aqx_[i][2] = -aqx_[i][0];
360 aqx_[i][3] = -aqx_[i][1];
361 aqx_[i][4] = -aqx_[i][5];
365 aqy_[i][0] = OneBySix*((mesh.C()[nei].z() - mesh.C()[own].z())*(points[p2].x() - points[p4].x())
366 - (mesh.C()[nei].x() - mesh.C()[own].x())*(points[p2].z() - points[p4].z()));
367 aqy_[i][1] = OneBySix*((mesh.C()[nei].z() - mesh.C()[own].z())*(points[p3].x() - points[p1].x())
368 - (mesh.C()[nei].x() - mesh.C()[own].x())*(points[p3].z() - points[p1].z()));
369 aqy_[i][5] = OneBySix*((points[p1].z() - points[p3].z())*(points[p2].x() - points[p4].x())
370 - (points[p1].x() - points[p3].x())*(points[p2].z() - points[p4].z()));
372 aqy_[i][2] = -aqy_[i][0];
373 aqy_[i][3] = -aqy_[i][1];
374 aqy_[i][4] = -aqy_[i][5];
378 aqz_[i][0] = OneBySix*((mesh.C()[nei].x() - mesh.C()[own].x())*(points[p2].y() - points[p4].y())
379 - (mesh.C()[nei].y() - mesh.C()[own].y())*(points[p2].x() - points[p4].x()));
380 aqz_[i][1] = OneBySix*((mesh.C()[nei].x() - mesh.C()[own].x())*(points[p3].y() - points[p1].y())
381 - (mesh.C()[nei].y() - mesh.C()[own].y())*(points[p3].x() - points[p1].x()));
382 aqz_[i][5] = OneBySix*((points[p1].x() - points[p3].x())*(points[p2].y() - points[p4].y())
383 - (points[p1].y() - points[p3].y())*(points[p2].x() - points[p4].x()));
385 aqz_[i][2] = -aqz_[i][0];
386 aqz_[i][3] = -aqz_[i][1];
387 aqz_[i][4] = -aqz_[i][5];
391 baqx_[iPatch].resize(bqf_[iPatch].size());
392 baqy_[iPatch].resize(bqf_[iPatch].size());
393 baqz_[iPatch].resize(bqf_[iPatch].size());
394 bvq_[iPatch].resize(bqf_[iPatch].size());
396 vectorField v6(mesh.boundary()[iPatch].size(), vector::zero);
397 vectorField v5(mesh.boundary()[iPatch].size(), vector::zero);
399 v6 = mesh.boundary()[iPatch].Cn();
400 if (processorPatch_[iPatch])
402 v5 = refCast<const processorFvPatch>(mesh.boundary()[iPatch]).
403 procPolyPatch().neighbFaceCellCentres();
409 mesh.boundary()[iPatch].Cf()
418 facei = bqf_[iPatch][k];
419 gFaceId = bgfid_[iPatch][facei];
421 p1 = faces[gFaceId][0];
422 p2 = faces[gFaceId][1];
423 p3 = faces[gFaceId][2];
424 p4 = faces[gFaceId][3];
428 bvq_[iPatch][k] = (points[p3] - points[p1]) &
430 (points[p4] - points[p2]) ^ (v6[facei] - v5[facei])
432 bvq_[iPatch][k] *= OneBySix;
435 baqx_[iPatch][k].resize(6);
436 baqx_[iPatch][k][0] = OneBySix*((v5[facei].y() - v6[facei].y())*(points[p2].z() - points[p4].z())
437 - (v5[facei].z() - v6[facei].z())*(points[p2].y() - points[p4].y()));
438 baqx_[iPatch][k][1] = OneBySix*((v5[facei].y() - v6[facei].y())*(points[p3].z() - points[p1].z())
439 - (v5[facei].z() - v6[facei].z())*(points[p3].y() - points[p1].y()));
440 baqx_[iPatch][k][5] = OneBySix*((points[p1].y() - points[p3].y())*(points[p2].z() - points[p4].z())
441 - (points[p1].z() - points[p3].z())*(points[p2].y() - points[p4].y()));
443 baqx_[iPatch][k][2] = -baqx_[iPatch][k][0];
444 baqx_[iPatch][k][3] = -baqx_[iPatch][k][1];
445 baqx_[iPatch][k][4] = -baqx_[iPatch][k][5];
448 baqy_[iPatch][k].resize(6);
449 baqy_[iPatch][k][0] = OneBySix*((v5[facei].z() - v6[facei].z())*(points[p2].x() - points[p4].x())
450 - (v5[facei].x() - v6[facei].x())*(points[p2].z() - points[p4].z()));
451 baqy_[iPatch][k][1] = OneBySix*((v5[facei].z() - v6[facei].z())*(points[p3].x() - points[p1].x())
452 - (v5[facei].x() - v6[facei].x())*(points[p3].z() - points[p1].z()));
453 baqy_[iPatch][k][5] = OneBySix*((points[p1].z() - points[p3].z())*(points[p2].x() - points[p4].x())
454 - (points[p1].x() - points[p3].x())*(points[p2].z() - points[p4].z()));
456 baqy_[iPatch][k][2] = -baqy_[iPatch][k][0];
457 baqy_[iPatch][k][3] = -baqy_[iPatch][k][1];
458 baqy_[iPatch][k][4] = -baqy_[iPatch][k][5];
461 baqz_[iPatch][k].resize(6);
462 baqz_[iPatch][k][0] = OneBySix*((v5[facei].x() - v6[facei].x())*(points[p2].y() - points[p4].y())
463 - (v5[facei].y() - v6[facei].y())*(points[p2].x() - points[p4].x()));
464 baqz_[iPatch][k][1] = OneBySix*((v5[facei].x() - v6[facei].x())*(points[p3].y() - points[p1].y())
465 - (v5[facei].y() - v6[facei].y())*(points[p3].x() - points[p1].x()));
466 baqz_[iPatch][k][5] = OneBySix*((points[p1].x() - points[p3].x())*(points[p2].y() - points[p4].y())
467 - (points[p1].y() - points[p3].y())*(points[p2].x() - points[p4].x()));
469 baqz_[iPatch][k][2] = -baqz_[iPatch][k][0];
470 baqz_[iPatch][k][3] = -baqz_[iPatch][k][1];
471 baqz_[iPatch][k][4] = -baqz_[iPatch][k][5];
480 #define VEC_CMPT(V,CMPT)\
483 #define SCA_CMPT(V,CMPT)\
486 #define dfdxif(vf,pf,dfdxfield,fi,vi,ai,icmpt,ocmpt,iop,oop) \
490 const label iown = (ai.size() > 0) ? ai[0].size() - 1 : 0; \
491 const label inei = (ai.size() > 0) ? iown - 1 : 0; \
492 scalar dfdxface = 0.0; \
496 celll = vf.mesh().neighbour()[facei]; \
498 iop(vf.primitiveField()[celll],icmpt) * ai[i][inei]; \
499 celll = vf.mesh().owner()[facei]; \
501 iop(vf.primitiveField()[celll],icmpt) * ai[i][iown]; \
503 forAll(faces[facei], k) \
506 iop(pf[faces[facei][k]],icmpt) * ai[i][k]; \
508 oop(dfdxfield.primitiveFieldRef()[facei],ocmpt) \
509 += (dfdxface / vi[i]); \
513 #define dfdxbf(vf,pf,patchi,dfdxfield,bfi,bvfi,bai,icmpt,ocmpt,iop,oop) \
516 const label iown = (bai[patchi].size() > 0) ? bai[patchi][0].size() - 1 : 0; \
517 const label inei = (bai[patchi].size() > 0) ? iown - 1 : 0; \
518 label gFaceId = -1; \
519 scalar dfdxface = 0.0; \
520 forAll(bfi[patchi], i) \
522 ifacei = bfi[patchi][i]; \
523 gFaceId = bgfid_[patchi][ifacei]; \
525 iop(psin[patchi][ifacei],icmpt) * bai[patchi][i][inei]; \
527 iop(psio[ifacei],icmpt) * bai[patchi][i][iown]; \
528 forAll(faces[gFaceId], k) \
531 iop(pf[faces[gFaceId][k]],icmpt) * \
534 oop(dfdxfield.boundaryFieldRef()[patchi][ifacei],ocmpt) += \
535 dfdxface / bvfi[patchi][i]; \
543 const volVectorField& vf,
544 const pointVectorField&
pf,
546 surfaceScalarField& divf,
547 const surfaceScalarField& dfdn
566 divf.primitiveFieldRef()[facei] =
567 dfdn.primitiveField()[facei];
574 const volVectorField& vf,
575 const pointVectorField& pf,
577 surfaceScalarField& divf,
578 const surfaceScalarField& dfdn
581 List<List<vector> > psin (vf.boundaryField().size());
584 if (processorPatch_[iPatch])
586 psin[iPatch] = refCast<const processorFvPatchField<vector> >
587 (vf.boundaryField()[iPatch]).patchNeighbourField();
591 psin[iPatch] = vf.boundaryField()[iPatch] +
592 vf.boundaryField()[iPatch].snGrad()
597 vectorField psio (vf.boundaryField()[iPatch].patchInternalField());
600 dfdxbf(vf,pf,iPatch,divf,bqf_,bvq_,baqx_,0,0,
VEC_CMPT,
SCA_CMPT)
601 dfdxbf(vf,pf,iPatch,divf,bqf_,bvq_,baqy_,1,0,
VEC_CMPT,
SCA_CMPT)
602 dfdxbf(vf,pf,iPatch,divf,bqf_,bvq_,baqz_,2,0,VEC_CMPT,
SCA_CMPT)
605 dfdxbf(vf,pf,iPatch,divf,btf_,bvt_,batx_,0,0,VEC_CMPT,
SCA_CMPT)
606 dfdxbf(vf,pf,iPatch,divf,btf_,bvt_,baty_,1,0,VEC_CMPT,
SCA_CMPT)
607 dfdxbf(vf,pf,iPatch,divf,btf_,bvt_,batz_,2,0,VEC_CMPT,
SCA_CMPT)
614 facei = bof_[iPatch][i];
615 divf.boundaryFieldRef()[iPatch][facei] =
616 dfdn.boundaryField()[iPatch][facei];
624 const volTensorField& tf,
625 const pointTensorField& pf,
627 surfaceVectorField& divf,
628 const surfaceVectorField& dfdn
666 divf.primitiveFieldRef()[facei] =
667 dfdn.primitiveField()[facei];
674 const volTensorField& tf,
675 const pointTensorField& pf,
677 surfaceVectorField& divf,
678 const surfaceVectorField& dfdn
681 List<List<tensor> > psin (tf.boundaryField().size());
684 if (processorPatch_[iPatch])
686 psin[iPatch] = refCast<const processorFvPatchField<tensor> >
687 (tf.boundaryField()[iPatch]).patchNeighbourField();
691 psin[iPatch] = tf.boundaryField()[iPatch] +
692 tf.boundaryField()[iPatch].snGrad()
697 tensorField psio (tf.boundaryField()[iPatch].patchInternalField());
700 dfdxbf(tf,pf,iPatch,divf,bqf_,bvq_,baqx_,0,0,
VEC_CMPT,
VEC_CMPT)
701 dfdxbf(tf,pf,iPatch,divf,bqf_,bvq_,baqy_,3,0,
VEC_CMPT,VEC_CMPT)
702 dfdxbf(tf,pf,iPatch,divf,bqf_,bvq_,baqz_,6,0,VEC_CMPT,VEC_CMPT)
704 dfdxbf(tf,pf,iPatch,divf,bqf_,bvq_,baqx_,1,1,VEC_CMPT,VEC_CMPT)
705 dfdxbf(tf,pf,iPatch,divf,bqf_,bvq_,baqy_,4,1,VEC_CMPT,VEC_CMPT)
706 dfdxbf(tf,pf,iPatch,divf,bqf_,bvq_,baqz_,7,1,VEC_CMPT,VEC_CMPT)
708 dfdxbf(tf,pf,iPatch,divf,bqf_,bvq_,baqx_,2,2,VEC_CMPT,VEC_CMPT)
709 dfdxbf(tf,pf,iPatch,divf,bqf_,bvq_,baqy_,5,2,VEC_CMPT,VEC_CMPT)
710 dfdxbf(tf,pf,iPatch,divf,bqf_,bvq_,baqz_,8,2,VEC_CMPT,VEC_CMPT)
713 dfdxbf(tf,pf,iPatch,divf,btf_,bvt_,batx_,0,0,VEC_CMPT,VEC_CMPT)
714 dfdxbf(tf,pf,iPatch,divf,btf_,bvt_,baty_,3,0,VEC_CMPT,VEC_CMPT)
715 dfdxbf(tf,pf,iPatch,divf,btf_,bvt_,batz_,6,0,VEC_CMPT,VEC_CMPT)
717 dfdxbf(tf,pf,iPatch,divf,btf_,bvt_,batx_,1,1,VEC_CMPT,VEC_CMPT)
718 dfdxbf(tf,pf,iPatch,divf,btf_,bvt_,baty_,4,1,VEC_CMPT,VEC_CMPT)
719 dfdxbf(tf,pf,iPatch,divf,btf_,bvt_,batz_,7,1,VEC_CMPT,VEC_CMPT)
721 dfdxbf(tf,pf,iPatch,divf,btf_,bvt_,batx_,2,2,VEC_CMPT,VEC_CMPT)
722 dfdxbf(tf,pf,iPatch,divf,btf_,bvt_,baty_,5,2,VEC_CMPT,VEC_CMPT)
723 dfdxbf(tf,pf,iPatch,divf,btf_,bvt_,batz_,8,2,VEC_CMPT,VEC_CMPT)
730 facei = bof_[iPatch][i];
731 divf.boundaryFieldRef()[iPatch][facei] =
732 dfdn.boundaryField()[iPatch][facei];
740 const volScalarField& sf,
741 const pointScalarField& pf,
743 surfaceVectorField& gradf,
744 const surfaceVectorField& dfdn
763 gradf.primitiveFieldRef()[facei] =
764 dfdn.primitiveField()[facei];
771 const volScalarField& sf,
772 const pointScalarField& pf,
774 surfaceVectorField& gradf,
775 const surfaceVectorField& dfdn
778 List<List<scalar> > psin (sf.boundaryField().size());
781 if (processorPatch_[iPatch])
783 psin[iPatch] = refCast<const processorFvPatchField<scalar> >
784 (sf.boundaryField()[iPatch]).patchNeighbourField();
788 psin[iPatch] = sf.boundaryField()[iPatch] +
789 sf.boundaryField()[iPatch].snGrad()
794 scalarField psio (sf.boundaryField()[iPatch].patchInternalField());
797 dfdxbf(sf,pf,iPatch,gradf,bqf_,bvq_,baqx_,0,0,
SCA_CMPT,
VEC_CMPT)
798 dfdxbf(sf,pf,iPatch,gradf,bqf_,bvq_,baqy_,0,1,
SCA_CMPT,
VEC_CMPT)
799 dfdxbf(sf,pf,iPatch,gradf,bqf_,bvq_,baqz_,0,2,SCA_CMPT,
VEC_CMPT)
802 dfdxbf(sf,pf,iPatch,gradf,btf_,bvt_,batx_,0,0,SCA_CMPT,
VEC_CMPT)
803 dfdxbf(sf,pf,iPatch,gradf,btf_,bvt_,baty_,0,1,SCA_CMPT,
VEC_CMPT)
804 dfdxbf(sf,pf,iPatch,gradf,btf_,bvt_,batz_,0,2,SCA_CMPT,
VEC_CMPT)
811 facei = bof_[iPatch][i];
812 gradf.boundaryFieldRef()[iPatch][facei] =
813 dfdn.boundaryField()[iPatch][facei];
821 const volVectorField& vf,
822 const pointVectorField& pf,
824 surfaceTensorField& gradf,
825 const surfaceTensorField& dfdn
860 gradf.primitiveFieldRef()[facei] =
861 dfdn.primitiveField()[facei];
868 const volVectorField& sf,
869 const pointVectorField& pf,
871 surfaceTensorField& gradf,
872 const surfaceTensorField& dfdn
875 List<List<vector> > psin (sf.boundaryField().size());
878 if (processorPatch_[iPatch])
880 psin[iPatch] = refCast<const processorFvPatchField<vector> >
881 (sf.boundaryField()[iPatch]).patchNeighbourField();
885 psin[iPatch] = sf.boundaryField()[iPatch] +
886 sf.boundaryField()[iPatch].snGrad()
891 vectorField psio (sf.boundaryField()[iPatch].patchInternalField());
894 dfdxbf(sf,pf,iPatch,gradf,bqf_,bvq_,baqx_,0,0,
VEC_CMPT,
VEC_CMPT)
895 dfdxbf(sf,pf,iPatch,gradf,bqf_,bvq_,baqx_,1,1,
VEC_CMPT,VEC_CMPT)
896 dfdxbf(sf,pf,iPatch,gradf,bqf_,bvq_,baqx_,2,2,VEC_CMPT,VEC_CMPT)
898 dfdxbf(sf,pf,iPatch,gradf,bqf_,bvq_,baqy_,0,3,VEC_CMPT,VEC_CMPT)
899 dfdxbf(sf,pf,iPatch,gradf,bqf_,bvq_,baqy_,1,4,VEC_CMPT,VEC_CMPT)
900 dfdxbf(sf,pf,iPatch,gradf,bqf_,bvq_,baqy_,2,5,VEC_CMPT,VEC_CMPT)
902 dfdxbf(sf,pf,iPatch,gradf,bqf_,bvq_,baqz_,0,6,VEC_CMPT,VEC_CMPT)
903 dfdxbf(sf,pf,iPatch,gradf,bqf_,bvq_,baqz_,1,7,VEC_CMPT,VEC_CMPT)
904 dfdxbf(sf,pf,iPatch,gradf,bqf_,bvq_,baqz_,2,8,VEC_CMPT,VEC_CMPT)
907 dfdxbf(sf,pf,iPatch,gradf,btf_,bvt_,batx_,0,0,VEC_CMPT,VEC_CMPT)
908 dfdxbf(sf,pf,iPatch,gradf,btf_,bvt_,batx_,1,1,VEC_CMPT,VEC_CMPT)
909 dfdxbf(sf,pf,iPatch,gradf,btf_,bvt_,batx_,2,2,VEC_CMPT,VEC_CMPT)
911 dfdxbf(sf,pf,iPatch,gradf,btf_,bvt_,baty_,0,3,VEC_CMPT,VEC_CMPT)
912 dfdxbf(sf,pf,iPatch,gradf,btf_,bvt_,baty_,1,4,VEC_CMPT,VEC_CMPT)
913 dfdxbf(sf,pf,iPatch,gradf,btf_,bvt_,baty_,2,5,VEC_CMPT,VEC_CMPT)
915 dfdxbf(sf,pf,iPatch,gradf,btf_,bvt_,batz_,0,6,VEC_CMPT,VEC_CMPT)
916 dfdxbf(sf,pf,iPatch,gradf,btf_,bvt_,batz_,1,7,VEC_CMPT,VEC_CMPT)
917 dfdxbf(sf,pf,iPatch,gradf,btf_,bvt_,batz_,2,8,VEC_CMPT,VEC_CMPT)
924 facei = bof_[iPatch][i];
925 gradf.boundaryFieldRef()[iPatch][facei] =
926 dfdn.boundaryField()[iPatch][facei];
936 volPoint_.interpolate
942 const surfaceVectorField& nf = nfRef_();
943 surfaceVectorField dfdn
948 const faceList& faces = sf.mesh().faces();
954 calcGradfIF(sf, pF, faces, gradf, dfdn);
960 calcGradfBF(sf, pF, faces, gradf, dfdn);
967 volPoint_.interpolate
973 const surfaceVectorField& nf = nfRef_();
974 surfaceTensorField dfdn
979 const faceList& faces = vf.mesh().faces();
985 calcGradfIF(vf, pF, faces, gradf, dfdn);
991 calcGradfBF(vf, pF, faces, gradf, dfdn);
998 volPoint_.interpolate
1004 surfaceScalarField divfn (nfRef_() & fvc::snGrad(vf));
1005 const faceList& faces = vf.mesh().faces();
1011 calcDivfIF(vf, pF, faces, divf, divfn);
1017 calcDivfBF(vf, pF, faces, divf, divfn);
1024 volPoint_.interpolate
1030 surfaceVectorField divfn (nfRef_() & fvc::snGrad(tf));
1031 const faceList& faces = tf.mesh().faces();
1037 calcDivfIF(tf, pF, faces, divf, divfn);
1043 calcDivfBF(tf, pF, faces, divf, divfn);
void faceDiv(const volVectorField &f, surfaceScalarField &divf)
void faceGrad(const volScalarField &f, surfaceVectorField &gradf)
#define VEC_CMPT(V, CMPT)
void triCalcWeights(const fvMesh &m)
Calculate weights for triangles.
static autoPtr< fvscStencil > New(const word &name, const fvMesh &mesh)
Return a reference to the selected fvscStencil model.
#define dfdxif(vf, pf, dfdxfield, fi, vi, ai, icmpt, ocmpt, iop, oop)
void calcDivfBF(const volVectorField &sf, const pointVectorField &pf, const faceList &faces, surfaceScalarField &divf, const surfaceScalarField &dfdn)
void calcGradfBF(const volScalarField &sf, const pointScalarField &pf, const faceList &faces, surfaceVectorField &gradf, const surfaceVectorField &dfdn)
GaussVolPointBase3D(const fvMesh &mesh)
void calcGradfIF(const volScalarField &sf, const pointScalarField &pf, const faceList &faces, surfaceVectorField &gradf, const surfaceVectorField &dfdn)
#define SCA_CMPT(V, CMPT)
void quaCalcWeights(const fvMesh &m)
Calcualte weights for quads.
#define dfdxbf(vf, pf, patchi, dfdxfield, bfi, bvfi, bai, icmpt, ocmpt, iop, oop)
void calcDivfIF(const volVectorField &sf, const pointVectorField &pf, const faceList &faces, surfaceScalarField &divf, const surfaceScalarField &dfdn)