viewFactorsGen: Write VTK directly without a system call
This commit is contained in:
@ -1,12 +1,14 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
|
-I$(LIB_SRC)/fileFormats/lnInclude \
|
||||||
-I$(LIB_SRC)/triSurface/lnInclude \
|
-I$(LIB_SRC)/triSurface/lnInclude \
|
||||||
-I$(LIB_SRC)/parallel/distributed/lnInclude \
|
-I$(LIB_SRC)/parallel/distributed/lnInclude \
|
||||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-lfiniteVolume \
|
-lfileFormats \
|
||||||
-lmeshTools \
|
|
||||||
-ltriSurface \
|
-ltriSurface \
|
||||||
-ldistributed \
|
-ldistributed \
|
||||||
|
-lfiniteVolume \
|
||||||
|
-lmeshTools \
|
||||||
-lradiationModels
|
-lradiationModels
|
||||||
|
|||||||
@ -53,6 +53,7 @@ Description
|
|||||||
#include "DynamicField.H"
|
#include "DynamicField.H"
|
||||||
#include "scalarListIOList.H"
|
#include "scalarListIOList.H"
|
||||||
#include "polygonTriangulate.H"
|
#include "polygonTriangulate.H"
|
||||||
|
#include "vtkWritePolyData.H"
|
||||||
|
|
||||||
using namespace Foam;
|
using namespace Foam;
|
||||||
|
|
||||||
@ -159,29 +160,35 @@ void writeRays
|
|||||||
const labelListList& visibleFaceFaces
|
const labelListList& visibleFaceFaces
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
OFstream str(fName);
|
DynamicList<point> allPoints;
|
||||||
label vertI = 0;
|
allPoints.append(myFc);
|
||||||
|
allPoints.append(compactCf);
|
||||||
Pout<< "Dumping rays to " << str.name() << endl;
|
|
||||||
|
|
||||||
|
DynamicList<labelPair> rays;
|
||||||
forAll(myFc, facei)
|
forAll(myFc, facei)
|
||||||
{
|
{
|
||||||
const labelList visFaces = visibleFaceFaces[facei];
|
const labelList visFaces = visibleFaceFaces[facei];
|
||||||
forAll(visFaces, faceRemote)
|
forAll(visFaces, faceRemote)
|
||||||
{
|
{
|
||||||
label compactI = visFaces[faceRemote];
|
rays.append
|
||||||
const point& remoteFc = compactCf[compactI];
|
(
|
||||||
|
labelPair(facei, myFc.size() + visFaces[faceRemote])
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
meshTools::writeOBJ(str, myFc[facei]);
|
Pout<< "\nDumping rays to " << fName + ".vtk" << endl;
|
||||||
vertI++;
|
|
||||||
meshTools::writeOBJ(str, remoteFc);
|
vtkWritePolyData::write
|
||||||
vertI++;
|
(
|
||||||
str << "l " << vertI-1 << ' ' << vertI << nl;
|
fName + ".vtk",
|
||||||
}
|
fName.name(),
|
||||||
}
|
false,
|
||||||
string cmd("objToVTK " + fName + " " + fName.lessExt() + ".vtk");
|
allPoints,
|
||||||
Pout<< "cmd:" << cmd << endl;
|
labelList(),
|
||||||
system(cmd);
|
rays,
|
||||||
|
faceList()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -663,7 +670,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
writeRays
|
writeRays
|
||||||
(
|
(
|
||||||
runTime.path()/"allVisibleFaces.obj",
|
runTime.path()/"allVisibleFaces",
|
||||||
compactCoarseCf,
|
compactCoarseCf,
|
||||||
remoteCoarseCf[Pstream::myProcNo()],
|
remoteCoarseCf[Pstream::myProcNo()],
|
||||||
visibleFaceFaces
|
visibleFaceFaces
|
||||||
|
|||||||
Reference in New Issue
Block a user