polyMeshMap: New mesh to mesh map for the new mapping update function mapMesh(const polyMeshMap&)
This new mapping structure is designed to support run-time mesh-to-mesh mapping to allow arbitrary changes to the mesh structure, for example during extreme motion requiring significant topology change including region disconnection etc.
This commit is contained in:
@ -162,7 +162,11 @@ void Foam::fv::VoFClouds::preUpdateMesh()
|
||||
}
|
||||
|
||||
|
||||
void Foam::fv::VoFClouds::updateMesh(const polyTopoChangeMap&)
|
||||
void Foam::fv::VoFClouds::topoChange(const polyTopoChangeMap&)
|
||||
{}
|
||||
|
||||
|
||||
void Foam::fv::VoFClouds::mapMesh(const polyMeshMap& map)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -148,8 +148,11 @@ public:
|
||||
//- Prepare for mesh update
|
||||
virtual void preUpdateMesh();
|
||||
|
||||
//- Update for mesh changes
|
||||
virtual void updateMesh(const polyTopoChangeMap&);
|
||||
//- Update topology using the given map
|
||||
virtual void topoChange(const polyTopoChangeMap&);
|
||||
|
||||
//- Update from another mesh using the given map
|
||||
virtual void mapMesh(const polyMeshMap&);
|
||||
|
||||
//- Redistribute or update using the given distribution map
|
||||
virtual void distribute(const polyDistributionMap&);
|
||||
|
||||
@ -222,12 +222,18 @@ void Foam::fv::VoFSolidificationMeltingSource::correct()
|
||||
}
|
||||
|
||||
|
||||
void Foam::fv::VoFSolidificationMeltingSource::updateMesh
|
||||
void Foam::fv::VoFSolidificationMeltingSource::topoChange
|
||||
(
|
||||
const polyTopoChangeMap& map
|
||||
)
|
||||
{
|
||||
set_.updateMesh(map);
|
||||
set_.topoChange(map);
|
||||
}
|
||||
|
||||
|
||||
void Foam::fv::VoFSolidificationMeltingSource::mapMesh(const polyMeshMap& map)
|
||||
{
|
||||
set_.mapMesh(map);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -190,8 +190,11 @@ public:
|
||||
|
||||
// Mesh motion
|
||||
|
||||
//- Update for mesh changes
|
||||
virtual void updateMesh(const polyTopoChangeMap&);
|
||||
//- Update topology using the given map
|
||||
virtual void topoChange(const polyTopoChangeMap&);
|
||||
|
||||
//- Update from another mesh using the given map
|
||||
virtual void mapMesh(const polyMeshMap&);
|
||||
|
||||
//- Redistribute or update using the given distribution map
|
||||
virtual void distribute(const polyDistributionMap&);
|
||||
|
||||
@ -153,7 +153,13 @@ void Foam::fv::VoFSurfaceFilm::addSup
|
||||
}
|
||||
|
||||
|
||||
void Foam::fv::VoFSurfaceFilm::updateMesh(const polyTopoChangeMap&)
|
||||
void Foam::fv::VoFSurfaceFilm::topoChange(const polyTopoChangeMap&)
|
||||
{
|
||||
NotImplemented;
|
||||
}
|
||||
|
||||
|
||||
void Foam::fv::VoFSurfaceFilm::mapMesh(const polyMeshMap& map)
|
||||
{
|
||||
NotImplemented;
|
||||
}
|
||||
|
||||
@ -135,8 +135,11 @@ public:
|
||||
|
||||
// Mesh changes
|
||||
|
||||
//- Update for mesh changes
|
||||
virtual void updateMesh(const polyTopoChangeMap&);
|
||||
//- Update topology using the given map
|
||||
virtual void topoChange(const polyTopoChangeMap&);
|
||||
|
||||
//- Update from another mesh using the given map
|
||||
virtual void mapMesh(const polyMeshMap&);
|
||||
|
||||
//- Redistribute or update using the given distribution map
|
||||
virtual void distribute(const polyDistributionMap&);
|
||||
|
||||
@ -207,7 +207,11 @@ void Foam::fv::VoFTurbulenceDamping::addSup
|
||||
}
|
||||
|
||||
|
||||
void Foam::fv::VoFTurbulenceDamping::updateMesh(const polyTopoChangeMap&)
|
||||
void Foam::fv::VoFTurbulenceDamping::topoChange(const polyTopoChangeMap&)
|
||||
{}
|
||||
|
||||
|
||||
void Foam::fv::VoFTurbulenceDamping::mapMesh(const polyMeshMap& map)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -174,8 +174,11 @@ public:
|
||||
|
||||
// Mesh changes
|
||||
|
||||
//- Update for mesh changes
|
||||
virtual void updateMesh(const polyTopoChangeMap&);
|
||||
//- Update topology using the given map
|
||||
virtual void topoChange(const polyTopoChangeMap&);
|
||||
|
||||
//- Update from another mesh using the given map
|
||||
virtual void mapMesh(const polyMeshMap&);
|
||||
|
||||
//- Redistribute or update using the given distribution map
|
||||
virtual void distribute(const polyDistributionMap&);
|
||||
|
||||
@ -202,7 +202,11 @@ void Foam::fv::VoFTurbulenceDamping::addSup
|
||||
}
|
||||
|
||||
|
||||
void Foam::fv::VoFTurbulenceDamping::updateMesh(const polyTopoChangeMap&)
|
||||
void Foam::fv::VoFTurbulenceDamping::topoChange(const polyTopoChangeMap&)
|
||||
{}
|
||||
|
||||
|
||||
void Foam::fv::VoFTurbulenceDamping::mapMesh(const polyMeshMap& map)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -173,8 +173,11 @@ public:
|
||||
|
||||
// Mesh changes
|
||||
|
||||
//- Update for mesh changes
|
||||
virtual void updateMesh(const polyTopoChangeMap&);
|
||||
//- Update topology using the given map
|
||||
virtual void topoChange(const polyTopoChangeMap&);
|
||||
|
||||
//- Update from another mesh using the given map
|
||||
virtual void mapMesh(const polyMeshMap&);
|
||||
|
||||
//- Redistribute or update using the given distribution map
|
||||
virtual void distribute(const polyDistributionMap&);
|
||||
|
||||
@ -304,7 +304,11 @@ void Foam::fv::interfaceTurbulenceDamping::addSup
|
||||
}
|
||||
|
||||
|
||||
void Foam::fv::interfaceTurbulenceDamping::updateMesh(const polyTopoChangeMap&)
|
||||
void Foam::fv::interfaceTurbulenceDamping::topoChange(const polyTopoChangeMap&)
|
||||
{}
|
||||
|
||||
|
||||
void Foam::fv::interfaceTurbulenceDamping::mapMesh(const polyMeshMap& map)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -194,8 +194,11 @@ public:
|
||||
|
||||
// Mesh changes
|
||||
|
||||
//- Update for mesh changes
|
||||
virtual void updateMesh(const polyTopoChangeMap&);
|
||||
//- Update topology using the given map
|
||||
virtual void topoChange(const polyTopoChangeMap&);
|
||||
|
||||
//- Update from another mesh using the given map
|
||||
virtual void mapMesh(const polyMeshMap&);
|
||||
|
||||
//- Redistribute or update using the given distribution map
|
||||
virtual void distribute(const polyDistributionMap&);
|
||||
|
||||
@ -235,13 +235,17 @@ void Foam::fv::phaseTurbulenceStabilisation::addSup
|
||||
}
|
||||
|
||||
|
||||
void Foam::fv::phaseTurbulenceStabilisation::updateMesh
|
||||
void Foam::fv::phaseTurbulenceStabilisation::topoChange
|
||||
(
|
||||
const polyTopoChangeMap&
|
||||
)
|
||||
{}
|
||||
|
||||
|
||||
void Foam::fv::phaseTurbulenceStabilisation::mapMesh(const polyMeshMap& map)
|
||||
{}
|
||||
|
||||
|
||||
void Foam::fv::phaseTurbulenceStabilisation::distribute
|
||||
(
|
||||
const polyDistributionMap&
|
||||
|
||||
@ -164,8 +164,11 @@ public:
|
||||
|
||||
// Mesh changes
|
||||
|
||||
//- Update for mesh changes
|
||||
virtual void updateMesh(const polyTopoChangeMap&);
|
||||
//- Update topology using the given map
|
||||
virtual void topoChange(const polyTopoChangeMap&);
|
||||
|
||||
//- Update from another mesh using the given map
|
||||
virtual void mapMesh(const polyMeshMap&);
|
||||
|
||||
//- Redistribute or update using the given distribution map
|
||||
virtual void distribute(const polyDistributionMap&);
|
||||
|
||||
@ -200,7 +200,7 @@ int main(int argc, char *argv[])
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh, inflate);
|
||||
|
||||
Info<< "Mapping fields" << nl << endl;
|
||||
mesh.updateMesh(map);
|
||||
mesh.topoChange(map);
|
||||
|
||||
// Move mesh (since morphing does not do this)
|
||||
if (map().hasMotionPoints())
|
||||
@ -210,7 +210,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
// Update numbering of cells/vertices.
|
||||
faceRemover.updateMesh(map);
|
||||
faceRemover.topoChange(map);
|
||||
|
||||
|
||||
Info<< "Writing fields" << nl << endl;
|
||||
|
||||
@ -277,7 +277,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
// Update fields
|
||||
Info<< nl << "-- mapping mesh data" << endl;
|
||||
mesh.updateMesh(map);
|
||||
mesh.topoChange(map);
|
||||
|
||||
// Inflate mesh
|
||||
if (map().hasMotionPoints())
|
||||
@ -288,7 +288,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
// Update numbering of cells/vertices.
|
||||
Info<< nl << "-- mapping hexRef8 data" << endl;
|
||||
meshCutter.updateMesh(map);
|
||||
meshCutter.topoChange(map);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1075,7 +1075,7 @@ int main(int argc, char *argv[])
|
||||
meshMod.changeMesh(subsetter.subMesh(), false);
|
||||
|
||||
// Update fields
|
||||
subsetter.subMesh().updateMesh(map);
|
||||
subsetter.subMesh().topoChange(map);
|
||||
|
||||
// Fix faces that get mapped to zero-sized patches (these don't get any
|
||||
// value)
|
||||
|
||||
@ -521,7 +521,7 @@ void subsetMesh
|
||||
}
|
||||
|
||||
// Update topology on cellRemover
|
||||
cellRemover.updateMesh(map());
|
||||
cellRemover.topoChange(map());
|
||||
|
||||
// Update refLevel for removed cells.
|
||||
const labelList& cellMap = map().cellMap();
|
||||
@ -547,7 +547,7 @@ void subsetMesh
|
||||
}
|
||||
|
||||
// Update cutCells for removed cells.
|
||||
cutCells.updateMesh(map());
|
||||
cutCells.topoChange(map());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -108,7 +108,7 @@ label mergePatchFaces
|
||||
map = meshMod.changeMesh(mesh, false, true);
|
||||
|
||||
// Update fields
|
||||
mesh.updateMesh(map);
|
||||
mesh.topoChange(map);
|
||||
|
||||
// Move mesh (since morphing does not do this)
|
||||
if (map().hasMotionPoints())
|
||||
@ -264,7 +264,7 @@ label mergePatchFaces
|
||||
map = meshMod.changeMesh(mesh, false, true);
|
||||
|
||||
// Update fields
|
||||
mesh.updateMesh(map);
|
||||
mesh.topoChange(map);
|
||||
|
||||
// Move mesh (since morphing does not do this)
|
||||
if (map().hasMotionPoints())
|
||||
@ -317,7 +317,7 @@ label mergeEdges(const scalar minCos, polyMesh& mesh)
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh, false, true);
|
||||
|
||||
// Update fields
|
||||
mesh.updateMesh(map);
|
||||
mesh.topoChange(map);
|
||||
|
||||
// Move mesh (since morphing does not do this)
|
||||
if (map().hasMotionPoints())
|
||||
|
||||
@ -461,7 +461,7 @@ void Foam::cellSplitter::setRefinement
|
||||
}
|
||||
|
||||
|
||||
void Foam::cellSplitter::updateMesh(const polyTopoChangeMap& map)
|
||||
void Foam::cellSplitter::topoChange(const polyTopoChangeMap& map)
|
||||
{
|
||||
// Create copy since we're deleting entries. Only if both cell and added
|
||||
// point get mapped do they get inserted.
|
||||
|
||||
@ -123,7 +123,7 @@ public:
|
||||
);
|
||||
|
||||
//- Force recalculation of locally stored data on topological change
|
||||
void updateMesh(const polyTopoChangeMap&);
|
||||
void topoChange(const polyTopoChangeMap&);
|
||||
|
||||
|
||||
// Access
|
||||
|
||||
@ -537,7 +537,7 @@ int main(int argc, char *argv[])
|
||||
mesh.movePoints(map().preMotionPoints());
|
||||
}
|
||||
|
||||
cutter.updateMesh(map());
|
||||
cutter.topoChange(map());
|
||||
|
||||
if (!overwrite)
|
||||
{
|
||||
@ -610,7 +610,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
// Not implemented yet:
|
||||
// cutter.updateMesh(map());
|
||||
// cutter.topoChange(map());
|
||||
|
||||
|
||||
if (!overwrite)
|
||||
@ -654,7 +654,7 @@ int main(int argc, char *argv[])
|
||||
mesh.movePoints(map().preMotionPoints());
|
||||
}
|
||||
|
||||
cutter.updateMesh(map());
|
||||
cutter.topoChange(map());
|
||||
|
||||
if (!overwrite)
|
||||
{
|
||||
|
||||
@ -145,10 +145,10 @@ int main(int argc, char *argv[])
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh, false);
|
||||
|
||||
// Update fields
|
||||
mesh.updateMesh(map);
|
||||
mesh.topoChange(map);
|
||||
|
||||
// Update numbering of cells/vertices.
|
||||
meshCutter.updateMesh(map);
|
||||
meshCutter.topoChange(map);
|
||||
|
||||
// Optionally inflate mesh
|
||||
if (map().hasMotionPoints())
|
||||
|
||||
@ -248,7 +248,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
// Update stored labels on meshCutter.
|
||||
cutter.updateMesh(map());
|
||||
cutter.topoChange(map());
|
||||
|
||||
Info<< "Finished refining" << endl;
|
||||
|
||||
|
||||
@ -138,7 +138,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh, false);
|
||||
|
||||
mesh.updateMesh(map);
|
||||
mesh.topoChange(map);
|
||||
|
||||
// Move mesh (since morphing does not do this)
|
||||
if (map().hasMotionPoints())
|
||||
@ -147,7 +147,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
// Update numbering of cells/vertices.
|
||||
faceRemover.updateMesh(map);
|
||||
faceRemover.topoChange(map);
|
||||
|
||||
if (!overwrite)
|
||||
{
|
||||
|
||||
@ -693,10 +693,10 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
// Update stored labels on meshCutter
|
||||
cutter.updateMesh(map());
|
||||
cutter.topoChange(map());
|
||||
|
||||
// Update cellSet
|
||||
cellsToCut.updateMesh(map());
|
||||
cellsToCut.topoChange(map());
|
||||
|
||||
Info<< "Remaining:" << cellsToCut.size() << endl;
|
||||
|
||||
|
||||
@ -424,7 +424,7 @@ int main(int argc, char *argv[])
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh, false);
|
||||
|
||||
// Update fields
|
||||
mesh.updateMesh(map);
|
||||
mesh.topoChange(map);
|
||||
|
||||
// Move mesh (since morphing does not do this)
|
||||
if (map().hasMotionPoints())
|
||||
@ -708,7 +708,7 @@ int main(int argc, char *argv[])
|
||||
mesh
|
||||
);
|
||||
|
||||
layerExtrude.updateMesh
|
||||
layerExtrude.topoChange
|
||||
(
|
||||
map(),
|
||||
identity(extrudePatch.size()),
|
||||
@ -884,7 +884,7 @@ int main(int argc, char *argv[])
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh, false);
|
||||
|
||||
// Update fields
|
||||
mesh.updateMesh(map);
|
||||
mesh.topoChange(map);
|
||||
|
||||
// Update stored data
|
||||
updateFaceLabels(map(), frontPatchFaces);
|
||||
@ -1016,7 +1016,7 @@ int main(int argc, char *argv[])
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh, false);
|
||||
|
||||
// Update fields
|
||||
mesh.updateMesh(map);
|
||||
mesh.topoChange(map);
|
||||
|
||||
// Update local data
|
||||
updateCellSet(map(), addedCellsSet);
|
||||
|
||||
@ -2312,7 +2312,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
|
||||
// Update numbering on extruder.
|
||||
extruder.updateMesh(shellMap);
|
||||
extruder.topoChange(shellMap);
|
||||
|
||||
|
||||
// Calculate offsets from shell mesh back to original mesh
|
||||
@ -2659,7 +2659,7 @@ int main(int argc, char *argv[])
|
||||
addBafflesMap = meshMod.changeMesh(mesh, false);
|
||||
|
||||
// Update fields
|
||||
mesh.updateMesh(addBafflesMap);
|
||||
mesh.topoChange(addBafflesMap);
|
||||
|
||||
|
||||
//XXXXXX
|
||||
|
||||
@ -253,7 +253,7 @@ int main(int argc, char *argv[])
|
||||
// Create a mesh from topo changes.
|
||||
autoPtr<polyTopoChangeMap> map = meshMod().changeMesh(mesh(), false);
|
||||
|
||||
mesh().updateMesh(map);
|
||||
mesh().topoChange(map);
|
||||
|
||||
{
|
||||
edgeCollapser collapser(mesh());
|
||||
@ -304,7 +304,7 @@ int main(int argc, char *argv[])
|
||||
autoPtr<polyTopoChangeMap> map
|
||||
= meshModCollapse.changeMesh(mesh(), false);
|
||||
|
||||
mesh().updateMesh(map);
|
||||
mesh().topoChange(map);
|
||||
}
|
||||
|
||||
if (!overwrite)
|
||||
|
||||
@ -119,7 +119,7 @@ public:
|
||||
void setRefinement(polyTopoChange&);
|
||||
|
||||
//- Force recalculation of locally stored data on topological change
|
||||
void updateMesh(const polyTopoChangeMap&)
|
||||
void topoChange(const polyTopoChangeMap&)
|
||||
{}
|
||||
|
||||
//- Force recalculation of locally stored data for mesh distribution
|
||||
|
||||
@ -246,10 +246,10 @@ void Foam::backgroundMeshDecomposition::initialRefinement()
|
||||
);
|
||||
|
||||
// Update fields
|
||||
mesh_.updateMesh(map);
|
||||
mesh_.topoChange(map);
|
||||
|
||||
// Update numbering of cells/vertices.
|
||||
meshCutter_.updateMesh(map);
|
||||
meshCutter_.topoChange(map);
|
||||
|
||||
{
|
||||
// Map volumeStatus
|
||||
@ -355,11 +355,11 @@ void Foam::backgroundMeshDecomposition::initialRefinement()
|
||||
);
|
||||
|
||||
// Update fields
|
||||
mesh_.updateMesh(map);
|
||||
mesh_.topoChange(map);
|
||||
|
||||
// Update numbering of cells/vertices.
|
||||
meshCutter_.updateMesh(map);
|
||||
cellRemover.updateMesh(map);
|
||||
meshCutter_.topoChange(map);
|
||||
cellRemover.topoChange(map);
|
||||
|
||||
{
|
||||
// Map volumeStatus
|
||||
@ -947,10 +947,10 @@ Foam::backgroundMeshDecomposition::distribute
|
||||
);
|
||||
|
||||
// Update fields
|
||||
mesh_.updateMesh(map);
|
||||
mesh_.topoChange(map);
|
||||
|
||||
// Update numbering of cells/vertices.
|
||||
meshCutter_.updateMesh(map);
|
||||
meshCutter_.topoChange(map);
|
||||
|
||||
Info<< " Background mesh refined from "
|
||||
<< returnReduce(map().nOldCells(), sumOp<label>())
|
||||
|
||||
@ -204,7 +204,7 @@ int main(int argc, char *argv[])
|
||||
autoPtr<polyTopoChangeMap> map =
|
||||
meshMod.changeMesh(pMesh, false);
|
||||
|
||||
pMesh.updateMesh(map);
|
||||
pMesh.topoChange(map);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -799,7 +799,7 @@ int main(int argc, char *argv[])
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh, false);
|
||||
|
||||
// Update fields
|
||||
mesh.updateMesh(map);
|
||||
mesh.topoChange(map);
|
||||
|
||||
|
||||
|
||||
|
||||
@ -219,7 +219,7 @@ int main(int argc, char *argv[])
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh, false);
|
||||
|
||||
// Update fields
|
||||
mesh.updateMesh(map);
|
||||
mesh.topoChange(map);
|
||||
|
||||
// Move mesh (since morphing does not do this)
|
||||
if (map().hasMotionPoints())
|
||||
|
||||
@ -124,7 +124,7 @@ int main(int argc, char *argv[])
|
||||
labelList(0), // oldPatchNMeshPoints,
|
||||
autoPtr<scalarField>() // oldCellVolumesPtr
|
||||
);
|
||||
refData.updateMesh(map);
|
||||
refData.topoChange(map);
|
||||
refData.write();
|
||||
|
||||
Info<< "End" << endl;
|
||||
|
||||
@ -512,7 +512,7 @@ int main(int argc, char *argv[])
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh, false);
|
||||
|
||||
// Update fields
|
||||
mesh.updateMesh(map);
|
||||
mesh.topoChange(map);
|
||||
|
||||
// Optionally inflate mesh
|
||||
if (map().hasMotionPoints())
|
||||
|
||||
@ -1003,7 +1003,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
|
||||
// Update fields
|
||||
mesh.updateMesh(map);
|
||||
mesh.topoChange(map);
|
||||
|
||||
// Update proc maps
|
||||
if
|
||||
@ -1319,7 +1319,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
cellSet cs(*iter());
|
||||
Info<< " " << cs.name() << endl;
|
||||
cs.updateMesh(map());
|
||||
cs.topoChange(map());
|
||||
cs.instance() = mesh.facesInstance();
|
||||
cs.write();
|
||||
}
|
||||
@ -1335,7 +1335,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
faceSet fs(*iter());
|
||||
Info<< " " << fs.name() << endl;
|
||||
fs.updateMesh(map());
|
||||
fs.topoChange(map());
|
||||
fs.instance() = mesh.facesInstance();
|
||||
fs.write();
|
||||
}
|
||||
@ -1351,7 +1351,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
pointSet ps(*iter());
|
||||
Info<< " " << ps.name() << endl;
|
||||
ps.updateMesh(map());
|
||||
ps.topoChange(map());
|
||||
ps.instance() = mesh.facesInstance();
|
||||
ps.write();
|
||||
}
|
||||
|
||||
@ -115,7 +115,7 @@ int main(int argc, char *argv[])
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh, false);
|
||||
|
||||
// Update fields
|
||||
mesh.updateMesh(map);
|
||||
mesh.topoChange(map);
|
||||
|
||||
// Move mesh (since morphing does not do this)
|
||||
if (map().hasMotionPoints())
|
||||
@ -131,7 +131,7 @@ int main(int argc, char *argv[])
|
||||
Info<< "Writing mesh to time " << runTime.timeName() << endl;
|
||||
mesh.write();
|
||||
|
||||
refData.updateMesh(map);
|
||||
refData.topoChange(map);
|
||||
refData.write();
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
@ -769,7 +769,7 @@ void createAndWriteRegion
|
||||
Info<< "Mapping fields" << endl;
|
||||
|
||||
// Map existing fields
|
||||
newMesh().updateMesh(map());
|
||||
newMesh().topoChange(map());
|
||||
|
||||
// Add subsetted fields
|
||||
subsetVolFields<volScalarField>
|
||||
|
||||
@ -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
|
||||
@ -168,7 +168,7 @@ int Foam::vtkPVFoam::setTime(int nRequest, const double requestTimes[])
|
||||
}
|
||||
|
||||
|
||||
void Foam::vtkPVFoam::updateMeshPartsStatus()
|
||||
void Foam::vtkPVFoam::topoChangePartsStatus()
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
@ -509,7 +509,7 @@ void Foam::vtkPVFoam::Update
|
||||
reader_->UpdateProgress(0.1);
|
||||
|
||||
// Set up mesh parts selection(s)
|
||||
updateMeshPartsStatus();
|
||||
topoChangePartsStatus();
|
||||
|
||||
reader_->UpdateProgress(0.15);
|
||||
|
||||
|
||||
@ -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
|
||||
@ -340,7 +340,7 @@ class vtkPVFoam
|
||||
// Update information helper functions
|
||||
|
||||
//- Update the mesh parts selected in the GUI
|
||||
void updateMeshPartsStatus();
|
||||
void topoChangePartsStatus();
|
||||
|
||||
//- Internal mesh info
|
||||
void updateInfoInternalMesh(vtkDataArraySelection*);
|
||||
|
||||
@ -179,9 +179,22 @@ void ${typeName}FvModel${SourceType}::addSup
|
||||
}
|
||||
|
||||
|
||||
void ${typeName}FvModel${SourceType}::updateMesh(const polyTopoChangeMap& map)
|
||||
bool ${typeName}FvModel${SourceType}::movePoints()
|
||||
{
|
||||
set_.updateMesh(map);
|
||||
set_.movePoints();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void ${typeName}FvModel${SourceType}::topoChange(const polyTopoChangeMap& map)
|
||||
{
|
||||
set_.topoChange(map);
|
||||
}
|
||||
|
||||
|
||||
void ${typeName}FvModel${SourceType}::mapMesh(const polyMeshMap& map)
|
||||
{
|
||||
set_.mapMesh(map);
|
||||
}
|
||||
|
||||
|
||||
@ -194,13 +207,6 @@ void ${typeName}FvModel${SourceType}::distribute
|
||||
}
|
||||
|
||||
|
||||
bool ${typeName}FvModel${SourceType}::movePoints()
|
||||
{
|
||||
set_.movePoints();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
@ -114,14 +114,17 @@ public:
|
||||
|
||||
// Mesh motion
|
||||
|
||||
//- Update for mesh changes
|
||||
virtual void updateMesh(const polyTopoChangeMap&);
|
||||
//- Update for mesh motion
|
||||
virtual bool movePoints();
|
||||
|
||||
//- Update topology using the given map
|
||||
virtual void topoChange(const polyTopoChangeMap&);
|
||||
|
||||
//- Update from another mesh using the given map
|
||||
virtual void mapMesh(const polyMeshMap&);
|
||||
|
||||
//- Redistribute or update using the given distribution map
|
||||
virtual void distribute(const polyDistributionMap&);
|
||||
|
||||
//- Update for mesh motion
|
||||
virtual bool movePoints();
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -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
|
||||
@ -25,7 +25,7 @@ License
|
||||
|
||||
#include "smoothDelta.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "FaceCellWave.H"
|
||||
#include "FvFaceCellWave.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
@ -43,47 +43,43 @@ namespace LESModels
|
||||
|
||||
void Foam::LESModels::smoothDelta::setChangedFaces
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const fvMesh& mesh,
|
||||
const volScalarField& delta,
|
||||
DynamicList<label>& changedFaces,
|
||||
DynamicList<labelPair>& changedFaces,
|
||||
DynamicList<deltaData>& changedFacesInfo
|
||||
)
|
||||
{
|
||||
for (label facei = 0; facei < mesh.nInternalFaces(); facei++)
|
||||
forAll(mesh.owner(), facei)
|
||||
{
|
||||
scalar ownDelta = delta[mesh.faceOwner()[facei]];
|
||||
|
||||
scalar neiDelta = delta[mesh.faceNeighbour()[facei]];
|
||||
const scalar ownDelta = delta[mesh.owner()[facei]];
|
||||
const scalar neiDelta = delta[mesh.neighbour()[facei]];
|
||||
|
||||
// Check if owner delta much larger than neighbour delta or vice versa
|
||||
|
||||
if (ownDelta > maxDeltaRatio_ * neiDelta)
|
||||
if (ownDelta > maxDeltaRatio_*neiDelta)
|
||||
{
|
||||
changedFaces.append(facei);
|
||||
changedFaces.append(labelPair(-1, facei));
|
||||
changedFacesInfo.append(deltaData(ownDelta));
|
||||
}
|
||||
else if (neiDelta > maxDeltaRatio_ * ownDelta)
|
||||
else if (neiDelta > maxDeltaRatio_*ownDelta)
|
||||
{
|
||||
changedFaces.append(facei);
|
||||
changedFaces.append(labelPair(-1, facei));
|
||||
changedFacesInfo.append(deltaData(neiDelta));
|
||||
}
|
||||
}
|
||||
|
||||
// Insert all faces of coupled patches no matter what. Let FaceCellWave
|
||||
// Insert all faces of coupled patches no matter what. Let FvFaceCellWave
|
||||
// sort it out.
|
||||
forAll(mesh.boundaryMesh(), patchi)
|
||||
forAll(mesh.boundary(), patchi)
|
||||
{
|
||||
const polyPatch& patch = mesh.boundaryMesh()[patchi];
|
||||
const fvPatch& patch = mesh.boundary()[patchi];
|
||||
|
||||
if (patch.coupled())
|
||||
{
|
||||
forAll(patch, patchFacei)
|
||||
{
|
||||
label meshFacei = patch.start() + patchFacei;
|
||||
const scalar ownDelta = delta[patch.faceCells()[patchFacei]];
|
||||
|
||||
scalar ownDelta = delta[mesh.faceOwner()[meshFacei]];
|
||||
|
||||
changedFaces.append(meshFacei);
|
||||
changedFaces.append(labelPair(patchi, patchFacei));
|
||||
changedFacesInfo.append(deltaData(ownDelta));
|
||||
}
|
||||
}
|
||||
@ -101,32 +97,40 @@ void Foam::LESModels::smoothDelta::calcDelta()
|
||||
const volScalarField& geometricDelta = geometricDelta_();
|
||||
|
||||
// Fill changed faces with info
|
||||
DynamicList<label> changedFaces(mesh.nFaces()/100 + 100);
|
||||
DynamicList<labelPair> changedFaces(mesh.nFaces()/100 + 100);
|
||||
DynamicList<deltaData> changedFacesInfo(changedFaces.size());
|
||||
|
||||
setChangedFaces(mesh, geometricDelta, changedFaces, changedFacesInfo);
|
||||
|
||||
// Set initial field on cells.
|
||||
List<deltaData> cellDeltaData(mesh.nCells());
|
||||
|
||||
forAll(geometricDelta, celli)
|
||||
{
|
||||
cellDeltaData[celli] = geometricDelta[celli];
|
||||
}
|
||||
|
||||
// Set initial field on faces.
|
||||
List<deltaData> faceDeltaData(mesh.nFaces());
|
||||
|
||||
List<deltaData> internalFaceDeltaData(mesh.nInternalFaces());
|
||||
List<List<deltaData>> patchFaceDeltaData
|
||||
(
|
||||
FvFaceCellWave<deltaData>::template
|
||||
sizesListList<List<List<deltaData>>>
|
||||
(
|
||||
FvFaceCellWave<deltaData>::template
|
||||
listListSizes(mesh.boundary()),
|
||||
deltaData()
|
||||
)
|
||||
);
|
||||
|
||||
// Propagate information over whole domain.
|
||||
FaceCellWave<deltaData, scalar> deltaCalc
|
||||
FvFaceCellWave<deltaData, scalar> deltaCalc
|
||||
(
|
||||
mesh,
|
||||
changedFaces,
|
||||
changedFacesInfo,
|
||||
faceDeltaData,
|
||||
internalFaceDeltaData,
|
||||
patchFaceDeltaData,
|
||||
cellDeltaData,
|
||||
mesh.globalData().nTotalCells()+1, // max iterations
|
||||
mesh.globalData().nTotalCells() + 1, // max iterations
|
||||
maxDeltaRatio_
|
||||
);
|
||||
|
||||
|
||||
@ -59,8 +59,12 @@ public:
|
||||
//- Public member class used by mesh-wave to propagate the delta-ratio
|
||||
class deltaData
|
||||
{
|
||||
// Private Member Data
|
||||
|
||||
//-
|
||||
scalar delta_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Update. Gets information from neighbouring face/cell and
|
||||
@ -90,13 +94,14 @@ public:
|
||||
|
||||
// Access
|
||||
|
||||
//-
|
||||
scalar delta() const
|
||||
{
|
||||
return delta_;
|
||||
}
|
||||
|
||||
|
||||
// Needed by FaceCellWave
|
||||
// Needed by FvFaceCellWave
|
||||
|
||||
//- Check whether origin has been changed at all or
|
||||
// still contains original (invalid) value.
|
||||
@ -108,7 +113,7 @@ public:
|
||||
template<class TrackingData>
|
||||
inline bool sameGeometry
|
||||
(
|
||||
const polyMesh&,
|
||||
const fvMesh&,
|
||||
const deltaData&,
|
||||
const scalar,
|
||||
TrackingData& td
|
||||
@ -118,7 +123,7 @@ public:
|
||||
template<class TrackingData>
|
||||
inline void transform
|
||||
(
|
||||
const polyPatch& patch,
|
||||
const fvPatch& patch,
|
||||
const label patchFacei,
|
||||
const transformer& transform,
|
||||
TrackingData& td
|
||||
@ -128,9 +133,9 @@ public:
|
||||
template<class TrackingData>
|
||||
inline bool updateCell
|
||||
(
|
||||
const polyMesh&,
|
||||
const fvMesh&,
|
||||
const label thisCelli,
|
||||
const label neighbourFacei,
|
||||
const labelPair& neighbourPatchAndFacei,
|
||||
const deltaData& neighbourInfo,
|
||||
const scalar tol,
|
||||
TrackingData& td
|
||||
@ -140,8 +145,8 @@ public:
|
||||
template<class TrackingData>
|
||||
inline bool updateFace
|
||||
(
|
||||
const polyMesh&,
|
||||
const label thisFacei,
|
||||
const fvMesh&,
|
||||
const labelPair& thisPatchAndFacei,
|
||||
const label neighbourCelli,
|
||||
const deltaData& neighbourInfo,
|
||||
const scalar tol,
|
||||
@ -152,8 +157,8 @@ public:
|
||||
template<class TrackingData>
|
||||
inline bool updateFace
|
||||
(
|
||||
const polyMesh&,
|
||||
const label thisFacei,
|
||||
const fvMesh&,
|
||||
const labelPair& thisPatchAndFacei,
|
||||
const deltaData& neighbourInfo,
|
||||
const scalar tol,
|
||||
TrackingData& td
|
||||
@ -165,18 +170,14 @@ public:
|
||||
|
||||
// Member Operators
|
||||
|
||||
// Needed for List IO
|
||||
inline bool operator==(const deltaData&) const;
|
||||
|
||||
inline bool operator!=(const deltaData&) const;
|
||||
|
||||
|
||||
// IOstream Operators
|
||||
|
||||
friend Ostream& operator<<
|
||||
(
|
||||
Ostream& os,
|
||||
const deltaData& wDist
|
||||
)
|
||||
friend Ostream& operator<<(Ostream& os, const deltaData& wDist)
|
||||
{
|
||||
return os << wDist.delta_;
|
||||
}
|
||||
@ -201,24 +202,24 @@ private:
|
||||
// Calculate the delta values
|
||||
void calcDelta();
|
||||
|
||||
//- Fill changedFaces (with face labels) and changedFacesInfo
|
||||
// (with delta).
|
||||
//- Fill changedPatchAndFaces (with patch and face labels) and
|
||||
// changedFacesInfo (with delta).
|
||||
// This is the initial set of faces from which to start the waves.
|
||||
// Since there might be lots of places with delta jumps we can follow
|
||||
// various strategies for this initial 'seed'.
|
||||
// - start from single cell/face and let FaceCellWave pick up all
|
||||
// - start from single cell/face and let FvFaceCellWave pick up all
|
||||
// others from there. might be quite a few waves before everything
|
||||
// settles.
|
||||
// - start from all faces. Lots of initial transfers.
|
||||
// We do something in between:
|
||||
// - start from all faces where there is a jump. Since we cannot easily
|
||||
// determine this across coupled patches (cyclic, processor)
|
||||
// introduce all faces of these and let FaceCellWave sort it out.
|
||||
// introduce all faces of these and let FvFaceCellWave sort it out.
|
||||
void setChangedFaces
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const fvMesh& mesh,
|
||||
const volScalarField& delta,
|
||||
DynamicList<label>& changedFaces,
|
||||
DynamicList<labelPair>& changedPatchAndFaces,
|
||||
DynamicList<deltaData>& changedFacesInfo
|
||||
);
|
||||
|
||||
|
||||
@ -23,6 +23,8 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "smoothDelta.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
template<class TrackingData>
|
||||
@ -53,7 +55,9 @@ inline bool Foam::LESModels::smoothDelta::deltaData::update
|
||||
else
|
||||
{
|
||||
// Neighbour is not too big for me or change is too small
|
||||
// Nothing changed.
|
||||
// ...
|
||||
|
||||
// Nothing changed
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -88,7 +92,7 @@ inline bool Foam::LESModels::smoothDelta::deltaData::valid
|
||||
template<class TrackingData>
|
||||
inline bool Foam::LESModels::smoothDelta::deltaData::sameGeometry
|
||||
(
|
||||
const polyMesh&,
|
||||
const fvMesh&,
|
||||
const deltaData&,
|
||||
const scalar,
|
||||
TrackingData& td
|
||||
@ -101,7 +105,7 @@ inline bool Foam::LESModels::smoothDelta::deltaData::sameGeometry
|
||||
template<class TrackingData>
|
||||
inline void Foam::LESModels::smoothDelta::deltaData::transform
|
||||
(
|
||||
const polyPatch& patch,
|
||||
const fvPatch& patch,
|
||||
const label patchFacei,
|
||||
const transformer& transform,
|
||||
TrackingData& td
|
||||
@ -112,9 +116,9 @@ inline void Foam::LESModels::smoothDelta::deltaData::transform
|
||||
template<class TrackingData>
|
||||
inline bool Foam::LESModels::smoothDelta::deltaData::updateCell
|
||||
(
|
||||
const polyMesh&,
|
||||
const label,
|
||||
const fvMesh&,
|
||||
const label,
|
||||
const labelPair&,
|
||||
const deltaData& neighbourWallInfo,
|
||||
const scalar tol,
|
||||
TrackingData& td
|
||||
@ -128,8 +132,8 @@ inline bool Foam::LESModels::smoothDelta::deltaData::updateCell
|
||||
template<class TrackingData>
|
||||
inline bool Foam::LESModels::smoothDelta::deltaData::updateFace
|
||||
(
|
||||
const polyMesh&,
|
||||
const label,
|
||||
const fvMesh&,
|
||||
const labelPair&,
|
||||
const label,
|
||||
const deltaData& neighbourWallInfo,
|
||||
const scalar tol,
|
||||
@ -144,8 +148,8 @@ inline bool Foam::LESModels::smoothDelta::deltaData::updateFace
|
||||
template<class TrackingData>
|
||||
inline bool Foam::LESModels::smoothDelta::deltaData::updateFace
|
||||
(
|
||||
const polyMesh&,
|
||||
const label,
|
||||
const fvMesh&,
|
||||
const labelPair&,
|
||||
const deltaData& neighbourWallInfo,
|
||||
const scalar tol,
|
||||
TrackingData& td
|
||||
|
||||
@ -25,8 +25,8 @@ License
|
||||
|
||||
#include "vanDriestDelta.H"
|
||||
#include "wallFvPatch.H"
|
||||
#include "patchDistWave.H"
|
||||
#include "wallPointYPlus.H"
|
||||
#include "fvPatchDistWave.H"
|
||||
#include "fvWallPointYPlus.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
@ -79,23 +79,21 @@ void Foam::LESModels::vanDriestDelta::calcDelta()
|
||||
}
|
||||
}
|
||||
|
||||
scalar cutOff = wallPointYPlus::yPlusCutOff;
|
||||
wallPointYPlus::yPlusCutOff = 500;
|
||||
scalar cutOff = fvWallPointYPlus::yPlusCutOff;
|
||||
fvWallPointYPlus::yPlusCutOff = 500;
|
||||
volScalarField y
|
||||
(
|
||||
volScalarField::New("y", mesh, dimensionedScalar(dimLength, great))
|
||||
);
|
||||
patchDistWave::wave<wallPointYPlus, fvPatchField>
|
||||
fvPatchDistWave::wave<fvWallPointYPlus>
|
||||
(
|
||||
mesh,
|
||||
mesh.boundaryMesh().findPatchIDs<wallPolyPatch>(),
|
||||
ystar.boundaryField(),
|
||||
y.primitiveFieldRef(),
|
||||
y.boundaryFieldRef(),
|
||||
ystar.primitiveFieldRef(),
|
||||
ystar.boundaryFieldRef()
|
||||
y,
|
||||
ystar
|
||||
);
|
||||
wallPointYPlus::yPlusCutOff = cutOff;
|
||||
fvWallPointYPlus::yPlusCutOff = cutOff;
|
||||
|
||||
delta_ = min
|
||||
(
|
||||
|
||||
@ -582,6 +582,9 @@ $(polyTopoChangeMap)/faceMapper/faceMapper.C
|
||||
$(polyTopoChangeMap)/cellMapper/cellMapper.C
|
||||
$(polyTopoChangeMap)/mapAddedPolyMesh.C
|
||||
|
||||
polyMeshMap = $(polyMesh)/polyMeshMap
|
||||
$(polyMeshMap)/polyMeshMap.C
|
||||
|
||||
polyDistributionMap = $(polyMesh)/polyDistributionMap
|
||||
$(polyDistributionMap)/distributionMap.C
|
||||
$(polyDistributionMap)/distributionMapBase.C
|
||||
|
||||
@ -128,17 +128,6 @@ bool Foam::IOOutputFilter<OutputFilter>::write(const bool write)
|
||||
}
|
||||
|
||||
|
||||
template<class OutputFilter>
|
||||
void Foam::IOOutputFilter<OutputFilter>::updateMesh
|
||||
(
|
||||
const polyTopoChangeMap& map
|
||||
)
|
||||
{
|
||||
read();
|
||||
OutputFilter::updateMesh(map);
|
||||
}
|
||||
|
||||
|
||||
template<class OutputFilter>
|
||||
void Foam::IOOutputFilter<OutputFilter>::movePoints(const polyMesh& mesh)
|
||||
{
|
||||
@ -147,4 +136,26 @@ void Foam::IOOutputFilter<OutputFilter>::movePoints(const polyMesh& mesh)
|
||||
}
|
||||
|
||||
|
||||
template<class OutputFilter>
|
||||
void Foam::IOOutputFilter<OutputFilter>::topoChange
|
||||
(
|
||||
const polyTopoChangeMap& map
|
||||
)
|
||||
{
|
||||
read();
|
||||
OutputFilter::topoChange(map);
|
||||
}
|
||||
|
||||
|
||||
template<class OutputFilter>
|
||||
void Foam::IOOutputFilter<OutputFilter>::mapMesh
|
||||
(
|
||||
const polyMeshMap& map
|
||||
)
|
||||
{
|
||||
read();
|
||||
OutputFilter::mapMesh(map);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -51,6 +51,7 @@ namespace Foam
|
||||
|
||||
// Forward declaration of classes
|
||||
class polyTopoChangeMap;
|
||||
class polyMeshMap;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class IOOutputFilter Declaration
|
||||
@ -125,12 +126,15 @@ public:
|
||||
//- Sample and write
|
||||
virtual bool write(const bool write = true);
|
||||
|
||||
//- Update for changes of mesh
|
||||
virtual void updateMesh(const polyTopoChangeMap& map);
|
||||
|
||||
//- Update for changes of mesh
|
||||
//- Update topology using the given map
|
||||
virtual void movePoints(const polyMesh& mesh);
|
||||
|
||||
//- Update topology using the given map
|
||||
virtual void topoChange(const polyTopoChangeMap& map);
|
||||
|
||||
//- Update from another mesh using the given map
|
||||
virtual void mapMesh(const polyMeshMap&);
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
|
||||
@ -156,12 +156,16 @@ Foam::scalar Foam::functionObject::timeToNextWrite()
|
||||
}
|
||||
|
||||
|
||||
void Foam::functionObject::updateMesh(const polyTopoChangeMap&)
|
||||
{}
|
||||
|
||||
|
||||
void Foam::functionObject::movePoints(const polyMesh&)
|
||||
{}
|
||||
|
||||
|
||||
void Foam::functionObject::topoChange(const polyTopoChangeMap&)
|
||||
{}
|
||||
|
||||
|
||||
void Foam::functionObject::mapMesh(const polyMeshMap&)
|
||||
{}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -133,6 +133,7 @@ namespace Foam
|
||||
class Time;
|
||||
class polyMesh;
|
||||
class polyTopoChangeMap;
|
||||
class polyMeshMap;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class functionObject Declaration
|
||||
@ -238,12 +239,15 @@ public:
|
||||
// time. Returns the write time, or vGreat.
|
||||
virtual scalar timeToNextWrite();
|
||||
|
||||
//- Update for changes of mesh
|
||||
virtual void updateMesh(const polyTopoChangeMap& map);
|
||||
|
||||
//- Update for changes of mesh
|
||||
//- Update topology using the given map
|
||||
virtual void movePoints(const polyMesh& mesh);
|
||||
|
||||
//- Update topology using the given map
|
||||
virtual void topoChange(const polyTopoChangeMap& map);
|
||||
|
||||
//- Update from another mesh using the given map
|
||||
virtual void mapMesh(const polyMeshMap&);
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
|
||||
@ -844,18 +844,6 @@ bool Foam::functionObjectList::read()
|
||||
}
|
||||
|
||||
|
||||
void Foam::functionObjectList::updateMesh(const polyTopoChangeMap& map)
|
||||
{
|
||||
if (execution_)
|
||||
{
|
||||
forAll(*this, oi)
|
||||
{
|
||||
operator[](oi).updateMesh(map);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::functionObjectList::movePoints(const polyMesh& mesh)
|
||||
{
|
||||
if (execution_)
|
||||
@ -868,4 +856,28 @@ void Foam::functionObjectList::movePoints(const polyMesh& mesh)
|
||||
}
|
||||
|
||||
|
||||
void Foam::functionObjectList::topoChange(const polyTopoChangeMap& map)
|
||||
{
|
||||
if (execution_)
|
||||
{
|
||||
forAll(*this, oi)
|
||||
{
|
||||
operator[](oi).topoChange(map);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::functionObjectList::mapMesh(const polyMeshMap& map)
|
||||
{
|
||||
if (execution_)
|
||||
{
|
||||
forAll(*this, oi)
|
||||
{
|
||||
operator[](oi).mapMesh(map);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -53,6 +53,7 @@ namespace Foam
|
||||
{
|
||||
|
||||
class polyTopoChangeMap;
|
||||
class polyMeshMap;
|
||||
class argList;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
@ -154,7 +155,7 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
~functionObjectList();
|
||||
virtual ~functionObjectList();
|
||||
|
||||
|
||||
// Member Functions
|
||||
@ -272,11 +273,14 @@ public:
|
||||
//- Return the time to the next write
|
||||
scalar timeToNextWrite();
|
||||
|
||||
//- Update for changes of mesh
|
||||
void updateMesh(const polyTopoChangeMap& map);
|
||||
//- Update topology using the given map
|
||||
virtual void movePoints(const polyMesh& mesh);
|
||||
|
||||
//- Update for changes of mesh
|
||||
void movePoints(const polyMesh& mesh);
|
||||
//- Update topology using the given map
|
||||
virtual void topoChange(const polyTopoChangeMap& map);
|
||||
|
||||
//- Update from another mesh using the given map
|
||||
virtual void mapMesh(const polyMeshMap&);
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
@ -26,6 +26,7 @@ License
|
||||
#include "timeControlFunctionObject.H"
|
||||
#include "polyMesh.H"
|
||||
#include "polyTopoChangeMap.H"
|
||||
#include "polyMeshMap.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
@ -197,18 +198,6 @@ bool Foam::functionObjects::timeControl::read(const dictionary& dict)
|
||||
}
|
||||
|
||||
|
||||
void Foam::functionObjects::timeControl::updateMesh
|
||||
(
|
||||
const polyTopoChangeMap& map
|
||||
)
|
||||
{
|
||||
if (active())
|
||||
{
|
||||
foPtr_->updateMesh(map);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::functionObjects::timeControl::movePoints(const polyMesh& mesh)
|
||||
{
|
||||
if (active())
|
||||
@ -218,4 +207,28 @@ void Foam::functionObjects::timeControl::movePoints(const polyMesh& mesh)
|
||||
}
|
||||
|
||||
|
||||
void Foam::functionObjects::timeControl::topoChange
|
||||
(
|
||||
const polyTopoChangeMap& map
|
||||
)
|
||||
{
|
||||
if (active())
|
||||
{
|
||||
foPtr_->topoChange(map);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::functionObjects::timeControl::mapMesh
|
||||
(
|
||||
const polyMeshMap& map
|
||||
)
|
||||
{
|
||||
if (active())
|
||||
{
|
||||
foPtr_->mapMesh(map);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -162,12 +162,15 @@ public:
|
||||
//- Read and set the function object if its data have changed
|
||||
virtual bool read(const dictionary&);
|
||||
|
||||
//- Update for changes of mesh
|
||||
virtual void updateMesh(const polyTopoChangeMap& map);
|
||||
|
||||
//- Update for changes of mesh
|
||||
//- Update topology using the given map
|
||||
virtual void movePoints(const polyMesh& mesh);
|
||||
|
||||
//- Update topology using the given map
|
||||
virtual void topoChange(const polyTopoChangeMap& map);
|
||||
|
||||
//- Update from another mesh using the given map
|
||||
virtual void mapMesh(const polyMeshMap&);
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
|
||||
@ -321,7 +321,7 @@ void Foam::meshObject::distribute
|
||||
|
||||
|
||||
template<class Mesh>
|
||||
void Foam::meshObject::updateMesh
|
||||
void Foam::meshObject::topoChange
|
||||
(
|
||||
objectRegistry& obr,
|
||||
const polyTopoChangeMap& map
|
||||
@ -334,7 +334,7 @@ void Foam::meshObject::updateMesh
|
||||
|
||||
if (meshObject::debug)
|
||||
{
|
||||
Pout<< "meshObject::updateMesh(objectRegistry&, "
|
||||
Pout<< "meshObject::topoChange(objectRegistry&, "
|
||||
"const polyTopoChangeMap& map) : updating " << Mesh::typeName
|
||||
<< " meshObjects for region " << obr.name() << endl;
|
||||
}
|
||||
@ -352,7 +352,53 @@ void Foam::meshObject::updateMesh
|
||||
{
|
||||
Pout<< " Updating " << iter()->name() << endl;
|
||||
}
|
||||
dynamic_cast<UpdateableMeshObject<Mesh>*>(iter())->updateMesh(map);
|
||||
dynamic_cast<UpdateableMeshObject<Mesh>*>(iter())->topoChange(map);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (meshObject::debug)
|
||||
{
|
||||
Pout<< " Destroying " << iter()->name() << endl;
|
||||
}
|
||||
obr.checkOut(*iter());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class Mesh>
|
||||
void Foam::meshObject::mapMesh
|
||||
(
|
||||
objectRegistry& obr,
|
||||
const polyMeshMap& map
|
||||
)
|
||||
{
|
||||
HashTable<GeometricMeshObject<Mesh>*> meshObjects
|
||||
(
|
||||
obr.lookupClass<GeometricMeshObject<Mesh>>()
|
||||
);
|
||||
|
||||
if (meshObject::debug)
|
||||
{
|
||||
Pout<< "meshObject::mapMesh(objectRegistry&, "
|
||||
"const polyMeshMap& map) : updating " << Mesh::typeName
|
||||
<< " meshObjects for region " << obr.name() << endl;
|
||||
}
|
||||
|
||||
forAllIter
|
||||
(
|
||||
typename HashTable<GeometricMeshObject<Mesh>*>,
|
||||
meshObjects,
|
||||
iter
|
||||
)
|
||||
{
|
||||
if (isA<UpdateableMeshObject<Mesh>>(*iter()))
|
||||
{
|
||||
if (meshObject::debug)
|
||||
{
|
||||
Pout<< " Updating " << iter()->name() << endl;
|
||||
}
|
||||
dynamic_cast<UpdateableMeshObject<Mesh>*>(iter())->mapMesh(map);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -51,13 +51,13 @@ Description
|
||||
- TopologicalMeshObject: mesh object to be deleted on topology change
|
||||
- GeometricMeshObject: mesh object to be deleted on geometry change
|
||||
- MoveableMeshObject: mesh object to be updated in movePoints
|
||||
- UpdateableMeshObject: mesh object to be updated in updateMesh or
|
||||
- UpdateableMeshObject: mesh object to be updated in topoChange or
|
||||
movePoints
|
||||
- PatchMeshObject: mesh object to be additionally updated patch changes
|
||||
|
||||
Note
|
||||
movePoints must be provided for MeshObjects of type MoveableMeshObject
|
||||
and both movePoints and updateMesh functions must exist, provided for
|
||||
and both movePoints and topoChange functions must exist, provided for
|
||||
MeshObjects of type UpdateableMeshObject.
|
||||
|
||||
SourceFiles
|
||||
@ -77,6 +77,7 @@ namespace Foam
|
||||
|
||||
// Forward declarations
|
||||
class polyTopoChangeMap;
|
||||
class polyMeshMap;
|
||||
class polyDistributionMap;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
@ -173,7 +174,10 @@ public:
|
||||
static void movePoints(objectRegistry&);
|
||||
|
||||
template<class Mesh>
|
||||
static void updateMesh(objectRegistry&, const polyTopoChangeMap&);
|
||||
static void topoChange(objectRegistry&, const polyTopoChangeMap&);
|
||||
|
||||
template<class Mesh>
|
||||
static void mapMesh(objectRegistry&, const polyMeshMap&);
|
||||
|
||||
template<class Mesh>
|
||||
static void distribute(objectRegistry&, const polyDistributionMap&);
|
||||
@ -321,7 +325,9 @@ public:
|
||||
DistributeableMeshObject<Mesh>(typeName, io)
|
||||
{}
|
||||
|
||||
virtual void updateMesh(const polyTopoChangeMap& map) = 0;
|
||||
virtual void topoChange(const polyTopoChangeMap& map) = 0;
|
||||
|
||||
virtual void mapMesh(const polyMeshMap& map) = 0;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -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
|
||||
@ -156,7 +156,7 @@ void Foam::pointBoundaryMesh::movePoints(const pointField& p)
|
||||
}
|
||||
|
||||
|
||||
void Foam::pointBoundaryMesh::updateMesh()
|
||||
void Foam::pointBoundaryMesh::topoChange()
|
||||
{
|
||||
PstreamBuffers pBufs(Pstream::defaultCommsType);
|
||||
|
||||
@ -168,14 +168,14 @@ void Foam::pointBoundaryMesh::updateMesh()
|
||||
{
|
||||
forAll(*this, patchi)
|
||||
{
|
||||
operator[](patchi).initUpdateMesh(pBufs);
|
||||
operator[](patchi).initTopoChange(pBufs);
|
||||
}
|
||||
|
||||
pBufs.finishedSends();
|
||||
|
||||
forAll(*this, patchi)
|
||||
{
|
||||
operator[](patchi).updateMesh(pBufs);
|
||||
operator[](patchi).topoChange(pBufs);
|
||||
}
|
||||
}
|
||||
else if (Pstream::defaultCommsType == Pstream::commsTypes::scheduled)
|
||||
@ -191,11 +191,11 @@ void Foam::pointBoundaryMesh::updateMesh()
|
||||
|
||||
if (patchSchedule[patchEvali].init)
|
||||
{
|
||||
operator[](patchi).initUpdateMesh(pBufs);
|
||||
operator[](patchi).initTopoChange(pBufs);
|
||||
}
|
||||
else
|
||||
{
|
||||
operator[](patchi).updateMesh(pBufs);
|
||||
operator[](patchi).topoChange(pBufs);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -227,7 +227,7 @@ void Foam::pointBoundaryMesh::shuffle
|
||||
pointPatchList::shuffle(newToOld);
|
||||
if (validBoundary)
|
||||
{
|
||||
updateMesh();
|
||||
topoChange();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
@ -103,14 +103,14 @@ public:
|
||||
void movePoints(const pointField&);
|
||||
|
||||
//- Correct pointBoundaryMesh after topology update
|
||||
void updateMesh();
|
||||
void topoChange();
|
||||
|
||||
//- Create pointBoundaryMesh from polyBoundaryMesh
|
||||
void reset(const polyBoundaryMesh&);
|
||||
|
||||
//- Reorders patches. Ordering does not have to be done in
|
||||
// ascending or descending order. Reordering has to be unique.
|
||||
// (is shuffle). If validBoundary calls updateMesh()
|
||||
// (is shuffle). If validBoundary calls topoChange()
|
||||
// after reordering to recalculate data (so call needs to be parallel
|
||||
// sync in that case)
|
||||
void shuffle(const labelUList& newToOld, const bool validBoundary);
|
||||
|
||||
@ -90,30 +90,6 @@ void Foam::pointMesh::reset(const bool validBoundary)
|
||||
}
|
||||
|
||||
|
||||
void Foam::pointMesh::updateMesh(const polyTopoChangeMap& map)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Pout<< "pointMesh::updateMesh(const polyTopoChangeMap&): "
|
||||
<< "Updating for topology changes." << endl;
|
||||
Pout<< endl;
|
||||
}
|
||||
boundary_.updateMesh();
|
||||
}
|
||||
|
||||
|
||||
void Foam::pointMesh::distribute(const polyDistributionMap& map)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Pout<< "pointMesh::distribute(const polyDistributionMap&): "
|
||||
<< "Distribute." << endl;
|
||||
Pout<< endl;
|
||||
}
|
||||
boundary_.updateMesh();
|
||||
}
|
||||
|
||||
|
||||
bool Foam::pointMesh::movePoints()
|
||||
{
|
||||
if (debug)
|
||||
@ -128,6 +104,42 @@ bool Foam::pointMesh::movePoints()
|
||||
}
|
||||
|
||||
|
||||
void Foam::pointMesh::topoChange(const polyTopoChangeMap& map)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Pout<< "pointMesh::topoChange(const polyTopoChangeMap&): "
|
||||
<< "Topology change." << endl;
|
||||
Pout<< endl;
|
||||
}
|
||||
boundary_.topoChange();
|
||||
}
|
||||
|
||||
|
||||
void Foam::pointMesh::mapMesh(const polyMeshMap& map)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Pout<< "pointMesh::mapMesh(const polyMeshMap&): "
|
||||
<< "Mesh mapping." << endl;
|
||||
Pout<< endl;
|
||||
}
|
||||
boundary_.topoChange();
|
||||
}
|
||||
|
||||
|
||||
void Foam::pointMesh::distribute(const polyDistributionMap& map)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Pout<< "pointMesh::distribute(const polyDistributionMap&): "
|
||||
<< "Distribute." << endl;
|
||||
Pout<< endl;
|
||||
}
|
||||
boundary_.topoChange();
|
||||
}
|
||||
|
||||
|
||||
void Foam::pointMesh::reorderPatches
|
||||
(
|
||||
const labelUList& newToOld,
|
||||
|
||||
@ -118,15 +118,18 @@ public:
|
||||
|
||||
// Mesh callbacks
|
||||
|
||||
//- Move points
|
||||
virtual bool movePoints();
|
||||
|
||||
//- Update the mesh corresponding to given map
|
||||
virtual void updateMesh(const polyTopoChangeMap&);
|
||||
virtual void topoChange(const polyTopoChangeMap&);
|
||||
|
||||
//- Update from another mesh using the given map
|
||||
virtual void mapMesh(const polyMeshMap&);
|
||||
|
||||
//- Redistribute or update using the given distribution map
|
||||
virtual void distribute(const polyDistributionMap&);
|
||||
|
||||
//- Move points
|
||||
virtual bool movePoints();
|
||||
|
||||
//- Reordered/removed trailing patches. If validBoundary call is
|
||||
// parallel synced and all add the same patch with same settings
|
||||
virtual void reorderPatches
|
||||
|
||||
@ -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
|
||||
@ -77,10 +77,10 @@ protected:
|
||||
virtual void movePoints(PstreamBuffers&, const pointField&) = 0;
|
||||
|
||||
//- Initialise the update of the patch topology
|
||||
virtual void initUpdateMesh(PstreamBuffers&) = 0;
|
||||
virtual void initTopoChange(PstreamBuffers&) = 0;
|
||||
|
||||
//- Update of the patch topology
|
||||
virtual void updateMesh(PstreamBuffers&) = 0;
|
||||
virtual void topoChange(PstreamBuffers&) = 0;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
@ -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
|
||||
@ -62,16 +62,16 @@ void Foam::cyclicPointPatch::movePoints(PstreamBuffers&, const pointField&)
|
||||
{}
|
||||
|
||||
|
||||
void Foam::cyclicPointPatch::initUpdateMesh(PstreamBuffers& pBufs)
|
||||
void Foam::cyclicPointPatch::initTopoChange(PstreamBuffers& pBufs)
|
||||
{
|
||||
facePointPatch::initUpdateMesh(pBufs);
|
||||
facePointPatch::initTopoChange(pBufs);
|
||||
cyclicPointPatch::initCalcGeometry(pBufs);
|
||||
}
|
||||
|
||||
|
||||
void Foam::cyclicPointPatch::updateMesh(PstreamBuffers& pBufs)
|
||||
void Foam::cyclicPointPatch::topoChange(PstreamBuffers& pBufs)
|
||||
{
|
||||
facePointPatch::updateMesh(pBufs);
|
||||
facePointPatch::topoChange(pBufs);
|
||||
cyclicPointPatch::calcGeometry(pBufs);
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
@ -82,10 +82,10 @@ class cyclicPointPatch
|
||||
virtual void movePoints(PstreamBuffers&, const pointField&);
|
||||
|
||||
//- Initialise the update of the patch topology
|
||||
virtual void initUpdateMesh(PstreamBuffers&);
|
||||
virtual void initTopoChange(PstreamBuffers&);
|
||||
|
||||
//- Update of the patch topology
|
||||
virtual void updateMesh(PstreamBuffers&);
|
||||
virtual void topoChange(PstreamBuffers&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
@ -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
|
||||
@ -88,16 +88,16 @@ void Foam::processorPointPatch::movePoints(PstreamBuffers&, const pointField&)
|
||||
{}
|
||||
|
||||
|
||||
void Foam::processorPointPatch::initUpdateMesh(PstreamBuffers& pBufs)
|
||||
void Foam::processorPointPatch::initTopoChange(PstreamBuffers& pBufs)
|
||||
{
|
||||
facePointPatch::initUpdateMesh(pBufs);
|
||||
facePointPatch::initTopoChange(pBufs);
|
||||
processorPointPatch::initCalcGeometry(pBufs);
|
||||
}
|
||||
|
||||
|
||||
void Foam::processorPointPatch::updateMesh(PstreamBuffers& pBufs)
|
||||
void Foam::processorPointPatch::topoChange(PstreamBuffers& pBufs)
|
||||
{
|
||||
facePointPatch::updateMesh(pBufs);
|
||||
facePointPatch::topoChange(pBufs);
|
||||
processorPointPatch::calcGeometry(pBufs);
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
@ -81,10 +81,10 @@ class processorPointPatch
|
||||
virtual void movePoints(PstreamBuffers&, const pointField&);
|
||||
|
||||
//- Initialise the update of the patch topology
|
||||
virtual void initUpdateMesh(PstreamBuffers&);
|
||||
virtual void initTopoChange(PstreamBuffers&);
|
||||
|
||||
//- Update of the patch topology
|
||||
virtual void updateMesh(PstreamBuffers&);
|
||||
virtual void topoChange(PstreamBuffers&);
|
||||
|
||||
|
||||
//- 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-2020 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -66,13 +66,13 @@ void facePointPatch::movePoints(PstreamBuffers&, const pointField&)
|
||||
{}
|
||||
|
||||
|
||||
void facePointPatch::initUpdateMesh(PstreamBuffers& pBufs)
|
||||
void facePointPatch::initTopoChange(PstreamBuffers& pBufs)
|
||||
{
|
||||
facePointPatch::initCalcGeometry(pBufs);
|
||||
}
|
||||
|
||||
|
||||
void facePointPatch::updateMesh(PstreamBuffers&)
|
||||
void facePointPatch::topoChange(PstreamBuffers&)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -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
|
||||
@ -79,10 +79,10 @@ protected:
|
||||
virtual void movePoints(PstreamBuffers&, const pointField&);
|
||||
|
||||
//- Initialise the update of the patch topology
|
||||
virtual void initUpdateMesh(PstreamBuffers&);
|
||||
virtual void initTopoChange(PstreamBuffers&);
|
||||
|
||||
//- Update of the patch topology
|
||||
virtual void updateMesh(PstreamBuffers&);
|
||||
virtual void topoChange(PstreamBuffers&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
@ -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
|
||||
@ -86,11 +86,11 @@ protected:
|
||||
{}
|
||||
|
||||
//- Initialise the update of the patch topology
|
||||
virtual void initUpdateMesh(PstreamBuffers&)
|
||||
virtual void initTopoChange(PstreamBuffers&)
|
||||
{}
|
||||
|
||||
//- Update of the patch topology
|
||||
virtual void updateMesh(PstreamBuffers&)
|
||||
virtual void topoChange(PstreamBuffers&)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -1784,7 +1784,7 @@ Foam::globalMeshData::globalMeshData(const polyMesh& mesh)
|
||||
sharedEdgeLabelsPtr_(nullptr),
|
||||
sharedEdgeAddrPtr_(nullptr)
|
||||
{
|
||||
updateMesh();
|
||||
topoChange();
|
||||
}
|
||||
|
||||
|
||||
@ -2761,7 +2761,7 @@ void Foam::globalMeshData::movePoints(const pointField& newPoints)
|
||||
}
|
||||
|
||||
|
||||
void Foam::globalMeshData::updateMesh()
|
||||
void Foam::globalMeshData::topoChange()
|
||||
{
|
||||
// Clear out old data
|
||||
clearOut();
|
||||
|
||||
@ -626,7 +626,7 @@ public:
|
||||
//- Change global mesh data given a topological change. Does a
|
||||
// full parallel analysis to determine shared points and
|
||||
// boundaries.
|
||||
void updateMesh();
|
||||
void topoChange();
|
||||
|
||||
|
||||
// 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-2021 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -1056,7 +1056,7 @@ void Foam::polyBoundaryMesh::movePoints(const pointField& p)
|
||||
}
|
||||
|
||||
|
||||
void Foam::polyBoundaryMesh::updateMesh()
|
||||
void Foam::polyBoundaryMesh::topoChange()
|
||||
{
|
||||
nbrEdgesPtr_.clear();
|
||||
patchIDPtr_.clear();
|
||||
@ -1072,14 +1072,14 @@ void Foam::polyBoundaryMesh::updateMesh()
|
||||
{
|
||||
forAll(*this, patchi)
|
||||
{
|
||||
operator[](patchi).initUpdateMesh(pBufs);
|
||||
operator[](patchi).initTopoChange(pBufs);
|
||||
}
|
||||
|
||||
pBufs.finishedSends();
|
||||
|
||||
forAll(*this, patchi)
|
||||
{
|
||||
operator[](patchi).updateMesh(pBufs);
|
||||
operator[](patchi).topoChange(pBufs);
|
||||
}
|
||||
}
|
||||
else if (Pstream::defaultCommsType == Pstream::commsTypes::scheduled)
|
||||
@ -1095,11 +1095,11 @@ void Foam::polyBoundaryMesh::updateMesh()
|
||||
|
||||
if (patchSchedule[patchEvali].init)
|
||||
{
|
||||
operator[](patchi).initUpdateMesh(pBufs);
|
||||
operator[](patchi).initTopoChange(pBufs);
|
||||
}
|
||||
else
|
||||
{
|
||||
operator[](patchi).updateMesh(pBufs);
|
||||
operator[](patchi).topoChange(pBufs);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1123,7 +1123,7 @@ void Foam::polyBoundaryMesh::renamePatches
|
||||
|
||||
if (validBoundary)
|
||||
{
|
||||
updateMesh();
|
||||
topoChange();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1149,7 +1149,7 @@ void Foam::polyBoundaryMesh::reorderPatches
|
||||
|
||||
if (validBoundary)
|
||||
{
|
||||
updateMesh();
|
||||
topoChange();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
@ -219,16 +219,16 @@ public:
|
||||
void movePoints(const pointField&);
|
||||
|
||||
//- Correct polyBoundaryMesh after topology update
|
||||
void updateMesh();
|
||||
void topoChange();
|
||||
|
||||
//- Rename the patches. If validBoundary is set this calls updateMesh()
|
||||
//- Rename the patches. If validBoundary is set this calls topoChange()
|
||||
// after reordering to recalculate data (so the call needs to be
|
||||
// parallel synchronised).
|
||||
void renamePatches(const wordUList& newNames, const bool validBoundary);
|
||||
|
||||
//- Reorders the patches. Ordering does not have to be done in
|
||||
// ascending or descending order. Reordering has to be unique (is a
|
||||
// shuffle). If validBoundary is set this calls updateMesh() after
|
||||
// shuffle). If validBoundary is set this calls topoChange() after
|
||||
// reordering to recalculate data (so the call needs to be parallel
|
||||
// synchronised).
|
||||
void reorderPatches
|
||||
|
||||
@ -551,19 +551,12 @@ public:
|
||||
// storage (local data first, then non-local data)
|
||||
void printLayout(Ostream& os) const;
|
||||
|
||||
//- Correct for topo change.
|
||||
void updateMesh(const polyTopoChangeMap&)
|
||||
{
|
||||
notImplemented
|
||||
(
|
||||
"distributionMap::updateMesh(const polyTopoChangeMap&)"
|
||||
);
|
||||
}
|
||||
|
||||
// Member Operators
|
||||
|
||||
void operator=(const distributionMap&);
|
||||
|
||||
|
||||
// IOstream Operators
|
||||
|
||||
//- Read dictionary from Istream
|
||||
@ -571,7 +564,6 @@ public:
|
||||
|
||||
//- Write dictionary to Ostream
|
||||
friend Ostream& operator<<(Ostream&, const distributionMap&);
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -81,11 +81,9 @@ SourceFiles
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
class polyTopoChangeMap;
|
||||
class globalIndex;
|
||||
class PstreamBuffers;
|
||||
|
||||
|
||||
// Forward declaration of friend functions and operators
|
||||
|
||||
class distributionMapBase;
|
||||
@ -455,12 +453,6 @@ public:
|
||||
// storage (local data first, then non-local data)
|
||||
void printLayout(Ostream& os) const;
|
||||
|
||||
//- Correct for topo change.
|
||||
void updateMesh(const polyTopoChangeMap&)
|
||||
{
|
||||
NotImplemented;
|
||||
}
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
|
||||
@ -42,8 +42,6 @@ SourceFiles
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
class polyTopoChangeMap;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class lagrangianDistributionMap Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
@ -102,12 +100,6 @@ public:
|
||||
{
|
||||
particleMap_.distribute(lst);
|
||||
}
|
||||
|
||||
//- Correct for topo change.
|
||||
void updateMesh(const polyTopoChangeMap&)
|
||||
{
|
||||
NotImplemented;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -48,10 +48,8 @@ SourceFiles
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
class polyTopoChangeMap;
|
||||
class polyMesh;
|
||||
|
||||
|
||||
// Forward declaration of friend functions and operators
|
||||
|
||||
class polyDistributionMap;
|
||||
@ -277,13 +275,6 @@ public:
|
||||
void distributePatchIndices(labelList& patchIDs) const;
|
||||
|
||||
|
||||
//- Correct for topo change.
|
||||
void updateMesh(const polyTopoChangeMap&)
|
||||
{
|
||||
NotImplemented;
|
||||
}
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
void operator=(const polyDistributionMap&);
|
||||
|
||||
@ -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
|
||||
@ -321,7 +321,7 @@ Foam::polyMesh::polyMesh(const IOobject& io)
|
||||
}
|
||||
|
||||
// Calculate topology for the patches (processor-processor comms etc.)
|
||||
boundary_.updateMesh();
|
||||
boundary_.topoChange();
|
||||
|
||||
// Calculate the geometry for the patches (transformation tensors etc.)
|
||||
boundary_.calcGeometry();
|
||||
@ -750,7 +750,7 @@ void Foam::polyMesh::resetPrimitives
|
||||
// processor-processor comms.
|
||||
|
||||
// Calculate topology for the patches (processor-processor comms etc.)
|
||||
boundary_.updateMesh();
|
||||
boundary_.topoChange();
|
||||
|
||||
// Calculate the geometry for the patches (transformation tensors etc.)
|
||||
boundary_.calcGeometry();
|
||||
@ -939,7 +939,7 @@ void Foam::polyMesh::addPatches
|
||||
if (validBoundary)
|
||||
{
|
||||
// Calculate topology for the patches (processor-processor comms etc.)
|
||||
boundary_.updateMesh();
|
||||
boundary_.topoChange();
|
||||
|
||||
// Calculate the geometry for the patches (transformation tensors etc.)
|
||||
boundary_.calcGeometry();
|
||||
@ -1119,7 +1119,7 @@ void Foam::polyMesh::addPatch
|
||||
|
||||
if (validBoundary)
|
||||
{
|
||||
boundary_.updateMesh();
|
||||
boundary_.topoChange();
|
||||
}
|
||||
|
||||
// Warn mesh objects
|
||||
|
||||
@ -64,6 +64,7 @@ namespace Foam
|
||||
// Forward declaration of classes
|
||||
class globalMeshData;
|
||||
class polyTopoChangeMap;
|
||||
class polyMeshMap;
|
||||
class polyDistributionMap;
|
||||
class polyMeshTetDecomposition;
|
||||
class treeDataCell;
|
||||
@ -606,8 +607,11 @@ public:
|
||||
// time directories
|
||||
virtual readUpdateState readUpdate();
|
||||
|
||||
//- Update the mesh topology from the given map
|
||||
virtual void updateMesh(const polyTopoChangeMap&);
|
||||
//- Update topology using the given map
|
||||
virtual void topoChange(const polyTopoChangeMap&);
|
||||
|
||||
//- Update from another mesh using the given map
|
||||
virtual void mapMesh(const polyMeshMap&);
|
||||
|
||||
//- Redistribute or update using the given distribution map
|
||||
virtual void distribute(const polyDistributionMap& 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
|
||||
@ -84,7 +84,7 @@ void Foam::polyMesh::clearAddressing(const bool isMeshUpdate)
|
||||
|
||||
if (isMeshUpdate)
|
||||
{
|
||||
// Part of a mesh update. Keep meshObjects that have an updateMesh
|
||||
// Part of a mesh update. Keep meshObjects that have an topoChange
|
||||
// callback
|
||||
meshObject::clearUpto
|
||||
<
|
||||
|
||||
@ -660,7 +660,7 @@ Foam::polyMesh::polyMesh
|
||||
if (syncPar)
|
||||
{
|
||||
// Calculate topology for the patches (processor-processor comms etc.)
|
||||
boundary_.updateMesh();
|
||||
boundary_.topoChange();
|
||||
|
||||
// Calculate the geometry for the patches (transformation tensors etc.)
|
||||
boundary_.calcGeometry();
|
||||
@ -941,7 +941,7 @@ Foam::polyMesh::polyMesh
|
||||
if (syncPar)
|
||||
{
|
||||
// Calculate topology for the patches (processor-processor comms etc.)
|
||||
boundary_.updateMesh();
|
||||
boundary_.topoChange();
|
||||
|
||||
// Calculate the geometry for the patches (transformation tensors etc.)
|
||||
boundary_.calcGeometry();
|
||||
|
||||
@ -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
|
||||
@ -264,7 +264,7 @@ Foam::polyMesh::readUpdateState Foam::polyMesh::readUpdate()
|
||||
// data.
|
||||
|
||||
// Calculate topology for the patches (processor-processor comms etc.)
|
||||
boundary_.updateMesh();
|
||||
boundary_.topoChange();
|
||||
|
||||
// Calculate the geometry for the patches (transformation tensors etc.)
|
||||
boundary_.calcGeometry();
|
||||
|
||||
34
src/OpenFOAM/meshes/polyMesh/polyMeshMap/polyMeshMap.C
Normal file
34
src/OpenFOAM/meshes/polyMesh/polyMeshMap/polyMeshMap.C
Normal file
@ -0,0 +1,34 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2022 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 "polyMeshMap.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::polyMeshMap::polyMeshMap()
|
||||
{}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
77
src/OpenFOAM/meshes/polyMesh/polyMeshMap/polyMeshMap.H
Normal file
77
src/OpenFOAM/meshes/polyMesh/polyMeshMap/polyMeshMap.H
Normal file
@ -0,0 +1,77 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2022 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::polyMeshMap
|
||||
|
||||
Description
|
||||
Class containing mesh-to-mesh mapping information.
|
||||
|
||||
SourceFiles
|
||||
polyMeshMap.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef polyMeshMap_H
|
||||
#define polyMeshMap_H
|
||||
|
||||
#include "polyMesh.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
class polyMesh;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class polyMeshMap Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class polyMeshMap
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct null
|
||||
polyMeshMap();
|
||||
|
||||
//- Disallow default bitwise copy construction
|
||||
polyMeshMap(const polyMeshMap&) = delete;
|
||||
|
||||
|
||||
// Member Functions
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -36,7 +36,7 @@ Description
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::polyMesh::updateMesh(const polyTopoChangeMap& map)
|
||||
void Foam::polyMesh::topoChange(const polyTopoChangeMap& map)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
@ -46,7 +46,7 @@ void Foam::polyMesh::updateMesh(const polyTopoChangeMap& map)
|
||||
}
|
||||
|
||||
// Update boundaryMesh (note that patches themselves already ok)
|
||||
boundary_.updateMesh();
|
||||
boundary_.topoChange();
|
||||
|
||||
// Update zones
|
||||
pointZones_.clearAddressing();
|
||||
@ -62,7 +62,7 @@ void Foam::polyMesh::updateMesh(const polyTopoChangeMap& map)
|
||||
// Update parallel data
|
||||
if (globalMeshDataPtr_.valid())
|
||||
{
|
||||
globalMeshDataPtr_->updateMesh();
|
||||
globalMeshDataPtr_->topoChange();
|
||||
}
|
||||
|
||||
setInstance(time().timeName());
|
||||
@ -116,14 +116,21 @@ void Foam::polyMesh::updateMesh(const polyTopoChangeMap& map)
|
||||
}
|
||||
}
|
||||
|
||||
meshObject::updateMesh<polyMesh>(*this, map);
|
||||
meshObject::updateMesh<pointMesh>(*this, map);
|
||||
meshObject::topoChange<polyMesh>(*this, map);
|
||||
meshObject::topoChange<pointMesh>(*this, map);
|
||||
|
||||
// Reset valid directions (could change by faces put into empty patches)
|
||||
geometricD_ = Zero;
|
||||
solutionD_ = Zero;
|
||||
|
||||
const_cast<Time&>(time()).functionObjects().updateMesh(map);
|
||||
const_cast<Time&>(time()).functionObjects().topoChange(map);
|
||||
}
|
||||
|
||||
|
||||
void Foam::polyMesh::mapMesh(const polyMeshMap& map)
|
||||
{
|
||||
meshObject::mapMesh<polyMesh>(*this, map);
|
||||
meshObject::mapMesh<pointMesh>(*this, 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
|
||||
@ -148,10 +148,10 @@ protected:
|
||||
virtual void movePoints(PstreamBuffers&, const pointField&) = 0;
|
||||
|
||||
//- Initialise the update of the patch topology
|
||||
virtual void initUpdateMesh(PstreamBuffers&) = 0;
|
||||
virtual void initTopoChange(PstreamBuffers&) = 0;
|
||||
|
||||
//- Update of the patch topology
|
||||
virtual void updateMesh(PstreamBuffers&) = 0;
|
||||
virtual void topoChange(PstreamBuffers&) = 0;
|
||||
|
||||
//- Write a patch in OBJ format
|
||||
static void writeOBJ
|
||||
|
||||
@ -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
|
||||
@ -103,15 +103,15 @@ void Foam::cyclicPolyPatch::movePoints
|
||||
}
|
||||
|
||||
|
||||
void Foam::cyclicPolyPatch::initUpdateMesh(PstreamBuffers& pBufs)
|
||||
void Foam::cyclicPolyPatch::initTopoChange(PstreamBuffers& pBufs)
|
||||
{
|
||||
polyPatch::initUpdateMesh(pBufs);
|
||||
polyPatch::initTopoChange(pBufs);
|
||||
}
|
||||
|
||||
|
||||
void Foam::cyclicPolyPatch::updateMesh(PstreamBuffers& pBufs)
|
||||
void Foam::cyclicPolyPatch::topoChange(PstreamBuffers& pBufs)
|
||||
{
|
||||
polyPatch::updateMesh(pBufs);
|
||||
polyPatch::topoChange(pBufs);
|
||||
deleteDemandDrivenData(coupledPointsPtr_);
|
||||
deleteDemandDrivenData(coupledEdgesPtr_);
|
||||
}
|
||||
|
||||
@ -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,10 +132,10 @@ protected:
|
||||
virtual void movePoints(PstreamBuffers&, const pointField&);
|
||||
|
||||
//- Initialise the update of the patch topology
|
||||
virtual void initUpdateMesh(PstreamBuffers&);
|
||||
virtual void initTopoChange(PstreamBuffers&);
|
||||
|
||||
//- Update of the patch topology
|
||||
virtual void updateMesh(PstreamBuffers&);
|
||||
virtual void topoChange(PstreamBuffers&);
|
||||
|
||||
//- Reset the patch name
|
||||
virtual void rename(const wordList& newNames);
|
||||
|
||||
@ -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
|
||||
@ -318,9 +318,9 @@ void Foam::processorPolyPatch::movePoints
|
||||
}
|
||||
|
||||
|
||||
void Foam::processorPolyPatch::initUpdateMesh(PstreamBuffers& pBufs)
|
||||
void Foam::processorPolyPatch::initTopoChange(PstreamBuffers& pBufs)
|
||||
{
|
||||
polyPatch::initUpdateMesh(pBufs);
|
||||
polyPatch::initTopoChange(pBufs);
|
||||
|
||||
if (Pstream::parRun())
|
||||
{
|
||||
@ -365,10 +365,10 @@ void Foam::processorPolyPatch::initUpdateMesh(PstreamBuffers& pBufs)
|
||||
}
|
||||
|
||||
|
||||
void Foam::processorPolyPatch::updateMesh(PstreamBuffers& pBufs)
|
||||
void Foam::processorPolyPatch::topoChange(PstreamBuffers& pBufs)
|
||||
{
|
||||
// For completeness
|
||||
polyPatch::updateMesh(pBufs);
|
||||
polyPatch::topoChange(pBufs);
|
||||
|
||||
nbrPointsPtr_.clear();
|
||||
nbrEdgesPtr_.clear();
|
||||
|
||||
@ -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
|
||||
@ -112,10 +112,10 @@ protected:
|
||||
void movePoints(PstreamBuffers&, const pointField&);
|
||||
|
||||
//- Initialise the update of the patch topology
|
||||
virtual void initUpdateMesh(PstreamBuffers&);
|
||||
virtual void initTopoChange(PstreamBuffers&);
|
||||
|
||||
//- Update of the patch topology
|
||||
virtual void updateMesh(PstreamBuffers&);
|
||||
virtual void topoChange(PstreamBuffers&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
@ -238,16 +238,16 @@ void Foam::processorCyclicPolyPatch::movePoints
|
||||
}
|
||||
|
||||
|
||||
void Foam::processorCyclicPolyPatch::initUpdateMesh(PstreamBuffers& pBufs)
|
||||
void Foam::processorCyclicPolyPatch::initTopoChange(PstreamBuffers& pBufs)
|
||||
{
|
||||
processorPolyPatch::initUpdateMesh(pBufs);
|
||||
processorPolyPatch::initTopoChange(pBufs);
|
||||
}
|
||||
|
||||
|
||||
void Foam::processorCyclicPolyPatch::updateMesh(PstreamBuffers& pBufs)
|
||||
void Foam::processorCyclicPolyPatch::topoChange(PstreamBuffers& pBufs)
|
||||
{
|
||||
referPatchID_ = -1;
|
||||
processorPolyPatch::updateMesh(pBufs);
|
||||
processorPolyPatch::topoChange(pBufs);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -98,10 +98,10 @@ protected:
|
||||
void movePoints(PstreamBuffers&, const pointField&);
|
||||
|
||||
//- Initialise the update of the patch topology
|
||||
virtual void initUpdateMesh(PstreamBuffers&);
|
||||
virtual void initTopoChange(PstreamBuffers&);
|
||||
|
||||
//- Update of the patch topology
|
||||
virtual void updateMesh(PstreamBuffers&);
|
||||
virtual void topoChange(PstreamBuffers&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
@ -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
|
||||
@ -60,7 +60,7 @@ void Foam::polyPatch::movePoints(PstreamBuffers&, const pointField& p)
|
||||
}
|
||||
|
||||
|
||||
void Foam::polyPatch::updateMesh(PstreamBuffers&)
|
||||
void Foam::polyPatch::topoChange(PstreamBuffers&)
|
||||
{
|
||||
primitivePatch::clearGeom();
|
||||
clearAddressing();
|
||||
|
||||
@ -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
|
||||
@ -113,11 +113,11 @@ protected:
|
||||
virtual void movePoints(PstreamBuffers&, const pointField& p);
|
||||
|
||||
//- Initialise the update of the patch topology
|
||||
virtual void initUpdateMesh(PstreamBuffers&)
|
||||
virtual void initTopoChange(PstreamBuffers&)
|
||||
{}
|
||||
|
||||
//- Update of the patch topology
|
||||
virtual void updateMesh(PstreamBuffers&);
|
||||
virtual void topoChange(PstreamBuffers&);
|
||||
|
||||
//- Clear geometry
|
||||
virtual void clearGeom();
|
||||
|
||||
@ -227,7 +227,7 @@ public:
|
||||
|
||||
// Edit
|
||||
|
||||
void updateMesh(const polyTopoChangeMap&)
|
||||
void topoChange(const polyTopoChangeMap&)
|
||||
{
|
||||
NotImplemented;
|
||||
}
|
||||
|
||||
@ -30,6 +30,7 @@ License
|
||||
#include "primitiveMesh.H"
|
||||
#include "demandDrivenData.H"
|
||||
#include "polyTopoChangeMap.H"
|
||||
#include "polyMeshMap.H"
|
||||
#include "syncTools.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
@ -386,7 +387,7 @@ void Foam::faceZone::resetAddressing
|
||||
}
|
||||
|
||||
|
||||
void Foam::faceZone::updateMesh(const polyTopoChangeMap& map)
|
||||
void Foam::faceZone::topoChange(const polyTopoChangeMap& map)
|
||||
{
|
||||
clearAddressing();
|
||||
|
||||
@ -416,6 +417,12 @@ void Foam::faceZone::updateMesh(const polyTopoChangeMap& map)
|
||||
}
|
||||
|
||||
|
||||
void Foam::faceZone::mapMesh(const polyMeshMap&)
|
||||
{
|
||||
NotImplemented;
|
||||
}
|
||||
|
||||
|
||||
bool Foam::faceZone::checkDefinition(const bool report) const
|
||||
{
|
||||
return zone::checkDefinition(meshZones().mesh().faces().size(), report);
|
||||
|
||||
@ -51,6 +51,7 @@ namespace Foam
|
||||
{
|
||||
|
||||
class polyTopoChangeMap;
|
||||
class polyMeshMap;
|
||||
|
||||
// Forward declaration of friend functions and operators
|
||||
|
||||
@ -290,8 +291,11 @@ public:
|
||||
//- Correct patch after moving points
|
||||
virtual void movePoints(const pointField&);
|
||||
|
||||
//- Update for changes in topology
|
||||
virtual void updateMesh(const polyTopoChangeMap&);
|
||||
//- Update topology using the given map
|
||||
virtual void topoChange(const polyTopoChangeMap&);
|
||||
|
||||
//- Update from another mesh using the given map
|
||||
virtual void mapMesh(const polyMeshMap&);
|
||||
|
||||
//- Write
|
||||
virtual void write(Ostream&) const;
|
||||
|
||||
@ -435,7 +435,7 @@ void Foam::attachDetach::setRefinement(polyTopoChange& ref) const
|
||||
}
|
||||
|
||||
|
||||
void Foam::attachDetach::updateMesh(const polyTopoChangeMap&)
|
||||
void Foam::attachDetach::topoChange(const polyTopoChangeMap&)
|
||||
{
|
||||
// Mesh has changed topologically. Update local topological data
|
||||
const polyMesh& mesh = topoChanger().mesh();
|
||||
|
||||
@ -214,7 +214,7 @@ public:
|
||||
virtual void modifyMotionPoints(pointField& motionPoints) const;
|
||||
|
||||
//- Force recalculation of locally stored data on topological change
|
||||
virtual void updateMesh(const polyTopoChangeMap&);
|
||||
virtual void topoChange(const polyTopoChangeMap&);
|
||||
|
||||
//- Get reference to trigger times
|
||||
const scalarField& triggerTimes() const
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user