Removed unneeded lib dependency from mdInitialise
[foam-extend-3.2.git] / applications / solvers / surfaceTracking / include / setRefCell.H
blobc50161301a4728d6988a85081f537bb3d830df70
1 label pRefCell = 0;
2 scalar pRefValue = 0.0;
3 bool pNeedRef = false;
4 bool procHasRef = false;
6 if (interface.twoFluids())
8     pNeedRef = true;
11 forAll (p.boundaryField(), patchI)
13     // Check only fluid B
14     if (fluidIndicator.boundaryField()[patchI].size())
15     {
16         if (min(fluidIndicator.boundaryField()[patchI]) < SMALL)
17         {
18             if (p.boundaryField()[patchI].fixesValue())
19             {
20                 pNeedRef = false;
21             }
22         }
23     }
26 pNeedRef = returnReduce<bool>(pNeedRef, andOp<bool>());
28 // Find reference cell
29 if (pNeedRef)
31     point refPointi(mesh.solutionDict().subDict("PISO").lookup("pRefPoint"));
32     label refCelli = mesh.findCell(refPointi);
33     label hasRef = (refCelli >= 0 ? 1 : 0);
34     label sumHasRef = returnReduce<label>(hasRef, sumOp<label>());
36     if (sumHasRef != 1)
37     {
38         FatalErrorIn(args.executable())
39             << "Unable to set reference cell for field "
40                 << p.name()
41                 << nl << "    Reference point pRefPoint"
42                 << " found on " << sumHasRef << " domains (should be one)"
43                 << nl << exit(FatalError);
44     }
46     if (hasRef)
47     {
48         pRefCell = refCelli;
49         procHasRef = true;
50     }
52     pRefValue =
53         readScalar(mesh.solutionDict().subDict("PISO").lookup("pRefValue"));