boundaryField() -> boundaryFieldRef()
This commit is contained in:
@ -36,18 +36,17 @@ void Foam::BlendedInterfacialModel<ModelType>::correctFixedFluxBCs
|
|||||||
GeometricField& field
|
GeometricField& field
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
forAll(phase1_.phi()().boundaryField(), patchI)
|
forAll(phase1_.phi()().boundaryField(), patchi)
|
||||||
{
|
{
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
isA<fixedValueFvsPatchScalarField>
|
isA<fixedValueFvsPatchScalarField>
|
||||||
(
|
(
|
||||||
phase1_.phi()().boundaryField()[patchI]
|
phase1_.phi()().boundaryField()[patchi]
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
field.boundaryField()[patchI]
|
field.boundaryField()[patchi] = Zero;
|
||||||
= Zero;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -36,18 +36,17 @@ void Foam::BlendedInterfacialModel<modelType>::correctFixedFluxBCs
|
|||||||
GeometricField& field
|
GeometricField& field
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
forAll(pair_.phase1().phi().boundaryField(), patchI)
|
forAll(pair_.phase1().phi().boundaryField(), patchi)
|
||||||
{
|
{
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
isA<fixedValueFvsPatchScalarField>
|
isA<fixedValueFvsPatchScalarField>
|
||||||
(
|
(
|
||||||
pair_.phase1().phi().boundaryField()[patchI]
|
pair_.phase1().phi().boundaryField()[patchi]
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
field.boundaryField()[patchI]
|
field.boundaryField()[patchi] = Zero;
|
||||||
= Zero;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -208,8 +208,8 @@ int main(int argc, char *argv[])
|
|||||||
#include "createMesh.H"
|
#include "createMesh.H"
|
||||||
|
|
||||||
const word patchName = args[1];
|
const word patchName = args[1];
|
||||||
label patchI = mesh.boundaryMesh().findPatchID(patchName);
|
label patchi = mesh.boundaryMesh().findPatchID(patchName);
|
||||||
const polyPatch& pp = mesh.boundaryMesh()[patchI];
|
const polyPatch& pp = mesh.boundaryMesh()[patchi];
|
||||||
|
|
||||||
const indirectPrimitivePatch& cpp = mesh.globalData().coupledPatch();
|
const indirectPrimitivePatch& cpp = mesh.globalData().coupledPatch();
|
||||||
|
|
||||||
|
|||||||
@ -156,9 +156,9 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
// Insert my boundary values
|
// Insert my boundary values
|
||||||
label nCompact = fld.size();
|
label nCompact = fld.size();
|
||||||
forAll(fld.boundaryField(), patchI)
|
forAll(fld.boundaryField(), patchi)
|
||||||
{
|
{
|
||||||
const fvPatchField<vector>& pfld = fld.boundaryField()[patchI];
|
const fvPatchField<vector>& pfld = fld.boundaryField()[patchi];
|
||||||
|
|
||||||
forAll(pfld, i)
|
forAll(pfld, i)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -60,11 +60,11 @@ int main(int argc, char *argv[])
|
|||||||
calculatedFvPatchVectorField::typeName
|
calculatedFvPatchVectorField::typeName
|
||||||
);
|
);
|
||||||
|
|
||||||
forAll(mesh.boundaryMesh(), patchI)
|
forAll(mesh.boundaryMesh(), patchi)
|
||||||
{
|
{
|
||||||
if (isA<mappedPolyPatch>(mesh.boundaryMesh()[patchI]))
|
if (isA<mappedPolyPatch>(mesh.boundaryMesh()[patchi]))
|
||||||
{
|
{
|
||||||
patchFieldTypes[patchI] =
|
patchFieldTypes[patchi] =
|
||||||
mappedFixedValueFvPatchVectorField::typeName;
|
mappedFixedValueFvPatchVectorField::typeName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -89,23 +89,23 @@ int main(int argc, char *argv[])
|
|||||||
cc.internalField() = mesh.C().internalField();
|
cc.internalField() = mesh.C().internalField();
|
||||||
cc.boundaryFieldRef().updateCoeffs();
|
cc.boundaryFieldRef().updateCoeffs();
|
||||||
|
|
||||||
forAll(cc.boundaryField(), patchI)
|
forAll(cc.boundaryField(), patchi)
|
||||||
{
|
{
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
isA<mappedFixedValueFvPatchVectorField>
|
isA<mappedFixedValueFvPatchVectorField>
|
||||||
(
|
(
|
||||||
cc.boundaryField()[patchI]
|
cc.boundaryField()[patchi]
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Pout<< "Detected a mapped patch:" << patchI << endl;
|
Pout<< "Detected a mapped patch:" << patchi << endl;
|
||||||
|
|
||||||
OFstream str(mesh.boundaryMesh()[patchI].name() + ".obj");
|
OFstream str(mesh.boundaryMesh()[patchi].name() + ".obj");
|
||||||
Pout<< "Writing mapped values to " << str.name() << endl;
|
Pout<< "Writing mapped values to " << str.name() << endl;
|
||||||
|
|
||||||
label vertI = 0;
|
label vertI = 0;
|
||||||
const fvPatchVectorField& fvp = cc.boundaryField()[patchI];
|
const fvPatchVectorField& fvp = cc.boundaryField()[patchi];
|
||||||
|
|
||||||
forAll(fvp, i)
|
forAll(fvp, i)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -66,18 +66,18 @@ int main(int argc, char *argv[])
|
|||||||
const polyBoundaryMesh& pbm = mesh.boundaryMesh();
|
const polyBoundaryMesh& pbm = mesh.boundaryMesh();
|
||||||
|
|
||||||
faceListList boundaryFaces(pbm.size());
|
faceListList boundaryFaces(pbm.size());
|
||||||
forAll(pbm, patchI)
|
forAll(pbm, patchi)
|
||||||
{
|
{
|
||||||
boundaryFaces[patchI] = pbm[patchI];
|
boundaryFaces[patchi] = pbm[patchi];
|
||||||
}
|
}
|
||||||
wordList boundaryPatchNames(pbm.names());
|
wordList boundaryPatchNames(pbm.names());
|
||||||
PtrList<dictionary> boundaryDicts(pbm.size());
|
PtrList<dictionary> boundaryDicts(pbm.size());
|
||||||
forAll(pbm, patchI)
|
forAll(pbm, patchi)
|
||||||
{
|
{
|
||||||
OStringStream os;
|
OStringStream os;
|
||||||
os << pbm[patchI];
|
os << pbm[patchi];
|
||||||
IStringStream is(os.str());
|
IStringStream is(os.str());
|
||||||
boundaryDicts.set(patchI, new dictionary(is));
|
boundaryDicts.set(patchi, new dictionary(is));
|
||||||
}
|
}
|
||||||
|
|
||||||
word defaultBoundaryPatchName = "defaultFaces";
|
word defaultBoundaryPatchName = "defaultFaces";
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -59,8 +59,8 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
|
|
||||||
const polyBoundaryMesh& pbm = mesh.boundaryMesh();
|
const polyBoundaryMesh& pbm = mesh.boundaryMesh();
|
||||||
label patchI = pbm.findPatchID(patchName);
|
label patchi = pbm.findPatchID(patchName);
|
||||||
const polyPatch& patch = pbm[patchI];
|
const polyPatch& patch = pbm[patchi];
|
||||||
|
|
||||||
Info<< "Patch:" << patch.name() << endl;
|
Info<< "Patch:" << patch.name() << endl;
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -52,9 +52,9 @@ labelList procNeighbours(const polyMesh& mesh)
|
|||||||
|
|
||||||
label nNeighbours = 0;
|
label nNeighbours = 0;
|
||||||
|
|
||||||
forAll(mesh.boundaryMesh(), patchI)
|
forAll(mesh.boundaryMesh(), patchi)
|
||||||
{
|
{
|
||||||
if (isA<processorPolyPatch>(mesh.boundaryMesh()[patchI]))
|
if (isA<processorPolyPatch>(mesh.boundaryMesh()[patchi]))
|
||||||
{
|
{
|
||||||
nNeighbours++;
|
nNeighbours++;
|
||||||
}
|
}
|
||||||
@ -64,11 +64,11 @@ labelList procNeighbours(const polyMesh& mesh)
|
|||||||
|
|
||||||
nNeighbours = 0;
|
nNeighbours = 0;
|
||||||
|
|
||||||
forAll(mesh.boundaryMesh(), patchI)
|
forAll(mesh.boundaryMesh(), patchi)
|
||||||
{
|
{
|
||||||
if (isA<processorPolyPatch>(mesh.boundaryMesh()[patchI]))
|
if (isA<processorPolyPatch>(mesh.boundaryMesh()[patchi]))
|
||||||
{
|
{
|
||||||
const polyPatch& patch = mesh.boundaryMesh()[patchI];
|
const polyPatch& patch = mesh.boundaryMesh()[patchi];
|
||||||
|
|
||||||
const processorPolyPatch& procPatch =
|
const processorPolyPatch& procPatch =
|
||||||
refCast<const processorPolyPatch>(patch);
|
refCast<const processorPolyPatch>(patch);
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -70,11 +70,11 @@ int main(int argc, char *argv[])
|
|||||||
const pointBoundaryMesh& pbm = pMesh.boundary();
|
const pointBoundaryMesh& pbm = pMesh.boundary();
|
||||||
|
|
||||||
Info<< "pointMesh boundary" << nl;
|
Info<< "pointMesh boundary" << nl;
|
||||||
forAll(pbm, patchI)
|
forAll(pbm, patchi)
|
||||||
{
|
{
|
||||||
Info<< "patch=" << pbm[patchI].name()
|
Info<< "patch=" << pbm[patchi].name()
|
||||||
<< ", type=" << pbm[patchI].type()
|
<< ", type=" << pbm[patchi].type()
|
||||||
<< ", coupled=" << pbm[patchI].coupled()
|
<< ", coupled=" << pbm[patchi].coupled()
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,10 +83,10 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
pointScalarField pp(pInterp.interpolate(p));
|
pointScalarField pp(pInterp.interpolate(p));
|
||||||
Info<< pp.name() << " boundary" << endl;
|
Info<< pp.name() << " boundary" << endl;
|
||||||
forAll(pp.boundaryField(), patchI)
|
forAll(pp.boundaryField(), patchi)
|
||||||
{
|
{
|
||||||
Info<< pbm[patchI].name() << " coupled="
|
Info<< pbm[patchi].name() << " coupled="
|
||||||
<< pp.boundaryField()[patchI].coupled()<< endl;
|
<< pp.boundaryField()[patchi].coupled()<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
pp.write();
|
pp.write();
|
||||||
|
|||||||
@ -126,7 +126,7 @@ void subsetVolFields
|
|||||||
(
|
(
|
||||||
const fvMeshSubset& subsetter,
|
const fvMeshSubset& subsetter,
|
||||||
const IOobjectList& objectsList,
|
const IOobjectList& objectsList,
|
||||||
const label patchI,
|
const label patchi,
|
||||||
const Type& exposedValue,
|
const Type& exposedValue,
|
||||||
const word GeomVolType,
|
const word GeomVolType,
|
||||||
PtrList<GeometricField<Type, fvPatchField, volMesh>>& subFields
|
PtrList<GeometricField<Type, fvPatchField, volMesh>>& subFields
|
||||||
@ -152,15 +152,15 @@ void subsetVolFields
|
|||||||
|
|
||||||
subFields.set(i, subsetter.interpolate(volField));
|
subFields.set(i, subsetter.interpolate(volField));
|
||||||
|
|
||||||
// Explicitly set exposed faces (in patchI) to exposedValue.
|
// Explicitly set exposed faces (in patchi) to exposedValue.
|
||||||
if (patchI >= 0)
|
if (patchi >= 0)
|
||||||
{
|
{
|
||||||
fvPatchField<Type>& fld =
|
fvPatchField<Type>& fld =
|
||||||
subFields[i++].boundaryField()[patchI];
|
subFields[i++].boundaryFieldRef()[patchi];
|
||||||
|
|
||||||
label newStart = fld.patch().patch().start();
|
label newStart = fld.patch().patch().start();
|
||||||
|
|
||||||
label oldPatchI = subsetter.patchMap()[patchI];
|
label oldPatchI = subsetter.patchMap()[patchi];
|
||||||
|
|
||||||
if (oldPatchI == -1)
|
if (oldPatchI == -1)
|
||||||
{
|
{
|
||||||
@ -198,7 +198,7 @@ void subsetSurfaceFields
|
|||||||
(
|
(
|
||||||
const fvMeshSubset& subsetter,
|
const fvMeshSubset& subsetter,
|
||||||
const IOobjectList& objectsList,
|
const IOobjectList& objectsList,
|
||||||
const label patchI,
|
const label patchi,
|
||||||
const Type& exposedValue,
|
const Type& exposedValue,
|
||||||
const word GeomSurfType,
|
const word GeomSurfType,
|
||||||
PtrList<GeometricField<Type, fvsPatchField, surfaceMesh>>& subFields
|
PtrList<GeometricField<Type, fvsPatchField, surfaceMesh>>& subFields
|
||||||
@ -225,15 +225,15 @@ void subsetSurfaceFields
|
|||||||
subFields.set(i, subsetter.interpolate(volField));
|
subFields.set(i, subsetter.interpolate(volField));
|
||||||
|
|
||||||
|
|
||||||
// Explicitly set exposed faces (in patchI) to exposedValue.
|
// Explicitly set exposed faces (in patchi) to exposedValue.
|
||||||
if (patchI >= 0)
|
if (patchi >= 0)
|
||||||
{
|
{
|
||||||
fvsPatchField<Type>& fld =
|
fvsPatchField<Type>& fld =
|
||||||
subFields[i++].boundaryField()[patchI];
|
subFields[i++].boundaryFieldRef()[patchi];
|
||||||
|
|
||||||
label newStart = fld.patch().patch().start();
|
label newStart = fld.patch().patch().start();
|
||||||
|
|
||||||
label oldPatchI = subsetter.patchMap()[patchI];
|
label oldPatchI = subsetter.patchMap()[patchi];
|
||||||
|
|
||||||
if (oldPatchI == -1)
|
if (oldPatchI == -1)
|
||||||
{
|
{
|
||||||
@ -291,16 +291,19 @@ void initCreatedPatches
|
|||||||
{
|
{
|
||||||
GeoField& field = const_cast<GeoField&>(*fieldIter());
|
GeoField& field = const_cast<GeoField&>(*fieldIter());
|
||||||
|
|
||||||
forAll(field.boundaryField(), patchi)
|
typename GeoField::GeometricBoundaryField& fieldBf =
|
||||||
|
field.boundaryFieldRef();
|
||||||
|
|
||||||
|
forAll(fieldBf, patchi)
|
||||||
{
|
{
|
||||||
if (map.oldPatchSizes()[patchi] == 0)
|
if (map.oldPatchSizes()[patchi] == 0)
|
||||||
{
|
{
|
||||||
// Not mapped.
|
// 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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -526,9 +529,9 @@ void createBaffles
|
|||||||
// Wrapper around find patch. Also makes sure same patch in parallel.
|
// Wrapper around find patch. Also makes sure same patch in parallel.
|
||||||
label findPatch(const polyBoundaryMesh& patches, const word& patchName)
|
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
|
FatalErrorInFunction
|
||||||
<< "Illegal patch " << patchName
|
<< "Illegal patch " << patchName
|
||||||
@ -538,20 +541,20 @@ label findPatch(const polyBoundaryMesh& patches, const word& patchName)
|
|||||||
|
|
||||||
// Check same patch for all procs
|
// Check same patch for all procs
|
||||||
{
|
{
|
||||||
label newPatch = patchI;
|
label newPatch = patchi;
|
||||||
reduce(newPatch, minOp<label>());
|
reduce(newPatch, minOp<label>());
|
||||||
|
|
||||||
if (newPatch != patchI)
|
if (newPatch != patchi)
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Patch " << patchName
|
<< "Patch " << patchName
|
||||||
<< " should have the same patch index on all processors." << nl
|
<< " 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
|
<< " ; on some other processor it has index " << newPatch
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return patchI;
|
return patchi;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -641,7 +644,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
faceSet fSet(mesh, setsAndPatches[setI][0]);
|
faceSet fSet(mesh, setsAndPatches[setI][0]);
|
||||||
|
|
||||||
label patchI = findPatch
|
label patchi = findPatch
|
||||||
(
|
(
|
||||||
mesh.boundaryMesh(),
|
mesh.boundaryMesh(),
|
||||||
setsAndPatches[setI][1]
|
setsAndPatches[setI][1]
|
||||||
@ -658,7 +661,7 @@ int main(int argc, char *argv[])
|
|||||||
<< " but also in patch " << wantedPatch[iter.key()]
|
<< " but also in patch " << wantedPatch[iter.key()]
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
wantedPatch[iter.key()] = patchI;
|
wantedPatch[iter.key()] = patchi;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -683,7 +686,7 @@ int main(int argc, char *argv[])
|
|||||||
);
|
);
|
||||||
|
|
||||||
faceSet fSet(mesh, coupledAndPatches[setI][0]);
|
faceSet fSet(mesh, coupledAndPatches[setI][0]);
|
||||||
label patchI = findPatch(patches, coupledAndPatches[setI][1]);
|
label patchi = findPatch(patches, coupledAndPatches[setI][1]);
|
||||||
|
|
||||||
forAllConstIter(faceSet, fSet, iter)
|
forAllConstIter(faceSet, fSet, iter)
|
||||||
{
|
{
|
||||||
@ -696,7 +699,7 @@ int main(int argc, char *argv[])
|
|||||||
<< " but also in patch " << coupledWantedPatch[iter.key()]
|
<< " but also in patch " << coupledWantedPatch[iter.key()]
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
coupledWantedPatch[iter.key()] = patchI;
|
coupledWantedPatch[iter.key()] = patchi;
|
||||||
cyclicWantedPatch_half0[iter.key()] = cyclicId;
|
cyclicWantedPatch_half0[iter.key()] = cyclicId;
|
||||||
cyclicWantedPatch_half1[iter.key()] = cyclicSlaveId;
|
cyclicWantedPatch_half1[iter.key()] = cyclicSlaveId;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -193,24 +193,24 @@ scalar getEdgeStats(const primitiveMesh& mesh, const direction excludeCmpt)
|
|||||||
// Adds empty patch if not yet there. Returns patchID.
|
// Adds empty patch if not yet there. Returns patchID.
|
||||||
label addPatch(polyMesh& mesh, const word& patchName)
|
label addPatch(polyMesh& mesh, const word& patchName)
|
||||||
{
|
{
|
||||||
label patchI = mesh.boundaryMesh().findPatchID(patchName);
|
label patchi = mesh.boundaryMesh().findPatchID(patchName);
|
||||||
|
|
||||||
if (patchI == -1)
|
if (patchi == -1)
|
||||||
{
|
{
|
||||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||||
|
|
||||||
List<polyPatch*> newPatches(patches.size() + 1);
|
List<polyPatch*> newPatches(patches.size() + 1);
|
||||||
|
|
||||||
// Add empty patch as 0th entry (Note: only since subsetMesh wants this)
|
// Add empty patch as 0th entry (Note: only since subsetMesh wants this)
|
||||||
patchI = 0;
|
patchi = 0;
|
||||||
|
|
||||||
newPatches[patchI] =
|
newPatches[patchi] =
|
||||||
new emptyPolyPatch
|
new emptyPolyPatch
|
||||||
(
|
(
|
||||||
Foam::word(patchName),
|
Foam::word(patchName),
|
||||||
0,
|
0,
|
||||||
mesh.nInternalFaces(),
|
mesh.nInternalFaces(),
|
||||||
patchI,
|
patchi,
|
||||||
patches,
|
patches,
|
||||||
emptyPolyPatch::typeName
|
emptyPolyPatch::typeName
|
||||||
);
|
);
|
||||||
@ -232,15 +232,15 @@ label addPatch(polyMesh& mesh, const word& patchName)
|
|||||||
mesh.removeBoundary();
|
mesh.removeBoundary();
|
||||||
mesh.addPatches(newPatches);
|
mesh.addPatches(newPatches);
|
||||||
|
|
||||||
Info<< "Created patch oldInternalFaces at " << patchI << endl;
|
Info<< "Created patch oldInternalFaces at " << patchi << endl;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Info<< "Reusing patch oldInternalFaces at " << patchI << endl;
|
Info<< "Reusing patch oldInternalFaces at " << patchi << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return patchI;
|
return patchi;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -482,7 +482,7 @@ void subsetMesh
|
|||||||
(
|
(
|
||||||
polyMesh& mesh,
|
polyMesh& mesh,
|
||||||
const label writeMesh,
|
const label writeMesh,
|
||||||
const label patchI, // patchID for exposed faces
|
const label patchi, // patchID for exposed faces
|
||||||
const labelHashSet& cellsToRemove,
|
const labelHashSet& cellsToRemove,
|
||||||
cellSet& cutCells,
|
cellSet& cutCells,
|
||||||
labelIOList& refLevel
|
labelIOList& refLevel
|
||||||
@ -503,7 +503,7 @@ void subsetMesh
|
|||||||
(
|
(
|
||||||
cellLabels,
|
cellLabels,
|
||||||
exposedFaces,
|
exposedFaces,
|
||||||
labelList(exposedFaces.size(), patchI),
|
labelList(exposedFaces.size(), patchi),
|
||||||
meshMod
|
meshMod
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -221,9 +221,9 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
List<polyPatch*> p(patches.size());
|
List<polyPatch*> p(patches.size());
|
||||||
|
|
||||||
forAll(p, patchI)
|
forAll(p, patchi)
|
||||||
{
|
{
|
||||||
p[patchI] = patches[patchI].clone(fMesh.boundaryMesh()).ptr();
|
p[patchi] = patches[patchi].clone(fMesh.boundaryMesh()).ptr();
|
||||||
}
|
}
|
||||||
|
|
||||||
fMesh.addFvPatches(p);
|
fMesh.addFvPatches(p);
|
||||||
@ -294,15 +294,17 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
volScalarField::GeometricBoundaryField& postRefLevelBf =
|
||||||
|
postRefLevel.boundaryFieldRef();
|
||||||
|
|
||||||
// For volScalarField: set boundary values to same as cell.
|
// For volScalarField: set boundary values to same as cell.
|
||||||
// Note: could also put
|
// Note: could also put
|
||||||
// zeroGradient b.c. on postRefLevel and do evaluate.
|
// zeroGradient b.c. on postRefLevel and do evaluate.
|
||||||
forAll(postRefLevel.boundaryField(), patchI)
|
forAll(postRefLevel.boundaryField(), patchi)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = patches[patchI];
|
const polyPatch& pp = patches[patchi];
|
||||||
|
|
||||||
fvPatchScalarField& bField = postRefLevel.boundaryField()[patchI];
|
fvPatchScalarField& bField = postRefLevelBf[patchi];
|
||||||
|
|
||||||
Info<< "Setting field for patch "<< endl;
|
Info<< "Setting field for patch "<< endl;
|
||||||
|
|
||||||
|
|||||||
@ -931,38 +931,38 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
label meshFaceI = foamPatchStarts[0];
|
label meshFaceI = foamPatchStarts[0];
|
||||||
|
|
||||||
forAll(newPatches, patchI)
|
forAll(newPatches, patchi)
|
||||||
{
|
{
|
||||||
const word& patchName = foamPatchNames[patchI];
|
const word& patchName = foamPatchNames[patchi];
|
||||||
const word& patchType = foamPatchTypes[patchI];
|
const word& patchType = foamPatchTypes[patchi];
|
||||||
|
|
||||||
Pout<< "Patch:" << patchName << " start at:" << meshFaceI
|
Pout<< "Patch:" << patchName << " start at:" << meshFaceI
|
||||||
<< " size:" << foamPatchSizes[patchI]
|
<< " size:" << foamPatchSizes[patchi]
|
||||||
<< " end at:" << meshFaceI+foamPatchSizes[patchI]
|
<< " end at:" << meshFaceI+foamPatchSizes[patchi]
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
if (patchType == "wall")
|
if (patchType == "wall")
|
||||||
{
|
{
|
||||||
newPatches[patchI] =
|
newPatches[patchi] =
|
||||||
new wallPolyPatch
|
new wallPolyPatch
|
||||||
(
|
(
|
||||||
patchName,
|
patchName,
|
||||||
foamPatchSizes[patchI],
|
foamPatchSizes[patchi],
|
||||||
meshFaceI,
|
meshFaceI,
|
||||||
patchI,
|
patchi,
|
||||||
mesh.boundaryMesh(),
|
mesh.boundaryMesh(),
|
||||||
patchType
|
patchType
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else if (patchType == "symmetryplane")
|
else if (patchType == "symmetryplane")
|
||||||
{
|
{
|
||||||
newPatches[patchI] =
|
newPatches[patchi] =
|
||||||
new symmetryPolyPatch
|
new symmetryPolyPatch
|
||||||
(
|
(
|
||||||
patchName,
|
patchName,
|
||||||
foamPatchSizes[patchI],
|
foamPatchSizes[patchi],
|
||||||
meshFaceI,
|
meshFaceI,
|
||||||
patchI,
|
patchi,
|
||||||
mesh.boundaryMesh(),
|
mesh.boundaryMesh(),
|
||||||
patchType
|
patchType
|
||||||
);
|
);
|
||||||
@ -970,13 +970,13 @@ int main(int argc, char *argv[])
|
|||||||
else if (patchType == "empty")
|
else if (patchType == "empty")
|
||||||
{
|
{
|
||||||
// Note: not ccm name, introduced by us above.
|
// Note: not ccm name, introduced by us above.
|
||||||
newPatches[patchI] =
|
newPatches[patchi] =
|
||||||
new emptyPolyPatch
|
new emptyPolyPatch
|
||||||
(
|
(
|
||||||
patchName,
|
patchName,
|
||||||
foamPatchSizes[patchI],
|
foamPatchSizes[patchi],
|
||||||
meshFaceI,
|
meshFaceI,
|
||||||
patchI,
|
patchi,
|
||||||
mesh.boundaryMesh(),
|
mesh.boundaryMesh(),
|
||||||
patchType
|
patchType
|
||||||
);
|
);
|
||||||
@ -985,19 +985,19 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
// All other ccm types become straight polyPatch:
|
// All other ccm types become straight polyPatch:
|
||||||
// 'inlet', 'outlet', ...
|
// 'inlet', 'outlet', ...
|
||||||
newPatches[patchI] =
|
newPatches[patchi] =
|
||||||
new polyPatch
|
new polyPatch
|
||||||
(
|
(
|
||||||
patchName,
|
patchName,
|
||||||
foamPatchSizes[patchI],
|
foamPatchSizes[patchi],
|
||||||
meshFaceI,
|
meshFaceI,
|
||||||
patchI,
|
patchi,
|
||||||
mesh.boundaryMesh(),
|
mesh.boundaryMesh(),
|
||||||
word::null
|
word::null
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
meshFaceI += foamPatchSizes[patchI];
|
meshFaceI += foamPatchSizes[patchi];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (meshFaceI != foamOwner.size())
|
if (meshFaceI != foamOwner.size())
|
||||||
|
|||||||
@ -485,18 +485,18 @@ int main(int argc, char *argv[])
|
|||||||
faceListList boundary(slPatchCells.size());
|
faceListList boundary(slPatchCells.size());
|
||||||
wordList patchNames(slPatchCells.size());
|
wordList patchNames(slPatchCells.size());
|
||||||
|
|
||||||
forAll(slPatchCells, patchI)
|
forAll(slPatchCells, patchi)
|
||||||
{
|
{
|
||||||
SLList<face> patchFaces;
|
SLList<face> patchFaces;
|
||||||
|
|
||||||
SLList<label>::iterator cellIter(slPatchCells[patchI].begin());
|
SLList<label>::iterator cellIter(slPatchCells[patchi].begin());
|
||||||
SLList<label>::iterator faceIter(slPatchCellFaces[patchI].begin());
|
SLList<label>::iterator faceIter(slPatchCellFaces[patchi].begin());
|
||||||
|
|
||||||
for
|
for
|
||||||
(
|
(
|
||||||
;
|
;
|
||||||
cellIter != slPatchCells[patchI].end()
|
cellIter != slPatchCells[patchi].end()
|
||||||
&& faceIter != slPatchCellFaces[patchI].end();
|
&& faceIter != slPatchCellFaces[patchi].end();
|
||||||
++cellIter, ++faceIter
|
++cellIter, ++faceIter
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -513,8 +513,8 @@ int main(int argc, char *argv[])
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
boundary[patchI] = patchFaces;
|
boundary[patchi] = patchFaces;
|
||||||
patchNames[patchI] = word("patch") + name(patchI + 1);
|
patchNames[patchi] = word("patch") + name(patchi + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -522,10 +522,10 @@ int main(int argc, char *argv[])
|
|||||||
// Lookup the face labels for all the boundary faces
|
// Lookup the face labels for all the boundary faces
|
||||||
//
|
//
|
||||||
labelListList boundaryFaceLabels(boundary.size());
|
labelListList boundaryFaceLabels(boundary.size());
|
||||||
forAll(boundary, patchI)
|
forAll(boundary, patchi)
|
||||||
{
|
{
|
||||||
const faceList& bFaces = boundary[patchI];
|
const faceList& bFaces = boundary[patchi];
|
||||||
labelList& bFaceLabels = boundaryFaceLabels[patchI];
|
labelList& bFaceLabels = boundaryFaceLabels[patchi];
|
||||||
bFaceLabels.setSize(bFaces.size());
|
bFaceLabels.setSize(bFaces.size());
|
||||||
forAll(bFaces, i)
|
forAll(bFaces, i)
|
||||||
{
|
{
|
||||||
@ -538,24 +538,24 @@ int main(int argc, char *argv[])
|
|||||||
// faces go into faceZones and external faces go into patches.
|
// faces go into faceZones and external faces go into patches.
|
||||||
List<faceList> patchFaces(slPatchCells.size());
|
List<faceList> patchFaces(slPatchCells.size());
|
||||||
labelList patchNFaces(slPatchCells.size(), 0);
|
labelList patchNFaces(slPatchCells.size(), 0);
|
||||||
forAll(boundary, patchI)
|
forAll(boundary, patchi)
|
||||||
{
|
{
|
||||||
const faceList& bFaces = boundary[patchI];
|
const faceList& bFaces = boundary[patchi];
|
||||||
const labelList& bFaceLabels = boundaryFaceLabels[patchI];
|
const labelList& bFaceLabels = boundaryFaceLabels[patchi];
|
||||||
|
|
||||||
patchFaces[patchI].setSize(bFaces.size());
|
patchFaces[patchi].setSize(bFaces.size());
|
||||||
|
|
||||||
forAll(bFaces, i)
|
forAll(bFaces, i)
|
||||||
{
|
{
|
||||||
if (!dummyMesh().isInternalFace(bFaceLabels[i]))
|
if (!dummyMesh().isInternalFace(bFaceLabels[i]))
|
||||||
{
|
{
|
||||||
patchFaces[patchI][patchNFaces[patchI]++] = bFaces[i];
|
patchFaces[patchi][patchNFaces[patchi]++] = bFaces[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
patchFaces[patchI].setSize(patchNFaces[patchI]);
|
patchFaces[patchi].setSize(patchNFaces[patchi]);
|
||||||
|
|
||||||
Info<< "Patch " << patchI << " named " << patchNames[patchI]
|
Info<< "Patch " << patchi << " named " << patchNames[patchi]
|
||||||
<< ": " << boundary[patchI].size() << " faces" << endl;
|
<< ": " << boundary[patchi].size() << " faces" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// We no longer need the dummyMesh
|
// We no longer need the dummyMesh
|
||||||
@ -583,14 +583,14 @@ int main(int argc, char *argv[])
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Add information to dictionary
|
// Add information to dictionary
|
||||||
forAll(patchNames, patchI)
|
forAll(patchNames, patchi)
|
||||||
{
|
{
|
||||||
if (!patchDicts.set(patchI))
|
if (!patchDicts.set(patchi))
|
||||||
{
|
{
|
||||||
patchDicts.set(patchI, new dictionary());
|
patchDicts.set(patchi, new dictionary());
|
||||||
}
|
}
|
||||||
// Add but not overwrite
|
// Add but not overwrite
|
||||||
patchDicts[patchI].add("type", polyPatch::typeName, false);
|
patchDicts[patchi].add("type", polyPatch::typeName, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -619,27 +619,27 @@ int main(int argc, char *argv[])
|
|||||||
DynamicList<cellZone*> cz;
|
DynamicList<cellZone*> cz;
|
||||||
|
|
||||||
// FaceZones
|
// FaceZones
|
||||||
forAll(boundaryFaceLabels, patchI)
|
forAll(boundaryFaceLabels, patchi)
|
||||||
{
|
{
|
||||||
if (boundaryFaceLabels[patchI].size())
|
if (boundaryFaceLabels[patchi].size())
|
||||||
{
|
{
|
||||||
// Re-do the boundaryFaceLabels since the boundary face
|
// Re-do the boundaryFaceLabels since the boundary face
|
||||||
// labels will be different on the pShapeMesh.
|
// labels will be different on the pShapeMesh.
|
||||||
const faceList& bFaces = boundary[patchI];
|
const faceList& bFaces = boundary[patchi];
|
||||||
labelList& bFaceLabels = boundaryFaceLabels[patchI];
|
labelList& bFaceLabels = boundaryFaceLabels[patchi];
|
||||||
forAll(bFaceLabels, i)
|
forAll(bFaceLabels, i)
|
||||||
{
|
{
|
||||||
bFaceLabels[i] = findFace(pShapeMesh, bFaces[i]);
|
bFaceLabels[i] = findFace(pShapeMesh, bFaces[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
Info<< "Creating faceZone " << patchNames[patchI]
|
Info<< "Creating faceZone " << patchNames[patchi]
|
||||||
<< " with " << bFaceLabels.size() << " faces" << endl;
|
<< " with " << bFaceLabels.size() << " faces" << endl;
|
||||||
|
|
||||||
fz.append
|
fz.append
|
||||||
(
|
(
|
||||||
new faceZone
|
new faceZone
|
||||||
(
|
(
|
||||||
patchNames[patchI],
|
patchNames[patchi],
|
||||||
bFaceLabels,
|
bFaceLabels,
|
||||||
boolList(bFaceLabels.size(), false),
|
boolList(bFaceLabels.size(), false),
|
||||||
fz.size(),
|
fz.size(),
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -103,14 +103,14 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
label no, blkNo, patchLabel;
|
label no, blkNo, patchLabel;
|
||||||
|
|
||||||
forAll(cfxPatchTypes, patchI)
|
forAll(cfxPatchTypes, patchi)
|
||||||
{
|
{
|
||||||
// Grab patch type and name
|
// Grab patch type and name
|
||||||
cfxFile >> cfxPatchTypes[patchI] >> cfxPatchNames[patchI] >> no;
|
cfxFile >> cfxPatchTypes[patchi] >> cfxPatchNames[patchi] >> no;
|
||||||
|
|
||||||
// Grab patch range
|
// Grab patch range
|
||||||
patchRanges[patchI].setSize(6);
|
patchRanges[patchi].setSize(6);
|
||||||
labelList& curRange = patchRanges[patchI];
|
labelList& curRange = patchRanges[patchi];
|
||||||
|
|
||||||
forAll(curRange, rI)
|
forAll(curRange, rI)
|
||||||
{
|
{
|
||||||
@ -122,9 +122,9 @@ int main(int argc, char *argv[])
|
|||||||
// 0 = solid (3-D patch),
|
// 0 = solid (3-D patch),
|
||||||
// 1 = high i, 2 = high j, 3 = high k
|
// 1 = high i, 2 = high j, 3 = high k
|
||||||
// 4 = low i, 5 = low j, 6 = low k
|
// 4 = low i, 5 = low j, 6 = low k
|
||||||
cfxFile >> patchDirections[patchI] >> blkNo >> patchLabel;
|
cfxFile >> patchDirections[patchi] >> blkNo >> patchLabel;
|
||||||
|
|
||||||
patchMasterBlocks[patchI] = blkNo - 1;
|
patchMasterBlocks[patchi] = blkNo - 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -178,9 +178,9 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
faceListList rawPatches(npatch);
|
faceListList rawPatches(npatch);
|
||||||
|
|
||||||
forAll(rawPatches, patchI)
|
forAll(rawPatches, patchi)
|
||||||
{
|
{
|
||||||
const word& patchType = cfxPatchTypes[patchI];
|
const word& patchType = cfxPatchTypes[patchi];
|
||||||
|
|
||||||
// reject volume patches
|
// reject volume patches
|
||||||
if
|
if
|
||||||
@ -189,17 +189,17 @@ int main(int argc, char *argv[])
|
|||||||
|| patchType == "SOLCON" || patchType == "USER3D"
|
|| patchType == "SOLCON" || patchType == "USER3D"
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
patchMasterBlocks[patchI] = -1;
|
patchMasterBlocks[patchi] = -1;
|
||||||
rawPatches[patchI].setSize(0);
|
rawPatches[patchi].setSize(0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// read and create a 2-D patch
|
// read and create a 2-D patch
|
||||||
rawPatches[patchI] =
|
rawPatches[patchi] =
|
||||||
blocks[patchMasterBlocks[patchI]].patchFaces
|
blocks[patchMasterBlocks[patchi]].patchFaces
|
||||||
(
|
(
|
||||||
patchDirections[patchI],
|
patchDirections[patchi],
|
||||||
patchRanges[patchI]
|
patchRanges[patchi]
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -580,30 +580,30 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
label nCreatedPatches = 0;
|
label nCreatedPatches = 0;
|
||||||
|
|
||||||
forAll(rawPatches, patchI)
|
forAll(rawPatches, patchi)
|
||||||
{
|
{
|
||||||
if (rawPatches[patchI].size() && cfxPatchTypes[patchI] != "BLKBDY")
|
if (rawPatches[patchi].size() && cfxPatchTypes[patchi] != "BLKBDY")
|
||||||
{
|
{
|
||||||
// Check if this name has been already created
|
// Check if this name has been already created
|
||||||
label existingPatch = -1;
|
label existingPatch = -1;
|
||||||
|
|
||||||
for (label oldPatchI = 0; oldPatchI < nCreatedPatches; oldPatchI++)
|
for (label oldPatchI = 0; oldPatchI < nCreatedPatches; oldPatchI++)
|
||||||
{
|
{
|
||||||
if (patchNames[oldPatchI] == cfxPatchNames[patchI])
|
if (patchNames[oldPatchI] == cfxPatchNames[patchi])
|
||||||
{
|
{
|
||||||
existingPatch = oldPatchI;
|
existingPatch = oldPatchI;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const faceList& curRawPatch = rawPatches[patchI];
|
const faceList& curRawPatch = rawPatches[patchi];
|
||||||
label curBlock = patchMasterBlocks[patchI];
|
label curBlock = patchMasterBlocks[patchi];
|
||||||
|
|
||||||
if (existingPatch >= 0)
|
if (existingPatch >= 0)
|
||||||
{
|
{
|
||||||
Info<< "CFX patch " << patchI
|
Info<< "CFX patch " << patchi
|
||||||
<< ", of type " << cfxPatchTypes[patchI]
|
<< ", of type " << cfxPatchTypes[patchi]
|
||||||
<< ", name " << cfxPatchNames[patchI]
|
<< ", name " << cfxPatchNames[patchi]
|
||||||
<< " already exists as OpenFOAM patch " << existingPatch
|
<< " already exists as OpenFOAM patch " << existingPatch
|
||||||
<< ". Adding faces." << endl;
|
<< ". Adding faces." << endl;
|
||||||
|
|
||||||
@ -653,48 +653,48 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Info<< "CFX patch " << patchI
|
Info<< "CFX patch " << patchi
|
||||||
<< ", of type " << cfxPatchTypes[patchI]
|
<< ", of type " << cfxPatchTypes[patchi]
|
||||||
<< ", name " << cfxPatchNames[patchI]
|
<< ", name " << cfxPatchNames[patchi]
|
||||||
<< " converted into OpenFOAM patch " << nCreatedPatches
|
<< " converted into OpenFOAM patch " << nCreatedPatches
|
||||||
<< " type ";
|
<< " type ";
|
||||||
|
|
||||||
if (cfxPatchTypes[patchI] == "WALL")
|
if (cfxPatchTypes[patchi] == "WALL")
|
||||||
{
|
{
|
||||||
Info<< "wall." << endl;
|
Info<< "wall." << endl;
|
||||||
|
|
||||||
patchTypes[nCreatedPatches] = wallPolyPatch::typeName;
|
patchTypes[nCreatedPatches] = wallPolyPatch::typeName;
|
||||||
patchNames[nCreatedPatches] = cfxPatchNames[patchI];
|
patchNames[nCreatedPatches] = cfxPatchNames[patchi];
|
||||||
nCreatedPatches++;
|
nCreatedPatches++;
|
||||||
}
|
}
|
||||||
else if (cfxPatchTypes[patchI] == "SYMMET")
|
else if (cfxPatchTypes[patchi] == "SYMMET")
|
||||||
{
|
{
|
||||||
Info<< "symmetryPlane." << endl;
|
Info<< "symmetryPlane." << endl;
|
||||||
|
|
||||||
patchTypes[nCreatedPatches] = symmetryPolyPatch::typeName;
|
patchTypes[nCreatedPatches] = symmetryPolyPatch::typeName;
|
||||||
patchNames[nCreatedPatches] = cfxPatchNames[patchI];
|
patchNames[nCreatedPatches] = cfxPatchNames[patchi];
|
||||||
nCreatedPatches++;
|
nCreatedPatches++;
|
||||||
}
|
}
|
||||||
else if
|
else if
|
||||||
(
|
(
|
||||||
cfxPatchTypes[patchI] == "INLET"
|
cfxPatchTypes[patchi] == "INLET"
|
||||||
|| cfxPatchTypes[patchI] == "OUTLET"
|
|| cfxPatchTypes[patchi] == "OUTLET"
|
||||||
|| cfxPatchTypes[patchI] == "PRESS"
|
|| cfxPatchTypes[patchi] == "PRESS"
|
||||||
|| cfxPatchTypes[patchI] == "CNDBDY"
|
|| cfxPatchTypes[patchi] == "CNDBDY"
|
||||||
|| cfxPatchTypes[patchI] == "USER2D"
|
|| cfxPatchTypes[patchi] == "USER2D"
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Info<< "generic." << endl;
|
Info<< "generic." << endl;
|
||||||
|
|
||||||
patchTypes[nCreatedPatches] = polyPatch::typeName;
|
patchTypes[nCreatedPatches] = polyPatch::typeName;
|
||||||
patchNames[nCreatedPatches] = cfxPatchNames[patchI];
|
patchNames[nCreatedPatches] = cfxPatchNames[patchi];
|
||||||
nCreatedPatches++;
|
nCreatedPatches++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Unrecognised CFX patch type "
|
<< "Unrecognised CFX patch type "
|
||||||
<< cfxPatchTypes[patchI]
|
<< cfxPatchTypes[patchi]
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -719,14 +719,14 @@ int main(int argc, char *argv[])
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Add information to dictionary
|
// Add information to dictionary
|
||||||
forAll(patchNames, patchI)
|
forAll(patchNames, patchi)
|
||||||
{
|
{
|
||||||
if (!patchDicts.set(patchI))
|
if (!patchDicts.set(patchi))
|
||||||
{
|
{
|
||||||
patchDicts.set(patchI, new dictionary());
|
patchDicts.set(patchi, new dictionary());
|
||||||
}
|
}
|
||||||
// Add but not overwrite
|
// Add but not overwrite
|
||||||
patchDicts[patchI].add("type", patchTypes[patchI], false);
|
patchDicts[patchi].add("type", patchTypes[patchi], false);
|
||||||
}
|
}
|
||||||
|
|
||||||
polyMesh pShapeMesh
|
polyMesh pShapeMesh
|
||||||
|
|||||||
@ -1377,9 +1377,9 @@ int main(int argc, char *argv[])
|
|||||||
label nBoundaries = 0;
|
label nBoundaries = 0;
|
||||||
|
|
||||||
|
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
const faceList& bFaces = patches[patchI];
|
const faceList& bFaces = patches[patchi];
|
||||||
|
|
||||||
label sz = bFaces.size();
|
label sz = bFaces.size();
|
||||||
labelList meshFaces(sz,-1);
|
labelList meshFaces(sz,-1);
|
||||||
@ -1402,7 +1402,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
patchTypes[patchI] != "internal"
|
patchTypes[patchi] != "internal"
|
||||||
&& !pShapeMesh.isInternalFace(meshFaces[0])
|
&& !pShapeMesh.isInternalFace(meshFaces[0])
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -1418,7 +1418,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Face " << faceI << " on new patch "
|
<< "Face " << faceI << " on new patch "
|
||||||
<< patchNames[patchI]
|
<< patchNames[patchi]
|
||||||
<< " is not an external face of the mesh." << endl
|
<< " is not an external face of the mesh." << endl
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
@ -1427,7 +1427,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Face " << faceI << " on new patch "
|
<< "Face " << faceI << " on new patch "
|
||||||
<< patchNames[patchI]
|
<< patchNames[patchi]
|
||||||
<< " has already been marked for repatching to"
|
<< " has already been marked for repatching to"
|
||||||
<< " patch "
|
<< " patch "
|
||||||
<< facePatchID[faceI - pShapeMesh.nInternalFaces()]
|
<< facePatchID[faceI - pShapeMesh.nInternalFaces()]
|
||||||
@ -1438,8 +1438,8 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
//add to boundary patch
|
//add to boundary patch
|
||||||
|
|
||||||
Info<< "Adding new patch " << patchNames[patchI]
|
Info<< "Adding new patch " << patchNames[patchi]
|
||||||
<< " of type " << patchTypes[patchI]
|
<< " of type " << patchTypes[patchi]
|
||||||
<< " as patch " << nBoundaries << endl;
|
<< " as patch " << nBoundaries << endl;
|
||||||
|
|
||||||
// Add patch to new patch list
|
// Add patch to new patch list
|
||||||
@ -1447,8 +1447,8 @@ int main(int argc, char *argv[])
|
|||||||
(
|
(
|
||||||
polyPatch::New
|
polyPatch::New
|
||||||
(
|
(
|
||||||
patchTypes[patchI],
|
patchTypes[patchi],
|
||||||
patchNames[patchI],
|
patchNames[patchi],
|
||||||
sz,
|
sz,
|
||||||
cMeshFace,
|
cMeshFace,
|
||||||
nBoundaries,
|
nBoundaries,
|
||||||
@ -1460,7 +1460,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Info<< "Patch " << patchNames[patchI]
|
Info<< "Patch " << patchNames[patchi]
|
||||||
<< " is internal to the mesh "
|
<< " is internal to the mesh "
|
||||||
<< " and is not being added to the boundary."
|
<< " and is not being added to the boundary."
|
||||||
<< endl;
|
<< endl;
|
||||||
@ -1535,12 +1535,12 @@ int main(int argc, char *argv[])
|
|||||||
// Re-do face matching to write sets
|
// Re-do face matching to write sets
|
||||||
if (writeSets)
|
if (writeSets)
|
||||||
{
|
{
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
const faceList& bFaces = patches[patchI];
|
const faceList& bFaces = patches[patchi];
|
||||||
label sz = bFaces.size();
|
label sz = bFaces.size();
|
||||||
|
|
||||||
faceSet pFaceSet(pShapeMesh, patchNames[patchI], sz);
|
faceSet pFaceSet(pShapeMesh, patchNames[patchi], sz);
|
||||||
|
|
||||||
forAll(bFaces, j)
|
forAll(bFaces, j)
|
||||||
{
|
{
|
||||||
@ -1548,7 +1548,7 @@ int main(int argc, char *argv[])
|
|||||||
label cMeshFace = findFace(pShapeMesh, f);
|
label cMeshFace = findFace(pShapeMesh, f);
|
||||||
pFaceSet.insert(cMeshFace);
|
pFaceSet.insert(cMeshFace);
|
||||||
}
|
}
|
||||||
Info<< "Writing patch " << patchNames[patchI]
|
Info<< "Writing patch " << patchNames[patchi]
|
||||||
<< " of size " << sz << " to faceSet" << endl;
|
<< " of size " << sz << " to faceSet" << endl;
|
||||||
|
|
||||||
pFaceSet.instance() = pShapeMesh.instance();
|
pFaceSet.instance() = pShapeMesh.instance();
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -157,31 +157,31 @@ void Foam::fluentFvMesh::writeFluentMesh() const
|
|||||||
label nWrittenFaces = own.size();
|
label nWrittenFaces = own.size();
|
||||||
|
|
||||||
// Writing boundary faces
|
// Writing boundary faces
|
||||||
forAll(boundary(), patchI)
|
forAll(boundary(), patchi)
|
||||||
{
|
{
|
||||||
const faceUList& patchFaces = boundaryMesh()[patchI];
|
const faceUList& patchFaces = boundaryMesh()[patchi];
|
||||||
|
|
||||||
const labelList& patchFaceCells =
|
const labelList& patchFaceCells =
|
||||||
boundaryMesh()[patchI].faceCells();
|
boundaryMesh()[patchi].faceCells();
|
||||||
|
|
||||||
// The face group will be offset by 10 from the patch label
|
// The face group will be offset by 10 from the patch label
|
||||||
|
|
||||||
// Write header
|
// Write header
|
||||||
fluentMeshFile
|
fluentMeshFile
|
||||||
<< "(13 (" << patchI + 10 << " " << nWrittenFaces + 1
|
<< "(13 (" << patchi + 10 << " " << nWrittenFaces + 1
|
||||||
<< " " << nWrittenFaces + patchFaces.size() << " ";
|
<< " " << nWrittenFaces + patchFaces.size() << " ";
|
||||||
|
|
||||||
nWrittenFaces += patchFaces.size();
|
nWrittenFaces += patchFaces.size();
|
||||||
|
|
||||||
// Write patch type
|
// Write patch type
|
||||||
if (isA<wallFvPatch>(boundary()[patchI]))
|
if (isA<wallFvPatch>(boundary()[patchi]))
|
||||||
{
|
{
|
||||||
fluentMeshFile << 3;
|
fluentMeshFile << 3;
|
||||||
}
|
}
|
||||||
else if
|
else if
|
||||||
(
|
(
|
||||||
isA<symmetryPlaneFvPatch>(boundary()[patchI])
|
isA<symmetryPlaneFvPatch>(boundary()[patchi])
|
||||||
|| isA<symmetryFvPatch>(boundary()[patchI])
|
|| isA<symmetryFvPatch>(boundary()[patchi])
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
fluentMeshFile << 7;
|
fluentMeshFile << 7;
|
||||||
@ -275,20 +275,20 @@ void Foam::fluentFvMesh::writeFluentMesh() const
|
|||||||
fluentMeshFile << "(39 (2 interior interior-1)())" << std::endl;
|
fluentMeshFile << "(39 (2 interior interior-1)())" << std::endl;
|
||||||
|
|
||||||
// Writing boundary patch types
|
// Writing boundary patch types
|
||||||
forAll(boundary(), patchI)
|
forAll(boundary(), patchi)
|
||||||
{
|
{
|
||||||
fluentMeshFile
|
fluentMeshFile
|
||||||
<< "(39 (" << patchI + 10 << " ";
|
<< "(39 (" << patchi + 10 << " ";
|
||||||
|
|
||||||
// Write patch type
|
// Write patch type
|
||||||
if (isA<wallFvPatch>(boundary()[patchI]))
|
if (isA<wallFvPatch>(boundary()[patchi]))
|
||||||
{
|
{
|
||||||
fluentMeshFile << "wall ";
|
fluentMeshFile << "wall ";
|
||||||
}
|
}
|
||||||
else if
|
else if
|
||||||
(
|
(
|
||||||
isA<symmetryPlaneFvPatch>(boundary()[patchI])
|
isA<symmetryPlaneFvPatch>(boundary()[patchi])
|
||||||
|| isA<symmetryFvPatch>(boundary()[patchI])
|
|| isA<symmetryFvPatch>(boundary()[patchi])
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
fluentMeshFile << "symmetry ";
|
fluentMeshFile << "symmetry ";
|
||||||
@ -299,7 +299,7 @@ void Foam::fluentFvMesh::writeFluentMesh() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
fluentMeshFile
|
fluentMeshFile
|
||||||
<< boundary()[patchI].name() << ")())" << std::endl;
|
<< boundary()[patchi].name() << ")())" << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -780,12 +780,12 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
faceListList boundary(patchCells.size());
|
faceListList boundary(patchCells.size());
|
||||||
|
|
||||||
forAll(patchCells, patchI)
|
forAll(patchCells, patchi)
|
||||||
{
|
{
|
||||||
labelList& curCells = patchCells[patchI];
|
labelList& curCells = patchCells[patchi];
|
||||||
labelList& curFaces = patchCellFaces[patchI];
|
labelList& curFaces = patchCellFaces[patchi];
|
||||||
|
|
||||||
faceList& patchFaces = boundary[patchI];
|
faceList& patchFaces = boundary[patchi];
|
||||||
patchFaces.setSize(curCells.size());
|
patchFaces.setSize(curCells.size());
|
||||||
|
|
||||||
forAll(curCells, faceI)
|
forAll(curCells, faceI)
|
||||||
@ -831,14 +831,14 @@ int main(int argc, char *argv[])
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Add information to dictionary
|
// Add information to dictionary
|
||||||
forAll(patchNames, patchI)
|
forAll(patchNames, patchi)
|
||||||
{
|
{
|
||||||
if (!patchDicts.set(patchI))
|
if (!patchDicts.set(patchi))
|
||||||
{
|
{
|
||||||
patchDicts.set(patchI, new dictionary());
|
patchDicts.set(patchi, new dictionary());
|
||||||
}
|
}
|
||||||
// Add but not overwrite
|
// Add but not overwrite
|
||||||
patchDicts[patchI].add("type", polyPatch::typeName, false);
|
patchDicts[patchi].add("type", polyPatch::typeName, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
polyMesh pShapeMesh
|
polyMesh pShapeMesh
|
||||||
|
|||||||
@ -505,28 +505,28 @@ void readCells
|
|||||||
|
|
||||||
Map<label>::iterator regFnd = physToPatch.find(regPhys);
|
Map<label>::iterator regFnd = physToPatch.find(regPhys);
|
||||||
|
|
||||||
label patchI = -1;
|
label patchi = -1;
|
||||||
if (regFnd == physToPatch.end())
|
if (regFnd == physToPatch.end())
|
||||||
{
|
{
|
||||||
// New region. Allocate patch for it.
|
// New region. Allocate patch for it.
|
||||||
patchI = patchFaces.size();
|
patchi = patchFaces.size();
|
||||||
|
|
||||||
patchFaces.setSize(patchI + 1);
|
patchFaces.setSize(patchi + 1);
|
||||||
patchToPhys.setSize(patchI + 1);
|
patchToPhys.setSize(patchi + 1);
|
||||||
|
|
||||||
Info<< "Mapping region " << regPhys << " to Foam patch "
|
Info<< "Mapping region " << regPhys << " to Foam patch "
|
||||||
<< patchI << endl;
|
<< patchi << endl;
|
||||||
physToPatch.insert(regPhys, patchI);
|
physToPatch.insert(regPhys, patchi);
|
||||||
patchToPhys[patchI] = regPhys;
|
patchToPhys[patchi] = regPhys;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Existing patch for region
|
// Existing patch for region
|
||||||
patchI = regFnd();
|
patchi = regFnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add triangle to correct patchFaces.
|
// Add triangle to correct patchFaces.
|
||||||
patchFaces[patchI].append(triPoints);
|
patchFaces[patchi].append(triPoints);
|
||||||
}
|
}
|
||||||
else if (elmType == MSHQUAD)
|
else if (elmType == MSHQUAD)
|
||||||
{
|
{
|
||||||
@ -538,28 +538,28 @@ void readCells
|
|||||||
|
|
||||||
Map<label>::iterator regFnd = physToPatch.find(regPhys);
|
Map<label>::iterator regFnd = physToPatch.find(regPhys);
|
||||||
|
|
||||||
label patchI = -1;
|
label patchi = -1;
|
||||||
if (regFnd == physToPatch.end())
|
if (regFnd == physToPatch.end())
|
||||||
{
|
{
|
||||||
// New region. Allocate patch for it.
|
// New region. Allocate patch for it.
|
||||||
patchI = patchFaces.size();
|
patchi = patchFaces.size();
|
||||||
|
|
||||||
patchFaces.setSize(patchI + 1);
|
patchFaces.setSize(patchi + 1);
|
||||||
patchToPhys.setSize(patchI + 1);
|
patchToPhys.setSize(patchi + 1);
|
||||||
|
|
||||||
Info<< "Mapping region " << regPhys << " to Foam patch "
|
Info<< "Mapping region " << regPhys << " to Foam patch "
|
||||||
<< patchI << endl;
|
<< patchi << endl;
|
||||||
physToPatch.insert(regPhys, patchI);
|
physToPatch.insert(regPhys, patchi);
|
||||||
patchToPhys[patchI] = regPhys;
|
patchToPhys[patchi] = regPhys;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Existing patch for region
|
// Existing patch for region
|
||||||
patchI = regFnd();
|
patchi = regFnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add quad to correct patchFaces.
|
// Add quad to correct patchFaces.
|
||||||
patchFaces[patchI].append(quadPoints);
|
patchFaces[patchi].append(quadPoints);
|
||||||
}
|
}
|
||||||
else if (elmType == MSHTET)
|
else if (elmType == MSHTET)
|
||||||
{
|
{
|
||||||
@ -707,9 +707,9 @@ void readCells
|
|||||||
|
|
||||||
cells.setSize(cellI);
|
cells.setSize(cellI);
|
||||||
|
|
||||||
forAll(patchFaces, patchI)
|
forAll(patchFaces, patchi)
|
||||||
{
|
{
|
||||||
patchFaces[patchI].shrink();
|
patchFaces[patchi].shrink();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -880,22 +880,22 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
wordList boundaryPatchNames(boundaryFaces.size());
|
wordList boundaryPatchNames(boundaryFaces.size());
|
||||||
|
|
||||||
forAll(boundaryPatchNames, patchI)
|
forAll(boundaryPatchNames, patchi)
|
||||||
{
|
{
|
||||||
label physReg = patchToPhys[patchI];
|
label physReg = patchToPhys[patchi];
|
||||||
|
|
||||||
Map<word>::const_iterator iter = physicalNames.find(physReg);
|
Map<word>::const_iterator iter = physicalNames.find(physReg);
|
||||||
|
|
||||||
if (iter != physicalNames.end())
|
if (iter != physicalNames.end())
|
||||||
{
|
{
|
||||||
boundaryPatchNames[patchI] = iter();
|
boundaryPatchNames[patchi] = iter();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
boundaryPatchNames[patchI] = word("patch") + name(patchI);
|
boundaryPatchNames[patchi] = word("patch") + name(patchi);
|
||||||
}
|
}
|
||||||
Info<< "Patch " << patchI << " gets name "
|
Info<< "Patch " << patchi << " gets name "
|
||||||
<< boundaryPatchNames[patchI] << endl;
|
<< boundaryPatchNames[patchi] << endl;
|
||||||
}
|
}
|
||||||
Info<< endl;
|
Info<< endl;
|
||||||
|
|
||||||
@ -938,11 +938,11 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
|
|
||||||
// Go through all the patchFaces and find corresponding face in pp.
|
// Go through all the patchFaces and find corresponding face in pp.
|
||||||
forAll(patchFaces, patchI)
|
forAll(patchFaces, patchi)
|
||||||
{
|
{
|
||||||
const DynamicList<face>& pFaces = patchFaces[patchI];
|
const DynamicList<face>& pFaces = patchFaces[patchi];
|
||||||
|
|
||||||
Info<< "Finding faces of patch " << patchI << endl;
|
Info<< "Finding faces of patch " << patchi << endl;
|
||||||
|
|
||||||
forAll(pFaces, i)
|
forAll(pFaces, i)
|
||||||
{
|
{
|
||||||
@ -955,7 +955,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
label meshFaceI = pp.start() + patchFaceI;
|
label meshFaceI = pp.start() + patchFaceI;
|
||||||
|
|
||||||
repatcher.changePatchID(meshFaceI, patchI);
|
repatcher.changePatchID(meshFaceI, patchi);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -965,7 +965,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (meshFaceI != -1)
|
if (meshFaceI != -1)
|
||||||
{
|
{
|
||||||
zoneFaces[patchI].append(meshFaceI);
|
zoneFaces[patchi].append(meshFaceI);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1104,11 +1104,11 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
List<polyPatch*> newPatchPtrList((mesh.boundaryMesh().size() - 1));
|
List<polyPatch*> newPatchPtrList((mesh.boundaryMesh().size() - 1));
|
||||||
label newPatchI = 0;
|
label newPatchI = 0;
|
||||||
forAll(mesh.boundaryMesh(), patchI)
|
forAll(mesh.boundaryMesh(), patchi)
|
||||||
{
|
{
|
||||||
if (patchI != defaultPatchID)
|
if (patchi != defaultPatchID)
|
||||||
{
|
{
|
||||||
const polyPatch& patch = mesh.boundaryMesh()[patchI];
|
const polyPatch& patch = mesh.boundaryMesh()[patchi];
|
||||||
|
|
||||||
newPatchPtrList[newPatchI] = patch.clone
|
newPatchPtrList[newPatchI] = patch.clone
|
||||||
(
|
(
|
||||||
|
|||||||
@ -625,16 +625,16 @@ void readDOFS
|
|||||||
// Returns -1 or group that all of the vertices of f are in,
|
// Returns -1 or group that all of the vertices of f are in,
|
||||||
label findPatch(const List<labelHashSet>& dofGroups, const face& f)
|
label findPatch(const List<labelHashSet>& dofGroups, const face& f)
|
||||||
{
|
{
|
||||||
forAll(dofGroups, patchI)
|
forAll(dofGroups, patchi)
|
||||||
{
|
{
|
||||||
if (dofGroups[patchI].found(f[0]))
|
if (dofGroups[patchi].found(f[0]))
|
||||||
{
|
{
|
||||||
bool allInGroup = true;
|
bool allInGroup = true;
|
||||||
|
|
||||||
// Check rest of face
|
// Check rest of face
|
||||||
for (label fp = 1; fp < f.size(); fp++)
|
for (label fp = 1; fp < f.size(); fp++)
|
||||||
{
|
{
|
||||||
if (!dofGroups[patchI].found(f[fp]))
|
if (!dofGroups[patchi].found(f[fp]))
|
||||||
{
|
{
|
||||||
allInGroup = false;
|
allInGroup = false;
|
||||||
break;
|
break;
|
||||||
@ -643,7 +643,7 @@ label findPatch(const List<labelHashSet>& dofGroups, const face& f)
|
|||||||
|
|
||||||
if (allInGroup)
|
if (allInGroup)
|
||||||
{
|
{
|
||||||
return patchI;
|
return patchi;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -937,22 +937,22 @@ int main(int argc, char *argv[])
|
|||||||
<< " DOF sets to detect boundary faces."<< endl;
|
<< " DOF sets to detect boundary faces."<< endl;
|
||||||
|
|
||||||
// Renumber vertex numbers on contraints
|
// Renumber vertex numbers on contraints
|
||||||
forAll(dofVertIndices, patchI)
|
forAll(dofVertIndices, patchi)
|
||||||
{
|
{
|
||||||
inplaceRenumber(unvToFoam, dofVertIndices[patchI]);
|
inplaceRenumber(unvToFoam, dofVertIndices[patchi]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Build labelHashSet of points per dofGroup/patch
|
// Build labelHashSet of points per dofGroup/patch
|
||||||
List<labelHashSet> dofGroups(dofVertIndices.size());
|
List<labelHashSet> dofGroups(dofVertIndices.size());
|
||||||
|
|
||||||
forAll(dofVertIndices, patchI)
|
forAll(dofVertIndices, patchi)
|
||||||
{
|
{
|
||||||
const labelList& foamVerts = dofVertIndices[patchI];
|
const labelList& foamVerts = dofVertIndices[patchi];
|
||||||
|
|
||||||
forAll(foamVerts, i)
|
forAll(foamVerts, i)
|
||||||
{
|
{
|
||||||
dofGroups[patchI].insert(foamVerts[i]);
|
dofGroups[patchi].insert(foamVerts[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -966,11 +966,11 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
forAll(shapeFaces, i)
|
forAll(shapeFaces, i)
|
||||||
{
|
{
|
||||||
label patchI = findPatch(dofGroups, shapeFaces[i]);
|
label patchi = findPatch(dofGroups, shapeFaces[i]);
|
||||||
|
|
||||||
if (patchI != -1)
|
if (patchi != -1)
|
||||||
{
|
{
|
||||||
dynPatchFaces[patchI].append(shapeFaces[i]);
|
dynPatchFaces[patchi].append(shapeFaces[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -978,9 +978,9 @@ int main(int argc, char *argv[])
|
|||||||
// Transfer
|
// Transfer
|
||||||
patchFaceVerts.setSize(dynPatchFaces.size());
|
patchFaceVerts.setSize(dynPatchFaces.size());
|
||||||
|
|
||||||
forAll(dynPatchFaces, patchI)
|
forAll(dynPatchFaces, patchi)
|
||||||
{
|
{
|
||||||
patchFaceVerts[patchI].transfer(dynPatchFaces[patchI]);
|
patchFaceVerts[patchi].transfer(dynPatchFaces[patchi]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1005,12 +1005,12 @@ int main(int argc, char *argv[])
|
|||||||
boundaryFaceToIndex.insert(boundaryFaceIndices[i], i);
|
boundaryFaceToIndex.insert(boundaryFaceIndices[i], i);
|
||||||
}
|
}
|
||||||
|
|
||||||
forAll(patchFaceVerts, patchI)
|
forAll(patchFaceVerts, patchi)
|
||||||
{
|
{
|
||||||
Info << patchI << ": " << patchNames[patchI] << " is " << flush;
|
Info << patchi << ": " << patchNames[patchi] << " is " << flush;
|
||||||
|
|
||||||
faceList& patchFaces = patchFaceVerts[patchI];
|
faceList& patchFaces = patchFaceVerts[patchi];
|
||||||
const labelList& faceIndices = patchFaceIndices[patchI];
|
const labelList& faceIndices = patchFaceIndices[patchi];
|
||||||
|
|
||||||
patchFaces.setSize(faceIndices.size());
|
patchFaces.setSize(faceIndices.size());
|
||||||
|
|
||||||
@ -1037,14 +1037,14 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (cnt != patchFaces.size() || duplicateFaces)
|
if (cnt != patchFaces.size() || duplicateFaces)
|
||||||
{
|
{
|
||||||
isAPatch[patchI] = false;
|
isAPatch[patchi] = false;
|
||||||
|
|
||||||
if (verbose)
|
if (verbose)
|
||||||
{
|
{
|
||||||
if (cnt != patchFaces.size())
|
if (cnt != patchFaces.size())
|
||||||
{
|
{
|
||||||
WarningInFunction
|
WarningInFunction
|
||||||
<< "For patch " << patchI << " there were "
|
<< "For patch " << patchi << " there were "
|
||||||
<< patchFaces.size()-cnt
|
<< patchFaces.size()-cnt
|
||||||
<< " faces not used because they seem"
|
<< " faces not used because they seem"
|
||||||
<< " to be internal. "
|
<< " to be internal. "
|
||||||
@ -1055,7 +1055,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
WarningInFunction
|
WarningInFunction
|
||||||
<< "Patch "
|
<< "Patch "
|
||||||
<< patchI << " has faces that are already "
|
<< patchi << " has faces that are already "
|
||||||
<< " in use on other boundary-patches,"
|
<< " in use on other boundary-patches,"
|
||||||
<< " Assuming faceZoneset." << endl;
|
<< " Assuming faceZoneset." << endl;
|
||||||
}
|
}
|
||||||
@ -1075,13 +1075,13 @@ int main(int argc, char *argv[])
|
|||||||
<< "The face index " << faceIndices[i]
|
<< "The face index " << faceIndices[i]
|
||||||
<< " was not found amongst the cells."
|
<< " was not found amongst the cells."
|
||||||
<< " This kills the theory that "
|
<< " This kills the theory that "
|
||||||
<< patchNames[patchI] << " is a cell zone"
|
<< patchNames[patchi] << " is a cell zone"
|
||||||
<< endl
|
<< endl
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
theCells[i] = cellCorrespondence[faceIndices[i]];
|
theCells[i] = cellCorrespondence[faceIndices[i]];
|
||||||
}
|
}
|
||||||
cellZones.insert(patchNames[patchI], theCells);
|
cellZones.insert(patchNames[patchi], theCells);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1091,7 +1091,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
theFaces[i] = boundaryFaceToIndex[faceIndices[i]];
|
theFaces[i] = boundaryFaceToIndex[faceIndices[i]];
|
||||||
}
|
}
|
||||||
faceZones.insert(patchNames[patchI],theFaces);
|
faceZones.insert(patchNames[patchi],theFaces);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1140,14 +1140,14 @@ int main(int argc, char *argv[])
|
|||||||
DynamicList<word> usedPatchNames;
|
DynamicList<word> usedPatchNames;
|
||||||
DynamicList<faceList> usedPatchFaceVerts;
|
DynamicList<faceList> usedPatchFaceVerts;
|
||||||
|
|
||||||
forAll(patchNames, patchI)
|
forAll(patchNames, patchi)
|
||||||
{
|
{
|
||||||
if (isAPatch[patchI])
|
if (isAPatch[patchi])
|
||||||
{
|
{
|
||||||
Info<< " " << patchNames[patchI] << '\t'
|
Info<< " " << patchNames[patchi] << '\t'
|
||||||
<< patchFaceVerts[patchI].size() << nl;
|
<< patchFaceVerts[patchi].size() << nl;
|
||||||
usedPatchNames.append(patchNames[patchI]);
|
usedPatchNames.append(patchNames[patchi]);
|
||||||
usedPatchFaceVerts.append(patchFaceVerts[patchI]);
|
usedPatchFaceVerts.append(patchFaceVerts[patchi]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
usedPatchNames.shrink();
|
usedPatchNames.shrink();
|
||||||
|
|||||||
@ -546,14 +546,14 @@ preservePatchTypes
|
|||||||
defaultFacesType
|
defaultFacesType
|
||||||
);
|
);
|
||||||
// Add information to dictionary
|
// Add information to dictionary
|
||||||
forAll(patchNames, patchI)
|
forAll(patchNames, patchi)
|
||||||
{
|
{
|
||||||
if (!patchDicts.set(patchI))
|
if (!patchDicts.set(patchi))
|
||||||
{
|
{
|
||||||
patchDicts.set(patchI, new dictionary());
|
patchDicts.set(patchi, new dictionary());
|
||||||
}
|
}
|
||||||
// Add but not overwrite
|
// Add but not overwrite
|
||||||
patchDicts[patchI].add("type", patchTypes[patchI], false);
|
patchDicts[patchi].add("type", patchTypes[patchi], false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build the mesh and write it out
|
// Build the mesh and write it out
|
||||||
|
|||||||
@ -167,18 +167,18 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
forAll(boundaryFaces, faceI)
|
forAll(boundaryFaces, faceI)
|
||||||
{
|
{
|
||||||
label patchI(readLabel(str));
|
label patchi(readLabel(str));
|
||||||
|
|
||||||
if (patchI < 0)
|
if (patchi < 0)
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Invalid boundary region number " << patchI
|
<< "Invalid boundary region number " << patchi
|
||||||
<< " on line " << str.lineNumber()
|
<< " on line " << str.lineNumber()
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
maxPatch = max(maxPatch, patchI);
|
maxPatch = max(maxPatch, patchi);
|
||||||
|
|
||||||
triFace tri(readLabel(str)-1, readLabel(str)-1, readLabel(str)-1);
|
triFace tri(readLabel(str)-1, readLabel(str)-1, readLabel(str)-1);
|
||||||
|
|
||||||
@ -187,7 +187,7 @@ int main(int argc, char *argv[])
|
|||||||
boundaryFaces[faceI][0] = tri[0];
|
boundaryFaces[faceI][0] = tri[0];
|
||||||
boundaryFaces[faceI][1] = tri[1];
|
boundaryFaces[faceI][1] = tri[1];
|
||||||
boundaryFaces[faceI][2] = tri[2];
|
boundaryFaces[faceI][2] = tri[2];
|
||||||
boundaryPatch[faceI] = patchI;
|
boundaryPatch[faceI] = patchi;
|
||||||
|
|
||||||
vertsToBoundary.insert(tri, faceI);
|
vertsToBoundary.insert(tri, faceI);
|
||||||
}
|
}
|
||||||
@ -254,9 +254,9 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
wordList patchNames(nPatches);
|
wordList patchNames(nPatches);
|
||||||
|
|
||||||
forAll(patchNames, patchI)
|
forAll(patchNames, patchi)
|
||||||
{
|
{
|
||||||
patchNames[patchI] = word("patch") + name(patchI);
|
patchNames[patchi] = word("patch") + name(patchi);
|
||||||
}
|
}
|
||||||
|
|
||||||
wordList patchTypes(nPatches, polyPatch::typeName);
|
wordList patchTypes(nPatches, polyPatch::typeName);
|
||||||
@ -270,22 +270,22 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
forAll(boundaryPatch, faceI)
|
forAll(boundaryPatch, faceI)
|
||||||
{
|
{
|
||||||
label patchI = boundaryPatch[faceI];
|
label patchi = boundaryPatch[faceI];
|
||||||
|
|
||||||
allPatchFaces[patchI].append(boundaryFaces[faceI]);
|
allPatchFaces[patchi].append(boundaryFaces[faceI]);
|
||||||
}
|
}
|
||||||
|
|
||||||
Info<< "Patches:" << nl
|
Info<< "Patches:" << nl
|
||||||
<< "\tNeutral Boundary\tPatch name\tSize" << nl
|
<< "\tNeutral Boundary\tPatch name\tSize" << nl
|
||||||
<< "\t----------------\t----------\t----" << endl;
|
<< "\t----------------\t----------\t----" << endl;
|
||||||
|
|
||||||
forAll(allPatchFaces, patchI)
|
forAll(allPatchFaces, patchi)
|
||||||
{
|
{
|
||||||
Info<< '\t' << patchI << "\t\t\t"
|
Info<< '\t' << patchi << "\t\t\t"
|
||||||
<< patchNames[patchI] << "\t\t"
|
<< patchNames[patchi] << "\t\t"
|
||||||
<< allPatchFaces[patchI].size() << endl;
|
<< allPatchFaces[patchi].size() << endl;
|
||||||
|
|
||||||
patchFaces[patchI].transfer(allPatchFaces[patchI]);
|
patchFaces[patchi].transfer(allPatchFaces[patchi]);
|
||||||
}
|
}
|
||||||
|
|
||||||
Info<< endl;
|
Info<< endl;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -70,9 +70,9 @@ bool Foam::sammMesh::sammEqualFace
|
|||||||
|
|
||||||
void Foam::sammMesh::createBoundaryFaces()
|
void Foam::sammMesh::createBoundaryFaces()
|
||||||
{
|
{
|
||||||
forAll(boundary_, patchI)
|
forAll(boundary_, patchi)
|
||||||
{
|
{
|
||||||
faceList& patchFaces = boundary_[patchI];
|
faceList& patchFaces = boundary_[patchi];
|
||||||
|
|
||||||
const labelListList& PointCells = pointCells();
|
const labelListList& PointCells = pointCells();
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -41,11 +41,11 @@ void Foam::sammMesh::createPolyBoundary()
|
|||||||
|
|
||||||
const labelListList& PointCells = pointCells();
|
const labelListList& PointCells = pointCells();
|
||||||
|
|
||||||
forAll(boundary_, patchI)
|
forAll(boundary_, patchi)
|
||||||
{
|
{
|
||||||
const faceList& curShapePatch = boundary_[patchI];
|
const faceList& curShapePatch = boundary_[patchi];
|
||||||
|
|
||||||
polyBoundaryPatchStartIndices_[patchI] = nCreatedFaces;
|
polyBoundaryPatchStartIndices_[patchi] = nCreatedFaces;
|
||||||
|
|
||||||
forAll(curShapePatch, faceI)
|
forAll(curShapePatch, faceI)
|
||||||
{
|
{
|
||||||
@ -120,21 +120,21 @@ Foam::List<Foam::polyPatch* > Foam::sammMesh::polyBoundaryPatches
|
|||||||
{
|
{
|
||||||
List<polyPatch* > p(boundary_.size());
|
List<polyPatch* > p(boundary_.size());
|
||||||
|
|
||||||
forAll(boundary_, patchI)
|
forAll(boundary_, patchi)
|
||||||
{
|
{
|
||||||
const faceList& curShapePatch = boundary_[patchI];
|
const faceList& curShapePatch = boundary_[patchi];
|
||||||
|
|
||||||
p[patchI] = polyPatch::New
|
p[patchi] = polyPatch::New
|
||||||
(
|
(
|
||||||
patchTypes_[patchI],
|
patchTypes_[patchi],
|
||||||
patchNames_[patchI],
|
patchNames_[patchi],
|
||||||
curShapePatch.size(),
|
curShapePatch.size(),
|
||||||
polyBoundaryPatchStartIndices_[patchI],
|
polyBoundaryPatchStartIndices_[patchi],
|
||||||
patchI,
|
patchi,
|
||||||
pMesh.boundaryMesh()
|
pMesh.boundaryMesh()
|
||||||
).ptr();
|
).ptr();
|
||||||
|
|
||||||
p[patchI]->physicalType() = patchPhysicalTypes_[patchI];
|
p[patchi]->physicalType() = patchPhysicalTypes_[patchi];
|
||||||
}
|
}
|
||||||
|
|
||||||
return p;
|
return p;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -243,13 +243,13 @@ void Foam::sammMesh::readBoundary()
|
|||||||
defaultFacesType_
|
defaultFacesType_
|
||||||
);
|
);
|
||||||
|
|
||||||
forAll(patchDicts, patchI)
|
forAll(patchDicts, patchi)
|
||||||
{
|
{
|
||||||
if (patchDicts.set(patchI))
|
if (patchDicts.set(patchi))
|
||||||
{
|
{
|
||||||
const dictionary& dict = patchDicts[patchI];
|
const dictionary& dict = patchDicts[patchi];
|
||||||
dict.readIfPresent("type", patchTypes_[patchI]);
|
dict.readIfPresent("type", patchTypes_[patchi]);
|
||||||
dict.readIfPresent("physicalType", patchPhysicalTypes_[patchI]);
|
dict.readIfPresent("physicalType", patchPhysicalTypes_[patchi]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -97,13 +97,13 @@ void Foam::starMesh::markBoundaryFaces()
|
|||||||
boundaryCellIDs_.setSize(boundary_.size());
|
boundaryCellIDs_.setSize(boundary_.size());
|
||||||
boundaryCellFaceIDs_.setSize(boundary_.size());
|
boundaryCellFaceIDs_.setSize(boundary_.size());
|
||||||
|
|
||||||
forAll(boundary_, patchI)
|
forAll(boundary_, patchi)
|
||||||
{
|
{
|
||||||
const faceList& patchFaces = boundary_[patchI];
|
const faceList& patchFaces = boundary_[patchi];
|
||||||
|
|
||||||
// set size of patch lists
|
// set size of patch lists
|
||||||
labelList& curBoundaryCellIDs = boundaryCellIDs_[patchI];
|
labelList& curBoundaryCellIDs = boundaryCellIDs_[patchi];
|
||||||
labelList& curBoundaryCellFaceIDs = boundaryCellFaceIDs_[patchI];
|
labelList& curBoundaryCellFaceIDs = boundaryCellFaceIDs_[patchi];
|
||||||
|
|
||||||
curBoundaryCellIDs.setSize(patchFaces.size());
|
curBoundaryCellIDs.setSize(patchFaces.size());
|
||||||
curBoundaryCellFaceIDs.setSize(patchFaces.size());
|
curBoundaryCellFaceIDs.setSize(patchFaces.size());
|
||||||
@ -178,13 +178,13 @@ void Foam::starMesh::markBoundaryFaces()
|
|||||||
void Foam::starMesh::collectBoundaryFaces()
|
void Foam::starMesh::collectBoundaryFaces()
|
||||||
{
|
{
|
||||||
Info<< "Collecting boundary faces" << endl;
|
Info<< "Collecting boundary faces" << endl;
|
||||||
forAll(boundary_, patchI)
|
forAll(boundary_, patchi)
|
||||||
{
|
{
|
||||||
faceList& patchFaces = boundary_[patchI];
|
faceList& patchFaces = boundary_[patchi];
|
||||||
|
|
||||||
// set size of patch lists
|
// set size of patch lists
|
||||||
const labelList& curBoundaryCellIDs = boundaryCellIDs_[patchI];
|
const labelList& curBoundaryCellIDs = boundaryCellIDs_[patchi];
|
||||||
const labelList& curBoundaryCellFaceIDs = boundaryCellFaceIDs_[patchI];
|
const labelList& curBoundaryCellFaceIDs = boundaryCellFaceIDs_[patchi];
|
||||||
|
|
||||||
forAll(curBoundaryCellIDs, faceI)
|
forAll(curBoundaryCellIDs, faceI)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -41,11 +41,11 @@ void Foam::starMesh::createPolyBoundary()
|
|||||||
|
|
||||||
const labelListList& PointCells = pointCells();
|
const labelListList& PointCells = pointCells();
|
||||||
|
|
||||||
forAll(boundary_, patchI)
|
forAll(boundary_, patchi)
|
||||||
{
|
{
|
||||||
const faceList& curShapePatch = boundary_[patchI];
|
const faceList& curShapePatch = boundary_[patchi];
|
||||||
|
|
||||||
polyBoundaryPatchStartIndices_[patchI] = nCreatedFaces;
|
polyBoundaryPatchStartIndices_[patchi] = nCreatedFaces;
|
||||||
|
|
||||||
forAll(curShapePatch, faceI)
|
forAll(curShapePatch, faceI)
|
||||||
{
|
{
|
||||||
@ -295,15 +295,15 @@ Foam::starMesh::polyBoundaryPatches(const polyMesh& pMesh)
|
|||||||
{
|
{
|
||||||
List<polyPatch*> p(boundary_.size());
|
List<polyPatch*> p(boundary_.size());
|
||||||
|
|
||||||
forAll(boundary_, patchI)
|
forAll(boundary_, patchi)
|
||||||
{
|
{
|
||||||
p[patchI] = polyPatch::New
|
p[patchi] = polyPatch::New
|
||||||
(
|
(
|
||||||
patchTypes_[patchI],
|
patchTypes_[patchi],
|
||||||
patchNames_[patchI],
|
patchNames_[patchi],
|
||||||
boundary_[patchI].size(),
|
boundary_[patchi].size(),
|
||||||
polyBoundaryPatchStartIndices_[patchI],
|
polyBoundaryPatchStartIndices_[patchi],
|
||||||
patchI,
|
patchi,
|
||||||
pMesh.boundaryMesh()
|
pMesh.boundaryMesh()
|
||||||
).ptr();
|
).ptr();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -241,13 +241,13 @@ void Foam::starMesh::readBoundary()
|
|||||||
defaultFacesType_
|
defaultFacesType_
|
||||||
);
|
);
|
||||||
|
|
||||||
forAll(patchDicts, patchI)
|
forAll(patchDicts, patchi)
|
||||||
{
|
{
|
||||||
if (patchDicts.set(patchI))
|
if (patchDicts.set(patchi))
|
||||||
{
|
{
|
||||||
const dictionary& dict = patchDicts[patchI];
|
const dictionary& dict = patchDicts[patchi];
|
||||||
dict.readIfPresent("type", patchTypes_[patchI]);
|
dict.readIfPresent("type", patchTypes_[patchi]);
|
||||||
dict.readIfPresent("physicalType", patchPhysicalTypes_[patchI]);
|
dict.readIfPresent("physicalType", patchPhysicalTypes_[patchi]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -431,27 +431,27 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
|
|
||||||
// Get Foam patchID and update region->patch table.
|
// Get Foam patchID and update region->patch table.
|
||||||
label patchI = 0;
|
label patchi = 0;
|
||||||
|
|
||||||
Map<label>::iterator patchFind =
|
Map<label>::iterator patchFind =
|
||||||
regionToPatch.find(region);
|
regionToPatch.find(region);
|
||||||
|
|
||||||
if (patchFind == regionToPatch.end())
|
if (patchFind == regionToPatch.end())
|
||||||
{
|
{
|
||||||
patchI = nPatches;
|
patchi = nPatches;
|
||||||
|
|
||||||
Info<< "Mapping tetgen region " << region
|
Info<< "Mapping tetgen region " << region
|
||||||
<< " to Foam patch "
|
<< " to Foam patch "
|
||||||
<< patchI << endl;
|
<< patchi << endl;
|
||||||
|
|
||||||
regionToPatch.insert(region, nPatches++);
|
regionToPatch.insert(region, nPatches++);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
patchI = patchFind();
|
patchi = patchFind();
|
||||||
}
|
}
|
||||||
|
|
||||||
boundaryPatch[faceI] = patchI;
|
boundaryPatch[faceI] = patchi;
|
||||||
|
|
||||||
// Skip remaining attributes
|
// Skip remaining attributes
|
||||||
for (label i = 1; i < nFaceAttr; i++)
|
for (label i = 1; i < nFaceAttr; i++)
|
||||||
@ -486,9 +486,9 @@ int main(int argc, char *argv[])
|
|||||||
faceListList patchFaces(nPatches);
|
faceListList patchFaces(nPatches);
|
||||||
wordList patchNames(nPatches);
|
wordList patchNames(nPatches);
|
||||||
|
|
||||||
forAll(patchNames, patchI)
|
forAll(patchNames, patchi)
|
||||||
{
|
{
|
||||||
patchNames[patchI] = word("patch") + name(patchI);
|
patchNames[patchi] = word("patch") + name(patchi);
|
||||||
}
|
}
|
||||||
|
|
||||||
wordList patchTypes(nPatches, polyPatch::typeName);
|
wordList patchTypes(nPatches, polyPatch::typeName);
|
||||||
@ -502,19 +502,19 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
forAll(boundaryPatch, faceI)
|
forAll(boundaryPatch, faceI)
|
||||||
{
|
{
|
||||||
label patchI = boundaryPatch[faceI];
|
label patchi = boundaryPatch[faceI];
|
||||||
|
|
||||||
allPatchFaces[patchI].append(boundaryFaces[faceI]);
|
allPatchFaces[patchi].append(boundaryFaces[faceI]);
|
||||||
}
|
}
|
||||||
|
|
||||||
Info<< "Patch sizes:" << endl;
|
Info<< "Patch sizes:" << endl;
|
||||||
|
|
||||||
forAll(allPatchFaces, patchI)
|
forAll(allPatchFaces, patchi)
|
||||||
{
|
{
|
||||||
Info<< " " << patchNames[patchI] << " : "
|
Info<< " " << patchNames[patchi] << " : "
|
||||||
<< allPatchFaces[patchI].size() << endl;
|
<< allPatchFaces[patchi].size() << endl;
|
||||||
|
|
||||||
patchFaces[patchI].transfer(allPatchFaces[patchI]);
|
patchFaces[patchi].transfer(allPatchFaces[patchi]);
|
||||||
}
|
}
|
||||||
|
|
||||||
Info<< endl;
|
Info<< endl;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -222,9 +222,9 @@ void writePatchCentres
|
|||||||
{
|
{
|
||||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||||
|
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = patches[patchI];
|
const polyPatch& pp = patches[patchi];
|
||||||
|
|
||||||
fileName faceFile
|
fileName faceFile
|
||||||
(
|
(
|
||||||
@ -251,9 +251,9 @@ void writePatchFaces
|
|||||||
{
|
{
|
||||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||||
|
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = patches[patchI];
|
const polyPatch& pp = patches[patchi];
|
||||||
|
|
||||||
fileName faceFile
|
fileName faceFile
|
||||||
(
|
(
|
||||||
@ -294,9 +294,9 @@ void writePatchBoundaryEdges
|
|||||||
{
|
{
|
||||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||||
|
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = patches[patchI];
|
const polyPatch& pp = patches[patchi];
|
||||||
|
|
||||||
fileName edgeFile
|
fileName edgeFile
|
||||||
(
|
(
|
||||||
|
|||||||
@ -358,11 +358,11 @@ int main(int argc, char *argv[])
|
|||||||
<< "Patches" << nl
|
<< "Patches" << nl
|
||||||
<< "----------------" << nl;
|
<< "----------------" << nl;
|
||||||
|
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
const polyPatch& p = patches[patchI];
|
const polyPatch& p = patches[patchi];
|
||||||
|
|
||||||
Info<< " " << "patch " << patchI
|
Info<< " " << "patch " << patchi
|
||||||
<< " (start: " << p.start()
|
<< " (start: " << p.start()
|
||||||
<< " size: " << p.size()
|
<< " size: " << p.size()
|
||||||
<< ") name: " << p.name()
|
<< ") name: " << p.name()
|
||||||
|
|||||||
@ -229,11 +229,11 @@ void changeFrontBackPatches
|
|||||||
|
|
||||||
DynamicList<polyPatch*> newPatches(patches.size());
|
DynamicList<polyPatch*> newPatches(patches.size());
|
||||||
|
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
const polyPatch& pp(patches[patchI]);
|
const polyPatch& pp(patches[patchi]);
|
||||||
|
|
||||||
if (patchI == frontPatchI || patchI == backPatchI)
|
if (patchi == frontPatchI || patchi == backPatchI)
|
||||||
{
|
{
|
||||||
newPatches.append
|
newPatches.append
|
||||||
(
|
(
|
||||||
@ -397,10 +397,10 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
label meshFaceI = meshFaces[i];
|
label meshFaceI = meshFaces[i];
|
||||||
|
|
||||||
label patchI = patches.whichPatch(meshFaceI);
|
label patchi = patches.whichPatch(meshFaceI);
|
||||||
label own = mesh.faceOwner()[meshFaceI];
|
label own = mesh.faceOwner()[meshFaceI];
|
||||||
label nei = -1;
|
label nei = -1;
|
||||||
if (patchI == -1)
|
if (patchi == -1)
|
||||||
{
|
{
|
||||||
nei = mesh.faceNeighbour()[meshFaceI];
|
nei = mesh.faceNeighbour()[meshFaceI];
|
||||||
}
|
}
|
||||||
@ -420,7 +420,7 @@ int main(int argc, char *argv[])
|
|||||||
own, // owner
|
own, // owner
|
||||||
nei, // neighbour
|
nei, // neighbour
|
||||||
true, // face flip
|
true, // face flip
|
||||||
patchI, // patch for face
|
patchi, // patch for face
|
||||||
zoneI, // zone for face
|
zoneI, // zone for face
|
||||||
zoneFlip // face flip in zone
|
zoneFlip // face flip in zone
|
||||||
);
|
);
|
||||||
@ -521,11 +521,11 @@ int main(int argc, char *argv[])
|
|||||||
if (nAdded > 0)
|
if (nAdded > 0)
|
||||||
{
|
{
|
||||||
DynamicList<polyPatch*> newPatches(nPatches);
|
DynamicList<polyPatch*> newPatches(nPatches);
|
||||||
forAll(mesh.boundaryMesh(), patchI)
|
forAll(mesh.boundaryMesh(), patchi)
|
||||||
{
|
{
|
||||||
newPatches.append
|
newPatches.append
|
||||||
(
|
(
|
||||||
mesh.boundaryMesh()[patchI].clone
|
mesh.boundaryMesh()[patchi].clone
|
||||||
(
|
(
|
||||||
mesh.boundaryMesh()
|
mesh.boundaryMesh()
|
||||||
).ptr()
|
).ptr()
|
||||||
@ -533,14 +533,14 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
for
|
for
|
||||||
(
|
(
|
||||||
label patchI = mesh.boundaryMesh().size();
|
label patchi = mesh.boundaryMesh().size();
|
||||||
patchI < nPatches;
|
patchi < nPatches;
|
||||||
patchI++
|
patchi++
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
label nbrProcI = patchToNbrProc[patchI];
|
label nbrProcI = patchToNbrProc[patchi];
|
||||||
|
|
||||||
Pout<< "Adding patch " << patchI
|
Pout<< "Adding patch " << patchi
|
||||||
<< " between " << Pstream::myProcNo()
|
<< " between " << Pstream::myProcNo()
|
||||||
<< " and " << nbrProcI
|
<< " and " << nbrProcI
|
||||||
<< endl;
|
<< endl;
|
||||||
@ -551,7 +551,7 @@ int main(int argc, char *argv[])
|
|||||||
(
|
(
|
||||||
0, // size
|
0, // size
|
||||||
mesh.nFaces(), // start
|
mesh.nFaces(), // start
|
||||||
patchI, // index
|
patchi, // index
|
||||||
mesh.boundaryMesh(),// polyBoundaryMesh
|
mesh.boundaryMesh(),// polyBoundaryMesh
|
||||||
Pstream::myProcNo(),// myProcNo
|
Pstream::myProcNo(),// myProcNo
|
||||||
nbrProcI // neighbProcNo
|
nbrProcI // neighbProcNo
|
||||||
|
|||||||
@ -164,29 +164,29 @@ label addPatch
|
|||||||
DynamicList<polyPatch*>& newPatches
|
DynamicList<polyPatch*>& newPatches
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
label patchI = findPatchID(newPatches, patchName);
|
label patchi = findPatchID(newPatches, patchName);
|
||||||
|
|
||||||
if (patchI != -1)
|
if (patchi != -1)
|
||||||
{
|
{
|
||||||
if (isA<PatchType>(*newPatches[patchI]))
|
if (isA<PatchType>(*newPatches[patchi]))
|
||||||
{
|
{
|
||||||
// Already there
|
// Already there
|
||||||
return patchI;
|
return patchi;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Already have patch " << patchName
|
<< "Already have patch " << patchName
|
||||||
<< " but of type " << newPatches[patchI]->type()
|
<< " but of type " << newPatches[patchi]->type()
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
patchI = newPatches.size();
|
patchi = newPatches.size();
|
||||||
|
|
||||||
label startFaceI = 0;
|
label startFaceI = 0;
|
||||||
if (patchI > 0)
|
if (patchi > 0)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = *newPatches.last();
|
const polyPatch& pp = *newPatches.last();
|
||||||
startFaceI = pp.start()+pp.size();
|
startFaceI = pp.start()+pp.size();
|
||||||
@ -201,12 +201,12 @@ label addPatch
|
|||||||
patchName,
|
patchName,
|
||||||
0, // size
|
0, // size
|
||||||
startFaceI, // nFaces
|
startFaceI, // nFaces
|
||||||
patchI,
|
patchi,
|
||||||
patches
|
patches
|
||||||
).ptr()
|
).ptr()
|
||||||
);
|
);
|
||||||
|
|
||||||
return patchI;
|
return patchi;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -219,29 +219,29 @@ label addPatch
|
|||||||
DynamicList<polyPatch*>& newPatches
|
DynamicList<polyPatch*>& newPatches
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
label patchI = findPatchID(newPatches, patchName);
|
label patchi = findPatchID(newPatches, patchName);
|
||||||
|
|
||||||
if (patchI != -1)
|
if (patchi != -1)
|
||||||
{
|
{
|
||||||
if (isA<PatchType>(*newPatches[patchI]))
|
if (isA<PatchType>(*newPatches[patchi]))
|
||||||
{
|
{
|
||||||
// Already there
|
// Already there
|
||||||
return patchI;
|
return patchi;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Already have patch " << patchName
|
<< "Already have patch " << patchName
|
||||||
<< " but of type " << newPatches[patchI]->type()
|
<< " but of type " << newPatches[patchi]->type()
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
patchI = newPatches.size();
|
patchi = newPatches.size();
|
||||||
|
|
||||||
label startFaceI = 0;
|
label startFaceI = 0;
|
||||||
if (patchI > 0)
|
if (patchi > 0)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = *newPatches.last();
|
const polyPatch& pp = *newPatches.last();
|
||||||
startFaceI = pp.start()+pp.size();
|
startFaceI = pp.start()+pp.size();
|
||||||
@ -258,12 +258,12 @@ label addPatch
|
|||||||
(
|
(
|
||||||
patchName,
|
patchName,
|
||||||
patchDict,
|
patchDict,
|
||||||
patchI,
|
patchi,
|
||||||
patches
|
patches
|
||||||
).ptr()
|
).ptr()
|
||||||
);
|
);
|
||||||
|
|
||||||
return patchI;
|
return patchi;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -287,60 +287,60 @@ void deleteEmptyPatches(fvMesh& mesh)
|
|||||||
// Add all the non-empty, non-processor patches
|
// Add all the non-empty, non-processor patches
|
||||||
forAll(masterNames, masterI)
|
forAll(masterNames, masterI)
|
||||||
{
|
{
|
||||||
label patchI = patches.findPatchID(masterNames[masterI]);
|
label patchi = patches.findPatchID(masterNames[masterI]);
|
||||||
|
|
||||||
if (patchI != -1)
|
if (patchi != -1)
|
||||||
{
|
{
|
||||||
if (isA<processorPolyPatch>(patches[patchI]))
|
if (isA<processorPolyPatch>(patches[patchi]))
|
||||||
{
|
{
|
||||||
// Similar named processor patch? Not 'possible'.
|
// Similar named processor patch? Not 'possible'.
|
||||||
if (patches[patchI].size() == 0)
|
if (patches[patchi].size() == 0)
|
||||||
{
|
{
|
||||||
Pout<< "Deleting processor patch " << patchI
|
Pout<< "Deleting processor patch " << patchi
|
||||||
<< " name:" << patches[patchI].name()
|
<< " name:" << patches[patchi].name()
|
||||||
<< endl;
|
<< endl;
|
||||||
oldToNew[patchI] = --notUsedI;
|
oldToNew[patchi] = --notUsedI;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
oldToNew[patchI] = usedI++;
|
oldToNew[patchi] = usedI++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Common patch.
|
// Common patch.
|
||||||
if (returnReduce(patches[patchI].size(), sumOp<label>()) == 0)
|
if (returnReduce(patches[patchi].size(), sumOp<label>()) == 0)
|
||||||
{
|
{
|
||||||
Pout<< "Deleting patch " << patchI
|
Pout<< "Deleting patch " << patchi
|
||||||
<< " name:" << patches[patchI].name()
|
<< " name:" << patches[patchi].name()
|
||||||
<< endl;
|
<< endl;
|
||||||
oldToNew[patchI] = --notUsedI;
|
oldToNew[patchi] = --notUsedI;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
oldToNew[patchI] = usedI++;
|
oldToNew[patchi] = usedI++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add remaining patches at the end
|
// Add remaining patches at the end
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
if (oldToNew[patchI] == -1)
|
if (oldToNew[patchi] == -1)
|
||||||
{
|
{
|
||||||
// Unique to this processor. Note: could check that these are
|
// Unique to this processor. Note: could check that these are
|
||||||
// only processor patches.
|
// only processor patches.
|
||||||
if (patches[patchI].size() == 0)
|
if (patches[patchi].size() == 0)
|
||||||
{
|
{
|
||||||
Pout<< "Deleting processor patch " << patchI
|
Pout<< "Deleting processor patch " << patchi
|
||||||
<< " name:" << patches[patchI].name()
|
<< " name:" << patches[patchi].name()
|
||||||
<< endl;
|
<< endl;
|
||||||
oldToNew[patchI] = --notUsedI;
|
oldToNew[patchi] = --notUsedI;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
oldToNew[patchI] = usedI++;
|
oldToNew[patchi] = usedI++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -533,12 +533,12 @@ label findUncoveredPatchFace
|
|||||||
forAll(eFaces, i)
|
forAll(eFaces, i)
|
||||||
{
|
{
|
||||||
label faceI = eFaces[i];
|
label faceI = eFaces[i];
|
||||||
label patchI = pbm.whichPatch(faceI);
|
label patchi = pbm.whichPatch(faceI);
|
||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
patchI != -1
|
patchi != -1
|
||||||
&& !pbm[patchI].coupled()
|
&& !pbm[patchi].coupled()
|
||||||
&& !extrudeFaceSet.found(faceI)
|
&& !extrudeFaceSet.found(faceI)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -569,12 +569,12 @@ label findUncoveredCyclicPatchFace
|
|||||||
forAll(eFaces, i)
|
forAll(eFaces, i)
|
||||||
{
|
{
|
||||||
label faceI = eFaces[i];
|
label faceI = eFaces[i];
|
||||||
label patchI = pbm.whichPatch(faceI);
|
label patchi = pbm.whichPatch(faceI);
|
||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
patchI != -1
|
patchi != -1
|
||||||
&& isA<cyclicPolyPatch>(pbm[patchI])
|
&& isA<cyclicPolyPatch>(pbm[patchi])
|
||||||
&& !extrudeFaceSet.found(faceI)
|
&& !extrudeFaceSet.found(faceI)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -1181,20 +1181,20 @@ void setCouplingInfo
|
|||||||
|
|
||||||
forAll(zoneToPatch, zoneI)
|
forAll(zoneToPatch, zoneI)
|
||||||
{
|
{
|
||||||
label patchI = zoneToPatch[zoneI];
|
label patchi = zoneToPatch[zoneI];
|
||||||
|
|
||||||
if (patchI != -1)
|
if (patchi != -1)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = patches[patchI];
|
const polyPatch& pp = patches[patchi];
|
||||||
|
|
||||||
if (isA<mappedWallPolyPatch>(pp))
|
if (isA<mappedWallPolyPatch>(pp))
|
||||||
{
|
{
|
||||||
newPatches[patchI] = new mappedWallPolyPatch
|
newPatches[patchi] = new mappedWallPolyPatch
|
||||||
(
|
(
|
||||||
pp.name(),
|
pp.name(),
|
||||||
pp.size(),
|
pp.size(),
|
||||||
pp.start(),
|
pp.start(),
|
||||||
patchI,
|
patchi,
|
||||||
sampleRegion, // sampleRegion
|
sampleRegion, // sampleRegion
|
||||||
mode, // sampleMode
|
mode, // sampleMode
|
||||||
pp.name(), // samplePatch
|
pp.name(), // samplePatch
|
||||||
@ -1205,11 +1205,11 @@ void setCouplingInfo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
forAll(newPatches, patchI)
|
forAll(newPatches, patchi)
|
||||||
{
|
{
|
||||||
if (!newPatches[patchI])
|
if (!newPatches[patchi])
|
||||||
{
|
{
|
||||||
newPatches[patchI] = patches[patchI].clone(patches).ptr();
|
newPatches[patchi] = patches[patchi].clone(patches).ptr();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1956,14 +1956,14 @@ int main(int argc, char *argv[])
|
|||||||
DynamicList<polyPatch*> regionPatches(patches.size());
|
DynamicList<polyPatch*> regionPatches(patches.size());
|
||||||
// Copy all non-local patches since these are used on boundary edges of
|
// Copy all non-local patches since these are used on boundary edges of
|
||||||
// the extrusion
|
// the extrusion
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
if (!isA<processorPolyPatch>(patches[patchI]))
|
if (!isA<processorPolyPatch>(patches[patchi]))
|
||||||
{
|
{
|
||||||
label newPatchI = regionPatches.size();
|
label newPatchI = regionPatches.size();
|
||||||
regionPatches.append
|
regionPatches.append
|
||||||
(
|
(
|
||||||
patches[patchI].clone
|
patches[patchi].clone
|
||||||
(
|
(
|
||||||
patches,
|
patches,
|
||||||
newPatchI,
|
newPatchI,
|
||||||
@ -2008,9 +2008,9 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
// Clone existing patches
|
// Clone existing patches
|
||||||
DynamicList<polyPatch*> newPatches(patches.size());
|
DynamicList<polyPatch*> newPatches(patches.size());
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
newPatches.append(patches[patchI].clone(patches).ptr());
|
newPatches.append(patches[patchi].clone(patches).ptr());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add new patches
|
// Add new patches
|
||||||
@ -2126,10 +2126,10 @@ int main(int argc, char *argv[])
|
|||||||
// // Add all the newPatches to the mesh and fields
|
// // Add all the newPatches to the mesh and fields
|
||||||
// // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
// // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
// {
|
// {
|
||||||
// forAll(newPatches, patchI)
|
// forAll(newPatches, patchi)
|
||||||
// {
|
// {
|
||||||
// Pout<< "Adding patch " << patchI
|
// Pout<< "Adding patch " << patchi
|
||||||
// << " name:" << newPatches[patchI]->name()
|
// << " name:" << newPatches[patchi]->name()
|
||||||
// << endl;
|
// << endl;
|
||||||
// }
|
// }
|
||||||
// //label nOldPatches = mesh.boundary().size();
|
// //label nOldPatches = mesh.boundary().size();
|
||||||
@ -2139,12 +2139,12 @@ int main(int argc, char *argv[])
|
|||||||
// //// Add calculated fvPatchFields for the added patches
|
// //// Add calculated fvPatchFields for the added patches
|
||||||
// //for
|
// //for
|
||||||
// //(
|
// //(
|
||||||
// // label patchI = nOldPatches;
|
// // label patchi = nOldPatches;
|
||||||
// // patchI < mesh.boundary().size();
|
// // patchi < mesh.boundary().size();
|
||||||
// // patchI++
|
// // patchi++
|
||||||
// //)
|
// //)
|
||||||
// //{
|
// //{
|
||||||
// // Pout<< "ADDing calculated to patch " << patchI
|
// // Pout<< "ADDing calculated to patch " << patchi
|
||||||
// // << endl;
|
// // << endl;
|
||||||
// // addCalculatedPatchFields(mesh);
|
// // addCalculatedPatchFields(mesh);
|
||||||
// //}
|
// //}
|
||||||
@ -2408,10 +2408,10 @@ int main(int argc, char *argv[])
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Add the new patches
|
// Add the new patches
|
||||||
forAll(regionPatches, patchI)
|
forAll(regionPatches, patchi)
|
||||||
{
|
{
|
||||||
polyPatch* ppPtr = regionPatches[patchI];
|
polyPatch* ppPtr = regionPatches[patchi];
|
||||||
regionPatches[patchI] = ppPtr->clone(regionMesh.boundaryMesh()).ptr();
|
regionPatches[patchi] = ppPtr->clone(regionMesh.boundaryMesh()).ptr();
|
||||||
delete ppPtr;
|
delete ppPtr;
|
||||||
}
|
}
|
||||||
regionMesh.clearOut();
|
regionMesh.clearOut();
|
||||||
@ -2474,20 +2474,20 @@ int main(int argc, char *argv[])
|
|||||||
List<pointField> topOffsets(zoneNames.size());
|
List<pointField> topOffsets(zoneNames.size());
|
||||||
List<pointField> bottomOffsets(zoneNames.size());
|
List<pointField> bottomOffsets(zoneNames.size());
|
||||||
|
|
||||||
forAll(regionMesh.boundaryMesh(), patchI)
|
forAll(regionMesh.boundaryMesh(), patchi)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = regionMesh.boundaryMesh()[patchI];
|
const polyPatch& pp = regionMesh.boundaryMesh()[patchi];
|
||||||
|
|
||||||
if (isA<mappedWallPolyPatch>(pp))
|
if (isA<mappedWallPolyPatch>(pp))
|
||||||
{
|
{
|
||||||
if (findIndex(interRegionTopPatch, patchI) != -1)
|
if (findIndex(interRegionTopPatch, patchi) != -1)
|
||||||
{
|
{
|
||||||
label zoneI = findIndex(interRegionTopPatch, patchI);
|
label zoneI = findIndex(interRegionTopPatch, patchi);
|
||||||
topOffsets[zoneI] = calcOffset(extrudePatch, extruder, pp);
|
topOffsets[zoneI] = calcOffset(extrudePatch, extruder, pp);
|
||||||
}
|
}
|
||||||
else if (findIndex(interRegionBottomPatch, patchI) != -1)
|
else if (findIndex(interRegionBottomPatch, patchi) != -1)
|
||||||
{
|
{
|
||||||
label zoneI = findIndex(interRegionBottomPatch, patchI);
|
label zoneI = findIndex(interRegionBottomPatch, patchi);
|
||||||
bottomOffsets[zoneI] = calcOffset(extrudePatch, extruder, pp);
|
bottomOffsets[zoneI] = calcOffset(extrudePatch, extruder, pp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -117,11 +117,11 @@ void Foam::extrude2DMesh::addFrontBackPatches()
|
|||||||
// Add patch.
|
// Add patch.
|
||||||
List<polyPatch*> newPatches(patches.size() + 2);
|
List<polyPatch*> newPatches(patches.size() + 2);
|
||||||
|
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = patches[patchI];
|
const polyPatch& pp = patches[patchi];
|
||||||
|
|
||||||
newPatches[patchI] =
|
newPatches[patchi] =
|
||||||
pp.clone
|
pp.clone
|
||||||
(
|
(
|
||||||
patches,
|
patches,
|
||||||
@ -323,15 +323,15 @@ void Foam::extrude2DMesh::setRefinement
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
for (label layer=0; layer < nLayers; layer++)
|
for (label layer=0; layer < nLayers; layer++)
|
||||||
{
|
{
|
||||||
label currentLayerOffset = layer*mesh_.nPoints();
|
label currentLayerOffset = layer*mesh_.nPoints();
|
||||||
label nextLayerOffset = currentLayerOffset + mesh_.nPoints();
|
label nextLayerOffset = currentLayerOffset + mesh_.nPoints();
|
||||||
|
|
||||||
label startFaceI = patches[patchI].start();
|
label startFaceI = patches[patchi].start();
|
||||||
label endFaceI = startFaceI + patches[patchI].size();
|
label endFaceI = startFaceI + patches[patchi].size();
|
||||||
|
|
||||||
for (label faceI = startFaceI; faceI < endFaceI; faceI++)
|
for (label faceI = startFaceI; faceI < endFaceI; faceI++)
|
||||||
{
|
{
|
||||||
@ -361,7 +361,7 @@ void Foam::extrude2DMesh::setRefinement
|
|||||||
-1, // masterEdgeID
|
-1, // masterEdgeID
|
||||||
nFaces++, // masterFaceID
|
nFaces++, // masterFaceID
|
||||||
false, // flipFaceFlux
|
false, // flipFaceFlux
|
||||||
patchI, // patchID
|
patchi, // patchID
|
||||||
zoneID, // zoneID
|
zoneID, // zoneID
|
||||||
zoneFlip // zoneFlip
|
zoneFlip // zoneFlip
|
||||||
);
|
);
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -152,11 +152,11 @@ void Foam::patchToPoly2DMesh::addPatchFacesToFaces()
|
|||||||
label offset = patch_.nInternalEdges();
|
label offset = patch_.nInternalEdges();
|
||||||
face f(2);
|
face f(2);
|
||||||
|
|
||||||
forAll(patchNames_, patchI)
|
forAll(patchNames_, patchi)
|
||||||
{
|
{
|
||||||
forAllConstIter(EdgeMap<label>, mapEdgesRegion_, eIter)
|
forAllConstIter(EdgeMap<label>, mapEdgesRegion_, eIter)
|
||||||
{
|
{
|
||||||
if (eIter() == patchI)
|
if (eIter() == patchi)
|
||||||
{
|
{
|
||||||
f[0] = meshPoints[eIter.key().start()];
|
f[0] = meshPoints[eIter.key().start()];
|
||||||
f[1] = meshPoints[eIter.key().end()];
|
f[1] = meshPoints[eIter.key().end()];
|
||||||
@ -333,10 +333,10 @@ void Foam::patchToPoly2DMesh::createMesh()
|
|||||||
createPolyMeshComponents();
|
createPolyMeshComponents();
|
||||||
|
|
||||||
label startFace = patch_.nInternalEdges();
|
label startFace = patch_.nInternalEdges();
|
||||||
forAll(patchNames_, patchI)
|
forAll(patchNames_, patchi)
|
||||||
{
|
{
|
||||||
patchStarts_[patchI] = startFace;
|
patchStarts_[patchi] = startFace;
|
||||||
startFace += patchSizes_[patchI];
|
startFace += patchSizes_[patchi];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -208,14 +208,14 @@ int main(int argc, char *argv[])
|
|||||||
Info<< "Constructing patches." << endl;
|
Info<< "Constructing patches." << endl;
|
||||||
List<polyPatch*> patches(poly2DMesh.patchNames().size());
|
List<polyPatch*> patches(poly2DMesh.patchNames().size());
|
||||||
|
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
patches[patchI] = new polyPatch
|
patches[patchi] = new polyPatch
|
||||||
(
|
(
|
||||||
poly2DMesh.patchNames()[patchI],
|
poly2DMesh.patchNames()[patchi],
|
||||||
poly2DMesh.patchSizes()[patchI],
|
poly2DMesh.patchSizes()[patchi],
|
||||||
poly2DMesh.patchStarts()[patchI],
|
poly2DMesh.patchStarts()[patchi],
|
||||||
patchI,
|
patchi,
|
||||||
mesh().boundaryMesh(),
|
mesh().boundaryMesh(),
|
||||||
polyPatch::typeName
|
polyPatch::typeName
|
||||||
);
|
);
|
||||||
|
|||||||
@ -947,9 +947,9 @@ Foam::labelHashSet Foam::conformalVoronoiMesh::findOffsetPatchFaces
|
|||||||
mesh.nCells()/1000
|
mesh.nCells()/1000
|
||||||
);
|
);
|
||||||
|
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
const polyPatch& patch = patches[patchI];
|
const polyPatch& patch = patches[patchi];
|
||||||
|
|
||||||
const faceList& localFaces = patch.localFaces();
|
const faceList& localFaces = patch.localFaces();
|
||||||
const pointField& localPoints = patch.localPoints();
|
const pointField& localPoints = patch.localPoints();
|
||||||
@ -1079,11 +1079,11 @@ Foam::labelHashSet Foam::conformalVoronoiMesh::checkPolyMeshQuality
|
|||||||
|
|
||||||
const polyBoundaryMesh& patches = pMesh.boundaryMesh();
|
const polyBoundaryMesh& patches = pMesh.boundaryMesh();
|
||||||
|
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
if (patches[patchI].coupled())
|
if (patches[patchi].coupled())
|
||||||
{
|
{
|
||||||
const labelUList& owners = patches[patchI].faceCells();
|
const labelUList& owners = patches[patchi].faceCells();
|
||||||
|
|
||||||
forAll(owners, i)
|
forAll(owners, i)
|
||||||
{
|
{
|
||||||
@ -1535,16 +1535,16 @@ Foam::label Foam::conformalVoronoiMesh::createPatchInfo
|
|||||||
|
|
||||||
const PtrList<dictionary>& patchInfo = geometryToConformTo_.patchInfo();
|
const PtrList<dictionary>& patchInfo = geometryToConformTo_.patchInfo();
|
||||||
|
|
||||||
forAll(patchNames, patchI)
|
forAll(patchNames, patchi)
|
||||||
{
|
{
|
||||||
if (patchInfo.set(patchI))
|
if (patchInfo.set(patchi))
|
||||||
{
|
{
|
||||||
patchDicts.set(patchI, new dictionary(patchInfo[patchI]));
|
patchDicts.set(patchi, new dictionary(patchInfo[patchi]));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
patchDicts.set(patchI, new dictionary());
|
patchDicts.set(patchi, new dictionary());
|
||||||
patchDicts[patchI].set
|
patchDicts[patchi].set
|
||||||
(
|
(
|
||||||
"type",
|
"type",
|
||||||
wallPolyPatch::typeName
|
wallPolyPatch::typeName
|
||||||
@ -1734,14 +1734,14 @@ void Foam::conformalVoronoiMesh::createFacesOwnerNeighbourAndPatches
|
|||||||
const label nPatches = patchNames.size();
|
const label nPatches = patchNames.size();
|
||||||
|
|
||||||
labelList procNeighbours(nPatches, label(-1));
|
labelList procNeighbours(nPatches, label(-1));
|
||||||
forAll(procNeighbours, patchI)
|
forAll(procNeighbours, patchi)
|
||||||
{
|
{
|
||||||
if (patchDicts[patchI].found("neighbProcNo"))
|
if (patchDicts[patchi].found("neighbProcNo"))
|
||||||
{
|
{
|
||||||
procNeighbours[patchI] =
|
procNeighbours[patchi] =
|
||||||
(
|
(
|
||||||
patchDicts[patchI].found("neighbProcNo")
|
patchDicts[patchi].found("neighbProcNo")
|
||||||
? readLabel(patchDicts[patchI].lookup("neighbProcNo"))
|
? readLabel(patchDicts[patchi].lookup("neighbProcNo"))
|
||||||
: -1
|
: -1
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -2347,9 +2347,9 @@ void Foam::conformalVoronoiMesh::createFacesOwnerNeighbourAndPatches
|
|||||||
|
|
||||||
// Return patchPointPairSlaves.setSize(nPatches);
|
// Return patchPointPairSlaves.setSize(nPatches);
|
||||||
patchPointPairSlaves.setSize(nPatches);
|
patchPointPairSlaves.setSize(nPatches);
|
||||||
forAll(patchPPSlaves, patchI)
|
forAll(patchPPSlaves, patchi)
|
||||||
{
|
{
|
||||||
patchPointPairSlaves[patchI].transfer(patchPPSlaves[patchI]);
|
patchPointPairSlaves[patchi].transfer(patchPPSlaves[patchi]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (foamyHexMeshControls().objOutput())
|
if (foamyHexMeshControls().objOutput())
|
||||||
@ -2458,13 +2458,13 @@ void Foam::conformalVoronoiMesh::sortProcPatches
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
forAll(patchSortingIndices, patchI)
|
forAll(patchSortingIndices, patchi)
|
||||||
{
|
{
|
||||||
faceList& faces = patchFaces[patchI];
|
faceList& faces = patchFaces[patchi];
|
||||||
labelList& owner = patchOwners[patchI];
|
labelList& owner = patchOwners[patchi];
|
||||||
DynamicList<label>& slaves = patchPointPairSlaves[patchI];
|
DynamicList<label>& slaves = patchPointPairSlaves[patchi];
|
||||||
DynamicList<Pair<labelPair>>& sortingIndices
|
DynamicList<Pair<labelPair>>& sortingIndices
|
||||||
= patchSortingIndices[patchI];
|
= patchSortingIndices[patchi];
|
||||||
|
|
||||||
if (!sortingIndices.empty())
|
if (!sortingIndices.empty())
|
||||||
{
|
{
|
||||||
@ -2477,7 +2477,7 @@ void Foam::conformalVoronoiMesh::sortProcPatches
|
|||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "patch size and size of sorting indices is inconsistent "
|
<< "patch size and size of sorting indices is inconsistent "
|
||||||
<< " for patch " << patchI << nl
|
<< " for patch " << patchi << nl
|
||||||
<< " faces.size() " << faces.size() << nl
|
<< " faces.size() " << faces.size() << nl
|
||||||
<< " owner.size() " << owner.size() << nl
|
<< " owner.size() " << owner.size() << nl
|
||||||
<< " slaves.size() " << slaves.size() << nl
|
<< " slaves.size() " << slaves.size() << nl
|
||||||
|
|||||||
@ -152,10 +152,10 @@ void Foam::conformalVoronoiMesh::writeMesh(const fileName& instance)
|
|||||||
|
|
||||||
dualPatchStarts.setSize(patchDicts.size());
|
dualPatchStarts.setSize(patchDicts.size());
|
||||||
|
|
||||||
forAll(dualPatchStarts, patchI)
|
forAll(dualPatchStarts, patchi)
|
||||||
{
|
{
|
||||||
dualPatchStarts[patchI] =
|
dualPatchStarts[patchi] =
|
||||||
readLabel(patchDicts[patchI].lookup("startFace"));
|
readLabel(patchDicts[patchi].lookup("startFace"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -229,9 +229,9 @@ void Foam::conformalVoronoiMesh::writeMesh(const fileName& instance)
|
|||||||
// vertexToDualAddressing[vertI] = cellI+1;
|
// vertexToDualAddressing[vertI] = cellI+1;
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// forAll(patchToDelaunayVertex, patchI)
|
// forAll(patchToDelaunayVertex, patchi)
|
||||||
// {
|
// {
|
||||||
// const labelList& patchVertices = patchToDelaunayVertex[patchI];
|
// const labelList& patchVertices = patchToDelaunayVertex[patchi];
|
||||||
//
|
//
|
||||||
// forAll(patchVertices, i)
|
// forAll(patchVertices, i)
|
||||||
// {
|
// {
|
||||||
@ -241,7 +241,7 @@ void Foam::conformalVoronoiMesh::writeMesh(const fileName& instance)
|
|||||||
// {
|
// {
|
||||||
// FatalErrorInFunction
|
// FatalErrorInFunction
|
||||||
// << "Delaunay vertex " << vertI
|
// << "Delaunay vertex " << vertI
|
||||||
// << " from patch " << patchI
|
// << " from patch " << patchi
|
||||||
// << " local index " << i
|
// << " local index " << i
|
||||||
// << " is already mapped to cell "
|
// << " is already mapped to cell "
|
||||||
// << vertexToDualAddressing[vertI]-1
|
// << vertexToDualAddressing[vertI]-1
|
||||||
@ -250,7 +250,7 @@ void Foam::conformalVoronoiMesh::writeMesh(const fileName& instance)
|
|||||||
//
|
//
|
||||||
// // Vertex might be used by multiple faces. Which one to
|
// // Vertex might be used by multiple faces. Which one to
|
||||||
// // use? For now last one wins.
|
// // use? For now last one wins.
|
||||||
// label dualFaceI = dualPatchStarts[patchI]+i;
|
// label dualFaceI = dualPatchStarts[patchi]+i;
|
||||||
// vertexToDualAddressing[vertI] = -dualFaceI-1;
|
// vertexToDualAddressing[vertI] = -dualFaceI-1;
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
@ -419,37 +419,37 @@ Foam::autoPtr<Foam::fvMesh> Foam::conformalVoronoiMesh::createDummyMesh
|
|||||||
|
|
||||||
List<polyPatch*> patches(patchDicts.size());
|
List<polyPatch*> patches(patchDicts.size());
|
||||||
|
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
patchDicts.set(patchI)
|
patchDicts.set(patchi)
|
||||||
&& (
|
&& (
|
||||||
word(patchDicts[patchI].lookup("type"))
|
word(patchDicts[patchi].lookup("type"))
|
||||||
== processorPolyPatch::typeName
|
== processorPolyPatch::typeName
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
patches[patchI] = new processorPolyPatch
|
patches[patchi] = new processorPolyPatch
|
||||||
(
|
(
|
||||||
0, //patchSizes[p],
|
0, //patchSizes[p],
|
||||||
0, //patchStarts[p],
|
0, //patchStarts[p],
|
||||||
patchI,
|
patchi,
|
||||||
mesh.boundaryMesh(),
|
mesh.boundaryMesh(),
|
||||||
readLabel(patchDicts[patchI].lookup("myProcNo")),
|
readLabel(patchDicts[patchi].lookup("myProcNo")),
|
||||||
readLabel(patchDicts[patchI].lookup("neighbProcNo")),
|
readLabel(patchDicts[patchi].lookup("neighbProcNo")),
|
||||||
coupledPolyPatch::COINCIDENTFULLMATCH
|
coupledPolyPatch::COINCIDENTFULLMATCH
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
patches[patchI] = polyPatch::New
|
patches[patchi] = polyPatch::New
|
||||||
(
|
(
|
||||||
patchDicts[patchI].lookup("type"),
|
patchDicts[patchi].lookup("type"),
|
||||||
patchNames[patchI],
|
patchNames[patchi],
|
||||||
0, //patchSizes[p],
|
0, //patchSizes[p],
|
||||||
0, //patchStarts[p],
|
0, //patchStarts[p],
|
||||||
patchI,
|
patchi,
|
||||||
mesh.boundaryMesh()
|
mesh.boundaryMesh()
|
||||||
).ptr();
|
).ptr();
|
||||||
}
|
}
|
||||||
@ -473,22 +473,22 @@ void Foam::conformalVoronoiMesh::checkProcessorPatchesMatch
|
|||||||
labelList(Pstream::nProcs(), -1)
|
labelList(Pstream::nProcs(), -1)
|
||||||
);
|
);
|
||||||
|
|
||||||
forAll(patchDicts, patchI)
|
forAll(patchDicts, patchi)
|
||||||
{
|
{
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
patchDicts.set(patchI)
|
patchDicts.set(patchi)
|
||||||
&& (
|
&& (
|
||||||
word(patchDicts[patchI].lookup("type"))
|
word(patchDicts[patchi].lookup("type"))
|
||||||
== processorPolyPatch::typeName
|
== processorPolyPatch::typeName
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const label procNeighb =
|
const label procNeighb =
|
||||||
readLabel(patchDicts[patchI].lookup("neighbProcNo"));
|
readLabel(patchDicts[patchi].lookup("neighbProcNo"));
|
||||||
|
|
||||||
procPatchSizes[Pstream::myProcNo()][procNeighb]
|
procPatchSizes[Pstream::myProcNo()][procNeighb]
|
||||||
= readLabel(patchDicts[patchI].lookup("nFaces"));
|
= readLabel(patchDicts[patchi].lookup("nFaces"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -502,15 +502,15 @@ void Foam::conformalVoronoiMesh::checkProcessorPatchesMatch
|
|||||||
{
|
{
|
||||||
const labelList& patchSizes = procPatchSizes[procI];
|
const labelList& patchSizes = procPatchSizes[procI];
|
||||||
|
|
||||||
forAll(patchSizes, patchI)
|
forAll(patchSizes, patchi)
|
||||||
{
|
{
|
||||||
if (patchSizes[patchI] != procPatchSizes[patchI][procI])
|
if (patchSizes[patchi] != procPatchSizes[patchi][procI])
|
||||||
{
|
{
|
||||||
allMatch = false;
|
allMatch = false;
|
||||||
|
|
||||||
Info<< indent << "Patches " << procI << " and " << patchI
|
Info<< indent << "Patches " << procI << " and " << patchi
|
||||||
<< " have different sizes: " << patchSizes[patchI]
|
<< " have different sizes: " << patchSizes[patchi]
|
||||||
<< " and " << procPatchSizes[patchI][procI] << endl;
|
<< " and " << procPatchSizes[patchi][procI] << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -621,9 +621,9 @@ void Foam::conformalVoronoiMesh::reorderProcessorPatches
|
|||||||
const fvMesh& sortMesh = sortMeshPtr();
|
const fvMesh& sortMesh = sortMeshPtr();
|
||||||
|
|
||||||
// Change the transform type on processors to coincident full match.
|
// Change the transform type on processors to coincident full match.
|
||||||
// forAll(sortMesh.boundaryMesh(), patchI)
|
// forAll(sortMesh.boundaryMesh(), patchi)
|
||||||
// {
|
// {
|
||||||
// const polyPatch& patch = sortMesh.boundaryMesh()[patchI];
|
// const polyPatch& patch = sortMesh.boundaryMesh()[patchi];
|
||||||
//
|
//
|
||||||
// if (isA<processorPolyPatch>(patch))
|
// if (isA<processorPolyPatch>(patch))
|
||||||
// {
|
// {
|
||||||
@ -644,9 +644,9 @@ void Foam::conformalVoronoiMesh::reorderProcessorPatches
|
|||||||
PstreamBuffers pBufs(Pstream::nonBlocking);
|
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||||
|
|
||||||
// Send ordering
|
// Send ordering
|
||||||
forAll(sortMesh.boundaryMesh(), patchI)
|
forAll(sortMesh.boundaryMesh(), patchi)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = sortMesh.boundaryMesh()[patchI];
|
const polyPatch& pp = sortMesh.boundaryMesh()[patchi];
|
||||||
|
|
||||||
if (isA<processorPolyPatch>(pp))
|
if (isA<processorPolyPatch>(pp))
|
||||||
{
|
{
|
||||||
@ -658,8 +658,8 @@ void Foam::conformalVoronoiMesh::reorderProcessorPatches
|
|||||||
SubList<face>
|
SubList<face>
|
||||||
(
|
(
|
||||||
faces,
|
faces,
|
||||||
readLabel(patchDicts[patchI].lookup("nFaces")),
|
readLabel(patchDicts[patchi].lookup("nFaces")),
|
||||||
readLabel(patchDicts[patchI].lookup("startFace"))
|
readLabel(patchDicts[patchi].lookup("startFace"))
|
||||||
),
|
),
|
||||||
points
|
points
|
||||||
)
|
)
|
||||||
@ -674,16 +674,16 @@ void Foam::conformalVoronoiMesh::reorderProcessorPatches
|
|||||||
// Receive and calculate ordering
|
// Receive and calculate ordering
|
||||||
bool anyChanged = false;
|
bool anyChanged = false;
|
||||||
|
|
||||||
forAll(sortMesh.boundaryMesh(), patchI)
|
forAll(sortMesh.boundaryMesh(), patchi)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = sortMesh.boundaryMesh()[patchI];
|
const polyPatch& pp = sortMesh.boundaryMesh()[patchi];
|
||||||
|
|
||||||
if (isA<processorPolyPatch>(pp))
|
if (isA<processorPolyPatch>(pp))
|
||||||
{
|
{
|
||||||
const label nPatchFaces =
|
const label nPatchFaces =
|
||||||
readLabel(patchDicts[patchI].lookup("nFaces"));
|
readLabel(patchDicts[patchi].lookup("nFaces"));
|
||||||
const label patchStartFace =
|
const label patchStartFace =
|
||||||
readLabel(patchDicts[patchI].lookup("startFace"));
|
readLabel(patchDicts[patchi].lookup("startFace"));
|
||||||
|
|
||||||
labelList patchFaceMap(nPatchFaces, label(-1));
|
labelList patchFaceMap(nPatchFaces, label(-1));
|
||||||
labelList patchFaceRotation(nPatchFaces, label(0));
|
labelList patchFaceRotation(nPatchFaces, label(0));
|
||||||
@ -1355,9 +1355,9 @@ Foam::labelHashSet Foam::conformalVoronoiMesh::findRemainingProtrusionSet
|
|||||||
|
|
||||||
labelHashSet protrudingBoundaryPoints;
|
labelHashSet protrudingBoundaryPoints;
|
||||||
|
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
const polyPatch& patch = patches[patchI];
|
const polyPatch& patch = patches[patchi];
|
||||||
|
|
||||||
forAll(patch.localPoints(), pLPI)
|
forAll(patch.localPoints(), pLPI)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -51,9 +51,9 @@ void Foam::conformalVoronoiMesh::calcNeighbourCellCentres
|
|||||||
|
|
||||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||||
|
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = patches[patchI];
|
const polyPatch& pp = patches[patchi];
|
||||||
|
|
||||||
const labelUList& faceCells = pp.faceCells();
|
const labelUList& faceCells = pp.faceCells();
|
||||||
|
|
||||||
@ -82,14 +82,14 @@ void Foam::conformalVoronoiMesh::selectSeparatedCoupledFaces
|
|||||||
{
|
{
|
||||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||||
|
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
// Check all coupled. Avoid using .coupled() so we also pick up AMI.
|
// Check all coupled. Avoid using .coupled() so we also pick up AMI.
|
||||||
if (isA<coupledPolyPatch>(patches[patchI]))
|
if (isA<coupledPolyPatch>(patches[patchi]))
|
||||||
{
|
{
|
||||||
const coupledPolyPatch& cpp = refCast<const coupledPolyPatch>
|
const coupledPolyPatch& cpp = refCast<const coupledPolyPatch>
|
||||||
(
|
(
|
||||||
patches[patchI]
|
patches[patchi]
|
||||||
);
|
);
|
||||||
|
|
||||||
if (cpp.separated() || !cpp.parallel())
|
if (cpp.separated() || !cpp.parallel())
|
||||||
@ -323,9 +323,9 @@ void Foam::conformalVoronoiMesh::calcFaceZones
|
|||||||
|
|
||||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||||
|
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = patches[patchI];
|
const polyPatch& pp = patches[patchi];
|
||||||
|
|
||||||
const labelUList& faceCells = pp.faceCells();
|
const labelUList& faceCells = pp.faceCells();
|
||||||
|
|
||||||
@ -501,9 +501,9 @@ void Foam::conformalVoronoiMesh::calcFaceZones
|
|||||||
|
|
||||||
// labelList neiCellSurface(mesh.nFaces()-mesh.nInternalFaces());
|
// labelList neiCellSurface(mesh.nFaces()-mesh.nInternalFaces());
|
||||||
//
|
//
|
||||||
// forAll(patches, patchI)
|
// forAll(patches, patchi)
|
||||||
// {
|
// {
|
||||||
// const polyPatch& pp = patches[patchI];
|
// const polyPatch& pp = patches[patchi];
|
||||||
//
|
//
|
||||||
// if (pp.coupled())
|
// if (pp.coupled())
|
||||||
// {
|
// {
|
||||||
@ -517,9 +517,9 @@ void Foam::conformalVoronoiMesh::calcFaceZones
|
|||||||
// }
|
// }
|
||||||
// syncTools::swapBoundaryFaceList(mesh, neiCellSurface);
|
// syncTools::swapBoundaryFaceList(mesh, neiCellSurface);
|
||||||
//
|
//
|
||||||
// forAll(patches, patchI)
|
// forAll(patches, patchi)
|
||||||
// {
|
// {
|
||||||
// const polyPatch& pp = patches[patchI];
|
// const polyPatch& pp = patches[patchi];
|
||||||
//
|
//
|
||||||
// if (pp.coupled())
|
// if (pp.coupled())
|
||||||
// {
|
// {
|
||||||
|
|||||||
@ -644,10 +644,10 @@ int main(int argc, char *argv[])
|
|||||||
surfaces
|
surfaces
|
||||||
);
|
);
|
||||||
// Patch fields
|
// Patch fields
|
||||||
forAll(fvm.C().boundaryField(), patchI)
|
forAll(fvm.C().boundaryField(), patchi)
|
||||||
{
|
{
|
||||||
const pointField& cc = fvm.C().boundaryField()[patchI];
|
const pointField& cc = fvm.C().boundaryField()[patchi];
|
||||||
fvPatchScalarField& fld = cellDistance.boundaryField()[patchI];
|
fvPatchScalarField& fld = cellDistance.boundaryField()[patchi];
|
||||||
scalarField patchDistSqr
|
scalarField patchDistSqr
|
||||||
(
|
(
|
||||||
fld.patch().patchInternalField(distSqr)
|
fld.patch().patchInternalField(distSqr)
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -280,10 +280,10 @@ void Foam::CV2D::calcDual
|
|||||||
|
|
||||||
extractPatches(patchNames, patchSizes, mapEdgesRegion, indirectPatchEdge);
|
extractPatches(patchNames, patchSizes, mapEdgesRegion, indirectPatchEdge);
|
||||||
|
|
||||||
forAll(patchNames, patchI)
|
forAll(patchNames, patchi)
|
||||||
{
|
{
|
||||||
Info<< "Patch " << patchNames[patchI]
|
Info<< "Patch " << patchNames[patchi]
|
||||||
<< " has size " << patchSizes[patchI] << endl;
|
<< " has size " << patchSizes[patchi] << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create dual faces
|
// Create dual faces
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -165,15 +165,15 @@ int main(int argc, char *argv[])
|
|||||||
List<polyPatch*> patches(poly2DMesh.patchNames().size());
|
List<polyPatch*> patches(poly2DMesh.patchNames().size());
|
||||||
label countPatches = 0;
|
label countPatches = 0;
|
||||||
|
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
if (poly2DMesh.patchSizes()[patchI] != 0)
|
if (poly2DMesh.patchSizes()[patchi] != 0)
|
||||||
{
|
{
|
||||||
patches[countPatches] = new polyPatch
|
patches[countPatches] = new polyPatch
|
||||||
(
|
(
|
||||||
poly2DMesh.patchNames()[patchI],
|
poly2DMesh.patchNames()[patchi],
|
||||||
poly2DMesh.patchSizes()[patchI],
|
poly2DMesh.patchSizes()[patchi],
|
||||||
poly2DMesh.patchStarts()[patchI],
|
poly2DMesh.patchStarts()[patchi],
|
||||||
countPatches,
|
countPatches,
|
||||||
pMesh.boundaryMesh(),
|
pMesh.boundaryMesh(),
|
||||||
word::null
|
word::null
|
||||||
|
|||||||
@ -578,10 +578,10 @@ void Foam::shortEdgeFilter2D::writeInfo(Ostream& os)
|
|||||||
<< " edgeAttachedToBoundaryFactor: " << edgeAttachedToBoundaryFactor_
|
<< " edgeAttachedToBoundaryFactor: " << edgeAttachedToBoundaryFactor_
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
forAll(patchNames_, patchI)
|
forAll(patchNames_, patchi)
|
||||||
{
|
{
|
||||||
os << " Patch " << patchNames_[patchI]
|
os << " Patch " << patchNames_[patchi]
|
||||||
<< ", size " << patchSizes_[patchI] << endl;
|
<< ", size " << patchSizes_[patchi] << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
os << " There are " << mapEdgesRegion_.size()
|
os << " There are " << mapEdgesRegion_.size()
|
||||||
|
|||||||
@ -411,10 +411,10 @@ void extractSurface
|
|||||||
labelList patchToCompactZone(bMesh.size(), -1);
|
labelList patchToCompactZone(bMesh.size(), -1);
|
||||||
forAllConstIter(HashTable<label>, compactZoneID, iter)
|
forAllConstIter(HashTable<label>, compactZoneID, iter)
|
||||||
{
|
{
|
||||||
label patchI = bMesh.findPatchID(iter.key());
|
label patchi = bMesh.findPatchID(iter.key());
|
||||||
if (patchI != -1)
|
if (patchi != -1)
|
||||||
{
|
{
|
||||||
patchToCompactZone[patchI] = iter();
|
patchToCompactZone[patchi] = iter();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1164,11 +1164,11 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
label globalRegionI = surfaces.globalRegion(surfI, i);
|
label globalRegionI = surfaces.globalRegion(surfI, i);
|
||||||
|
|
||||||
label patchI;
|
label patchi;
|
||||||
|
|
||||||
if (surfacePatchInfo.set(globalRegionI))
|
if (surfacePatchInfo.set(globalRegionI))
|
||||||
{
|
{
|
||||||
patchI = meshRefiner.addMeshedPatch
|
patchi = meshRefiner.addMeshedPatch
|
||||||
(
|
(
|
||||||
regNames[i],
|
regNames[i],
|
||||||
surfacePatchInfo[globalRegionI]
|
surfacePatchInfo[globalRegionI]
|
||||||
@ -1179,7 +1179,7 @@ int main(int argc, char *argv[])
|
|||||||
dictionary patchInfo;
|
dictionary patchInfo;
|
||||||
patchInfo.set("type", wallPolyPatch::typeName);
|
patchInfo.set("type", wallPolyPatch::typeName);
|
||||||
|
|
||||||
patchI = meshRefiner.addMeshedPatch
|
patchi = meshRefiner.addMeshedPatch
|
||||||
(
|
(
|
||||||
regNames[i],
|
regNames[i],
|
||||||
patchInfo
|
patchInfo
|
||||||
@ -1187,12 +1187,12 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
Info<< setf(ios_base::left)
|
Info<< setf(ios_base::left)
|
||||||
<< setw(6) << patchI
|
<< setw(6) << patchi
|
||||||
<< setw(20) << mesh.boundaryMesh()[patchI].type()
|
<< setw(20) << mesh.boundaryMesh()[patchi].type()
|
||||||
<< setw(30) << regNames[i] << nl;
|
<< setw(30) << regNames[i] << nl;
|
||||||
|
|
||||||
globalToMasterPatch[globalRegionI] = patchI;
|
globalToMasterPatch[globalRegionI] = patchi;
|
||||||
globalToSlavePatch[globalRegionI] = patchI;
|
globalToSlavePatch[globalRegionI] = patchi;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1204,11 +1204,11 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
// Add master side patch
|
// Add master side patch
|
||||||
{
|
{
|
||||||
label patchI;
|
label patchi;
|
||||||
|
|
||||||
if (surfacePatchInfo.set(globalRegionI))
|
if (surfacePatchInfo.set(globalRegionI))
|
||||||
{
|
{
|
||||||
patchI = meshRefiner.addMeshedPatch
|
patchi = meshRefiner.addMeshedPatch
|
||||||
(
|
(
|
||||||
regNames[i],
|
regNames[i],
|
||||||
surfacePatchInfo[globalRegionI]
|
surfacePatchInfo[globalRegionI]
|
||||||
@ -1219,7 +1219,7 @@ int main(int argc, char *argv[])
|
|||||||
dictionary patchInfo;
|
dictionary patchInfo;
|
||||||
patchInfo.set("type", wallPolyPatch::typeName);
|
patchInfo.set("type", wallPolyPatch::typeName);
|
||||||
|
|
||||||
patchI = meshRefiner.addMeshedPatch
|
patchi = meshRefiner.addMeshedPatch
|
||||||
(
|
(
|
||||||
regNames[i],
|
regNames[i],
|
||||||
patchInfo
|
patchInfo
|
||||||
@ -1227,20 +1227,20 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
Info<< setf(ios_base::left)
|
Info<< setf(ios_base::left)
|
||||||
<< setw(6) << patchI
|
<< setw(6) << patchi
|
||||||
<< setw(20) << mesh.boundaryMesh()[patchI].type()
|
<< setw(20) << mesh.boundaryMesh()[patchi].type()
|
||||||
<< setw(30) << regNames[i] << nl;
|
<< setw(30) << regNames[i] << nl;
|
||||||
|
|
||||||
globalToMasterPatch[globalRegionI] = patchI;
|
globalToMasterPatch[globalRegionI] = patchi;
|
||||||
}
|
}
|
||||||
// Add slave side patch
|
// Add slave side patch
|
||||||
{
|
{
|
||||||
const word slaveName = regNames[i] + "_slave";
|
const word slaveName = regNames[i] + "_slave";
|
||||||
label patchI;
|
label patchi;
|
||||||
|
|
||||||
if (surfacePatchInfo.set(globalRegionI))
|
if (surfacePatchInfo.set(globalRegionI))
|
||||||
{
|
{
|
||||||
patchI = meshRefiner.addMeshedPatch
|
patchi = meshRefiner.addMeshedPatch
|
||||||
(
|
(
|
||||||
slaveName,
|
slaveName,
|
||||||
surfacePatchInfo[globalRegionI]
|
surfacePatchInfo[globalRegionI]
|
||||||
@ -1251,7 +1251,7 @@ int main(int argc, char *argv[])
|
|||||||
dictionary patchInfo;
|
dictionary patchInfo;
|
||||||
patchInfo.set("type", wallPolyPatch::typeName);
|
patchInfo.set("type", wallPolyPatch::typeName);
|
||||||
|
|
||||||
patchI = meshRefiner.addMeshedPatch
|
patchi = meshRefiner.addMeshedPatch
|
||||||
(
|
(
|
||||||
slaveName,
|
slaveName,
|
||||||
patchInfo
|
patchInfo
|
||||||
@ -1259,11 +1259,11 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
Info<< setf(ios_base::left)
|
Info<< setf(ios_base::left)
|
||||||
<< setw(6) << patchI
|
<< setw(6) << patchi
|
||||||
<< setw(20) << mesh.boundaryMesh()[patchI].type()
|
<< setw(20) << mesh.boundaryMesh()[patchi].type()
|
||||||
<< setw(30) << slaveName << nl;
|
<< setw(30) << slaveName << nl;
|
||||||
|
|
||||||
globalToSlavePatch[globalRegionI] = patchI;
|
globalToSlavePatch[globalRegionI] = patchi;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1491,13 +1491,13 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
forAll(bMesh, patchI)
|
forAll(bMesh, patchi)
|
||||||
{
|
{
|
||||||
const polyPatch& patch = bMesh[patchI];
|
const polyPatch& patch = bMesh[patchi];
|
||||||
|
|
||||||
if (!isA<processorPolyPatch>(patch))
|
if (!isA<processorPolyPatch>(patch))
|
||||||
{
|
{
|
||||||
includePatches.insert(patchI);
|
includePatches.insert(patchi);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -183,9 +183,9 @@ int main(int argc, char *argv[])
|
|||||||
newPatchI = 0;
|
newPatchI = 0;
|
||||||
|
|
||||||
// Copy old patches
|
// Copy old patches
|
||||||
forAll(mesh.boundaryMesh(), patchI)
|
forAll(mesh.boundaryMesh(), patchi)
|
||||||
{
|
{
|
||||||
const polyPatch& patch = mesh.boundaryMesh()[patchI];
|
const polyPatch& patch = mesh.boundaryMesh()[patchi];
|
||||||
|
|
||||||
newPatchPtrList[newPatchI] =
|
newPatchPtrList[newPatchI] =
|
||||||
patch.clone
|
patch.clone
|
||||||
@ -200,9 +200,9 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add new ones with empty size.
|
// Add new ones with empty size.
|
||||||
for (label patchI = newPatchI; patchI < patches.size(); patchI++)
|
for (label patchi = newPatchI; patchi < patches.size(); patchi++)
|
||||||
{
|
{
|
||||||
const boundaryPatch& bp = patches[patchI];
|
const boundaryPatch& bp = patches[patchi];
|
||||||
|
|
||||||
newPatchPtrList[newPatchI] = polyPatch::New
|
newPatchPtrList[newPatchI] = polyPatch::New
|
||||||
(
|
(
|
||||||
|
|||||||
@ -21,17 +21,17 @@ Foam::label Foam::findOppositeWedge
|
|||||||
|
|
||||||
scalar wppCosAngle = wpp.cosAngle();
|
scalar wppCosAngle = wpp.cosAngle();
|
||||||
|
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
patchI != wpp.index()
|
patchi != wpp.index()
|
||||||
&& patches[patchI].size()
|
&& patches[patchi].size()
|
||||||
&& isA<wedgePolyPatch>(patches[patchI])
|
&& isA<wedgePolyPatch>(patches[patchi])
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const wedgePolyPatch& pp =
|
const wedgePolyPatch& pp =
|
||||||
refCast<const wedgePolyPatch>(patches[patchI]);
|
refCast<const wedgePolyPatch>(patches[patchi]);
|
||||||
|
|
||||||
// Calculate (cos of) angle to wpp (not pp!) centre normal
|
// Calculate (cos of) angle to wpp (not pp!) centre normal
|
||||||
scalar ppCosAngle = wpp.centreNormal() & pp.n();
|
scalar ppCosAngle = wpp.centreNormal() & pp.n();
|
||||||
@ -43,7 +43,7 @@ Foam::label Foam::findOppositeWedge
|
|||||||
&& mag(ppCosAngle - wppCosAngle) >= 1e-3
|
&& mag(ppCosAngle - wppCosAngle) >= 1e-3
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return patchI;
|
return patchi;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -67,12 +67,12 @@ bool Foam::checkWedges
|
|||||||
|
|
||||||
|
|
||||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
if (patches[patchI].size() && isA<wedgePolyPatch>(patches[patchI]))
|
if (patches[patchi].size() && isA<wedgePolyPatch>(patches[patchi]))
|
||||||
{
|
{
|
||||||
const wedgePolyPatch& pp =
|
const wedgePolyPatch& pp =
|
||||||
refCast<const wedgePolyPatch>(patches[patchI]);
|
refCast<const wedgePolyPatch>(patches[patchi]);
|
||||||
|
|
||||||
scalar wedgeAngle = acos(pp.cosAngle());
|
scalar wedgeAngle = acos(pp.cosAngle());
|
||||||
|
|
||||||
@ -340,13 +340,13 @@ bool Foam::checkCoupledPoints
|
|||||||
List<pointField> nbrPoints(fcs.size() - mesh.nInternalFaces());
|
List<pointField> nbrPoints(fcs.size() - mesh.nInternalFaces());
|
||||||
|
|
||||||
// Exchange zero point
|
// Exchange zero point
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
if (patches[patchI].coupled())
|
if (patches[patchi].coupled())
|
||||||
{
|
{
|
||||||
const coupledPolyPatch& cpp = refCast<const coupledPolyPatch>
|
const coupledPolyPatch& cpp = refCast<const coupledPolyPatch>
|
||||||
(
|
(
|
||||||
patches[patchI]
|
patches[patchi]
|
||||||
);
|
);
|
||||||
|
|
||||||
forAll(cpp, i)
|
forAll(cpp, i)
|
||||||
@ -375,12 +375,12 @@ bool Foam::checkCoupledPoints
|
|||||||
scalar avgMismatch = 0;
|
scalar avgMismatch = 0;
|
||||||
label nCoupledPoints = 0;
|
label nCoupledPoints = 0;
|
||||||
|
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
if (patches[patchI].coupled())
|
if (patches[patchi].coupled())
|
||||||
{
|
{
|
||||||
const coupledPolyPatch& cpp =
|
const coupledPolyPatch& cpp =
|
||||||
refCast<const coupledPolyPatch>(patches[patchI]);
|
refCast<const coupledPolyPatch>(patches[patchi]);
|
||||||
|
|
||||||
if (cpp.owner())
|
if (cpp.owner())
|
||||||
{
|
{
|
||||||
|
|||||||
@ -53,11 +53,11 @@ Foam::label Foam::checkTopology
|
|||||||
// Check that empty patches cover all sides of the mesh
|
// Check that empty patches cover all sides of the mesh
|
||||||
{
|
{
|
||||||
label nEmpty = 0;
|
label nEmpty = 0;
|
||||||
forAll(mesh.boundaryMesh(), patchI)
|
forAll(mesh.boundaryMesh(), patchi)
|
||||||
{
|
{
|
||||||
if (isA<emptyPolyPatch>(mesh.boundaryMesh()[patchI]))
|
if (isA<emptyPolyPatch>(mesh.boundaryMesh()[patchi]))
|
||||||
{
|
{
|
||||||
nEmpty += mesh.boundaryMesh()[patchI].size();
|
nEmpty += mesh.boundaryMesh()[patchi].size();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
reduce(nEmpty, sumOp<label>());
|
reduce(nEmpty, sumOp<label>());
|
||||||
@ -229,11 +229,11 @@ Foam::label Foam::checkTopology
|
|||||||
nInternalFaces[mesh.faceNeighbour()[faceI]]++;
|
nInternalFaces[mesh.faceNeighbour()[faceI]]++;
|
||||||
}
|
}
|
||||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
if (patches[patchI].coupled())
|
if (patches[patchi].coupled())
|
||||||
{
|
{
|
||||||
const labelUList& owners = patches[patchI].faceCells();
|
const labelUList& owners = patches[patchi].faceCells();
|
||||||
|
|
||||||
forAll(owners, i)
|
forAll(owners, i)
|
||||||
{
|
{
|
||||||
@ -387,9 +387,9 @@ Foam::label Foam::checkTopology
|
|||||||
}
|
}
|
||||||
Info<< endl;
|
Info<< endl;
|
||||||
|
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = patches[patchI];
|
const polyPatch& pp = patches[patchi];
|
||||||
|
|
||||||
if (!isA<processorPolyPatch>(pp))
|
if (!isA<processorPolyPatch>(pp))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -290,9 +290,9 @@ void createFaces
|
|||||||
// For warning once per patch.
|
// For warning once per patch.
|
||||||
labelHashSet patchWarned;
|
labelHashSet patchWarned;
|
||||||
|
|
||||||
forAll(pbm, patchI)
|
forAll(pbm, patchi)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = pbm[patchI];
|
const polyPatch& pp = pbm[patchi];
|
||||||
|
|
||||||
label newPatchI = newMasterPatches[i];
|
label newPatchI = newMasterPatches[i];
|
||||||
|
|
||||||
@ -311,7 +311,7 @@ void createFaces
|
|||||||
|
|
||||||
if (zoneFaceI != -1)
|
if (zoneFaceI != -1)
|
||||||
{
|
{
|
||||||
if (patchWarned.insert(patchI))
|
if (patchWarned.insert(patchi))
|
||||||
{
|
{
|
||||||
WarningInFunction
|
WarningInFunction
|
||||||
<< "Found boundary face (in patch "
|
<< "Found boundary face (in patch "
|
||||||
@ -699,14 +699,14 @@ int main(int argc, char *argv[])
|
|||||||
forAllConstIter(dictionary, patchSources, iter)
|
forAllConstIter(dictionary, patchSources, iter)
|
||||||
{
|
{
|
||||||
const word patchName(iter().dict()["name"]);
|
const word patchName(iter().dict()["name"]);
|
||||||
label patchI = pbm.findPatchID(patchName);
|
label patchi = pbm.findPatchID(patchName);
|
||||||
if (master)
|
if (master)
|
||||||
{
|
{
|
||||||
newMasterPatches.append(patchI);
|
newMasterPatches.append(patchi);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
newSlavePatches.append(patchI);
|
newSlavePatches.append(patchi);
|
||||||
}
|
}
|
||||||
master = !master;
|
master = !master;
|
||||||
}
|
}
|
||||||
@ -761,9 +761,9 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
forAllConstIter(HashSet<word>, bafflePatches, iter)
|
forAllConstIter(HashSet<word>, bafflePatches, iter)
|
||||||
{
|
{
|
||||||
label patchI = mesh.boundaryMesh().findPatchID(iter.key());
|
label patchi = mesh.boundaryMesh().findPatchID(iter.key());
|
||||||
|
|
||||||
const fvPatchMapper& pm = mapper.boundaryMap()[patchI];
|
const fvPatchMapper& pm = mapper.boundaryMap()[patchi];
|
||||||
|
|
||||||
if (pm.sizeBeforeMapping() == 0)
|
if (pm.sizeBeforeMapping() == 0)
|
||||||
{
|
{
|
||||||
@ -775,7 +775,7 @@ int main(int argc, char *argv[])
|
|||||||
<< "You might have to edit these fields." << endl;
|
<< "You might have to edit these fields." << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
fvMeshTools::zeroPatchFields(mesh, patchI);
|
fvMeshTools::zeroPatchFields(mesh, patchi);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -796,7 +796,7 @@ int main(int argc, char *argv[])
|
|||||||
forAllConstIter(dictionary, patchSources, iter)
|
forAllConstIter(dictionary, patchSources, iter)
|
||||||
{
|
{
|
||||||
const word patchName(iter().dict()["name"]);
|
const word patchName(iter().dict()["name"]);
|
||||||
label patchI = pbm.findPatchID(patchName);
|
label patchi = pbm.findPatchID(patchName);
|
||||||
|
|
||||||
if (iter().dict().found("patchFields"))
|
if (iter().dict().found("patchFields"))
|
||||||
{
|
{
|
||||||
@ -809,7 +809,7 @@ int main(int argc, char *argv[])
|
|||||||
fvMeshTools::setPatchFields
|
fvMeshTools::setPatchFields
|
||||||
(
|
(
|
||||||
mesh,
|
mesh,
|
||||||
patchI,
|
patchi,
|
||||||
patchFieldsDict
|
patchFieldsDict
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -863,20 +863,20 @@ int main(int argc, char *argv[])
|
|||||||
const word masterPatchName(groupName + "_master");
|
const word masterPatchName(groupName + "_master");
|
||||||
const word slavePatchName(groupName + "_slave");
|
const word slavePatchName(groupName + "_slave");
|
||||||
|
|
||||||
label patchIMaster = pbm.findPatchID(masterPatchName);
|
label patchiMaster = pbm.findPatchID(masterPatchName);
|
||||||
label patchISlave = pbm.findPatchID(slavePatchName);
|
label patchiSlave = pbm.findPatchID(slavePatchName);
|
||||||
|
|
||||||
fvMeshTools::setPatchFields
|
fvMeshTools::setPatchFields
|
||||||
(
|
(
|
||||||
mesh,
|
mesh,
|
||||||
patchIMaster,
|
patchiMaster,
|
||||||
patchFieldsDict
|
patchFieldsDict
|
||||||
);
|
);
|
||||||
|
|
||||||
fvMeshTools::setPatchFields
|
fvMeshTools::setPatchFields
|
||||||
(
|
(
|
||||||
mesh,
|
mesh,
|
||||||
patchISlave,
|
patchiSlave,
|
||||||
patchFieldsDict
|
patchFieldsDict
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -115,9 +115,9 @@ void Foam::faceSelections::searchableSurfaceSelection::select
|
|||||||
|
|
||||||
const polyBoundaryMesh& pbm = mesh_.boundaryMesh();
|
const polyBoundaryMesh& pbm = mesh_.boundaryMesh();
|
||||||
|
|
||||||
forAll(pbm, patchI)
|
forAll(pbm, patchi)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = pbm[patchI];
|
const polyPatch& pp = pbm[patchi];
|
||||||
|
|
||||||
if (pp.coupled())
|
if (pp.coupled())
|
||||||
{
|
{
|
||||||
@ -155,9 +155,9 @@ void Foam::faceSelections::searchableSurfaceSelection::select
|
|||||||
faceToFlip[faceI] = ((normals[faceI] & d) < 0);
|
faceToFlip[faceI] = ((normals[faceI] & d) < 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
forAll(pbm, patchI)
|
forAll(pbm, patchi)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = pbm[patchI];
|
const polyPatch& pp = pbm[patchi];
|
||||||
|
|
||||||
if (pp.coupled())
|
if (pp.coupled())
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -107,9 +107,9 @@ void filterPatches(polyMesh& mesh, const HashSet<word>& addedPatchNames)
|
|||||||
label nOldPatches = returnReduce(patches.size(), sumOp<label>());
|
label nOldPatches = returnReduce(patches.size(), sumOp<label>());
|
||||||
|
|
||||||
// Copy old patches.
|
// Copy old patches.
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = patches[patchI];
|
const polyPatch& pp = patches[patchi];
|
||||||
|
|
||||||
// Note: reduce possible since non-proc patches guaranteed in same order
|
// Note: reduce possible since non-proc patches guaranteed in same order
|
||||||
if (!isA<processorPolyPatch>(pp))
|
if (!isA<processorPolyPatch>(pp))
|
||||||
@ -143,14 +143,14 @@ void filterPatches(polyMesh& mesh, const HashSet<word>& addedPatchNames)
|
|||||||
{
|
{
|
||||||
Info<< "Removing zero-sized patch " << pp.name()
|
Info<< "Removing zero-sized patch " << pp.name()
|
||||||
<< " type " << pp.type()
|
<< " type " << pp.type()
|
||||||
<< " at position " << patchI << endl;
|
<< " at position " << patchi << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Copy non-empty processor patches
|
// Copy non-empty processor patches
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = patches[patchI];
|
const polyPatch& pp = patches[patchi];
|
||||||
|
|
||||||
if (isA<processorPolyPatch>(pp))
|
if (isA<processorPolyPatch>(pp))
|
||||||
{
|
{
|
||||||
@ -170,7 +170,7 @@ void filterPatches(polyMesh& mesh, const HashSet<word>& addedPatchNames)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
Info<< "Removing empty processor patch " << pp.name()
|
Info<< "Removing empty processor patch " << pp.name()
|
||||||
<< " at position " << patchI << endl;
|
<< " at position " << patchi << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -199,16 +199,16 @@ void dumpCyclicMatch(const fileName& prefix, const polyMesh& mesh)
|
|||||||
{
|
{
|
||||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||||
|
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
isA<cyclicPolyPatch>(patches[patchI])
|
isA<cyclicPolyPatch>(patches[patchi])
|
||||||
&& refCast<const cyclicPolyPatch>(patches[patchI]).owner()
|
&& refCast<const cyclicPolyPatch>(patches[patchi]).owner()
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const cyclicPolyPatch& cycPatch =
|
const cyclicPolyPatch& cycPatch =
|
||||||
refCast<const cyclicPolyPatch>(patches[patchI]);
|
refCast<const cyclicPolyPatch>(patches[patchi]);
|
||||||
|
|
||||||
// Dump patches
|
// Dump patches
|
||||||
{
|
{
|
||||||
@ -319,9 +319,9 @@ void syncPoints
|
|||||||
{
|
{
|
||||||
// Send
|
// Send
|
||||||
|
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = patches[patchI];
|
const polyPatch& pp = patches[patchi];
|
||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
@ -356,9 +356,9 @@ void syncPoints
|
|||||||
|
|
||||||
// Receive and set.
|
// Receive and set.
|
||||||
|
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = patches[patchI];
|
const polyPatch& pp = patches[patchi];
|
||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
@ -407,9 +407,9 @@ void syncPoints
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Do the cyclics.
|
// Do the cyclics.
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = patches[patchI];
|
const polyPatch& pp = patches[patchi];
|
||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
@ -558,9 +558,9 @@ int main(int argc, char *argv[])
|
|||||||
label startFaceI = mesh.nInternalFaces();
|
label startFaceI = mesh.nInternalFaces();
|
||||||
|
|
||||||
// Copy old patches.
|
// Copy old patches.
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = patches[patchI];
|
const polyPatch& pp = patches[patchi];
|
||||||
|
|
||||||
if (!isA<processorPolyPatch>(pp))
|
if (!isA<processorPolyPatch>(pp))
|
||||||
{
|
{
|
||||||
@ -569,7 +569,7 @@ int main(int argc, char *argv[])
|
|||||||
pp.clone
|
pp.clone
|
||||||
(
|
(
|
||||||
patches,
|
patches,
|
||||||
patchI,
|
patchi,
|
||||||
pp.size(),
|
pp.size(),
|
||||||
startFaceI
|
startFaceI
|
||||||
).ptr()
|
).ptr()
|
||||||
@ -619,9 +619,9 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Copy old patches.
|
// Copy old patches.
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = patches[patchI];
|
const polyPatch& pp = patches[patchi];
|
||||||
|
|
||||||
if (isA<processorPolyPatch>(pp))
|
if (isA<processorPolyPatch>(pp))
|
||||||
{
|
{
|
||||||
@ -630,7 +630,7 @@ int main(int argc, char *argv[])
|
|||||||
pp.clone
|
pp.clone
|
||||||
(
|
(
|
||||||
patches,
|
patches,
|
||||||
patchI,
|
patchi,
|
||||||
pp.size(),
|
pp.size(),
|
||||||
startFaceI
|
startFaceI
|
||||||
).ptr()
|
).ptr()
|
||||||
@ -771,9 +771,9 @@ int main(int argc, char *argv[])
|
|||||||
// For cyclic patches:
|
// For cyclic patches:
|
||||||
// - for separated ones use user specified offset vector
|
// - for separated ones use user specified offset vector
|
||||||
|
|
||||||
forAll(mesh.boundaryMesh(), patchI)
|
forAll(mesh.boundaryMesh(), patchi)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = mesh.boundaryMesh()[patchI];
|
const polyPatch& pp = mesh.boundaryMesh()[patchi];
|
||||||
|
|
||||||
if (pp.size() && isA<coupledPolyPatch>(pp))
|
if (pp.size() && isA<coupledPolyPatch>(pp))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -50,14 +50,14 @@ Foam::label Foam::mergePolyMesh::patchIndex(const polyPatch& p)
|
|||||||
|
|
||||||
bool nameFound = false;
|
bool nameFound = false;
|
||||||
|
|
||||||
forAll(patchNames_, patchI)
|
forAll(patchNames_, patchi)
|
||||||
{
|
{
|
||||||
if (patchNames_[patchI] == pName)
|
if (patchNames_[patchi] == pName)
|
||||||
{
|
{
|
||||||
if (word(patchDicts_[patchI]["type"]) == pType)
|
if (word(patchDicts_[patchi]["type"]) == pType)
|
||||||
{
|
{
|
||||||
// Found name and types match
|
// Found name and types match
|
||||||
return patchI;
|
return patchi;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -134,12 +134,12 @@ Foam::mergePolyMesh::mergePolyMesh(const IOobject& io)
|
|||||||
// Insert the original patches into the list
|
// Insert the original patches into the list
|
||||||
wordList curPatchNames = boundaryMesh().names();
|
wordList curPatchNames = boundaryMesh().names();
|
||||||
|
|
||||||
forAll(boundaryMesh(), patchI)
|
forAll(boundaryMesh(), patchi)
|
||||||
{
|
{
|
||||||
patchNames_.append(boundaryMesh()[patchI].name());
|
patchNames_.append(boundaryMesh()[patchi].name());
|
||||||
|
|
||||||
OStringStream os;
|
OStringStream os;
|
||||||
boundaryMesh()[patchI].write(os);
|
boundaryMesh()[patchi].write(os);
|
||||||
patchDicts_.append(dictionary(IStringStream(os.str())()));
|
patchDicts_.append(dictionary(IStringStream(os.str())()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -275,9 +275,9 @@ void Foam::mergePolyMesh::addMesh(const polyMesh& m)
|
|||||||
// Gather the patch indices
|
// Gather the patch indices
|
||||||
labelList patchIndices(bm.size());
|
labelList patchIndices(bm.size());
|
||||||
|
|
||||||
forAll(patchIndices, patchI)
|
forAll(patchIndices, patchi)
|
||||||
{
|
{
|
||||||
patchIndices[patchI] = patchIndex(bm[patchI]);
|
patchIndices[patchi] = patchIndex(bm[patchi]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Temporary: update number of allowable patches. This should be
|
// Temporary: update number of allowable patches. This should be
|
||||||
@ -400,32 +400,32 @@ void Foam::mergePolyMesh::merge()
|
|||||||
const polyBoundaryMesh& oldPatches = boundaryMesh();
|
const polyBoundaryMesh& oldPatches = boundaryMesh();
|
||||||
|
|
||||||
// Note. Re-using counter in two for loops
|
// Note. Re-using counter in two for loops
|
||||||
label patchI = 0;
|
label patchi = 0;
|
||||||
|
|
||||||
for (patchI = 0; patchI < oldPatches.size(); patchI++)
|
for (patchi = 0; patchi < oldPatches.size(); patchi++)
|
||||||
{
|
{
|
||||||
newPatches[patchI] = oldPatches[patchI].clone(oldPatches).ptr();
|
newPatches[patchi] = oldPatches[patchi].clone(oldPatches).ptr();
|
||||||
}
|
}
|
||||||
|
|
||||||
Info<< "Adding new patches. " << endl;
|
Info<< "Adding new patches. " << endl;
|
||||||
|
|
||||||
label endOfLastPatch =
|
label endOfLastPatch =
|
||||||
oldPatches[patchI - 1].start() + oldPatches[patchI - 1].size();
|
oldPatches[patchi - 1].start() + oldPatches[patchi - 1].size();
|
||||||
|
|
||||||
for (; patchI < patchNames_.size(); patchI++)
|
for (; patchi < patchNames_.size(); patchi++)
|
||||||
{
|
{
|
||||||
// Add a patch
|
// Add a patch
|
||||||
dictionary dict(patchDicts_[patchI]);
|
dictionary dict(patchDicts_[patchi]);
|
||||||
dict.set("nFaces", 0);
|
dict.set("nFaces", 0);
|
||||||
dict.set("startFace", endOfLastPatch);
|
dict.set("startFace", endOfLastPatch);
|
||||||
|
|
||||||
newPatches[patchI] =
|
newPatches[patchi] =
|
||||||
(
|
(
|
||||||
polyPatch::New
|
polyPatch::New
|
||||||
(
|
(
|
||||||
patchNames_[patchI],
|
patchNames_[patchi],
|
||||||
dict,
|
dict,
|
||||||
patchI,
|
patchi,
|
||||||
oldPatches
|
oldPatches
|
||||||
).ptr()
|
).ptr()
|
||||||
);
|
);
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -171,16 +171,16 @@ labelList findBaffles(const polyMesh& mesh, const labelList& boundaryFaces)
|
|||||||
if (duplicates[bFaceI] != -1)
|
if (duplicates[bFaceI] != -1)
|
||||||
{
|
{
|
||||||
label faceI = mesh.nInternalFaces() + bFaceI;
|
label faceI = mesh.nInternalFaces() + bFaceI;
|
||||||
label patchI = patches.whichPatch(faceI);
|
label patchi = patches.whichPatch(faceI);
|
||||||
|
|
||||||
if (isA<processorPolyPatch>(patches[patchI]))
|
if (isA<processorPolyPatch>(patches[patchi]))
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Duplicate face " << faceI
|
<< "Duplicate face " << faceI
|
||||||
<< " is on a processorPolyPatch."
|
<< " is on a processorPolyPatch."
|
||||||
<< "This is not allowed." << nl
|
<< "This is not allowed." << nl
|
||||||
<< "Face:" << faceI
|
<< "Face:" << faceI
|
||||||
<< " is on patch:" << patches[patchI].name()
|
<< " is on patch:" << patches[patchi].name()
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -149,9 +149,9 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
|
|||||||
// as internal
|
// as internal
|
||||||
boolListList insertedBouFace(oldPatches.size());
|
boolListList insertedBouFace(oldPatches.size());
|
||||||
|
|
||||||
forAll(oldPatches, patchI)
|
forAll(oldPatches, patchi)
|
||||||
{
|
{
|
||||||
const polyPatch& curPatch = oldPatches[patchI];
|
const polyPatch& curPatch = oldPatches[patchi];
|
||||||
|
|
||||||
if (curPatch.coupled())
|
if (curPatch.coupled())
|
||||||
{
|
{
|
||||||
@ -162,7 +162,7 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
|
|||||||
<< " createPatch afterwards." << endl;
|
<< " createPatch afterwards." << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolList& curInsBouFace = insertedBouFace[patchI];
|
boolList& curInsBouFace = insertedBouFace[patchi];
|
||||||
|
|
||||||
curInsBouFace.setSize(curPatch.size());
|
curInsBouFace.setSize(curPatch.size());
|
||||||
curInsBouFace = false;
|
curInsBouFace = false;
|
||||||
@ -249,11 +249,11 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
|
|||||||
labelList newPatchStarts(boundary().size(), -1);
|
labelList newPatchStarts(boundary().size(), -1);
|
||||||
label nNewPatches = 0;
|
label nNewPatches = 0;
|
||||||
|
|
||||||
forAll(boundaryMesh(), patchI)
|
forAll(boundaryMesh(), patchi)
|
||||||
{
|
{
|
||||||
const label curPatchSize = boundaryMesh()[patchI].size();
|
const label curPatchSize = boundaryMesh()[patchi].size();
|
||||||
const label curPatchStart = boundaryMesh()[patchI].start();
|
const label curPatchStart = boundaryMesh()[patchi].start();
|
||||||
const boolList& curInserted = insertedBouFace[patchI];
|
const boolList& curInserted = insertedBouFace[patchi];
|
||||||
|
|
||||||
newPatchStarts[nNewPatches] = nNewFaces;
|
newPatchStarts[nNewPatches] = nNewFaces;
|
||||||
|
|
||||||
@ -303,7 +303,7 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
|
|||||||
// If patch exists, grab the name and type of the original patch
|
// If patch exists, grab the name and type of the original patch
|
||||||
if (nNewFaces > newPatchStarts[nNewPatches])
|
if (nNewFaces > newPatchStarts[nNewPatches])
|
||||||
{
|
{
|
||||||
newToOldPatch[nNewPatches] = patchI;
|
newToOldPatch[nNewPatches] = patchi;
|
||||||
|
|
||||||
newPatchSizes[nNewPatches] =
|
newPatchSizes[nNewPatches] =
|
||||||
nNewFaces - newPatchStarts[nNewPatches];
|
nNewFaces - newPatchStarts[nNewPatches];
|
||||||
@ -378,14 +378,14 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
|
|||||||
// Add the boundary patches
|
// Add the boundary patches
|
||||||
List<polyPatch*> p(newPatchSizes.size());
|
List<polyPatch*> p(newPatchSizes.size());
|
||||||
|
|
||||||
forAll(p, patchI)
|
forAll(p, patchi)
|
||||||
{
|
{
|
||||||
p[patchI] = boundaryMesh()[newToOldPatch[patchI]].clone
|
p[patchi] = boundaryMesh()[newToOldPatch[patchi]].clone
|
||||||
(
|
(
|
||||||
pMesh.boundaryMesh(),
|
pMesh.boundaryMesh(),
|
||||||
patchI,
|
patchi,
|
||||||
newPatchSizes[patchI],
|
newPatchSizes[patchi],
|
||||||
newPatchStarts[patchI]
|
newPatchStarts[patchi]
|
||||||
).ptr();
|
).ptr();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -71,12 +71,12 @@ void writeWeights(const polyMesh& mesh)
|
|||||||
|
|
||||||
const word tmName(mesh.time().timeName());
|
const word tmName(mesh.time().timeName());
|
||||||
|
|
||||||
forAll(pbm, patchI)
|
forAll(pbm, patchi)
|
||||||
{
|
{
|
||||||
if (isA<cyclicAMIPolyPatch>(pbm[patchI]))
|
if (isA<cyclicAMIPolyPatch>(pbm[patchi]))
|
||||||
{
|
{
|
||||||
const cyclicAMIPolyPatch& cpp =
|
const cyclicAMIPolyPatch& cpp =
|
||||||
refCast<const cyclicAMIPolyPatch>(pbm[patchI]);
|
refCast<const cyclicAMIPolyPatch>(pbm[patchi]);
|
||||||
|
|
||||||
if (cpp.owner())
|
if (cpp.owner())
|
||||||
{
|
{
|
||||||
|
|||||||
@ -102,12 +102,12 @@ int main(int argc, char *argv[])
|
|||||||
forAll(faceLabels, faceI)
|
forAll(faceLabels, faceI)
|
||||||
{
|
{
|
||||||
const label meshFaceI = faceLabels[faceI];
|
const label meshFaceI = faceLabels[faceI];
|
||||||
const label patchI = bm.whichPatch(meshFaceI);
|
const label patchi = bm.whichPatch(meshFaceI);
|
||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
patchI != -1
|
patchi != -1
|
||||||
&& bm[patchI].coupled()
|
&& bm[patchi].coupled()
|
||||||
&& !isMasterFace[meshFaceI]
|
&& !isMasterFace[meshFaceI]
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -312,12 +312,12 @@ int main(int argc, char *argv[])
|
|||||||
forAll(faceLabels, i)
|
forAll(faceLabels, i)
|
||||||
{
|
{
|
||||||
const label meshFaceI = faceLabels[i];
|
const label meshFaceI = faceLabels[i];
|
||||||
const label patchI = bm.whichPatch(meshFaceI);
|
const label patchi = bm.whichPatch(meshFaceI);
|
||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
patchI != -1
|
patchi != -1
|
||||||
&& bm[patchI].coupled()
|
&& bm[patchi].coupled()
|
||||||
&& !isMasterFace[meshFaceI]
|
&& !isMasterFace[meshFaceI]
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -319,7 +319,7 @@ Foam::label Foam::meshDualiser::addBoundaryFace
|
|||||||
const label masterFaceI,
|
const label masterFaceI,
|
||||||
|
|
||||||
const label dualCellI,
|
const label dualCellI,
|
||||||
const label patchI,
|
const label patchi,
|
||||||
const DynamicList<label>& verts,
|
const DynamicList<label>& verts,
|
||||||
polyTopoChange& meshMod
|
polyTopoChange& meshMod
|
||||||
) const
|
) const
|
||||||
@ -349,7 +349,7 @@ Foam::label Foam::meshDualiser::addBoundaryFace
|
|||||||
masterEdgeI, // masterEdgeID
|
masterEdgeI, // masterEdgeID
|
||||||
masterFaceI, // masterFaceID
|
masterFaceI, // masterFaceID
|
||||||
false, // flipFaceFlux
|
false, // flipFaceFlux
|
||||||
patchI, // patchID
|
patchi, // patchID
|
||||||
zoneID, // zoneID
|
zoneID, // zoneID
|
||||||
zoneFlip // zoneFlip
|
zoneFlip // zoneFlip
|
||||||
);
|
);
|
||||||
@ -640,7 +640,7 @@ void Foam::meshDualiser::createFaceFromInternalFace
|
|||||||
// (pointFaces()). Gets starting face and marks off visited faces in donePFaces.
|
// (pointFaces()). Gets starting face and marks off visited faces in donePFaces.
|
||||||
void Foam::meshDualiser::createFacesAroundBoundaryPoint
|
void Foam::meshDualiser::createFacesAroundBoundaryPoint
|
||||||
(
|
(
|
||||||
const label patchI,
|
const label patchi,
|
||||||
const label patchPointI,
|
const label patchPointI,
|
||||||
const label startFaceI,
|
const label startFaceI,
|
||||||
polyTopoChange& meshMod,
|
polyTopoChange& meshMod,
|
||||||
@ -648,7 +648,7 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
|
|||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
|
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
|
||||||
const polyPatch& pp = patches[patchI];
|
const polyPatch& pp = patches[patchi];
|
||||||
const labelList& pFaces = pp.pointFaces()[patchPointI];
|
const labelList& pFaces = pp.pointFaces()[patchPointI];
|
||||||
const labelList& own = mesh_.faceOwner();
|
const labelList& own = mesh_.faceOwner();
|
||||||
|
|
||||||
@ -713,7 +713,7 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
|
|||||||
if (faceI < pp.start() || faceI >= pp.start()+pp.size())
|
if (faceI < pp.start() || faceI >= pp.start()+pp.size())
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Walked from face on patch:" << patchI
|
<< "Walked from face on patch:" << patchi
|
||||||
<< " to face:" << faceI
|
<< " to face:" << faceI
|
||||||
<< " fc:" << mesh_.faceCentres()[faceI]
|
<< " fc:" << mesh_.faceCentres()[faceI]
|
||||||
<< " on patch:" << patches.whichPatch(faceI)
|
<< " on patch:" << patches.whichPatch(faceI)
|
||||||
@ -746,7 +746,7 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
|
|||||||
-1, // masterEdgeI
|
-1, // masterEdgeI
|
||||||
faceI, // masterFaceI
|
faceI, // masterFaceI
|
||||||
dualCellI,
|
dualCellI,
|
||||||
patchI,
|
patchi,
|
||||||
verts,
|
verts,
|
||||||
meshMod
|
meshMod
|
||||||
);
|
);
|
||||||
@ -800,7 +800,7 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
|
|||||||
-1, // masterEdgeI
|
-1, // masterEdgeI
|
||||||
faceI, // masterFaceI
|
faceI, // masterFaceI
|
||||||
findDualCell(own[faceI], pointI),
|
findDualCell(own[faceI], pointI),
|
||||||
patchI,
|
patchi,
|
||||||
verts.shrink(),
|
verts.shrink(),
|
||||||
meshMod
|
meshMod
|
||||||
);
|
);
|
||||||
@ -845,7 +845,7 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
|
|||||||
-1, // masterEdgeI
|
-1, // masterEdgeI
|
||||||
startFaceI, // masterFaceI
|
startFaceI, // masterFaceI
|
||||||
findDualCell(own[faceI], pointI),
|
findDualCell(own[faceI], pointI),
|
||||||
patchI,
|
patchi,
|
||||||
verts.shrink(),
|
verts.shrink(),
|
||||||
meshMod
|
meshMod
|
||||||
);
|
);
|
||||||
@ -1390,9 +1390,9 @@ void Foam::meshDualiser::setRefinement
|
|||||||
// These need to be closed.
|
// These need to be closed.
|
||||||
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
|
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
|
||||||
|
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = patches[patchI];
|
const polyPatch& pp = patches[patchi];
|
||||||
|
|
||||||
const labelListList& pointFaces = pp.pointFaces();
|
const labelListList& pointFaces = pp.pointFaces();
|
||||||
|
|
||||||
@ -1411,14 +1411,14 @@ void Foam::meshDualiser::setRefinement
|
|||||||
|
|
||||||
//Pout<< "Walking around point:" << pointI
|
//Pout<< "Walking around point:" << pointI
|
||||||
// << " coord:" << mesh_.points()[pointI]
|
// << " coord:" << mesh_.points()[pointI]
|
||||||
// << " on patch:" << patchI
|
// << " on patch:" << patchi
|
||||||
// << " startFace:" << startFaceI
|
// << " startFace:" << startFaceI
|
||||||
// << " at:" << mesh_.faceCentres()[startFaceI]
|
// << " at:" << mesh_.faceCentres()[startFaceI]
|
||||||
// << endl;
|
// << endl;
|
||||||
|
|
||||||
createFacesAroundBoundaryPoint
|
createFacesAroundBoundaryPoint
|
||||||
(
|
(
|
||||||
patchI,
|
patchi,
|
||||||
patchPointI,
|
patchPointI,
|
||||||
startFaceI,
|
startFaceI,
|
||||||
meshMod,
|
meshMod,
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -105,9 +105,9 @@ void simpleMarkFeatures
|
|||||||
// 1. Mark all edges between patches
|
// 1. Mark all edges between patches
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = patches[patchI];
|
const polyPatch& pp = patches[patchi];
|
||||||
const labelList& meshEdges = pp.meshEdges();
|
const labelList& meshEdges = pp.meshEdges();
|
||||||
|
|
||||||
// All patch corner edges. These need to be feature points & edges!
|
// All patch corner edges. These need to be feature points & edges!
|
||||||
|
|||||||
@ -446,12 +446,12 @@ autoPtr<mapPolyMesh> reorderMesh
|
|||||||
labelList oldPatchNMeshPoints(patches.size());
|
labelList oldPatchNMeshPoints(patches.size());
|
||||||
labelListList patchPointMap(patches.size());
|
labelListList patchPointMap(patches.size());
|
||||||
|
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
patchSizes[patchI] = patches[patchI].size();
|
patchSizes[patchi] = patches[patchi].size();
|
||||||
patchStarts[patchI] = patches[patchI].start();
|
patchStarts[patchi] = patches[patchi].start();
|
||||||
oldPatchNMeshPoints[patchI] = patches[patchI].nPoints();
|
oldPatchNMeshPoints[patchi] = patches[patchi].nPoints();
|
||||||
patchPointMap[patchI] = identity(patches[patchI].nPoints());
|
patchPointMap[patchi] = identity(patches[patchi].nPoints());
|
||||||
}
|
}
|
||||||
|
|
||||||
mesh.resetPrimitives
|
mesh.resetPrimitives
|
||||||
@ -955,11 +955,11 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
// Collect all boundary cells on coupled patches
|
// Collect all boundary cells on coupled patches
|
||||||
label nBndCells = 0;
|
label nBndCells = 0;
|
||||||
forAll(pbm, patchI)
|
forAll(pbm, patchi)
|
||||||
{
|
{
|
||||||
if (pbm[patchI].coupled())
|
if (pbm[patchi].coupled())
|
||||||
{
|
{
|
||||||
nBndCells += pbm[patchI].size();
|
nBndCells += pbm[patchi].size();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -968,11 +968,11 @@ int main(int argc, char *argv[])
|
|||||||
labelList bndCells(nBndCells);
|
labelList bndCells(nBndCells);
|
||||||
labelList bndCellMap(nBndCells);
|
labelList bndCellMap(nBndCells);
|
||||||
nBndCells = 0;
|
nBndCells = 0;
|
||||||
forAll(pbm, patchI)
|
forAll(pbm, patchi)
|
||||||
{
|
{
|
||||||
if (pbm[patchI].coupled())
|
if (pbm[patchi].coupled())
|
||||||
{
|
{
|
||||||
const labelUList& faceCells = pbm[patchI].faceCells();
|
const labelUList& faceCells = pbm[patchi].faceCells();
|
||||||
forAll(faceCells, i)
|
forAll(faceCells, i)
|
||||||
{
|
{
|
||||||
label cellI = faceCells[i];
|
label cellI = faceCells[i];
|
||||||
|
|||||||
@ -86,9 +86,9 @@ label findEdge(const primitiveMesh& mesh, const label v0, const label v1)
|
|||||||
// Checks whether patch present
|
// Checks whether patch present
|
||||||
void checkPatch(const polyBoundaryMesh& bMesh, const word& name)
|
void checkPatch(const polyBoundaryMesh& bMesh, const word& name)
|
||||||
{
|
{
|
||||||
const label patchI = bMesh.findPatchID(name);
|
const label patchi = bMesh.findPatchID(name);
|
||||||
|
|
||||||
if (patchI == -1)
|
if (patchi == -1)
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Cannot find patch " << name << nl
|
<< "Cannot find patch " << name << nl
|
||||||
@ -97,7 +97,7 @@ void checkPatch(const polyBoundaryMesh& bMesh, const word& name)
|
|||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bMesh[patchI].size())
|
if (bMesh[patchi].size())
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Patch " << name << " is present but non-zero size"
|
<< "Patch " << name << " is present but non-zero size"
|
||||||
|
|||||||
@ -121,8 +121,8 @@ void renamePatches
|
|||||||
const_cast<polyBoundaryMesh&>(mesh.boundaryMesh());
|
const_cast<polyBoundaryMesh&>(mesh.boundaryMesh());
|
||||||
forAll(patchesToRename, i)
|
forAll(patchesToRename, i)
|
||||||
{
|
{
|
||||||
label patchI = patchesToRename[i];
|
label patchi = patchesToRename[i];
|
||||||
polyPatch& pp = polyPatches[patchI];
|
polyPatch& pp = polyPatches[patchi];
|
||||||
|
|
||||||
if (isA<coupledPolyPatch>(pp))
|
if (isA<coupledPolyPatch>(pp))
|
||||||
{
|
{
|
||||||
@ -177,11 +177,11 @@ void subsetVolFields
|
|||||||
|
|
||||||
// Hack: set value to 0 for introduced patches (since don't
|
// Hack: set value to 0 for introduced patches (since don't
|
||||||
// get initialised.
|
// get initialised.
|
||||||
forAll(tSubFld().boundaryField(), patchI)
|
forAll(tSubFld().boundaryField(), patchi)
|
||||||
{
|
{
|
||||||
if (addedPatches.found(patchI))
|
if (addedPatches.found(patchi))
|
||||||
{
|
{
|
||||||
tSubFld.ref().boundaryField()[patchI] ==
|
tSubFld.ref().boundaryFieldRef()[patchi] ==
|
||||||
typename GeoField::value_type(Zero);
|
typename GeoField::value_type(Zero);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -229,11 +229,11 @@ void subsetSurfaceFields
|
|||||||
|
|
||||||
// Hack: set value to 0 for introduced patches (since don't
|
// Hack: set value to 0 for introduced patches (since don't
|
||||||
// get initialised.
|
// get initialised.
|
||||||
forAll(tSubFld().boundaryField(), patchI)
|
forAll(tSubFld().boundaryField(), patchi)
|
||||||
{
|
{
|
||||||
if (addedPatches.found(patchI))
|
if (addedPatches.found(patchi))
|
||||||
{
|
{
|
||||||
tSubFld.ref().boundaryField()[patchI] ==
|
tSubFld.ref().boundaryFieldRef()[patchi] ==
|
||||||
typename GeoField::value_type(Zero);
|
typename GeoField::value_type(Zero);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -875,16 +875,16 @@ void createAndWriteRegion
|
|||||||
Info<< "Deleting empty patches" << endl;
|
Info<< "Deleting empty patches" << endl;
|
||||||
|
|
||||||
// Assumes all non-proc boundaries are on all processors!
|
// Assumes all non-proc boundaries are on all processors!
|
||||||
forAll(newPatches, patchI)
|
forAll(newPatches, patchi)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = newPatches[patchI];
|
const polyPatch& pp = newPatches[patchi];
|
||||||
|
|
||||||
if (!isA<processorPolyPatch>(pp))
|
if (!isA<processorPolyPatch>(pp))
|
||||||
{
|
{
|
||||||
if (returnReduce(pp.size(), sumOp<label>()) > 0)
|
if (returnReduce(pp.size(), sumOp<label>()) > 0)
|
||||||
{
|
{
|
||||||
oldToNew[patchI] = newI;
|
oldToNew[patchi] = newI;
|
||||||
if (!addedPatches.found(patchI))
|
if (!addedPatches.found(patchi))
|
||||||
{
|
{
|
||||||
sharedPatches.append(newI);
|
sharedPatches.append(newI);
|
||||||
}
|
}
|
||||||
@ -894,24 +894,24 @@ void createAndWriteRegion
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Same for processor patches (but need no reduction)
|
// Same for processor patches (but need no reduction)
|
||||||
forAll(newPatches, patchI)
|
forAll(newPatches, patchi)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = newPatches[patchI];
|
const polyPatch& pp = newPatches[patchi];
|
||||||
|
|
||||||
if (isA<processorPolyPatch>(pp) && pp.size())
|
if (isA<processorPolyPatch>(pp) && pp.size())
|
||||||
{
|
{
|
||||||
oldToNew[patchI] = newI++;
|
oldToNew[patchi] = newI++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const label nNewPatches = newI;
|
const label nNewPatches = newI;
|
||||||
|
|
||||||
// Move all deleteable patches to the end
|
// Move all deleteable patches to the end
|
||||||
forAll(oldToNew, patchI)
|
forAll(oldToNew, patchi)
|
||||||
{
|
{
|
||||||
if (oldToNew[patchI] == -1)
|
if (oldToNew[patchi] == -1)
|
||||||
{
|
{
|
||||||
oldToNew[patchI] = newI++;
|
oldToNew[patchi] = newI++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -173,9 +173,9 @@ label addCellZone(const polyMesh& mesh, const word& name)
|
|||||||
// Checks whether patch present
|
// Checks whether patch present
|
||||||
void checkPatch(const polyBoundaryMesh& bMesh, const word& name)
|
void checkPatch(const polyBoundaryMesh& bMesh, const word& name)
|
||||||
{
|
{
|
||||||
const label patchI = bMesh.findPatchID(name);
|
const label patchi = bMesh.findPatchID(name);
|
||||||
|
|
||||||
if (patchI == -1)
|
if (patchi == -1)
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Cannot find patch " << name << endl
|
<< "Cannot find patch " << name << endl
|
||||||
@ -184,7 +184,7 @@ void checkPatch(const polyBoundaryMesh& bMesh, const word& name)
|
|||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bMesh[patchI].empty())
|
if (bMesh[patchi].empty())
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Patch " << name << " is present but zero size"
|
<< "Patch " << name << " is present but zero size"
|
||||||
|
|||||||
@ -129,20 +129,20 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
// Print each patch separately
|
// Print each patch separately
|
||||||
|
|
||||||
forAll(bm, patchI)
|
forAll(bm, patchi)
|
||||||
{
|
{
|
||||||
Info<< bm[patchI].type() << "\t: " << bm[patchI].name() << nl;
|
Info<< bm[patchi].type() << "\t: " << bm[patchi].name() << nl;
|
||||||
outputFieldList(vsf, patchI);
|
outputFieldList(vsf, patchi);
|
||||||
outputFieldList(vvf, patchI);
|
outputFieldList(vvf, patchi);
|
||||||
outputFieldList(vsptf, patchI);
|
outputFieldList(vsptf, patchi);
|
||||||
outputFieldList(vsytf, patchI);
|
outputFieldList(vsytf, patchi);
|
||||||
outputFieldList(vtf, patchI);
|
outputFieldList(vtf, patchi);
|
||||||
|
|
||||||
outputFieldList(psf, patchI);
|
outputFieldList(psf, patchi);
|
||||||
outputFieldList(pvf, patchI);
|
outputFieldList(pvf, patchi);
|
||||||
outputFieldList(psptf, patchI);
|
outputFieldList(psptf, patchi);
|
||||||
outputFieldList(psytf, patchI);
|
outputFieldList(psytf, patchi);
|
||||||
outputFieldList(ptf, patchI);
|
outputFieldList(ptf, patchi);
|
||||||
Info<< endl;
|
Info<< endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -155,32 +155,32 @@ int main(int argc, char *argv[])
|
|||||||
DynamicList<HashTable<word>> fieldToTypes(bm.size());
|
DynamicList<HashTable<word>> fieldToTypes(bm.size());
|
||||||
// Per 'group' the patches
|
// Per 'group' the patches
|
||||||
DynamicList<DynamicList<label>> groupToPatches(bm.size());
|
DynamicList<DynamicList<label>> groupToPatches(bm.size());
|
||||||
forAll(bm, patchI)
|
forAll(bm, patchi)
|
||||||
{
|
{
|
||||||
HashTable<word> fieldToType;
|
HashTable<word> fieldToType;
|
||||||
collectFieldList(vsf, patchI, fieldToType);
|
collectFieldList(vsf, patchi, fieldToType);
|
||||||
collectFieldList(vvf, patchI, fieldToType);
|
collectFieldList(vvf, patchi, fieldToType);
|
||||||
collectFieldList(vsptf, patchI, fieldToType);
|
collectFieldList(vsptf, patchi, fieldToType);
|
||||||
collectFieldList(vsytf, patchI, fieldToType);
|
collectFieldList(vsytf, patchi, fieldToType);
|
||||||
collectFieldList(vtf, patchI, fieldToType);
|
collectFieldList(vtf, patchi, fieldToType);
|
||||||
|
|
||||||
collectFieldList(psf, patchI, fieldToType);
|
collectFieldList(psf, patchi, fieldToType);
|
||||||
collectFieldList(pvf, patchI, fieldToType);
|
collectFieldList(pvf, patchi, fieldToType);
|
||||||
collectFieldList(psptf, patchI, fieldToType);
|
collectFieldList(psptf, patchi, fieldToType);
|
||||||
collectFieldList(psytf, patchI, fieldToType);
|
collectFieldList(psytf, patchi, fieldToType);
|
||||||
collectFieldList(ptf, patchI, fieldToType);
|
collectFieldList(ptf, patchi, fieldToType);
|
||||||
|
|
||||||
label groupI = findIndex(fieldToTypes, fieldToType);
|
label groupI = findIndex(fieldToTypes, fieldToType);
|
||||||
if (groupI == -1)
|
if (groupI == -1)
|
||||||
{
|
{
|
||||||
DynamicList<label> group(1);
|
DynamicList<label> group(1);
|
||||||
group.append(patchI);
|
group.append(patchi);
|
||||||
groupToPatches.append(group);
|
groupToPatches.append(group);
|
||||||
fieldToTypes.append(fieldToType);
|
fieldToTypes.append(fieldToType);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
groupToPatches[groupI].append(patchI);
|
groupToPatches[groupI].append(patchi);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -227,20 +227,20 @@ int main(int argc, char *argv[])
|
|||||||
// No group.
|
// No group.
|
||||||
forAll(patchIDs, i)
|
forAll(patchIDs, i)
|
||||||
{
|
{
|
||||||
label patchI = patchIDs[i];
|
label patchi = patchIDs[i];
|
||||||
Info<< bm[patchI].type()
|
Info<< bm[patchi].type()
|
||||||
<< "\t: " << bm[patchI].name() << nl;
|
<< "\t: " << bm[patchi].name() << nl;
|
||||||
outputFieldList(vsf, patchI);
|
outputFieldList(vsf, patchi);
|
||||||
outputFieldList(vvf, patchI);
|
outputFieldList(vvf, patchi);
|
||||||
outputFieldList(vsptf, patchI);
|
outputFieldList(vsptf, patchi);
|
||||||
outputFieldList(vsytf, patchI);
|
outputFieldList(vsytf, patchi);
|
||||||
outputFieldList(vtf, patchI);
|
outputFieldList(vtf, patchi);
|
||||||
|
|
||||||
outputFieldList(psf, patchI);
|
outputFieldList(psf, patchi);
|
||||||
outputFieldList(pvf, patchI);
|
outputFieldList(pvf, patchi);
|
||||||
outputFieldList(psptf, patchI);
|
outputFieldList(psptf, patchi);
|
||||||
outputFieldList(psytf, patchI);
|
outputFieldList(psytf, patchi);
|
||||||
outputFieldList(ptf, patchI);
|
outputFieldList(ptf, patchi);
|
||||||
Info<< endl;
|
Info<< endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -53,7 +53,7 @@ template<class GeoField>
|
|||||||
void Foam::outputFieldList
|
void Foam::outputFieldList
|
||||||
(
|
(
|
||||||
const PtrList<GeoField>& fieldList,
|
const PtrList<GeoField>& fieldList,
|
||||||
const label patchI
|
const label patchi
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
forAll(fieldList, fieldI)
|
forAll(fieldList, fieldI)
|
||||||
@ -63,7 +63,7 @@ void Foam::outputFieldList
|
|||||||
Info<< " " << pTraits<typename GeoField::value_type>::typeName
|
Info<< " " << pTraits<typename GeoField::value_type>::typeName
|
||||||
<< tab << tab
|
<< tab << tab
|
||||||
<< fieldList[fieldI].name() << tab << tab
|
<< fieldList[fieldI].name() << tab << tab
|
||||||
<< fieldList[fieldI].boundaryField()[patchI].type() << nl;
|
<< fieldList[fieldI].boundaryField()[patchi].type() << nl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -73,7 +73,7 @@ template<class GeoField>
|
|||||||
void Foam::collectFieldList
|
void Foam::collectFieldList
|
||||||
(
|
(
|
||||||
const PtrList<GeoField>& fieldList,
|
const PtrList<GeoField>& fieldList,
|
||||||
const label patchI,
|
const label patchi,
|
||||||
HashTable<word>& fieldToType
|
HashTable<word>& fieldToType
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -84,7 +84,7 @@ void Foam::collectFieldList
|
|||||||
fieldToType.insert
|
fieldToType.insert
|
||||||
(
|
(
|
||||||
fieldList[fieldI].name(),
|
fieldList[fieldI].name(),
|
||||||
fieldList[fieldI].boundaryField()[patchI].type()
|
fieldList[fieldI].boundaryField()[patchi].type()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -55,16 +55,16 @@ void Foam::domainDecomposition::addInterProcFace
|
|||||||
List<DynamicList<DynamicList<label>>>& interPatchFaces
|
List<DynamicList<DynamicList<label>>>& interPatchFaces
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
Map<label>::iterator patchIter = nbrToInterPatch[ownerProc].find(nbrProc);
|
Map<label>::iterator patchiter = nbrToInterPatch[ownerProc].find(nbrProc);
|
||||||
|
|
||||||
// Introduce turning index only for internal faces (are duplicated).
|
// Introduce turning index only for internal faces (are duplicated).
|
||||||
label ownerIndex = facei+1;
|
label ownerIndex = facei+1;
|
||||||
label nbrIndex = -(facei+1);
|
label nbrIndex = -(facei+1);
|
||||||
|
|
||||||
if (patchIter != nbrToInterPatch[ownerProc].end())
|
if (patchiter != nbrToInterPatch[ownerProc].end())
|
||||||
{
|
{
|
||||||
// Existing interproc patch. Add to both sides.
|
// Existing interproc patch. Add to both sides.
|
||||||
label toNbrProcPatchI = patchIter();
|
label toNbrProcPatchI = patchiter();
|
||||||
interPatchFaces[ownerProc][toNbrProcPatchI].append(ownerIndex);
|
interPatchFaces[ownerProc][toNbrProcPatchI].append(ownerIndex);
|
||||||
|
|
||||||
if (isInternalFace(facei))
|
if (isInternalFace(facei))
|
||||||
@ -402,11 +402,11 @@ void Foam::domainDecomposition::decomposeMesh()
|
|||||||
//
|
//
|
||||||
// const labelList& curProcPatchStartIndex = procPatchStartIndex_[procI];
|
// const labelList& curProcPatchStartIndex = procPatchStartIndex_[procI];
|
||||||
//
|
//
|
||||||
// forAll(curProcPatchStartIndex, patchI)
|
// forAll(curProcPatchStartIndex, patchi)
|
||||||
// {
|
// {
|
||||||
// Info<< " patch:" << patchI
|
// Info<< " patch:" << patchi
|
||||||
// << "\tstart:" << curProcPatchStartIndex[patchI]
|
// << "\tstart:" << curProcPatchStartIndex[patchi]
|
||||||
// << "\tsize:" << procPatchSize_[procI][patchI]
|
// << "\tsize:" << procPatchSize_[procI][patchi]
|
||||||
// << endl;
|
// << endl;
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|||||||
@ -117,9 +117,9 @@ autoPtr<faceCoupleInfo> determineCoupledFaces
|
|||||||
- masterMesh.nInternalFaces()
|
- masterMesh.nInternalFaces()
|
||||||
);
|
);
|
||||||
|
|
||||||
forAll(masterPatches, patchI)
|
forAll(masterPatches, patchi)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = masterPatches[patchI];
|
const polyPatch& pp = masterPatches[patchi];
|
||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
@ -151,9 +151,9 @@ autoPtr<faceCoupleInfo> determineCoupledFaces
|
|||||||
- meshToAdd.nInternalFaces()
|
- meshToAdd.nInternalFaces()
|
||||||
);
|
);
|
||||||
|
|
||||||
forAll(addPatches, patchI)
|
forAll(addPatches, patchi)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = addPatches[patchI];
|
const polyPatch& pp = addPatches[patchi];
|
||||||
|
|
||||||
if (isA<processorPolyPatch>(pp))
|
if (isA<processorPolyPatch>(pp))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -136,9 +136,9 @@ Foam::autoPtr<Foam::fvMesh> Foam::loadOrCreateMesh
|
|||||||
List<polyPatch*> patches(patchEntries.size());
|
List<polyPatch*> patches(patchEntries.size());
|
||||||
label nPatches = 0;
|
label nPatches = 0;
|
||||||
|
|
||||||
forAll(patchEntries, patchI)
|
forAll(patchEntries, patchi)
|
||||||
{
|
{
|
||||||
const entry& e = patchEntries[patchI];
|
const entry& e = patchEntries[patchi];
|
||||||
const word type(e.dict().lookup("type"));
|
const word type(e.dict().lookup("type"));
|
||||||
const word& name = e.keyword();
|
const word& name = e.keyword();
|
||||||
|
|
||||||
@ -152,7 +152,7 @@ Foam::autoPtr<Foam::fvMesh> Foam::loadOrCreateMesh
|
|||||||
patchDict.set("nFaces", 0);
|
patchDict.set("nFaces", 0);
|
||||||
patchDict.set("startFace", 0);
|
patchDict.set("startFace", 0);
|
||||||
|
|
||||||
patches[patchI] = polyPatch::New
|
patches[patchi] = polyPatch::New
|
||||||
(
|
(
|
||||||
name,
|
name,
|
||||||
patchDict,
|
patchDict,
|
||||||
@ -223,9 +223,9 @@ Foam::autoPtr<Foam::fvMesh> Foam::loadOrCreateMesh
|
|||||||
|
|
||||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||||
|
|
||||||
forAll(patchEntries, patchI)
|
forAll(patchEntries, patchi)
|
||||||
{
|
{
|
||||||
const entry& e = patchEntries[patchI];
|
const entry& e = patchEntries[patchi];
|
||||||
const word type(e.dict().lookup("type"));
|
const word type(e.dict().lookup("type"));
|
||||||
const word& name = e.keyword();
|
const word& name = e.keyword();
|
||||||
|
|
||||||
@ -234,7 +234,7 @@ Foam::autoPtr<Foam::fvMesh> Foam::loadOrCreateMesh
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (patchI >= patches.size())
|
if (patchi >= patches.size())
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Non-processor patches not synchronised."
|
<< "Non-processor patches not synchronised."
|
||||||
@ -242,26 +242,26 @@ Foam::autoPtr<Foam::fvMesh> Foam::loadOrCreateMesh
|
|||||||
<< "Processor " << Pstream::myProcNo()
|
<< "Processor " << Pstream::myProcNo()
|
||||||
<< " has only " << patches.size()
|
<< " has only " << patches.size()
|
||||||
<< " patches, master has "
|
<< " patches, master has "
|
||||||
<< patchI
|
<< patchi
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
type != patches[patchI].type()
|
type != patches[patchi].type()
|
||||||
|| name != patches[patchI].name()
|
|| name != patches[patchi].name()
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Non-processor patches not synchronised."
|
<< "Non-processor patches not synchronised."
|
||||||
<< endl
|
<< endl
|
||||||
<< "Master patch " << patchI
|
<< "Master patch " << patchi
|
||||||
<< " name:" << type
|
<< " name:" << type
|
||||||
<< " type:" << type << endl
|
<< " type:" << type << endl
|
||||||
<< "Processor " << Pstream::myProcNo()
|
<< "Processor " << Pstream::myProcNo()
|
||||||
<< " patch " << patchI
|
<< " patch " << patchi
|
||||||
<< " has name:" << patches[patchI].name()
|
<< " has name:" << patches[patchi].name()
|
||||||
<< " type:" << patches[patchI].type()
|
<< " type:" << patches[patchi].type()
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -379,16 +379,16 @@ void compareFields
|
|||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
forAll(a.boundaryField(), patchI)
|
forAll(a.boundaryField(), patchi)
|
||||||
{
|
{
|
||||||
// We have real mesh cellcentre and
|
// We have real mesh cellcentre and
|
||||||
// mapped original cell centre.
|
// mapped original cell centre.
|
||||||
|
|
||||||
const fvPatchVectorField& aBoundary =
|
const fvPatchVectorField& aBoundary =
|
||||||
a.boundaryField()[patchI];
|
a.boundaryField()[patchi];
|
||||||
|
|
||||||
const fvPatchVectorField& bBoundary =
|
const fvPatchVectorField& bBoundary =
|
||||||
b.boundaryField()[patchI];
|
b.boundaryField()[patchi];
|
||||||
|
|
||||||
if (!bBoundary.coupled())
|
if (!bBoundary.coupled())
|
||||||
{
|
{
|
||||||
@ -399,7 +399,7 @@ void compareFields
|
|||||||
WarningInFunction
|
WarningInFunction
|
||||||
<< "Did not map volVectorField correctly:"
|
<< "Did not map volVectorField correctly:"
|
||||||
<< endl
|
<< endl
|
||||||
<< "patch:" << patchI << " patchFace:" << i
|
<< "patch:" << patchi << " patchFace:" << i
|
||||||
<< " cc:" << endl
|
<< " cc:" << endl
|
||||||
<< " real :" << aBoundary[i] << endl
|
<< " real :" << aBoundary[i] << endl
|
||||||
<< " mapped :" << bBoundary[i] << endl
|
<< " mapped :" << bBoundary[i] << endl
|
||||||
@ -576,9 +576,9 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
label nonProcI = -1;
|
label nonProcI = -1;
|
||||||
|
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
if (isA<processorPolyPatch>(patches[patchI]))
|
if (isA<processorPolyPatch>(patches[patchi]))
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -80,9 +80,9 @@ int main(int argc, char *argv[])
|
|||||||
// Writing number of faces
|
// Writing number of faces
|
||||||
label nFaces = mesh.nFaces();
|
label nFaces = mesh.nFaces();
|
||||||
|
|
||||||
forAll(mesh.boundary(), patchI)
|
forAll(mesh.boundary(), patchi)
|
||||||
{
|
{
|
||||||
nFaces += mesh.boundary()[patchI].size();
|
nFaces += mesh.boundary()[patchi].size();
|
||||||
}
|
}
|
||||||
|
|
||||||
fluentDataFile
|
fluentDataFile
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -52,7 +52,7 @@ void writeFluentField
|
|||||||
<< "(300 ("
|
<< "(300 ("
|
||||||
<< fluentFieldIdentifier << " " // Field identifier
|
<< fluentFieldIdentifier << " " // Field identifier
|
||||||
<< "1 " // Zone ID: (cells=1, internal faces=2,
|
<< "1 " // Zone ID: (cells=1, internal faces=2,
|
||||||
// patch faces=patchI+10)
|
// patch faces=patchi+10)
|
||||||
<< "1 " // Number of components (scalar=1, vector=3)
|
<< "1 " // Number of components (scalar=1, vector=3)
|
||||||
<< "0 0 " // Unused
|
<< "0 0 " // Unused
|
||||||
<< "1 " << phiInternal.size() // Start and end of list
|
<< "1 " << phiInternal.size() // Start and end of list
|
||||||
@ -69,9 +69,9 @@ void writeFluentField
|
|||||||
label nWrittenFaces = phiInternal.size();
|
label nWrittenFaces = phiInternal.size();
|
||||||
|
|
||||||
// Writing boundary faces
|
// Writing boundary faces
|
||||||
forAll(phi.boundaryField(), patchI)
|
forAll(phi.boundaryField(), patchi)
|
||||||
{
|
{
|
||||||
if (isType<emptyFvPatchScalarField>(phi.boundaryField()[patchI]))
|
if (isType<emptyFvPatchScalarField>(phi.boundaryField()[patchi]))
|
||||||
{
|
{
|
||||||
// Form empty patch field repeat the internal field to
|
// Form empty patch field repeat the internal field to
|
||||||
// allow for the node interpolation in Fluent
|
// allow for the node interpolation in Fluent
|
||||||
@ -79,13 +79,13 @@ void writeFluentField
|
|||||||
|
|
||||||
// Get reference to internal cells
|
// Get reference to internal cells
|
||||||
const labelList emptyFaceCells =
|
const labelList emptyFaceCells =
|
||||||
phi.boundaryField()[patchI].patch().patch().faceCells();
|
phi.boundaryField()[patchi].patch().patch().faceCells();
|
||||||
|
|
||||||
// Writing cells for empty patch
|
// Writing cells for empty patch
|
||||||
stream
|
stream
|
||||||
<< "(300 ("
|
<< "(300 ("
|
||||||
<< fluentFieldIdentifier << " " // Field identifier
|
<< fluentFieldIdentifier << " " // Field identifier
|
||||||
<< patchI + 10 << " " // Zone ID: patchI+10
|
<< patchi + 10 << " " // Zone ID: patchi+10
|
||||||
<< "1 " // Number of components (scalar=1, vector=3)
|
<< "1 " // Number of components (scalar=1, vector=3)
|
||||||
<< "0 0 " // Unused
|
<< "0 0 " // Unused
|
||||||
<< nWrittenFaces + 1 << " "
|
<< nWrittenFaces + 1 << " "
|
||||||
@ -107,13 +107,13 @@ void writeFluentField
|
|||||||
// Regular patch
|
// Regular patch
|
||||||
label nWrittenFaces = phiInternal.size();
|
label nWrittenFaces = phiInternal.size();
|
||||||
|
|
||||||
const scalarField& patchPhi = phi.boundaryField()[patchI];
|
const scalarField& patchPhi = phi.boundaryField()[patchi];
|
||||||
|
|
||||||
// Write header
|
// Write header
|
||||||
stream
|
stream
|
||||||
<< "(300 ("
|
<< "(300 ("
|
||||||
<< fluentFieldIdentifier << " " // Field identifier
|
<< fluentFieldIdentifier << " " // Field identifier
|
||||||
<< patchI + 10 << " " // Zone ID: patchI+10
|
<< patchi + 10 << " " // Zone ID: patchi+10
|
||||||
<< "1 " // Number of components (scalar=1, vector=3)
|
<< "1 " // Number of components (scalar=1, vector=3)
|
||||||
<< "0 0 " // Unused
|
<< "0 0 " // Unused
|
||||||
<< nWrittenFaces + 1 << " " << nWrittenFaces + patchPhi.size()
|
<< nWrittenFaces + 1 << " " << nWrittenFaces + patchPhi.size()
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -51,7 +51,7 @@ void writeFluentField
|
|||||||
<< "(300 ("
|
<< "(300 ("
|
||||||
<< fluentFieldIdentifier << " " // Field identifier
|
<< fluentFieldIdentifier << " " // Field identifier
|
||||||
<< "1 " // Zone ID: (cells=1, internal faces=2,
|
<< "1 " // Zone ID: (cells=1, internal faces=2,
|
||||||
// patch faces=patchI+10)
|
// patch faces=patchi+10)
|
||||||
<< "3 " // Number of components (scalar=1, vector=3)
|
<< "3 " // Number of components (scalar=1, vector=3)
|
||||||
<< "0 0 " // Unused
|
<< "0 0 " // Unused
|
||||||
<< "1 " << phiInternal.size() // Start and end of list
|
<< "1 " << phiInternal.size() // Start and end of list
|
||||||
@ -72,15 +72,15 @@ void writeFluentField
|
|||||||
label nWrittenFaces = phiInternal.size();
|
label nWrittenFaces = phiInternal.size();
|
||||||
|
|
||||||
// Writing boundary faces
|
// Writing boundary faces
|
||||||
forAll(phi.boundaryField(), patchI)
|
forAll(phi.boundaryField(), patchi)
|
||||||
{
|
{
|
||||||
const vectorField& patchPhi = phi.boundaryField()[patchI];
|
const vectorField& patchPhi = phi.boundaryField()[patchi];
|
||||||
|
|
||||||
// Write header
|
// Write header
|
||||||
stream
|
stream
|
||||||
<< "(300 ("
|
<< "(300 ("
|
||||||
<< fluentFieldIdentifier << " " // Field identifier
|
<< fluentFieldIdentifier << " " // Field identifier
|
||||||
<< patchI + 10 << " " // Zone ID: patchI+10
|
<< patchi + 10 << " " // Zone ID: patchi+10
|
||||||
<< "3 " // Number of components (scalar=1, vector=3)
|
<< "3 " // Number of components (scalar=1, vector=3)
|
||||||
<< "0 0 " // Unused
|
<< "0 0 " // Unused
|
||||||
<< nWrittenFaces + 1 << " " << nWrittenFaces + patchPhi.size()
|
<< nWrittenFaces + 1 << " " << nWrittenFaces + patchPhi.size()
|
||||||
|
|||||||
@ -492,10 +492,10 @@ void ensightField
|
|||||||
{
|
{
|
||||||
if (eMesh.faceToBeIncluded(faceI))
|
if (eMesh.faceToBeIncluded(faceI))
|
||||||
{
|
{
|
||||||
label patchI = mesh.boundaryMesh().whichPatch(faceI);
|
label patchi = mesh.boundaryMesh().whichPatch(faceI);
|
||||||
const polyPatch& pp = mesh.boundaryMesh()[patchI];
|
const polyPatch& pp = mesh.boundaryMesh()[patchi];
|
||||||
label patchFaceI = pp.whichFace(faceI);
|
label patchFaceI = pp.whichFace(faceI);
|
||||||
Type value = sf.boundaryField()[patchI][patchFaceI];
|
Type value = sf.boundaryField()[patchi][patchFaceI];
|
||||||
values[j] = value;
|
values[j] = value;
|
||||||
++j;
|
++j;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -284,9 +284,9 @@ void Foam::ensightMesh::correct()
|
|||||||
1
|
1
|
||||||
);
|
);
|
||||||
|
|
||||||
forAll(mesh_.boundaryMesh(), patchI)
|
forAll(mesh_.boundaryMesh(), patchi)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = mesh_.boundaryMesh()[patchI];
|
const polyPatch& pp = mesh_.boundaryMesh()[patchi];
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
isA<processorPolyPatch>(pp)
|
isA<processorPolyPatch>(pp)
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -129,9 +129,9 @@ labelList getSelectedPatches
|
|||||||
|
|
||||||
Info<< "Combining patches:" << endl;
|
Info<< "Combining patches:" << endl;
|
||||||
|
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = patches[patchI];
|
const polyPatch& pp = patches[patchi];
|
||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
@ -139,18 +139,18 @@ labelList getSelectedPatches
|
|||||||
|| (Pstream::parRun() && isType<processorPolyPatch>(pp))
|
|| (Pstream::parRun() && isType<processorPolyPatch>(pp))
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Info<< " discarding empty/processor patch " << patchI
|
Info<< " discarding empty/processor patch " << patchi
|
||||||
<< " " << pp.name() << endl;
|
<< " " << pp.name() << endl;
|
||||||
}
|
}
|
||||||
else if (findStrings(excludePatches, pp.name()))
|
else if (findStrings(excludePatches, pp.name()))
|
||||||
{
|
{
|
||||||
Info<< " excluding patch " << patchI
|
Info<< " excluding patch " << patchi
|
||||||
<< " " << pp.name() << endl;
|
<< " " << pp.name() << endl;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
patchIDs.append(patchI);
|
patchIDs.append(patchi);
|
||||||
Info<< " patch " << patchI << " " << pp.name() << endl;
|
Info<< " patch " << patchi << " " << pp.name() << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return patchIDs.shrink();
|
return patchIDs.shrink();
|
||||||
|
|||||||
@ -69,16 +69,16 @@ Foam::tmp<Field<Type>> Foam::tecplotWriter::getPatchField
|
|||||||
(
|
(
|
||||||
const bool nearCellValue,
|
const bool nearCellValue,
|
||||||
const GeometricField<Type, fvPatchField, volMesh>& vfld,
|
const GeometricField<Type, fvPatchField, volMesh>& vfld,
|
||||||
const label patchI
|
const label patchi
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
if (nearCellValue)
|
if (nearCellValue)
|
||||||
{
|
{
|
||||||
return vfld.boundaryField()[patchI].patchInternalField();
|
return vfld.boundaryField()[patchi].patchInternalField();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return vfld.boundaryField()[patchI];
|
return vfld.boundaryField()[patchi];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -99,16 +99,16 @@ Foam::tmp<Field<Type>> Foam::tecplotWriter::getFaceField
|
|||||||
{
|
{
|
||||||
label faceI = faceLabels[i];
|
label faceI = faceLabels[i];
|
||||||
|
|
||||||
label patchI = patches.whichPatch(faceI);
|
label patchi = patches.whichPatch(faceI);
|
||||||
|
|
||||||
if (patchI == -1)
|
if (patchi == -1)
|
||||||
{
|
{
|
||||||
fld[i] = sfld[faceI];
|
fld[i] = sfld[faceI];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
label localFaceI = faceI - patches[patchI].start();
|
label localFaceI = faceI - patches[patchi].start();
|
||||||
fld[i] = sfld.boundaryField()[patchI][localFaceI];
|
fld[i] = sfld.boundaryField()[patchi][localFaceI];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -110,12 +110,12 @@ void ReadAndMapFields
|
|||||||
label bFaceI = faceI - mesh.nInternalFaces();
|
label bFaceI = faceI - mesh.nInternalFaces();
|
||||||
if (bFaceI >= 0)
|
if (bFaceI >= 0)
|
||||||
{
|
{
|
||||||
label patchI = mesh.boundaryMesh().patchID()[bFaceI];
|
label patchi = mesh.boundaryMesh().patchID()[bFaceI];
|
||||||
label localFaceI = mesh.boundaryMesh()[patchI].whichFace
|
label localFaceI = mesh.boundaryMesh()[patchi].whichFace
|
||||||
(
|
(
|
||||||
faceI
|
faceI
|
||||||
);
|
);
|
||||||
fld[pointI] = readField.boundaryField()[patchI][localFaceI];
|
fld[pointI] = readField.boundaryField()[patchi][localFaceI];
|
||||||
}
|
}
|
||||||
//else
|
//else
|
||||||
//{
|
//{
|
||||||
|
|||||||
@ -198,9 +198,9 @@ labelList getSelectedPatches
|
|||||||
|
|
||||||
Info<< "Combining patches:" << endl;
|
Info<< "Combining patches:" << endl;
|
||||||
|
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = patches[patchI];
|
const polyPatch& pp = patches[patchi];
|
||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
@ -208,18 +208,18 @@ labelList getSelectedPatches
|
|||||||
|| (Pstream::parRun() && isType<processorPolyPatch>(pp))
|
|| (Pstream::parRun() && isType<processorPolyPatch>(pp))
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Info<< " discarding empty/processor patch " << patchI
|
Info<< " discarding empty/processor patch " << patchi
|
||||||
<< " " << pp.name() << endl;
|
<< " " << pp.name() << endl;
|
||||||
}
|
}
|
||||||
else if (findStrings(excludePatches, pp.name()))
|
else if (findStrings(excludePatches, pp.name()))
|
||||||
{
|
{
|
||||||
Info<< " excluding patch " << patchI
|
Info<< " excluding patch " << patchi
|
||||||
<< " " << pp.name() << endl;
|
<< " " << pp.name() << endl;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
patchIDs.append(patchI);
|
patchIDs.append(patchi);
|
||||||
Info<< " patch " << patchI << " " << pp.name() << endl;
|
Info<< " patch " << patchi << " " << pp.name() << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return patchIDs.shrink();
|
return patchIDs.shrink();
|
||||||
@ -890,9 +890,9 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = patches[patchI];
|
const polyPatch& pp = patches[patchi];
|
||||||
|
|
||||||
if (!findStrings(excludePatches, pp.name()))
|
if (!findStrings(excludePatches, pp.name()))
|
||||||
{
|
{
|
||||||
@ -925,7 +925,7 @@ int main(int argc, char *argv[])
|
|||||||
binary,
|
binary,
|
||||||
nearCellValue,
|
nearCellValue,
|
||||||
patchFileName,
|
patchFileName,
|
||||||
labelList(1, patchI)
|
labelList(1, patchi)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!isA<emptyPolyPatch>(pp))
|
if (!isA<emptyPolyPatch>(pp))
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -123,13 +123,13 @@ void Foam::patchWriter::writePatchIDs()
|
|||||||
|
|
||||||
forAll(patchIDs_, i)
|
forAll(patchIDs_, i)
|
||||||
{
|
{
|
||||||
label patchI = patchIDs_[i];
|
label patchi = patchIDs_[i];
|
||||||
|
|
||||||
const polyPatch& pp = mesh.boundaryMesh()[patchI];
|
const polyPatch& pp = mesh.boundaryMesh()[patchi];
|
||||||
|
|
||||||
if (!isA<emptyPolyPatch>(pp))
|
if (!isA<emptyPolyPatch>(pp))
|
||||||
{
|
{
|
||||||
writeFuns::insert(scalarField(pp.size(), patchI), fField);
|
writeFuns::insert(scalarField(pp.size(), patchi), fField);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
writeFuns::write(os_, binary_, fField);
|
writeFuns::write(os_, binary_, fField);
|
||||||
|
|||||||
@ -45,9 +45,9 @@ void Foam::patchWriter::write
|
|||||||
|
|
||||||
forAll(patchIDs_, j)
|
forAll(patchIDs_, j)
|
||||||
{
|
{
|
||||||
label patchI = patchIDs_[j];
|
label patchi = patchIDs_[j];
|
||||||
|
|
||||||
const fvPatchField<Type>& pfld = fld.boundaryField()[patchI];
|
const fvPatchField<Type>& pfld = fld.boundaryField()[patchi];
|
||||||
|
|
||||||
if (nearCellValue_)
|
if (nearCellValue_)
|
||||||
{
|
{
|
||||||
@ -81,9 +81,9 @@ void Foam::patchWriter::write
|
|||||||
|
|
||||||
forAll(patchIDs_, j)
|
forAll(patchIDs_, j)
|
||||||
{
|
{
|
||||||
label patchI = patchIDs_[j];
|
label patchi = patchIDs_[j];
|
||||||
|
|
||||||
const pointPatchField<Type>& pfld = fld.boundaryField()[patchI];
|
const pointPatchField<Type>& pfld = fld.boundaryField()[patchi];
|
||||||
|
|
||||||
writeFuns::insert(pfld.patchInternalField()(), fField);
|
writeFuns::insert(pfld.patchInternalField()(), fField);
|
||||||
}
|
}
|
||||||
@ -110,9 +110,9 @@ void Foam::patchWriter::write
|
|||||||
|
|
||||||
forAll(patchIDs_, j)
|
forAll(patchIDs_, j)
|
||||||
{
|
{
|
||||||
label patchI = patchIDs_[j];
|
label patchi = patchIDs_[j];
|
||||||
|
|
||||||
const fvPatchField<Type>& pfld = fld.boundaryField()[patchI];
|
const fvPatchField<Type>& pfld = fld.boundaryField()[patchi];
|
||||||
|
|
||||||
if (nearCellValue_)
|
if (nearCellValue_)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -43,16 +43,16 @@ Foam::tmp<Field<Type>> Foam::surfaceMeshWriter::getFaceField
|
|||||||
{
|
{
|
||||||
label faceI = pp_.addressing()[i];
|
label faceI = pp_.addressing()[i];
|
||||||
|
|
||||||
label patchI = patches.whichPatch(faceI);
|
label patchi = patches.whichPatch(faceI);
|
||||||
|
|
||||||
if (patchI == -1)
|
if (patchi == -1)
|
||||||
{
|
{
|
||||||
fld[i] = sfld[faceI];
|
fld[i] = sfld[faceI];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
label localFaceI = faceI - patches[patchI].start();
|
label localFaceI = faceI - patches[patchi].start();
|
||||||
fld[i] = sfld.boundaryField()[patchI][localFaceI];
|
fld[i] = sfld.boundaryField()[patchi][localFaceI];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -89,11 +89,11 @@ void writeSurfFields
|
|||||||
writeFuns::insert(svf[faceI], fField);
|
writeFuns::insert(svf[faceI], fField);
|
||||||
}
|
}
|
||||||
|
|
||||||
forAll(svf.boundaryField(), patchI)
|
forAll(svf.boundaryField(), patchi)
|
||||||
{
|
{
|
||||||
const fvsPatchVectorField& pf = svf.boundaryField()[patchI];
|
const fvsPatchVectorField& pf = svf.boundaryField()[patchi];
|
||||||
|
|
||||||
const fvPatch& pp = mesh.boundary()[patchI];
|
const fvPatch& pp = mesh.boundary()[patchi];
|
||||||
|
|
||||||
if (isA<emptyFvsPatchVectorField>(pf))
|
if (isA<emptyFvsPatchVectorField>(pf))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -630,10 +630,10 @@ void Foam::vtkPV3Foam::renderPatchNames(vtkRenderer* renderer, const bool show)
|
|||||||
|
|
||||||
// always remove old actors first
|
// always remove old actors first
|
||||||
|
|
||||||
forAll(patchTextActorsPtrs_, patchI)
|
forAll(patchTextActorsPtrs_, patchi)
|
||||||
{
|
{
|
||||||
renderer->RemoveViewProp(patchTextActorsPtrs_[patchI]);
|
renderer->RemoveViewProp(patchTextActorsPtrs_[patchi]);
|
||||||
patchTextActorsPtrs_[patchI]->Delete();
|
patchTextActorsPtrs_[patchi]->Delete();
|
||||||
}
|
}
|
||||||
patchTextActorsPtrs_.clear();
|
patchTextActorsPtrs_.clear();
|
||||||
|
|
||||||
@ -663,9 +663,9 @@ void Foam::vtkPV3Foam::renderPatchNames(vtkRenderer* renderer, const bool show)
|
|||||||
|
|
||||||
|
|
||||||
// Loop through all patches to determine zones, and centre of each zone
|
// Loop through all patches to determine zones, and centre of each zone
|
||||||
forAll(pbMesh, patchI)
|
forAll(pbMesh, patchi)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = pbMesh[patchI];
|
const polyPatch& pp = pbMesh[patchi];
|
||||||
|
|
||||||
// Only include the patch if it is selected
|
// Only include the patch if it is selected
|
||||||
if (!selectedPatches.found(pp.name()))
|
if (!selectedPatches.found(pp.name()))
|
||||||
@ -697,27 +697,27 @@ void Foam::vtkPV3Foam::renderPatchNames(vtkRenderer* renderer, const bool show)
|
|||||||
// Do topological analysis of patch, find disconnected regions
|
// Do topological analysis of patch, find disconnected regions
|
||||||
patchZones pZones(pp, featEdge);
|
patchZones pZones(pp, featEdge);
|
||||||
|
|
||||||
nZones[patchI] = pZones.nZones();
|
nZones[patchi] = pZones.nZones();
|
||||||
|
|
||||||
labelList zoneNFaces(pZones.nZones(), 0);
|
labelList zoneNFaces(pZones.nZones(), 0);
|
||||||
|
|
||||||
// Create storage for additional zone centres
|
// Create storage for additional zone centres
|
||||||
forAll(zoneNFaces, zoneI)
|
forAll(zoneNFaces, zoneI)
|
||||||
{
|
{
|
||||||
zoneCentre[patchI].append(Zero);
|
zoneCentre[patchi].append(Zero);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do averaging per individual zone
|
// Do averaging per individual zone
|
||||||
forAll(pp, faceI)
|
forAll(pp, faceI)
|
||||||
{
|
{
|
||||||
label zoneI = pZones[faceI];
|
label zoneI = pZones[faceI];
|
||||||
zoneCentre[patchI][zoneI] += pp[faceI].centre(pp.points());
|
zoneCentre[patchi][zoneI] += pp[faceI].centre(pp.points());
|
||||||
zoneNFaces[zoneI]++;
|
zoneNFaces[zoneI]++;
|
||||||
}
|
}
|
||||||
|
|
||||||
forAll(zoneCentre[patchI], zoneI)
|
forAll(zoneCentre[patchi], zoneI)
|
||||||
{
|
{
|
||||||
zoneCentre[patchI][zoneI] /= zoneNFaces[zoneI];
|
zoneCentre[patchi][zoneI] /= zoneNFaces[zoneI];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -728,9 +728,9 @@ void Foam::vtkPV3Foam::renderPatchNames(vtkRenderer* renderer, const bool show)
|
|||||||
|
|
||||||
label displayZoneI = 0;
|
label displayZoneI = 0;
|
||||||
|
|
||||||
forAll(pbMesh, patchI)
|
forAll(pbMesh, patchi)
|
||||||
{
|
{
|
||||||
displayZoneI += min(MAXPATCHZONES, nZones[patchI]);
|
displayZoneI += min(MAXPATCHZONES, nZones[patchi]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
@ -750,18 +750,18 @@ void Foam::vtkPV3Foam::renderPatchNames(vtkRenderer* renderer, const bool show)
|
|||||||
// Actor index
|
// Actor index
|
||||||
displayZoneI = 0;
|
displayZoneI = 0;
|
||||||
|
|
||||||
forAll(pbMesh, patchI)
|
forAll(pbMesh, patchi)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = pbMesh[patchI];
|
const polyPatch& pp = pbMesh[patchi];
|
||||||
|
|
||||||
label globalZoneI = 0;
|
label globalZoneI = 0;
|
||||||
|
|
||||||
// Only selected patches will have a non-zero number of zones
|
// Only selected patches will have a non-zero number of zones
|
||||||
label nDisplayZones = min(MAXPATCHZONES, nZones[patchI]);
|
label nDisplayZones = min(MAXPATCHZONES, nZones[patchi]);
|
||||||
label increment = 1;
|
label increment = 1;
|
||||||
if (nZones[patchI] >= MAXPATCHZONES)
|
if (nZones[patchi] >= MAXPATCHZONES)
|
||||||
{
|
{
|
||||||
increment = nZones[patchI]/MAXPATCHZONES;
|
increment = nZones[patchi]/MAXPATCHZONES;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (label i = 0; i < nDisplayZones; i++)
|
for (label i = 0; i < nDisplayZones; i++)
|
||||||
@ -769,7 +769,7 @@ void Foam::vtkPV3Foam::renderPatchNames(vtkRenderer* renderer, const bool show)
|
|||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "patch name = " << pp.name() << nl
|
Info<< "patch name = " << pp.name() << nl
|
||||||
<< "anchor = " << zoneCentre[patchI][globalZoneI] << nl
|
<< "anchor = " << zoneCentre[patchi][globalZoneI] << nl
|
||||||
<< "globalZoneI = " << globalZoneI << endl;
|
<< "globalZoneI = " << globalZoneI << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -792,9 +792,9 @@ void Foam::vtkPV3Foam::renderPatchNames(vtkRenderer* renderer, const bool show)
|
|||||||
|
|
||||||
txt->GetPositionCoordinate()->SetValue
|
txt->GetPositionCoordinate()->SetValue
|
||||||
(
|
(
|
||||||
zoneCentre[patchI][globalZoneI].x(),
|
zoneCentre[patchi][globalZoneI].x(),
|
||||||
zoneCentre[patchI][globalZoneI].y(),
|
zoneCentre[patchi][globalZoneI].y(),
|
||||||
zoneCentre[patchI][globalZoneI].z()
|
zoneCentre[patchi][globalZoneI].z()
|
||||||
);
|
);
|
||||||
|
|
||||||
// Add text to each renderer
|
// Add text to each renderer
|
||||||
|
|||||||
@ -295,9 +295,9 @@ void Foam::vtkPV3Foam::updateInfoPatches
|
|||||||
|
|
||||||
if (!reader_->GetShowGroupsOnly())
|
if (!reader_->GetShowGroupsOnly())
|
||||||
{
|
{
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = patches[patchI];
|
const polyPatch& pp = patches[patchi];
|
||||||
|
|
||||||
if (pp.size())
|
if (pp.size())
|
||||||
{
|
{
|
||||||
@ -344,12 +344,12 @@ void Foam::vtkPV3Foam::updateInfoPatches
|
|||||||
wordList names(patchEntries.size());
|
wordList names(patchEntries.size());
|
||||||
labelList sizes(patchEntries.size());
|
labelList sizes(patchEntries.size());
|
||||||
|
|
||||||
forAll(patchEntries, patchI)
|
forAll(patchEntries, patchi)
|
||||||
{
|
{
|
||||||
const dictionary& patchDict = patchEntries[patchI].dict();
|
const dictionary& patchDict = patchEntries[patchi].dict();
|
||||||
|
|
||||||
sizes[patchI] = readLabel(patchDict.lookup("nFaces"));
|
sizes[patchi] = readLabel(patchDict.lookup("nFaces"));
|
||||||
names[patchI] = patchEntries[patchI].keyword();
|
names[patchi] = patchEntries[patchi].keyword();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -358,9 +358,9 @@ void Foam::vtkPV3Foam::updateInfoPatches
|
|||||||
|
|
||||||
HashTable<labelList, word> groups(patchEntries.size());
|
HashTable<labelList, word> groups(patchEntries.size());
|
||||||
|
|
||||||
forAll(patchEntries, patchI)
|
forAll(patchEntries, patchi)
|
||||||
{
|
{
|
||||||
const dictionary& patchDict = patchEntries[patchI].dict();
|
const dictionary& patchDict = patchEntries[patchi].dict();
|
||||||
|
|
||||||
wordList groupNames;
|
wordList groupNames;
|
||||||
patchDict.readIfPresent("inGroups", groupNames);
|
patchDict.readIfPresent("inGroups", groupNames);
|
||||||
@ -373,11 +373,11 @@ void Foam::vtkPV3Foam::updateInfoPatches
|
|||||||
);
|
);
|
||||||
if (iter != groups.end())
|
if (iter != groups.end())
|
||||||
{
|
{
|
||||||
iter().append(patchI);
|
iter().append(patchi);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
groups.insert(groupNames[groupI], labelList(1, patchI));
|
groups.insert(groupNames[groupI], labelList(1, patchi));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -432,14 +432,14 @@ void Foam::vtkPV3Foam::updateInfoPatches
|
|||||||
|
|
||||||
if (!reader_->GetShowGroupsOnly())
|
if (!reader_->GetShowGroupsOnly())
|
||||||
{
|
{
|
||||||
forAll(names, patchI)
|
forAll(names, patchi)
|
||||||
{
|
{
|
||||||
// Valid patch if nFace > 0 - add patch to GUI list
|
// Valid patch if nFace > 0 - add patch to GUI list
|
||||||
if (sizes[patchI])
|
if (sizes[patchi])
|
||||||
{
|
{
|
||||||
arraySelection->AddArray
|
arraySelection->AddArray
|
||||||
(
|
(
|
||||||
(names[patchI] + " - patch").c_str()
|
(names[patchi] + " - patch").c_str()
|
||||||
);
|
);
|
||||||
|
|
||||||
++nPatches;
|
++nPatches;
|
||||||
|
|||||||
@ -634,10 +634,10 @@ void Foam::vtkPVFoam::renderPatchNames
|
|||||||
|
|
||||||
// always remove old actors first
|
// always remove old actors first
|
||||||
|
|
||||||
forAll(patchTextActorsPtrs_, patchI)
|
forAll(patchTextActorsPtrs_, patchi)
|
||||||
{
|
{
|
||||||
renderer->RemoveViewProp(patchTextActorsPtrs_[patchI]);
|
renderer->RemoveViewProp(patchTextActorsPtrs_[patchi]);
|
||||||
patchTextActorsPtrs_[patchI]->Delete();
|
patchTextActorsPtrs_[patchi]->Delete();
|
||||||
}
|
}
|
||||||
patchTextActorsPtrs_.clear();
|
patchTextActorsPtrs_.clear();
|
||||||
|
|
||||||
@ -667,9 +667,9 @@ void Foam::vtkPVFoam::renderPatchNames
|
|||||||
|
|
||||||
|
|
||||||
// Loop through all patches to determine zones, and centre of each zone
|
// Loop through all patches to determine zones, and centre of each zone
|
||||||
forAll(pbMesh, patchI)
|
forAll(pbMesh, patchi)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = pbMesh[patchI];
|
const polyPatch& pp = pbMesh[patchi];
|
||||||
|
|
||||||
// Only include the patch if it is selected
|
// Only include the patch if it is selected
|
||||||
if (!selectedPatches.found(pp.name()))
|
if (!selectedPatches.found(pp.name()))
|
||||||
@ -701,27 +701,27 @@ void Foam::vtkPVFoam::renderPatchNames
|
|||||||
// Do topological analysis of patch, find disconnected regions
|
// Do topological analysis of patch, find disconnected regions
|
||||||
patchZones pZones(pp, featEdge);
|
patchZones pZones(pp, featEdge);
|
||||||
|
|
||||||
nZones[patchI] = pZones.nZones();
|
nZones[patchi] = pZones.nZones();
|
||||||
|
|
||||||
labelList zoneNFaces(pZones.nZones(), 0);
|
labelList zoneNFaces(pZones.nZones(), 0);
|
||||||
|
|
||||||
// Create storage for additional zone centres
|
// Create storage for additional zone centres
|
||||||
forAll(zoneNFaces, zoneI)
|
forAll(zoneNFaces, zoneI)
|
||||||
{
|
{
|
||||||
zoneCentre[patchI].append(Zero);
|
zoneCentre[patchi].append(Zero);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do averaging per individual zone
|
// Do averaging per individual zone
|
||||||
forAll(pp, faceI)
|
forAll(pp, faceI)
|
||||||
{
|
{
|
||||||
label zoneI = pZones[faceI];
|
label zoneI = pZones[faceI];
|
||||||
zoneCentre[patchI][zoneI] += pp[faceI].centre(pp.points());
|
zoneCentre[patchi][zoneI] += pp[faceI].centre(pp.points());
|
||||||
zoneNFaces[zoneI]++;
|
zoneNFaces[zoneI]++;
|
||||||
}
|
}
|
||||||
|
|
||||||
forAll(zoneCentre[patchI], zoneI)
|
forAll(zoneCentre[patchi], zoneI)
|
||||||
{
|
{
|
||||||
zoneCentre[patchI][zoneI] /= zoneNFaces[zoneI];
|
zoneCentre[patchi][zoneI] /= zoneNFaces[zoneI];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -732,9 +732,9 @@ void Foam::vtkPVFoam::renderPatchNames
|
|||||||
|
|
||||||
label displayZoneI = 0;
|
label displayZoneI = 0;
|
||||||
|
|
||||||
forAll(pbMesh, patchI)
|
forAll(pbMesh, patchi)
|
||||||
{
|
{
|
||||||
displayZoneI += min(MAXPATCHZONES, nZones[patchI]);
|
displayZoneI += min(MAXPATCHZONES, nZones[patchi]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
@ -754,18 +754,18 @@ void Foam::vtkPVFoam::renderPatchNames
|
|||||||
// Actor index
|
// Actor index
|
||||||
displayZoneI = 0;
|
displayZoneI = 0;
|
||||||
|
|
||||||
forAll(pbMesh, patchI)
|
forAll(pbMesh, patchi)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = pbMesh[patchI];
|
const polyPatch& pp = pbMesh[patchi];
|
||||||
|
|
||||||
label globalZoneI = 0;
|
label globalZoneI = 0;
|
||||||
|
|
||||||
// Only selected patches will have a non-zero number of zones
|
// Only selected patches will have a non-zero number of zones
|
||||||
label nDisplayZones = min(MAXPATCHZONES, nZones[patchI]);
|
label nDisplayZones = min(MAXPATCHZONES, nZones[patchi]);
|
||||||
label increment = 1;
|
label increment = 1;
|
||||||
if (nZones[patchI] >= MAXPATCHZONES)
|
if (nZones[patchi] >= MAXPATCHZONES)
|
||||||
{
|
{
|
||||||
increment = nZones[patchI]/MAXPATCHZONES;
|
increment = nZones[patchi]/MAXPATCHZONES;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (label i = 0; i < nDisplayZones; i++)
|
for (label i = 0; i < nDisplayZones; i++)
|
||||||
@ -773,7 +773,7 @@ void Foam::vtkPVFoam::renderPatchNames
|
|||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "patch name = " << pp.name() << nl
|
Info<< "patch name = " << pp.name() << nl
|
||||||
<< "anchor = " << zoneCentre[patchI][globalZoneI] << nl
|
<< "anchor = " << zoneCentre[patchi][globalZoneI] << nl
|
||||||
<< "globalZoneI = " << globalZoneI << endl;
|
<< "globalZoneI = " << globalZoneI << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -796,9 +796,9 @@ void Foam::vtkPVFoam::renderPatchNames
|
|||||||
|
|
||||||
txt->GetPositionCoordinate()->SetValue
|
txt->GetPositionCoordinate()->SetValue
|
||||||
(
|
(
|
||||||
zoneCentre[patchI][globalZoneI].x(),
|
zoneCentre[patchi][globalZoneI].x(),
|
||||||
zoneCentre[patchI][globalZoneI].y(),
|
zoneCentre[patchi][globalZoneI].y(),
|
||||||
zoneCentre[patchI][globalZoneI].z()
|
zoneCentre[patchi][globalZoneI].z()
|
||||||
);
|
);
|
||||||
|
|
||||||
// Add text to each renderer
|
// Add text to each renderer
|
||||||
|
|||||||
@ -295,9 +295,9 @@ void Foam::vtkPVFoam::updateInfoPatches
|
|||||||
|
|
||||||
if (!reader_->GetShowGroupsOnly())
|
if (!reader_->GetShowGroupsOnly())
|
||||||
{
|
{
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = patches[patchI];
|
const polyPatch& pp = patches[patchi];
|
||||||
|
|
||||||
if (pp.size())
|
if (pp.size())
|
||||||
{
|
{
|
||||||
@ -344,12 +344,12 @@ void Foam::vtkPVFoam::updateInfoPatches
|
|||||||
wordList names(patchEntries.size());
|
wordList names(patchEntries.size());
|
||||||
labelList sizes(patchEntries.size());
|
labelList sizes(patchEntries.size());
|
||||||
|
|
||||||
forAll(patchEntries, patchI)
|
forAll(patchEntries, patchi)
|
||||||
{
|
{
|
||||||
const dictionary& patchDict = patchEntries[patchI].dict();
|
const dictionary& patchDict = patchEntries[patchi].dict();
|
||||||
|
|
||||||
sizes[patchI] = readLabel(patchDict.lookup("nFaces"));
|
sizes[patchi] = readLabel(patchDict.lookup("nFaces"));
|
||||||
names[patchI] = patchEntries[patchI].keyword();
|
names[patchi] = patchEntries[patchi].keyword();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -358,9 +358,9 @@ void Foam::vtkPVFoam::updateInfoPatches
|
|||||||
|
|
||||||
HashTable<labelList, word> groups(patchEntries.size());
|
HashTable<labelList, word> groups(patchEntries.size());
|
||||||
|
|
||||||
forAll(patchEntries, patchI)
|
forAll(patchEntries, patchi)
|
||||||
{
|
{
|
||||||
const dictionary& patchDict = patchEntries[patchI].dict();
|
const dictionary& patchDict = patchEntries[patchi].dict();
|
||||||
|
|
||||||
wordList groupNames;
|
wordList groupNames;
|
||||||
patchDict.readIfPresent("inGroups", groupNames);
|
patchDict.readIfPresent("inGroups", groupNames);
|
||||||
@ -373,11 +373,11 @@ void Foam::vtkPVFoam::updateInfoPatches
|
|||||||
);
|
);
|
||||||
if (iter != groups.end())
|
if (iter != groups.end())
|
||||||
{
|
{
|
||||||
iter().append(patchI);
|
iter().append(patchi);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
groups.insert(groupNames[groupI], labelList(1, patchI));
|
groups.insert(groupNames[groupI], labelList(1, patchi));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -432,14 +432,14 @@ void Foam::vtkPVFoam::updateInfoPatches
|
|||||||
|
|
||||||
if (!reader_->GetShowGroupsOnly())
|
if (!reader_->GetShowGroupsOnly())
|
||||||
{
|
{
|
||||||
forAll(names, patchI)
|
forAll(names, patchi)
|
||||||
{
|
{
|
||||||
// Valid patch if nFace > 0 - add patch to GUI list
|
// Valid patch if nFace > 0 - add patch to GUI list
|
||||||
if (sizes[patchI])
|
if (sizes[patchi])
|
||||||
{
|
{
|
||||||
arraySelection->AddArray
|
arraySelection->AddArray
|
||||||
(
|
(
|
||||||
(names[patchI] + " - patch").c_str()
|
(names[patchi] + " - patch").c_str()
|
||||||
);
|
);
|
||||||
|
|
||||||
++nPatches;
|
++nPatches;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -243,9 +243,9 @@ Foam::channelIndex::channelIndex
|
|||||||
|
|
||||||
forAll(patchNames, i)
|
forAll(patchNames, i)
|
||||||
{
|
{
|
||||||
const label patchI = patches.findPatchID(patchNames[i]);
|
const label patchi = patches.findPatchID(patchNames[i]);
|
||||||
|
|
||||||
if (patchI == -1)
|
if (patchi == -1)
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Illegal patch " << patchNames[i]
|
<< "Illegal patch " << patchNames[i]
|
||||||
@ -253,7 +253,7 @@ Foam::channelIndex::channelIndex
|
|||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
nFaces += patches[patchI].size();
|
nFaces += patches[patchi].size();
|
||||||
}
|
}
|
||||||
|
|
||||||
labelList startFaces(nFaces);
|
labelList startFaces(nFaces);
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -114,14 +114,19 @@ int main(int argc, char *argv[])
|
|||||||
dimensionedScalar("V", mesh.V().dimensions(), 0.0),
|
dimensionedScalar("V", mesh.V().dimensions(), 0.0),
|
||||||
calculatedFvPatchField<scalar>::typeName
|
calculatedFvPatchField<scalar>::typeName
|
||||||
);
|
);
|
||||||
|
|
||||||
V.dimensionedInternalField() = mesh.V();
|
V.dimensionedInternalField() = mesh.V();
|
||||||
forAll(V.boundaryField(), patchI)
|
|
||||||
|
volScalarField::GeometricBoundaryField& Vbf = V.boundaryFieldRef();
|
||||||
|
|
||||||
|
forAll(Vbf, patchi)
|
||||||
{
|
{
|
||||||
V.boundaryField()[patchI] =
|
Vbf[patchi] = Vbf[patchi].patch().magSf();
|
||||||
V.boundaryField()[patchI].patch().magSf();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Info<< "Writing cellVolumes and patch faceAreas to " << V.name()
|
Info<< "Writing cellVolumes and patch faceAreas to " << V.name()
|
||||||
<< " in " << runTime.timeName() << endl;
|
<< " in " << runTime.timeName() << endl;
|
||||||
|
|
||||||
V.write();
|
V.write();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,7 +39,7 @@ void printAverage
|
|||||||
const fvMesh& mesh,
|
const fvMesh& mesh,
|
||||||
const IOobject& fieldHeader,
|
const IOobject& fieldHeader,
|
||||||
const scalar area,
|
const scalar area,
|
||||||
const label patchI,
|
const label patchi,
|
||||||
bool& done
|
bool& done
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -57,15 +57,15 @@ void printAverage
|
|||||||
{
|
{
|
||||||
sumField = gSum
|
sumField = gSum
|
||||||
(
|
(
|
||||||
mesh.magSf().boundaryField()[patchI]
|
mesh.magSf().boundaryField()[patchi]
|
||||||
* field.boundaryField()[patchI]
|
* field.boundaryField()[patchi]
|
||||||
) / area;
|
) / area;
|
||||||
}
|
}
|
||||||
|
|
||||||
Info<< " Average of " << fieldHeader.headerClassName()
|
Info<< " Average of " << fieldHeader.headerClassName()
|
||||||
<< " over patch "
|
<< " over patch "
|
||||||
<< mesh.boundary()[patchI].name()
|
<< mesh.boundary()[patchi].name()
|
||||||
<< '[' << patchI << ']' << " = "
|
<< '[' << patchi << ']' << " = "
|
||||||
<< sumField << endl;
|
<< sumField << endl;
|
||||||
|
|
||||||
done = true;
|
done = true;
|
||||||
@ -106,21 +106,21 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
mesh.readUpdate();
|
mesh.readUpdate();
|
||||||
|
|
||||||
const label patchI = mesh.boundaryMesh().findPatchID(patchName);
|
const label patchi = mesh.boundaryMesh().findPatchID(patchName);
|
||||||
if (patchI < 0)
|
if (patchi < 0)
|
||||||
{
|
{
|
||||||
FatalError
|
FatalError
|
||||||
<< "Unable to find patch " << patchName << nl
|
<< "Unable to find patch " << patchName << nl
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
scalar area = gSum(mesh.magSf().boundaryField()[patchI]);
|
scalar area = gSum(mesh.magSf().boundaryField()[patchi]);
|
||||||
|
|
||||||
bool done = false;
|
bool done = false;
|
||||||
printAverage<volScalarField>(mesh, io, area, patchI, done);
|
printAverage<volScalarField>(mesh, io, area, patchi, done);
|
||||||
printAverage<volVectorField>(mesh, io, area, patchI, done);
|
printAverage<volVectorField>(mesh, io, area, patchi, done);
|
||||||
printAverage<volSphericalTensorField>(mesh, io, area, patchI, done);
|
printAverage<volSphericalTensorField>(mesh, io, area, patchi, done);
|
||||||
printAverage<volSymmTensorField>(mesh, io, area, patchI, done);
|
printAverage<volSymmTensorField>(mesh, io, area, patchi, done);
|
||||||
printAverage<volTensorField>(mesh, io, area, patchI, done);
|
printAverage<volTensorField>(mesh, io, area, patchi, done);
|
||||||
|
|
||||||
if (!done)
|
if (!done)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -38,7 +38,7 @@ void printIntegrate
|
|||||||
(
|
(
|
||||||
const fvMesh& mesh,
|
const fvMesh& mesh,
|
||||||
const IOobject& fieldHeader,
|
const IOobject& fieldHeader,
|
||||||
const label patchI,
|
const label patchi,
|
||||||
bool& done
|
bool& done
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -51,21 +51,21 @@ void printIntegrate
|
|||||||
|
|
||||||
Info<< " Integral of " << fieldHeader.name()
|
Info<< " Integral of " << fieldHeader.name()
|
||||||
<< " over vector area of patch "
|
<< " over vector area of patch "
|
||||||
<< mesh.boundary()[patchI].name() << '[' << patchI << ']' << " = "
|
<< mesh.boundary()[patchi].name() << '[' << patchi << ']' << " = "
|
||||||
<< gSum
|
<< gSum
|
||||||
(
|
(
|
||||||
mesh.Sf().boundaryField()[patchI]
|
mesh.Sf().boundaryField()[patchi]
|
||||||
*field.boundaryField()[patchI]
|
*field.boundaryField()[patchi]
|
||||||
)
|
)
|
||||||
<< nl;
|
<< nl;
|
||||||
|
|
||||||
Info<< " Integral of " << fieldHeader.name()
|
Info<< " Integral of " << fieldHeader.name()
|
||||||
<< " over area magnitude of patch "
|
<< " over area magnitude of patch "
|
||||||
<< mesh.boundary()[patchI].name() << '[' << patchI << ']' << " = "
|
<< mesh.boundary()[patchi].name() << '[' << patchi << ']' << " = "
|
||||||
<< gSum
|
<< gSum
|
||||||
(
|
(
|
||||||
mesh.magSf().boundaryField()[patchI]
|
mesh.magSf().boundaryField()[patchi]
|
||||||
*field.boundaryField()[patchI]
|
*field.boundaryField()[patchi]
|
||||||
)
|
)
|
||||||
<< nl;
|
<< nl;
|
||||||
|
|
||||||
@ -79,7 +79,7 @@ void printSum
|
|||||||
(
|
(
|
||||||
const fvMesh& mesh,
|
const fvMesh& mesh,
|
||||||
const IOobject& fieldHeader,
|
const IOobject& fieldHeader,
|
||||||
const label patchI,
|
const label patchi,
|
||||||
bool& done
|
bool& done
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -91,11 +91,11 @@ void printSum
|
|||||||
FieldType field(fieldHeader, mesh);
|
FieldType field(fieldHeader, mesh);
|
||||||
typename FieldType::value_type sumField = gSum
|
typename FieldType::value_type sumField = gSum
|
||||||
(
|
(
|
||||||
field.boundaryField()[patchI]
|
field.boundaryField()[patchi]
|
||||||
);
|
);
|
||||||
|
|
||||||
Info<< " Integral of " << fieldHeader.name() << " over patch "
|
Info<< " Integral of " << fieldHeader.name() << " over patch "
|
||||||
<< mesh.boundary()[patchI].name() << '[' << patchI << ']' << " = "
|
<< mesh.boundary()[patchi].name() << '[' << patchi << ']' << " = "
|
||||||
<< sumField << nl;
|
<< sumField << nl;
|
||||||
|
|
||||||
done = true;
|
done = true;
|
||||||
@ -136,8 +136,8 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
mesh.readUpdate();
|
mesh.readUpdate();
|
||||||
|
|
||||||
const label patchI = mesh.boundaryMesh().findPatchID(patchName);
|
const label patchi = mesh.boundaryMesh().findPatchID(patchName);
|
||||||
if (patchI < 0)
|
if (patchi < 0)
|
||||||
{
|
{
|
||||||
FatalError
|
FatalError
|
||||||
<< "Unable to find patch " << patchName << nl
|
<< "Unable to find patch " << patchName << nl
|
||||||
@ -146,11 +146,11 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
// Give patch area
|
// Give patch area
|
||||||
Info<< " Area vector of patch "
|
Info<< " Area vector of patch "
|
||||||
<< patchName << '[' << patchI << ']' << " = "
|
<< patchName << '[' << patchi << ']' << " = "
|
||||||
<< gSum(mesh.Sf().boundaryField()[patchI]) << endl;
|
<< gSum(mesh.Sf().boundaryField()[patchi]) << endl;
|
||||||
Info<< " Area magnitude of patch "
|
Info<< " Area magnitude of patch "
|
||||||
<< patchName << '[' << patchI << ']' << " = "
|
<< patchName << '[' << patchi << ']' << " = "
|
||||||
<< gSum(mesh.magSf().boundaryField()[patchI]) << endl;
|
<< gSum(mesh.magSf().boundaryField()[patchi]) << endl;
|
||||||
|
|
||||||
// Read field and calc integral
|
// Read field and calc integral
|
||||||
bool done = false;
|
bool done = false;
|
||||||
@ -158,14 +158,14 @@ int main(int argc, char *argv[])
|
|||||||
(
|
(
|
||||||
mesh,
|
mesh,
|
||||||
fieldHeader,
|
fieldHeader,
|
||||||
patchI,
|
patchi,
|
||||||
done
|
done
|
||||||
);
|
);
|
||||||
printIntegrate<volVectorField>
|
printIntegrate<volVectorField>
|
||||||
(
|
(
|
||||||
mesh,
|
mesh,
|
||||||
fieldHeader,
|
fieldHeader,
|
||||||
patchI,
|
patchi,
|
||||||
done
|
done
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -174,21 +174,21 @@ int main(int argc, char *argv[])
|
|||||||
//(
|
//(
|
||||||
// mesh,
|
// mesh,
|
||||||
// fieldHeader,
|
// fieldHeader,
|
||||||
// patchI,
|
// patchi,
|
||||||
// done
|
// done
|
||||||
//);
|
//);
|
||||||
//printIntegrate<volSymmTensorField>
|
//printIntegrate<volSymmTensorField>
|
||||||
//(
|
//(
|
||||||
// mesh,
|
// mesh,
|
||||||
// fieldHeader,
|
// fieldHeader,
|
||||||
// patchI,
|
// patchi,
|
||||||
// done
|
// done
|
||||||
//);
|
//);
|
||||||
//printIntegrate<volTensorField>
|
//printIntegrate<volTensorField>
|
||||||
//(
|
//(
|
||||||
// mesh,
|
// mesh,
|
||||||
// fieldHeader,
|
// fieldHeader,
|
||||||
// patchI,
|
// patchi,
|
||||||
// done
|
// done
|
||||||
//);
|
//);
|
||||||
|
|
||||||
@ -196,35 +196,35 @@ int main(int argc, char *argv[])
|
|||||||
(
|
(
|
||||||
mesh,
|
mesh,
|
||||||
fieldHeader,
|
fieldHeader,
|
||||||
patchI,
|
patchi,
|
||||||
done
|
done
|
||||||
);
|
);
|
||||||
printSum<surfaceVectorField>
|
printSum<surfaceVectorField>
|
||||||
(
|
(
|
||||||
mesh,
|
mesh,
|
||||||
fieldHeader,
|
fieldHeader,
|
||||||
patchI,
|
patchi,
|
||||||
done
|
done
|
||||||
);
|
);
|
||||||
printSum<volSphericalTensorField>
|
printSum<volSphericalTensorField>
|
||||||
(
|
(
|
||||||
mesh,
|
mesh,
|
||||||
fieldHeader,
|
fieldHeader,
|
||||||
patchI,
|
patchi,
|
||||||
done
|
done
|
||||||
);
|
);
|
||||||
printSum<volSymmTensorField>
|
printSum<volSymmTensorField>
|
||||||
(
|
(
|
||||||
mesh,
|
mesh,
|
||||||
fieldHeader,
|
fieldHeader,
|
||||||
patchI,
|
patchi,
|
||||||
done
|
done
|
||||||
);
|
);
|
||||||
printSum<volTensorField>
|
printSum<volTensorField>
|
||||||
(
|
(
|
||||||
mesh,
|
mesh,
|
||||||
fieldHeader,
|
fieldHeader,
|
||||||
patchI,
|
patchi,
|
||||||
done
|
done
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -192,12 +192,15 @@ int main(int argc, char *argv[])
|
|||||||
0.0*sigma.component(symmTensor::YZ)
|
0.0*sigma.component(symmTensor::YZ)
|
||||||
);
|
);
|
||||||
|
|
||||||
forAll(sigmaUn.boundaryField(), patchI)
|
volScalarField::GeometricBoundaryField& sigmaUnBf =
|
||||||
|
sigmaUn.boundaryFieldRef();
|
||||||
|
|
||||||
|
forAll(sigmaUn.boundaryField(), patchi)
|
||||||
{
|
{
|
||||||
sigmaUn.boundaryField()[patchI] =
|
sigmaUnBf[patchi] =
|
||||||
(
|
(
|
||||||
mesh.boundary()[patchI].nf()
|
mesh.boundary()[patchi].nf()
|
||||||
& sigma.boundaryField()[patchI]
|
& sigma.boundaryField()[patchi]
|
||||||
)().component(vector::X);
|
)().component(vector::X);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -147,17 +147,17 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
found = false;
|
found = false;
|
||||||
|
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
const primitivePatch& bouFaces = patches[patchI];
|
const primitivePatch& bouFaces = patches[patchi];
|
||||||
|
|
||||||
if (!isType<emptyPolyPatch>(patches[patchI]))
|
if (!isType<emptyPolyPatch>(patches[patchi]))
|
||||||
{
|
{
|
||||||
forAll(bouFaces, faceI)
|
forAll(bouFaces, faceI)
|
||||||
{
|
{
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
magSqr(phi.boundaryField()[patchI][faceI])
|
magSqr(phi.boundaryField()[patchi][faceI])
|
||||||
< SMALL
|
< SMALL
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -177,7 +177,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (found)
|
if (found)
|
||||||
{
|
{
|
||||||
Info<< "Zero face: patch: " << patchI
|
Info<< "Zero face: patch: " << patchi
|
||||||
<< " face: " << faceI << endl;
|
<< " face: " << faceI << endl;
|
||||||
|
|
||||||
forAll(zeroPoints, pointI)
|
forAll(zeroPoints, pointI)
|
||||||
@ -471,7 +471,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
// Normalise the stream-function by the 2D mesh thickness
|
// Normalise the stream-function by the 2D mesh thickness
|
||||||
streamFunction /= thickness;
|
streamFunction /= thickness;
|
||||||
streamFunction.boundaryField() = 0.0;
|
streamFunction.boundaryFieldRef() = 0.0;
|
||||||
streamFunction.write();
|
streamFunction.write();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -88,16 +88,18 @@ int main(int argc, char *argv[])
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
volVectorField::GeometricBoundaryField& wallGradUBf =
|
||||||
|
wallGradU.boundaryFieldRef();
|
||||||
|
|
||||||
const fvPatchList& patches = mesh.boundary();
|
const fvPatchList& patches = mesh.boundary();
|
||||||
|
|
||||||
forAll(wallGradU.boundaryField(), patchi)
|
forAll(wallGradUBf, patchi)
|
||||||
{
|
{
|
||||||
const fvPatch& currPatch = patches[patchi];
|
const fvPatch& currPatch = patches[patchi];
|
||||||
|
|
||||||
if (isA<wallFvPatch>(currPatch))
|
if (isA<wallFvPatch>(currPatch))
|
||||||
{
|
{
|
||||||
wallGradU.boundaryField()[patchi] =
|
wallGradUBf[patchi] = -U.boundaryField()[patchi].snGrad();
|
||||||
-U.boundaryField()[patchi].snGrad();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -104,9 +104,12 @@ int main(int argc, char *argv[])
|
|||||||
dimensionedScalar("wallHeatFlux", heatFlux.dimensions(), 0.0)
|
dimensionedScalar("wallHeatFlux", heatFlux.dimensions(), 0.0)
|
||||||
);
|
);
|
||||||
|
|
||||||
forAll(wallHeatFlux.boundaryField(), patchi)
|
volScalarField::GeometricBoundaryField& wallHeatFluxBf =
|
||||||
|
wallHeatFlux.boundaryFieldRef();
|
||||||
|
|
||||||
|
forAll(wallHeatFluxBf, patchi)
|
||||||
{
|
{
|
||||||
wallHeatFlux.boundaryField()[patchi] = patchHeatFlux[patchi];
|
wallHeatFluxBf[patchi] = patchHeatFlux[patchi];
|
||||||
}
|
}
|
||||||
|
|
||||||
wallHeatFlux.write();
|
wallHeatFlux.write();
|
||||||
@ -132,9 +135,12 @@ int main(int argc, char *argv[])
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
forAll(totalWallHeatFlux.boundaryField(), patchi)
|
volScalarField::GeometricBoundaryField& totalWallHeatFluxBf =
|
||||||
|
totalWallHeatFlux.boundaryFieldRef();
|
||||||
|
|
||||||
|
forAll(totalWallHeatFluxBf, patchi)
|
||||||
{
|
{
|
||||||
totalWallHeatFlux.boundaryField()[patchi] =
|
totalWallHeatFluxBf[patchi] =
|
||||||
patchHeatFlux[patchi] - patchRadHeatFlux[patchi];
|
patchHeatFlux[patchi] - patchRadHeatFlux[patchi];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -60,13 +60,16 @@ void calcIncompressible
|
|||||||
|
|
||||||
const volSymmTensorField Reff(model->devReff());
|
const volSymmTensorField Reff(model->devReff());
|
||||||
|
|
||||||
forAll(wallShearStress.boundaryField(), patchI)
|
volVectorField::GeometricBoundaryField& wallShearStressBf =
|
||||||
|
wallShearStress.boundaryFieldRef();
|
||||||
|
|
||||||
|
forAll(wallShearStressBf, patchi)
|
||||||
{
|
{
|
||||||
wallShearStress.boundaryField()[patchI] =
|
wallShearStressBf[patchi] =
|
||||||
(
|
(
|
||||||
-mesh.Sf().boundaryField()[patchI]
|
-mesh.Sf().boundaryField()[patchi]
|
||||||
/mesh.magSf().boundaryField()[patchI]
|
/mesh.magSf().boundaryField()[patchi]
|
||||||
) & Reff.boundaryField()[patchI];
|
) & Reff.boundaryField()[patchi];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -109,13 +112,16 @@ void calcCompressible
|
|||||||
|
|
||||||
const volSymmTensorField Reff(model->devRhoReff());
|
const volSymmTensorField Reff(model->devRhoReff());
|
||||||
|
|
||||||
forAll(wallShearStress.boundaryField(), patchI)
|
volVectorField::GeometricBoundaryField& wallShearStressBf =
|
||||||
|
wallShearStress.boundaryFieldRef();
|
||||||
|
|
||||||
|
forAll(wallShearStressBf, patchi)
|
||||||
{
|
{
|
||||||
wallShearStress.boundaryField()[patchI] =
|
wallShearStressBf[patchi] =
|
||||||
(
|
(
|
||||||
-mesh.Sf().boundaryField()[patchI]
|
-mesh.Sf().boundaryField()[patchi]
|
||||||
/mesh.magSf().boundaryField()[patchI]
|
/mesh.magSf().boundaryField()[patchi]
|
||||||
) & Reff.boundaryField()[patchI];
|
) & Reff.boundaryField()[patchi];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -68,6 +68,9 @@ void calcYPlus
|
|||||||
const volScalarField::GeometricBoundaryField nuBf =
|
const volScalarField::GeometricBoundaryField nuBf =
|
||||||
turbulenceModel->nu()().boundaryField();
|
turbulenceModel->nu()().boundaryField();
|
||||||
|
|
||||||
|
volScalarField::GeometricBoundaryField& yPlusBf =
|
||||||
|
yPlus.boundaryFieldRef();
|
||||||
|
|
||||||
const fvPatchList& patches = mesh.boundary();
|
const fvPatchList& patches = mesh.boundary();
|
||||||
|
|
||||||
forAll(patches, patchi)
|
forAll(patches, patchi)
|
||||||
@ -82,7 +85,7 @@ void calcYPlus
|
|||||||
nutBf[patchi]
|
nutBf[patchi]
|
||||||
);
|
);
|
||||||
|
|
||||||
yPlus.boundaryField()[patchi] = nutPf.yPlus();
|
yPlusBf[patchi] = nutPf.yPlus();
|
||||||
const scalarField& Yp = yPlus.boundaryField()[patchi];
|
const scalarField& Yp = yPlus.boundaryField()[patchi];
|
||||||
|
|
||||||
Info<< "Patch " << patchi
|
Info<< "Patch " << patchi
|
||||||
@ -93,7 +96,7 @@ void calcYPlus
|
|||||||
}
|
}
|
||||||
else if (isA<wallFvPatch>(patch))
|
else if (isA<wallFvPatch>(patch))
|
||||||
{
|
{
|
||||||
yPlus.boundaryField()[patchi] =
|
yPlusBf[patchi] =
|
||||||
d[patchi]
|
d[patchi]
|
||||||
*sqrt
|
*sqrt
|
||||||
(
|
(
|
||||||
|
|||||||
@ -55,9 +55,9 @@ void processField
|
|||||||
const typename fieldType::GeometricBoundaryField& bf =
|
const typename fieldType::GeometricBoundaryField& bf =
|
||||||
vtf.boundaryField();
|
vtf.boundaryField();
|
||||||
|
|
||||||
forAll(bf, patchI)
|
forAll(bf, patchi)
|
||||||
{
|
{
|
||||||
if (isA<externalCoupledMixedFvPatchField<Type>>(bf[patchI]))
|
if (isA<externalCoupledMixedFvPatchField<Type>>(bf[patchi]))
|
||||||
{
|
{
|
||||||
Info<< "Generating external coupled geometry for field "
|
Info<< "Generating external coupled geometry for field "
|
||||||
<< fieldName << endl;
|
<< fieldName << endl;
|
||||||
@ -65,7 +65,7 @@ void processField
|
|||||||
const externalCoupledMixedFvPatchField<Type>& pf =
|
const externalCoupledMixedFvPatchField<Type>& pf =
|
||||||
refCast<const externalCoupledMixedFvPatchField<Type>>
|
refCast<const externalCoupledMixedFvPatchField<Type>>
|
||||||
(
|
(
|
||||||
bf[patchI]
|
bf[patchi]
|
||||||
);
|
);
|
||||||
|
|
||||||
pf.writeGeometry();
|
pf.writeGeometry();
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -84,11 +84,11 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
forAllConstIter(dictionary, agglomDict, iter)
|
forAllConstIter(dictionary, agglomDict, iter)
|
||||||
{
|
{
|
||||||
labelList patchIds = boundary.findIndices(iter().keyword());
|
labelList patchids = boundary.findIndices(iter().keyword());
|
||||||
forAll(patchIds, i)
|
forAll(patchids, i)
|
||||||
{
|
{
|
||||||
label patchI = patchIds[i];
|
label patchi = patchids[i];
|
||||||
const polyPatch& pp = boundary[patchI];
|
const polyPatch& pp = boundary[patchi];
|
||||||
if (!pp.coupled())
|
if (!pp.coupled())
|
||||||
{
|
{
|
||||||
Info << "\nAgglomerating patch : " << pp.name() << endl;
|
Info << "\nAgglomerating patch : " << pp.name() << endl;
|
||||||
@ -98,12 +98,12 @@ int main(int argc, char *argv[])
|
|||||||
agglomDict.subDict(pp.name())
|
agglomDict.subDict(pp.name())
|
||||||
);
|
);
|
||||||
agglomObject.agglomerate();
|
agglomObject.agglomerate();
|
||||||
finalAgglom[patchI] =
|
finalAgglom[patchi] =
|
||||||
agglomObject.restrictTopBottomAddressing();
|
agglomObject.restrictTopBottomAddressing();
|
||||||
|
|
||||||
if (finalAgglom[patchI].size())
|
if (finalAgglom[patchi].size())
|
||||||
{
|
{
|
||||||
nCoarseFaces += max(finalAgglom[patchI] + 1);
|
nCoarseFaces += max(finalAgglom[patchi] + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -111,40 +111,40 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
|
|
||||||
// - All patches which are not agglomarated are identity for finalAgglom
|
// - All patches which are not agglomarated are identity for finalAgglom
|
||||||
forAll(boundary, patchId)
|
forAll(boundary, patchid)
|
||||||
{
|
{
|
||||||
if (finalAgglom[patchId].size() == 0)
|
if (finalAgglom[patchid].size() == 0)
|
||||||
{
|
{
|
||||||
finalAgglom[patchId] = identity(boundary[patchId].size());
|
finalAgglom[patchid] = identity(boundary[patchid].size());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sync agglomeration across coupled patches
|
// Sync agglomeration across coupled patches
|
||||||
labelList nbrAgglom(mesh.nFaces() - mesh.nInternalFaces(), -1);
|
labelList nbrAgglom(mesh.nFaces() - mesh.nInternalFaces(), -1);
|
||||||
|
|
||||||
forAll(boundary, patchId)
|
forAll(boundary, patchid)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = boundary[patchId];
|
const polyPatch& pp = boundary[patchid];
|
||||||
if (pp.coupled())
|
if (pp.coupled())
|
||||||
{
|
{
|
||||||
finalAgglom[patchId] = identity(pp.size());
|
finalAgglom[patchid] = identity(pp.size());
|
||||||
forAll(pp, i)
|
forAll(pp, i)
|
||||||
{
|
{
|
||||||
nbrAgglom[pp.start() - mesh.nInternalFaces() + i] =
|
nbrAgglom[pp.start() - mesh.nInternalFaces() + i] =
|
||||||
finalAgglom[patchId][i];
|
finalAgglom[patchid][i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
syncTools::swapBoundaryFaceList(mesh, nbrAgglom);
|
syncTools::swapBoundaryFaceList(mesh, nbrAgglom);
|
||||||
forAll(boundary, patchId)
|
forAll(boundary, patchid)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = boundary[patchId];
|
const polyPatch& pp = boundary[patchid];
|
||||||
if (pp.coupled() && !refCast<const coupledPolyPatch>(pp).owner())
|
if (pp.coupled() && !refCast<const coupledPolyPatch>(pp).owner())
|
||||||
{
|
{
|
||||||
forAll(pp, i)
|
forAll(pp, i)
|
||||||
{
|
{
|
||||||
finalAgglom[patchId][i] =
|
finalAgglom[patchid][i] =
|
||||||
nbrAgglom[pp.start() - mesh.nInternalFaces() + i];
|
nbrAgglom[pp.start() - mesh.nInternalFaces() + i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -169,14 +169,17 @@ int main(int argc, char *argv[])
|
|||||||
dimensionedScalar("facesAgglomeration", dimless, 0)
|
dimensionedScalar("facesAgglomeration", dimless, 0)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
volScalarField::GeometricBoundaryField& facesAgglomerationBf =
|
||||||
|
facesAgglomeration.boundaryFieldRef();
|
||||||
|
|
||||||
label coarsePatchIndex = 0;
|
label coarsePatchIndex = 0;
|
||||||
forAll(boundary, patchId)
|
forAll(boundary, patchid)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = boundary[patchId];
|
const polyPatch& pp = boundary[patchid];
|
||||||
if (pp.size() > 0)
|
if (pp.size() > 0)
|
||||||
{
|
{
|
||||||
fvPatchScalarField& bFacesAgglomeration =
|
fvPatchScalarField& bFacesAgglomeration =
|
||||||
facesAgglomeration.boundaryField()[patchId];
|
facesAgglomerationBf[patchid];
|
||||||
|
|
||||||
forAll(bFacesAgglomeration, j)
|
forAll(bFacesAgglomeration, j)
|
||||||
{
|
{
|
||||||
@ -184,11 +187,11 @@ int main(int argc, char *argv[])
|
|||||||
index.toGlobal
|
index.toGlobal
|
||||||
(
|
(
|
||||||
Pstream::myProcNo(),
|
Pstream::myProcNo(),
|
||||||
finalAgglom[patchId][j] + coarsePatchIndex
|
finalAgglom[patchid][j] + coarsePatchIndex
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
coarsePatchIndex += max(finalAgglom[patchId]) + 1;
|
coarsePatchIndex += max(finalAgglom[patchid]) + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -87,15 +87,15 @@ void rewriteBoundary
|
|||||||
|
|
||||||
// Replace any 'cyclic'
|
// Replace any 'cyclic'
|
||||||
label nOldCyclics = 0;
|
label nOldCyclics = 0;
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
const dictionary& patchDict = patches[patchI].dict();
|
const dictionary& patchDict = patches[patchi].dict();
|
||||||
|
|
||||||
if (word(patchDict["type"]) == cyclicPolyPatch::typeName)
|
if (word(patchDict["type"]) == cyclicPolyPatch::typeName)
|
||||||
{
|
{
|
||||||
if (!patchDict.found("neighbourPatch"))
|
if (!patchDict.found("neighbourPatch"))
|
||||||
{
|
{
|
||||||
Info<< "Patch " << patches[patchI].keyword()
|
Info<< "Patch " << patches[patchi].keyword()
|
||||||
<< " does not have 'neighbourPatch' entry; assuming it"
|
<< " does not have 'neighbourPatch' entry; assuming it"
|
||||||
<< " is of the old type." << endl;
|
<< " is of the old type." << endl;
|
||||||
nOldCyclics++;
|
nOldCyclics++;
|
||||||
@ -120,21 +120,21 @@ void rewriteBoundary
|
|||||||
// Add new entries
|
// Add new entries
|
||||||
label addedPatchI = nOldPatches;
|
label addedPatchI = nOldPatches;
|
||||||
label newPatchI = 0;
|
label newPatchI = 0;
|
||||||
forAll(oldPatches, patchI)
|
forAll(oldPatches, patchi)
|
||||||
{
|
{
|
||||||
const dictionary& patchDict = oldPatches[patchI].dict();
|
const dictionary& patchDict = oldPatches[patchi].dict();
|
||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
word(patchDict["type"]) == cyclicPolyPatch::typeName
|
word(patchDict["type"]) == cyclicPolyPatch::typeName
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const word& name = oldPatches[patchI].keyword();
|
const word& name = oldPatches[patchi].keyword();
|
||||||
|
|
||||||
if (patchDict.found("neighbourPatch"))
|
if (patchDict.found("neighbourPatch"))
|
||||||
{
|
{
|
||||||
patches.set(patchI, oldPatches.set(patchI, NULL));
|
patches.set(patchi, oldPatches.set(patchi, NULL));
|
||||||
oldToNew[patchI] = newPatchI++;
|
oldToNew[patchi] = newPatchI++;
|
||||||
|
|
||||||
// Check if patches come from automatic conversion
|
// Check if patches come from automatic conversion
|
||||||
word oldName;
|
word oldName;
|
||||||
@ -178,15 +178,15 @@ void rewriteBoundary
|
|||||||
nbrNames.insert(name, nbrName);
|
nbrNames.insert(name, nbrName);
|
||||||
|
|
||||||
// Save current dictionary
|
// Save current dictionary
|
||||||
const dictionary patchDict(patches[patchI].dict());
|
const dictionary patchDict(patches[patchi].dict());
|
||||||
|
|
||||||
// Change entry on this side
|
// Change entry on this side
|
||||||
patches.set(patchI, oldPatches.set(patchI, NULL));
|
patches.set(patchi, oldPatches.set(patchi, NULL));
|
||||||
oldToNew[patchI] = newPatchI++;
|
oldToNew[patchi] = newPatchI++;
|
||||||
dictionary& thisPatchDict = patches[patchI].dict();
|
dictionary& thisPatchDict = patches[patchi].dict();
|
||||||
thisPatchDict.add("neighbourPatch", nbrName);
|
thisPatchDict.add("neighbourPatch", nbrName);
|
||||||
thisPatchDict.set("nFaces", nFaces/2);
|
thisPatchDict.set("nFaces", nFaces/2);
|
||||||
patches[patchI].keyword() = thisName;
|
patches[patchi].keyword() = thisName;
|
||||||
|
|
||||||
// Add entry on other side
|
// Add entry on other side
|
||||||
patches.set
|
patches.set
|
||||||
@ -207,7 +207,7 @@ void rewriteBoundary
|
|||||||
patches[addedPatchI].keyword() = nbrName;
|
patches[addedPatchI].keyword() = nbrName;
|
||||||
|
|
||||||
Info<< "Replaced with patches" << nl
|
Info<< "Replaced with patches" << nl
|
||||||
<< patches[patchI].keyword() << " with" << nl
|
<< patches[patchi].keyword() << " with" << nl
|
||||||
<< " nFaces : "
|
<< " nFaces : "
|
||||||
<< readLabel(thisPatchDict.lookup("nFaces"))
|
<< readLabel(thisPatchDict.lookup("nFaces"))
|
||||||
<< nl
|
<< nl
|
||||||
@ -226,8 +226,8 @@ void rewriteBoundary
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
patches.set(patchI, oldPatches.set(patchI, NULL));
|
patches.set(patchi, oldPatches.set(patchi, NULL));
|
||||||
oldToNew[patchI] = newPatchI++;
|
oldToNew[patchi] = newPatchI++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -133,11 +133,11 @@ wordList addProcessorPatches
|
|||||||
|
|
||||||
const polyBoundaryMesh& pbm = meshTarget.boundaryMesh();
|
const polyBoundaryMesh& pbm = meshTarget.boundaryMesh();
|
||||||
|
|
||||||
forAll(pbm, patchI)
|
forAll(pbm, patchi)
|
||||||
{
|
{
|
||||||
if (isA<processorPolyPatch>(pbm[patchI]))
|
if (isA<processorPolyPatch>(pbm[patchi]))
|
||||||
{
|
{
|
||||||
const word& patchName = pbm[patchI].name();
|
const word& patchName = pbm[patchi].name();
|
||||||
cuttingPatchTable.insert(patchName);
|
cuttingPatchTable.insert(patchName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -98,10 +98,12 @@ bool setCellFieldType
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
typename GeometricField<Type, fvPatchField, volMesh>::
|
||||||
|
GeometricBoundaryField& fieldBf = field.boundaryFieldRef();
|
||||||
|
|
||||||
forAll(field.boundaryField(), patchi)
|
forAll(field.boundaryField(), patchi)
|
||||||
{
|
{
|
||||||
field.boundaryField()[patchi] =
|
fieldBf[patchi] = fieldBf[patchi].patchInternalField();
|
||||||
field.boundaryField()[patchi].patchInternalField();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!field.write())
|
if (!field.write())
|
||||||
@ -274,6 +276,9 @@ bool setFaceFieldType
|
|||||||
Pstream::listCombineGather(nChanged, plusEqOp<label>());
|
Pstream::listCombineGather(nChanged, plusEqOp<label>());
|
||||||
Pstream::listCombineScatter(nChanged);
|
Pstream::listCombineScatter(nChanged);
|
||||||
|
|
||||||
|
typename GeometricField<Type, fvPatchField, volMesh>::
|
||||||
|
GeometricBoundaryField& fieldBf = field.boundaryFieldRef();
|
||||||
|
|
||||||
// Reassign.
|
// Reassign.
|
||||||
forAll(field.boundaryField(), patchi)
|
forAll(field.boundaryField(), patchi)
|
||||||
{
|
{
|
||||||
@ -282,11 +287,11 @@ bool setFaceFieldType
|
|||||||
Info<< " On patch "
|
Info<< " On patch "
|
||||||
<< field.boundaryField()[patchi].patch().name()
|
<< field.boundaryField()[patchi].patch().name()
|
||||||
<< " set " << nChanged[patchi] << " values" << endl;
|
<< " set " << nChanged[patchi] << " values" << endl;
|
||||||
field.boundaryField()[patchi] == SubField<Type>
|
fieldBf[patchi] == SubField<Type>
|
||||||
(
|
(
|
||||||
allBoundaryValues,
|
allBoundaryValues,
|
||||||
field.boundaryField()[patchi].size(),
|
fieldBf[patchi].size(),
|
||||||
field.boundaryField()[patchi].patch().start()
|
fieldBf[patchi].patch().start()
|
||||||
- mesh.nInternalFaces()
|
- mesh.nInternalFaces()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,9 +24,9 @@ dict.add
|
|||||||
dict.add("mergeDistance", SMALL);
|
dict.add("mergeDistance", SMALL);
|
||||||
|
|
||||||
labelHashSet includePatches;
|
labelHashSet includePatches;
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = patches[patchI];
|
const polyPatch& pp = patches[patchi];
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
!pp.coupled()
|
!pp.coupled()
|
||||||
@ -34,7 +34,7 @@ forAll(patches, patchI)
|
|||||||
&& !isA<emptyPolyPatch>(pp)
|
&& !isA<emptyPolyPatch>(pp)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
includePatches.insert(patchI);
|
includePatches.insert(patchi);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user