|
13 | 13 | );
|
14 | 14 |
|
15 | 15 | //-- Reading patch information
|
16 |
| - word patchName = args.opt("patch"); |
| 16 | + word patchName = args.option("patch"); |
17 | 17 | label patchID = mesh.boundaryMesh().findPatchID(patchName);
|
18 | 18 | fvPatchScalarField& potentialPatch = potential.boundaryFieldRef()[patchID];
|
19 | 19 |
|
20 | 20 | //-- Compute and set up head pressure
|
21 |
| - if (args.found("DEM")) |
| 21 | + if (args.optionFound("DEM")) |
22 | 22 | {
|
23 | 23 | //- reading DEM informations
|
24 |
| - DEMfile fixedPotentialDEM(args.opt("DEM")); |
25 |
| - scalar offsetPotential = args.getOrDefault<scalar>("offset",0.); |
| 24 | + DEMfile fixedPotentialDEM(args.option("DEM")); |
| 25 | + scalar offsetPotential = args.optionLookupOrDefault<scalar>("offset",0.); |
26 | 26 | if (offsetPotential==0)
|
27 | 27 | {
|
28 | 28 | Info << nl << "Potential fixed using DEM" << endl;
|
|
39 | 39 | potentialPatch[facei] = fixedPotentialDEM.interpolate(faces[facei]) + offsetPotential;
|
40 | 40 | }
|
41 | 41 | }
|
42 |
| - else if (args.found("STL")) |
| 42 | + else if (args.optionFound("STL")) |
43 | 43 | {
|
44 | 44 | //- reading STL informations
|
45 |
| - word STLfile = args.opt("STL"); |
| 45 | + word STLfile = args.option("STL"); |
46 | 46 | triSurfaceMesh potentialSTL(IOobject(STLfile,mesh));
|
47 | 47 | pointField pPoints( potentialSTL.points() );
|
48 |
| - scalar thresholdPotential = args.getOrDefault<scalar>("threshold",0.); |
49 |
| - scalar offsetPotential = args.getOrDefault<scalar>("offset",0.); |
| 48 | + scalar thresholdPotential = args.optionLookupOrDefault<scalar>("threshold",0.); |
| 49 | + scalar offsetPotential = args.optionLookupOrDefault<scalar>("offset",0.); |
50 | 50 | Info << nl << "Potential fixed using points over " << thresholdPotential << " in STL = " << STLfile << " offseted by " << offsetPotential << endl;
|
51 | 51 | const vectorField& faces = mesh.boundary()[patchID].patch().faceCentres();
|
52 | 52 |
|
|
70 | 70 | potentialPatch[facei] = pPoints[id_point].z() + offsetPotential;
|
71 | 71 | }
|
72 | 72 | }
|
73 |
| - else if (args.found("value")) |
| 73 | + else if (args.optionFound("value")) |
74 | 74 | {
|
75 | 75 | //- uniform potential
|
76 |
| - scalar uniformPotential = args.getOrDefault<scalar>("value",0.); |
| 76 | + scalar uniformPotential = args.optionLookupOrDefault<scalar>("value",0.); |
77 | 77 | Info << nl << "Uniform potential fixed = " << uniformPotential << " m " << endl;
|
78 | 78 | //- computing and writing local potential
|
79 | 79 | forAll(potentialPatch,facei)
|
|
0 commit comments