mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
GIT: Resolved merge conflict
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -475,7 +475,11 @@ int main(int argc, char *argv[])
|
||||
word regionName = polyMesh::defaultRegion;
|
||||
word regionDir = word::null;
|
||||
|
||||
if (args.optionReadIfPresent("region", regionName))
|
||||
if
|
||||
(
|
||||
args.optionReadIfPresent("region", regionName)
|
||||
&& regionName != polyMesh::defaultRegion
|
||||
)
|
||||
{
|
||||
regionDir = regionName;
|
||||
Info<< "Operating on region " << regionName << nl << endl;
|
||||
@ -578,7 +582,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
|
||||
// Loop over all times
|
||||
forAll(Times, timeI)
|
||||
for (label timeI = startTime; timeI < endTime; timeI++)
|
||||
{
|
||||
// Set time for global database
|
||||
runTime.setTime(Times[timeI], timeI);
|
||||
@ -591,6 +595,19 @@ int main(int argc, char *argv[])
|
||||
databases[procI].setTime(Times[timeI], timeI);
|
||||
}
|
||||
|
||||
const fileName meshPath =
|
||||
databases[0].path()
|
||||
/databases[0].timeName()
|
||||
/regionDir
|
||||
/polyMesh::meshSubDir;
|
||||
|
||||
if (!isFile(meshPath/"faces"))
|
||||
{
|
||||
Info<< "No mesh." << nl << endl;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
// Read point on individual processors to determine merge tolerance
|
||||
// (otherwise single cell domains might give problems)
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -458,6 +458,8 @@ int main(int argc, char *argv[])
|
||||
regIOobject::fileModificationChecking = regIOobject::timeStamp;
|
||||
# include "createTime.H"
|
||||
|
||||
runTime.functionObjects().off();
|
||||
|
||||
word regionName = polyMesh::defaultRegion;
|
||||
fileName meshSubDir;
|
||||
|
||||
|
||||
@ -1,9 +1,11 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/sampling/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/surfMesh/lnInclude \
|
||||
-I$(LIB_SRC)/triSurface/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lsampling \
|
||||
-ltriSurface \
|
||||
-lsurfMesh \
|
||||
-lmeshTools
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -39,6 +39,7 @@ Description
|
||||
#include "surfaceIntersection.H"
|
||||
#include "SortableList.H"
|
||||
#include "PatchTools.H"
|
||||
#include "vtkSurfaceWriter.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
@ -183,6 +184,12 @@ int main(int argc, char *argv[])
|
||||
"also check for self-intersection"
|
||||
);
|
||||
argList::addBoolOption
|
||||
(
|
||||
"splitNonManifold",
|
||||
"split surface along non-manifold edges"
|
||||
" (default split is fully disconnected)"
|
||||
);
|
||||
argList::addBoolOption
|
||||
(
|
||||
"verbose",
|
||||
"verbose operation"
|
||||
@ -198,6 +205,7 @@ int main(int argc, char *argv[])
|
||||
const fileName surfFileName = args[1];
|
||||
const bool checkSelfIntersect = args.optionFound("checkSelfIntersection");
|
||||
const bool verbose = args.optionFound("verbose");
|
||||
const bool splitNonManifold = args.optionFound("splitNonManifold");
|
||||
|
||||
Info<< "Reading surface from " << surfFileName << " ..." << nl << endl;
|
||||
|
||||
@ -565,56 +573,108 @@ int main(int argc, char *argv[])
|
||||
// Check singly connected domain
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
labelList faceZone;
|
||||
label numZones = surf.markZones(boolList(surf.nEdges(), false), faceZone);
|
||||
|
||||
Info<< "Number of unconnected parts : " << numZones << endl;
|
||||
|
||||
if (numZones > 1)
|
||||
{
|
||||
Info<< "Splitting surface into parts ..." << endl << endl;
|
||||
|
||||
fileName surfFileNameBase(surfFileName.name());
|
||||
const word fileType = surfFileNameBase.ext();
|
||||
// Strip extension
|
||||
surfFileNameBase = surfFileNameBase.lessExt();
|
||||
// If extension was .gz strip original extension
|
||||
if (fileType == "gz")
|
||||
boolList borderEdge(surf.nEdges(), false);
|
||||
if (splitNonManifold)
|
||||
{
|
||||
surfFileNameBase = surfFileNameBase.lessExt();
|
||||
}
|
||||
|
||||
for (label zone = 0; zone < numZones; zone++)
|
||||
{
|
||||
boolList includeMap(surf.size(), false);
|
||||
|
||||
forAll(faceZone, faceI)
|
||||
const labelListList& eFaces = surf.edgeFaces();
|
||||
forAll(eFaces, edgeI)
|
||||
{
|
||||
if (faceZone[faceI] == zone)
|
||||
if (eFaces[edgeI].size() > 2)
|
||||
{
|
||||
includeMap[faceI] = true;
|
||||
borderEdge[edgeI] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
labelList pointMap;
|
||||
labelList faceMap;
|
||||
labelList faceZone;
|
||||
label numZones = surf.markZones(borderEdge, faceZone);
|
||||
|
||||
triSurface subSurf
|
||||
(
|
||||
surf.subsetMesh
|
||||
Info<< "Number of unconnected parts : " << numZones << endl;
|
||||
|
||||
if (numZones > 1)
|
||||
{
|
||||
Info<< "Splitting surface into parts ..." << endl << endl;
|
||||
|
||||
fileName surfFileNameBase(surfFileName.name());
|
||||
const word fileType = surfFileNameBase.ext();
|
||||
// Strip extension
|
||||
surfFileNameBase = surfFileNameBase.lessExt();
|
||||
// If extension was .gz strip original extension
|
||||
if (fileType == "gz")
|
||||
{
|
||||
surfFileNameBase = surfFileNameBase.lessExt();
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
Info<< "Writing zoning to "
|
||||
<< fileName
|
||||
(
|
||||
"zone_"
|
||||
+ surfFileNameBase
|
||||
+ '.'
|
||||
+ vtkSurfaceWriter::typeName
|
||||
)
|
||||
<< "..." << endl << endl;
|
||||
|
||||
// Convert data
|
||||
scalarField scalarFaceZone(faceZone.size());
|
||||
forAll(faceZone, i)
|
||||
{
|
||||
scalarFaceZone[i] = faceZone[i];
|
||||
}
|
||||
faceList faces(surf.size());
|
||||
forAll(surf, i)
|
||||
{
|
||||
faces[i] = surf[i].triFaceFace();
|
||||
}
|
||||
|
||||
vtkSurfaceWriter().write
|
||||
(
|
||||
includeMap,
|
||||
pointMap,
|
||||
faceMap
|
||||
)
|
||||
);
|
||||
surfFileName.path(),
|
||||
surfFileNameBase,
|
||||
surf.points(),
|
||||
faces,
|
||||
"zone",
|
||||
scalarFaceZone,
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
fileName subFileName(surfFileNameBase + "_" + name(zone) + ".obj");
|
||||
|
||||
Info<< "writing part " << zone << " size " << subSurf.size()
|
||||
<< " to " << subFileName << endl;
|
||||
for (label zone = 0; zone < numZones; zone++)
|
||||
{
|
||||
boolList includeMap(surf.size(), false);
|
||||
|
||||
subSurf.write(subFileName);
|
||||
forAll(faceZone, faceI)
|
||||
{
|
||||
if (faceZone[faceI] == zone)
|
||||
{
|
||||
includeMap[faceI] = true;
|
||||
}
|
||||
}
|
||||
|
||||
labelList pointMap;
|
||||
labelList faceMap;
|
||||
|
||||
triSurface subSurf
|
||||
(
|
||||
surf.subsetMesh
|
||||
(
|
||||
includeMap,
|
||||
pointMap,
|
||||
faceMap
|
||||
)
|
||||
);
|
||||
|
||||
fileName subName(surfFileNameBase + "_" + name(zone) + ".obj");
|
||||
|
||||
Info<< "writing part " << zone << " size " << subSurf.size()
|
||||
<< " to " << subName << endl;
|
||||
|
||||
subSurf.write(subName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user