mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: fvMesh: add construct from cellShape
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -58,6 +58,58 @@ int main(int argc, char *argv[])
|
||||
|
||||
Info<< Cf << endl;
|
||||
|
||||
// Test construct from cellShapes
|
||||
{
|
||||
pointField points(mesh.points());
|
||||
cellShapeList shapes(mesh.cellShapes());
|
||||
|
||||
const polyBoundaryMesh& pbm = mesh.boundaryMesh();
|
||||
|
||||
faceListList boundaryFaces(pbm.size());
|
||||
forAll(pbm, patchI)
|
||||
{
|
||||
boundaryFaces[patchI] = pbm[patchI];
|
||||
}
|
||||
wordList boundaryPatchNames(pbm.names());
|
||||
PtrList<dictionary> boundaryDicts(pbm.size());
|
||||
forAll(pbm, patchI)
|
||||
{
|
||||
OStringStream os;
|
||||
os << pbm[patchI];
|
||||
IStringStream is(os.str());
|
||||
boundaryDicts.set(patchI, new dictionary(is));
|
||||
}
|
||||
|
||||
word defaultBoundaryPatchName = "defaultFaces";
|
||||
word defaultBoundaryPatchType = emptyPolyPatch::typeName;
|
||||
|
||||
fvMesh newMesh
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"newMesh",
|
||||
runTime.timeName(),
|
||||
runTime,
|
||||
Foam::IOobject::NO_READ
|
||||
),
|
||||
Xfer<pointField>(points),
|
||||
shapes,
|
||||
boundaryFaces,
|
||||
boundaryPatchNames,
|
||||
boundaryDicts,
|
||||
defaultBoundaryPatchName,
|
||||
defaultBoundaryPatchType
|
||||
);
|
||||
|
||||
Info<< newMesh.C() << endl;
|
||||
Info<< newMesh.V() << endl;
|
||||
|
||||
surfaceVectorField Cf = newMesh.Cf();
|
||||
|
||||
Info<< Cf << endl;
|
||||
}
|
||||
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user