polyTopoChangeMap: Renamed from mapPolyMesh to clarify purpose and scope
The polyTopoChangeMap is the map specifically relating to polyMesh topological changes generated by polyTopoChange and used to update and map mesh related types and fields following the topo-change.
This commit is contained in:
@ -162,7 +162,7 @@ void Foam::fv::VoFClouds::preUpdateMesh()
|
||||
}
|
||||
|
||||
|
||||
void Foam::fv::VoFClouds::updateMesh(const mapPolyMesh&)
|
||||
void Foam::fv::VoFClouds::updateMesh(const polyTopoChangeMap&)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -149,7 +149,7 @@ public:
|
||||
virtual void preUpdateMesh();
|
||||
|
||||
//- Update for mesh changes
|
||||
virtual void updateMesh(const mapPolyMesh&);
|
||||
virtual void updateMesh(const polyTopoChangeMap&);
|
||||
|
||||
//- Update mesh corresponding to the given distribution map
|
||||
virtual void distribute(const polyMeshDistributionMap&);
|
||||
|
||||
@ -224,7 +224,7 @@ void Foam::fv::VoFSolidificationMeltingSource::correct()
|
||||
|
||||
void Foam::fv::VoFSolidificationMeltingSource::updateMesh
|
||||
(
|
||||
const mapPolyMesh& map
|
||||
const polyTopoChangeMap& map
|
||||
)
|
||||
{
|
||||
set_.updateMesh(map);
|
||||
|
||||
@ -191,7 +191,7 @@ public:
|
||||
// Mesh motion
|
||||
|
||||
//- Update for mesh changes
|
||||
virtual void updateMesh(const mapPolyMesh&);
|
||||
virtual void updateMesh(const polyTopoChangeMap&);
|
||||
|
||||
//- Update mesh corresponding to the given distribution map
|
||||
virtual void distribute(const polyMeshDistributionMap&);
|
||||
|
||||
@ -153,7 +153,7 @@ void Foam::fv::VoFSurfaceFilm::addSup
|
||||
}
|
||||
|
||||
|
||||
void Foam::fv::VoFSurfaceFilm::updateMesh(const mapPolyMesh&)
|
||||
void Foam::fv::VoFSurfaceFilm::updateMesh(const polyTopoChangeMap&)
|
||||
{
|
||||
NotImplemented;
|
||||
}
|
||||
|
||||
@ -136,7 +136,7 @@ public:
|
||||
// Mesh changes
|
||||
|
||||
//- Update for mesh changes
|
||||
virtual void updateMesh(const mapPolyMesh&);
|
||||
virtual void updateMesh(const polyTopoChangeMap&);
|
||||
|
||||
//- Update mesh corresponding to the given distribution map
|
||||
virtual void distribute(const polyMeshDistributionMap&);
|
||||
|
||||
@ -207,7 +207,7 @@ void Foam::fv::VoFTurbulenceDamping::addSup
|
||||
}
|
||||
|
||||
|
||||
void Foam::fv::VoFTurbulenceDamping::updateMesh(const mapPolyMesh&)
|
||||
void Foam::fv::VoFTurbulenceDamping::updateMesh(const polyTopoChangeMap&)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -175,7 +175,7 @@ public:
|
||||
// Mesh changes
|
||||
|
||||
//- Update for mesh changes
|
||||
virtual void updateMesh(const mapPolyMesh&);
|
||||
virtual void updateMesh(const polyTopoChangeMap&);
|
||||
|
||||
//- Update mesh corresponding to the given distribution map
|
||||
virtual void distribute(const polyMeshDistributionMap&);
|
||||
|
||||
@ -202,7 +202,7 @@ void Foam::fv::VoFTurbulenceDamping::addSup
|
||||
}
|
||||
|
||||
|
||||
void Foam::fv::VoFTurbulenceDamping::updateMesh(const mapPolyMesh&)
|
||||
void Foam::fv::VoFTurbulenceDamping::updateMesh(const polyTopoChangeMap&)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -174,7 +174,7 @@ public:
|
||||
// Mesh changes
|
||||
|
||||
//- Update for mesh changes
|
||||
virtual void updateMesh(const mapPolyMesh&);
|
||||
virtual void updateMesh(const polyTopoChangeMap&);
|
||||
|
||||
//- Update mesh corresponding to the given distribution map
|
||||
virtual void distribute(const polyMeshDistributionMap&);
|
||||
|
||||
@ -304,7 +304,7 @@ void Foam::fv::interfaceTurbulenceDamping::addSup
|
||||
}
|
||||
|
||||
|
||||
void Foam::fv::interfaceTurbulenceDamping::updateMesh(const mapPolyMesh&)
|
||||
void Foam::fv::interfaceTurbulenceDamping::updateMesh(const polyTopoChangeMap&)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -195,7 +195,7 @@ public:
|
||||
// Mesh changes
|
||||
|
||||
//- Update for mesh changes
|
||||
virtual void updateMesh(const mapPolyMesh&);
|
||||
virtual void updateMesh(const polyTopoChangeMap&);
|
||||
|
||||
//- Update mesh corresponding to the given distribution map
|
||||
virtual void distribute(const polyMeshDistributionMap&);
|
||||
|
||||
@ -235,7 +235,10 @@ void Foam::fv::phaseTurbulenceStabilisation::addSup
|
||||
}
|
||||
|
||||
|
||||
void Foam::fv::phaseTurbulenceStabilisation::updateMesh(const mapPolyMesh&)
|
||||
void Foam::fv::phaseTurbulenceStabilisation::updateMesh
|
||||
(
|
||||
const polyTopoChangeMap&
|
||||
)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -165,7 +165,7 @@ public:
|
||||
// Mesh changes
|
||||
|
||||
//- Update for mesh changes
|
||||
virtual void updateMesh(const mapPolyMesh&);
|
||||
virtual void updateMesh(const polyTopoChangeMap&);
|
||||
|
||||
//- Update mesh corresponding to the given distribution map
|
||||
virtual void distribute(const polyMeshDistributionMap&);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2013-2021 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -36,7 +36,7 @@ Description
|
||||
#include "OFstream.H"
|
||||
#include "meshTools.H"
|
||||
#include "removeFaces.H"
|
||||
#include "mapPolyMesh.H"
|
||||
#include "polyTopoChangeMap.H"
|
||||
#include "polyTopoChange.H"
|
||||
#include "fvcDiv.H"
|
||||
#include "zeroGradientFvPatchFields.H"
|
||||
@ -197,7 +197,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
// Change mesh and inflate
|
||||
Info<< "Actually changing mesh" << nl << endl;
|
||||
autoPtr<mapPolyMesh> morphMap = meshMod.changeMesh(mesh, inflate);
|
||||
autoPtr<polyTopoChangeMap> morphMap = meshMod.changeMesh(mesh, inflate);
|
||||
|
||||
Info<< "Mapping fields" << nl << endl;
|
||||
mesh.updateMesh(morphMap);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2013-2021 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -36,7 +36,7 @@ Description
|
||||
#include "surfaceFields.H"
|
||||
#include "pointFields.H"
|
||||
#include "hexRef8.H"
|
||||
#include "mapPolyMesh.H"
|
||||
#include "polyTopoChangeMap.H"
|
||||
#include "polyTopoChange.H"
|
||||
#include "Random.H"
|
||||
#include "zeroGradientFvPatchFields.H"
|
||||
@ -273,7 +273,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
// Create mesh, return map from old to new mesh.
|
||||
Info<< nl << "-- actually changing mesh" << endl;
|
||||
autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh, inflate);
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh, inflate);
|
||||
|
||||
// Update fields
|
||||
Info<< nl << "-- mapping mesh data" << endl;
|
||||
|
||||
@ -49,7 +49,7 @@ Description
|
||||
#include "cellSet.H"
|
||||
#include "IOobjectList.H"
|
||||
#include "volFields.H"
|
||||
#include "mapPolyMesh.H"
|
||||
#include "polyTopoChangeMap.H"
|
||||
#include "faceSet.H"
|
||||
#include "cellSet.H"
|
||||
#include "syncTools.H"
|
||||
@ -272,7 +272,7 @@ template<class GeoField>
|
||||
void initCreatedPatches
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const mapPolyMesh& map,
|
||||
const polyTopoChangeMap& map,
|
||||
const typename GeoField::value_type initValue
|
||||
)
|
||||
{
|
||||
@ -1071,7 +1071,8 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
// Change the mesh. Change points directly (no inflation).
|
||||
autoPtr<mapPolyMesh> map = meshMod.changeMesh(subsetter.subMesh(), false);
|
||||
autoPtr<polyTopoChangeMap> map =
|
||||
meshMod.changeMesh(subsetter.subMesh(), false);
|
||||
|
||||
// Update fields
|
||||
subsetter.subMesh().updateMesh(map);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -49,7 +49,7 @@ Description
|
||||
#include "surfaceSets.H"
|
||||
#include "polyTopoChange.H"
|
||||
#include "polyTopoChanger.H"
|
||||
#include "mapPolyMesh.H"
|
||||
#include "polyTopoChangeMap.H"
|
||||
#include "labelIOList.H"
|
||||
#include "emptyPolyPatch.H"
|
||||
#include "removeCells.H"
|
||||
@ -513,7 +513,7 @@ void subsetMesh
|
||||
|
||||
const Time& runTime = mesh.time();
|
||||
|
||||
autoPtr<mapPolyMesh> morphMap = meshMod.changeMesh(mesh, false);
|
||||
autoPtr<polyTopoChangeMap> morphMap = meshMod.changeMesh(mesh, false);
|
||||
|
||||
if (morphMap().hasMotionPoints())
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -54,7 +54,7 @@ Description
|
||||
#include "combineFaces.H"
|
||||
#include "removePoints.H"
|
||||
#include "polyMesh.H"
|
||||
#include "mapPolyMesh.H"
|
||||
#include "polyTopoChangeMap.H"
|
||||
#include "unitConversion.H"
|
||||
#include "motionSmoother.H"
|
||||
|
||||
@ -96,7 +96,7 @@ label mergePatchFaces
|
||||
);
|
||||
}
|
||||
|
||||
autoPtr<mapPolyMesh> map;
|
||||
autoPtr<polyTopoChangeMap> map;
|
||||
{
|
||||
// Topology changes container
|
||||
polyTopoChange meshMod(mesh);
|
||||
@ -314,7 +314,7 @@ label mergeEdges(const scalar minCos, polyMesh& mesh)
|
||||
pointRemover.setRefinement(pointCanBeDeleted, meshMod);
|
||||
|
||||
// Change the mesh (no inflation)
|
||||
autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh, false, true);
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh, false, true);
|
||||
|
||||
// Update fields
|
||||
mesh.updateMesh(map);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -30,7 +30,7 @@ License
|
||||
#include "polyAddFace.H"
|
||||
#include "polyAddPoint.H"
|
||||
#include "polyModifyFace.H"
|
||||
#include "mapPolyMesh.H"
|
||||
#include "polyTopoChangeMap.H"
|
||||
#include "meshTools.H"
|
||||
|
||||
|
||||
@ -461,7 +461,7 @@ void Foam::cellSplitter::setRefinement
|
||||
}
|
||||
|
||||
|
||||
void Foam::cellSplitter::updateMesh(const mapPolyMesh& morphMap)
|
||||
void Foam::cellSplitter::updateMesh(const polyTopoChangeMap& morphMap)
|
||||
{
|
||||
// Create copy since we're deleting entries. Only if both cell and added
|
||||
// point get mapped do they get inserted.
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -47,7 +47,7 @@ namespace Foam
|
||||
|
||||
// Forward declaration of classes
|
||||
class polyTopoChange;
|
||||
class mapPolyMesh;
|
||||
class polyTopoChangeMap;
|
||||
class polyMesh;
|
||||
|
||||
|
||||
@ -123,7 +123,7 @@ public:
|
||||
);
|
||||
|
||||
//- Force recalculation of locally stored data on topological change
|
||||
void updateMesh(const mapPolyMesh&);
|
||||
void updateMesh(const polyTopoChangeMap&);
|
||||
|
||||
|
||||
// Access
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -52,7 +52,7 @@ Description
|
||||
#include "Time.H"
|
||||
#include "polyMesh.H"
|
||||
#include "polyTopoChange.H"
|
||||
#include "mapPolyMesh.H"
|
||||
#include "polyTopoChangeMap.H"
|
||||
#include "boundaryCutter.H"
|
||||
#include "cellSplitter.H"
|
||||
#include "edgeCollapser.H"
|
||||
@ -530,7 +530,7 @@ int main(int argc, char *argv[])
|
||||
cutter.setRefinement(cellToPyrCentre, meshMod);
|
||||
|
||||
// Do changes
|
||||
autoPtr<mapPolyMesh> morphMap = meshMod.changeMesh(mesh, false);
|
||||
autoPtr<polyTopoChangeMap> morphMap = meshMod.changeMesh(mesh, false);
|
||||
|
||||
if (morphMap().hasMotionPoints())
|
||||
{
|
||||
@ -602,7 +602,7 @@ int main(int argc, char *argv[])
|
||||
cutter.setRefinement(allPointInfo, meshMod);
|
||||
|
||||
// Do changes
|
||||
autoPtr<mapPolyMesh> morphMap = meshMod.changeMesh(mesh, false);
|
||||
autoPtr<polyTopoChangeMap> morphMap = meshMod.changeMesh(mesh, false);
|
||||
|
||||
if (morphMap().hasMotionPoints())
|
||||
{
|
||||
@ -647,7 +647,7 @@ int main(int argc, char *argv[])
|
||||
);
|
||||
|
||||
// Do changes
|
||||
autoPtr<mapPolyMesh> morphMap = meshMod.changeMesh(mesh, false);
|
||||
autoPtr<polyTopoChangeMap> morphMap = meshMod.changeMesh(mesh, false);
|
||||
|
||||
if (morphMap().hasMotionPoints())
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -39,7 +39,7 @@ Description
|
||||
#include "meshTools.H"
|
||||
#include "IFstream.H"
|
||||
#include "polyTopoChange.H"
|
||||
#include "mapPolyMesh.H"
|
||||
#include "polyTopoChangeMap.H"
|
||||
#include "volMesh.H"
|
||||
#include "surfaceMesh.H"
|
||||
#include "volFields.H"
|
||||
@ -142,7 +142,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
// Create mesh, return map from old to new mesh.
|
||||
autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh, false);
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh, false);
|
||||
|
||||
// Update fields
|
||||
mesh.updateMesh(map);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -240,7 +240,7 @@ int main(int argc, char *argv[])
|
||||
runTime++;
|
||||
}
|
||||
|
||||
autoPtr<mapPolyMesh> morphMap = meshMod.changeMesh(mesh, false);
|
||||
autoPtr<polyTopoChangeMap> morphMap = meshMod.changeMesh(mesh, false);
|
||||
|
||||
if (morphMap().hasMotionPoints())
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -136,7 +136,7 @@ int main(int argc, char *argv[])
|
||||
meshMod
|
||||
);
|
||||
|
||||
autoPtr<mapPolyMesh> morphMap = meshMod.changeMesh(mesh, false);
|
||||
autoPtr<polyTopoChangeMap> morphMap = meshMod.changeMesh(mesh, false);
|
||||
|
||||
mesh.updateMesh(morphMap);
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -45,7 +45,7 @@ Description
|
||||
#include "Time.H"
|
||||
#include "polyTopoChange.H"
|
||||
#include "polyTopoChanger.H"
|
||||
#include "mapPolyMesh.H"
|
||||
#include "polyTopoChangeMap.H"
|
||||
#include "polyMesh.H"
|
||||
#include "cellCuts.H"
|
||||
#include "cellSet.H"
|
||||
@ -685,7 +685,7 @@ int main(int argc, char *argv[])
|
||||
runTime++;
|
||||
}
|
||||
|
||||
autoPtr<mapPolyMesh> morphMap = meshMod.changeMesh(mesh, false);
|
||||
autoPtr<polyTopoChangeMap> morphMap = meshMod.changeMesh(mesh, false);
|
||||
|
||||
if (morphMap().hasMotionPoints())
|
||||
{
|
||||
|
||||
@ -1456,7 +1456,7 @@ int main(int argc, char *argv[])
|
||||
// Modify mesh
|
||||
// ~~~~~~~~~~~
|
||||
|
||||
autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh, false);
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh, false);
|
||||
|
||||
// Zip-up the mesh if it contained hanging nodes
|
||||
if (hangingNodes)
|
||||
|
||||
@ -176,7 +176,7 @@ labelList patchFaces(const polyBoundaryMesh& patches, const wordList& names)
|
||||
}
|
||||
|
||||
|
||||
void updateFaceLabels(const mapPolyMesh& map, labelList& faceLabels)
|
||||
void updateFaceLabels(const polyTopoChangeMap& map, labelList& faceLabels)
|
||||
{
|
||||
const labelList& reverseMap = map.reverseFaceMap();
|
||||
|
||||
@ -197,7 +197,7 @@ void updateFaceLabels(const mapPolyMesh& map, labelList& faceLabels)
|
||||
}
|
||||
|
||||
|
||||
void updateCellSet(const mapPolyMesh& map, labelHashSet& cellLabels)
|
||||
void updateCellSet(const polyTopoChangeMap& map, labelHashSet& cellLabels)
|
||||
{
|
||||
const labelList& reverseMap = map.reverseCellMap();
|
||||
|
||||
@ -421,7 +421,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
// Change the mesh. No inflation.
|
||||
autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh, false);
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh, false);
|
||||
|
||||
// Update fields
|
||||
mesh.updateMesh(map);
|
||||
@ -693,7 +693,7 @@ int main(int argc, char *argv[])
|
||||
createDummyFvMeshFiles(mesh, regionDir);
|
||||
|
||||
// Create actual mesh from polyTopoChange container
|
||||
autoPtr<mapPolyMesh> map = meshMod().makeMesh
|
||||
autoPtr<polyTopoChangeMap> map = meshMod().makeMesh
|
||||
(
|
||||
meshFromMesh,
|
||||
IOobject
|
||||
@ -881,7 +881,7 @@ int main(int argc, char *argv[])
|
||||
if (anyChange)
|
||||
{
|
||||
// Construct new mesh from polyTopoChange.
|
||||
autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh, false);
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh, false);
|
||||
|
||||
// Update fields
|
||||
mesh.updateMesh(map);
|
||||
@ -1013,7 +1013,7 @@ int main(int argc, char *argv[])
|
||||
);
|
||||
|
||||
// Construct new mesh from polyTopoChange.
|
||||
autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh, false);
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh, false);
|
||||
|
||||
// Update fields
|
||||
mesh.updateMesh(map);
|
||||
|
||||
@ -2235,7 +2235,7 @@ int main(int argc, char *argv[])
|
||||
);
|
||||
|
||||
|
||||
autoPtr<mapPolyMesh> shellMap;
|
||||
autoPtr<polyTopoChangeMap> shellMap;
|
||||
fvMesh regionMesh
|
||||
(
|
||||
IOobject
|
||||
@ -2524,7 +2524,7 @@ int main(int argc, char *argv[])
|
||||
// Insert baffles into original mesh
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
autoPtr<mapPolyMesh> addBafflesMap;
|
||||
autoPtr<polyTopoChangeMap> addBafflesMap;
|
||||
|
||||
if (adaptMesh)
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -251,7 +251,7 @@ int main(int argc, char *argv[])
|
||||
extruder.setRefinement(meshMod());
|
||||
|
||||
// Create a mesh from topo changes.
|
||||
autoPtr<mapPolyMesh> morphMap = meshMod().changeMesh(mesh(), false);
|
||||
autoPtr<polyTopoChangeMap> morphMap = meshMod().changeMesh(mesh(), false);
|
||||
|
||||
mesh().updateMesh(morphMap);
|
||||
|
||||
@ -301,7 +301,7 @@ int main(int argc, char *argv[])
|
||||
collapser.setRefinement(allPointInfo, meshModCollapse);
|
||||
|
||||
// Create a mesh from topo changes.
|
||||
autoPtr<mapPolyMesh> morphMap
|
||||
autoPtr<polyTopoChangeMap> morphMap
|
||||
= meshModCollapse.changeMesh(mesh(), false);
|
||||
|
||||
mesh().updateMesh(morphMap);
|
||||
|
||||
@ -51,7 +51,7 @@ namespace Foam
|
||||
// Forward declaration of classes
|
||||
class polyMesh;
|
||||
class polyTopoChange;
|
||||
class mapPolyMesh;
|
||||
class polyTopoChangeMap;
|
||||
class polyMeshDistributionMap;
|
||||
class polyBoundaryMesh;
|
||||
|
||||
@ -119,7 +119,7 @@ public:
|
||||
void setRefinement(polyTopoChange&);
|
||||
|
||||
//- Force recalculation of locally stored data on topological change
|
||||
void updateMesh(const mapPolyMesh&)
|
||||
void updateMesh(const polyTopoChangeMap&)
|
||||
{}
|
||||
|
||||
//- Force recalculation of locally stored data for mesh distribution
|
||||
|
||||
@ -236,7 +236,7 @@ void Foam::backgroundMeshDecomposition::initialRefinement()
|
||||
meshCutter_.setRefinement(newCellsToRefine, meshMod);
|
||||
|
||||
// Create mesh, return map from old to new mesh.
|
||||
autoPtr<mapPolyMesh> map = meshMod.changeMesh
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh
|
||||
(
|
||||
mesh_,
|
||||
false, // inflate
|
||||
@ -345,7 +345,7 @@ void Foam::backgroundMeshDecomposition::initialRefinement()
|
||||
);
|
||||
|
||||
// Create mesh, return map from old to new mesh.
|
||||
autoPtr<mapPolyMesh> map = meshMod.changeMesh
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh
|
||||
(
|
||||
mesh_,
|
||||
false, // inflate
|
||||
@ -937,7 +937,7 @@ Foam::backgroundMeshDecomposition::distribute
|
||||
meshCutter_.setRefinement(newCellsToRefine, meshMod);
|
||||
|
||||
// Create mesh, return map from old to new mesh.
|
||||
autoPtr<mapPolyMesh> map = meshMod.changeMesh
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh
|
||||
(
|
||||
mesh_,
|
||||
false, // inflate
|
||||
|
||||
@ -58,7 +58,7 @@ SourceFiles
|
||||
#include "cellSet.H"
|
||||
#include "meshTools.H"
|
||||
#include "polyTopoChange.H"
|
||||
#include "mapPolyMesh.H"
|
||||
#include "polyTopoChangeMap.H"
|
||||
#include "decompositionMethod.H"
|
||||
#include "fvMeshDistribute.H"
|
||||
#include "removeCells.H"
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2012-2021 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -992,7 +992,7 @@ void Foam::conformalVoronoiMesh::writeMesh
|
||||
|
||||
polyTopoChange meshMod(newMesh());
|
||||
|
||||
autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh, false);
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh, false);
|
||||
|
||||
polyMeshFilter::copySets(newMesh(), mesh);
|
||||
}
|
||||
@ -1029,7 +1029,7 @@ void Foam::conformalVoronoiMesh::writeMesh
|
||||
|
||||
polyTopoChange meshMod(newMesh());
|
||||
|
||||
autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh, false);
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh, false);
|
||||
|
||||
polyMeshFilter::copySets(newMesh(), mesh);
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -698,7 +698,7 @@ void Foam::conformalVoronoiMesh::addZones
|
||||
}
|
||||
|
||||
// Change the mesh (no inflation, parallel sync)
|
||||
autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh, false, true);
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh, false, true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2013-2019 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -201,7 +201,8 @@ int main(int argc, char *argv[])
|
||||
|
||||
extruder.setRefinement(meshMod);
|
||||
|
||||
autoPtr<mapPolyMesh> morphMap = meshMod.changeMesh(pMesh, false);
|
||||
autoPtr<polyTopoChangeMap> morphMap =
|
||||
meshMod.changeMesh(pMesh, false);
|
||||
|
||||
pMesh.updateMesh(morphMap);
|
||||
}
|
||||
|
||||
@ -796,7 +796,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
// Change the mesh. Change points directly (no inflation).
|
||||
autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh, false);
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh, false);
|
||||
|
||||
// Update fields
|
||||
mesh.updateMesh(map);
|
||||
|
||||
@ -723,7 +723,7 @@ int main(int argc, char *argv[])
|
||||
// Change mesh, use inflation to reforce calculation of transformation
|
||||
// tensors.
|
||||
Info<< "Doing topology modification to order faces." << nl << endl;
|
||||
autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh, true);
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh, true);
|
||||
mesh.movePoints(map().preMotionPoints());
|
||||
|
||||
if (writeCyclicMatch)
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -216,7 +216,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
// Change the mesh. No inflation.
|
||||
autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh, false);
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh, false);
|
||||
|
||||
// Update fields
|
||||
mesh.updateMesh(map);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -26,7 +26,7 @@ License
|
||||
#include "mergePolyMesh.H"
|
||||
#include "Time.H"
|
||||
#include "polyTopoChanger.H"
|
||||
#include "mapPolyMesh.H"
|
||||
#include "polyTopoChangeMap.H"
|
||||
#include "polyAddPoint.H"
|
||||
#include "polyAddCell.H"
|
||||
#include "polyAddFace.H"
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -32,7 +32,7 @@ Description
|
||||
#include "argList.H"
|
||||
#include "Time.H"
|
||||
#include "mirrorFvMesh.H"
|
||||
#include "mapPolyMesh.H"
|
||||
#include "polyTopoChangeMap.H"
|
||||
#include "hexRef8Data.H"
|
||||
#include "systemDict.H"
|
||||
|
||||
@ -93,7 +93,7 @@ int main(int argc, char *argv[])
|
||||
mMesh.write();
|
||||
|
||||
// Map the hexRef8 data
|
||||
mapPolyMesh map
|
||||
polyTopoChangeMap map
|
||||
(
|
||||
mesh,
|
||||
mesh.nPoints(), // nOldPoints,
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -27,7 +27,7 @@ License
|
||||
#include "meshTools.H"
|
||||
#include "polyMesh.H"
|
||||
#include "polyTopoChange.H"
|
||||
#include "mapPolyMesh.H"
|
||||
#include "polyTopoChangeMap.H"
|
||||
#include "edgeFaceCirculator.H"
|
||||
#include "mergePoints.H"
|
||||
#include "OFstream.H"
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -63,7 +63,7 @@ Note
|
||||
#include "fvMesh.H"
|
||||
#include "unitConversion.H"
|
||||
#include "polyTopoChange.H"
|
||||
#include "mapPolyMesh.H"
|
||||
#include "polyTopoChangeMap.H"
|
||||
#include "PackedBoolList.H"
|
||||
#include "meshTools.H"
|
||||
#include "OFstream.H"
|
||||
@ -509,7 +509,7 @@ int main(int argc, char *argv[])
|
||||
);
|
||||
|
||||
// Create mesh, return map from old to new mesh.
|
||||
autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh, false);
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh, false);
|
||||
|
||||
// Update fields
|
||||
mesh.updateMesh(map);
|
||||
|
||||
@ -390,7 +390,7 @@ labelList getRegionFaceOrder
|
||||
// cellOrder: old cell for every new cell
|
||||
// faceOrder: old face for every new face. Ordering of boundary faces not
|
||||
// changed.
|
||||
autoPtr<mapPolyMesh> reorderMesh
|
||||
autoPtr<polyTopoChangeMap> reorderMesh
|
||||
(
|
||||
polyMesh& mesh,
|
||||
const labelList& cellOrder,
|
||||
@ -506,9 +506,9 @@ autoPtr<mapPolyMesh> reorderMesh
|
||||
}
|
||||
|
||||
|
||||
return autoPtr<mapPolyMesh>
|
||||
return autoPtr<polyTopoChangeMap>
|
||||
(
|
||||
new mapPolyMesh
|
||||
new polyTopoChangeMap
|
||||
(
|
||||
mesh, // const polyMesh& mesh,
|
||||
mesh.nPoints(), // nOldPoints,
|
||||
@ -972,13 +972,13 @@ int main(int argc, char *argv[])
|
||||
|
||||
|
||||
// Change the mesh.
|
||||
autoPtr<mapPolyMesh> map = reorderMesh(mesh, cellOrder, faceOrder);
|
||||
autoPtr<polyTopoChangeMap> map = reorderMesh(mesh, cellOrder, faceOrder);
|
||||
|
||||
|
||||
if (orderPoints)
|
||||
{
|
||||
polyTopoChange meshMod(mesh);
|
||||
autoPtr<mapPolyMesh> pointOrderMap = meshMod.changeMesh
|
||||
autoPtr<polyTopoChangeMap> pointOrderMap = meshMod.changeMesh
|
||||
(
|
||||
mesh,
|
||||
false, // inflate
|
||||
|
||||
@ -112,7 +112,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
// Change the mesh. No inflation.
|
||||
autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh, false);
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh, false);
|
||||
|
||||
// Update fields
|
||||
mesh.updateMesh(map);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -47,7 +47,7 @@ Description
|
||||
#include "polyMesh.H"
|
||||
#include "Time.H"
|
||||
#include "polyTopoChange.H"
|
||||
#include "mapPolyMesh.H"
|
||||
#include "polyTopoChangeMap.H"
|
||||
#include "faceSet.H"
|
||||
#include "attachDetach.H"
|
||||
#include "attachPolyTopoChanger.H"
|
||||
|
||||
@ -559,7 +559,7 @@ void getInterfaceSizes
|
||||
|
||||
|
||||
// Create mesh for region.
|
||||
autoPtr<mapPolyMesh> createRegionMesh
|
||||
autoPtr<polyTopoChangeMap> createRegionMesh
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
// Region info
|
||||
@ -711,7 +711,7 @@ autoPtr<mapPolyMesh> createRegionMesh
|
||||
meshMod
|
||||
);
|
||||
|
||||
autoPtr<mapPolyMesh> map = meshMod.makeMesh
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.makeMesh
|
||||
(
|
||||
newMesh,
|
||||
IOobject
|
||||
@ -745,7 +745,7 @@ void createAndWriteRegion
|
||||
<< ' ' << regionNames[regioni] << endl;
|
||||
|
||||
autoPtr<fvMesh> newMesh;
|
||||
autoPtr<mapPolyMesh> map = createRegionMesh
|
||||
autoPtr<polyTopoChangeMap> map = createRegionMesh
|
||||
(
|
||||
mesh,
|
||||
cellRegion,
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -62,7 +62,7 @@ Description
|
||||
|
||||
#include "argList.H"
|
||||
#include "polyTopoChanger.H"
|
||||
#include "mapPolyMesh.H"
|
||||
#include "polyTopoChangeMap.H"
|
||||
#include "slidingInterface.H"
|
||||
#include "perfectInterface.H"
|
||||
#include "ReadFields.H"
|
||||
@ -448,7 +448,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
// Execute all polyMeshModifiers
|
||||
autoPtr<mapPolyMesh> morphMap = stitcher.changeMesh(true);
|
||||
autoPtr<polyTopoChangeMap> morphMap = stitcher.changeMesh(true);
|
||||
|
||||
mesh.movePoints(morphMap->preMotionPoints());
|
||||
|
||||
|
||||
@ -179,7 +179,7 @@ void ${typeName}FvModel${SourceType}::addSup
|
||||
}
|
||||
|
||||
|
||||
void ${typeName}FvModel${SourceType}::updateMesh(const mapPolyMesh& map)
|
||||
void ${typeName}FvModel${SourceType}::updateMesh(const polyTopoChangeMap& map)
|
||||
{
|
||||
set_.updateMesh(map);
|
||||
}
|
||||
|
||||
@ -115,7 +115,7 @@ public:
|
||||
// Mesh motion
|
||||
|
||||
//- Update for mesh changes
|
||||
virtual void updateMesh(const mapPolyMesh&);
|
||||
virtual void updateMesh(const polyTopoChangeMap&);
|
||||
|
||||
//- Update mesh corresponding to the given distribution map
|
||||
virtual void distribute(const polyMeshDistributionMap&);
|
||||
|
||||
@ -576,11 +576,11 @@ $(cellMatcher)/tetWedgeMatcher.C
|
||||
$(cellMatcher)/tetMatcher.C
|
||||
$(cellMatcher)/degenerateMatcher.C
|
||||
|
||||
mapPolyMesh = $(polyMesh)/mapPolyMesh
|
||||
$(mapPolyMesh)/mapPolyMesh.C
|
||||
$(mapPolyMesh)/faceMapper/faceMapper.C
|
||||
$(mapPolyMesh)/cellMapper/cellMapper.C
|
||||
$(mapPolyMesh)/mapAddedPolyMesh.C
|
||||
polyTopoChangeMap = $(polyMesh)/polyTopoChangeMap
|
||||
$(polyTopoChangeMap)/polyTopoChangeMap.C
|
||||
$(polyTopoChangeMap)/faceMapper/faceMapper.C
|
||||
$(polyTopoChangeMap)/cellMapper/cellMapper.C
|
||||
$(polyTopoChangeMap)/mapAddedPolyMesh.C
|
||||
|
||||
polyMeshDistributionMap = $(polyMesh)/polyMeshDistributionMap
|
||||
$(polyMeshDistributionMap)/distributionMap.C
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -129,10 +129,13 @@ bool Foam::IOOutputFilter<OutputFilter>::write(const bool write)
|
||||
|
||||
|
||||
template<class OutputFilter>
|
||||
void Foam::IOOutputFilter<OutputFilter>::updateMesh(const mapPolyMesh& mpm)
|
||||
void Foam::IOOutputFilter<OutputFilter>::updateMesh
|
||||
(
|
||||
const polyTopoChangeMap& map
|
||||
)
|
||||
{
|
||||
read();
|
||||
OutputFilter::updateMesh(mpm);
|
||||
OutputFilter::updateMesh(map);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -50,7 +50,7 @@ namespace Foam
|
||||
{
|
||||
|
||||
// Forward declaration of classes
|
||||
class mapPolyMesh;
|
||||
class polyTopoChangeMap;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class IOOutputFilter Declaration
|
||||
@ -126,7 +126,7 @@ public:
|
||||
virtual bool write(const bool write = true);
|
||||
|
||||
//- Update for changes of mesh
|
||||
virtual void updateMesh(const mapPolyMesh& mpm);
|
||||
virtual void updateMesh(const polyTopoChangeMap& map);
|
||||
|
||||
//- Update for changes of mesh
|
||||
virtual void movePoints(const polyMesh& mesh);
|
||||
|
||||
@ -156,7 +156,7 @@ Foam::scalar Foam::functionObject::timeToNextWrite()
|
||||
}
|
||||
|
||||
|
||||
void Foam::functionObject::updateMesh(const mapPolyMesh&)
|
||||
void Foam::functionObject::updateMesh(const polyTopoChangeMap&)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -132,7 +132,7 @@ namespace Foam
|
||||
// Forward declaration of classes
|
||||
class Time;
|
||||
class polyMesh;
|
||||
class mapPolyMesh;
|
||||
class polyTopoChangeMap;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class functionObject Declaration
|
||||
@ -239,7 +239,7 @@ public:
|
||||
virtual scalar timeToNextWrite();
|
||||
|
||||
//- Update for changes of mesh
|
||||
virtual void updateMesh(const mapPolyMesh& mpm);
|
||||
virtual void updateMesh(const polyTopoChangeMap& map);
|
||||
|
||||
//- Update for changes of mesh
|
||||
virtual void movePoints(const polyMesh& mesh);
|
||||
|
||||
@ -844,13 +844,13 @@ bool Foam::functionObjectList::read()
|
||||
}
|
||||
|
||||
|
||||
void Foam::functionObjectList::updateMesh(const mapPolyMesh& mpm)
|
||||
void Foam::functionObjectList::updateMesh(const polyTopoChangeMap& map)
|
||||
{
|
||||
if (execution_)
|
||||
{
|
||||
forAll(*this, oi)
|
||||
{
|
||||
operator[](oi).updateMesh(mpm);
|
||||
operator[](oi).updateMesh(map);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -52,7 +52,7 @@ SourceFiles
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
class mapPolyMesh;
|
||||
class polyTopoChangeMap;
|
||||
class argList;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
@ -273,7 +273,7 @@ public:
|
||||
scalar timeToNextWrite();
|
||||
|
||||
//- Update for changes of mesh
|
||||
void updateMesh(const mapPolyMesh& mpm);
|
||||
void updateMesh(const polyTopoChangeMap& map);
|
||||
|
||||
//- Update for changes of mesh
|
||||
void movePoints(const polyMesh& mesh);
|
||||
|
||||
@ -25,7 +25,7 @@ License
|
||||
|
||||
#include "timeControlFunctionObject.H"
|
||||
#include "polyMesh.H"
|
||||
#include "mapPolyMesh.H"
|
||||
#include "polyTopoChangeMap.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
@ -197,11 +197,14 @@ bool Foam::functionObjects::timeControl::read(const dictionary& dict)
|
||||
}
|
||||
|
||||
|
||||
void Foam::functionObjects::timeControl::updateMesh(const mapPolyMesh& mpm)
|
||||
void Foam::functionObjects::timeControl::updateMesh
|
||||
(
|
||||
const polyTopoChangeMap& map
|
||||
)
|
||||
{
|
||||
if (active())
|
||||
{
|
||||
foPtr_->updateMesh(mpm);
|
||||
foPtr_->updateMesh(map);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2016-2021 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2016-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -163,7 +163,7 @@ public:
|
||||
virtual bool read(const dictionary&);
|
||||
|
||||
//- Update for changes of mesh
|
||||
virtual void updateMesh(const mapPolyMesh& mpm);
|
||||
virtual void updateMesh(const polyTopoChangeMap& map);
|
||||
|
||||
//- Update for changes of mesh
|
||||
virtual void movePoints(const polyMesh& mesh);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -64,7 +64,7 @@ Foam::cloud::~cloud()
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::cloud::autoMap(const mapPolyMesh&)
|
||||
void Foam::cloud::autoMap(const polyTopoChangeMap&)
|
||||
{
|
||||
NotImplemented;
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -43,7 +43,7 @@ namespace Foam
|
||||
{
|
||||
|
||||
// Forward declaration of classes
|
||||
class mapPolyMesh;
|
||||
class polyTopoChangeMap;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class cloud Declaration
|
||||
@ -85,7 +85,7 @@ public:
|
||||
|
||||
//- Remap the cells of particles corresponding to the
|
||||
// mesh topology change
|
||||
virtual void autoMap(const mapPolyMesh&);
|
||||
virtual void autoMap(const polyTopoChangeMap&);
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -45,7 +45,7 @@ namespace Foam
|
||||
//- Generic Geometric field mapper.
|
||||
// For "real" mapping, add template specialisations for mapping of internal
|
||||
// fields depending on mesh type.
|
||||
inline void mapClouds(const objectRegistry& db, const mapPolyMesh& mapper)
|
||||
inline void mapClouds(const objectRegistry& db, const polyTopoChangeMap& mapper)
|
||||
{
|
||||
HashTable<const cloud*> clouds(db.lookupClass<cloud>());
|
||||
|
||||
|
||||
@ -321,7 +321,11 @@ void Foam::meshObject::distribute
|
||||
|
||||
|
||||
template<class Mesh>
|
||||
void Foam::meshObject::updateMesh(objectRegistry& obr, const mapPolyMesh& map)
|
||||
void Foam::meshObject::updateMesh
|
||||
(
|
||||
objectRegistry& obr,
|
||||
const polyTopoChangeMap& map
|
||||
)
|
||||
{
|
||||
HashTable<GeometricMeshObject<Mesh>*> meshObjects
|
||||
(
|
||||
@ -331,7 +335,7 @@ void Foam::meshObject::updateMesh(objectRegistry& obr, const mapPolyMesh& map)
|
||||
if (meshObject::debug)
|
||||
{
|
||||
Pout<< "meshObject::updateMesh(objectRegistry&, "
|
||||
"const mapPolyMesh& map) : updating " << Mesh::typeName
|
||||
"const polyTopoChangeMap& map) : updating " << Mesh::typeName
|
||||
<< " meshObjects for region " << obr.name() << endl;
|
||||
}
|
||||
|
||||
|
||||
@ -76,7 +76,7 @@ namespace Foam
|
||||
{
|
||||
|
||||
// Forward declarations
|
||||
class mapPolyMesh;
|
||||
class polyTopoChangeMap;
|
||||
class polyMeshDistributionMap;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
@ -173,7 +173,7 @@ public:
|
||||
static void movePoints(objectRegistry&);
|
||||
|
||||
template<class Mesh>
|
||||
static void updateMesh(objectRegistry&, const mapPolyMesh&);
|
||||
static void updateMesh(objectRegistry&, const polyTopoChangeMap&);
|
||||
|
||||
template<class Mesh>
|
||||
static void distribute(objectRegistry&, const polyMeshDistributionMap&);
|
||||
@ -321,7 +321,7 @@ public:
|
||||
DistributeableMeshObject<Mesh>(typeName, io)
|
||||
{}
|
||||
|
||||
virtual void updateMesh(const mapPolyMesh& map) = 0;
|
||||
virtual void updateMesh(const polyTopoChangeMap& map) = 0;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -90,11 +90,11 @@ void Foam::pointMesh::reset(const bool validBoundary)
|
||||
}
|
||||
|
||||
|
||||
void Foam::pointMesh::updateMesh(const mapPolyMesh& map)
|
||||
void Foam::pointMesh::updateMesh(const polyTopoChangeMap& map)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Pout<< "pointMesh::updateMesh(const mapPolyMesh&): "
|
||||
Pout<< "pointMesh::updateMesh(const polyTopoChangeMap&): "
|
||||
<< "Updating for topology changes." << endl;
|
||||
Pout<< endl;
|
||||
}
|
||||
|
||||
@ -119,7 +119,7 @@ public:
|
||||
// Mesh callbacks
|
||||
|
||||
//- Update the mesh corresponding to given map
|
||||
virtual void updateMesh(const mapPolyMesh&);
|
||||
virtual void updateMesh(const polyTopoChangeMap&);
|
||||
|
||||
//- Update mesh corresponding to the given distribution map
|
||||
virtual void distribute(const polyMeshDistributionMap&);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -58,7 +58,7 @@ public:
|
||||
(
|
||||
const pointMesh& mesh,
|
||||
const pointMapper& pointMap,
|
||||
const mapPolyMesh& mpm
|
||||
const polyTopoChangeMap& map
|
||||
)
|
||||
:
|
||||
PtrList<pointPatchMapper>(mesh.boundary().size())
|
||||
@ -74,7 +74,7 @@ public:
|
||||
(
|
||||
patches[patchi],
|
||||
pointMap,
|
||||
mpm
|
||||
map
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -26,7 +26,7 @@ License
|
||||
#include "pointMapper.H"
|
||||
#include "demandDrivenData.H"
|
||||
#include "pointMesh.H"
|
||||
#include "mapPolyMesh.H"
|
||||
#include "polyTopoChangeMap.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
@ -49,7 +49,7 @@ void Foam::pointMapper::calcAddressing() const
|
||||
{
|
||||
// Direct addressing, no weights
|
||||
|
||||
directAddrPtr_ = new labelList(mpm_.pointMap());
|
||||
directAddrPtr_ = new labelList(map_.pointMap());
|
||||
labelList& directAddr = *directAddrPtr_;
|
||||
|
||||
// Not necessary to resize the list as there are no retired points
|
||||
@ -84,7 +84,7 @@ void Foam::pointMapper::calcAddressing() const
|
||||
scalarListList& w = *weightsPtr_;
|
||||
|
||||
// Points created from other points (i.e. points merged into it).
|
||||
const List<objectMap>& cfc = mpm_.pointsFromPointsMap();
|
||||
const List<objectMap>& cfc = map_.pointsFromPointsMap();
|
||||
|
||||
forAll(cfc, cfcI)
|
||||
{
|
||||
@ -110,7 +110,7 @@ void Foam::pointMapper::calcAddressing() const
|
||||
// Do mapped points. Note that can already be set from pointsFromPoints
|
||||
// so check if addressing size still zero.
|
||||
|
||||
const labelList& cm = mpm_.pointMap();
|
||||
const labelList& cm = map_.pointMap();
|
||||
|
||||
forAll(cm, pointi)
|
||||
{
|
||||
@ -158,10 +158,14 @@ void Foam::pointMapper::clearOut()
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::pointMapper::pointMapper(const pointMesh& pMesh, const mapPolyMesh& mpm)
|
||||
Foam::pointMapper::pointMapper
|
||||
(
|
||||
const pointMesh& pMesh,
|
||||
const polyTopoChangeMap& map
|
||||
)
|
||||
:
|
||||
pMesh_(pMesh),
|
||||
mpm_(mpm),
|
||||
map_(map),
|
||||
insertedPoints_(true),
|
||||
direct_(false),
|
||||
directAddrPtr_(nullptr),
|
||||
@ -170,7 +174,7 @@ Foam::pointMapper::pointMapper(const pointMesh& pMesh, const mapPolyMesh& mpm)
|
||||
insertedPointLabelsPtr_(nullptr)
|
||||
{
|
||||
// Check for possibility of direct mapping
|
||||
if (mpm_.pointsFromPointsMap().empty())
|
||||
if (map_.pointsFromPointsMap().empty())
|
||||
{
|
||||
direct_ = true;
|
||||
}
|
||||
@ -180,7 +184,7 @@ Foam::pointMapper::pointMapper(const pointMesh& pMesh, const mapPolyMesh& mpm)
|
||||
}
|
||||
|
||||
// Check for inserted points
|
||||
if (direct_ && (mpm_.pointMap().empty() || min(mpm_.pointMap()) > -1))
|
||||
if (direct_ && (map_.pointMap().empty() || min(map_.pointMap()) > -1))
|
||||
{
|
||||
insertedPoints_ = false;
|
||||
}
|
||||
@ -192,7 +196,7 @@ Foam::pointMapper::pointMapper(const pointMesh& pMesh, const mapPolyMesh& mpm)
|
||||
// and check for left-overs
|
||||
labelList cm(pMesh_.size(), -1);
|
||||
|
||||
const List<objectMap>& cfc = mpm_.pointsFromPointsMap();
|
||||
const List<objectMap>& cfc = map_.pointsFromPointsMap();
|
||||
|
||||
forAll(cfc, cfcI)
|
||||
{
|
||||
@ -219,7 +223,7 @@ Foam::pointMapper::~pointMapper()
|
||||
|
||||
Foam::label Foam::pointMapper::sizeBeforeMapping() const
|
||||
{
|
||||
return mpm_.nOldPoints();
|
||||
return map_.nOldPoints();
|
||||
}
|
||||
|
||||
|
||||
@ -235,7 +239,7 @@ const Foam::labelUList& Foam::pointMapper::directAddressing() const
|
||||
if (!insertedObjects())
|
||||
{
|
||||
// No inserted points. Re-use pointMap
|
||||
return mpm_.pointMap();
|
||||
return map_.pointMap();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -27,7 +27,7 @@ Class
|
||||
Description
|
||||
This object provides mapping and fill-in information for point data
|
||||
between the two meshes after the topological change. It is
|
||||
constructed from mapPolyMesh.
|
||||
constructed from polyTopoChangeMap.
|
||||
|
||||
SourceFiles
|
||||
pointMapper.C
|
||||
@ -46,7 +46,7 @@ namespace Foam
|
||||
|
||||
// Forward declaration of classes
|
||||
class pointMesh;
|
||||
class mapPolyMesh;
|
||||
class polyTopoChangeMap;
|
||||
class polyMesh;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
@ -62,8 +62,8 @@ class pointMapper
|
||||
//- Reference to pointMesh
|
||||
const pointMesh& pMesh_;
|
||||
|
||||
//- Reference to mapPolyMesh
|
||||
const mapPolyMesh& mpm_;
|
||||
//- Reference to polyTopoChangeMap
|
||||
const polyTopoChangeMap& map_;
|
||||
|
||||
//- Are there any inserted (unmapped) points
|
||||
bool insertedPoints_;
|
||||
@ -100,8 +100,8 @@ public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from mapPolyMesh
|
||||
pointMapper(const pointMesh&, const mapPolyMesh& mpm);
|
||||
//- Construct from polyTopoChangeMap
|
||||
pointMapper(const pointMesh&, const polyTopoChangeMap& map);
|
||||
|
||||
//- Disallow default bitwise copy construction
|
||||
pointMapper(const pointMapper&) = delete;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -46,7 +46,7 @@ namespace Foam
|
||||
|
||||
// Forward declaration of classes
|
||||
class pointMesh;
|
||||
class mapPolyMesh;
|
||||
class polyTopoChangeMap;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class pointMeshMapper Declaration
|
||||
@ -71,11 +71,11 @@ public:
|
||||
// Constructors
|
||||
|
||||
//- Construct from pointMesh
|
||||
pointMeshMapper(const pointMesh& mesh, const mapPolyMesh& mpm)
|
||||
pointMeshMapper(const pointMesh& mesh, const polyTopoChangeMap& map)
|
||||
:
|
||||
mesh_(mesh),
|
||||
pointMap_(mesh, mpm),
|
||||
boundaryMap_(mesh, pointMap_, mpm)
|
||||
pointMap_(mesh, map),
|
||||
boundaryMap_(mesh, pointMap_, map)
|
||||
{}
|
||||
|
||||
//- Disallow default bitwise copy construction
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -25,7 +25,7 @@ License
|
||||
|
||||
#include "pointPatchMapper.H"
|
||||
#include "pointPatch.H"
|
||||
#include "mapPolyMesh.H"
|
||||
#include "polyTopoChangeMap.H"
|
||||
#include "faceMapper.H"
|
||||
#include "demandDrivenData.H"
|
||||
|
||||
@ -50,7 +50,7 @@ void Foam::pointPatchMapper::calcAddressing() const
|
||||
if (direct())
|
||||
{
|
||||
// Direct mapping.
|
||||
directAddrPtr_ = new labelList(mpm_.patchPointMap()[patch_.index()]);
|
||||
directAddrPtr_ = new labelList(map_.patchPointMap()[patch_.index()]);
|
||||
labelList& addr = *directAddrPtr_;
|
||||
|
||||
forAll(addr, i)
|
||||
@ -76,7 +76,7 @@ void Foam::pointPatchMapper::calcAddressing() const
|
||||
weightsPtr_ = new scalarListList(addr.size());
|
||||
scalarListList& w = *weightsPtr_;
|
||||
|
||||
const labelList& ppm = mpm_.patchPointMap()[patch_.index()];
|
||||
const labelList& ppm = map_.patchPointMap()[patch_.index()];
|
||||
|
||||
forAll(ppm, i)
|
||||
{
|
||||
@ -113,17 +113,17 @@ Foam::pointPatchMapper::pointPatchMapper
|
||||
(
|
||||
const pointPatch& patch,
|
||||
const pointMapper& pointMap,
|
||||
const mapPolyMesh& mpm
|
||||
const polyTopoChangeMap& map
|
||||
)
|
||||
:
|
||||
generalPointPatchFieldMapper(),
|
||||
patch_(patch),
|
||||
pointMapper_(pointMap),
|
||||
mpm_(mpm),
|
||||
map_(map),
|
||||
sizeBeforeMapping_
|
||||
(
|
||||
patch_.index() < mpm_.oldPatchNMeshPoints().size()
|
||||
? mpm_.oldPatchNMeshPoints()[patch_.index()]
|
||||
patch_.index() < map_.oldPatchNMeshPoints().size()
|
||||
? map_.oldPatchNMeshPoints()[patch_.index()]
|
||||
: 0
|
||||
),
|
||||
hasUnmapped_(false),
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -47,7 +47,7 @@ namespace Foam
|
||||
|
||||
// Forward declaration of classes
|
||||
class pointPatch;
|
||||
class mapPolyMesh;
|
||||
class polyTopoChangeMap;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class pointPatchMapper Declaration
|
||||
@ -66,7 +66,7 @@ class pointPatchMapper
|
||||
const morphFieldMapper& pointMapper_;
|
||||
|
||||
//- Reference to mapping data
|
||||
const mapPolyMesh& mpm_;
|
||||
const polyTopoChangeMap& map_;
|
||||
|
||||
//- Size before mapping
|
||||
const label sizeBeforeMapping_;
|
||||
@ -104,7 +104,7 @@ public:
|
||||
(
|
||||
const pointPatch& patch,
|
||||
const pointMapper& pointMap,
|
||||
const mapPolyMesh& mpm
|
||||
const polyTopoChangeMap& map
|
||||
);
|
||||
|
||||
//- Disallow default bitwise copy construction
|
||||
|
||||
@ -1,463 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "cellMapper.H"
|
||||
#include "demandDrivenData.H"
|
||||
#include "polyMesh.H"
|
||||
#include "mapPolyMesh.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
void Foam::cellMapper::calcAddressing() const
|
||||
{
|
||||
if
|
||||
(
|
||||
directAddrPtr_
|
||||
|| interpolationAddrPtr_
|
||||
|| weightsPtr_
|
||||
|| insertedCellLabelsPtr_
|
||||
)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Addressing already calculated."
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
if (direct())
|
||||
{
|
||||
// Direct addressing, no weights
|
||||
|
||||
directAddrPtr_ = new labelList(mpm_.cellMap());
|
||||
labelList& directAddr = *directAddrPtr_;
|
||||
|
||||
// Not necessary to resize the list as there are no retired cells
|
||||
// directAddr.setSize(mesh_.nCells());
|
||||
|
||||
insertedCellLabelsPtr_ = new labelList(mesh_.nCells());
|
||||
labelList& insertedCells = *insertedCellLabelsPtr_;
|
||||
|
||||
label nInsertedCells = 0;
|
||||
|
||||
forAll(directAddr, celli)
|
||||
{
|
||||
if (directAddr[celli] < 0)
|
||||
{
|
||||
// Found inserted cell
|
||||
directAddr[celli] = 0;
|
||||
insertedCells[nInsertedCells] = celli;
|
||||
nInsertedCells++;
|
||||
}
|
||||
}
|
||||
|
||||
insertedCells.setSize(nInsertedCells);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Interpolative addressing
|
||||
|
||||
interpolationAddrPtr_ = new labelListList(mesh_.nCells());
|
||||
labelListList& addr = *interpolationAddrPtr_;
|
||||
|
||||
weightsPtr_ = new scalarListList(mesh_.nCells());
|
||||
scalarListList& w = *weightsPtr_;
|
||||
|
||||
const List<objectMap>& cfp = mpm_.cellsFromPointsMap();
|
||||
|
||||
forAll(cfp, cfpI)
|
||||
{
|
||||
// Get addressing
|
||||
const labelList& mo = cfp[cfpI].masterObjects();
|
||||
|
||||
label celli = cfp[cfpI].index();
|
||||
|
||||
if (addr[celli].size())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Master cell " << celli
|
||||
<< " mapped from point cells " << mo
|
||||
<< " already destination of mapping." << abort(FatalError);
|
||||
}
|
||||
|
||||
// Map from masters, uniform weights
|
||||
addr[celli] = mo;
|
||||
w[celli] = scalarList(mo.size(), 1.0/mo.size());
|
||||
}
|
||||
|
||||
const List<objectMap>& cfe = mpm_.cellsFromEdgesMap();
|
||||
|
||||
forAll(cfe, cfeI)
|
||||
{
|
||||
// Get addressing
|
||||
const labelList& mo = cfe[cfeI].masterObjects();
|
||||
|
||||
label celli = cfe[cfeI].index();
|
||||
|
||||
if (addr[celli].size())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Master cell " << celli
|
||||
<< " mapped from edge cells " << mo
|
||||
<< " already destination of mapping." << abort(FatalError);
|
||||
}
|
||||
|
||||
// Map from masters, uniform weights
|
||||
addr[celli] = mo;
|
||||
w[celli] = scalarList(mo.size(), 1.0/mo.size());
|
||||
}
|
||||
|
||||
const List<objectMap>& cff = mpm_.cellsFromFacesMap();
|
||||
|
||||
forAll(cff, cffI)
|
||||
{
|
||||
// Get addressing
|
||||
const labelList& mo = cff[cffI].masterObjects();
|
||||
|
||||
label celli = cff[cffI].index();
|
||||
|
||||
if (addr[celli].size())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Master cell " << celli
|
||||
<< " mapped from face cells " << mo
|
||||
<< " already destination of mapping." << abort(FatalError);
|
||||
}
|
||||
|
||||
// Map from masters, uniform weights
|
||||
addr[celli] = mo;
|
||||
w[celli] = scalarList(mo.size(), 1.0/mo.size());
|
||||
}
|
||||
|
||||
// Volume conservative mapping if possible
|
||||
|
||||
const List<objectMap>& cfc = mpm_.cellsFromCellsMap();
|
||||
|
||||
forAll(cfc, cfcI)
|
||||
{
|
||||
// Get addressing
|
||||
const labelList& mo = cfc[cfcI].masterObjects();
|
||||
|
||||
label celli = cfc[cfcI].index();
|
||||
|
||||
if (addr[celli].size())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Master cell " << celli
|
||||
<< " mapped from cell cells " << mo
|
||||
<< " already destination of mapping."
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
// Map from masters
|
||||
addr[celli] = mo;
|
||||
}
|
||||
|
||||
if (mpm_.hasOldCellVolumes())
|
||||
{
|
||||
// Volume weighted
|
||||
|
||||
const scalarField& V = mpm_.oldCellVolumes();
|
||||
|
||||
if (V.size() != sizeBeforeMapping())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "cellVolumes size " << V.size()
|
||||
<< " is not the old number of cells " << sizeBeforeMapping()
|
||||
<< ". Are your cellVolumes already mapped?"
|
||||
<< " (new number of cells " << mpm_.cellMap().size() << ")"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
forAll(cfc, cfcI)
|
||||
{
|
||||
const labelList& mo = cfc[cfcI].masterObjects();
|
||||
|
||||
label celli = cfc[cfcI].index();
|
||||
|
||||
w[celli].setSize(mo.size());
|
||||
|
||||
if (mo.size())
|
||||
{
|
||||
scalar sumV = 0;
|
||||
forAll(mo, ci)
|
||||
{
|
||||
w[celli][ci] = V[mo[ci]];
|
||||
sumV += V[mo[ci]];
|
||||
}
|
||||
if (sumV > vSmall)
|
||||
{
|
||||
forAll(mo, ci)
|
||||
{
|
||||
w[celli][ci] /= sumV;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Exception: zero volume. Use uniform mapping
|
||||
w[celli] = scalarList(mo.size(), 1.0/mo.size());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Uniform weighted
|
||||
|
||||
forAll(cfc, cfcI)
|
||||
{
|
||||
const labelList& mo = cfc[cfcI].masterObjects();
|
||||
|
||||
label celli = cfc[cfcI].index();
|
||||
|
||||
w[celli] = scalarList(mo.size(), 1.0/mo.size());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Do mapped faces. Note that can already be set from cellsFromCells
|
||||
// so check if addressing size still zero.
|
||||
|
||||
const labelList& cm = mpm_.cellMap();
|
||||
|
||||
forAll(cm, celli)
|
||||
{
|
||||
if (cm[celli] > -1 && addr[celli].empty())
|
||||
{
|
||||
// Mapped from a single cell
|
||||
addr[celli] = labelList(1, cm[celli]);
|
||||
w[celli] = scalarList(1, 1.0);
|
||||
}
|
||||
}
|
||||
|
||||
// Grab inserted points (for them the size of addressing is still zero)
|
||||
|
||||
insertedCellLabelsPtr_ = new labelList(mesh_.nCells());
|
||||
labelList& insertedCells = *insertedCellLabelsPtr_;
|
||||
|
||||
label nInsertedCells = 0;
|
||||
|
||||
forAll(addr, celli)
|
||||
{
|
||||
if (addr[celli].empty())
|
||||
{
|
||||
// Mapped from a dummy cell
|
||||
addr[celli] = labelList(1, label(0));
|
||||
w[celli] = scalarList(1, 1.0);
|
||||
|
||||
insertedCells[nInsertedCells] = celli;
|
||||
nInsertedCells++;
|
||||
}
|
||||
}
|
||||
|
||||
insertedCells.setSize(nInsertedCells);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::cellMapper::clearOut()
|
||||
{
|
||||
deleteDemandDrivenData(directAddrPtr_);
|
||||
deleteDemandDrivenData(interpolationAddrPtr_);
|
||||
deleteDemandDrivenData(weightsPtr_);
|
||||
deleteDemandDrivenData(insertedCellLabelsPtr_);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::cellMapper::cellMapper(const mapPolyMesh& mpm)
|
||||
:
|
||||
mesh_(mpm.mesh()),
|
||||
mpm_(mpm),
|
||||
insertedCells_(true),
|
||||
direct_(false),
|
||||
directAddrPtr_(nullptr),
|
||||
interpolationAddrPtr_(nullptr),
|
||||
weightsPtr_(nullptr),
|
||||
insertedCellLabelsPtr_(nullptr)
|
||||
{
|
||||
// Check for possibility of direct mapping
|
||||
if
|
||||
(
|
||||
mpm_.cellsFromPointsMap().empty()
|
||||
&& mpm_.cellsFromEdgesMap().empty()
|
||||
&& mpm_.cellsFromFacesMap().empty()
|
||||
&& mpm_.cellsFromCellsMap().empty()
|
||||
)
|
||||
{
|
||||
direct_ = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
direct_ = false;
|
||||
}
|
||||
|
||||
// Check for inserted cells
|
||||
if (direct_ && (mpm_.cellMap().empty() || min(mpm_.cellMap()) > -1))
|
||||
{
|
||||
insertedCells_ = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Need to check all 3 lists to see if there are inserted cells
|
||||
// with no owner
|
||||
|
||||
// Make a copy of the cell map, add the entried for cells from points,
|
||||
// cells from edges and cells from faces and check for left-overs
|
||||
labelList cm(mesh_.nCells(), -1);
|
||||
|
||||
const List<objectMap>& cfp = mpm_.cellsFromPointsMap();
|
||||
|
||||
forAll(cfp, cfpI)
|
||||
{
|
||||
cm[cfp[cfpI].index()] = 0;
|
||||
}
|
||||
|
||||
const List<objectMap>& cfe = mpm_.cellsFromEdgesMap();
|
||||
|
||||
forAll(cfe, cfeI)
|
||||
{
|
||||
cm[cfe[cfeI].index()] = 0;
|
||||
}
|
||||
|
||||
const List<objectMap>& cff = mpm_.cellsFromFacesMap();
|
||||
|
||||
forAll(cff, cffI)
|
||||
{
|
||||
cm[cff[cffI].index()] = 0;
|
||||
}
|
||||
|
||||
const List<objectMap>& cfc = mpm_.cellsFromCellsMap();
|
||||
|
||||
forAll(cfc, cfcI)
|
||||
{
|
||||
cm[cfc[cfcI].index()] = 0;
|
||||
}
|
||||
|
||||
if (min(cm) < 0)
|
||||
{
|
||||
insertedCells_ = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::cellMapper::~cellMapper()
|
||||
{
|
||||
clearOut();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::label Foam::cellMapper::sizeBeforeMapping() const
|
||||
{
|
||||
return mpm_.nOldCells();
|
||||
}
|
||||
|
||||
|
||||
const Foam::labelUList& Foam::cellMapper::directAddressing() const
|
||||
{
|
||||
if (!direct())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Requested direct addressing for an interpolative mapper."
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
if (!insertedObjects())
|
||||
{
|
||||
// No inserted cells. Re-use cellMap
|
||||
return mpm_.cellMap();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!directAddrPtr_)
|
||||
{
|
||||
calcAddressing();
|
||||
}
|
||||
|
||||
return *directAddrPtr_;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const Foam::labelListList& Foam::cellMapper::addressing() const
|
||||
{
|
||||
if (direct())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Requested interpolative addressing for a direct mapper."
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
if (!interpolationAddrPtr_)
|
||||
{
|
||||
calcAddressing();
|
||||
}
|
||||
|
||||
return *interpolationAddrPtr_;
|
||||
}
|
||||
|
||||
|
||||
const Foam::scalarListList& Foam::cellMapper::weights() const
|
||||
{
|
||||
if (direct())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Requested interpolative weights for a direct mapper."
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
if (!weightsPtr_)
|
||||
{
|
||||
calcAddressing();
|
||||
}
|
||||
|
||||
return *weightsPtr_;
|
||||
}
|
||||
|
||||
|
||||
const Foam::labelList& Foam::cellMapper::insertedObjectLabels() const
|
||||
{
|
||||
if (!insertedCellLabelsPtr_)
|
||||
{
|
||||
if (!insertedObjects())
|
||||
{
|
||||
// There are no inserted cells
|
||||
insertedCellLabelsPtr_ = new labelList(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
calcAddressing();
|
||||
}
|
||||
}
|
||||
|
||||
return *insertedCellLabelsPtr_;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,165 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::cellMapper
|
||||
|
||||
Description
|
||||
This object provides mapping and fill-in information for cell data
|
||||
between the two meshes after the topological change. It is
|
||||
constructed from mapPolyMesh.
|
||||
|
||||
SourceFiles
|
||||
cellMapper.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef cellMapper_H
|
||||
#define cellMapper_H
|
||||
|
||||
#include "morphFieldMapper.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// Forward declaration of classes
|
||||
class polyMesh;
|
||||
class mapPolyMesh;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class cellMapper Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class cellMapper
|
||||
:
|
||||
public morphFieldMapper
|
||||
{
|
||||
// Private Data
|
||||
|
||||
//- Reference to polyMesh
|
||||
const polyMesh& mesh_;
|
||||
|
||||
//- Reference to mapPolyMesh
|
||||
const mapPolyMesh& mpm_;
|
||||
|
||||
//- Are there any inserted (unmapped) cells
|
||||
bool insertedCells_;
|
||||
|
||||
//- Is the mapping direct
|
||||
bool direct_;
|
||||
|
||||
|
||||
// Demand-driven private data
|
||||
|
||||
//- Direct addressing (only one for of addressing is used)
|
||||
mutable labelList* directAddrPtr_;
|
||||
|
||||
//- Interpolated addressing (only one for of addressing is used)
|
||||
mutable labelListList* interpolationAddrPtr_;
|
||||
|
||||
//- Interpolation weights
|
||||
mutable scalarListList* weightsPtr_;
|
||||
|
||||
//- Inserted cells
|
||||
mutable labelList* insertedCellLabelsPtr_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Calculate addressing for mapping with inserted cells
|
||||
void calcAddressing() const;
|
||||
|
||||
//- Clear out local storage
|
||||
void clearOut();
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Static Data Members
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from mapPolyMesh
|
||||
cellMapper(const mapPolyMesh& mpm);
|
||||
|
||||
//- Disallow default bitwise copy construction
|
||||
cellMapper(const cellMapper&) = delete;
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~cellMapper();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return size before mapping
|
||||
virtual label sizeBeforeMapping() const;
|
||||
|
||||
//- Is the mapping direct
|
||||
virtual bool direct() const
|
||||
{
|
||||
return direct_;
|
||||
}
|
||||
|
||||
virtual bool hasUnmapped() const
|
||||
{
|
||||
return insertedObjects();
|
||||
}
|
||||
|
||||
//- Return direct addressing
|
||||
virtual const labelUList& directAddressing() const;
|
||||
|
||||
//- Return interpolated addressing
|
||||
virtual const labelListList& addressing() const;
|
||||
|
||||
//- Return interpolation weights
|
||||
virtual const scalarListList& weights() const;
|
||||
|
||||
//- Are there any inserted cells
|
||||
virtual bool insertedObjects() const
|
||||
{
|
||||
return insertedCells_;
|
||||
}
|
||||
|
||||
//- Return list of inserted cells
|
||||
const virtual labelList& insertedObjectLabels() const;
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const cellMapper&) = delete;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,401 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "faceMapper.H"
|
||||
#include "fieldTypes.H"
|
||||
#include "demandDrivenData.H"
|
||||
#include "polyMesh.H"
|
||||
#include "mapPolyMesh.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
void Foam::faceMapper::calcAddressing() const
|
||||
{
|
||||
if
|
||||
(
|
||||
directAddrPtr_
|
||||
|| interpolationAddrPtr_
|
||||
|| weightsPtr_
|
||||
|| insertedFaceLabelsPtr_
|
||||
)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Addressing already calculated."
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
if (direct())
|
||||
{
|
||||
// Direct addressing, no weights
|
||||
|
||||
directAddrPtr_ = new labelList(mpm_.faceMap());
|
||||
labelList& directAddr = *directAddrPtr_;
|
||||
|
||||
// Reset the size of addressing list to contain only live faces
|
||||
directAddr.setSize(mesh_.nFaces());
|
||||
|
||||
insertedFaceLabelsPtr_ = new labelList(mesh_.nFaces());
|
||||
labelList& insertedFaces = *insertedFaceLabelsPtr_;
|
||||
|
||||
label nInsertedFaces = 0;
|
||||
|
||||
forAll(directAddr, facei)
|
||||
{
|
||||
if (directAddr[facei] < 0)
|
||||
{
|
||||
// Found inserted face
|
||||
directAddr[facei] = 0;
|
||||
insertedFaces[nInsertedFaces] = facei;
|
||||
nInsertedFaces++;
|
||||
}
|
||||
}
|
||||
|
||||
insertedFaces.setSize(nInsertedFaces);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Interpolative addressing
|
||||
|
||||
interpolationAddrPtr_ = new labelListList(mesh_.nFaces());
|
||||
labelListList& addr = *interpolationAddrPtr_;
|
||||
|
||||
weightsPtr_ = new scalarListList(mesh_.nFaces());
|
||||
scalarListList& w = *weightsPtr_;
|
||||
|
||||
const List<objectMap>& ffp = mpm_.facesFromPointsMap();
|
||||
|
||||
forAll(ffp, ffpI)
|
||||
{
|
||||
// Get addressing
|
||||
const labelList& mo = ffp[ffpI].masterObjects();
|
||||
|
||||
label facei = ffp[ffpI].index();
|
||||
|
||||
if (addr[facei].size())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Master face " << facei
|
||||
<< " mapped from point faces " << mo
|
||||
<< " already destination of mapping." << abort(FatalError);
|
||||
}
|
||||
|
||||
// Map from masters, uniform weights
|
||||
addr[facei] = mo;
|
||||
w[facei] = scalarList(mo.size(), 1.0/mo.size());
|
||||
}
|
||||
|
||||
const List<objectMap>& ffe = mpm_.facesFromEdgesMap();
|
||||
|
||||
forAll(ffe, ffeI)
|
||||
{
|
||||
// Get addressing
|
||||
const labelList& mo = ffe[ffeI].masterObjects();
|
||||
|
||||
label facei = ffe[ffeI].index();
|
||||
|
||||
if (addr[facei].size())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Master face " << facei
|
||||
<< " mapped from edge faces " << mo
|
||||
<< " already destination of mapping." << abort(FatalError);
|
||||
}
|
||||
|
||||
// Map from masters, uniform weights
|
||||
addr[facei] = mo;
|
||||
w[facei] = scalarList(mo.size(), 1.0/mo.size());
|
||||
}
|
||||
|
||||
const List<objectMap>& fff = mpm_.facesFromFacesMap();
|
||||
|
||||
forAll(fff, fffI)
|
||||
{
|
||||
// Get addressing
|
||||
const labelList& mo = fff[fffI].masterObjects();
|
||||
|
||||
label facei = fff[fffI].index();
|
||||
|
||||
if (addr[facei].size())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Master face " << facei
|
||||
<< " mapped from face faces " << mo
|
||||
<< " already destination of mapping." << abort(FatalError);
|
||||
}
|
||||
|
||||
// Map from masters, uniform weights
|
||||
addr[facei] = mo;
|
||||
w[facei] = scalarList(mo.size(), 1.0/mo.size());
|
||||
}
|
||||
|
||||
|
||||
// Do mapped faces. Note that can already be set from facesFromFaces
|
||||
// so check if addressing size still zero.
|
||||
const labelList& fm = mpm_.faceMap();
|
||||
|
||||
forAll(fm, facei)
|
||||
{
|
||||
if (fm[facei] > -1 && addr[facei].empty())
|
||||
{
|
||||
// Mapped from a single face
|
||||
addr[facei] = labelList(1, fm[facei]);
|
||||
w[facei] = scalarList(1, 1.0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Grab inserted faces (for them the size of addressing is still zero)
|
||||
|
||||
insertedFaceLabelsPtr_ = new labelList(mesh_.nFaces());
|
||||
labelList& insertedFaces = *insertedFaceLabelsPtr_;
|
||||
|
||||
label nInsertedFaces = 0;
|
||||
|
||||
forAll(addr, facei)
|
||||
{
|
||||
if (addr[facei].empty())
|
||||
{
|
||||
// Mapped from a dummy face
|
||||
addr[facei] = labelList(1, label(0));
|
||||
w[facei] = scalarList(1, 1.0);
|
||||
|
||||
insertedFaces[nInsertedFaces] = facei;
|
||||
nInsertedFaces++;
|
||||
}
|
||||
}
|
||||
|
||||
insertedFaces.setSize(nInsertedFaces);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::faceMapper::clearOut()
|
||||
{
|
||||
deleteDemandDrivenData(directAddrPtr_);
|
||||
deleteDemandDrivenData(interpolationAddrPtr_);
|
||||
deleteDemandDrivenData(weightsPtr_);
|
||||
deleteDemandDrivenData(insertedFaceLabelsPtr_);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::faceMapper::faceMapper(const mapPolyMesh& mpm)
|
||||
:
|
||||
mesh_(mpm.mesh()),
|
||||
mpm_(mpm),
|
||||
insertedFaces_(true),
|
||||
direct_(false),
|
||||
directAddrPtr_(nullptr),
|
||||
interpolationAddrPtr_(nullptr),
|
||||
weightsPtr_(nullptr),
|
||||
insertedFaceLabelsPtr_(nullptr)
|
||||
{
|
||||
// Check for possibility of direct mapping
|
||||
if
|
||||
(
|
||||
mpm_.facesFromPointsMap().empty()
|
||||
&& mpm_.facesFromEdgesMap().empty()
|
||||
&& mpm_.facesFromFacesMap().empty()
|
||||
)
|
||||
{
|
||||
direct_ = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
direct_ = false;
|
||||
}
|
||||
|
||||
// Check for inserted faces
|
||||
if (direct_ && (mpm_.faceMap().empty() || min(mpm_.faceMap()) > -1))
|
||||
{
|
||||
insertedFaces_ = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Need to check all 3 lists to see if there are inserted faces
|
||||
// with no owner
|
||||
|
||||
// Make a copy of the face map, add the entries for faces from points
|
||||
// and faces from edges and check for left-overs
|
||||
labelList fm(mesh_.nFaces(), -1);
|
||||
|
||||
const List<objectMap>& ffp = mpm_.facesFromPointsMap();
|
||||
|
||||
forAll(ffp, ffpI)
|
||||
{
|
||||
fm[ffp[ffpI].index()] = 0;
|
||||
}
|
||||
|
||||
const List<objectMap>& ffe = mpm_.facesFromEdgesMap();
|
||||
|
||||
forAll(ffe, ffeI)
|
||||
{
|
||||
fm[ffe[ffeI].index()] = 0;
|
||||
}
|
||||
|
||||
const List<objectMap>& fff = mpm_.facesFromFacesMap();
|
||||
|
||||
forAll(fff, fffI)
|
||||
{
|
||||
fm[fff[fffI].index()] = 0;
|
||||
}
|
||||
|
||||
if (min(fm) < 0)
|
||||
{
|
||||
insertedFaces_ = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::faceMapper::~faceMapper()
|
||||
{
|
||||
clearOut();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::label Foam::faceMapper::sizeBeforeMapping() const
|
||||
{
|
||||
return mpm_.nOldFaces();
|
||||
}
|
||||
|
||||
|
||||
Foam::label Foam::faceMapper::internalSizeBeforeMapping() const
|
||||
{
|
||||
return mpm_.nOldInternalFaces();
|
||||
}
|
||||
|
||||
|
||||
const Foam::labelUList& Foam::faceMapper::directAddressing() const
|
||||
{
|
||||
if (!direct())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Requested direct addressing for an interpolative mapper."
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
if (!insertedObjects())
|
||||
{
|
||||
// No inserted faces. Re-use faceMap
|
||||
return mpm_.faceMap();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!directAddrPtr_)
|
||||
{
|
||||
calcAddressing();
|
||||
}
|
||||
|
||||
return *directAddrPtr_;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const Foam::labelListList& Foam::faceMapper::addressing() const
|
||||
{
|
||||
if (direct())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Requested interpolative addressing for a direct mapper."
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
if (!interpolationAddrPtr_)
|
||||
{
|
||||
calcAddressing();
|
||||
}
|
||||
|
||||
return *interpolationAddrPtr_;
|
||||
}
|
||||
|
||||
|
||||
const Foam::scalarListList& Foam::faceMapper::weights() const
|
||||
{
|
||||
if (direct())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Requested interpolative weights for a direct mapper."
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
if (!weightsPtr_)
|
||||
{
|
||||
calcAddressing();
|
||||
}
|
||||
|
||||
return *weightsPtr_;
|
||||
}
|
||||
|
||||
|
||||
const Foam::labelList& Foam::faceMapper::insertedObjectLabels() const
|
||||
{
|
||||
if (!insertedFaceLabelsPtr_)
|
||||
{
|
||||
if (!insertedObjects())
|
||||
{
|
||||
// There are no inserted faces
|
||||
insertedFaceLabelsPtr_ = new labelList(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
calcAddressing();
|
||||
}
|
||||
}
|
||||
|
||||
return *insertedFaceLabelsPtr_;
|
||||
}
|
||||
|
||||
|
||||
const Foam::labelHashSet& Foam::faceMapper::flipFaceFlux() const
|
||||
{
|
||||
return mpm_.flipFaceFlux();
|
||||
}
|
||||
|
||||
|
||||
Foam::label Foam::faceMapper::nOldInternalFaces() const
|
||||
{
|
||||
return mpm_.nOldInternalFaces();
|
||||
}
|
||||
|
||||
|
||||
const Foam::labelList& Foam::faceMapper::oldPatchStarts() const
|
||||
{
|
||||
return mpm_.oldPatchStarts();
|
||||
}
|
||||
|
||||
|
||||
const Foam::labelList& Foam::faceMapper::oldPatchSizes() const
|
||||
{
|
||||
return mpm_.oldPatchSizes();
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,181 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::faceMapper
|
||||
|
||||
Description
|
||||
This object provides mapping and fill-in information for face data
|
||||
between the two meshes after the topological change. It is
|
||||
constructed from mapPolyMesh.
|
||||
|
||||
SourceFiles
|
||||
faceMapper.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef faceMapper_H
|
||||
#define faceMapper_H
|
||||
|
||||
#include "morphFieldMapper.H"
|
||||
#include "HashSet.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// Forward declaration of classes
|
||||
class polyMesh;
|
||||
class mapPolyMesh;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class faceMapper Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class faceMapper
|
||||
:
|
||||
public morphFieldMapper
|
||||
{
|
||||
// Private Data
|
||||
|
||||
//- Reference to polyMesh
|
||||
const polyMesh& mesh_;
|
||||
|
||||
//- Reference to mapPolyMesh
|
||||
const mapPolyMesh& mpm_;
|
||||
|
||||
//- Are there any inserted (unmapped) faces
|
||||
bool insertedFaces_;
|
||||
|
||||
//- Is the mapping direct
|
||||
bool direct_;
|
||||
|
||||
|
||||
// Demand-driven private data
|
||||
|
||||
//- Direct addressing (only one for of addressing is used)
|
||||
mutable labelList* directAddrPtr_;
|
||||
|
||||
//- Interpolated addressing (only one for of addressing is used)
|
||||
mutable labelListList* interpolationAddrPtr_;
|
||||
|
||||
//- Interpolation weights
|
||||
mutable scalarListList* weightsPtr_;
|
||||
|
||||
//- Inserted faces
|
||||
mutable labelList* insertedFaceLabelsPtr_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Calculate addressing for mapping with inserted faces
|
||||
void calcAddressing() const;
|
||||
|
||||
//- Clear out local storage
|
||||
void clearOut();
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Static Data Members
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from mapPolyMesh
|
||||
faceMapper(const mapPolyMesh& mpm);
|
||||
|
||||
//- Disallow default bitwise copy construction
|
||||
faceMapper(const faceMapper&) = delete;
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~faceMapper();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return size of field before mapping
|
||||
virtual label sizeBeforeMapping() const;
|
||||
|
||||
//- Return number of internal faces before mapping
|
||||
virtual label internalSizeBeforeMapping() const;
|
||||
|
||||
//- Is the mapping direct
|
||||
virtual bool direct() const
|
||||
{
|
||||
return direct_;
|
||||
}
|
||||
|
||||
virtual bool hasUnmapped() const
|
||||
{
|
||||
return insertedObjects();
|
||||
}
|
||||
|
||||
//- Return direct addressing
|
||||
virtual const labelUList& directAddressing() const;
|
||||
|
||||
//- Return interpolated addressing
|
||||
virtual const labelListList& addressing() const;
|
||||
|
||||
//- Return interpolation weights
|
||||
virtual const scalarListList& weights() const;
|
||||
|
||||
//- Return flux flip map
|
||||
virtual const labelHashSet& flipFaceFlux() const;
|
||||
|
||||
//- Return number of old internalFaces
|
||||
virtual label nOldInternalFaces() const;
|
||||
|
||||
//- Return old patch starts
|
||||
virtual const labelList& oldPatchStarts() const;
|
||||
|
||||
//- Return old patch sizes
|
||||
virtual const labelList& oldPatchSizes() const;
|
||||
|
||||
//- Are there any inserted faces
|
||||
virtual bool insertedObjects() const
|
||||
{
|
||||
return insertedFaces_;
|
||||
}
|
||||
|
||||
//- Return list of inserted faces
|
||||
virtual const labelList& insertedObjectLabels() const;
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const faceMapper&) = delete;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,81 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "mapAddedPolyMesh.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::mapAddedPolyMesh::mapAddedPolyMesh
|
||||
(
|
||||
const label nOldPoints,
|
||||
const label nOldFaces,
|
||||
const label nOldCells,
|
||||
const label nAddedPoints,
|
||||
const label nAddedFaces,
|
||||
const label nAddedCells,
|
||||
const labelList& oldPointMap,
|
||||
const labelList& oldFaceMap,
|
||||
const labelList& oldCellMap,
|
||||
|
||||
const labelList& addedPointMap,
|
||||
const labelList& addedFaceMap,
|
||||
const labelList& addedCellMap,
|
||||
|
||||
const labelList& oldPatchMap,
|
||||
const labelList& addedPatchMap,
|
||||
const labelList& oldPatchSizes,
|
||||
const labelList& oldPatchStarts
|
||||
)
|
||||
:
|
||||
nOldPoints_(nOldPoints),
|
||||
nOldFaces_(nOldFaces),
|
||||
nOldCells_(nOldCells),
|
||||
nAddedPoints_(nAddedPoints),
|
||||
nAddedFaces_(nAddedFaces),
|
||||
nAddedCells_(nAddedCells),
|
||||
|
||||
oldPointMap_(oldPointMap),
|
||||
oldFaceMap_(oldFaceMap),
|
||||
oldCellMap_(oldCellMap),
|
||||
|
||||
addedPointMap_(addedPointMap),
|
||||
addedFaceMap_(addedFaceMap),
|
||||
addedCellMap_(addedCellMap),
|
||||
|
||||
oldPatchMap_(oldPatchMap),
|
||||
addedPatchMap_(addedPatchMap),
|
||||
|
||||
oldPatchSizes_(oldPatchSizes),
|
||||
oldPatchStarts_(oldPatchStarts)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,245 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::mapAddedPolyMesh
|
||||
|
||||
Description
|
||||
Class containing mesh-to-mesh mapping information after a mesh addition
|
||||
where we add a mesh ('added mesh') to an old mesh, creating a new mesh.
|
||||
|
||||
We store mapping from the old to the new mesh and from the added mesh
|
||||
to the new mesh.
|
||||
|
||||
Note: Might need some more access functions or maybe some zone maps?
|
||||
|
||||
SourceFiles
|
||||
mapAddedPolyMesh.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef mapAddedPolyMesh_H
|
||||
#define mapAddedPolyMesh_H
|
||||
|
||||
#include "labelList.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
class mapPolyMesh;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class mapAddedPolyMesh Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class mapAddedPolyMesh
|
||||
{
|
||||
// Private Data
|
||||
|
||||
//- Old mesh points/face/cells
|
||||
label nOldPoints_;
|
||||
label nOldFaces_;
|
||||
label nOldCells_;
|
||||
|
||||
//- Added mesh points/faces/cells
|
||||
label nAddedPoints_;
|
||||
label nAddedFaces_;
|
||||
label nAddedCells_;
|
||||
|
||||
|
||||
//- From old mesh points to new points
|
||||
labelList oldPointMap_;
|
||||
//- From old mesh faces to new faces
|
||||
labelList oldFaceMap_;
|
||||
//- From old mesh cells to new cells
|
||||
labelList oldCellMap_;
|
||||
|
||||
//- From added mesh points to new points
|
||||
labelList addedPointMap_;
|
||||
//- From added mesh faces to new faces
|
||||
labelList addedFaceMap_;
|
||||
//- From added mesh cells to new cells
|
||||
labelList addedCellMap_;
|
||||
|
||||
//- Original mesh to new mesh patch map. -1 for deleted patches.
|
||||
labelList oldPatchMap_;
|
||||
|
||||
//- Added mesh to new mesh patch map. -1 for deleted patches.
|
||||
labelList addedPatchMap_;
|
||||
|
||||
//- Original patch sizes on old mesh
|
||||
labelList oldPatchSizes_;
|
||||
|
||||
//- Original patch starts
|
||||
labelList oldPatchStarts_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
mapAddedPolyMesh
|
||||
(
|
||||
const label nOldPoints,
|
||||
const label nOldFaces,
|
||||
const label nOldCells,
|
||||
const label nAddedPoints,
|
||||
const label nAddedFaces,
|
||||
const label nAddedCells,
|
||||
const labelList& oldPointMap,
|
||||
const labelList& oldFaceMap,
|
||||
const labelList& oldCellMap,
|
||||
|
||||
const labelList& addedPointMap,
|
||||
const labelList& addedFaceMap,
|
||||
const labelList& addedCellMap,
|
||||
|
||||
const labelList& oldPatchMap,
|
||||
const labelList& addedPatchMap,
|
||||
const labelList& oldPatchSizes,
|
||||
const labelList& oldPatchStarts
|
||||
);
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Access
|
||||
|
||||
// Old mesh data
|
||||
|
||||
label nOldPoints() const
|
||||
{
|
||||
return nOldPoints_;
|
||||
}
|
||||
|
||||
label nOldFaces() const
|
||||
{
|
||||
return nOldFaces_;
|
||||
}
|
||||
|
||||
label nOldCells() const
|
||||
{
|
||||
return nOldCells_;
|
||||
}
|
||||
|
||||
|
||||
//- From old mesh point/face/cell to new mesh point/face/cell.
|
||||
const labelList& oldPointMap() const
|
||||
{
|
||||
return oldPointMap_;
|
||||
}
|
||||
const labelList& oldFaceMap() const
|
||||
{
|
||||
return oldFaceMap_;
|
||||
}
|
||||
const labelList& oldCellMap() const
|
||||
{
|
||||
return oldCellMap_;
|
||||
}
|
||||
|
||||
//- From old patch index to new patch index or -1 if patch
|
||||
// not present (since 0 size)
|
||||
const labelList& oldPatchMap() const
|
||||
{
|
||||
return oldPatchMap_;
|
||||
}
|
||||
|
||||
//- Return list of the old patch sizes
|
||||
const labelList& oldPatchSizes() const
|
||||
{
|
||||
return oldPatchSizes_;
|
||||
}
|
||||
|
||||
//- Return list of the old patch start labels
|
||||
const labelList& oldPatchStarts() const
|
||||
{
|
||||
return oldPatchStarts_;
|
||||
}
|
||||
|
||||
//- Number of old internal faces
|
||||
label nOldInternalFaces() const
|
||||
{
|
||||
return oldPatchStarts_[0];
|
||||
}
|
||||
|
||||
|
||||
// Added mesh data
|
||||
|
||||
label nAddedPoints() const
|
||||
{
|
||||
return nAddedPoints_;
|
||||
}
|
||||
|
||||
label nAddedFaces() const
|
||||
{
|
||||
return nAddedFaces_;
|
||||
}
|
||||
|
||||
label nAddedCells() const
|
||||
{
|
||||
return nAddedCells_;
|
||||
}
|
||||
|
||||
//- From added mesh point/face/cell to new mesh point/face/cell.
|
||||
const labelList& addedPointMap() const
|
||||
{
|
||||
return addedPointMap_;
|
||||
}
|
||||
const labelList& addedFaceMap() const
|
||||
{
|
||||
return addedFaceMap_;
|
||||
}
|
||||
const labelList& addedCellMap() const
|
||||
{
|
||||
return addedCellMap_;
|
||||
}
|
||||
|
||||
//- From added mesh patch index to new patch index or -1 if
|
||||
// patch not present (since 0 size)
|
||||
const labelList& addedPatchMap() const
|
||||
{
|
||||
return addedPatchMap_;
|
||||
}
|
||||
|
||||
|
||||
// Edit
|
||||
|
||||
void updateMesh(const mapPolyMesh&)
|
||||
{
|
||||
NotImplemented;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,152 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::mapPatchChange
|
||||
|
||||
Description
|
||||
Class containing mesh-to-mesh mapping information after a patch change
|
||||
operation.
|
||||
|
||||
SourceFiles
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef mapPatchChange_H
|
||||
#define mapPatchChange_H
|
||||
|
||||
#include "labelList.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class mapPatchChange Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class mapPatchChange
|
||||
{
|
||||
// Private Data
|
||||
|
||||
//- Old patches
|
||||
const label nOldPatches_;
|
||||
|
||||
//- Patch mapping array
|
||||
const labelList patchMap_;
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
mapPatchChange(const label nOldPatches, const labelList& patchMap)
|
||||
:
|
||||
nOldPatches_(nOldPatches),
|
||||
patchMap_(patchMap)
|
||||
{}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Access
|
||||
|
||||
//- Number of old patches
|
||||
label nOldPatches() const
|
||||
{
|
||||
return nOldPatches_;
|
||||
}
|
||||
|
||||
//- Patch map. Size of current patches.
|
||||
// -1 : patch was added
|
||||
// >=0 : old position of patch
|
||||
// any original patch which is not in the list has been deleted
|
||||
const labelList& patchMap() const
|
||||
{
|
||||
return patchMap_;
|
||||
}
|
||||
|
||||
|
||||
// Utility functions
|
||||
|
||||
//- Labels of added patches
|
||||
labelList addedPatches() const
|
||||
{
|
||||
labelList added(patchMap_.size());
|
||||
|
||||
label addedI = 0;
|
||||
|
||||
forAll(patchMap_, patchi)
|
||||
{
|
||||
if (patchMap_[patchi] == -1)
|
||||
{
|
||||
added[addedI++] = patchi;
|
||||
}
|
||||
}
|
||||
added.setSize(addedI);
|
||||
return added;
|
||||
}
|
||||
|
||||
//- Labels (on old mesh) of deleted patches
|
||||
labelList deletedPatches() const
|
||||
{
|
||||
labelList oldToNew(nOldPatches_, -1);
|
||||
|
||||
// Mark all preserved patches
|
||||
forAll(patchMap_, patchi)
|
||||
{
|
||||
if (patchMap_[patchi] != -1)
|
||||
{
|
||||
oldToNew[patchMap_[patchi]] = patchi;
|
||||
}
|
||||
}
|
||||
|
||||
// Extract -1 elements from oldToNew. These are the deleted
|
||||
// patches.
|
||||
label deletedI = 0;
|
||||
|
||||
forAll(oldToNew, oldPatchi)
|
||||
{
|
||||
if (oldToNew[oldPatchi] == -1)
|
||||
{
|
||||
oldToNew[deletedI++] = oldPatchi;
|
||||
}
|
||||
}
|
||||
|
||||
oldToNew.setSize(deletedI);
|
||||
|
||||
return oldToNew;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,210 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "mapPolyMesh.H"
|
||||
#include "polyMesh.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::mapPolyMesh::mapPolyMesh
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const label nOldPoints,
|
||||
const label nOldFaces,
|
||||
const label nOldCells,
|
||||
const labelList& pointMap,
|
||||
const List<objectMap>& pointsFromPoints,
|
||||
const labelList& faceMap,
|
||||
const List<objectMap>& facesFromPoints,
|
||||
const List<objectMap>& facesFromEdges,
|
||||
const List<objectMap>& facesFromFaces,
|
||||
const labelList& cellMap,
|
||||
const List<objectMap>& cellsFromPoints,
|
||||
const List<objectMap>& cellsFromEdges,
|
||||
const List<objectMap>& cellsFromFaces,
|
||||
const List<objectMap>& cellsFromCells,
|
||||
const labelList& reversePointMap,
|
||||
const labelList& reverseFaceMap,
|
||||
const labelList& reverseCellMap,
|
||||
const labelHashSet& flipFaceFlux,
|
||||
const labelListList& patchPointMap,
|
||||
const labelListList& pointZoneMap,
|
||||
const labelListList& faceZonePointMap,
|
||||
const labelListList& faceZoneFaceMap,
|
||||
const labelListList& cellZoneMap,
|
||||
const pointField& preMotionPoints,
|
||||
const labelList& oldPatchStarts,
|
||||
const labelList& oldPatchNMeshPoints,
|
||||
const autoPtr<scalarField>& oldCellVolumesPtr
|
||||
)
|
||||
:
|
||||
mesh_(mesh),
|
||||
nOldPoints_(nOldPoints),
|
||||
nOldFaces_(nOldFaces),
|
||||
nOldCells_(nOldCells),
|
||||
pointMap_(pointMap),
|
||||
pointsFromPointsMap_(pointsFromPoints),
|
||||
faceMap_(faceMap),
|
||||
facesFromPointsMap_(facesFromPoints),
|
||||
facesFromEdgesMap_(facesFromEdges),
|
||||
facesFromFacesMap_(facesFromFaces),
|
||||
cellMap_(cellMap),
|
||||
cellsFromPointsMap_(cellsFromPoints),
|
||||
cellsFromEdgesMap_(cellsFromEdges),
|
||||
cellsFromFacesMap_(cellsFromFaces),
|
||||
cellsFromCellsMap_(cellsFromCells),
|
||||
reversePointMap_(reversePointMap),
|
||||
reverseFaceMap_(reverseFaceMap),
|
||||
reverseCellMap_(reverseCellMap),
|
||||
flipFaceFlux_(flipFaceFlux),
|
||||
patchPointMap_(patchPointMap),
|
||||
pointZoneMap_(pointZoneMap),
|
||||
faceZonePointMap_(faceZonePointMap),
|
||||
faceZoneFaceMap_(faceZoneFaceMap),
|
||||
cellZoneMap_(cellZoneMap),
|
||||
preMotionPoints_(preMotionPoints),
|
||||
oldPatchSizes_(oldPatchStarts.size()),
|
||||
oldPatchStarts_(oldPatchStarts),
|
||||
oldPatchNMeshPoints_(oldPatchNMeshPoints),
|
||||
oldCellVolumesPtr_(oldCellVolumesPtr)
|
||||
{
|
||||
if (oldPatchStarts_.size())
|
||||
{
|
||||
// Calculate old patch sizes
|
||||
for (label patchi = 0; patchi < oldPatchStarts_.size() - 1; patchi++)
|
||||
{
|
||||
oldPatchSizes_[patchi] =
|
||||
oldPatchStarts_[patchi + 1] - oldPatchStarts_[patchi];
|
||||
}
|
||||
|
||||
// Set the last one by hand
|
||||
const label lastPatchID = oldPatchStarts_.size() - 1;
|
||||
|
||||
oldPatchSizes_[lastPatchID] = nOldFaces_ - oldPatchStarts_[lastPatchID];
|
||||
|
||||
if (polyMesh::debug)
|
||||
{
|
||||
if (min(oldPatchSizes_) < 0)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Foam::mapPolyMesh::mapPolyMesh
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const label nOldPoints,
|
||||
const label nOldFaces,
|
||||
const label nOldCells,
|
||||
labelList& pointMap,
|
||||
List<objectMap>& pointsFromPoints,
|
||||
labelList& faceMap,
|
||||
List<objectMap>& facesFromPoints,
|
||||
List<objectMap>& facesFromEdges,
|
||||
List<objectMap>& facesFromFaces,
|
||||
labelList& cellMap,
|
||||
List<objectMap>& cellsFromPoints,
|
||||
List<objectMap>& cellsFromEdges,
|
||||
List<objectMap>& cellsFromFaces,
|
||||
List<objectMap>& cellsFromCells,
|
||||
labelList& reversePointMap,
|
||||
labelList& reverseFaceMap,
|
||||
labelList& reverseCellMap,
|
||||
labelHashSet& flipFaceFlux,
|
||||
labelListList& patchPointMap,
|
||||
labelListList& pointZoneMap,
|
||||
labelListList& faceZonePointMap,
|
||||
labelListList& faceZoneFaceMap,
|
||||
labelListList& cellZoneMap,
|
||||
pointField& preMotionPoints,
|
||||
labelList& oldPatchStarts,
|
||||
labelList& oldPatchNMeshPoints,
|
||||
autoPtr<scalarField>& oldCellVolumesPtr,
|
||||
const bool reuse
|
||||
)
|
||||
:
|
||||
mesh_(mesh),
|
||||
nOldPoints_(nOldPoints),
|
||||
nOldFaces_(nOldFaces),
|
||||
nOldCells_(nOldCells),
|
||||
pointMap_(pointMap, reuse),
|
||||
pointsFromPointsMap_(pointsFromPoints, reuse),
|
||||
faceMap_(faceMap, reuse),
|
||||
facesFromPointsMap_(facesFromPoints, reuse),
|
||||
facesFromEdgesMap_(facesFromEdges, reuse),
|
||||
facesFromFacesMap_(facesFromFaces, reuse),
|
||||
cellMap_(cellMap, reuse),
|
||||
cellsFromPointsMap_(cellsFromPoints, reuse),
|
||||
cellsFromEdgesMap_(cellsFromEdges, reuse),
|
||||
cellsFromFacesMap_(cellsFromFaces, reuse),
|
||||
cellsFromCellsMap_(cellsFromCells, reuse),
|
||||
reversePointMap_(reversePointMap, reuse),
|
||||
reverseFaceMap_(reverseFaceMap, reuse),
|
||||
reverseCellMap_(reverseCellMap, reuse),
|
||||
flipFaceFlux_(flipFaceFlux),
|
||||
patchPointMap_(patchPointMap, reuse),
|
||||
pointZoneMap_(pointZoneMap, reuse),
|
||||
faceZonePointMap_(faceZonePointMap, reuse),
|
||||
faceZoneFaceMap_(faceZoneFaceMap, reuse),
|
||||
cellZoneMap_(cellZoneMap, reuse),
|
||||
preMotionPoints_(preMotionPoints, reuse),
|
||||
oldPatchSizes_(oldPatchStarts.size()),
|
||||
oldPatchStarts_(oldPatchStarts, reuse),
|
||||
oldPatchNMeshPoints_(oldPatchNMeshPoints, reuse),
|
||||
oldCellVolumesPtr_(oldCellVolumesPtr, reuse)
|
||||
{
|
||||
if (oldPatchStarts_.size() > 0)
|
||||
{
|
||||
// Calculate old patch sizes
|
||||
for (label patchi = 0; patchi < oldPatchStarts_.size() - 1; patchi++)
|
||||
{
|
||||
oldPatchSizes_[patchi] =
|
||||
oldPatchStarts_[patchi + 1] - oldPatchStarts_[patchi];
|
||||
}
|
||||
|
||||
// Set the last one by hand
|
||||
const label lastPatchID = oldPatchStarts_.size() - 1;
|
||||
|
||||
oldPatchSizes_[lastPatchID] = nOldFaces_ - oldPatchStarts_[lastPatchID];
|
||||
|
||||
if (polyMesh::debug)
|
||||
{
|
||||
if (min(oldPatchSizes_) < 0)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Calculated negative old patch size."
|
||||
<< " Error in mapping data"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,662 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::mapPolyMesh
|
||||
|
||||
Description
|
||||
Class containing mesh-to-mesh mapping information after a change
|
||||
in polyMesh topology.
|
||||
|
||||
General:
|
||||
- pointMap/faceMap/cellMap: \n
|
||||
from current mesh back to previous mesh.
|
||||
(so to 'pull' the information onto the current mesh)
|
||||
- reversePointMap/faceMap/cellMap: \n
|
||||
from previous mesh to current. (so to 'push' information)
|
||||
|
||||
In the topology change points/faces/cells
|
||||
- can be unchanged. (faces might be renumbered though)
|
||||
- can be removed (into nothing)
|
||||
- can be removed into/merged with existing same entity
|
||||
(so point merged with other point, face with other face, cell with
|
||||
other cell. Note that probably only cell with cell is relevant)
|
||||
- can be added from existing same 'master' entity
|
||||
(so point from point, face from face and cell from cell)
|
||||
- can be inflated: face out of edge or point,
|
||||
cell out of face, edge or point.
|
||||
- can be appended: added 'out of nothing'.
|
||||
|
||||
All this information is necessary to correctly map fields.
|
||||
|
||||
\par points
|
||||
|
||||
- unchanged:
|
||||
- pointMap[pointi] contains old point label
|
||||
- reversePointMap[oldPointi] contains new point label
|
||||
- removed:
|
||||
- reversePointMap[oldPointi] contains -1
|
||||
- merged into point:
|
||||
- reversePointMap[oldPointi] contains <-1 : -newPointi-2
|
||||
- pointMap[pointi] contains the old master point label
|
||||
- pointsFromPoints gives for pointi all the old point labels
|
||||
(including the old master point!)
|
||||
- added-from-same:
|
||||
- pointMap[pointi] contains the old master point label
|
||||
- appended:
|
||||
- pointMap[pointi] contains -1
|
||||
|
||||
\par faces
|
||||
|
||||
- unchanged:
|
||||
- faceMap[facei] contains old face label
|
||||
- reverseFaceMap[oldFacei] contains new face label
|
||||
- removed:
|
||||
- reverseFaceMap[oldFacei] contains -1
|
||||
- merged into face:
|
||||
- reverseFaceMap[oldFacei] contains <-1 : -newFacei-2
|
||||
- faceMap[facei] contains the old master face label
|
||||
- facesFromFaces gives for facei all the old face labels
|
||||
(including the old master face!)
|
||||
- added-from-same:
|
||||
- faceMap[facei] contains the old master face label
|
||||
- inflated-from-edge:
|
||||
- faceMap[facei] contains -1
|
||||
- facesFromEdges contains an entry with
|
||||
- facei
|
||||
- list of faces(*) on old mesh that connected to the old edge
|
||||
- inflated-from-point:
|
||||
- faceMap[facei] contains -1
|
||||
- facesFromPoints contains an entry with
|
||||
- facei
|
||||
- list of faces(*) on old mesh that connected to the old point
|
||||
- appended:
|
||||
- faceMap[facei] contains -1
|
||||
|
||||
Note (*) \n
|
||||
if the newly inflated face is a boundary face the list of faces will
|
||||
only be boundary faces; if the new face is an internal face they
|
||||
will only be internal faces.
|
||||
|
||||
\par cells
|
||||
|
||||
- unchanged:
|
||||
- cellMap[celli] contains old cell label
|
||||
- reverseCellMap[oldCelli] contains new cell label
|
||||
- removed:
|
||||
- reverseCellMap[oldCelli] contains -1
|
||||
- merged into cell:
|
||||
- reverseCellMap[oldCelli] contains <-1 : -newCelli-2
|
||||
- cellMap[celli] contains the old master cell label
|
||||
- cellsFromCells gives for celli all the old cell labels
|
||||
(including the old master cell!)
|
||||
- added-from-same:
|
||||
- cellMap[celli] contains the old master cell label
|
||||
- inflated-from-face:
|
||||
- cellMap[celli] contains -1
|
||||
- cellsFromFaces contains an entry with
|
||||
- celli
|
||||
- list of cells on old mesh that connected to the old face
|
||||
- inflated-from-edge:
|
||||
- cellMap[celli] contains -1
|
||||
- cellsFromEdges contains an entry with
|
||||
- celli
|
||||
- list of cells on old mesh that connected to the old edge
|
||||
- inflated-from-point:
|
||||
- cellMap[celli] contains -1
|
||||
- cellsFromPoints contains an entry with
|
||||
- celli
|
||||
- list of cells on old mesh that connected to the old point
|
||||
- appended:
|
||||
- cellMap[celli] contains -1
|
||||
|
||||
|
||||
SourceFiles
|
||||
mapPolyMesh.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef mapPolyMesh_H
|
||||
#define mapPolyMesh_H
|
||||
|
||||
#include "labelList.H"
|
||||
#include "objectMap.H"
|
||||
#include "pointField.H"
|
||||
#include "HashSet.H"
|
||||
#include "Map.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
class polyMesh;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class mapPolyMesh Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class mapPolyMesh
|
||||
{
|
||||
// Private Data
|
||||
|
||||
//- Reference to polyMesh
|
||||
const polyMesh& mesh_;
|
||||
|
||||
//- Number of old live points
|
||||
const label nOldPoints_;
|
||||
|
||||
//- Number of old live faces
|
||||
const label nOldFaces_;
|
||||
|
||||
//- Number of old live cells
|
||||
const label nOldCells_;
|
||||
|
||||
//- Old point map.
|
||||
// Contains the old point label for all new points.
|
||||
// - for preserved points this is the old point label.
|
||||
// - for added points this is the master point ID
|
||||
// - for points added with no master, this is -1
|
||||
// Size of the list equals the size of new points
|
||||
const labelList pointMap_;
|
||||
|
||||
//- Points resulting from merging points
|
||||
const List<objectMap> pointsFromPointsMap_;
|
||||
|
||||
//- Old face map.
|
||||
// Contains a list of old face labels for every new face.
|
||||
// Size of the list equals the number of new faces
|
||||
// - for preserved faces this is the old face label.
|
||||
// - for faces added from faces this is the master face ID
|
||||
// - for faces added with no master, this is -1
|
||||
// - for faces added from points or edges, this is -1
|
||||
const labelList faceMap_;
|
||||
|
||||
//- Faces inflated from points
|
||||
const List<objectMap> facesFromPointsMap_;
|
||||
|
||||
//- Faces inflated from edges
|
||||
const List<objectMap> facesFromEdgesMap_;
|
||||
|
||||
//- Faces resulting from merging faces
|
||||
const List<objectMap> facesFromFacesMap_;
|
||||
|
||||
//- Old cell map.
|
||||
// Contains old cell label for all preserved cells.
|
||||
// Size of the list equals the number or preserved cells
|
||||
const labelList cellMap_;
|
||||
|
||||
//- Cells inflated from points
|
||||
const List<objectMap> cellsFromPointsMap_;
|
||||
|
||||
//- Cells inflated from edges
|
||||
const List<objectMap> cellsFromEdgesMap_;
|
||||
|
||||
//- Cells inflated from faces
|
||||
const List<objectMap> cellsFromFacesMap_;
|
||||
|
||||
//- Cells resulting from merging cells
|
||||
const List<objectMap> cellsFromCellsMap_;
|
||||
|
||||
//- Reverse point map
|
||||
const labelList reversePointMap_;
|
||||
|
||||
//- Reverse face map
|
||||
const labelList reverseFaceMap_;
|
||||
|
||||
//- Reverse cell map
|
||||
const labelList reverseCellMap_;
|
||||
|
||||
//- Map of flipped face flux faces
|
||||
const labelHashSet flipFaceFlux_;
|
||||
|
||||
//- Patch mesh point renumbering
|
||||
const labelListList patchPointMap_;
|
||||
|
||||
//- Point zone renumbering
|
||||
// For every preserved point in zone give the old position.
|
||||
// For added points, the index is set to -1
|
||||
const labelListList pointZoneMap_;
|
||||
|
||||
//- Face zone point renumbering
|
||||
// For every preserved point in zone give the old position.
|
||||
// For added points, the index is set to -1
|
||||
const labelListList faceZonePointMap_;
|
||||
|
||||
//- Face zone face renumbering
|
||||
// For every preserved face in zone give the old position.
|
||||
// For added faces, the index is set to -1
|
||||
const labelListList faceZoneFaceMap_;
|
||||
|
||||
//- Cell zone renumbering
|
||||
// For every preserved cell in zone give the old position.
|
||||
// For added cells, the index is set to -1
|
||||
const labelListList cellZoneMap_;
|
||||
|
||||
//- Pre-motion point positions.
|
||||
// This specifies the correct way of blowing up zero-volume objects
|
||||
const pointField preMotionPoints_;
|
||||
|
||||
//- List of the old patch sizes
|
||||
labelList oldPatchSizes_;
|
||||
|
||||
//- List of the old patch start labels
|
||||
const labelList oldPatchStarts_;
|
||||
|
||||
//- List of numbers of mesh points per old patch
|
||||
const labelList oldPatchNMeshPoints_;
|
||||
|
||||
//- Optional old cell volumes (for mapping)
|
||||
autoPtr<scalarField> oldCellVolumesPtr_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components. Copy (except for oldCellVolumes).
|
||||
mapPolyMesh
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const label nOldPoints,
|
||||
const label nOldFaces,
|
||||
const label nOldCells,
|
||||
const labelList& pointMap,
|
||||
const List<objectMap>& pointsFromPoints,
|
||||
const labelList& faceMap,
|
||||
const List<objectMap>& facesFromPoints,
|
||||
const List<objectMap>& facesFromEdges,
|
||||
const List<objectMap>& facesFromFaces,
|
||||
const labelList& cellMap,
|
||||
const List<objectMap>& cellsFromPoints,
|
||||
const List<objectMap>& cellsFromEdges,
|
||||
const List<objectMap>& cellsFromFaces,
|
||||
const List<objectMap>& cellsFromCells,
|
||||
const labelList& reversePointMap,
|
||||
const labelList& reverseFaceMap,
|
||||
const labelList& reverseCellMap,
|
||||
const labelHashSet& flipFaceFlux,
|
||||
const labelListList& patchPointMap,
|
||||
const labelListList& pointZoneMap,
|
||||
const labelListList& faceZonePointMap,
|
||||
const labelListList& faceZoneFaceMap,
|
||||
const labelListList& cellZoneMap,
|
||||
const pointField& preMotionPoints,
|
||||
const labelList& oldPatchStarts,
|
||||
const labelList& oldPatchNMeshPoints,
|
||||
const autoPtr<scalarField>& oldCellVolumesPtr
|
||||
);
|
||||
|
||||
//- Construct from components and optionally reuse storage
|
||||
mapPolyMesh
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const label nOldPoints,
|
||||
const label nOldFaces,
|
||||
const label nOldCells,
|
||||
labelList& pointMap,
|
||||
List<objectMap>& pointsFromPoints,
|
||||
labelList& faceMap,
|
||||
List<objectMap>& facesFromPoints,
|
||||
List<objectMap>& facesFromEdges,
|
||||
List<objectMap>& facesFromFaces,
|
||||
labelList& cellMap,
|
||||
List<objectMap>& cellsFromPoints,
|
||||
List<objectMap>& cellsFromEdges,
|
||||
List<objectMap>& cellsFromFaces,
|
||||
List<objectMap>& cellsFromCells,
|
||||
labelList& reversePointMap,
|
||||
labelList& reverseFaceMap,
|
||||
labelList& reverseCellMap,
|
||||
labelHashSet& flipFaceFlux,
|
||||
labelListList& patchPointMap,
|
||||
labelListList& pointZoneMap,
|
||||
labelListList& faceZonePointMap,
|
||||
labelListList& faceZoneFaceMap,
|
||||
labelListList& cellZoneMap,
|
||||
pointField& preMotionPoints,
|
||||
labelList& oldPatchStarts,
|
||||
labelList& oldPatchNMeshPoints,
|
||||
autoPtr<scalarField>& oldCellVolumesPtr,
|
||||
const bool reuse
|
||||
);
|
||||
|
||||
//- Disallow default bitwise copy construction
|
||||
mapPolyMesh(const mapPolyMesh&) = delete;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Access
|
||||
|
||||
//- Return polyMesh
|
||||
const polyMesh& mesh() const
|
||||
{
|
||||
return mesh_;
|
||||
}
|
||||
|
||||
//- Number of old points
|
||||
label nOldPoints() const
|
||||
{
|
||||
return nOldPoints_;
|
||||
}
|
||||
|
||||
//- Number of old internal faces
|
||||
label nOldInternalFaces() const
|
||||
{
|
||||
return oldPatchStarts_[0];
|
||||
}
|
||||
|
||||
//- Number of old faces
|
||||
label nOldFaces() const
|
||||
{
|
||||
return nOldFaces_;
|
||||
}
|
||||
|
||||
//- Number of old cells
|
||||
label nOldCells() const
|
||||
{
|
||||
return nOldCells_;
|
||||
}
|
||||
|
||||
//- Old point map.
|
||||
// Contains the old point label for all new points.
|
||||
// For preserved points this is the old point label.
|
||||
// For added points this is the master point ID
|
||||
const labelList& pointMap() const
|
||||
{
|
||||
return pointMap_;
|
||||
}
|
||||
|
||||
//- Points originating from points
|
||||
const List<objectMap>& pointsFromPointsMap() const
|
||||
{
|
||||
return pointsFromPointsMap_;
|
||||
}
|
||||
|
||||
//- Old face map.
|
||||
// Contains a list of old face labels for every new face.
|
||||
// Warning: this map contains invalid entries for new faces
|
||||
const labelList& faceMap() const
|
||||
{
|
||||
return faceMap_;
|
||||
}
|
||||
|
||||
//- Faces inflated from points
|
||||
const List<objectMap>& facesFromPointsMap() const
|
||||
{
|
||||
return facesFromPointsMap_;
|
||||
}
|
||||
|
||||
//- Faces inflated from edges
|
||||
const List<objectMap>& facesFromEdgesMap() const
|
||||
{
|
||||
return facesFromEdgesMap_;
|
||||
}
|
||||
|
||||
//- Faces originating from faces
|
||||
const List<objectMap>& facesFromFacesMap() const
|
||||
{
|
||||
return facesFromFacesMap_;
|
||||
}
|
||||
|
||||
//- Old cell map.
|
||||
// Contains old cell label for all preserved cells.
|
||||
const labelList& cellMap() const
|
||||
{
|
||||
return cellMap_;
|
||||
}
|
||||
|
||||
//- Cells inflated from points
|
||||
const List<objectMap>& cellsFromPointsMap() const
|
||||
{
|
||||
return cellsFromPointsMap_;
|
||||
}
|
||||
|
||||
//- Cells inflated from edges
|
||||
const List<objectMap>& cellsFromEdgesMap() const
|
||||
{
|
||||
return cellsFromEdgesMap_;
|
||||
}
|
||||
|
||||
//- Cells inflated from faces
|
||||
const List<objectMap>& cellsFromFacesMap() const
|
||||
{
|
||||
return cellsFromFacesMap_;
|
||||
}
|
||||
|
||||
//- Cells originating from cells
|
||||
const List<objectMap>& cellsFromCellsMap() const
|
||||
{
|
||||
return cellsFromCellsMap_;
|
||||
}
|
||||
|
||||
|
||||
// Reverse maps
|
||||
|
||||
//- Reverse point map
|
||||
// Contains new point label for all old and added points
|
||||
const labelList& reversePointMap() const
|
||||
{
|
||||
return reversePointMap_;
|
||||
}
|
||||
|
||||
//- If point is removed return point (on new mesh) it merged
|
||||
// into
|
||||
label mergedPoint(const label oldPointi) const
|
||||
{
|
||||
label i = reversePointMap_[oldPointi];
|
||||
|
||||
if (i == -1)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
else if (i < -1)
|
||||
{
|
||||
return -i-2;
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "old point label " << oldPointi
|
||||
<< " has reverseMap " << i << endl
|
||||
<< "Only call mergedPoint for removed points."
|
||||
<< abort(FatalError);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
//- Reverse face map
|
||||
// Contains new face label for all old and added faces
|
||||
const labelList& reverseFaceMap() const
|
||||
{
|
||||
return reverseFaceMap_;
|
||||
}
|
||||
|
||||
//- If face is removed return face (on new mesh) it merged into
|
||||
label mergedFace(const label oldFacei) const
|
||||
{
|
||||
label i = reverseFaceMap_[oldFacei];
|
||||
|
||||
if (i == -1)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
else if (i < -1)
|
||||
{
|
||||
return -i-2;
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "old face label " << oldFacei
|
||||
<< " has reverseMap " << i << endl
|
||||
<< "Only call mergedFace for removed faces."
|
||||
<< abort(FatalError);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
//- Reverse cell map
|
||||
// Contains new cell label for all old and added cells
|
||||
const labelList& reverseCellMap() const
|
||||
{
|
||||
return reverseCellMap_;
|
||||
}
|
||||
|
||||
//- If cell is removed return cell (on new mesh) it merged into
|
||||
label mergedCell(const label oldCelli) const
|
||||
{
|
||||
label i = reverseCellMap_[oldCelli];
|
||||
|
||||
if (i == -1)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
else if (i < -1)
|
||||
{
|
||||
return -i-2;
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "old cell label " << oldCelli
|
||||
<< " has reverseMap " << i << endl
|
||||
<< "Only call mergedCell for removed cells."
|
||||
<< abort(FatalError);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
//- Map of flipped face flux faces
|
||||
const labelHashSet& flipFaceFlux() const
|
||||
{
|
||||
return flipFaceFlux_;
|
||||
}
|
||||
|
||||
//- Patch point renumbering
|
||||
// For every preserved point on a patch give the old position.
|
||||
// For added points, the index is set to -1
|
||||
const labelListList& patchPointMap() const
|
||||
{
|
||||
return patchPointMap_;
|
||||
}
|
||||
|
||||
|
||||
// Zone mapping
|
||||
|
||||
//- Point zone renumbering
|
||||
// For every preserved point in zone give the old position.
|
||||
// For added points, the index is set to -1
|
||||
const labelListList& pointZoneMap() const
|
||||
{
|
||||
return pointZoneMap_;
|
||||
}
|
||||
|
||||
//- Face zone point renumbering
|
||||
// For every preserved point in zone give the old position.
|
||||
// For added points, the index is set to -1
|
||||
const labelListList& faceZonePointMap() const
|
||||
{
|
||||
return faceZonePointMap_;
|
||||
}
|
||||
|
||||
//- Face zone face renumbering
|
||||
// For every preserved face in zone give the old position.
|
||||
// For added faces, the index is set to -1
|
||||
const labelListList& faceZoneFaceMap() const
|
||||
{
|
||||
return faceZoneFaceMap_;
|
||||
}
|
||||
|
||||
//- Cell zone renumbering
|
||||
// For every preserved cell in zone give the old position.
|
||||
// For added cells, the index is set to -1
|
||||
const labelListList& cellZoneMap() const
|
||||
{
|
||||
return cellZoneMap_;
|
||||
}
|
||||
|
||||
//- Pre-motion point positions.
|
||||
// This specifies the correct way of blowing up
|
||||
// zero-volume objects
|
||||
const pointField& preMotionPoints() const
|
||||
{
|
||||
return preMotionPoints_;
|
||||
}
|
||||
|
||||
//- Has valid preMotionPoints?
|
||||
bool hasMotionPoints() const
|
||||
{
|
||||
return preMotionPoints_.size() > 0;
|
||||
}
|
||||
|
||||
|
||||
//- Return list of the old patch sizes
|
||||
const labelList& oldPatchSizes() const
|
||||
{
|
||||
return oldPatchSizes_;
|
||||
}
|
||||
|
||||
//- Return list of the old patch start labels
|
||||
const labelList& oldPatchStarts() const
|
||||
{
|
||||
return oldPatchStarts_;
|
||||
}
|
||||
|
||||
//- Return numbers of mesh points per old patch
|
||||
const labelList& oldPatchNMeshPoints() const
|
||||
{
|
||||
return oldPatchNMeshPoints_;
|
||||
}
|
||||
|
||||
|
||||
// Geometric mapping data
|
||||
|
||||
bool hasOldCellVolumes() const
|
||||
{
|
||||
return oldCellVolumesPtr_.valid();
|
||||
}
|
||||
|
||||
const scalarField& oldCellVolumes() const
|
||||
{
|
||||
return oldCellVolumesPtr_();
|
||||
}
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const mapPolyMesh&) = delete;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,202 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::mapSubsetMesh
|
||||
|
||||
Description
|
||||
Class containing mesh-to-mesh mapping information after a subset operation
|
||||
|
||||
SourceFiles
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef mapSubsetMesh_H
|
||||
#define mapSubsetMesh_H
|
||||
|
||||
#include "labelList.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class mapSubsetMesh Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class mapSubsetMesh
|
||||
{
|
||||
// Private Data
|
||||
|
||||
//- Number of old live points
|
||||
label nOldPoints_;
|
||||
|
||||
//- Number of old live faces
|
||||
label nOldFaces_;
|
||||
|
||||
//- Number of old live cells
|
||||
label nOldCells_;
|
||||
|
||||
//- Point mapping array
|
||||
const labelList pointMap_;
|
||||
|
||||
//- Face mapping array
|
||||
const labelList faceMap_;
|
||||
|
||||
//- Cell mapping array
|
||||
const labelList cellMap_;
|
||||
|
||||
//- Patch for exposed faces
|
||||
const label exposedPatchID_;
|
||||
|
||||
//- List of the old patch sizes
|
||||
labelList oldPatchSizes_;
|
||||
|
||||
//- List of the old patch start labels
|
||||
const labelList oldPatchStarts_;
|
||||
|
||||
//- List of numbers of mesh points per old patch
|
||||
const labelList oldPatchNMeshPoints_;
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
mapSubsetMesh
|
||||
(
|
||||
const label nOldPoints,
|
||||
const label nOldFaces,
|
||||
const label nOldCells,
|
||||
const labelList& pointMap,
|
||||
const labelList& faceMap,
|
||||
const labelList& cellMap,
|
||||
const label exposedPatchID,
|
||||
const labelList& oldPatchStarts,
|
||||
const labelList& oldPatchNMeshPoints
|
||||
);
|
||||
|
||||
//- Construct from components and optionally reuse storage
|
||||
mapSubsetMesh
|
||||
(
|
||||
const label nOldPoints,
|
||||
const label nOldFaces,
|
||||
const label nOldCells,
|
||||
labelList& pointMap,
|
||||
labelList& faceMap,
|
||||
labelList& cellMap,
|
||||
const label exposedPatchID,
|
||||
labelList& oldPatchStarts,
|
||||
labelList& oldPatchNMeshPoints,
|
||||
const bool reuse
|
||||
);
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Access
|
||||
|
||||
//- Number of old points
|
||||
label nOldPoints() const
|
||||
{
|
||||
return nOldPoints_;
|
||||
}
|
||||
|
||||
//- Number of old internal faces
|
||||
label nOldInternalFaces() const
|
||||
{
|
||||
return oldPatchStarts_[0];
|
||||
}
|
||||
|
||||
//- Number of old faces
|
||||
label nOldFaces() const
|
||||
{
|
||||
return nOldFaces_;
|
||||
}
|
||||
|
||||
//- Number of old cells
|
||||
label nOldCells() const
|
||||
{
|
||||
return nOldCells_;
|
||||
}
|
||||
|
||||
//- Patch that exposed faces were put into
|
||||
label exposedPatchID() const
|
||||
{
|
||||
return exposedPatchID_;
|
||||
}
|
||||
|
||||
//- Old point map.
|
||||
// Contains the old point label for all points of the subsetted
|
||||
// mesh
|
||||
const labelList& pointMap() const
|
||||
{
|
||||
return pointMap_;
|
||||
}
|
||||
|
||||
//- Old face map.
|
||||
// Contains the old point label for all faces of the subsetted
|
||||
// mesh
|
||||
const labelList& faceMap() const
|
||||
{
|
||||
return faceMap_;
|
||||
}
|
||||
|
||||
//- Old cell map.
|
||||
// Contains the old point label for all cells of the subsetted
|
||||
// mesh
|
||||
const labelList& cellMap() const
|
||||
{
|
||||
return cellMap_;
|
||||
}
|
||||
|
||||
//- Return list of the old patch sizes
|
||||
const labelList& oldPatchSizes() const
|
||||
{
|
||||
return oldPatchSizes_;
|
||||
}
|
||||
|
||||
//- Return list of the old patch start labels
|
||||
const labelList& oldPatchStarts() const
|
||||
{
|
||||
return oldPatchStarts_;
|
||||
}
|
||||
|
||||
//- Return numbers of mesh points per old patch
|
||||
const labelList& oldPatchNMeshPoints() const
|
||||
{
|
||||
return oldPatchNMeshPoints_;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,87 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::morphFieldMapper
|
||||
|
||||
Description
|
||||
Abstract base class to hold the Field mapping for mesh morphs.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef morphFieldMapper_H
|
||||
#define morphFieldMapper_H
|
||||
|
||||
#include "generalFieldMapper.H"
|
||||
#include "Map.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class morphFieldMapper Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class morphFieldMapper
|
||||
:
|
||||
public generalFieldMapper
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Null constructor
|
||||
morphFieldMapper()
|
||||
{}
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~morphFieldMapper()
|
||||
{}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return size of field before mapping
|
||||
virtual label sizeBeforeMapping() const = 0;
|
||||
|
||||
//- Are there any inserted objects
|
||||
virtual bool insertedObjects() const = 0;
|
||||
|
||||
//- Return list of inserted objects
|
||||
virtual const labelList& insertedObjectLabels() const = 0;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,121 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::objectMap
|
||||
|
||||
Description
|
||||
An objectMap is a pair of labels defining the mapping of an object from
|
||||
another object, e.g. a cell mapped from a point.
|
||||
|
||||
SourceFiles
|
||||
objectMapI.H
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef objectMap_H
|
||||
#define objectMap_H
|
||||
|
||||
#include "labelList.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// Forward declaration of friend functions and operators
|
||||
|
||||
class objectMap;
|
||||
inline bool operator==(const objectMap& a, const objectMap& b);
|
||||
inline bool operator!=(const objectMap& a, const objectMap& b);
|
||||
inline Ostream& operator<<(Ostream&, const objectMap&);
|
||||
inline Istream& operator>>(Istream&, objectMap&);
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class objectMap Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class objectMap
|
||||
{
|
||||
// Private Data
|
||||
|
||||
//- Object index
|
||||
label index_;
|
||||
|
||||
//- Master object index
|
||||
labelList masterObjects_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Null constructor for lists
|
||||
inline objectMap();
|
||||
|
||||
//- Construct from components
|
||||
inline objectMap(const label index, const labelList& master);
|
||||
|
||||
//- Construct from Istream
|
||||
inline objectMap(Istream&);
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return object index
|
||||
inline label& index();
|
||||
inline label index() const;
|
||||
|
||||
//- Return master object index
|
||||
inline labelList& masterObjects();
|
||||
inline const labelList& masterObjects() const;
|
||||
|
||||
|
||||
// Friend Operators
|
||||
|
||||
friend bool operator==(const objectMap& a, const objectMap& b);
|
||||
friend bool operator!=(const objectMap& a, const objectMap& b);
|
||||
|
||||
|
||||
// IOstream Operators
|
||||
|
||||
friend Ostream& operator<<(Ostream&, const objectMap&);
|
||||
|
||||
friend Istream& operator>>(Istream&, objectMap&);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "objectMapI.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,142 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Description
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "IOstreams.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
inline objectMap::objectMap()
|
||||
:
|
||||
index_(-1),
|
||||
masterObjects_(0)
|
||||
{}
|
||||
|
||||
|
||||
inline objectMap::objectMap(const label index, const labelList& master)
|
||||
:
|
||||
index_(index),
|
||||
masterObjects_(master)
|
||||
{}
|
||||
|
||||
|
||||
inline objectMap::objectMap(Istream& is)
|
||||
{
|
||||
// Read beginning of objectMap
|
||||
is.readBegin("objectMap");
|
||||
|
||||
is >> index_ >> static_cast<labelList&>(masterObjects_);
|
||||
|
||||
// Read master of objectMap
|
||||
is.readEnd("objectMap");
|
||||
|
||||
// Check state of Istream
|
||||
is.check("objectMap::objectMap(Istream&)");
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
label& objectMap::index()
|
||||
{
|
||||
return index_;
|
||||
}
|
||||
|
||||
|
||||
inline label objectMap::index() const
|
||||
{
|
||||
return index_;
|
||||
}
|
||||
|
||||
|
||||
inline labelList& objectMap::masterObjects()
|
||||
{
|
||||
return masterObjects_;
|
||||
}
|
||||
|
||||
|
||||
inline const labelList& objectMap::masterObjects() const
|
||||
{
|
||||
return masterObjects_;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * //
|
||||
|
||||
inline bool operator==(const objectMap& a, const objectMap& b)
|
||||
{
|
||||
return
|
||||
(
|
||||
(a.index_ == b.index_) && (a.masterObjects_ == b.masterObjects_)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
inline bool operator!=(const objectMap& a, const objectMap& b)
|
||||
{
|
||||
return (!(a == b));
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
|
||||
|
||||
inline Ostream& operator<<(Ostream& os, const objectMap& a)
|
||||
{
|
||||
os << token::BEGIN_LIST
|
||||
<< a.index_ << token::SPACE
|
||||
<< a.masterObjects_
|
||||
<< token::END_LIST;
|
||||
|
||||
// Check state of Ostream
|
||||
os.check("Ostream& operator<<(Ostream&, const objectMap&)");
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
|
||||
inline Istream& operator>>(Istream& is, objectMap& a)
|
||||
{
|
||||
is.readBegin("objectMap");
|
||||
is >> a.index_ >> a.masterObjects_;
|
||||
is.readEnd("objectMap");
|
||||
|
||||
// Check state of Istream
|
||||
is.check("Istream& operator>>(Istream&, objectMap&)");
|
||||
|
||||
return is;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // Master namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -63,7 +63,7 @@ namespace Foam
|
||||
|
||||
// Forward declaration of classes
|
||||
class globalMeshData;
|
||||
class mapPolyMesh;
|
||||
class polyTopoChangeMap;
|
||||
class polyMeshDistributionMap;
|
||||
class polyMeshTetDecomposition;
|
||||
class treeDataCell;
|
||||
@ -606,8 +606,8 @@ public:
|
||||
// time directories
|
||||
virtual readUpdateState readUpdate();
|
||||
|
||||
//- Update the mesh corresponding to given map
|
||||
virtual void updateMesh(const mapPolyMesh&);
|
||||
//- Update the mesh topology from the given map
|
||||
virtual void updateMesh(const polyTopoChangeMap&);
|
||||
|
||||
//- Update mesh corresponding to the given distribution map
|
||||
virtual void distribute(const polyMeshDistributionMap& map);
|
||||
|
||||
@ -552,11 +552,11 @@ public:
|
||||
void printLayout(Ostream& os) const;
|
||||
|
||||
//- Correct for topo change.
|
||||
void updateMesh(const mapPolyMesh&)
|
||||
void updateMesh(const polyTopoChangeMap&)
|
||||
{
|
||||
notImplemented
|
||||
(
|
||||
"distributionMap::updateMesh(const mapPolyMesh&)"
|
||||
"distributionMap::updateMesh(const polyTopoChangeMap&)"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -81,7 +81,7 @@ SourceFiles
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
class mapPolyMesh;
|
||||
class polyTopoChangeMap;
|
||||
class globalIndex;
|
||||
class PstreamBuffers;
|
||||
|
||||
@ -456,7 +456,7 @@ public:
|
||||
void printLayout(Ostream& os) const;
|
||||
|
||||
//- Correct for topo change.
|
||||
void updateMesh(const mapPolyMesh&)
|
||||
void updateMesh(const polyTopoChangeMap&)
|
||||
{
|
||||
NotImplemented;
|
||||
}
|
||||
|
||||
@ -42,7 +42,7 @@ SourceFiles
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
class mapPolyMesh;
|
||||
class polyTopoChangeMap;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class lagrangianDistributionMap Declaration
|
||||
@ -104,7 +104,7 @@ public:
|
||||
}
|
||||
|
||||
//- Correct for topo change.
|
||||
void updateMesh(const mapPolyMesh&)
|
||||
void updateMesh(const polyTopoChangeMap&)
|
||||
{
|
||||
NotImplemented;
|
||||
}
|
||||
|
||||
@ -48,7 +48,7 @@ SourceFiles
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
class mapPolyMesh;
|
||||
class polyTopoChangeMap;
|
||||
class polyMesh;
|
||||
|
||||
|
||||
@ -278,7 +278,7 @@ public:
|
||||
|
||||
|
||||
//- Correct for topo change.
|
||||
void updateMesh(const mapPolyMesh&)
|
||||
void updateMesh(const polyTopoChangeMap&)
|
||||
{
|
||||
NotImplemented;
|
||||
}
|
||||
|
||||
@ -27,7 +27,7 @@ Description
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "polyMesh.H"
|
||||
#include "mapPolyMesh.H"
|
||||
#include "polyTopoChangeMap.H"
|
||||
#include "Time.H"
|
||||
#include "globalMeshData.H"
|
||||
#include "pointMesh.H"
|
||||
@ -36,7 +36,7 @@ Description
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::polyMesh::updateMesh(const mapPolyMesh& mpm)
|
||||
void Foam::polyMesh::updateMesh(const polyTopoChangeMap& map)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
@ -79,13 +79,13 @@ void Foam::polyMesh::updateMesh(const mapPolyMesh& mpm)
|
||||
newMotionPoints.setSize(points_.size());
|
||||
|
||||
// Map the list
|
||||
newMotionPoints.map(oldMotionPoints, mpm.pointMap());
|
||||
newMotionPoints.map(oldMotionPoints, map.pointMap());
|
||||
|
||||
// Any points created out-of-nothing get set to the current coordinate
|
||||
// for lack of anything better.
|
||||
forAll(mpm.pointMap(), newPointi)
|
||||
forAll(map.pointMap(), newPointi)
|
||||
{
|
||||
if (mpm.pointMap()[newPointi] == -1)
|
||||
if (map.pointMap()[newPointi] == -1)
|
||||
{
|
||||
newMotionPoints[newPointi] = points_[newPointi];
|
||||
}
|
||||
@ -103,27 +103,27 @@ void Foam::polyMesh::updateMesh(const mapPolyMesh& mpm)
|
||||
newMotionCellCentres.setSize(cellCentres().size());
|
||||
|
||||
// Map the list
|
||||
newMotionCellCentres.map(oldMotionCellCentres, mpm.cellMap());
|
||||
newMotionCellCentres.map(oldMotionCellCentres, map.cellMap());
|
||||
|
||||
// Any points created out-of-nothing get set to the current coordinate
|
||||
// for lack of anything better.
|
||||
forAll(mpm.cellMap(), newCelli)
|
||||
forAll(map.cellMap(), newCelli)
|
||||
{
|
||||
if (mpm.cellMap()[newCelli] == -1)
|
||||
if (map.cellMap()[newCelli] == -1)
|
||||
{
|
||||
newMotionCellCentres[newCelli] = cellCentres()[newCelli];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
meshObject::updateMesh<polyMesh>(*this, mpm);
|
||||
meshObject::updateMesh<pointMesh>(*this, mpm);
|
||||
meshObject::updateMesh<polyMesh>(*this, map);
|
||||
meshObject::updateMesh<pointMesh>(*this, map);
|
||||
|
||||
// Reset valid directions (could change by faces put into empty patches)
|
||||
geometricD_ = Zero;
|
||||
solutionD_ = Zero;
|
||||
|
||||
const_cast<Time&>(time()).functionObjects().updateMesh(mpm);
|
||||
const_cast<Time&>(time()).functionObjects().updateMesh(map);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -29,7 +29,7 @@ License
|
||||
#include "polyMesh.H"
|
||||
#include "primitiveMesh.H"
|
||||
#include "demandDrivenData.H"
|
||||
#include "mapPolyMesh.H"
|
||||
#include "polyTopoChangeMap.H"
|
||||
#include "syncTools.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
@ -386,7 +386,7 @@ void Foam::faceZone::resetAddressing
|
||||
}
|
||||
|
||||
|
||||
void Foam::faceZone::updateMesh(const mapPolyMesh& mpm)
|
||||
void Foam::faceZone::updateMesh(const polyTopoChangeMap& map)
|
||||
{
|
||||
clearAddressing();
|
||||
|
||||
@ -394,7 +394,7 @@ void Foam::faceZone::updateMesh(const mapPolyMesh& mpm)
|
||||
boolList newFlipMap(flipMap_.size());
|
||||
label nFaces = 0;
|
||||
|
||||
const labelList& faceMap = mpm.reverseFaceMap();
|
||||
const labelList& faceMap = map.reverseFaceMap();
|
||||
|
||||
forAll(*this, i)
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -50,7 +50,7 @@ SourceFiles
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
class mapPolyMesh;
|
||||
class polyTopoChangeMap;
|
||||
|
||||
// Forward declaration of friend functions and operators
|
||||
|
||||
@ -291,7 +291,7 @@ public:
|
||||
virtual void movePoints(const pointField&);
|
||||
|
||||
//- Update for changes in topology
|
||||
virtual void updateMesh(const mapPolyMesh&);
|
||||
virtual void updateMesh(const polyTopoChangeMap&);
|
||||
|
||||
//- Write
|
||||
virtual void write(Ostream&) const;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2020 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2020-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -279,7 +279,7 @@ void Foam::polyMeshUnMergeCyclics(polyMesh& mesh, const scalar includedAngle)
|
||||
}
|
||||
}
|
||||
}
|
||||
autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh, false);
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh, false);
|
||||
|
||||
// Remove the (now) empty merged cyclic patches. Copy everything except the
|
||||
// merged cyclics into a patch list and use this then re-patch the mesh.
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -435,7 +435,7 @@ void Foam::attachDetach::setRefinement(polyTopoChange& ref) const
|
||||
}
|
||||
|
||||
|
||||
void Foam::attachDetach::updateMesh(const mapPolyMesh&)
|
||||
void Foam::attachDetach::updateMesh(const polyTopoChangeMap&)
|
||||
{
|
||||
// Mesh has changed topologically. Update local topological data
|
||||
const polyMesh& mesh = topoChanger().mesh();
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -214,7 +214,7 @@ public:
|
||||
virtual void modifyMotionPoints(pointField& motionPoints) const;
|
||||
|
||||
//- Force recalculation of locally stored data on topological change
|
||||
virtual void updateMesh(const mapPolyMesh&);
|
||||
virtual void updateMesh(const polyTopoChangeMap&);
|
||||
|
||||
//- Get reference to trigger times
|
||||
const scalarField& triggerTimes() const
|
||||
|
||||
@ -26,7 +26,7 @@ License
|
||||
#include "createShellMesh.H"
|
||||
#include "polyTopoChange.H"
|
||||
#include "meshTools.H"
|
||||
#include "mapPolyMesh.H"
|
||||
#include "polyTopoChangeMap.H"
|
||||
#include "polyAddPoint.H"
|
||||
#include "polyAddFace.H"
|
||||
#include "polyModifyFace.H"
|
||||
@ -903,7 +903,7 @@ void Foam::createShellMesh::setRefinement
|
||||
}
|
||||
|
||||
|
||||
void Foam::createShellMesh::updateMesh(const mapPolyMesh& map)
|
||||
void Foam::createShellMesh::updateMesh(const polyTopoChangeMap& map)
|
||||
{
|
||||
inplaceReorder(map.reverseCellMap(), cellToFaceMap_);
|
||||
inplaceReorder(map.reverseFaceMap(), faceToFaceMap_);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -49,7 +49,7 @@ namespace Foam
|
||||
{
|
||||
|
||||
// Forward declaration of classes
|
||||
class mapPolyMesh;
|
||||
class polyTopoChangeMap;
|
||||
class polyTopoChange;
|
||||
class globalMeshData;
|
||||
|
||||
@ -195,7 +195,7 @@ public:
|
||||
// Member Operators
|
||||
|
||||
//- Update any locally stored mesh information.
|
||||
void updateMesh(const mapPolyMesh&);
|
||||
void updateMesh(const polyTopoChangeMap&);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -334,7 +334,7 @@ void extrudePatchMesh::extrudeMesh(const List<polyPatch*>& regionPatches)
|
||||
meshMod
|
||||
);
|
||||
|
||||
autoPtr<mapPolyMesh> map = meshMod.changeMesh
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh
|
||||
(
|
||||
*this, // mesh to change
|
||||
false // inflate
|
||||
|
||||
@ -448,7 +448,7 @@ Foam::label Foam::fvMeshDistribute::findNonEmptyPatch() const
|
||||
}
|
||||
|
||||
|
||||
Foam::autoPtr<Foam::mapPolyMesh> Foam::fvMeshDistribute::deleteProcPatches
|
||||
Foam::autoPtr<Foam::polyTopoChangeMap> Foam::fvMeshDistribute::deleteProcPatches
|
||||
(
|
||||
const label destinationPatch
|
||||
)
|
||||
@ -487,7 +487,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::fvMeshDistribute::deleteProcPatches
|
||||
// destinationPatch is at the end and we have visited the patches in
|
||||
// incremental order.
|
||||
labelListList dummyFaceMaps;
|
||||
autoPtr<mapPolyMesh> map = repatch(newPatchID, dummyFaceMaps);
|
||||
autoPtr<polyTopoChangeMap> map = repatch(newPatchID, dummyFaceMaps);
|
||||
|
||||
|
||||
// Delete (now empty) processor patches.
|
||||
@ -519,7 +519,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::fvMeshDistribute::deleteProcPatches
|
||||
}
|
||||
|
||||
|
||||
Foam::autoPtr<Foam::mapPolyMesh> Foam::fvMeshDistribute::repatch
|
||||
Foam::autoPtr<Foam::polyTopoChangeMap> Foam::fvMeshDistribute::repatch
|
||||
(
|
||||
const labelList& newPatchID, // per boundary face -1 or new patchID
|
||||
labelListList& constructFaceMap
|
||||
@ -583,7 +583,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::fvMeshDistribute::repatch
|
||||
// shared points (see mergeSharedPoints below). So temporarily points
|
||||
// and edges do not match!
|
||||
|
||||
autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh_, false, true);
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh_, false, true);
|
||||
|
||||
// Update fields. No inflation, parallel sync.
|
||||
mapFields(map);
|
||||
@ -635,7 +635,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::fvMeshDistribute::repatch
|
||||
}
|
||||
|
||||
|
||||
Foam::autoPtr<Foam::mapPolyMesh> Foam::fvMeshDistribute::mergeSharedPoints
|
||||
Foam::autoPtr<Foam::polyTopoChangeMap> Foam::fvMeshDistribute::mergeSharedPoints
|
||||
(
|
||||
const labelList& pointToGlobalMaster,
|
||||
labelListList& constructPointMap
|
||||
@ -681,7 +681,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::fvMeshDistribute::mergeSharedPoints
|
||||
|
||||
if (returnReduce(pointToMaster.size(), sumOp<label>()) == 0)
|
||||
{
|
||||
return autoPtr<mapPolyMesh>(nullptr);
|
||||
return autoPtr<polyTopoChangeMap>(nullptr);
|
||||
}
|
||||
|
||||
// Create the mesh change engine to merge the points
|
||||
@ -775,7 +775,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::fvMeshDistribute::mergeSharedPoints
|
||||
}
|
||||
|
||||
// Change the mesh (no inflation). Note: parallel comms allowed.
|
||||
autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh_, false, true);
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh_, false, true);
|
||||
|
||||
// Update fields. No inflation, parallel sync.
|
||||
mapFields(map);
|
||||
@ -1240,7 +1240,7 @@ Foam::labelList Foam::fvMeshDistribute::mapPointData
|
||||
}
|
||||
|
||||
|
||||
Foam::autoPtr<Foam::mapPolyMesh> Foam::fvMeshDistribute::doRemoveCells
|
||||
Foam::autoPtr<Foam::polyTopoChangeMap> Foam::fvMeshDistribute::doRemoveCells
|
||||
(
|
||||
const labelList& cellsToRemove,
|
||||
const label oldInternalPatchi
|
||||
@ -1281,7 +1281,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::fvMeshDistribute::doRemoveCells
|
||||
saveInternalFields(tFlds);
|
||||
|
||||
// Change the mesh. No inflation. Note: no parallel comms allowed.
|
||||
autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh_, false, false);
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh_, false, false);
|
||||
|
||||
// Update fields
|
||||
mapFields(map);
|
||||
@ -1306,7 +1306,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::fvMeshDistribute::doRemoveCells
|
||||
}
|
||||
|
||||
|
||||
void Foam::fvMeshDistribute::mapFields(const mapPolyMesh& map)
|
||||
void Foam::fvMeshDistribute::mapFields(const polyTopoChangeMap& map)
|
||||
{
|
||||
meshObject::updateMesh<polyMesh>(mesh_, map);
|
||||
meshObject::updateMesh<pointMesh>(mesh_, map);
|
||||
@ -2013,7 +2013,8 @@ Foam::autoPtr<Foam::polyMeshDistributionMap> Foam::fvMeshDistribute::distribute
|
||||
// oldInternalPatchi.
|
||||
labelList repatchFaceMap;
|
||||
{
|
||||
autoPtr<mapPolyMesh> repatchMap = deleteProcPatches(oldInternalPatchi);
|
||||
autoPtr<polyTopoChangeMap> repatchMap =
|
||||
deleteProcPatches(oldInternalPatchi);
|
||||
|
||||
// Store face map (only face ordering that changed)
|
||||
repatchFaceMap = repatchMap().faceMap();
|
||||
@ -2351,7 +2352,7 @@ Foam::autoPtr<Foam::polyMeshDistributionMap> Foam::fvMeshDistribute::distribute
|
||||
const label oldInternalFaces = mesh_.nInternalFaces();
|
||||
|
||||
// Remove cells.
|
||||
autoPtr<mapPolyMesh> subMap
|
||||
autoPtr<polyTopoChangeMap> subMap
|
||||
(
|
||||
doRemoveCells
|
||||
(
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user