mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge remote-tracking branch 'origin/feature-cellSetRemove' into develop
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -56,7 +56,9 @@ Description
|
||||
#include "mapPolyMesh.H"
|
||||
#include "faceSet.H"
|
||||
#include "cellSet.H"
|
||||
#include "pointSet.H"
|
||||
#include "syncTools.H"
|
||||
#include "ReadFields.H"
|
||||
#include "polyTopoChange.H"
|
||||
#include "polyModifyFace.H"
|
||||
#include "polyAddFace.H"
|
||||
@ -315,6 +317,59 @@ void initCreatedPatches
|
||||
}
|
||||
|
||||
|
||||
template<class TopoSet>
|
||||
void subsetTopoSets
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const IOobjectList& objectsList,
|
||||
const labelList& map,
|
||||
const fvMesh& subMesh,
|
||||
PtrList<TopoSet>& subSets
|
||||
)
|
||||
{
|
||||
// Read original sets
|
||||
PtrList<TopoSet> sets;
|
||||
ReadFields<TopoSet>(objectsList, sets);
|
||||
|
||||
subSets.setSize(sets.size());
|
||||
forAll(sets, i)
|
||||
{
|
||||
TopoSet& set = sets[i];
|
||||
|
||||
Info<< "Subsetting " << set.type() << " " << set.name() << endl;
|
||||
|
||||
// Map the data
|
||||
PackedBoolList isSet(set.maxSize(mesh));
|
||||
forAllConstIter(labelHashSet, set, iter)
|
||||
{
|
||||
isSet[iter.key()] = true;
|
||||
}
|
||||
label nSet = 0;
|
||||
forAll(map, i)
|
||||
{
|
||||
if (isSet[map[i]])
|
||||
{
|
||||
nSet++;
|
||||
}
|
||||
}
|
||||
|
||||
subSets.set
|
||||
(
|
||||
i,
|
||||
new TopoSet(subMesh, set.name(), nSet, IOobject::AUTO_WRITE)
|
||||
);
|
||||
TopoSet& subSet = subSets[i];
|
||||
forAll(map, i)
|
||||
{
|
||||
if (isSet[map[i]])
|
||||
{
|
||||
subSet.insert(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void createCoupledBaffles
|
||||
(
|
||||
fvMesh& mesh,
|
||||
@ -923,6 +978,41 @@ int main(int argc, char *argv[])
|
||||
surfTensorFlds
|
||||
);
|
||||
|
||||
|
||||
// Set handling
|
||||
PtrList<cellSet> cellSets;
|
||||
PtrList<faceSet> faceSets;
|
||||
PtrList<pointSet> pointSets;
|
||||
{
|
||||
IOobjectList objects(mesh, mesh.facesInstance(), "polyMesh/sets");
|
||||
subsetTopoSets
|
||||
(
|
||||
mesh,
|
||||
objects,
|
||||
subsetter.cellMap(),
|
||||
subsetter.subMesh(),
|
||||
cellSets
|
||||
);
|
||||
subsetTopoSets
|
||||
(
|
||||
mesh,
|
||||
objects,
|
||||
subsetter.faceMap(),
|
||||
subsetter.subMesh(),
|
||||
faceSets
|
||||
);
|
||||
subsetTopoSets
|
||||
(
|
||||
mesh,
|
||||
objects,
|
||||
subsetter.pointMap(),
|
||||
subsetter.subMesh(),
|
||||
pointSets
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (!overwrite)
|
||||
{
|
||||
runTime++;
|
||||
@ -1134,6 +1224,11 @@ int main(int argc, char *argv[])
|
||||
Zero
|
||||
);
|
||||
|
||||
// Update numbering of topoSets
|
||||
topoSet::updateMesh(subsetter.subMesh().facesInstance(), map, cellSets);
|
||||
topoSet::updateMesh(subsetter.subMesh().facesInstance(), map, faceSets);
|
||||
topoSet::updateMesh(subsetter.subMesh().facesInstance(), map, pointSets);
|
||||
|
||||
|
||||
// Move mesh (since morphing might not do this)
|
||||
if (map().hasMotionPoints())
|
||||
|
||||
@ -1,9 +1,11 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/parallel/reconstruct/reconstruct/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
||||
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lreconstruct \
|
||||
-ldynamicMesh
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -60,6 +60,8 @@ Description
|
||||
#include "mapPolyMesh.H"
|
||||
#include "unitConversion.H"
|
||||
#include "motionSmoother.H"
|
||||
#include "topoSet.H"
|
||||
#include "processorMeshes.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
@ -450,6 +452,8 @@ int main(int argc, char *argv[])
|
||||
Info<< "Writing morphed mesh to time " << runTime.timeName() << endl;
|
||||
|
||||
mesh.write();
|
||||
topoSet::removeFiles(mesh);
|
||||
processorMeshes::removeFiles(mesh);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -1,7 +1,10 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/parallel/reconstruct/reconstruct/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicMesh/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lmeshTools \
|
||||
-lreconstruct \
|
||||
-ldynamicMesh
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -62,6 +62,8 @@ Description
|
||||
#include "meshTools.H"
|
||||
#include "Pair.H"
|
||||
#include "globalIndex.H"
|
||||
#include "topoSet.H"
|
||||
#include "processorMeshes.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
@ -567,6 +569,8 @@ int main(int argc, char *argv[])
|
||||
// Write resulting mesh
|
||||
Info<< "Writing modified mesh to time " << runTime.timeName() << endl;
|
||||
mesh.write();
|
||||
topoSet::removeFiles(mesh);
|
||||
processorMeshes::removeFiles(mesh);
|
||||
}
|
||||
else if (edgeToPos.size())
|
||||
{
|
||||
@ -641,6 +645,8 @@ int main(int argc, char *argv[])
|
||||
// Write resulting mesh
|
||||
Info<< "Writing modified mesh to time " << runTime.timeName() << endl;
|
||||
mesh.write();
|
||||
topoSet::removeFiles(mesh);
|
||||
processorMeshes::removeFiles(mesh);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -684,6 +690,8 @@ int main(int argc, char *argv[])
|
||||
// Write resulting mesh
|
||||
Info<< "Writing modified mesh to time " << runTime.timeName() << endl;
|
||||
mesh.write();
|
||||
topoSet::removeFiles(mesh);
|
||||
processorMeshes::removeFiles(mesh);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1,11 +1,10 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
||||
-I$(LIB_SRC)/parallel/reconstruct/reconstruct/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude
|
||||
|
||||
|
||||
EXE_LIBS = \
|
||||
-lreconstruct \
|
||||
-ldynamicMesh \
|
||||
-lmeshTools \
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -49,6 +49,7 @@ Description
|
||||
#include "surfaceFields.H"
|
||||
#include "pointFields.H"
|
||||
#include "ReadFields.H"
|
||||
#include "processorMeshes.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
@ -197,6 +198,8 @@ int main(int argc, char *argv[])
|
||||
|
||||
mesh.write();
|
||||
meshCutter.write();
|
||||
topoSet::removeFiles(mesh);
|
||||
processorMeshes::removeFiles(mesh);
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
|
||||
@ -1,7 +1,10 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/parallel/reconstruct/reconstruct/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicMesh/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-ldynamicMesh \
|
||||
-lreconstruct \
|
||||
-lmeshTools
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -53,6 +53,7 @@ Description
|
||||
#include "cellCuts.H"
|
||||
#include "cellSet.H"
|
||||
#include "meshCutter.H"
|
||||
#include "processorMeshes.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
@ -257,6 +258,8 @@ int main(int argc, char *argv[])
|
||||
Info<< "Writing refined mesh to time " << runTime.timeName() << endl;
|
||||
|
||||
mesh.write();
|
||||
topoSet::removeFiles(mesh);
|
||||
processorMeshes::removeFiles(mesh);
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
|
||||
@ -1,10 +1,12 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
||||
-I$(LIB_SRC)/parallel/reconstruct/reconstruct/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lmeshTools \
|
||||
-ldynamicMesh \
|
||||
-lfiniteVolume \
|
||||
-lreconstruct \
|
||||
-lgenericPatchFields
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -44,6 +44,7 @@ Description
|
||||
#include "ReadFields.H"
|
||||
#include "volFields.H"
|
||||
#include "surfaceFields.H"
|
||||
#include "processorMeshes.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
@ -179,6 +180,8 @@ int main(int argc, char *argv[])
|
||||
// Take over refinement levels and write to new time directory.
|
||||
Pout<< "Writing mesh to time " << runTime.timeName() << endl;
|
||||
mesh.write();
|
||||
topoSet::removeFiles(mesh);
|
||||
processorMeshes::removeFiles(mesh);
|
||||
|
||||
Pout<< "End\n" << endl;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user