mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
GIT: Initial state after latest Foundation merge
This commit is contained in:
@ -72,17 +72,17 @@ void modifyOrAddFace
|
||||
(
|
||||
polyTopoChange& meshMod,
|
||||
const face& f,
|
||||
const label faceI,
|
||||
const label facei,
|
||||
const label own,
|
||||
const bool flipFaceFlux,
|
||||
const label newPatchI,
|
||||
const label newPatchi,
|
||||
const label zoneID,
|
||||
const bool zoneFlip,
|
||||
|
||||
PackedBoolList& modifiedFace
|
||||
)
|
||||
{
|
||||
if (!modifiedFace[faceI])
|
||||
if (!modifiedFace[facei])
|
||||
{
|
||||
// First usage of face. Modify.
|
||||
meshMod.setAction
|
||||
@ -90,17 +90,17 @@ void modifyOrAddFace
|
||||
polyModifyFace
|
||||
(
|
||||
f, // modified face
|
||||
faceI, // label of face
|
||||
facei, // label of face
|
||||
own, // owner
|
||||
-1, // neighbour
|
||||
flipFaceFlux, // face flip
|
||||
newPatchI, // patch for face
|
||||
newPatchi, // patch for face
|
||||
false, // remove from zone
|
||||
zoneID, // zone for face
|
||||
zoneFlip // face flip in zone
|
||||
)
|
||||
);
|
||||
modifiedFace[faceI] = 1;
|
||||
modifiedFace[facei] = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -114,9 +114,9 @@ void modifyOrAddFace
|
||||
-1, // neighbour
|
||||
-1, // master point
|
||||
-1, // master edge
|
||||
faceI, // master face
|
||||
facei, // master face
|
||||
flipFaceFlux, // face flip
|
||||
newPatchI, // patch for face
|
||||
newPatchi, // patch for face
|
||||
zoneID, // zone for face
|
||||
zoneFlip // face flip in zone
|
||||
)
|
||||
@ -130,7 +130,7 @@ void subsetVolFields
|
||||
(
|
||||
const fvMeshSubset& subsetter,
|
||||
const IOobjectList& objectsList,
|
||||
const label patchI,
|
||||
const label patchi,
|
||||
const Type& exposedValue,
|
||||
const word GeomVolType,
|
||||
PtrList<GeometricField<Type, fvPatchField, volMesh>>& subFields
|
||||
@ -156,17 +156,17 @@ void subsetVolFields
|
||||
|
||||
subFields.set(i, subsetter.interpolate(volField));
|
||||
|
||||
// Explicitly set exposed faces (in patchI) to exposedValue.
|
||||
if (patchI >= 0)
|
||||
// Explicitly set exposed faces (in patchi) to exposedValue.
|
||||
if (patchi >= 0)
|
||||
{
|
||||
fvPatchField<Type>& fld =
|
||||
subFields[i++].boundaryField()[patchI];
|
||||
subFields[i++].boundaryFieldRef()[patchi];
|
||||
|
||||
label newStart = fld.patch().patch().start();
|
||||
|
||||
label oldPatchI = subsetter.patchMap()[patchI];
|
||||
label oldPatchi = subsetter.patchMap()[patchi];
|
||||
|
||||
if (oldPatchI == -1)
|
||||
if (oldPatchi == -1)
|
||||
{
|
||||
// New patch. Reset whole value.
|
||||
fld = exposedValue;
|
||||
@ -175,17 +175,17 @@ void subsetVolFields
|
||||
{
|
||||
// Reset those faces that originate from different patch
|
||||
// or internal faces.
|
||||
label oldSize = volField.boundaryField()[oldPatchI].size();
|
||||
label oldSize = volField.boundaryField()[oldPatchi].size();
|
||||
label oldStart = volField.boundaryField()
|
||||
[
|
||||
oldPatchI
|
||||
oldPatchi
|
||||
].patch().patch().start();
|
||||
|
||||
forAll(fld, j)
|
||||
{
|
||||
label oldFaceI = subsetter.faceMap()[newStart+j];
|
||||
label oldFacei = subsetter.faceMap()[newStart+j];
|
||||
|
||||
if (oldFaceI < oldStart || oldFaceI >= oldStart+oldSize)
|
||||
if (oldFacei < oldStart || oldFacei >= oldStart+oldSize)
|
||||
{
|
||||
fld[j] = exposedValue;
|
||||
}
|
||||
@ -202,7 +202,7 @@ void subsetSurfaceFields
|
||||
(
|
||||
const fvMeshSubset& subsetter,
|
||||
const IOobjectList& objectsList,
|
||||
const label patchI,
|
||||
const label patchi,
|
||||
const Type& exposedValue,
|
||||
const word GeomSurfType,
|
||||
PtrList<GeometricField<Type, fvsPatchField, surfaceMesh>>& subFields
|
||||
@ -229,17 +229,17 @@ void subsetSurfaceFields
|
||||
subFields.set(i, subsetter.interpolate(volField));
|
||||
|
||||
|
||||
// Explicitly set exposed faces (in patchI) to exposedValue.
|
||||
if (patchI >= 0)
|
||||
// Explicitly set exposed faces (in patchi) to exposedValue.
|
||||
if (patchi >= 0)
|
||||
{
|
||||
fvsPatchField<Type>& fld =
|
||||
subFields[i++].boundaryField()[patchI];
|
||||
subFields[i++].boundaryFieldRef()[patchi];
|
||||
|
||||
label newStart = fld.patch().patch().start();
|
||||
|
||||
label oldPatchI = subsetter.patchMap()[patchI];
|
||||
label oldPatchi = subsetter.patchMap()[patchi];
|
||||
|
||||
if (oldPatchI == -1)
|
||||
if (oldPatchi == -1)
|
||||
{
|
||||
// New patch. Reset whole value.
|
||||
fld = exposedValue;
|
||||
@ -248,17 +248,17 @@ void subsetSurfaceFields
|
||||
{
|
||||
// Reset those faces that originate from different patch
|
||||
// or internal faces.
|
||||
label oldSize = volField.boundaryField()[oldPatchI].size();
|
||||
label oldSize = volField.boundaryField()[oldPatchi].size();
|
||||
label oldStart = volField.boundaryField()
|
||||
[
|
||||
oldPatchI
|
||||
oldPatchi
|
||||
].patch().patch().start();
|
||||
|
||||
forAll(fld, j)
|
||||
{
|
||||
label oldFaceI = subsetter.faceMap()[newStart+j];
|
||||
label oldFacei = subsetter.faceMap()[newStart+j];
|
||||
|
||||
if (oldFaceI < oldStart || oldFaceI >= oldStart+oldSize)
|
||||
if (oldFacei < oldStart || oldFacei >= oldStart+oldSize)
|
||||
{
|
||||
fld[j] = exposedValue;
|
||||
}
|
||||
@ -295,16 +295,19 @@ void initCreatedPatches
|
||||
{
|
||||
GeoField& field = const_cast<GeoField&>(*fieldIter());
|
||||
|
||||
forAll(field.boundaryField(), patchi)
|
||||
typename GeoField::Boundary& fieldBf =
|
||||
field.boundaryFieldRef();
|
||||
|
||||
forAll(fieldBf, patchi)
|
||||
{
|
||||
if (map.oldPatchSizes()[patchi] == 0)
|
||||
{
|
||||
// Not mapped.
|
||||
field.boundaryField()[patchi] = initValue;
|
||||
fieldBf[patchi] = initValue;
|
||||
|
||||
if (field.boundaryField()[patchi].fixesValue())
|
||||
if (fieldBf[patchi].fixesValue())
|
||||
{
|
||||
field.boundaryField()[patchi] == initValue;
|
||||
fieldBf[patchi] == initValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -322,18 +325,18 @@ void createCoupledBaffles
|
||||
{
|
||||
const faceZoneMesh& faceZones = mesh.faceZones();
|
||||
|
||||
forAll(coupledWantedPatch, faceI)
|
||||
forAll(coupledWantedPatch, facei)
|
||||
{
|
||||
if (coupledWantedPatch[faceI] != -1)
|
||||
if (coupledWantedPatch[facei] != -1)
|
||||
{
|
||||
const face& f = mesh.faces()[faceI];
|
||||
label zoneID = faceZones.whichZone(faceI);
|
||||
const face& f = mesh.faces()[facei];
|
||||
label zoneID = faceZones.whichZone(facei);
|
||||
bool zoneFlip = false;
|
||||
|
||||
if (zoneID >= 0)
|
||||
{
|
||||
const faceZone& fZone = faceZones[zoneID];
|
||||
zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
|
||||
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
|
||||
}
|
||||
|
||||
// Use owner side of face
|
||||
@ -341,34 +344,34 @@ void createCoupledBaffles
|
||||
(
|
||||
meshMod,
|
||||
f, // modified face
|
||||
faceI, // label of face
|
||||
mesh.faceOwner()[faceI], // owner
|
||||
facei, // label of face
|
||||
mesh.faceOwner()[facei], // owner
|
||||
false, // face flip
|
||||
coupledWantedPatch[faceI], // patch for face
|
||||
coupledWantedPatch[facei], // patch for face
|
||||
zoneID, // zone for face
|
||||
zoneFlip, // face flip in zone
|
||||
modifiedFace // modify or add status
|
||||
);
|
||||
|
||||
if (mesh.isInternalFace(faceI))
|
||||
if (mesh.isInternalFace(facei))
|
||||
{
|
||||
label zoneID = faceZones.whichZone(faceI);
|
||||
label zoneID = faceZones.whichZone(facei);
|
||||
bool zoneFlip = false;
|
||||
|
||||
if (zoneID >= 0)
|
||||
{
|
||||
const faceZone& fZone = faceZones[zoneID];
|
||||
zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
|
||||
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
|
||||
}
|
||||
// Use neighbour side of face
|
||||
modifyOrAddFace
|
||||
(
|
||||
meshMod,
|
||||
f.reverseFace(), // modified face
|
||||
faceI, // label of face
|
||||
mesh.faceNeighbour()[faceI],// owner
|
||||
facei, // label of face
|
||||
mesh.faceNeighbour()[facei],// owner
|
||||
false, // face flip
|
||||
coupledWantedPatch[faceI], // patch for face
|
||||
coupledWantedPatch[facei], // patch for face
|
||||
zoneID, // zone for face
|
||||
zoneFlip, // face flip in zone
|
||||
modifiedFace // modify or add status
|
||||
@ -390,29 +393,29 @@ void createCyclicCoupledBaffles
|
||||
{
|
||||
const faceZoneMesh& faceZones = mesh.faceZones();
|
||||
|
||||
forAll(cyclicMasterPatch, faceI)
|
||||
forAll(cyclicMasterPatch, facei)
|
||||
{
|
||||
if (cyclicMasterPatch[faceI] != -1)
|
||||
if (cyclicMasterPatch[facei] != -1)
|
||||
{
|
||||
const face& f = mesh.faces()[faceI];
|
||||
const face& f = mesh.faces()[facei];
|
||||
|
||||
label zoneID = faceZones.whichZone(faceI);
|
||||
label zoneID = faceZones.whichZone(facei);
|
||||
bool zoneFlip = false;
|
||||
|
||||
if (zoneID >= 0)
|
||||
{
|
||||
const faceZone& fZone = faceZones[zoneID];
|
||||
zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
|
||||
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
|
||||
}
|
||||
|
||||
modifyOrAddFace
|
||||
(
|
||||
meshMod,
|
||||
f.reverseFace(), // modified face
|
||||
faceI, // label of face
|
||||
mesh.faceNeighbour()[faceI], // owner
|
||||
facei, // label of face
|
||||
mesh.faceNeighbour()[facei], // owner
|
||||
false, // face flip
|
||||
cyclicMasterPatch[faceI], // patch for face
|
||||
cyclicMasterPatch[facei], // patch for face
|
||||
zoneID, // zone for face
|
||||
zoneFlip, // face flip in zone
|
||||
modifiedFace // modify or add
|
||||
@ -420,30 +423,30 @@ void createCyclicCoupledBaffles
|
||||
}
|
||||
}
|
||||
|
||||
forAll(cyclicSlavePatch, faceI)
|
||||
forAll(cyclicSlavePatch, facei)
|
||||
{
|
||||
if (cyclicSlavePatch[faceI] != -1)
|
||||
if (cyclicSlavePatch[facei] != -1)
|
||||
{
|
||||
const face& f = mesh.faces()[faceI];
|
||||
if (mesh.isInternalFace(faceI))
|
||||
const face& f = mesh.faces()[facei];
|
||||
if (mesh.isInternalFace(facei))
|
||||
{
|
||||
label zoneID = faceZones.whichZone(faceI);
|
||||
label zoneID = faceZones.whichZone(facei);
|
||||
bool zoneFlip = false;
|
||||
|
||||
if (zoneID >= 0)
|
||||
{
|
||||
const faceZone& fZone = faceZones[zoneID];
|
||||
zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
|
||||
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
|
||||
}
|
||||
// Use owner side of face
|
||||
modifyOrAddFace
|
||||
(
|
||||
meshMod,
|
||||
f, // modified face
|
||||
faceI, // label of face
|
||||
mesh.faceOwner()[faceI], // owner
|
||||
facei, // label of face
|
||||
mesh.faceOwner()[facei], // owner
|
||||
false, // face flip
|
||||
cyclicSlavePatch[faceI], // patch for face
|
||||
cyclicSlavePatch[facei], // patch for face
|
||||
zoneID, // zone for face
|
||||
zoneFlip, // face flip in zone
|
||||
modifiedFace // modify or add status
|
||||
@ -463,19 +466,19 @@ void createBaffles
|
||||
{
|
||||
const faceZoneMesh& faceZones = mesh.faceZones();
|
||||
Info << "faceZone:createBaffle " << faceZones << endl;
|
||||
forAll(wantedPatch, faceI)
|
||||
forAll(wantedPatch, facei)
|
||||
{
|
||||
if (wantedPatch[faceI] != -1)
|
||||
if (wantedPatch[facei] != -1)
|
||||
{
|
||||
const face& f = mesh.faces()[faceI];
|
||||
const face& f = mesh.faces()[facei];
|
||||
|
||||
label zoneID = faceZones.whichZone(faceI);
|
||||
label zoneID = faceZones.whichZone(facei);
|
||||
bool zoneFlip = false;
|
||||
|
||||
if (zoneID >= 0)
|
||||
{
|
||||
const faceZone& fZone = faceZones[zoneID];
|
||||
zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
|
||||
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
|
||||
}
|
||||
|
||||
meshMod.setAction
|
||||
@ -483,26 +486,26 @@ void createBaffles
|
||||
polyModifyFace
|
||||
(
|
||||
f, // modified face
|
||||
faceI, // label of face
|
||||
mesh.faceOwner()[faceI], // owner
|
||||
facei, // label of face
|
||||
mesh.faceOwner()[facei], // owner
|
||||
-1, // neighbour
|
||||
false, // face flip
|
||||
wantedPatch[faceI], // patch for face
|
||||
wantedPatch[facei], // patch for face
|
||||
false, // remove from zone
|
||||
zoneID, // zone for face
|
||||
zoneFlip // face flip in zone
|
||||
)
|
||||
);
|
||||
|
||||
if (mesh.isInternalFace(faceI))
|
||||
if (mesh.isInternalFace(facei))
|
||||
{
|
||||
label zoneID = faceZones.whichZone(faceI);
|
||||
label zoneID = faceZones.whichZone(facei);
|
||||
bool zoneFlip = false;
|
||||
|
||||
if (zoneID >= 0)
|
||||
{
|
||||
const faceZone& fZone = faceZones[zoneID];
|
||||
zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
|
||||
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
|
||||
}
|
||||
|
||||
meshMod.setAction
|
||||
@ -510,13 +513,13 @@ void createBaffles
|
||||
polyAddFace
|
||||
(
|
||||
f.reverseFace(), // modified face
|
||||
mesh.faceNeighbour()[faceI],// owner
|
||||
mesh.faceNeighbour()[facei],// owner
|
||||
-1, // neighbour
|
||||
-1, // masterPointID
|
||||
-1, // masterEdgeID
|
||||
faceI, // masterFaceID,
|
||||
facei, // masterFaceID,
|
||||
false, // face flip
|
||||
wantedPatch[faceI], // patch for face
|
||||
wantedPatch[facei], // patch for face
|
||||
zoneID, // zone for face
|
||||
zoneFlip // face flip in zone
|
||||
)
|
||||
@ -530,9 +533,9 @@ void createBaffles
|
||||
// Wrapper around find patch. Also makes sure same patch in parallel.
|
||||
label findPatch(const polyBoundaryMesh& patches, const word& patchName)
|
||||
{
|
||||
label patchI = patches.findPatchID(patchName);
|
||||
label patchi = patches.findPatchID(patchName);
|
||||
|
||||
if (patchI == -1)
|
||||
if (patchi == -1)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Illegal patch " << patchName
|
||||
@ -542,20 +545,20 @@ label findPatch(const polyBoundaryMesh& patches, const word& patchName)
|
||||
|
||||
// Check same patch for all procs
|
||||
{
|
||||
label newPatch = patchI;
|
||||
label newPatch = patchi;
|
||||
reduce(newPatch, minOp<label>());
|
||||
|
||||
if (newPatch != patchI)
|
||||
if (newPatch != patchi)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Patch " << patchName
|
||||
<< " should have the same patch index on all processors." << nl
|
||||
<< "On my processor it has index " << patchI
|
||||
<< "On my processor it has index " << patchi
|
||||
<< " ; on some other processor it has index " << newPatch
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
return patchI;
|
||||
return patchi;
|
||||
}
|
||||
|
||||
|
||||
@ -645,7 +648,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
faceSet fSet(mesh, setsAndPatches[setI][0]);
|
||||
|
||||
label patchI = findPatch
|
||||
label patchi = findPatch
|
||||
(
|
||||
mesh.boundaryMesh(),
|
||||
setsAndPatches[setI][1]
|
||||
@ -662,7 +665,7 @@ int main(int argc, char *argv[])
|
||||
<< " but also in patch " << wantedPatch[iter.key()]
|
||||
<< exit(FatalError);
|
||||
}
|
||||
wantedPatch[iter.key()] = patchI;
|
||||
wantedPatch[iter.key()] = patchi;
|
||||
}
|
||||
}
|
||||
|
||||
@ -687,7 +690,7 @@ int main(int argc, char *argv[])
|
||||
);
|
||||
|
||||
faceSet fSet(mesh, coupledAndPatches[setI][0]);
|
||||
label patchI = findPatch(patches, coupledAndPatches[setI][1]);
|
||||
label patchi = findPatch(patches, coupledAndPatches[setI][1]);
|
||||
|
||||
forAllConstIter(faceSet, fSet, iter)
|
||||
{
|
||||
@ -700,14 +703,14 @@ int main(int argc, char *argv[])
|
||||
<< " but also in patch " << coupledWantedPatch[iter.key()]
|
||||
<< exit(FatalError);
|
||||
}
|
||||
coupledWantedPatch[iter.key()] = patchI;
|
||||
coupledWantedPatch[iter.key()] = patchi;
|
||||
cyclicWantedPatch_half0[iter.key()] = cyclicId;
|
||||
cyclicWantedPatch_half1[iter.key()] = cyclicSlaveId;
|
||||
}
|
||||
}
|
||||
|
||||
// Exposed faces patch
|
||||
label defaultPatchI = findPatch(mesh.boundaryMesh(), defaultPatch);
|
||||
label defaultPatchi = findPatch(mesh.boundaryMesh(), defaultPatch);
|
||||
|
||||
|
||||
//
|
||||
@ -726,7 +729,7 @@ int main(int argc, char *argv[])
|
||||
blockedCells.invert(mesh.nCells());
|
||||
|
||||
// Create subsetted mesh.
|
||||
subsetter.setLargeCellSubset(blockedCells, defaultPatchI, true);
|
||||
subsetter.setLargeCellSubset(blockedCells, defaultPatchi, true);
|
||||
}
|
||||
|
||||
|
||||
@ -784,7 +787,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
subsetter,
|
||||
objects,
|
||||
defaultPatchI,
|
||||
defaultPatchi,
|
||||
scalar(Zero),
|
||||
volScalarField::typeName,
|
||||
scalarFlds
|
||||
@ -796,7 +799,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
subsetter,
|
||||
objects,
|
||||
defaultPatchI,
|
||||
defaultPatchi,
|
||||
vector(Zero),
|
||||
volVectorField::typeName,
|
||||
vectorFlds
|
||||
@ -814,7 +817,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
subsetter,
|
||||
objects,
|
||||
defaultPatchI,
|
||||
defaultPatchi,
|
||||
sphericalTensor(Zero),
|
||||
volSphericalTensorField::typeName,
|
||||
sphericalTensorFlds
|
||||
@ -826,7 +829,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
subsetter,
|
||||
objects,
|
||||
defaultPatchI,
|
||||
defaultPatchi,
|
||||
symmTensor(Zero),
|
||||
volSymmTensorField::typeName,
|
||||
symmTensorFlds
|
||||
@ -838,7 +841,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
subsetter,
|
||||
objects,
|
||||
defaultPatchI,
|
||||
defaultPatchi,
|
||||
tensor(Zero),
|
||||
volTensorField::typeName,
|
||||
tensorFlds
|
||||
@ -852,7 +855,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
subsetter,
|
||||
objects,
|
||||
defaultPatchI,
|
||||
defaultPatchi,
|
||||
scalar(Zero),
|
||||
surfaceScalarField::typeName,
|
||||
surfScalarFlds
|
||||
@ -864,7 +867,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
subsetter,
|
||||
objects,
|
||||
defaultPatchI,
|
||||
defaultPatchi,
|
||||
vector(Zero),
|
||||
surfaceVectorField::typeName,
|
||||
surfVectorFlds
|
||||
@ -882,7 +885,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
subsetter,
|
||||
objects,
|
||||
defaultPatchI,
|
||||
defaultPatchi,
|
||||
sphericalTensor(Zero),
|
||||
surfaceSphericalTensorField::typeName,
|
||||
surfSphericalTensorFlds
|
||||
@ -902,7 +905,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
subsetter,
|
||||
objects,
|
||||
defaultPatchI,
|
||||
defaultPatchi,
|
||||
symmTensor(Zero),
|
||||
surfaceSymmTensorField::typeName,
|
||||
surfSymmTensorFlds
|
||||
@ -914,7 +917,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
subsetter,
|
||||
objects,
|
||||
defaultPatchI,
|
||||
defaultPatchi,
|
||||
tensor(Zero),
|
||||
surfaceTensorField::typeName,
|
||||
surfTensorFlds
|
||||
|
||||
Reference in New Issue
Block a user