mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-12-28 03:37:59 +00:00
ENH: mirrorMesh: Added support for cellLevel and pointLevel to support dynamic mesh refinement
Patch contributed by Mattijs Janssens Resolves bug-report https://bugs.openfoam.org/view.php?id=2712
This commit is contained in:
committed by
Andrew Heather
parent
798ac98aef
commit
3e19185f10
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -42,8 +42,7 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
),
|
||||
mirrorMeshPtr_(nullptr)
|
||||
)
|
||||
{
|
||||
plane mirrorPlane(mirrorMeshDict_);
|
||||
|
||||
@ -108,6 +107,21 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
|
||||
Info<< " New points: " << nNewPoints << endl;
|
||||
newPoints.setSize(nNewPoints);
|
||||
|
||||
// Construct new to old map
|
||||
pointMapPtr_.reset(new labelList(newPoints.size()));
|
||||
labelList& pointMap = pointMapPtr_();
|
||||
// Insert old points
|
||||
forAll(oldPoints, oldPointi)
|
||||
{
|
||||
pointMap[oldPointi] = oldPointi;
|
||||
}
|
||||
forAll(mirrorPointLookup, oldPointi)
|
||||
{
|
||||
pointMap[mirrorPointLookup[oldPointi]] = oldPointi;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Info<< "Mirroring faces. Old faces: " << oldFaces.size();
|
||||
|
||||
// Algorithm:
|
||||
@ -317,6 +331,10 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
|
||||
cellList newCells(2*oldCells.size());
|
||||
label nNewCells = 0;
|
||||
|
||||
// Construct new to old cell map
|
||||
cellMapPtr_.reset(new labelList(newCells.size()));
|
||||
labelList& cellMap = cellMapPtr_();
|
||||
|
||||
// Grab the original cells. Take care of face renumbering.
|
||||
forAll(oldCells, celli)
|
||||
{
|
||||
@ -330,6 +348,8 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
|
||||
nc[i] = masterFaceLookup[oc[i]];
|
||||
}
|
||||
|
||||
cellMap[nNewCells] = celli;
|
||||
|
||||
nNewCells++;
|
||||
}
|
||||
|
||||
@ -346,6 +366,8 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
|
||||
nc[i] = mirrorFaceLookup[oc[i]];
|
||||
}
|
||||
|
||||
cellMap[nNewCells] = celli;
|
||||
|
||||
nNewCells++;
|
||||
}
|
||||
|
||||
@ -361,7 +383,7 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
|
||||
std::move(newCells)
|
||||
);
|
||||
|
||||
fvMesh& pMesh = *mirrorMeshPtr_;
|
||||
fvMesh& pMesh = mirrorMeshPtr_();
|
||||
|
||||
// Add the boundary patches
|
||||
List<polyPatch*> p(newPatchSizes.size());
|
||||
|
||||
Reference in New Issue
Block a user