Merge branch 'master' of /home/noisy3/OpenFOAM/OpenFOAM-dev

Conflicts:
	applications/utilities/postProcessing/dataConversion/foamToTecplot360/Allwmake
This commit is contained in:
mattijs
2009-12-01 16:47:45 +00:00
614 changed files with 56132 additions and 2923 deletions

17
README
View File

@ -2,7 +2,7 @@
# #
#+TITLE: OpenFOAM README for version 1.6 #+TITLE: OpenFOAM README for version 1.6
#+AUTHOR: OpenCFD Ltd. #+AUTHOR: OpenCFD Ltd.
#+DATE: July 2009 #+DATE: November 2009
#+LINK: http://www.opencfd.co.uk #+LINK: http://www.opencfd.co.uk
#+OPTIONS: author:nil ^:{} #+OPTIONS: author:nil ^:{}
@ -99,7 +99,7 @@
and a csh/tcsh example: and a csh/tcsh example:
+ setenv FOAM_INST_DIR /data/app/OpenFOAM + setenv FOAM_INST_DIR /data/app/OpenFOAM
+ foamDotFile=$FOAM_INST_DIR/OpenFOAM-1.6/etc/bashrc + foamDotFile=$FOAM_INST_DIR/OpenFOAM-1.6/etc/cshrc
+ if ( -f $foamDotFile ) source $foamDotFile + if ( -f $foamDotFile ) source $foamDotFile
The value set in '$FOAM_INST_DIR' will be used to locate the remaining parts The value set in '$FOAM_INST_DIR' will be used to locate the remaining parts
@ -168,9 +168,9 @@
+ rm -rf paraview-3.6.1/platforms + rm -rf paraview-3.6.1/platforms
+ ./makeParaView + ./makeParaView
The PV3FoamReader module is an OpenFOAM utility that can be compiled in the The PV3blockMeshReader and the PV3FoamReader ParaView plugins are compiled
usual manner as follows: as usual for OpenFOAM utilities:
+ cd $FOAM_UTILITIES/postProcessing/graphics/PV3FoamReader + cd $FOAM_UTILITIES/postProcessing/graphics/PV3Readers/
+ ./Allwclean + ./Allwclean
+ ./Allwmake + ./Allwmake
@ -180,14 +180,15 @@
downloads a supported version of Qt /e.g./ 4.3.5 as described in the section downloads a supported version of Qt /e.g./ 4.3.5 as described in the section
on "Qt". The user should unpack the source pack in the $WM_THIRD_PARTY_DIR. on "Qt". The user should unpack the source pack in the $WM_THIRD_PARTY_DIR.
Then the user can build Qt by executing from within $WM_THIRD_PARTY_DIR: Then the user can build Qt by executing from within $WM_THIRD_PARTY_DIR:
+ makeQt + ./makeQt
The user should then compile ParaView using the local version of Qt by The user should then compile ParaView using the local version of Qt by
executing makeParaView with the -qmake option, giving the full path of the executing makeParaView with the -qmake option, giving the full path of the
newly built qmake as an argument: newly built qmake as an argument:
+ makeParaView -qmake <path_to_qmake> + ./makeParaView -qmake <path_to_qmake>
The user must then recompile the PV3FoamReader module as normal (see above). The user must then recompile the PV3blockMeshReader and the
PV3FoamReader plugins as usual (see above).
* Documentation * Documentation
http://www.OpenFOAM.org/doc http://www.OpenFOAM.org/doc

View File

@ -27,7 +27,7 @@ if (transonic)
pEqn.setReference(pRefCell, pRefValue); pEqn.setReference(pRefCell, pRefValue);
// retain the residual from the first iteration // Retain the residual from the first iteration
if (nonOrth == 0) if (nonOrth == 0)
{ {
eqnResidual = pEqn.solve().initialResidual(); eqnResidual = pEqn.solve().initialResidual();

View File

@ -0,0 +1,3 @@
rhoSimplecFoam.C
EXE = $(FOAM_APPBIN)/rhoSimplecFoam

View File

@ -0,0 +1,14 @@
EXE_INC = \
-I../rhoSimpleFoam \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/RASModel \
-I$(LIB_SRC)/finiteVolume/cfdTools \
-I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
-lbasicThermophysicalModels \
-lspecie \
-lcompressibleRASModels \
-lfiniteVolume \
-lmeshTools

View File

@ -0,0 +1,17 @@
// Solve the Momentum equation
tmp<fvVectorMatrix> UEqn
(
fvm::div(phi, U)
- fvm::Sp(fvc::div(phi), U)
+ turbulence->divDevRhoReff(U)
);
UEqn().relax();
eqnResidual = solve
(
UEqn() == -fvc::grad(p)
).initialResidual();
maxResidual = max(eqnResidual, maxResidual);

View File

@ -0,0 +1,63 @@
Info<< "Reading thermophysical properties\n" << endl;
autoPtr<basicPsiThermo> pThermo
(
basicPsiThermo::New(mesh)
);
basicPsiThermo& thermo = pThermo();
volScalarField rho
(
IOobject
(
"rho",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
thermo.rho()
);
volScalarField& p = thermo.p();
volScalarField& h = thermo.h();
const volScalarField& psi = thermo.psi();
Info<< "Reading field U\n" << endl;
volVectorField U
(
IOobject
(
"U",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
#include "compressibleCreatePhi.H"
label pRefCell = 0;
scalar pRefValue = 0.0;
setRefCell(p, mesh.solutionDict().subDict("SIMPLE"), pRefCell, pRefValue);
dimensionedScalar pMin
(
mesh.solutionDict().subDict("SIMPLE").lookup("pMin")
);
Info<< "Creating turbulence model\n" << endl;
autoPtr<compressible::RASModel> turbulence
(
compressible::RASModel::New
(
rho,
U,
phi,
thermo
)
);
dimensionedScalar initialMass = fvc::domainIntegrate(rho);

View File

@ -0,0 +1,29 @@
{
fvScalarMatrix hEqn
(
fvm::div(phi, h)
- fvm::Sp(fvc::div(phi), h)
- fvm::laplacian(turbulence->alphaEff(), h)
==
fvc::div(phi/fvc::interpolate(rho)*fvc::interpolate(p, "div(U,p)"))
- p*fvc::div(phi/fvc::interpolate(rho))
);
hEqn.relax();
eqnResidual = hEqn.solve().initialResidual();
maxResidual = max(eqnResidual, maxResidual);
thermo.correct();
rho = thermo.rho();
if (!transonic)
{
rho.relax();
}
Info<< "rho max/min : "
<< max(rho).value() << " "
<< min(rho).value() << endl;
}

View File

@ -0,0 +1,123 @@
volScalarField p0 = p;
volScalarField AU = UEqn().A();
volScalarField AtU = AU - UEqn().H1();
U = UEqn().H()/AU;
UEqn.clear();
bool closedVolume = false;
if (transonic)
{
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
surfaceScalarField phid
(
"phid",
fvc::interpolate(psi*U) & mesh.Sf()
);
surfaceScalarField phic
(
"phic",
fvc::interpolate(rho/AtU - rho/AU)*fvc::snGrad(p)*mesh.magSf()
+ phid*(fvc::interpolate(p) - fvc::interpolate(p, "UD"))
);
refCast<mixedFvPatchScalarField>(p.boundaryField()[1]).refValue()
= p.boundaryField()[1];
fvScalarMatrix pEqn
(
fvm::div(phid, p)
+ fvc::div(phic)
- fvm::Sp(fvc::div(phid), p)
+ fvc::div(phid)*p
- fvm::laplacian(rho/AtU, p)
);
pEqn.setReference(pRefCell, pRefValue);
// Retain the residual from the first iteration
if (nonOrth == 0)
{
eqnResidual = pEqn.solve().initialResidual();
maxResidual = max(eqnResidual, maxResidual);
}
else
{
pEqn.solve();
}
if (nonOrth == nNonOrthCorr)
{
phi == phic + pEqn.flux();
}
}
}
else
{
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
phi = fvc::interpolate(rho*U) & mesh.Sf();
closedVolume = adjustPhi(phi, U, p);
phi += fvc::interpolate(rho/AtU - rho/AU)*fvc::snGrad(p)*mesh.magSf();
fvScalarMatrix pEqn
(
fvc::div(phi)
//- fvm::laplacian(rho/AU, p)
- fvm::laplacian(rho/AtU, p)
);
pEqn.setReference(pRefCell, pRefValue);
// Retain the residual from the first iteration
if (nonOrth == 0)
{
eqnResidual = pEqn.solve().initialResidual();
maxResidual = max(eqnResidual, maxResidual);
}
else
{
pEqn.solve();
}
if (nonOrth == nNonOrthCorr)
{
phi += pEqn.flux();
}
}
}
// The incompressibe for of the continuity error check is appropriate for
// steady-state compressible also.
#include "incompressible/continuityErrs.H"
// Explicitly relax pressure for momentum corrector
p.relax();
U -= (fvc::grad(p0)*(1.0/AU - 1.0/AtU) + fvc::grad(p)/AtU);
//U -= fvc::grad(p)/AU;
U.correctBoundaryConditions();
bound(p, pMin);
// For closed-volume cases adjust the pressure and density levels
// to obey overall mass continuity
if (closedVolume)
{
p += (initialMass - fvc::domainIntegrate(psi*p))
/fvc::domainIntegrate(psi);
}
rho = thermo.rho();
if (!transonic)
{
rho.relax();
}
Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value() << endl;

View File

@ -0,0 +1,92 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Application
rhoSimplecFoam
Description
Steady-state SIMPLEC solver for laminar or turbulent RANS flow of
compressible fluids.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "basicPsiThermo.H"
#include "RASModel.H"
#include "mixedFvPatchFields.H"
#include "bound.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createFields.H"
#include "initContinuityErrs.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
for (runTime++; !runTime.end(); runTime++)
{
Info<< "Time = " << runTime.timeName() << nl << endl;
#include "readSIMPLEControls.H"
#include "initConvergenceCheck.H"
p.storePrevIter();
if (!transonic)
{
rho.storePrevIter();
}
// Velocity-pressure-enthalpy SIMPLEC corrector
{
#include "UEqn.H"
#include "pEqn.H"
#include "hEqn.H"
}
turbulence->correct();
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
#include "convergenceCheck.H"
}
Info<< "End\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -108,8 +108,7 @@ int main()
Info<< " badName(die) => " << findEtcFile("badName", true) << nl Info<< " badName(die) => " << findEtcFile("badName", true) << nl
<< endl; << endl;
Info<< "\nEnd" << endl; Info<< "\nEnd\n" << endl;
return 0; return 0;
} }

View File

@ -95,8 +95,7 @@ int main(int argc, char *argv[])
printCleaning(pathName); printCleaning(pathName);
} }
Info<< "\nEnd" << endl; Info<< "\nEnd\n" << endl;
return 0; return 0;
} }

View File

@ -102,8 +102,7 @@ int main(int argc, char *argv[])
Info<< "Ostream<< >" << s2 << "<\n"; Info<< "Ostream<< >" << s2 << "<\n";
Info<< "hash:" << hex << string::hash()(s2) << endl; Info<< "hash:" << hex << string::hash()(s2) << endl;
Info << "End\n" << endl; Info<< "\nEnd\n" << endl;
return 0; return 0;
} }

View File

@ -131,8 +131,7 @@ int main(int argc, char *argv[])
psf.write(); psf.write();
Info << nl << "End" << endl; Info<< "\nEnd\n" << endl;
return 0; return 0;
} }

View File

@ -1,215 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::Tuple
Description
A 2 Tuple. Differs from Tuple in that the two elements can be different
type.
\*---------------------------------------------------------------------------*/
#ifndef Tuple_H
#define Tuple_H
#include "Istream.H"
#include "Ostream.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward declaration of friend functions and operators
template<class Type1, class Type2>
class Tuple;
template<class Type1, class Type2>
Istream& operator>>(Istream&, Tuple<Type1, Type2>&);
template<class Type1, class Type2>
Ostream& operator<<(Ostream&, const Tuple<Type1, Type2>&);
/*---------------------------------------------------------------------------*\
Class Tuple Declaration
\*---------------------------------------------------------------------------*/
template<class Type1, class Type2>
class Tuple
{
// Private data
Type1 first_;
Type2 second_;
public:
// Constructors
//- Null constructor for lists
inline Tuple()
{}
//- Construct from components
inline Tuple(const Type1& first, const Type2& second)
:
first_(first),
second_(second)
{}
//- Construct from Istream
inline Tuple(Istream& is)
{
// Read beginning of pair
is.readBegin("pair");
is >> first_ >> second_;
// Read end of pair
is.readEnd("pair");
// Check state of Istream
is.check("Tuple::Tuple(Istream&)");
}
// Member Functions
//- Return first
inline Type1 first() const
{
return first_;
}
//- Return first
inline Type1& first()
{
return first_;
}
//- Return second
inline Type2 second() const
{
return second_;
}
//- Return second
inline Type2& second()
{
return second_;
}
//- Return reverse pair
inline Tuple<Type1, Type2> reverseTuple() const
{
return Tuple<Type1, Type2>(second_, first_);
}
// Friend Operators
inline friend bool operator==
(
const Tuple<Type1, Type2>& a,
const Tuple<Type1, Type2>& b
)
{
return
(
(a.first_ == b.first_) && (a.second_ == b.second_)
);
}
inline friend bool operator!=
(
const Tuple<Type1, Type2>& a,
const Tuple<Type1, Type2>& b
)
{
return (!(a == b));
}
// IOstream Operators
friend Istream& operator>> <Type1, Type2>
(
Istream& is,
Tuple<Type1, Type2>& p
);
friend Ostream& operator<< <Type1, Type2>
(
Ostream& os,
const Tuple<Type1, Type2>& p
);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type1, class Type2>
Istream& operator>>(Istream& is, Tuple<Type1, Type2>& p)
{
// Read beginning of Tuple<Type, Type>
is.readBegin("Tuple<Type, Type>");
is >> p.first_ >> p.second_;
// Read end of Tuple<Type, Type>
is.readEnd("Tuple<Type, Type>");
// Check state of Ostream
is.check("Istream& operator>>(Istream&, Tuple<Type, Type>&)");
return is;
}
template<class Type1, class Type2>
Ostream& operator<<(Ostream& os, const Tuple<Type1, Type2>& p)
{
os << token::BEGIN_LIST
<< p.first_ << token::SPACE
<< p.second_
<< token::END_LIST;
// Check state of Ostream
os.check("Ostream& operator<<(Ostream&, const Tuple<Type, Type>&)");
return os;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -375,7 +375,7 @@ int main(int argc, char *argv[])
bool cellsToSplit = cellsToPyramidise.size(); bool cellsToSplit = cellsToPyramidise.size();
//List<Tuple<pointField,point> > // List<Tuple2<pointField,point> >
// cellsToCreate(dict.lookup("cellsToCreate")); // cellsToCreate(dict.lookup("cellsToCreate"));
Info<< "Read from " << dict.name() << nl Info<< "Read from " << dict.name() << nl
@ -661,8 +661,7 @@ int main(int argc, char *argv[])
} }
Info << nl << "End" << endl; Info<< "\nEnd\n" << endl;
return 0; return 0;
} }

View File

@ -126,41 +126,41 @@ int main(int argc, char *argv[])
// Create bin0. Have upperlimit as factor times lowerlimit. // Create bin0. Have upperlimit as factor times lowerlimit.
bins.append(DynamicList<label>()); bins.append(DynamicList<label>());
lowerLimits.append(sortedVols[0]); lowerLimits.append(sortedVols[0]);
upperLimits.append(1.1*lowerLimits[lowerLimits.size()-1]); upperLimits.append(1.1 * lowerLimits.last());
forAll(sortedVols, i) forAll(sortedVols, i)
{ {
if (sortedVols[i] > upperLimits[upperLimits.size()-1]) if (sortedVols[i] > upperLimits.last())
{ {
// New value outside of current bin // New value outside of current bin
// Shrink old bin. // Shrink old bin.
DynamicList<label>& bin = bins[bins.size()-1]; DynamicList<label>& bin = bins.last();
bin.shrink(); bin.shrink();
Info<< "Collected " << bin.size() << " elements in bin " Info<< "Collected " << bin.size() << " elements in bin "
<< lowerLimits[lowerLimits.size()-1] << " .. " << lowerLimits.last() << " .. "
<< upperLimits[upperLimits.size()-1] << endl; << upperLimits.last() << endl;
// Create new bin. // Create new bin.
bins.append(DynamicList<label>()); bins.append(DynamicList<label>());
lowerLimits.append(sortedVols[i]); lowerLimits.append(sortedVols[i]);
upperLimits.append(1.1*lowerLimits[lowerLimits.size()-1]); upperLimits.append(1.1 * lowerLimits.last());
Info<< "Creating new bin " << lowerLimits[lowerLimits.size()-1] Info<< "Creating new bin " << lowerLimits.last()
<< " .. " << upperLimits[upperLimits.size()-1] << " .. " << upperLimits.last()
<< endl; << endl;
} }
// Append to current bin. // Append to current bin.
DynamicList<label>& bin = bins[bins.size()-1]; DynamicList<label>& bin = bins.last();
bin.append(sortedVols.indices()[i]); bin.append(sortedVols.indices()[i]);
} }
Info<< endl; Info<< endl;
bins[bins.size()-1].shrink(); bins.last().shrink();
bins.shrink(); bins.shrink();
lowerLimits.shrink(); lowerLimits.shrink();
upperLimits.shrink(); upperLimits.shrink();
@ -355,8 +355,7 @@ int main(int argc, char *argv[])
<< nl << endl; << nl << endl;
} }
Info << nl << "End" << endl; Info<< "\nEnd\n" << endl;
return 0; return 0;
} }

View File

@ -324,7 +324,7 @@ endOfSection {space}")"{space}
// point group type skipped // point group type skipped
strtol(endPtr, &endPtr, 16); strtol(endPtr, &endPtr, 16);
pointi = pointGroupStartIndex[pointGroupStartIndex.size()-1]; pointi = pointGroupStartIndex.last();
// reset number of components to default // reset number of components to default
pointGroupNumberOfComponents = 3; pointGroupNumberOfComponents = 3;
@ -336,11 +336,11 @@ endOfSection {space}")"{space}
} }
Info<< "PointGroup: " Info<< "PointGroup: "
<< pointGroupZoneID[pointGroupZoneID.size()-1] << pointGroupZoneID.last()
<< " start: " << " start: "
<< pointGroupStartIndex[pointGroupStartIndex.size()-1] << pointGroupStartIndex.last()
<< " end: " << " end: "
<< pointGroupEndIndex[pointGroupEndIndex.size()-1] << flush; << pointGroupEndIndex.last() << flush;
} }
<readNumberOfPoints,readPointGroupData>{endOfSection} { <readNumberOfPoints,readPointGroupData>{endOfSection} {
@ -387,14 +387,14 @@ endOfSection {space}")"{space}
Info<< "done." << endl; Info<< "done." << endl;
// check read of points // check read of points
if (pointi != pointGroupEndIndex[pointGroupEndIndex.size()-1]+1) if (pointi != pointGroupEndIndex.last()+1)
{ {
Warning Warning
<< "Problem with reading points: " << nl << "Problem with reading points: " << nl
<< " start index: " << " start index: "
<< pointGroupStartIndex[pointGroupStartIndex.size()-1] << pointGroupStartIndex.last()
<< " end index: " << " end index: "
<< pointGroupEndIndex[pointGroupEndIndex.size()-1] << pointGroupEndIndex.last()
<< " last points read: " << pointi << nl << " last points read: " << pointi << nl
<< " on line " << lineNo << endl; << " on line " << lineNo << endl;
} }
@ -440,14 +440,14 @@ endOfSection {space}")"{space}
faceGroupElementType = strtol(endPtr, &endPtr, 16); faceGroupElementType = strtol(endPtr, &endPtr, 16);
facei = faceGroupStartIndex[faceGroupStartIndex.size()-1]; facei = faceGroupStartIndex.last();
Info<< "FaceGroup: " Info<< "FaceGroup: "
<< faceGroupZoneID[faceGroupZoneID.size()-1] << faceGroupZoneID.last()
<< " start: " << " start: "
<< faceGroupStartIndex[faceGroupStartIndex.size()-1] << faceGroupStartIndex.last()
<< " end: " << " end: "
<< faceGroupEndIndex[faceGroupEndIndex.size()-1] << flush; << faceGroupEndIndex.last() << flush;
} }
<readNumberOfFaces,readFaceGroupData>{space}{endOfSection} { <readNumberOfFaces,readFaceGroupData>{space}{endOfSection} {
@ -507,14 +507,14 @@ endOfSection {space}")"{space}
Info<< "done." << endl; Info<< "done." << endl;
// check read of fluentFaces // check read of fluentFaces
if (facei != faceGroupEndIndex[faceGroupEndIndex.size()-1]+1) if (facei != faceGroupEndIndex.last()+1)
{ {
Warning Warning
<< "Problem with reading fluentFaces: " << nl << "Problem with reading fluentFaces: " << nl
<< " start index: " << " start index: "
<< faceGroupStartIndex[faceGroupStartIndex.size()-1] << faceGroupStartIndex.last()
<< " end index: " << " end index: "
<< faceGroupEndIndex[faceGroupEndIndex.size()-1] << faceGroupEndIndex.last()
<< " last fluentFaces read: " << facei << nl << " last fluentFaces read: " << facei << nl
<< " on line " << lineNo << endl; << " on line " << lineNo << endl;
} }
@ -560,13 +560,13 @@ endOfSection {space}")"{space}
cellGroupType.append(strtol(endPtr, &endPtr, 16)); cellGroupType.append(strtol(endPtr, &endPtr, 16));
Info<< "CellGroup: " Info<< "CellGroup: "
<< cellGroupZoneID[cellGroupZoneID.size()-1] << cellGroupZoneID.last()
<< " start: " << " start: "
<< cellGroupStartIndex[cellGroupStartIndex.size()-1] << cellGroupStartIndex.last()
<< " end: " << " end: "
<< cellGroupEndIndex[cellGroupEndIndex.size()-1] << cellGroupEndIndex.last()
<< " type: " << " type: "
<< cellGroupType[cellGroupType.size()-1] << cellGroupType.last()
<< endl; << endl;
} }
@ -587,13 +587,13 @@ endOfSection {space}")"{space}
strtol(endPtr, &endPtr, 16); strtol(endPtr, &endPtr, 16);
Info<< "CellGroup: " Info<< "CellGroup: "
<< cellGroupZoneID[cellGroupZoneID.size()-1] << cellGroupZoneID.last()
<< " start: " << " start: "
<< cellGroupStartIndex[cellGroupStartIndex.size()-1] << cellGroupStartIndex.last()
<< " end: " << " end: "
<< cellGroupEndIndex[cellGroupEndIndex.size()-1] << cellGroupEndIndex.last()
<< " type: " << " type: "
<< cellGroupType[cellGroupType.size()-1] << cellGroupType.last()
<< endl; << endl;
} }
@ -1356,7 +1356,7 @@ int main(int argc, char *argv[])
mesh.write(); mesh.write();
Info<< nl << "End" << endl; Info<< "\nEnd\n" << endl;
return 0; return 0;
} }

View File

@ -1404,7 +1404,11 @@ int main(int argc, char *argv[])
//it will be put in a default wall boundary //it will be put in a default wall boundary
//internal boundaries are simply ignored //internal boundaries are simply ignored
if(patchTypes[patchI] != "internal" && !pShapeMesh.isInternalFace(meshFaces[0])) if
(
patchTypes[patchI] != "internal"
&& !pShapeMesh.isInternalFace(meshFaces[0])
)
{ {
//first face is external and has valid non-internal type //first face is external and has valid non-internal type
@ -1729,7 +1733,7 @@ int main(int argc, char *argv[])
} }
} }
Info<< nl << "End" << endl; Info<< "\nEnd\n" << endl;
return 0; return 0;
} }

View File

@ -867,7 +867,7 @@ int main(int argc, char *argv[])
Info<< "Writing polyMesh" << endl; Info<< "Writing polyMesh" << endl;
pShapeMesh.write(); pShapeMesh.write();
Info<< nl << "End" << endl; Info<< "\nEnd\n" << endl;
return 0; return 0;
} }

View File

@ -885,7 +885,7 @@ int main(int argc, char *argv[])
// Now use the patchFaces to patch up the outside faces of the mesh. // Now use the patchFaces to patch up the outside faces of the mesh.
// Get the patch for all the outside faces (= default patch added as last) // Get the patch for all the outside faces (= default patch added as last)
const polyPatch& pp = mesh.boundaryMesh()[mesh.boundaryMesh().size()-1]; const polyPatch& pp = mesh.boundaryMesh().last();
// Storage for faceZones. // Storage for faceZones.
List<DynamicList<label> > zoneFaces(patchFaces.size()); List<DynamicList<label> > zoneFaces(patchFaces.size());

View File

@ -324,13 +324,13 @@ void readCells
cellVerts.append(cellShape(tet, cVerts, true)); cellVerts.append(cellShape(tet, cVerts, true));
cellMaterial.append(physProp); cellMaterial.append(physProp);
if (cellVerts[cellVerts.size()-1].size() != cVerts.size()) if (cellVerts.last().size() != cVerts.size())
{ {
Pout<< "Line:" << is.lineNumber() Pout<< "Line:" << is.lineNumber()
<< " element:" << cellI << " element:" << cellI
<< " type:" << feID << " type:" << feID
<< " collapsed from " << cVerts << nl << " collapsed from " << cVerts << nl
<< " to:" << cellVerts[cellVerts.size()-1] << " to:" << cellVerts.last()
<< endl; << endl;
} }
} }
@ -347,13 +347,13 @@ void readCells
cellVerts.append(cellShape(prism, cVerts, true)); cellVerts.append(cellShape(prism, cVerts, true));
cellMaterial.append(physProp); cellMaterial.append(physProp);
if (cellVerts[cellVerts.size()-1].size() != cVerts.size()) if (cellVerts.last().size() != cVerts.size())
{ {
Pout<< "Line:" << is.lineNumber() Pout<< "Line:" << is.lineNumber()
<< " element:" << cellI << " element:" << cellI
<< " type:" << feID << " type:" << feID
<< " collapsed from " << cVerts << nl << " collapsed from " << cVerts << nl
<< " to:" << cellVerts[cellVerts.size()-1] << " to:" << cellVerts.last()
<< endl; << endl;
} }
} }
@ -371,13 +371,13 @@ void readCells
cellVerts.append(cellShape(hex, cVerts, true)); cellVerts.append(cellShape(hex, cVerts, true));
cellMaterial.append(physProp); cellMaterial.append(physProp);
if (cellVerts[cellVerts.size()-1].size() != cVerts.size()) if (cellVerts.last().size() != cVerts.size())
{ {
Pout<< "Line:" << is.lineNumber() Pout<< "Line:" << is.lineNumber()
<< " element:" << cellI << " element:" << cellI
<< " type:" << feID << " type:" << feID
<< " collapsed from " << cVerts << nl << " collapsed from " << cVerts << nl
<< " to:" << cellVerts[cellVerts.size()-1] << " to:" << cellVerts.last()
<< endl; << endl;
} }
} }
@ -511,7 +511,7 @@ void readDOFS
} }
Info<< "For DOF set " << group Info<< "For DOF set " << group
<< " named " << patchNames[patchNames.size()-1] << " named " << patchNames.last()
<< " trying to read vertex indices." << " trying to read vertex indices."
<< endl; << endl;
@ -534,7 +534,7 @@ void readDOFS
} }
Info<< "For DOF set " << group Info<< "For DOF set " << group
<< " named " << patchNames[patchNames.size()-1] << " named " << patchNames.last()
<< " read " << vertices.size() << " vertex indices." << endl; << " read " << vertices.size() << " vertex indices." << endl;
dofVertices.append(vertices.shrink()); dofVertices.append(vertices.shrink());

View File

@ -64,7 +64,7 @@ int main(int argc, char *argv[])
Info<< "Writing mesh" << endl; Info<< "Writing mesh" << endl;
makeMesh.writeMesh(); makeMesh.writeMesh();
Info<< nl << "End" << nl << endl; Info<< "\nEnd\n" << endl;
return 0; return 0;
} }

View File

@ -64,7 +64,7 @@ int main(int argc, char *argv[])
Info<< "Writing mesh" << endl; Info<< "Writing mesh" << endl;
makeMesh.writeMesh(); makeMesh.writeMesh();
Info<< nl << "End" << nl << endl; Info<< "\nEnd\n" << endl;
return 0; return 0;
} }

View File

@ -382,7 +382,7 @@ int main(int argc, char *argv[])
} }
} }
Info<< nl << "End" << endl; Info<< "\nEnd\n" << endl;
return 0; return 0;
} }

View File

@ -418,8 +418,8 @@ int main(int argc, char *argv[])
frontPatchFaces.setSize(layerFaces.size()); frontPatchFaces.setSize(layerFaces.size());
forAll(backPatchFaces, i) forAll(backPatchFaces, i)
{ {
backPatchFaces[i] = layerFaces[i][0]; backPatchFaces[i] = layerFaces[i].first();
frontPatchFaces[i] = layerFaces[i][layerFaces[i].size()-1]; frontPatchFaces[i] = layerFaces[i].last();
} }
// Create dummy fvSchemes, fvSolution // Create dummy fvSchemes, fvSolution

View File

@ -1,6 +1,6 @@
EXE_INC = \ EXE_INC = \
/* -g -DFULLDEBUG -O0 */ \ /* -g -DFULLDEBUG -O0 */ \
-I$(LIB_SRC)/decompositionMethods/decompositionMethods/lnInclude \ -I$(LIB_SRC)/parallel/decompositionMethods/lnInclude \
-I$(LIB_SRC)/mesh/autoMesh/lnInclude \ -I$(LIB_SRC)/mesh/autoMesh/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/triSurface/lnInclude \ -I$(LIB_SRC)/triSurface/lnInclude \

View File

@ -189,7 +189,7 @@ int main(int argc, char *argv[])
currentSet.write(); currentSet.write();
} }
Info << nl << "End" << endl; Info<< "\nEnd\n" << endl;
return 0; return 0;
} }

View File

@ -186,7 +186,7 @@ int main(int argc, char *argv[])
{ {
newPatches.append(findPatchID(mesh, patchNames[i])); newPatches.append(findPatchID(mesh, patchNames[i]));
Info<< "Using additional patch " << patchNames[i] Info<< "Using additional patch " << patchNames[i]
<< " at index " << newPatches[newPatches.size()-1] << endl; << " at index " << newPatches.last() << endl;
} }
} }

View File

@ -189,7 +189,7 @@ int main(int argc, char *argv[])
currentSet.write(); currentSet.write();
} }
Info << nl << "End" << endl; Info<< "\nEnd\n" << endl;
return 0; return 0;
} }

View File

@ -77,7 +77,7 @@ int main(int argc, char *argv[])
masterMesh.merge(); masterMesh.merge();
masterMesh.polyMesh::write(); masterMesh.polyMesh::write();
Info << nl << "End" << endl; Info<< "\nEnd\n" << endl;
return 0; return 0;
} }

View File

@ -189,7 +189,7 @@ int main(int argc, char *argv[])
currentSet.write(); currentSet.write();
} }
Info << nl << "End" << endl; Info<< "\nEnd\n" << endl;
return 0; return 0;
} }

View File

@ -2,7 +2,7 @@ EXE_INC = \
-I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/decompositionMethods/decompositionMethods/lnInclude -I$(LIB_SRC)/parallel/decompositionMethods/lnInclude
EXE_LIBS = \ EXE_LIBS = \
-lmeshTools \ -lmeshTools \

View File

@ -992,7 +992,7 @@ int main(int argc, char *argv[])
delete fileStreamPtr; delete fileStreamPtr;
} }
Pout<< "\nEnd" << endl; Pout<< "\nEnd\n" << endl;
return 0; return 0;
} }

View File

@ -341,7 +341,7 @@ int main(int argc, char *argv[])
<< exit(FatalError); << exit(FatalError);
} }
Info<< nl << "End" << endl; Info<< "\nEnd\n" << endl;
return 0; return 0;
} }

View File

@ -439,7 +439,7 @@ int main(int argc, char *argv[])
} }
Info << nl << "End" << endl; Info<< "\nEnd\n" << endl;
return 0; return 0;
} }

View File

@ -1,7 +1,7 @@
decomposeMesh.C
decomposePar.C decomposePar.C
domainDecomposition.C domainDecomposition.C
distributeCells.C domainDecompositionMesh.C
domainDecompositionDistribute.C
fvFieldDecomposer.C fvFieldDecomposer.C
pointFieldDecomposer.C pointFieldDecomposer.C
lagrangianFieldDecomposer.C lagrangianFieldDecomposer.C

View File

@ -1,5 +1,5 @@
EXE_INC = \ EXE_INC = \
-I$(LIB_SRC)/decompositionMethods/decompositionMethods/lnInclude \ -I$(LIB_SRC)/parallel/decompositionMethods/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \ -I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude -I$(LIB_SRC)/meshTools/lnInclude

View File

@ -106,7 +106,6 @@ int main(int argc, char *argv[])
Info<< "Decomposing mesh " << regionName << nl << endl; Info<< "Decomposing mesh " << regionName << nl << endl;
} }
bool writeCellDist = args.optionFound("cellDist"); bool writeCellDist = args.optionFound("cellDist");
bool copyUniform = args.optionFound("copyUniform"); bool copyUniform = args.optionFound("copyUniform");
bool decomposeFieldsOnly = args.optionFound("fields"); bool decomposeFieldsOnly = args.optionFound("fields");

View File

@ -38,7 +38,7 @@ License
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void domainDecomposition::mark void Foam::domainDecomposition::mark
( (
const labelList& zoneElems, const labelList& zoneElems,
const label zoneI, const label zoneI,
@ -66,7 +66,7 @@ void domainDecomposition::mark
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// from components // from components
domainDecomposition::domainDecomposition(const IOobject& io) Foam::domainDecomposition::domainDecomposition(const IOobject& io)
: :
fvMesh(io), fvMesh(io),
decompositionDict_ decompositionDict_
@ -105,13 +105,13 @@ domainDecomposition::domainDecomposition(const IOobject& io)
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
domainDecomposition::~domainDecomposition() Foam::domainDecomposition::~domainDecomposition()
{} {}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool domainDecomposition::writeDecomposition() bool Foam::domainDecomposition::writeDecomposition()
{ {
Info<< "\nConstructing processor meshes" << endl; Info<< "\nConstructing processor meshes" << endl;

View File

@ -26,7 +26,7 @@ Class
Foam::domainDecomposition Foam::domainDecomposition
Description Description
Automatic domain decomposition class for FOAM meshes Automatic domain decomposition class for finite-volume meshes
SourceFiles SourceFiles
domainDecomposition.C domainDecomposition.C
@ -42,10 +42,8 @@ SourceFiles
#include "PtrList.H" #include "PtrList.H"
#include "point.H" #include "point.H"
#ifndef namespaceFoam namespace Foam
#define namespaceFoam {
using namespace Foam;
#endif
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class domainDecomposition Declaration Class domainDecomposition Declaration
@ -165,6 +163,11 @@ public:
}; };
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif #endif

View File

@ -33,7 +33,7 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
void domainDecomposition::distributeCells() void Foam::domainDecomposition::distributeCells()
{ {
Info<< "\nCalculating distribution of cells" << endl; Info<< "\nCalculating distribution of cells" << endl;

View File

@ -40,7 +40,7 @@ Description
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void domainDecomposition::decomposeMesh(const bool filterEmptyPatches) void Foam::domainDecomposition::decomposeMesh(const bool filterEmptyPatches)
{ {
// Decide which cell goes to which processor // Decide which cell goes to which processor
distributeCells(); distributeCells();
@ -775,3 +775,5 @@ void domainDecomposition::decomposeMesh(const bool filterEmptyPatches)
sort(globallySharedPoints_); sort(globallySharedPoints_);
} }
} }
// ************************************************************************* //

View File

@ -26,14 +26,10 @@ License
#include "fvFieldDecomposer.H" #include "fvFieldDecomposer.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
fvFieldDecomposer::patchFieldDecomposer::patchFieldDecomposer Foam::fvFieldDecomposer::patchFieldDecomposer::patchFieldDecomposer
( (
const unallocLabelList& addressingSlice, const unallocLabelList& addressingSlice,
const label addressingOffset const label addressingOffset
@ -49,7 +45,7 @@ fvFieldDecomposer::patchFieldDecomposer::patchFieldDecomposer
} }
fvFieldDecomposer::processorVolPatchFieldDecomposer:: Foam::fvFieldDecomposer::processorVolPatchFieldDecomposer::
processorVolPatchFieldDecomposer processorVolPatchFieldDecomposer
( (
const fvMesh& mesh, const fvMesh& mesh,
@ -97,7 +93,7 @@ processorVolPatchFieldDecomposer
} }
fvFieldDecomposer::processorSurfacePatchFieldDecomposer:: Foam::fvFieldDecomposer::processorSurfacePatchFieldDecomposer::
processorSurfacePatchFieldDecomposer processorSurfacePatchFieldDecomposer
( (
const unallocLabelList& addressingSlice const unallocLabelList& addressingSlice
@ -117,7 +113,7 @@ processorSurfacePatchFieldDecomposer
} }
fvFieldDecomposer::fvFieldDecomposer Foam::fvFieldDecomposer::fvFieldDecomposer
( (
const fvMesh& completeMesh, const fvMesh& completeMesh,
const fvMesh& procMesh, const fvMesh& procMesh,
@ -187,7 +183,7 @@ fvFieldDecomposer::fvFieldDecomposer
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
fvFieldDecomposer::~fvFieldDecomposer() Foam::fvFieldDecomposer::~fvFieldDecomposer()
{ {
forAll(patchFieldDecomposerPtrs_, patchi) forAll(patchFieldDecomposerPtrs_, patchi)
{ {
@ -214,9 +210,4 @@ fvFieldDecomposer::~fvFieldDecomposer()
} }
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* // // ************************************************************************* //

View File

@ -28,16 +28,11 @@ License
#include "processorFvPatchField.H" #include "processorFvPatchField.H"
#include "processorFvsPatchField.H" #include "processorFvsPatchField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type> template<class Type>
tmp<GeometricField<Type, fvPatchField, volMesh> > Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> >
fvFieldDecomposer::decomposeField Foam::fvFieldDecomposer::decomposeField
( (
const GeometricField<Type, fvPatchField, volMesh>& field const GeometricField<Type, fvPatchField, volMesh>& field
) const ) const
@ -106,8 +101,8 @@ fvFieldDecomposer::decomposeField
template<class Type> template<class Type>
tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > Foam::tmp<Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh> >
fvFieldDecomposer::decomposeField Foam::fvFieldDecomposer::decomposeField
( (
const GeometricField<Type, fvsPatchField, surfaceMesh>& field const GeometricField<Type, fvsPatchField, surfaceMesh>& field
) const ) const
@ -217,7 +212,7 @@ fvFieldDecomposer::decomposeField
template<class GeoField> template<class GeoField>
void fvFieldDecomposer::decomposeFields void Foam::fvFieldDecomposer::decomposeFields
( (
const PtrList<GeoField>& fields const PtrList<GeoField>& fields
) const ) const
@ -229,8 +224,4 @@ void fvFieldDecomposer::decomposeFields
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* // // ************************************************************************* //

View File

@ -29,16 +29,10 @@ Description
#include "lagrangianFieldDecomposer.H" #include "lagrangianFieldDecomposer.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components // Construct from components
lagrangianFieldDecomposer::lagrangianFieldDecomposer Foam::lagrangianFieldDecomposer::lagrangianFieldDecomposer
( (
const polyMesh& mesh, const polyMesh& mesh,
const polyMesh& procMesh, const polyMesh& procMesh,
@ -88,6 +82,4 @@ lagrangianFieldDecomposer::lagrangianFieldDecomposer
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* // // ************************************************************************* //

View File

@ -27,15 +27,10 @@ License
#include "lagrangianFieldDecomposer.H" #include "lagrangianFieldDecomposer.H"
#include "IOobjectList.H" #include "IOobjectList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type> template<class Type>
void lagrangianFieldDecomposer::readFields void Foam::lagrangianFieldDecomposer::readFields
( (
const label cloudI, const label cloudI,
const IOobjectList& lagrangianObjects, const IOobjectList& lagrangianObjects,
@ -70,7 +65,8 @@ void lagrangianFieldDecomposer::readFields
template<class Type> template<class Type>
tmp<IOField<Type> > lagrangianFieldDecomposer::decomposeField Foam::tmp<Foam::IOField<Type> >
Foam::lagrangianFieldDecomposer::decomposeField
( (
const word& cloudName, const word& cloudName,
const IOField<Type>& field const IOField<Type>& field
@ -100,7 +96,7 @@ tmp<IOField<Type> > lagrangianFieldDecomposer::decomposeField
template<class GeoField> template<class GeoField>
void lagrangianFieldDecomposer::decomposeFields void Foam::lagrangianFieldDecomposer::decomposeFields
( (
const word& cloudName, const word& cloudName,
const PtrList<GeoField>& fields const PtrList<GeoField>& fields
@ -116,8 +112,4 @@ void lagrangianFieldDecomposer::decomposeFields
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* // // ************************************************************************* //

View File

@ -26,14 +26,9 @@ License
#include "pointFieldDecomposer.H" #include "pointFieldDecomposer.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
pointFieldDecomposer::patchFieldDecomposer::patchFieldDecomposer Foam::pointFieldDecomposer::patchFieldDecomposer::patchFieldDecomposer
( (
const pointPatch& completeMeshPatch, const pointPatch& completeMeshPatch,
const pointPatch& procMeshPatch, const pointPatch& procMeshPatch,
@ -79,7 +74,7 @@ pointFieldDecomposer::patchFieldDecomposer::patchFieldDecomposer
} }
pointFieldDecomposer::pointFieldDecomposer Foam::pointFieldDecomposer::pointFieldDecomposer
( (
const pointMesh& completeMesh, const pointMesh& completeMesh,
const pointMesh& procMesh, const pointMesh& procMesh,
@ -114,7 +109,7 @@ pointFieldDecomposer::pointFieldDecomposer
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
pointFieldDecomposer::~pointFieldDecomposer() Foam::pointFieldDecomposer::~pointFieldDecomposer()
{ {
forAll(patchFieldDecomposerPtrs_, patchi) forAll(patchFieldDecomposerPtrs_, patchi)
{ {
@ -128,6 +123,4 @@ pointFieldDecomposer::~pointFieldDecomposer()
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* // // ************************************************************************* //

View File

@ -28,16 +28,11 @@ License
#include "processorPointPatchFields.H" #include "processorPointPatchFields.H"
#include "globalPointPatchFields.H" #include "globalPointPatchFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type> template<class Type>
tmp<GeometricField<Type, pointPatchField, pointMesh> > Foam::tmp<Foam::GeometricField<Type, Foam::pointPatchField, Foam::pointMesh> >
pointFieldDecomposer::decomposeField Foam::pointFieldDecomposer::decomposeField
( (
const GeometricField<Type, pointPatchField, pointMesh>& field const GeometricField<Type, pointPatchField, pointMesh>& field
) const ) const
@ -117,7 +112,7 @@ pointFieldDecomposer::decomposeField
template<class GeoField> template<class GeoField>
void pointFieldDecomposer::decomposeFields void Foam::pointFieldDecomposer::decomposeFields
( (
const PtrList<GeoField>& fields const PtrList<GeoField>& fields
) const ) const
@ -131,6 +126,4 @@ void pointFieldDecomposer::decomposeFields
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* // // ************************************************************************* //

View File

@ -1,7 +1,3 @@
processorMeshes.C
fvFieldReconstructor.C
pointFieldReconstructor.C
reconstructLagrangianPositions.C
reconstructPar.C reconstructPar.C
EXE = $(FOAM_APPBIN)/reconstructPar EXE = $(FOAM_APPBIN)/reconstructPar

View File

@ -1,9 +1,11 @@
EXE_INC = \ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude -I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/parallel/reconstruct/lnInclude
EXE_LIBS = \ EXE_LIBS = \
-lfiniteVolume \ -lfiniteVolume \
-lgenericPatchFields \ -lgenericPatchFields \
-llagrangian \ -llagrangian \
-lmeshTools -lmeshTools \
-lreconstruct

View File

@ -1,5 +1,5 @@
EXE_INC = \ EXE_INC = \
-I$(LIB_SRC)/decompositionMethods/decompositionMethods/lnInclude \ -I$(LIB_SRC)/parallel/decompositionMethods/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude -I$(LIB_SRC)/dynamicMesh/lnInclude

View File

@ -33,11 +33,11 @@ Description
Balances mesh and writes new mesh to new time directory. Balances mesh and writes new mesh to new time directory.
Can also work like decomposePar: Can also work like decomposePar:
@verbatim
mkdir processor0 mkdir processor0
cp -r constant processor0 cp -r constant processor0
mpirun -np ddd redistributeMeshPar -parallel mpirun -np ddd redistributeMeshPar -parallel
@endverbatim
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "Field.H" #include "Field.H"

View File

@ -175,7 +175,7 @@ int main(int argc, char *argv[])
ensightMesh eMesh(mesh, args, binary); ensightMesh eMesh(mesh, args, binary);
// Set Time to the last time before looking for the lagrangian objects // Set Time to the last time before looking for the lagrangian objects
runTime.setTime(Times[Times.size()-1], Times.size()-1); runTime.setTime(Times.last(), Times.size()-1);
IOobjectList objects(mesh, runTime.timeName()); IOobjectList objects(mesh, runTime.timeName());

View File

@ -8,7 +8,7 @@ HashTable< HashTable<word> > cloudFields;
if (timeDirs.size()) if (timeDirs.size())
{ {
IOobjectList objs(mesh, timeDirs[timeDirs.size()-1].name()); IOobjectList objs(mesh, timeDirs.last().name());
forAllConstIter(IOobjectList, objs, fieldIter) forAllConstIter(IOobjectList, objs, fieldIter)
{ {
@ -34,7 +34,7 @@ if (timeDirs.size())
fileNameList cloudDirs = readDir fileNameList cloudDirs = readDir
( (
runTime.path() runTime.path()
/ timeDirs[timeDirs.size()-1].name() / timeDirs.last().name()
/ regionPrefix / regionPrefix
/ cloud::prefix, / cloud::prefix,
fileName::DIRECTORY fileName::DIRECTORY
@ -54,7 +54,7 @@ if (timeDirs.size())
IOobjectList objs IOobjectList objs
( (
mesh, mesh,
timeDirs[timeDirs.size()-1].name(), timeDirs.last().name(),
cloud::prefix/cloudName cloud::prefix/cloudName
); );

View File

@ -16,6 +16,17 @@
</Documentation> </Documentation>
</StringVectorProperty> </StringVectorProperty>
<!-- Send discrete time info to the animation panel -->
<DoubleVectorProperty
name="TimestepValues"
repeatable="1"
information_only="1">
<TimeStepsInformationHelper/>
<Documentation>
Available timestep values.
</Documentation>
</DoubleVectorProperty>
<!-- Cache Mesh check-box --> <!-- Cache Mesh check-box -->
<IntVectorProperty <IntVectorProperty
name="UiCacheMesh" name="UiCacheMesh"
@ -30,20 +41,33 @@
</Documentation> </Documentation>
</IntVectorProperty> </IntVectorProperty>
<!-- Refresh button -->
<!-- Send discrete time info to the animation panel --> <IntVectorProperty
<DoubleVectorProperty name="UiRefresh"
name="TimestepValues" command="SetRefresh"
repeatable="1" number_of_elements="1"
information_only="1"> is_internal="0"
<TimeStepsInformationHelper/> default_values="0"
animateable="0">
<BooleanDomain name="bool"/>
<Documentation> <Documentation>
Available timestep values. Rescan for updated timesteps/fields.
</Documentation> </Documentation>
</DoubleVectorProperty> </IntVectorProperty>
<!-- Skip Zero Time check-box -->
<!-- Global settings --> <IntVectorProperty
name="UiZeroTime"
command="SetSkipZeroTime"
number_of_elements="1"
is_internal="1"
default_values="0"
animateable="0">
<BooleanDomain name="bool"/>
<Documentation>
Skip including the 0/ time directory
</Documentation>
</IntVectorProperty>
<!-- Extrapolate Patches check-box --> <!-- Extrapolate Patches check-box -->
<IntVectorProperty <IntVectorProperty
@ -60,22 +84,24 @@
<!-- Include Sets check-box --> <!-- Include Sets check-box -->
<IntVectorProperty <IntVectorProperty
name="IncludeSets" name="UiIncludeSets"
command="SetIncludeSets" command="SetIncludeSets"
number_of_elements="1" number_of_elements="1"
is_internal="1"
default_values="0" default_values="0"
animateable="0"> animateable="0">
<Documentation> <Documentation>
Searches the polyMesh/sets/ directory Search the polyMesh/sets/ directory
</Documentation> </Documentation>
<BooleanDomain name="bool"/> <BooleanDomain name="bool"/>
</IntVectorProperty> </IntVectorProperty>
<!-- Include Zones check-box --> <!-- Include Zones check-box -->
<IntVectorProperty <IntVectorProperty
name="IncludeZones" name="UiIncludeZones"
command="SetIncludeZones" command="SetIncludeZones"
number_of_elements="1" number_of_elements="1"
is_internal="1"
default_values="0" default_values="0"
animateable="0"> animateable="0">
<Documentation> <Documentation>
@ -95,7 +121,7 @@
animateable="0"> animateable="0">
<BooleanDomain name="bool"/> <BooleanDomain name="bool"/>
<Documentation> <Documentation>
Show patch names in render window. Show patch names in render window
</Documentation> </Documentation>
</IntVectorProperty> </IntVectorProperty>
@ -112,12 +138,13 @@
</Documentation> </Documentation>
</IntVectorProperty> </IntVectorProperty>
<!--
<!-- Selections --> | Selections
-->
<!-- Available Parts (volume, patches, lagrangian) array --> <!-- Available Parts (volume, patches, lagrangian) array -->
<StringVectorProperty <StringVectorProperty
name="PartArrayInfo" name="PartArrayStatus"
information_only="1"> information_only="1">
<ArraySelectionInformationHelper attribute_name="Part"/> <ArraySelectionInformationHelper attribute_name="Part"/>
</StringVectorProperty> </StringVectorProperty>
@ -129,18 +156,21 @@
repeat_command="1" repeat_command="1"
number_of_elements_per_command="2" number_of_elements_per_command="2"
element_types="2 0" element_types="2 0"
information_property="PartArrayInfo" information_property="PartArrayStatus"
animateable="0"> animateable="0">
<ArraySelectionDomain name="array_list"> <ArraySelectionDomain name="array_list">
<RequiredProperties> <RequiredProperties>
<Property name="PartArrayInfo" function="ArrayList"/> <Property name="PartArrayStatus" function="ArrayList"/>
</RequiredProperties> </RequiredProperties>
</ArraySelectionDomain> </ArraySelectionDomain>
<Documentation>
This property contains a list of the mesh parts (patches, sets, zones).
</Documentation>
</StringVectorProperty> </StringVectorProperty>
<!-- Available volFields array --> <!-- Available volFields array -->
<StringVectorProperty <StringVectorProperty
name="VolFieldArrayInfo" name="VolFieldArrayStatus"
information_only="1"> information_only="1">
<ArraySelectionInformationHelper attribute_name="VolField"/> <ArraySelectionInformationHelper attribute_name="VolField"/>
</StringVectorProperty> </StringVectorProperty>
@ -152,18 +182,21 @@
repeat_command="1" repeat_command="1"
number_of_elements_per_command="2" number_of_elements_per_command="2"
element_types="2 0" element_types="2 0"
information_property="VolFieldArrayInfo" information_property="VolFieldArrayStatus"
animateable="0"> animateable="0">
<ArraySelectionDomain name="array_list"> <ArraySelectionDomain name="array_list">
<RequiredProperties> <RequiredProperties>
<Property name="VolFieldArrayInfo" function="ArrayList"/> <Property name="VolFieldArrayStatus" function="ArrayList"/>
</RequiredProperties> </RequiredProperties>
</ArraySelectionDomain> </ArraySelectionDomain>
<Documentation>
This property contains a list of the volume fields
</Documentation>
</StringVectorProperty> </StringVectorProperty>
<!-- Available Lagrangian fields array --> <!-- Available Lagrangian fields array -->
<StringVectorProperty <StringVectorProperty
name="LagrangianFieldArrayInfo" name="LagrangianFieldArrayStatus"
information_only="1"> information_only="1">
<ArraySelectionInformationHelper attribute_name="LagrangianField"/> <ArraySelectionInformationHelper attribute_name="LagrangianField"/>
</StringVectorProperty> </StringVectorProperty>
@ -175,18 +208,21 @@
repeat_command="1" repeat_command="1"
number_of_elements_per_command="2" number_of_elements_per_command="2"
element_types="2 0" element_types="2 0"
information_property="LagrangianFieldArrayInfo" information_property="LagrangianFieldArrayStatus"
animateable="0"> animateable="0">
<ArraySelectionDomain name="array_list"> <ArraySelectionDomain name="array_list">
<RequiredProperties> <RequiredProperties>
<Property name="LagrangianFieldArrayInfo" function="ArrayList"/> <Property name="LagrangianFieldArrayStatus" function="ArrayList"/>
</RequiredProperties> </RequiredProperties>
</ArraySelectionDomain> </ArraySelectionDomain>
<Documentation>
This property contains a list of the lagrangian fields
</Documentation>
</StringVectorProperty> </StringVectorProperty>
<!-- Available pointFields array --> <!-- Available pointFields array -->
<StringVectorProperty <StringVectorProperty
name="PointFieldArrayInfo" name="PointFieldArrayStatus"
information_only="1"> information_only="1">
<ArraySelectionInformationHelper attribute_name="PointField"/> <ArraySelectionInformationHelper attribute_name="PointField"/>
</StringVectorProperty> </StringVectorProperty>
@ -198,19 +234,26 @@
repeat_command="1" repeat_command="1"
number_of_elements_per_command="2" number_of_elements_per_command="2"
element_types="2 0" element_types="2 0"
information_property="PointFieldArrayInfo" information_property="PointFieldArrayStatus"
animateable="0"> animateable="0">
<ArraySelectionDomain name="array_list"> <ArraySelectionDomain name="array_list">
<RequiredProperties> <RequiredProperties>
<Property name="PointFieldArrayInfo" function="ArrayList"/> <Property name="PointFieldArrayStatus" function="ArrayList"/>
</RequiredProperties> </RequiredProperties>
</ArraySelectionDomain> </ArraySelectionDomain>
<Documentation>
This property contains a list of the point fields
</Documentation>
</StringVectorProperty> </StringVectorProperty>
<Hints> <Hints>
<Property name="FileName" show="0"/> <Property name="FileName" show="0"/>
<Property name="UiCacheMesh" show="0"/> <Property name="UiCacheMesh" show="0"/>
<Property name="UiZeroTime" show="0"/>
<Property name="UiRefresh" show="0"/>
<Property name="UiShowPatchNames" show="0"/> <Property name="UiShowPatchNames" show="0"/>
<Property name="UiIncludeSets" show="0"/>
<Property name="UiIncludeZones" show="0"/>
</Hints> </Hints>

View File

@ -32,6 +32,7 @@ License
#include <QLabel> #include <QLabel>
#include <QLayout> #include <QLayout>
#include <QString> #include <QString>
#include <QPushButton>
#include <QtDebug> #include <QtDebug>
// Paraview <-> QT UI // Paraview <-> QT UI
@ -56,22 +57,75 @@ pqPV3FoamReaderPanel::pqPV3FoamReaderPanel
QWidget *p QWidget *p
) )
: :
pqAutoGeneratedObjectPanel(proxy, p), pqAutoGeneratedObjectPanel(proxy, p)
sourceProxy_(vtkSMSourceProxy::SafeDownCast(this->proxy()))
{ {
// create first sublayout (at top of the panel) // create first sublayout (at top of the panel)
QGridLayout *sect1 = new QGridLayout(); QGridLayout *form = new QGridLayout();
this->PanelLayout->addLayout(sect1, 0, 0, 1, -1); this->PanelLayout->addLayout(form, 0, 0, 1, -1);
vtkSMProperty* prop = 0;
// refresh button for updating times/fields
if ((prop = this->proxy()->GetProperty("UiRefresh")) != 0)
{
prop->SetImmediateUpdate(1);
QPushButton *refresh = new QPushButton("Refresh Times");
refresh->setToolTip("Rescan for updated times/fields.");
form->addWidget(refresh, 0, 0, Qt::AlignLeft);
QObject::connect
(
refresh,
SIGNAL(clicked()),
this,
SLOT(RefreshPressed())
);
}
// checkbox for skip zeroTime
if ((prop = this->proxy()->GetProperty("UiZeroTime")) != 0)
{
// immediate update on the Server Manager side
prop->SetImmediateUpdate(true);
ZeroTime_ = new QCheckBox("Skip Zero Time");
ZeroTime_->setChecked
(
vtkSMIntVectorProperty::SafeDownCast(prop)->GetElement(0)
);
ZeroTime_->setToolTip
(
"Skip including the 0/ time directory."
);
form->addWidget(ZeroTime_, 0, 1, Qt::AlignLeft);
connect
(
ZeroTime_,
SIGNAL(stateChanged(int)),
this,
SLOT(ZeroTimeToggled())
);
}
// checkbox for caching mesh // checkbox for caching mesh
if ((prop = this->proxy()->GetProperty("UiCacheMesh")) != 0)
{
// immediate update on the Server Manager side
prop->SetImmediateUpdate(true);
CacheMesh_ = new QCheckBox("Cache Mesh"); CacheMesh_ = new QCheckBox("Cache Mesh");
CacheMesh_->setChecked(true); CacheMesh_->setChecked
(
// checkbox for caching mesh vtkSMIntVectorProperty::SafeDownCast(prop)->GetElement(0)
ShowPatchNames_ = new QCheckBox("Show Patch Names"); );
ShowPatchNames_->setChecked(false); CacheMesh_->setToolTip
(
"Cache the fvMesh in memory."
);
form->addWidget(CacheMesh_, 1, 0, Qt::AlignLeft);
connect connect
( (
CacheMesh_, CacheMesh_,
@ -79,7 +133,27 @@ pqPV3FoamReaderPanel::pqPV3FoamReaderPanel
this, this,
SLOT(CacheMeshToggled()) SLOT(CacheMeshToggled())
); );
}
// checkbox for patch names
if ((prop = this->proxy()->GetProperty("UiShowPatchNames")) != 0)
{
// immediate update on the Server Manager side
prop->SetImmediateUpdate(true);
ShowPatchNames_ = new QCheckBox("Patch Names");
ShowPatchNames_->setChecked
(
vtkSMIntVectorProperty::SafeDownCast(prop)->GetElement(0)
);
ShowPatchNames_->setToolTip
(
"Show patch names in render window."
);
// row/col 0,1
form->addWidget(ShowPatchNames_, 1, 1, Qt::AlignLeft);
connect connect
( (
ShowPatchNames_, ShowPatchNames_,
@ -87,20 +161,65 @@ pqPV3FoamReaderPanel::pqPV3FoamReaderPanel
this, this,
SLOT(ShowPatchNamesToggled()) SLOT(ShowPatchNamesToggled())
); );
}
sect1->addWidget(CacheMesh_);
sect1->addWidget(ShowPatchNames_);
// checkbox for include sets
if ((prop = this->proxy()->GetProperty("UiIncludeSets")) != 0)
{
// immediate update on the Server Manager side // immediate update on the Server Manager side
vtkSMIntVectorProperty::SafeDownCast prop->SetImmediateUpdate(true);
IncludeSets_ = new QCheckBox("Include Sets");
IncludeSets_->setChecked
( (
sourceProxy_->GetProperty("UiCacheMesh") vtkSMIntVectorProperty::SafeDownCast(prop)->GetElement(0)
)->SetImmediateUpdate(true); );
vtkSMIntVectorProperty::SafeDownCast IncludeSets_->setToolTip
( (
sourceProxy_->GetProperty("UiShowPatchNames") "Search the polyMesh/sets/ directory."
)->SetImmediateUpdate(true); );
// row/col 1,0
form->addWidget(IncludeSets_, 2, 0, Qt::AlignLeft);
connect
(
IncludeSets_,
SIGNAL(stateChanged(int)),
this,
SLOT(IncludeSetsToggled())
);
}
// checkbox for include zones
if ((prop = this->proxy()->GetProperty("UiIncludeZones")) != 0)
{
// immediate update on the Server Manager side
prop->SetImmediateUpdate(true);
IncludeZones_ = new QCheckBox("Include Zones");
IncludeZones_->setChecked
(
vtkSMIntVectorProperty::SafeDownCast(prop)->GetElement(0)
);
IncludeZones_->setToolTip
(
"ZoneMesh information is used to find {cell,face,point}Zones. "
"The polyMesh/ directory is only checked on startup."
);
// row/col 1,1
form->addWidget(IncludeZones_, 2, 1, Qt::AlignLeft);
connect
(
IncludeZones_,
SIGNAL(stateChanged(int)),
this,
SLOT(IncludeZonesToggled())
);
}
} }
@ -110,16 +229,43 @@ void pqPV3FoamReaderPanel::CacheMeshToggled()
{ {
vtkSMIntVectorProperty::SafeDownCast vtkSMIntVectorProperty::SafeDownCast
( (
sourceProxy_->GetProperty("UiCacheMesh") this->proxy()->GetProperty("UiCacheMesh")
)->SetElement(0, CacheMesh_->isChecked()); )->SetElement(0, CacheMesh_->isChecked());
} }
void pqPV3FoamReaderPanel::RefreshPressed()
{
// update everything
vtkSMIntVectorProperty::SafeDownCast
(
this->proxy()->GetProperty("UiRefresh")
)->Modified();
vtkSMSourceProxy::SafeDownCast(this->proxy())->UpdatePipeline();
// render all views
pqApplicationCore::instance()->render();
}
void pqPV3FoamReaderPanel::ZeroTimeToggled()
{
vtkSMIntVectorProperty::SafeDownCast
(
this->proxy()->GetProperty("UiZeroTime")
)->SetElement(0, ZeroTime_->isChecked());
// update everything
RefreshPressed();
}
void pqPV3FoamReaderPanel::ShowPatchNamesToggled() void pqPV3FoamReaderPanel::ShowPatchNamesToggled()
{ {
vtkSMIntVectorProperty::SafeDownCast vtkSMIntVectorProperty::SafeDownCast
( (
sourceProxy_->GetProperty("UiShowPatchNames") this->proxy()->GetProperty("UiShowPatchNames")
)->SetElement(0, ShowPatchNames_->isChecked()); )->SetElement(0, ShowPatchNames_->isChecked());
// update the active view // update the active view
@ -132,4 +278,37 @@ void pqPV3FoamReaderPanel::ShowPatchNamesToggled()
} }
void pqPV3FoamReaderPanel::IncludeSetsToggled()
{
vtkSMProperty* prop;
vtkSMIntVectorProperty::SafeDownCast
(
this->proxy()->GetProperty("UiIncludeSets")
)->SetElement(0, IncludeSets_->isChecked());
if ((prop = this->proxy()->GetProperty("PartArrayStatus")) != 0)
{
this->proxy()->UpdatePropertyInformation(prop);
}
}
void pqPV3FoamReaderPanel::IncludeZonesToggled()
{
vtkSMProperty* prop;
vtkSMIntVectorProperty::SafeDownCast
(
this->proxy()->GetProperty("UiIncludeZones")
)->SetElement(0, IncludeZones_->isChecked());
if ((prop = this->proxy()->GetProperty("PartArrayStatus")) != 0)
{
this->proxy()->UpdatePropertyInformation(prop);
}
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -37,6 +37,7 @@ SourceFiles
#ifndef pqPV3FoamReaderPanel_h #ifndef pqPV3FoamReaderPanel_h
#define pqPV3FoamReaderPanel_h #define pqPV3FoamReaderPanel_h
#include "pqAutoGeneratedObjectPanel.h" #include "pqAutoGeneratedObjectPanel.h"
// Forward declaration of QT classes // Forward declaration of QT classes
@ -62,8 +63,8 @@ class pqPV3FoamReaderPanel
Q_OBJECT; Q_OBJECT;
typedef pqAutoGeneratedObjectPanel Superclass; typedef pqAutoGeneratedObjectPanel Superclass;
//- Server Manager Source Proxy //- ZeroTime checkbox
vtkSMSourceProxy* sourceProxy_; QCheckBox* ZeroTime_;
//- CacheMesh checkbox //- CacheMesh checkbox
QCheckBox* CacheMesh_; QCheckBox* CacheMesh_;
@ -71,10 +72,20 @@ class pqPV3FoamReaderPanel
//- Show Patch Names checkbox //- Show Patch Names checkbox
QCheckBox* ShowPatchNames_; QCheckBox* ShowPatchNames_;
//- IncludeSets checkbox
QCheckBox* IncludeSets_;
//- IncludeZones checkbox
QCheckBox* IncludeZones_;
protected slots: protected slots:
void CacheMeshToggled(); void CacheMeshToggled();
void ZeroTimeToggled();
void RefreshPressed();
void ShowPatchNamesToggled(); void ShowPatchNamesToggled();
void IncludeSetsToggled();
void IncludeZonesToggled();
public: public:

View File

@ -79,7 +79,9 @@ vtkPV3FoamReader::vtkPV3FoamReader()
TimeStepRange[1] = 0; TimeStepRange[1] = 0;
CacheMesh = 1; CacheMesh = 1;
Refresh = 0;
SkipZeroTime = 0;
ExtrapolatePatches = 0; ExtrapolatePatches = 0;
IncludeSets = 0; IncludeSets = 0;
IncludeZones = 0; IncludeZones = 0;
@ -336,7 +338,6 @@ int vtkPV3FoamReader::RequestData
foamData_->setTime(nRequestTime, requestTime); foamData_->setTime(nRequestTime, requestTime);
} }
vtkMultiBlockDataSet* output = vtkMultiBlockDataSet::SafeDownCast vtkMultiBlockDataSet* output = vtkMultiBlockDataSet::SafeDownCast
( (
outputVector->GetInformationObject(0)->Get outputVector->GetInformationObject(0)->Get
@ -420,7 +421,39 @@ int vtkPV3FoamReader::RequestData
} }
void vtkPV3FoamReader::SetShowPatchNames(const int val) void vtkPV3FoamReader::SetRefresh(int val)
{
Modified();
}
void vtkPV3FoamReader::SetIncludeSets(int val)
{
if (IncludeSets != val)
{
IncludeSets = val;
if (foamData_)
{
foamData_->updateInfo();
}
}
}
void vtkPV3FoamReader::SetIncludeZones(int val)
{
if (IncludeZones != val)
{
IncludeZones = val;
if (foamData_)
{
foamData_->updateInfo();
}
}
}
void vtkPV3FoamReader::SetShowPatchNames(int val)
{ {
if (ShowPatchNames != val) if (ShowPatchNames != val)
{ {
@ -430,7 +463,6 @@ void vtkPV3FoamReader::SetShowPatchNames(const int val)
} }
void vtkPV3FoamReader::updatePatchNamesView(const bool show) void vtkPV3FoamReader::updatePatchNamesView(const bool show)
{ {
pqApplicationCore* appCore = pqApplicationCore::instance(); pqApplicationCore* appCore = pqApplicationCore::instance();
@ -452,7 +484,7 @@ void vtkPV3FoamReader::updatePatchNamesView(const bool show)
// Get all the pqRenderView instances // Get all the pqRenderView instances
QList<pqRenderView*> renderViews = smModel->findItems<pqRenderView*>(); QList<pqRenderView*> renderViews = smModel->findItems<pqRenderView*>();
for (int viewI=0; viewI<renderViews.size(); viewI++) for (int viewI=0; viewI < renderViews.size(); ++viewI)
{ {
foamData_->renderPatchNames foamData_->renderPatchNames
( (
@ -521,7 +553,8 @@ int vtkPV3FoamReader::GetPartArrayStatus(const char* name)
void vtkPV3FoamReader::SetPartArrayStatus(const char* name, int status) void vtkPV3FoamReader::SetPartArrayStatus(const char* name, int status)
{ {
vtkDebugMacro(<<"SetPartArrayStatus"); vtkDebugMacro("Set mesh part \"" << name << "\" status to: " << status);
if (status) if (status)
{ {
PartSelection->EnableArray(name); PartSelection->EnableArray(name);

View File

@ -83,6 +83,15 @@ public:
vtkSetMacro(CacheMesh, int); vtkSetMacro(CacheMesh, int);
vtkGetMacro(CacheMesh, int); vtkGetMacro(CacheMesh, int);
// Description:
// FOAM refresh times/fields
virtual void SetRefresh(int);
// Description:
// FOAM Skip/include the 0/ time directory
vtkSetMacro(SkipZeroTime, int);
vtkGetMacro(SkipZeroTime, int);
// Description: // Description:
// GUI update control // GUI update control
vtkSetMacro(UpdateGUI, int); vtkSetMacro(UpdateGUI, int);
@ -93,13 +102,14 @@ public:
vtkSetMacro(ExtrapolatePatches, int); vtkSetMacro(ExtrapolatePatches, int);
vtkGetMacro(ExtrapolatePatches, int); vtkGetMacro(ExtrapolatePatches, int);
// Description:
// FOAM read sets control // FOAM read sets control
vtkSetMacro(IncludeSets, int); virtual void SetIncludeSets(int);
vtkGetMacro(IncludeSets, int); vtkGetMacro(IncludeSets, int);
// Description: // Description:
// FOAM read zones control // FOAM read zones control
vtkSetMacro(IncludeZones, int); virtual void SetIncludeZones(int);
vtkGetMacro(IncludeZones, int); vtkGetMacro(IncludeZones, int);
// Description: // Description:
@ -113,7 +123,7 @@ public:
// Description: // Description:
// Parts selection list control // Parts selection list control
vtkDataArraySelection* GetPartSelection(); virtual vtkDataArraySelection* GetPartSelection();
int GetNumberOfPartArrays(); int GetNumberOfPartArrays();
int GetPartArrayStatus(const char* name); int GetPartArrayStatus(const char* name);
void SetPartArrayStatus(const char* name, int status); void SetPartArrayStatus(const char* name, int status);
@ -121,7 +131,7 @@ public:
// Description: // Description:
// volField selection list control // volField selection list control
vtkDataArraySelection* GetVolFieldSelection(); virtual vtkDataArraySelection* GetVolFieldSelection();
int GetNumberOfVolFieldArrays(); int GetNumberOfVolFieldArrays();
int GetVolFieldArrayStatus(const char* name); int GetVolFieldArrayStatus(const char* name);
void SetVolFieldArrayStatus(const char* name, int status); void SetVolFieldArrayStatus(const char* name, int status);
@ -129,7 +139,7 @@ public:
// Description: // Description:
// pointField selection list control // pointField selection list control
vtkDataArraySelection* GetPointFieldSelection(); virtual vtkDataArraySelection* GetPointFieldSelection();
int GetNumberOfPointFieldArrays(); int GetNumberOfPointFieldArrays();
int GetPointFieldArrayStatus(const char* name); int GetPointFieldArrayStatus(const char* name);
void SetPointFieldArrayStatus(const char* name, int status); void SetPointFieldArrayStatus(const char* name, int status);
@ -137,7 +147,7 @@ public:
// Description: // Description:
// lagrangianField selection list control // lagrangianField selection list control
vtkDataArraySelection* GetLagrangianFieldSelection(); virtual vtkDataArraySelection* GetLagrangianFieldSelection();
int GetNumberOfLagrangianFieldArrays(); int GetNumberOfLagrangianFieldArrays();
int GetLagrangianFieldArrayStatus(const char* name); int GetLagrangianFieldArrayStatus(const char* name);
void SetLagrangianFieldArrayStatus(const char* name, int status); void SetLagrangianFieldArrayStatus(const char* name, int status);
@ -156,7 +166,6 @@ public:
void SelectionModified(); void SelectionModified();
protected: protected:
//- Construct null //- Construct null
@ -185,9 +194,10 @@ protected:
//- Fill in additional port information //- Fill in additional port information
virtual int FillOutputPortInformation(int, vtkInformation*); virtual int FillOutputPortInformation(int, vtkInformation*);
// The observer to modify this object when array selections are modified //- The observer to modify this object when array selections are modified
vtkCallbackCommand* SelectionObserver; vtkCallbackCommand* SelectionObserver;
//- The file name for this case
char* FileName; char* FileName;
private: private:
@ -202,14 +212,16 @@ private:
void updatePatchNamesView(const bool show); void updatePatchNamesView(const bool show);
int TimeStepRange[2]; int TimeStepRange[2];
int Refresh;
int CacheMesh; int CacheMesh;
int SkipZeroTime;
int ExtrapolatePatches; int ExtrapolatePatches;
int IncludeSets; int IncludeSets;
int IncludeZones; int IncludeZones;
int ShowPatchNames; int ShowPatchNames;
//- Dummy variable/switch for invoke a reader update //- Dummy variable/switch to invoke a reader update
int UpdateGUI; int UpdateGUI;
vtkDataArraySelection* PartSelection; vtkDataArraySelection* PartSelection;

View File

@ -50,16 +50,16 @@ defineTypeNameAndDebug(Foam::vtkPV3Foam, 0);
void Foam::vtkPV3Foam::resetCounters() void Foam::vtkPV3Foam::resetCounters()
{ {
// Reset mesh part ids and sizes // Reset array range information (ids and sizes)
partInfoVolume_.reset(); arrayRangeVolume_.reset();
partInfoPatches_.reset(); arrayRangePatches_.reset();
partInfoLagrangian_.reset(); arrayRangeLagrangian_.reset();
partInfoCellZones_.reset(); arrayRangeCellZones_.reset();
partInfoFaceZones_.reset(); arrayRangeFaceZones_.reset();
partInfoPointZones_.reset(); arrayRangePointZones_.reset();
partInfoCellSets_.reset(); arrayRangeCellSets_.reset();
partInfoFaceSets_.reset(); arrayRangeFaceSets_.reset();
partInfoPointSets_.reset(); arrayRangePointSets_.reset();
} }
@ -92,21 +92,6 @@ void Foam::vtkPV3Foam::reduceMemory()
int Foam::vtkPV3Foam::setTime(int nRequest, const double requestTimes[]) int Foam::vtkPV3Foam::setTime(int nRequest, const double requestTimes[])
{ {
if (debug)
{
Info<< "<beg> Foam::vtkPV3Foam::setTime(";
for (int requestI = 0; requestI < nRequest; ++requestI)
{
if (requestI)
{
Info<< ", ";
}
Info<< requestTimes[requestI];
}
Info << ") - previousIndex = " << timeIndex_ << endl;
}
Time& runTime = dbPtr_(); Time& runTime = dbPtr_();
// Get times list // Get times list
@ -128,6 +113,22 @@ int Foam::vtkPV3Foam::setTime(int nRequest, const double requestTimes[])
nearestIndex = 0; nearestIndex = 0;
} }
if (debug)
{
Info<< "<beg> Foam::vtkPV3Foam::setTime(";
for (int requestI = 0; requestI < nRequest; ++requestI)
{
if (requestI)
{
Info<< ", ";
}
Info<< requestTimes[requestI];
}
Info<< ") - previousIndex = " << timeIndex_
<< ", nearestIndex = " << nearestIndex << endl;
}
// see what has changed // see what has changed
if (timeIndex_ != nearestIndex) if (timeIndex_ != nearestIndex)
@ -230,15 +231,15 @@ Foam::vtkPV3Foam::vtkPV3Foam
timeIndex_(-1), timeIndex_(-1),
meshChanged_(true), meshChanged_(true),
fieldsChanged_(true), fieldsChanged_(true),
partInfoVolume_("unzoned"), arrayRangeVolume_("unzoned"),
partInfoPatches_("patches"), arrayRangePatches_("patches"),
partInfoLagrangian_("lagrangian"), arrayRangeLagrangian_("lagrangian"),
partInfoCellZones_("cellZone"), arrayRangeCellZones_("cellZone"),
partInfoFaceZones_("faceZone"), arrayRangeFaceZones_("faceZone"),
partInfoPointZones_("pointZone"), arrayRangePointZones_("pointZone"),
partInfoCellSets_("cellSet"), arrayRangeCellSets_("cellSet"),
partInfoFaceSets_("faceSet"), arrayRangeFaceSets_("faceSet"),
partInfoPointSets_("pointSet") arrayRangePointSets_("pointSet")
{ {
if (debug) if (debug)
{ {
@ -288,7 +289,7 @@ Foam::vtkPV3Foam::vtkPV3Foam
meshRegion_ = caseName.substr(beg+1, end-beg-1); meshRegion_ = caseName.substr(beg+1, end-beg-1);
// some safety // some safety
if (!meshRegion_.size()) if (meshRegion_.empty())
{ {
meshRegion_ = polyMesh::defaultRegion; meshRegion_ = polyMesh::defaultRegion;
} }
@ -352,6 +353,14 @@ void Foam::vtkPV3Foam::updateInfo()
vtkDataArraySelection* partSelection = reader_->GetPartSelection(); vtkDataArraySelection* partSelection = reader_->GetPartSelection();
// there are two ways to ensure we have the correct list of parts:
// 1. remove everything and then set particular entries 'on'
// 2. build a 'char **' list and call SetArraysWithDefault()
//
// Nr. 2 has the potential advantage of not touching the modification
// time of the vtkDataArraySelection, but the qt/paraview proxy
// layer doesn't care about that anyhow.
// enable 'internalMesh' on the first call // enable 'internalMesh' on the first call
// or preserve the enabled selections // or preserve the enabled selections
stringList enabledEntries; stringList enabledEntries;
@ -369,11 +378,11 @@ void Foam::vtkPV3Foam::updateInfo()
partSelection->RemoveAllArrays(); partSelection->RemoveAllArrays();
// Update mesh parts list - add Lagrangian at the bottom // Update mesh parts list - add Lagrangian at the bottom
updateInfoInternalMesh(); updateInfoInternalMesh(partSelection);
updateInfoPatches(); updateInfoPatches(partSelection);
updateInfoSets(); updateInfoSets(partSelection);
updateInfoZones(); updateInfoZones(partSelection);
updateInfoLagrangian(); updateInfoLagrangian(partSelection);
// restore the enabled selections // restore the enabled selections
setSelectedArrayEntries(partSelection, enabledEntries); setSelectedArrayEntries(partSelection, enabledEntries);
@ -396,6 +405,8 @@ void Foam::vtkPV3Foam::updateInfo()
if (debug) if (debug)
{ {
// just for debug info
getSelectedArrayEntries(partSelection);
Info<< "<end> Foam::vtkPV3Foam::updateInfo" << endl; Info<< "<end> Foam::vtkPV3Foam::updateInfo" << endl;
} }
@ -559,12 +570,26 @@ double* Foam::vtkPV3Foam::findTimes(int& nTimeSteps)
nTimes = timeLst.size() - timeI; nTimes = timeLst.size() - timeI;
// always skip "constant" time if possible // skip "constant" time whenever possible
if (timeI == 0 && nTimes > 1) if (timeI == 0 && nTimes > 1)
{ {
timeI = 1; if (timeLst[timeI].name() == "constant")
{
++timeI;
--nTimes; --nTimes;
} }
}
// skip "0/" time if requested and possible
if (nTimes > 1 && reader_->GetSkipZeroTime())
{
if (mag(timeLst[timeI].value()) < SMALL)
{
++timeI;
--nTimes;
}
}
if (nTimes) if (nTimes)
{ {
@ -607,10 +632,10 @@ void Foam::vtkPV3Foam::renderPatchNames(vtkRenderer* renderer, const bool show)
wordHashSet selectedPatches = getSelected wordHashSet selectedPatches = getSelected
( (
reader_->GetPartSelection(), reader_->GetPartSelection(),
partInfoPatches_ arrayRangePatches_
); );
if (!selectedPatches.size()) if (selectedPatches.empty())
{ {
return; return;
} }

View File

@ -111,7 +111,7 @@ class vtkPV3Foam
// Private classes // Private classes
//- Bookkeeping for GUI checklists and the multi-block organization //- Bookkeeping for GUI checklists and the multi-block organization
class partInfo class arrayRange
{ {
const char *name_; const char *name_;
int block_; int block_;
@ -120,11 +120,11 @@ class vtkPV3Foam
public: public:
partInfo(const char *name, const int blockNo=0) arrayRange(const char *name, const int blockNo=0)
: :
name_(name), name_(name),
block_(blockNo), block_(blockNo),
start_(-1), start_(0),
size_(0) size_(0)
{} {}
@ -142,21 +142,25 @@ class vtkPV3Foam
return prev; return prev;
} }
//- Return block name
const char* name() const const char* name() const
{ {
return name_; return name_;
} }
//- Return array start index
int start() const int start() const
{ {
return start_; return start_;
} }
//- Return array end index
int end() const int end() const
{ {
return start_ + size_; return start_ + size_;
} }
//- Return sublist size
int size() const int size() const
{ {
return size_; return size_;
@ -167,16 +171,10 @@ class vtkPV3Foam
return !size_; return !size_;
} }
void reset() //- Reset the size to zero and optionally assign a new start
void reset(const int startAt = 0)
{ {
start_ = -1; start_ = startAt;
size_ = 0;
}
//- Assign new start and reset the size
void operator=(const int i)
{
start_ = i;
size_ = 0; size_ = 0;
} }
@ -282,15 +280,15 @@ class vtkPV3Foam
//- First instance and size of various mesh parts //- First instance and size of various mesh parts
// used to index into partStatus_ and partDataset_ // used to index into partStatus_ and partDataset_
partInfo partInfoVolume_; arrayRange arrayRangeVolume_;
partInfo partInfoPatches_; arrayRange arrayRangePatches_;
partInfo partInfoLagrangian_; arrayRange arrayRangeLagrangian_;
partInfo partInfoCellZones_; arrayRange arrayRangeCellZones_;
partInfo partInfoFaceZones_; arrayRange arrayRangeFaceZones_;
partInfo partInfoPointZones_; arrayRange arrayRangePointZones_;
partInfo partInfoCellSets_; arrayRange arrayRangeCellSets_;
partInfo partInfoFaceSets_; arrayRange arrayRangeFaceSets_;
partInfo partInfoPointSets_; arrayRange arrayRangePointSets_;
//- Decomposed cells information (mesh regions) //- Decomposed cells information (mesh regions)
// TODO: regions // TODO: regions
@ -313,7 +311,7 @@ class vtkPV3Foam
( (
vtkMultiBlockDataSet* output, vtkMultiBlockDataSet* output,
vtkDataSet* dataset, vtkDataSet* dataset,
const partInfo&, const arrayRange&,
const label datasetNo, const label datasetNo,
const std::string& datasetName const std::string& datasetName
); );
@ -323,7 +321,7 @@ class vtkPV3Foam
static vtkDataSet* GetDataSetFromBlock static vtkDataSet* GetDataSetFromBlock
( (
vtkMultiBlockDataSet* output, vtkMultiBlockDataSet* output,
const partInfo&, const arrayRange&,
const label datasetNo const label datasetNo
); );
@ -332,7 +330,7 @@ class vtkPV3Foam
static label GetNumberOfDataSets static label GetNumberOfDataSets
( (
vtkMultiBlockDataSet* output, vtkMultiBlockDataSet* output,
const partInfo& const arrayRange&
); );
//- Reset data counters //- Reset data counters
@ -344,19 +342,19 @@ class vtkPV3Foam
void updateMeshPartsStatus(); void updateMeshPartsStatus();
//- Internal mesh info //- Internal mesh info
void updateInfoInternalMesh(); void updateInfoInternalMesh(vtkDataArraySelection*);
//- Lagrangian info //- Lagrangian info
void updateInfoLagrangian(); void updateInfoLagrangian(vtkDataArraySelection*);
//- Patch info //- Patch info
void updateInfoPatches(); void updateInfoPatches(vtkDataArraySelection*);
//- Set info //- Set info
void updateInfoSets(); void updateInfoSets(vtkDataArraySelection*);
//- Zone info //- Zone info
void updateInfoZones(); void updateInfoZones(vtkDataArraySelection*);
//- Read zone names for zoneType from file //- Read zone names for zoneType from file
wordList readZoneNames(const word& zoneType); wordList readZoneNames(const word& zoneType);
@ -511,7 +509,7 @@ class vtkPV3Foam
const GeometricField<Type, fvPatchField, volMesh>&, const GeometricField<Type, fvPatchField, volMesh>&,
autoPtr<GeometricField<Type, pointPatchField, pointMesh> >&, autoPtr<GeometricField<Type, pointPatchField, pointMesh> >&,
vtkMultiBlockDataSet* output, vtkMultiBlockDataSet* output,
const partInfo& selector, const arrayRange&,
const List<polyDecomp>& decompLst const List<polyDecomp>& decompLst
); );
@ -521,7 +519,7 @@ class vtkPV3Foam
( (
const GeometricField<Type, fvPatchField, volMesh>&, const GeometricField<Type, fvPatchField, volMesh>&,
vtkMultiBlockDataSet* output, vtkMultiBlockDataSet* output,
const partInfo&, const arrayRange&,
const label datasetNo, const label datasetNo,
const polyDecomp& const polyDecomp&
); );
@ -533,7 +531,7 @@ class vtkPV3Foam
const word& name, const word& name,
const Field<Type>&, const Field<Type>&,
vtkMultiBlockDataSet* output, vtkMultiBlockDataSet* output,
const partInfo&, const arrayRange&,
const label datasetNo const label datasetNo
); );
@ -543,7 +541,7 @@ class vtkPV3Foam
( (
const GeometricField<Type, fvPatchField, volMesh>&, const GeometricField<Type, fvPatchField, volMesh>&,
vtkMultiBlockDataSet* output, vtkMultiBlockDataSet* output,
const partInfo&, const arrayRange&,
const label datasetNo, const label datasetNo,
const fvMesh&, const fvMesh&,
const labelList& faceLabels const labelList& faceLabels
@ -555,7 +553,7 @@ class vtkPV3Foam
( (
const GeometricField<Type, fvPatchField, volMesh>&, const GeometricField<Type, fvPatchField, volMesh>&,
vtkMultiBlockDataSet* output, vtkMultiBlockDataSet* output,
const partInfo&, const arrayRange&,
const label datasetNo, const label datasetNo,
const fvMesh&, const fvMesh&,
const faceSet& const faceSet&
@ -576,7 +574,7 @@ class vtkPV3Foam
( (
const IOField<Type>&, const IOField<Type>&,
vtkMultiBlockDataSet* output, vtkMultiBlockDataSet* output,
const partInfo&, const arrayRange&,
const label datasetNo const label datasetNo
); );
@ -596,7 +594,7 @@ class vtkPV3Foam
( (
const GeometricField<Type, pointPatchField, pointMesh>&, const GeometricField<Type, pointPatchField, pointMesh>&,
vtkMultiBlockDataSet* output, vtkMultiBlockDataSet* output,
const partInfo& selector, const arrayRange&,
const List<polyDecomp>& const List<polyDecomp>&
); );
@ -607,7 +605,7 @@ class vtkPV3Foam
const GeometricField<Type, pointPatchField, pointMesh>&, const GeometricField<Type, pointPatchField, pointMesh>&,
const GeometricField<Type, fvPatchField, volMesh>&, const GeometricField<Type, fvPatchField, volMesh>&,
vtkMultiBlockDataSet* output, vtkMultiBlockDataSet* output,
const partInfo&, const arrayRange&,
const label datasetNo, const label datasetNo,
const polyDecomp& const polyDecomp&
); );
@ -619,7 +617,7 @@ class vtkPV3Foam
const word& name, const word& name,
const Field<Type>&, const Field<Type>&,
vtkMultiBlockDataSet* output, vtkMultiBlockDataSet* output,
const partInfo&, const arrayRange&,
const label datasetNo const label datasetNo
); );
@ -640,7 +638,7 @@ class vtkPV3Foam
static wordHashSet getSelected static wordHashSet getSelected
( (
vtkDataArraySelection*, vtkDataArraySelection*,
const partInfo& const arrayRange&
); );
//- Retrieve the current selections //- Retrieve the current selections
@ -650,7 +648,7 @@ class vtkPV3Foam
static stringList getSelectedArrayEntries static stringList getSelectedArrayEntries
( (
vtkDataArraySelection*, vtkDataArraySelection*,
const partInfo& const arrayRange&
); );
//- Set selection(s) //- Set selection(s)
@ -661,7 +659,7 @@ class vtkPV3Foam
); );
//- Get the first word from the mesh parts selection //- Get the first word from the mesh parts selection
word getPartName(int); word getPartName(const int);
//- Disallow default bitwise copy construct //- Disallow default bitwise copy construct

View File

@ -50,11 +50,17 @@ Foam::label Foam::vtkPV3Foam::addToSelection
{ {
if (suffix.size()) if (suffix.size())
{ {
select->AddArray((names[nameI] + suffix).c_str()); select->AddArray
(
(names[nameI] + suffix).c_str()
);
} }
else else
{ {
select->AddArray(names[nameI].c_str()); select->AddArray
(
(names[nameI]).c_str()
);
} }
} }

View File

@ -43,7 +43,7 @@ void Foam::vtkPV3Foam::convertFaceField
( (
const GeometricField<Type, fvPatchField, volMesh>& tf, const GeometricField<Type, fvPatchField, volMesh>& tf,
vtkMultiBlockDataSet* output, vtkMultiBlockDataSet* output,
const partInfo& selector, const arrayRange& range,
const label datasetNo, const label datasetNo,
const fvMesh& mesh, const fvMesh& mesh,
const labelList& faceLabels const labelList& faceLabels
@ -100,7 +100,7 @@ void Foam::vtkPV3Foam::convertFaceField
vtkPolyData::SafeDownCast vtkPolyData::SafeDownCast
( (
GetDataSetFromBlock(output, selector, datasetNo) GetDataSetFromBlock(output, range, datasetNo)
) ->GetCellData() ) ->GetCellData()
->AddArray(cellData); ->AddArray(cellData);
@ -113,7 +113,7 @@ void Foam::vtkPV3Foam::convertFaceField
( (
const GeometricField<Type, fvPatchField, volMesh>& tf, const GeometricField<Type, fvPatchField, volMesh>& tf,
vtkMultiBlockDataSet* output, vtkMultiBlockDataSet* output,
const partInfo& selector, const arrayRange& range,
const label datasetNo, const label datasetNo,
const fvMesh& mesh, const fvMesh& mesh,
const faceSet& fSet const faceSet& fSet
@ -173,7 +173,7 @@ void Foam::vtkPV3Foam::convertFaceField
vtkPolyData::SafeDownCast vtkPolyData::SafeDownCast
( (
GetDataSetFromBlock(output, selector, datasetNo) GetDataSetFromBlock(output, range, datasetNo)
) ->GetCellData() ) ->GetCellData()
->AddArray(cellData); ->AddArray(cellData);

View File

@ -51,7 +51,7 @@ void Foam::vtkPV3Foam::pruneObjectList
) )
{ {
// hash all the selected field names // hash all the selected field names
if (!selected.size()) if (selected.empty())
{ {
objects.clear(); objects.clear();
} }
@ -79,7 +79,7 @@ void Foam::vtkPV3Foam::convertVolFields
reader_->GetVolFieldSelection() reader_->GetVolFieldSelection()
); );
if (!selectedFields.size()) if (selectedFields.empty())
{ {
return; return;
} }
@ -89,7 +89,7 @@ void Foam::vtkPV3Foam::convertVolFields
IOobjectList objects(mesh, dbPtr_().timeName()); IOobjectList objects(mesh, dbPtr_().timeName());
pruneObjectList(objects, selectedFields); pruneObjectList(objects, selectedFields);
if (!objects.size()) if (objects.empty())
{ {
return; return;
} }
@ -164,7 +164,7 @@ void Foam::vtkPV3Foam::convertPointFields
reader_->GetPointFieldSelection() reader_->GetPointFieldSelection()
); );
if (!selectedFields.size()) if (selectedFields.empty())
{ {
return; return;
} }
@ -174,7 +174,7 @@ void Foam::vtkPV3Foam::convertPointFields
IOobjectList objects(mesh, dbPtr_().timeName()); IOobjectList objects(mesh, dbPtr_().timeName());
pruneObjectList(objects, selectedFields); pruneObjectList(objects, selectedFields);
if (!objects.size()) if (objects.empty())
{ {
return; return;
} }
@ -229,7 +229,7 @@ void Foam::vtkPV3Foam::convertLagrangianFields
vtkMultiBlockDataSet* output vtkMultiBlockDataSet* output
) )
{ {
partInfo& selector = partInfoLagrangian_; arrayRange& range = arrayRangeLagrangian_;
const fvMesh& mesh = *meshPtr_; const fvMesh& mesh = *meshPtr_;
wordHashSet selectedFields = getSelected wordHashSet selectedFields = getSelected
@ -237,7 +237,7 @@ void Foam::vtkPV3Foam::convertLagrangianFields
reader_->GetLagrangianFieldSelection() reader_->GetLagrangianFieldSelection()
); );
if (!selectedFields.size()) if (selectedFields.empty())
{ {
return; return;
} }
@ -248,7 +248,7 @@ void Foam::vtkPV3Foam::convertLagrangianFields
printMemory(); printMemory();
} }
for (int partId = selector.start(); partId < selector.end(); ++partId) for (int partId = range.start(); partId < range.end(); ++partId)
{ {
const word cloudName = getPartName(partId); const word cloudName = getPartName(partId);
const label datasetNo = partDataset_[partId]; const label datasetNo = partDataset_[partId];
@ -270,7 +270,7 @@ void Foam::vtkPV3Foam::convertLagrangianFields
); );
pruneObjectList(objects, selectedFields); pruneObjectList(objects, selectedFields);
if (!objects.size()) if (objects.empty())
{ {
continue; continue;
} }

View File

@ -42,7 +42,7 @@ void Foam::vtkPV3Foam::convertLagrangianFields
const label datasetNo const label datasetNo
) )
{ {
const partInfo& selector = partInfoLagrangian_; const arrayRange& range = arrayRangeLagrangian_;
forAllConstIter(IOobjectList, objects, iter) forAllConstIter(IOobjectList, objects, iter)
{ {
@ -50,7 +50,7 @@ void Foam::vtkPV3Foam::convertLagrangianFields
if (iter()->headerClassName() == IOField<Type>::typeName) if (iter()->headerClassName() == IOField<Type>::typeName)
{ {
IOField<Type> tf(*iter()); IOField<Type> tf(*iter());
convertLagrangianField(tf, output, selector, datasetNo); convertLagrangianField(tf, output, range, datasetNo);
} }
} }
} }
@ -61,7 +61,7 @@ void Foam::vtkPV3Foam::convertLagrangianField
( (
const IOField<Type>& tf, const IOField<Type>& tf,
vtkMultiBlockDataSet* output, vtkMultiBlockDataSet* output,
const partInfo& selector, const arrayRange& range,
const label datasetNo const label datasetNo
) )
{ {
@ -97,7 +97,7 @@ void Foam::vtkPV3Foam::convertLagrangianField
vtkPolyData::SafeDownCast vtkPolyData::SafeDownCast
( (
GetDataSetFromBlock(output, selector, datasetNo) GetDataSetFromBlock(output, range, datasetNo)
) ->GetPointData() ) ->GetPointData()
->AddArray(pointData); ->AddArray(pointData);

View File

@ -49,13 +49,13 @@ void Foam::vtkPV3Foam::convertMeshVolume
int& blockNo int& blockNo
) )
{ {
partInfo& selector = partInfoVolume_; arrayRange& range = arrayRangeVolume_;
selector.block(blockNo); // set output block range.block(blockNo); // set output block
label datasetNo = 0; // restart at dataset 0 label datasetNo = 0; // restart at dataset 0
const fvMesh& mesh = *meshPtr_; const fvMesh& mesh = *meshPtr_;
// resize for decomposed polyhedra // resize for decomposed polyhedra
regionPolyDecomp_.setSize(selector.size()); regionPolyDecomp_.setSize(range.size());
if (debug) if (debug)
{ {
@ -65,7 +65,7 @@ void Foam::vtkPV3Foam::convertMeshVolume
// Convert the internalMesh // Convert the internalMesh
// this looks like more than one part, but it isn't // this looks like more than one part, but it isn't
for (int partId = selector.start(); partId < selector.end(); ++partId) for (int partId = range.start(); partId < range.end(); ++partId)
{ {
const word partName = "internalMesh"; const word partName = "internalMesh";
@ -82,7 +82,7 @@ void Foam::vtkPV3Foam::convertMeshVolume
if (vtkmesh) if (vtkmesh)
{ {
AddToBlock(output, vtkmesh, selector, datasetNo, partName); AddToBlock(output, vtkmesh, range, datasetNo, partName);
vtkmesh->Delete(); vtkmesh->Delete();
partDataset_[partId] = datasetNo++; partDataset_[partId] = datasetNo++;
@ -109,8 +109,8 @@ void Foam::vtkPV3Foam::convertMeshLagrangian
int& blockNo int& blockNo
) )
{ {
partInfo& selector = partInfoLagrangian_; arrayRange& range = arrayRangeLagrangian_;
selector.block(blockNo); // set output block range.block(blockNo); // set output block
label datasetNo = 0; // restart at dataset 0 label datasetNo = 0; // restart at dataset 0
const fvMesh& mesh = *meshPtr_; const fvMesh& mesh = *meshPtr_;
@ -120,7 +120,7 @@ void Foam::vtkPV3Foam::convertMeshLagrangian
printMemory(); printMemory();
} }
for (int partId = selector.start(); partId < selector.end(); ++partId) for (int partId = range.start(); partId < range.end(); ++partId)
{ {
const word cloudName = getPartName(partId); const word cloudName = getPartName(partId);
@ -133,7 +133,7 @@ void Foam::vtkPV3Foam::convertMeshLagrangian
if (vtkmesh) if (vtkmesh)
{ {
AddToBlock(output, vtkmesh, selector, datasetNo, cloudName); AddToBlock(output, vtkmesh, range, datasetNo, cloudName);
vtkmesh->Delete(); vtkmesh->Delete();
partDataset_[partId] = datasetNo++; partDataset_[partId] = datasetNo++;
@ -160,8 +160,8 @@ void Foam::vtkPV3Foam::convertMeshPatches
int& blockNo int& blockNo
) )
{ {
partInfo& selector = partInfoPatches_; arrayRange& range = arrayRangePatches_;
selector.block(blockNo); // set output block range.block(blockNo); // set output block
label datasetNo = 0; // restart at dataset 0 label datasetNo = 0; // restart at dataset 0
const fvMesh& mesh = *meshPtr_; const fvMesh& mesh = *meshPtr_;
const polyBoundaryMesh& patches = mesh.boundaryMesh(); const polyBoundaryMesh& patches = mesh.boundaryMesh();
@ -172,7 +172,7 @@ void Foam::vtkPV3Foam::convertMeshPatches
printMemory(); printMemory();
} }
for (int partId = selector.start(); partId < selector.end(); ++partId) for (int partId = range.start(); partId < range.end(); ++partId)
{ {
const word patchName = getPartName(partId); const word patchName = getPartName(partId);
const label patchId = patches.findPatchID(patchName); const label patchId = patches.findPatchID(patchName);
@ -192,7 +192,7 @@ void Foam::vtkPV3Foam::convertMeshPatches
if (vtkmesh) if (vtkmesh)
{ {
AddToBlock(output, vtkmesh, selector, datasetNo, patchName); AddToBlock(output, vtkmesh, range, datasetNo, patchName);
vtkmesh->Delete(); vtkmesh->Delete();
partDataset_[partId] = datasetNo++; partDataset_[partId] = datasetNo++;
@ -219,15 +219,15 @@ void Foam::vtkPV3Foam::convertMeshCellZones
int& blockNo int& blockNo
) )
{ {
partInfo& selector = partInfoCellZones_; arrayRange& range = arrayRangeCellZones_;
selector.block(blockNo); // set output block range.block(blockNo); // set output block
label datasetNo = 0; // restart at dataset 0 label datasetNo = 0; // restart at dataset 0
const fvMesh& mesh = *meshPtr_; const fvMesh& mesh = *meshPtr_;
// resize for decomposed polyhedra // resize for decomposed polyhedra
zonePolyDecomp_.setSize(selector.size()); zonePolyDecomp_.setSize(range.size());
if (!selector.size()) if (range.empty())
{ {
return; return;
} }
@ -239,7 +239,7 @@ void Foam::vtkPV3Foam::convertMeshCellZones
} }
const cellZoneMesh& zMesh = mesh.cellZones(); const cellZoneMesh& zMesh = mesh.cellZones();
for (int partId = selector.start(); partId < selector.end(); ++partId) for (int partId = range.start(); partId < range.end(); ++partId)
{ {
const word zoneName = getPartName(partId); const word zoneName = getPartName(partId);
const label zoneId = zMesh.findZoneID(zoneName); const label zoneId = zMesh.findZoneID(zoneName);
@ -281,7 +281,7 @@ void Foam::vtkPV3Foam::convertMeshCellZones
// copy pointMap as well, otherwise pointFields fail // copy pointMap as well, otherwise pointFields fail
zonePolyDecomp_[datasetNo].pointMap() = subsetter.pointMap(); zonePolyDecomp_[datasetNo].pointMap() = subsetter.pointMap();
AddToBlock(output, vtkmesh, selector, datasetNo, zoneName); AddToBlock(output, vtkmesh, range, datasetNo, zoneName);
vtkmesh->Delete(); vtkmesh->Delete();
partDataset_[partId] = datasetNo++; partDataset_[partId] = datasetNo++;
@ -308,13 +308,13 @@ void Foam::vtkPV3Foam::convertMeshCellSets
int& blockNo int& blockNo
) )
{ {
partInfo& selector = partInfoCellSets_; arrayRange& range = arrayRangeCellSets_;
selector.block(blockNo); // set output block range.block(blockNo); // set output block
label datasetNo = 0; // restart at dataset 0 label datasetNo = 0; // restart at dataset 0
const fvMesh& mesh = *meshPtr_; const fvMesh& mesh = *meshPtr_;
// resize for decomposed polyhedra // resize for decomposed polyhedra
csetPolyDecomp_.setSize(selector.size()); csetPolyDecomp_.setSize(range.size());
if (debug) if (debug)
{ {
@ -322,7 +322,7 @@ void Foam::vtkPV3Foam::convertMeshCellSets
printMemory(); printMemory();
} }
for (int partId = selector.start(); partId < selector.end(); ++partId) for (int partId = range.start(); partId < range.end(); ++partId)
{ {
const word partName = getPartName(partId); const word partName = getPartName(partId);
@ -363,7 +363,7 @@ void Foam::vtkPV3Foam::convertMeshCellSets
// copy pointMap as well, otherwise pointFields fail // copy pointMap as well, otherwise pointFields fail
csetPolyDecomp_[datasetNo].pointMap() = subsetter.pointMap(); csetPolyDecomp_[datasetNo].pointMap() = subsetter.pointMap();
AddToBlock(output, vtkmesh, selector, datasetNo, partName); AddToBlock(output, vtkmesh, range, datasetNo, partName);
vtkmesh->Delete(); vtkmesh->Delete();
partDataset_[partId] = datasetNo++; partDataset_[partId] = datasetNo++;
@ -390,12 +390,12 @@ void Foam::vtkPV3Foam::convertMeshFaceZones
int& blockNo int& blockNo
) )
{ {
partInfo& selector = partInfoFaceZones_; arrayRange& range = arrayRangeFaceZones_;
selector.block(blockNo); // set output block range.block(blockNo); // set output block
label datasetNo = 0; // restart at dataset 0 label datasetNo = 0; // restart at dataset 0
const fvMesh& mesh = *meshPtr_; const fvMesh& mesh = *meshPtr_;
if (!selector.size()) if (range.empty())
{ {
return; return;
} }
@ -407,7 +407,7 @@ void Foam::vtkPV3Foam::convertMeshFaceZones
} }
const faceZoneMesh& zMesh = mesh.faceZones(); const faceZoneMesh& zMesh = mesh.faceZones();
for (int partId = selector.start(); partId < selector.end(); ++partId) for (int partId = range.start(); partId < range.end(); ++partId)
{ {
const word zoneName = getPartName(partId); const word zoneName = getPartName(partId);
const label zoneId = zMesh.findZoneID(zoneName); const label zoneId = zMesh.findZoneID(zoneName);
@ -426,7 +426,7 @@ void Foam::vtkPV3Foam::convertMeshFaceZones
vtkPolyData* vtkmesh = faceZoneVTKMesh(mesh, zMesh[zoneId]); vtkPolyData* vtkmesh = faceZoneVTKMesh(mesh, zMesh[zoneId]);
if (vtkmesh) if (vtkmesh)
{ {
AddToBlock(output, vtkmesh, selector, datasetNo, zoneName); AddToBlock(output, vtkmesh, range, datasetNo, zoneName);
vtkmesh->Delete(); vtkmesh->Delete();
partDataset_[partId] = datasetNo++; partDataset_[partId] = datasetNo++;
@ -453,8 +453,8 @@ void Foam::vtkPV3Foam::convertMeshFaceSets
int& blockNo int& blockNo
) )
{ {
partInfo& selector = partInfoFaceSets_; arrayRange& range = arrayRangeFaceSets_;
selector.block(blockNo); // set output block range.block(blockNo); // set output block
label datasetNo = 0; // restart at dataset 0 label datasetNo = 0; // restart at dataset 0
const fvMesh& mesh = *meshPtr_; const fvMesh& mesh = *meshPtr_;
@ -464,7 +464,7 @@ void Foam::vtkPV3Foam::convertMeshFaceSets
printMemory(); printMemory();
} }
for (int partId = selector.start(); partId < selector.end(); ++partId) for (int partId = range.start(); partId < range.end(); ++partId)
{ {
const word partName = getPartName(partId); const word partName = getPartName(partId);
@ -483,7 +483,7 @@ void Foam::vtkPV3Foam::convertMeshFaceSets
vtkPolyData* vtkmesh = faceSetVTKMesh(mesh, fSet); vtkPolyData* vtkmesh = faceSetVTKMesh(mesh, fSet);
if (vtkmesh) if (vtkmesh)
{ {
AddToBlock(output, vtkmesh, selector, datasetNo, partName); AddToBlock(output, vtkmesh, range, datasetNo, partName);
vtkmesh->Delete(); vtkmesh->Delete();
partDataset_[partId] = datasetNo++; partDataset_[partId] = datasetNo++;
@ -510,8 +510,8 @@ void Foam::vtkPV3Foam::convertMeshPointZones
int& blockNo int& blockNo
) )
{ {
partInfo& selector = partInfoPointZones_; arrayRange& range = arrayRangePointZones_;
selector.block(blockNo); // set output block range.block(blockNo); // set output block
label datasetNo = 0; // restart at dataset 0 label datasetNo = 0; // restart at dataset 0
const fvMesh& mesh = *meshPtr_; const fvMesh& mesh = *meshPtr_;
@ -521,10 +521,10 @@ void Foam::vtkPV3Foam::convertMeshPointZones
printMemory(); printMemory();
} }
if (selector.size()) if (range.size())
{ {
const pointZoneMesh& zMesh = mesh.pointZones(); const pointZoneMesh& zMesh = mesh.pointZones();
for (int partId = selector.start(); partId < selector.end(); ++partId) for (int partId = range.start(); partId < range.end(); ++partId)
{ {
word zoneName = getPartName(partId); word zoneName = getPartName(partId);
label zoneId = zMesh.findZoneID(zoneName); label zoneId = zMesh.findZoneID(zoneName);
@ -537,7 +537,7 @@ void Foam::vtkPV3Foam::convertMeshPointZones
vtkPolyData* vtkmesh = pointZoneVTKMesh(mesh, zMesh[zoneId]); vtkPolyData* vtkmesh = pointZoneVTKMesh(mesh, zMesh[zoneId]);
if (vtkmesh) if (vtkmesh)
{ {
AddToBlock(output, vtkmesh, selector, datasetNo, zoneName); AddToBlock(output, vtkmesh, range, datasetNo, zoneName);
vtkmesh->Delete(); vtkmesh->Delete();
partDataset_[partId] = datasetNo++; partDataset_[partId] = datasetNo++;
@ -566,8 +566,8 @@ void Foam::vtkPV3Foam::convertMeshPointSets
int& blockNo int& blockNo
) )
{ {
partInfo& selector = partInfoPointSets_; arrayRange& range = arrayRangePointSets_;
selector.block(blockNo); // set output block range.block(blockNo); // set output block
label datasetNo = 0; // restart at dataset 0 label datasetNo = 0; // restart at dataset 0
const fvMesh& mesh = *meshPtr_; const fvMesh& mesh = *meshPtr_;
@ -577,7 +577,7 @@ void Foam::vtkPV3Foam::convertMeshPointSets
printMemory(); printMemory();
} }
for (int partId = selector.start(); partId < selector.end(); ++partId) for (int partId = range.start(); partId < range.end(); ++partId)
{ {
word partName = getPartName(partId); word partName = getPartName(partId);
@ -596,7 +596,7 @@ void Foam::vtkPV3Foam::convertMeshPointSets
vtkPolyData* vtkmesh = pointSetVTKMesh(mesh, pSet); vtkPolyData* vtkmesh = pointSetVTKMesh(mesh, pSet);
if (vtkmesh) if (vtkmesh)
{ {
AddToBlock(output, vtkmesh, selector, datasetNo, partName); AddToBlock(output, vtkmesh, range, datasetNo, partName);
vtkmesh->Delete(); vtkmesh->Delete();
partDataset_[partId] = datasetNo++; partDataset_[partId] = datasetNo++;
@ -616,4 +616,5 @@ void Foam::vtkPV3Foam::convertMeshPointSets
} }
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -45,7 +45,7 @@ void Foam::vtkPV3Foam::convertPatchField
const word& name, const word& name,
const Field<Type>& ptf, const Field<Type>& ptf,
vtkMultiBlockDataSet* output, vtkMultiBlockDataSet* output,
const partInfo& selector, const arrayRange& range,
const label datasetNo const label datasetNo
) )
{ {
@ -70,7 +70,7 @@ void Foam::vtkPV3Foam::convertPatchField
vtkPolyData::SafeDownCast vtkPolyData::SafeDownCast
( (
GetDataSetFromBlock(output, selector, datasetNo) GetDataSetFromBlock(output, range, datasetNo)
) ->GetCellData() ) ->GetCellData()
->AddArray(cellData); ->AddArray(cellData);
@ -85,7 +85,7 @@ void Foam::vtkPV3Foam::convertPatchPointField
const word& name, const word& name,
const Field<Type>& pptf, const Field<Type>& pptf,
vtkMultiBlockDataSet* output, vtkMultiBlockDataSet* output,
const partInfo& selector, const arrayRange& range,
const label datasetNo const label datasetNo
) )
{ {
@ -111,7 +111,7 @@ void Foam::vtkPV3Foam::convertPatchPointField
vtkPolyData::SafeDownCast vtkPolyData::SafeDownCast
( (
GetDataSetFromBlock(output, selector, datasetNo) GetDataSetFromBlock(output, range, datasetNo)
) ->GetPointData() ) ->GetPointData()
->AddArray(pointData); ->AddArray(pointData);

View File

@ -77,7 +77,7 @@ void Foam::vtkPV3Foam::convertPointFields
( (
ptf, ptf,
output, output,
partInfoVolume_, arrayRangeVolume_,
regionPolyDecomp_ regionPolyDecomp_
); );
@ -86,7 +86,7 @@ void Foam::vtkPV3Foam::convertPointFields
( (
ptf, ptf,
output, output,
partInfoCellZones_, arrayRangeCellZones_,
zonePolyDecomp_ zonePolyDecomp_
); );
@ -95,7 +95,7 @@ void Foam::vtkPV3Foam::convertPointFields
( (
ptf, ptf,
output, output,
partInfoCellSets_, arrayRangeCellSets_,
csetPolyDecomp_ csetPolyDecomp_
); );
@ -105,8 +105,8 @@ void Foam::vtkPV3Foam::convertPointFields
// //
for for
( (
int partId = partInfoPatches_.start(); int partId = arrayRangePatches_.start();
partId < partInfoPatches_.end(); partId < arrayRangePatches_.end();
++partId ++partId
) )
{ {
@ -124,7 +124,7 @@ void Foam::vtkPV3Foam::convertPointFields
fieldName, fieldName,
ptf.boundaryField()[patchId].patchInternalField()(), ptf.boundaryField()[patchId].patchInternalField()(),
output, output,
partInfoPatches_, arrayRangePatches_,
datasetNo datasetNo
); );
} }
@ -137,11 +137,11 @@ void Foam::vtkPV3Foam::convertPointFieldBlock
( (
const GeometricField<Type, pointPatchField, pointMesh>& ptf, const GeometricField<Type, pointPatchField, pointMesh>& ptf,
vtkMultiBlockDataSet* output, vtkMultiBlockDataSet* output,
const partInfo& selector, const arrayRange& range,
const List<polyDecomp>& decompLst const List<polyDecomp>& decompLst
) )
{ {
for (int partId = selector.start(); partId < selector.end(); ++partId) for (int partId = range.start(); partId < range.end(); ++partId)
{ {
const label datasetNo = partDataset_[partId]; const label datasetNo = partDataset_[partId];
@ -152,7 +152,7 @@ void Foam::vtkPV3Foam::convertPointFieldBlock
ptf, ptf,
GeometricField<Type, fvPatchField, volMesh>::null(), GeometricField<Type, fvPatchField, volMesh>::null(),
output, output,
selector, range,
datasetNo, datasetNo,
decompLst[datasetNo] decompLst[datasetNo]
); );
@ -167,7 +167,7 @@ void Foam::vtkPV3Foam::convertPointField
const GeometricField<Type, pointPatchField, pointMesh>& ptf, const GeometricField<Type, pointPatchField, pointMesh>& ptf,
const GeometricField<Type, fvPatchField, volMesh>& tf, const GeometricField<Type, fvPatchField, volMesh>& tf,
vtkMultiBlockDataSet* output, vtkMultiBlockDataSet* output,
const partInfo& selector, const arrayRange& range,
const label datasetNo, const label datasetNo,
const polyDecomp& decomp const polyDecomp& decomp
) )
@ -260,7 +260,7 @@ void Foam::vtkPV3Foam::convertPointField
vtkUnstructuredGrid::SafeDownCast vtkUnstructuredGrid::SafeDownCast
( (
GetDataSetFromBlock(output, selector, datasetNo) GetDataSetFromBlock(output, range, datasetNo)
) ->GetPointData() ) ->GetPointData()
->AddArray(pointData); ->AddArray(pointData);

View File

@ -118,32 +118,39 @@ Foam::wordList Foam::vtkPV3Foam::readZoneNames(const word& zoneType)
} }
void Foam::vtkPV3Foam::updateInfoInternalMesh() void Foam::vtkPV3Foam::updateInfoInternalMesh
(
vtkDataArraySelection* arraySelection
)
{ {
if (debug) if (debug)
{ {
Info<< "<beg> Foam::vtkPV3Foam::updateInfoInternalMesh" << endl; Info<< "<beg> Foam::vtkPV3Foam::updateInfoInternalMesh" << endl;
} }
vtkDataArraySelection* partSelection = reader_->GetPartSelection();
// Determine mesh parts (internalMesh, patches...) // Determine mesh parts (internalMesh, patches...)
//- Add internal mesh as first entry //- Add internal mesh as first entry
partInfoVolume_ = partSelection->GetNumberOfArrays(); arrayRangeVolume_.reset( arraySelection->GetNumberOfArrays() );
partSelection->AddArray("internalMesh"); arraySelection->AddArray
partInfoVolume_ += 1; (
"internalMesh"
);
arrayRangeVolume_ += 1;
if (debug) if (debug)
{ {
// just for debug info // just for debug info
getSelectedArrayEntries(partSelection); getSelectedArrayEntries(arraySelection);
Info<< "<end> Foam::vtkPV3Foam::updateInfoInternalMesh" << endl; Info<< "<end> Foam::vtkPV3Foam::updateInfoInternalMesh" << endl;
} }
} }
void Foam::vtkPV3Foam::updateInfoLagrangian() void Foam::vtkPV3Foam::updateInfoLagrangian
(
vtkDataArraySelection* arraySelection
)
{ {
if (debug) if (debug)
{ {
@ -166,34 +173,35 @@ void Foam::vtkPV3Foam::updateInfoLagrangian()
readDir(dbPtr_->timePath()/lagrangianPrefix, fileName::DIRECTORY) readDir(dbPtr_->timePath()/lagrangianPrefix, fileName::DIRECTORY)
); );
vtkDataArraySelection* partSelection = reader_->GetPartSelection(); arrayRangeLagrangian_.reset( arraySelection->GetNumberOfArrays() );
partInfoLagrangian_ = partSelection->GetNumberOfArrays();
int nClouds = 0; int nClouds = 0;
forAll(cloudDirs, cloudI) forAll(cloudDirs, cloudI)
{ {
// Add cloud to GUI list // Add cloud to GUI list
partSelection->AddArray arraySelection->AddArray
( (
(cloudDirs[cloudI] + " - lagrangian").c_str() (cloudDirs[cloudI] + " - lagrangian").c_str()
); );
++nClouds; ++nClouds;
} }
arrayRangeLagrangian_ += nClouds;
partInfoLagrangian_ += nClouds;
if (debug) if (debug)
{ {
// just for debug info // just for debug info
getSelectedArrayEntries(partSelection); getSelectedArrayEntries(arraySelection);
Info<< "<end> Foam::vtkPV3Foam::updateInfoLagrangian" << endl; Info<< "<end> Foam::vtkPV3Foam::updateInfoLagrangian" << endl;
} }
} }
void Foam::vtkPV3Foam::updateInfoPatches() void Foam::vtkPV3Foam::updateInfoPatches
(
vtkDataArraySelection* arraySelection
)
{ {
if (debug) if (debug)
{ {
@ -201,8 +209,7 @@ void Foam::vtkPV3Foam::updateInfoPatches()
<< " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]" << endl; << " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]" << endl;
} }
vtkDataArraySelection* partSelection = reader_->GetPartSelection(); arrayRangePatches_.reset( arraySelection->GetNumberOfArrays() );
partInfoPatches_ = partSelection->GetNumberOfArrays();
int nPatches = 0; int nPatches = 0;
if (meshPtr_) if (meshPtr_)
@ -215,7 +222,7 @@ void Foam::vtkPV3Foam::updateInfoPatches()
if (pp.size()) if (pp.size())
{ {
// Add patch to GUI list // Add patch to GUI list
partSelection->AddArray arraySelection->AddArray
( (
(pp.name() + " - patch").c_str() (pp.name() + " - patch").c_str()
); );
@ -260,7 +267,7 @@ void Foam::vtkPV3Foam::updateInfoPatches()
// Valid patch if nFace > 0 - add patch to GUI list // Valid patch if nFace > 0 - add patch to GUI list
if (nFaces) if (nFaces)
{ {
partSelection->AddArray arraySelection->AddArray
( (
(patchEntries[entryI].keyword() + " - patch").c_str() (patchEntries[entryI].keyword() + " - patch").c_str()
); );
@ -270,19 +277,22 @@ void Foam::vtkPV3Foam::updateInfoPatches()
} }
} }
} }
partInfoPatches_ += nPatches; arrayRangePatches_ += nPatches;
if (debug) if (debug)
{ {
// just for debug info // just for debug info
getSelectedArrayEntries(partSelection); getSelectedArrayEntries(arraySelection);
Info<< "<end> Foam::vtkPV3Foam::updateInfoPatches" << endl; Info<< "<end> Foam::vtkPV3Foam::updateInfoPatches" << endl;
} }
} }
void Foam::vtkPV3Foam::updateInfoZones() void Foam::vtkPV3Foam::updateInfoZones
(
vtkDataArraySelection* arraySelection
)
{ {
if (!reader_->GetIncludeZones()) if (!reader_->GetIncludeZones())
{ {
@ -295,7 +305,6 @@ void Foam::vtkPV3Foam::updateInfoZones()
<< " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]" << endl; << " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]" << endl;
} }
vtkDataArraySelection* partSelection = reader_->GetPartSelection();
wordList namesLst; wordList namesLst;
// //
@ -310,12 +319,15 @@ void Foam::vtkPV3Foam::updateInfoZones()
namesLst = readZoneNames("cellZones"); namesLst = readZoneNames("cellZones");
} }
partInfoCellZones_ = partSelection->GetNumberOfArrays(); arrayRangeCellZones_.reset( arraySelection->GetNumberOfArrays() );
forAll(namesLst, elemI) forAll(namesLst, elemI)
{ {
partSelection->AddArray((namesLst[elemI] + " - cellZone").c_str()); arraySelection->AddArray
(
(namesLst[elemI] + " - cellZone").c_str()
);
} }
partInfoCellZones_ += namesLst.size(); arrayRangeCellZones_ += namesLst.size();
// //
@ -330,15 +342,15 @@ void Foam::vtkPV3Foam::updateInfoZones()
namesLst = readZoneNames("faceZones"); namesLst = readZoneNames("faceZones");
} }
partInfoFaceZones_ = partSelection->GetNumberOfArrays(); arrayRangeFaceZones_.reset( arraySelection->GetNumberOfArrays() );
forAll(namesLst, elemI) forAll(namesLst, elemI)
{ {
partSelection->AddArray arraySelection->AddArray
( (
(namesLst[elemI] + " - faceZone").c_str() (namesLst[elemI] + " - faceZone").c_str()
); );
} }
partInfoFaceZones_ += namesLst.size(); arrayRangeFaceZones_ += namesLst.size();
// //
@ -353,28 +365,30 @@ void Foam::vtkPV3Foam::updateInfoZones()
namesLst = readZoneNames("pointZones"); namesLst = readZoneNames("pointZones");
} }
partInfoPointZones_ = partSelection->GetNumberOfArrays(); arrayRangePointZones_.reset( arraySelection->GetNumberOfArrays() );
forAll(namesLst, elemI) forAll(namesLst, elemI)
{ {
partSelection->AddArray arraySelection->AddArray
( (
(namesLst[elemI] + " - pointZone").c_str() (namesLst[elemI] + " - pointZone").c_str()
); );
} }
partInfoPointZones_ += namesLst.size(); arrayRangePointZones_ += namesLst.size();
if (debug) if (debug)
{ {
// just for debug info // just for debug info
getSelectedArrayEntries(partSelection); getSelectedArrayEntries(arraySelection);
Info<< "<end> Foam::vtkPV3Foam::updateInfoZones" << endl; Info<< "<end> Foam::vtkPV3Foam::updateInfoZones" << endl;
} }
} }
void Foam::vtkPV3Foam::updateInfoSets() void Foam::vtkPV3Foam::updateInfoSets
(
vtkDataArraySelection* arraySelection
)
{ {
if (!reader_->GetIncludeSets()) if (!reader_->GetIncludeSets())
{ {
@ -386,8 +400,6 @@ void Foam::vtkPV3Foam::updateInfoSets()
Info<< "<beg> Foam::vtkPV3Foam::updateInfoSets" << endl; Info<< "<beg> Foam::vtkPV3Foam::updateInfoSets" << endl;
} }
vtkDataArraySelection* partSelection = reader_->GetPartSelection();
// Add names of sets // Add names of sets
IOobjectList objects IOobjectList objects
( (
@ -397,26 +409,26 @@ void Foam::vtkPV3Foam::updateInfoSets()
); );
partInfoCellSets_ = partSelection->GetNumberOfArrays(); arrayRangeCellSets_.reset( arraySelection->GetNumberOfArrays() );
partInfoCellSets_ += addToSelection<cellSet> arrayRangeCellSets_ += addToSelection<cellSet>
( (
partSelection, arraySelection,
objects, objects,
" - cellSet" " - cellSet"
); );
partInfoFaceSets_ = partSelection->GetNumberOfArrays(); arrayRangeFaceSets_.reset( arraySelection->GetNumberOfArrays() );
partInfoFaceSets_ += addToSelection<faceSet> arrayRangeFaceSets_ += addToSelection<faceSet>
( (
partSelection, arraySelection,
objects, objects,
" - faceSet" " - faceSet"
); );
partInfoPointSets_ = partSelection->GetNumberOfArrays(); arrayRangePointSets_.reset( arraySelection->GetNumberOfArrays() );
partInfoPointSets_ += addToSelection<pointSet> arrayRangePointSets_ += addToSelection<pointSet>
( (
partSelection, arraySelection,
objects, objects,
" - pointSet" " - pointSet"
); );
@ -424,7 +436,7 @@ void Foam::vtkPV3Foam::updateInfoSets()
if (debug) if (debug)
{ {
// just for debug info // just for debug info
getSelectedArrayEntries(partSelection); getSelectedArrayEntries(arraySelection);
Info<< "<end> Foam::vtkPV3Foam::updateInfoSets" << endl; Info<< "<end> Foam::vtkPV3Foam::updateInfoSets" << endl;
} }
@ -450,14 +462,13 @@ void Foam::vtkPV3Foam::updateInfoLagrangianFields()
// have to decide if the second set of fields get mixed in // have to decide if the second set of fields get mixed in
// or dealt with separately // or dealt with separately
const partInfo& selector = partInfoLagrangian_; const arrayRange& range = arrayRangeLagrangian_;
int partId = selector.start(); if (range.empty())
if (!selector.size() || partId < 0)
{ {
return; return;
} }
int partId = range.start();
word cloudName = getPartName(partId); word cloudName = getPartName(partId);
// use the db directly since this might be called without a mesh, // use the db directly since this might be called without a mesh,

View File

@ -76,12 +76,12 @@ void Foam::vtkPV3Foam::AddToBlock
( (
vtkMultiBlockDataSet* output, vtkMultiBlockDataSet* output,
vtkDataSet* dataset, vtkDataSet* dataset,
const partInfo& selector, const arrayRange& range,
const label datasetNo, const label datasetNo,
const std::string& datasetName const std::string& datasetName
) )
{ {
const int blockNo = selector.block(); const int blockNo = range.block();
vtkDataObject* blockDO = output->GetBlock(blockNo); vtkDataObject* blockDO = output->GetBlock(blockNo);
vtkMultiBlockDataSet* block = vtkMultiBlockDataSet::SafeDownCast(blockDO); vtkMultiBlockDataSet* block = vtkMultiBlockDataSet::SafeDownCast(blockDO);
@ -117,7 +117,7 @@ void Foam::vtkPV3Foam::AddToBlock
output->GetMetaData(blockNo)->Set output->GetMetaData(blockNo)->Set
( (
vtkCompositeDataSet::NAME(), vtkCompositeDataSet::NAME(),
selector.name() range.name()
); );
} }
@ -135,11 +135,11 @@ void Foam::vtkPV3Foam::AddToBlock
vtkDataSet* Foam::vtkPV3Foam::GetDataSetFromBlock vtkDataSet* Foam::vtkPV3Foam::GetDataSetFromBlock
( (
vtkMultiBlockDataSet* output, vtkMultiBlockDataSet* output,
const partInfo& selector, const arrayRange& range,
const label datasetNo const label datasetNo
) )
{ {
const int blockNo = selector.block(); const int blockNo = range.block();
vtkDataObject* blockDO = output->GetBlock(blockNo); vtkDataObject* blockDO = output->GetBlock(blockNo);
vtkMultiBlockDataSet* block = vtkMultiBlockDataSet::SafeDownCast(blockDO); vtkMultiBlockDataSet* block = vtkMultiBlockDataSet::SafeDownCast(blockDO);
@ -157,10 +157,10 @@ vtkDataSet* Foam::vtkPV3Foam::GetDataSetFromBlock
Foam::label Foam::vtkPV3Foam::GetNumberOfDataSets Foam::label Foam::vtkPV3Foam::GetNumberOfDataSets
( (
vtkMultiBlockDataSet* output, vtkMultiBlockDataSet* output,
const partInfo& selector const arrayRange& range
) )
{ {
const int blockNo = selector.block(); const int blockNo = range.block();
vtkDataObject* blockDO = output->GetBlock(blockNo); vtkDataObject* blockDO = output->GetBlock(blockNo);
vtkMultiBlockDataSet* block = vtkMultiBlockDataSet::SafeDownCast(blockDO); vtkMultiBlockDataSet* block = vtkMultiBlockDataSet::SafeDownCast(blockDO);
@ -173,7 +173,7 @@ Foam::label Foam::vtkPV3Foam::GetNumberOfDataSets
} }
Foam::word Foam::vtkPV3Foam::getPartName(int partId) Foam::word Foam::vtkPV3Foam::getPartName(const int partId)
{ {
return getFirstWord(reader_->GetPartArrayName(partId)); return getFirstWord(reader_->GetPartArrayName(partId));
} }
@ -202,13 +202,13 @@ Foam::wordHashSet Foam::vtkPV3Foam::getSelected
Foam::wordHashSet Foam::vtkPV3Foam::getSelected Foam::wordHashSet Foam::vtkPV3Foam::getSelected
( (
vtkDataArraySelection* select, vtkDataArraySelection* select,
const partInfo& selector const arrayRange& range
) )
{ {
int nElem = select->GetNumberOfArrays(); int nElem = select->GetNumberOfArrays();
wordHashSet selections(2*nElem); wordHashSet selections(2*nElem);
for (int elemI = selector.start(); elemI < selector.end(); ++elemI) for (int elemI = range.start(); elemI < range.end(); ++elemI)
{ {
if (select->GetArraySetting(elemI)) if (select->GetArraySetting(elemI))
{ {
@ -262,13 +262,13 @@ Foam::stringList Foam::vtkPV3Foam::getSelectedArrayEntries
Foam::stringList Foam::vtkPV3Foam::getSelectedArrayEntries Foam::stringList Foam::vtkPV3Foam::getSelectedArrayEntries
( (
vtkDataArraySelection* select, vtkDataArraySelection* select,
const partInfo& selector const arrayRange& range
) )
{ {
stringList selections(selector.size()); stringList selections(range.size());
label nElem = 0; label nElem = 0;
for (int elemI = selector.start(); elemI < selector.end(); ++elemI) for (int elemI = range.start(); elemI < range.end(); ++elemI)
{ {
if (select->GetArraySetting(elemI)) if (select->GetArraySetting(elemI))
{ {
@ -281,7 +281,7 @@ Foam::stringList Foam::vtkPV3Foam::getSelectedArrayEntries
if (debug) if (debug)
{ {
Info<< "available("; Info<< "available(";
for (int elemI = selector.start(); elemI < selector.end(); ++elemI) for (int elemI = range.start(); elemI < range.end(); ++elemI)
{ {
Info<< " \"" << select->GetArrayName(elemI) << "\""; Info<< " \"" << select->GetArrayName(elemI) << "\"";
} }

View File

@ -81,7 +81,7 @@ void Foam::vtkPV3Foam::convertVolFields
tf, tf,
ptfPtr, ptfPtr,
output, output,
partInfoVolume_, arrayRangeVolume_,
regionPolyDecomp_ regionPolyDecomp_
); );
@ -91,7 +91,7 @@ void Foam::vtkPV3Foam::convertVolFields
tf, tf,
ptfPtr, ptfPtr,
output, output,
partInfoCellZones_, arrayRangeCellZones_,
zonePolyDecomp_ zonePolyDecomp_
); );
@ -101,7 +101,7 @@ void Foam::vtkPV3Foam::convertVolFields
tf, tf,
ptfPtr, ptfPtr,
output, output,
partInfoCellSets_, arrayRangeCellSets_,
csetPolyDecomp_ csetPolyDecomp_
); );
@ -117,8 +117,8 @@ void Foam::vtkPV3Foam::convertVolFields
for for
( (
int partId = partInfoPatches_.start(); int partId = arrayRangePatches_.start();
partId < partInfoPatches_.end(); partId < arrayRangePatches_.end();
++partId ++partId
) )
{ {
@ -155,7 +155,7 @@ void Foam::vtkPV3Foam::convertVolFields
tf.name(), tf.name(),
tpptf(), tpptf(),
output, output,
partInfoPatches_, arrayRangePatches_,
datasetNo datasetNo
); );
@ -164,7 +164,7 @@ void Foam::vtkPV3Foam::convertVolFields
pointFldName, pointFldName,
ppInterpList[patchId].faceToPointInterpolate(tpptf)(), ppInterpList[patchId].faceToPointInterpolate(tpptf)(),
output, output,
partInfoPatches_, arrayRangePatches_,
datasetNo datasetNo
); );
} }
@ -175,7 +175,7 @@ void Foam::vtkPV3Foam::convertVolFields
tf.name(), tf.name(),
ptf, ptf,
output, output,
partInfoPatches_, arrayRangePatches_,
datasetNo datasetNo
); );
@ -184,7 +184,7 @@ void Foam::vtkPV3Foam::convertVolFields
pointFldName, pointFldName,
ppInterpList[patchId].faceToPointInterpolate(ptf)(), ppInterpList[patchId].faceToPointInterpolate(ptf)(),
output, output,
partInfoPatches_, arrayRangePatches_,
datasetNo datasetNo
); );
} }
@ -195,8 +195,8 @@ void Foam::vtkPV3Foam::convertVolFields
// //
for for
( (
int partId = partInfoFaceZones_.start(); int partId = arrayRangeFaceZones_.start();
partId < partInfoFaceZones_.end(); partId < arrayRangeFaceZones_.end();
++partId ++partId
) )
{ {
@ -220,7 +220,7 @@ void Foam::vtkPV3Foam::convertVolFields
( (
tf, tf,
output, output,
partInfoFaceZones_, arrayRangeFaceZones_,
datasetNo, datasetNo,
mesh, mesh,
zMesh[zoneId] zMesh[zoneId]
@ -234,8 +234,8 @@ void Foam::vtkPV3Foam::convertVolFields
// //
for for
( (
int partId = partInfoFaceSets_.start(); int partId = arrayRangeFaceSets_.start();
partId < partInfoFaceSets_.end(); partId < arrayRangeFaceSets_.end();
++partId ++partId
) )
{ {
@ -253,7 +253,7 @@ void Foam::vtkPV3Foam::convertVolFields
( (
tf, tf,
output, output,
partInfoFaceSets_, arrayRangeFaceSets_,
datasetNo, datasetNo,
mesh, mesh,
fSet fSet
@ -271,11 +271,11 @@ void Foam::vtkPV3Foam::convertVolFieldBlock
const GeometricField<Type, fvPatchField, volMesh>& tf, const GeometricField<Type, fvPatchField, volMesh>& tf,
autoPtr<GeometricField<Type, pointPatchField, pointMesh> >& ptfPtr, autoPtr<GeometricField<Type, pointPatchField, pointMesh> >& ptfPtr,
vtkMultiBlockDataSet* output, vtkMultiBlockDataSet* output,
const partInfo& selector, const arrayRange& range,
const List<polyDecomp>& decompLst const List<polyDecomp>& decompLst
) )
{ {
for (int partId = selector.start(); partId < selector.end(); ++partId) for (int partId = range.start(); partId < range.end(); ++partId)
{ {
const label datasetNo = partDataset_[partId]; const label datasetNo = partDataset_[partId];
@ -285,7 +285,7 @@ void Foam::vtkPV3Foam::convertVolFieldBlock
( (
tf, tf,
output, output,
selector, range,
datasetNo, datasetNo,
decompLst[datasetNo] decompLst[datasetNo]
); );
@ -309,7 +309,7 @@ void Foam::vtkPV3Foam::convertVolFieldBlock
ptfPtr(), ptfPtr(),
tf, tf,
output, output,
selector, range,
datasetNo, datasetNo,
decompLst[datasetNo] decompLst[datasetNo]
); );
@ -323,7 +323,7 @@ void Foam::vtkPV3Foam::convertVolField
( (
const GeometricField<Type, fvPatchField, volMesh>& tf, const GeometricField<Type, fvPatchField, volMesh>& tf,
vtkMultiBlockDataSet* output, vtkMultiBlockDataSet* output,
const partInfo& selector, const arrayRange& range,
const label datasetNo, const label datasetNo,
const polyDecomp& decompInfo const polyDecomp& decompInfo
) )
@ -359,7 +359,7 @@ void Foam::vtkPV3Foam::convertVolField
vtkUnstructuredGrid::SafeDownCast vtkUnstructuredGrid::SafeDownCast
( (
GetDataSetFromBlock(output, selector, datasetNo) GetDataSetFromBlock(output, range, datasetNo)
) ->GetCellData() ) ->GetCellData()
->AddArray(celldata); ->AddArray(celldata);

View File

@ -43,34 +43,40 @@
</Documentation> </Documentation>
</IntVectorProperty> </IntVectorProperty>
<!-- Selections -->
<!-- Available Parts (blocks) array --> <!--
| Selections
-->
<!-- Available Blocks array -->
<StringVectorProperty <StringVectorProperty
name="PartArrayInfo" name="BlockArrayStatus"
information_only="1"> information_only="1">
<ArraySelectionInformationHelper attribute_name="Part"/> <ArraySelectionInformationHelper attribute_name="Block"/>
</StringVectorProperty> </StringVectorProperty>
<StringVectorProperty <StringVectorProperty
name="PartStatus" name="BlockStatus"
label="Blocks" label="Blocks"
command="SetPartArrayStatus" command="SetBlockArrayStatus"
number_of_elements="0" number_of_elements="0"
repeat_command="1" repeat_command="1"
number_of_elements_per_command="2" number_of_elements_per_command="2"
element_types="2 0" element_types="2 0"
information_property="PartArrayInfo" information_property="BlockArrayStatus"
animateable="0"> animateable="0">
<ArraySelectionDomain name="array_list"> <ArraySelectionDomain name="array_list">
<RequiredProperties> <RequiredProperties>
<Property name="PartArrayInfo" function="ArrayList"/> <Property name="BlockArrayStatus" function="ArrayList"/>
</RequiredProperties> </RequiredProperties>
</ArraySelectionDomain> </ArraySelectionDomain>
<Documentation>
This property contains a list of the blocks
</Documentation>
</StringVectorProperty> </StringVectorProperty>
<!-- Available Parts (blocks) array --> <!-- Available CurvedEdges array -->
<StringVectorProperty <StringVectorProperty
name="CurvedEdgesArrayInfo" name="CurvedEdgesArrayStatus"
information_only="1"> information_only="1">
<ArraySelectionInformationHelper attribute_name="CurvedEdges"/> <ArraySelectionInformationHelper attribute_name="CurvedEdges"/>
</StringVectorProperty> </StringVectorProperty>
@ -82,13 +88,16 @@
repeat_command="1" repeat_command="1"
number_of_elements_per_command="2" number_of_elements_per_command="2"
element_types="2 0" element_types="2 0"
information_property="CurvedEdgesArrayInfo" information_property="CurvedEdgesArrayStatus"
animateable="0"> animateable="0">
<ArraySelectionDomain name="array_list"> <ArraySelectionDomain name="array_list">
<RequiredProperties> <RequiredProperties>
<Property name="CurvedEdgesArrayInfo" function="ArrayList"/> <Property name="CurvedEdgesArrayStatus" function="ArrayList"/>
</RequiredProperties> </RequiredProperties>
</ArraySelectionDomain> </ArraySelectionDomain>
<Documentation>
This property contains a list of the curved edges
</Documentation>
</StringVectorProperty> </StringVectorProperty>
<Hints> <Hints>

View File

@ -32,6 +32,7 @@ License
#include <QLabel> #include <QLabel>
#include <QLayout> #include <QLayout>
#include <QString> #include <QString>
#include <QPushButton>
#include <QtDebug> #include <QtDebug>
// Paraview <-> QT UI // Paraview <-> QT UI
@ -56,17 +57,26 @@ pqPV3blockMeshReaderPanel::pqPV3blockMeshReaderPanel
QWidget *p QWidget *p
) )
: :
pqAutoGeneratedObjectPanel(proxy, p), pqAutoGeneratedObjectPanel(proxy, p)
sourceProxy_(vtkSMSourceProxy::SafeDownCast(this->proxy()))
{ {
// create first sublayout (at top of the panel) // create first sublayout (at top of the panel)
QGridLayout *sect1 = new QGridLayout(); QGridLayout *form = new QGridLayout();
this->PanelLayout->addLayout(sect1, 0, 0, 1, -1); this->PanelLayout->addLayout(form, 0, 0, 1, -1);
vtkSMProperty* prop = 0;
// checkbox for showing point numbers // checkbox for showing point numbers
if ((prop = this->proxy()->GetProperty("UiShowPointNumbers")) != 0)
{
prop->SetImmediateUpdate(true);
ShowPointNumbers_ = new QCheckBox("Show Point Numbers"); ShowPointNumbers_ = new QCheckBox("Show Point Numbers");
ShowPointNumbers_->setChecked(true); ShowPointNumbers_->setToolTip("Show point numbers in render window.");
ShowPointNumbers_->setChecked
(
vtkSMIntVectorProperty::SafeDownCast(prop)->GetElement(0)
);
form->addWidget(ShowPointNumbers_);
connect connect
( (
@ -75,15 +85,7 @@ pqPV3blockMeshReaderPanel::pqPV3blockMeshReaderPanel
this, this,
SLOT(ShowPointNumbersToggled()) SLOT(ShowPointNumbersToggled())
); );
}
sect1->addWidget(ShowPointNumbers_);
// immediate update on the Server Manager side
vtkSMIntVectorProperty::SafeDownCast
(
sourceProxy_->GetProperty("UiShowPointNumbers")
)->SetImmediateUpdate(true);
} }
@ -93,7 +95,7 @@ void pqPV3blockMeshReaderPanel::ShowPointNumbersToggled()
{ {
vtkSMIntVectorProperty::SafeDownCast vtkSMIntVectorProperty::SafeDownCast
( (
sourceProxy_->GetProperty("UiShowPointNumbers") this->proxy()->GetProperty("UiShowPointNumbers")
)->SetElement(0, ShowPointNumbers_->isChecked()); )->SetElement(0, ShowPointNumbers_->isChecked());
// update the active view // update the active view

View File

@ -62,9 +62,6 @@ class pqPV3blockMeshReaderPanel
Q_OBJECT; Q_OBJECT;
typedef pqAutoGeneratedObjectPanel Superclass; typedef pqAutoGeneratedObjectPanel Superclass;
//- Server Manager Source Proxy
vtkSMSourceProxy* sourceProxy_;
//- Show Point Numbers checkbox //- Show Point Numbers checkbox
QCheckBox* ShowPointNumbers_; QCheckBox* ShowPointNumbers_;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -64,7 +64,7 @@ vtkPV3blockMeshReader::vtkPV3blockMeshReader()
ShowPointNumbers = 1; ShowPointNumbers = 1;
UpdateGUI = 0; UpdateGUI = 0;
PartSelection = vtkDataArraySelection::New(); BlockSelection = vtkDataArraySelection::New();
CurvedEdgesSelection = vtkDataArraySelection::New(); CurvedEdgesSelection = vtkDataArraySelection::New();
// Setup the selection callback to modify this object when an array // Setup the selection callback to modify this object when an array
@ -77,7 +77,7 @@ vtkPV3blockMeshReader::vtkPV3blockMeshReader()
SelectionObserver->SetClientData(this); SelectionObserver->SetClientData(this);
PartSelection->AddObserver BlockSelection->AddObserver
( (
vtkCommand::ModifiedEvent, vtkCommand::ModifiedEvent,
this->SelectionObserver this->SelectionObserver
@ -109,11 +109,11 @@ vtkPV3blockMeshReader::~vtkPV3blockMeshReader()
delete [] FileName; delete [] FileName;
} }
PartSelection->RemoveObserver(this->SelectionObserver); BlockSelection->RemoveObserver(this->SelectionObserver);
CurvedEdgesSelection->RemoveObserver(this->SelectionObserver); CurvedEdgesSelection->RemoveObserver(this->SelectionObserver);
SelectionObserver->Delete(); SelectionObserver->Delete();
PartSelection->Delete(); BlockSelection->Delete();
} }
@ -292,50 +292,50 @@ void vtkPV3blockMeshReader::PrintSelf(ostream& os, vtkIndent indent)
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
// Parts selection list control // Block selection list control
vtkDataArraySelection* vtkPV3blockMeshReader::GetPartSelection() vtkDataArraySelection* vtkPV3blockMeshReader::GetBlockSelection()
{ {
vtkDebugMacro(<<"GetPartSelection"); vtkDebugMacro(<<"GetBlockSelection");
return PartSelection; return BlockSelection;
} }
int vtkPV3blockMeshReader::GetNumberOfPartArrays() int vtkPV3blockMeshReader::GetNumberOfBlockArrays()
{ {
vtkDebugMacro(<<"GetNumberOfPartArrays"); vtkDebugMacro(<<"GetNumberOfBlockArrays");
return PartSelection->GetNumberOfArrays(); return BlockSelection->GetNumberOfArrays();
} }
const char* vtkPV3blockMeshReader::GetPartArrayName(int index) const char* vtkPV3blockMeshReader::GetBlockArrayName(int index)
{ {
vtkDebugMacro(<<"GetPartArrayName"); vtkDebugMacro(<<"GetBlockArrayName");
return PartSelection->GetArrayName(index); return BlockSelection->GetArrayName(index);
} }
int vtkPV3blockMeshReader::GetPartArrayStatus(const char* name) int vtkPV3blockMeshReader::GetBlockArrayStatus(const char* name)
{ {
vtkDebugMacro(<<"GetPartArrayStatus"); vtkDebugMacro(<<"GetBlockArrayStatus");
return PartSelection->ArrayIsEnabled(name); return BlockSelection->ArrayIsEnabled(name);
} }
void vtkPV3blockMeshReader::SetPartArrayStatus void vtkPV3blockMeshReader::SetBlockArrayStatus
( (
const char* name, const char* name,
int status int status
) )
{ {
vtkDebugMacro(<<"SetPartArrayStatus"); vtkDebugMacro(<<"SetBlockArrayStatus");
if (status) if (status)
{ {
PartSelection->EnableArray(name); BlockSelection->EnableArray(name);
} }
else else
{ {
PartSelection->DisableArray(name); BlockSelection->DisableArray(name);
} }
} }
@ -399,14 +399,7 @@ void vtkPV3blockMeshReader::SelectionModifiedCallback
void* void*
) )
{ {
static_cast<vtkPV3blockMeshReader*>(clientdata)->SelectionModified(); static_cast<vtkPV3blockMeshReader*>(clientdata)->Modified();
}
void vtkPV3blockMeshReader::SelectionModified()
{
vtkDebugMacro(<<"SelectionModified");
Modified();
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -84,15 +84,15 @@ public:
// Description: // Description:
// Parts (blocks) selection list control // Blocks selection list control
vtkDataArraySelection* GetPartSelection(); vtkDataArraySelection* GetBlockSelection();
int GetNumberOfPartArrays(); int GetNumberOfBlockArrays();
int GetPartArrayStatus(const char*); int GetBlockArrayStatus(const char*);
void SetPartArrayStatus(const char*, int status); void SetBlockArrayStatus(const char*, int status);
const char* GetPartArrayName(int index); const char* GetBlockArrayName(int index);
// Description: // Description:
// Parts (blocks) selection list control // CurvedEdges selection list control
vtkDataArraySelection* GetCurvedEdgesSelection(); vtkDataArraySelection* GetCurvedEdgesSelection();
int GetNumberOfCurvedEdgesArrays(); int GetNumberOfCurvedEdgesArrays();
int GetCurvedEdgesArrayStatus(const char*); int GetCurvedEdgesArrayStatus(const char*);
@ -110,8 +110,6 @@ public:
void* calldata void* calldata
); );
void SelectionModified();
protected: protected:
@ -164,7 +162,7 @@ private:
//- Dummy variable/switch to invoke a reader update //- Dummy variable/switch to invoke a reader update
int UpdateGUI; int UpdateGUI;
vtkDataArraySelection* PartSelection; vtkDataArraySelection* BlockSelection;
vtkDataArraySelection* CurvedEdgesSelection; vtkDataArraySelection* CurvedEdgesSelection;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -49,13 +49,16 @@ defineTypeNameAndDebug(Foam::vtkPV3blockMesh, 0);
void Foam::vtkPV3blockMesh::resetCounters() void Foam::vtkPV3blockMesh::resetCounters()
{ {
// Reset mesh part ids and sizes // Reset mesh part ids and sizes
partInfoBlocks_.reset(); arrayRangeBlocks_.reset();
partInfoEdges_.reset(); arrayRangeEdges_.reset();
partInfoCorners_.reset(); arrayRangeCorners_.reset();
} }
void Foam::vtkPV3blockMesh::updateInfoBlocks() void Foam::vtkPV3blockMesh::updateInfoBlocks
(
vtkDataArraySelection* arraySelection
)
{ {
if (debug) if (debug)
{ {
@ -63,8 +66,7 @@ void Foam::vtkPV3blockMesh::updateInfoBlocks()
<< " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]" << endl; << " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]" << endl;
} }
vtkDataArraySelection* selection = reader_->GetPartSelection(); arrayRangeBlocks_.reset( arraySelection->GetNumberOfArrays() );
partInfoBlocks_ = selection->GetNumberOfArrays();
const blockMesh& blkMesh = *meshPtr_; const blockMesh& blkMesh = *meshPtr_;
const int nBlocks = blkMesh.size(); const int nBlocks = blkMesh.size();
@ -81,22 +83,25 @@ void Foam::vtkPV3blockMesh::updateInfoBlocks()
} }
// Add blockId and zoneName to GUI list // Add blockId and zoneName to GUI list
selection->AddArray(partName.c_str()); arraySelection->AddArray(partName.c_str());
} }
partInfoBlocks_ += nBlocks; arrayRangeBlocks_ += nBlocks;
if (debug) if (debug)
{ {
// just for debug info // just for debug info
getSelectedArrayEntries(selection); getSelectedArrayEntries(arraySelection);
Info<< "<end> Foam::vtkPV3blockMesh::updateInfoBlocks" << endl; Info<< "<end> Foam::vtkPV3blockMesh::updateInfoBlocks" << endl;
} }
} }
void Foam::vtkPV3blockMesh::updateInfoEdges() void Foam::vtkPV3blockMesh::updateInfoEdges
(
vtkDataArraySelection* arraySelection
)
{ {
if (debug) if (debug)
{ {
@ -104,8 +109,7 @@ void Foam::vtkPV3blockMesh::updateInfoEdges()
<< " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]" << endl; << " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]" << endl;
} }
vtkDataArraySelection* selection = reader_->GetCurvedEdgesSelection(); arrayRangeEdges_.reset( arraySelection->GetNumberOfArrays() );
partInfoEdges_ = selection->GetNumberOfArrays();
const blockMesh& blkMesh = *meshPtr_; const blockMesh& blkMesh = *meshPtr_;
const curvedEdgeList& edges = blkMesh.edges(); const curvedEdgeList& edges = blkMesh.edges();
@ -119,15 +123,15 @@ void Foam::vtkPV3blockMesh::updateInfoEdges()
<< edges[edgeI].type(); << edges[edgeI].type();
// Add "beg:end - type" to GUI list // Add "beg:end - type" to GUI list
selection->AddArray(ostr.str().c_str()); arraySelection->AddArray(ostr.str().c_str());
} }
partInfoEdges_ += nEdges; arrayRangeEdges_ += nEdges;
if (debug) if (debug)
{ {
// just for debug info // just for debug info
getSelectedArrayEntries(selection); getSelectedArrayEntries(arraySelection);
Info<< "<end> Foam::vtkPV3blockMesh::updateInfoEdges" << endl; Info<< "<end> Foam::vtkPV3blockMesh::updateInfoEdges" << endl;
} }
@ -145,9 +149,9 @@ Foam::vtkPV3blockMesh::vtkPV3blockMesh
reader_(reader), reader_(reader),
dbPtr_(NULL), dbPtr_(NULL),
meshPtr_(NULL), meshPtr_(NULL),
partInfoBlocks_("block"), arrayRangeBlocks_("block"),
partInfoEdges_("edges"), arrayRangeEdges_("edges"),
partInfoCorners_("corners") arrayRangeCorners_("corners")
{ {
if (debug) if (debug)
{ {
@ -243,7 +247,7 @@ void Foam::vtkPV3blockMesh::updateInfo()
resetCounters(); resetCounters();
vtkDataArraySelection* partSelection = reader_->GetPartSelection(); vtkDataArraySelection* blockSelection = reader_->GetBlockSelection();
vtkDataArraySelection* edgeSelection = reader_->GetCurvedEdgesSelection(); vtkDataArraySelection* edgeSelection = reader_->GetCurvedEdgesSelection();
// enable 'internalMesh' on the first call // enable 'internalMesh' on the first call
@ -251,33 +255,33 @@ void Foam::vtkPV3blockMesh::updateInfo()
stringList enabledParts; stringList enabledParts;
stringList enabledEdges; stringList enabledEdges;
bool firstTime = false; bool firstTime = false;
if (!partSelection->GetNumberOfArrays() && !meshPtr_) if (!blockSelection->GetNumberOfArrays() && !meshPtr_)
{ {
firstTime = true; firstTime = true;
} }
else else
{ {
enabledParts = getSelectedArrayEntries(partSelection); enabledParts = getSelectedArrayEntries(blockSelection);
enabledEdges = getSelectedArrayEntries(edgeSelection); enabledEdges = getSelectedArrayEntries(edgeSelection);
} }
// Clear current mesh parts list // Clear current mesh parts list
partSelection->RemoveAllArrays(); blockSelection->RemoveAllArrays();
edgeSelection->RemoveAllArrays(); edgeSelection->RemoveAllArrays();
// need a blockMesh // need a blockMesh
updateFoamMesh(); updateFoamMesh();
// Update mesh parts list // Update mesh parts list
updateInfoBlocks(); updateInfoBlocks( blockSelection );
// Update curved edges list // Update curved edges list
updateInfoEdges(); updateInfoEdges( edgeSelection );
// restore the enabled selections // restore the enabled selections
if (!firstTime) if (!firstTime)
{ {
setSelectedArrayEntries(partSelection, enabledParts); setSelectedArrayEntries(blockSelection, enabledParts);
setSelectedArrayEntries(edgeSelection, enabledEdges); setSelectedArrayEntries(edgeSelection, enabledEdges);
} }
@ -337,7 +341,7 @@ void Foam::vtkPV3blockMesh::Update
reader_->UpdateProgress(0.1); reader_->UpdateProgress(0.1);
// Set up mesh parts selection(s) // Set up mesh parts selection(s)
updateBoolListStatus(partStatus_, reader_->GetPartSelection()); updateBoolListStatus(blockStatus_, reader_->GetBlockSelection());
// Set up curved edges selection(s) // Set up curved edges selection(s)
updateBoolListStatus(edgeStatus_, reader_->GetCurvedEdgesSelection()); updateBoolListStatus(edgeStatus_, reader_->GetCurvedEdgesSelection());

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -88,7 +88,7 @@ class vtkPV3blockMesh
// Private classes // Private classes
//- Bookkeeping for GUI checklists and the multi-block organization //- Bookkeeping for GUI checklists and the multi-block organization
class partInfo class arrayRange
{ {
const char *name_; const char *name_;
int block_; int block_;
@ -97,11 +97,11 @@ class vtkPV3blockMesh
public: public:
partInfo(const char *name, const int blockNo=0) arrayRange(const char *name, const int blockNo=0)
: :
name_(name), name_(name),
block_(blockNo), block_(blockNo),
start_(-1), start_(0),
size_(0) size_(0)
{} {}
@ -119,21 +119,25 @@ class vtkPV3blockMesh
return prev; return prev;
} }
//- Return block name
const char* name() const const char* name() const
{ {
return name_; return name_;
} }
//- Return array start index
int start() const int start() const
{ {
return start_; return start_;
} }
//- Return array end index
int end() const int end() const
{ {
return start_ + size_; return start_ + size_;
} }
//- Return sublist size
int size() const int size() const
{ {
return size_; return size_;
@ -144,16 +148,10 @@ class vtkPV3blockMesh
return !size_; return !size_;
} }
void reset() //- Reset the size to zero and optionally assign a new start
void reset(const int startAt = 0)
{ {
start_ = -1; start_ = startAt;
size_ = 0;
}
//- Assign new start and reset the size
void operator=(const int i)
{
start_ = i;
size_ = 0; size_ = 0;
} }
@ -177,22 +175,20 @@ class vtkPV3blockMesh
blockMesh* meshPtr_; blockMesh* meshPtr_;
//- Selected geometrical parts //- Selected geometrical parts
boolList partStatus_; boolList blockStatus_;
//- Selected curved edges //- Selected curved edges
boolList edgeStatus_; boolList edgeStatus_;
//- First instance and size of bleckMesh blocks //- First instance and size of bleckMesh blocks
// used to index into partStatus_ // used to index into blockStatus_
partInfo partInfoBlocks_; arrayRange arrayRangeBlocks_;
//- First instance and size of CurvedEdges //- First instance and size of CurvedEdges (only partially used)
// only partially used arrayRange arrayRangeEdges_;
partInfo partInfoEdges_;
//- First instance and size of block corners //- First instance and size of block corners (only partially used)
// only partially used arrayRange arrayRangeCorners_;
partInfo partInfoCorners_;
//- List of point numbers for rendering to window //- List of point numbers for rendering to window
List<vtkTextActor*> pointNumberTextActorsPtrs_; List<vtkTextActor*> pointNumberTextActorsPtrs_;
@ -205,7 +201,7 @@ class vtkPV3blockMesh
( (
vtkMultiBlockDataSet* output, vtkMultiBlockDataSet* output,
vtkDataSet* dataset, vtkDataSet* dataset,
const partInfo&, const arrayRange&,
const label datasetNo, const label datasetNo,
const std::string& datasetName const std::string& datasetName
); );
@ -215,7 +211,7 @@ class vtkPV3blockMesh
static vtkDataSet* GetDataSetFromBlock static vtkDataSet* GetDataSetFromBlock
( (
vtkMultiBlockDataSet* output, vtkMultiBlockDataSet* output,
const partInfo&, const arrayRange&,
const label datasetNo const label datasetNo
); );
@ -224,7 +220,7 @@ class vtkPV3blockMesh
static label GetNumberOfDataSets static label GetNumberOfDataSets
( (
vtkMultiBlockDataSet* output, vtkMultiBlockDataSet* output,
const partInfo& const arrayRange&
); );
//- Update boolList from GUI selection //- Update boolList from GUI selection
@ -240,10 +236,10 @@ class vtkPV3blockMesh
// Update information helper functions // Update information helper functions
//- Internal block info //- Internal block info
void updateInfoBlocks(); void updateInfoBlocks(vtkDataArraySelection*);
//- block curved edges info //- block curved edges info
void updateInfoEdges(); void updateInfoEdges(vtkDataArraySelection*);
// Update helper functions // Update helper functions
@ -271,7 +267,7 @@ class vtkPV3blockMesh
static wordHashSet getSelected static wordHashSet getSelected
( (
vtkDataArraySelection*, vtkDataArraySelection*,
const partInfo& const arrayRange&
); );
//- Retrieve the current selections //- Retrieve the current selections
@ -281,7 +277,7 @@ class vtkPV3blockMesh
static stringList getSelectedArrayEntries static stringList getSelectedArrayEntries
( (
vtkDataArraySelection*, vtkDataArraySelection*,
const partInfo& const arrayRange&
); );
//- Set selection(s) //- Set selection(s)

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -52,9 +52,9 @@ void Foam::vtkPV3blockMesh::convertMeshBlocks
int& blockNo int& blockNo
) )
{ {
vtkDataArraySelection* selection = reader_->GetPartSelection(); vtkDataArraySelection* selection = reader_->GetBlockSelection();
partInfo& selector = partInfoBlocks_; arrayRange& range = arrayRangeBlocks_;
selector.block(blockNo); // set output block range.block(blockNo); // set output block
label datasetNo = 0; // restart at dataset 0 label datasetNo = 0; // restart at dataset 0
const blockMesh& blkMesh = *meshPtr_; const blockMesh& blkMesh = *meshPtr_;
@ -70,25 +70,18 @@ void Foam::vtkPV3blockMesh::convertMeshBlocks
for for
( (
int partId = selector.start(); int partId = range.start();
partId < selector.end(); partId < range.end();
++partId, ++blockI ++partId, ++blockI
) )
{ {
if (!partStatus_[partId]) if (!blockStatus_[partId])
{ {
continue; continue;
} }
const blockDescriptor& blockDef = blkMesh[blockI].blockDef(); const blockDescriptor& blockDef = blkMesh[blockI].blockDef();
word partName("block");
// // append the (optional) zone name
// if (!blockDef.zoneName().empty())
// {
// partName += " - " + blockDef.zoneName();
// }
//
vtkUnstructuredGrid* vtkmesh = vtkUnstructuredGrid::New(); vtkUnstructuredGrid* vtkmesh = vtkUnstructuredGrid::New();
// Convert Foam mesh vertices to VTK // Convert Foam mesh vertices to VTK
@ -123,7 +116,7 @@ void Foam::vtkPV3blockMesh::convertMeshBlocks
AddToBlock AddToBlock
( (
output, vtkmesh, selector, datasetNo, output, vtkmesh, range, datasetNo,
selection->GetArrayName(partId) selection->GetArrayName(partId)
); );
@ -152,9 +145,9 @@ void Foam::vtkPV3blockMesh::convertMeshEdges
) )
{ {
vtkDataArraySelection* selection = reader_->GetCurvedEdgesSelection(); vtkDataArraySelection* selection = reader_->GetCurvedEdgesSelection();
partInfo& selector = partInfoEdges_; arrayRange& range = arrayRangeEdges_;
selector.block(blockNo); // set output block range.block(blockNo); // set output block
label datasetNo = 0; // restart at dataset 0 label datasetNo = 0; // restart at dataset 0
const blockMesh& blkMesh = *meshPtr_; const blockMesh& blkMesh = *meshPtr_;
@ -165,8 +158,8 @@ void Foam::vtkPV3blockMesh::convertMeshEdges
for for
( (
int partId = selector.start(); int partId = range.start();
partId < selector.end(); partId < range.end();
++partId, ++edgeI ++partId, ++edgeI
) )
{ {
@ -187,9 +180,7 @@ void Foam::vtkPV3blockMesh::convertMeshEdges
edgeList blkEdges = blockDef.blockShape().edges(); edgeList blkEdges = blockDef.blockShape().edges();
// find the corresponding edge within the block // find the corresponding edge within the block
label foundEdgeI = -1; label foundEdgeI = -1;
forAll(blkEdges, blkEdgeI) forAll(blkEdges, blkEdgeI)
{ {
@ -236,7 +227,7 @@ void Foam::vtkPV3blockMesh::convertMeshEdges
AddToBlock AddToBlock
( (
output, vtkmesh, selector, datasetNo, output, vtkmesh, range, datasetNo,
selection->GetArrayName(partId) selection->GetArrayName(partId)
); );
@ -269,8 +260,8 @@ void Foam::vtkPV3blockMesh::convertMeshCorners
int& blockNo int& blockNo
) )
{ {
partInfo& selector = partInfoCorners_; arrayRange& range = arrayRangeCorners_;
selector.block(blockNo); // set output block range.block(blockNo); // set output block
label datasetNo = 0; // restart at dataset 0 label datasetNo = 0; // restart at dataset 0
const pointField& blockPoints = meshPtr_->blockPointField(); const pointField& blockPoints = meshPtr_->blockPointField();
@ -310,7 +301,11 @@ void Foam::vtkPV3blockMesh::convertMeshCorners
vtkmesh->SetVerts(vtkcells); vtkmesh->SetVerts(vtkcells);
vtkcells->Delete(); vtkcells->Delete();
AddToBlock(output, vtkmesh, selector, datasetNo, partInfoCorners_.name()); AddToBlock
(
output, vtkmesh, range, datasetNo,
arrayRangeCorners_.name()
);
vtkmesh->Delete(); vtkmesh->Delete();
datasetNo++; datasetNo++;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -71,12 +71,12 @@ void Foam::vtkPV3blockMesh::AddToBlock
( (
vtkMultiBlockDataSet* output, vtkMultiBlockDataSet* output,
vtkDataSet* dataset, vtkDataSet* dataset,
const partInfo& selector, const arrayRange& range,
const label datasetNo, const label datasetNo,
const std::string& datasetName const std::string& datasetName
) )
{ {
const int blockNo = selector.block(); const int blockNo = range.block();
vtkDataObject* blockDO = output->GetBlock(blockNo); vtkDataObject* blockDO = output->GetBlock(blockNo);
vtkMultiBlockDataSet* block = vtkMultiBlockDataSet::SafeDownCast(blockDO); vtkMultiBlockDataSet* block = vtkMultiBlockDataSet::SafeDownCast(blockDO);
@ -112,7 +112,7 @@ void Foam::vtkPV3blockMesh::AddToBlock
output->GetMetaData(blockNo)->Set output->GetMetaData(blockNo)->Set
( (
vtkCompositeDataSet::NAME(), vtkCompositeDataSet::NAME(),
selector.name() range.name()
); );
} }
@ -130,11 +130,11 @@ void Foam::vtkPV3blockMesh::AddToBlock
vtkDataSet* Foam::vtkPV3blockMesh::GetDataSetFromBlock vtkDataSet* Foam::vtkPV3blockMesh::GetDataSetFromBlock
( (
vtkMultiBlockDataSet* output, vtkMultiBlockDataSet* output,
const partInfo& selector, const arrayRange& range,
const label datasetNo const label datasetNo
) )
{ {
const int blockNo = selector.block(); const int blockNo = range.block();
vtkDataObject* blockDO = output->GetBlock(blockNo); vtkDataObject* blockDO = output->GetBlock(blockNo);
vtkMultiBlockDataSet* block = vtkMultiBlockDataSet::SafeDownCast(blockDO); vtkMultiBlockDataSet* block = vtkMultiBlockDataSet::SafeDownCast(blockDO);
@ -152,10 +152,10 @@ vtkDataSet* Foam::vtkPV3blockMesh::GetDataSetFromBlock
Foam::label Foam::vtkPV3blockMesh::GetNumberOfDataSets Foam::label Foam::vtkPV3blockMesh::GetNumberOfDataSets
( (
vtkMultiBlockDataSet* output, vtkMultiBlockDataSet* output,
const partInfo& selector const arrayRange& range
) )
{ {
const int blockNo = selector.block(); const int blockNo = range.block();
vtkDataObject* blockDO = output->GetBlock(blockNo); vtkDataObject* blockDO = output->GetBlock(blockNo);
vtkMultiBlockDataSet* block = vtkMultiBlockDataSet::SafeDownCast(blockDO); vtkMultiBlockDataSet* block = vtkMultiBlockDataSet::SafeDownCast(blockDO);
@ -191,13 +191,13 @@ Foam::wordHashSet Foam::vtkPV3blockMesh::getSelected
Foam::wordHashSet Foam::vtkPV3blockMesh::getSelected Foam::wordHashSet Foam::vtkPV3blockMesh::getSelected
( (
vtkDataArraySelection* select, vtkDataArraySelection* select,
const partInfo& selector const arrayRange& range
) )
{ {
int nElem = select->GetNumberOfArrays(); int nElem = select->GetNumberOfArrays();
wordHashSet selections(2*nElem); wordHashSet selections(2*nElem);
for (int elemI = selector.start(); elemI < selector.end(); ++elemI) for (int elemI = range.start(); elemI < range.end(); ++elemI)
{ {
if (select->GetArraySetting(elemI)) if (select->GetArraySetting(elemI))
{ {
@ -251,13 +251,13 @@ Foam::stringList Foam::vtkPV3blockMesh::getSelectedArrayEntries
Foam::stringList Foam::vtkPV3blockMesh::getSelectedArrayEntries Foam::stringList Foam::vtkPV3blockMesh::getSelectedArrayEntries
( (
vtkDataArraySelection* select, vtkDataArraySelection* select,
const partInfo& selector const arrayRange& range
) )
{ {
stringList selections(selector.size()); stringList selections(range.size());
label nElem = 0; label nElem = 0;
for (int elemI = selector.start(); elemI < selector.end(); ++elemI) for (int elemI = range.start(); elemI < range.end(); ++elemI)
{ {
if (select->GetArraySetting(elemI)) if (select->GetArraySetting(elemI))
{ {
@ -270,7 +270,7 @@ Foam::stringList Foam::vtkPV3blockMesh::getSelectedArrayEntries
if (debug) if (debug)
{ {
Info<< "available("; Info<< "available(";
for (int elemI = selector.start(); elemI < selector.end(); ++elemI) for (int elemI = range.start(); elemI < range.end(); ++elemI)
{ {
Info<< " \"" << select->GetArrayName(elemI) << "\""; Info<< " \"" << select->GetArrayName(elemI) << "\"";
} }

View File

@ -87,7 +87,7 @@ int USERD_set_filenames
// set the number of fields and store their names // set the number of fields and store their names
// a valid field must exist for all time-steps // a valid field must exist for all time-steps
runTime.setTime(timeDirs[timeDirs.size()-1], timeDirs.size()-1); runTime.setTime(timeDirs.last(), timeDirs.size()-1);
IOobjectList objects(*meshPtr, runTime.timeName()); IOobjectList objects(*meshPtr, runTime.timeName());
fieldNames = objects.names(); fieldNames = objects.names();

View File

@ -6,3 +6,5 @@
# then # then
# wmake fieldview9Reader # wmake fieldview9Reader
# fi # fi
# ----------------------------------------------------------------- end-of-file

View File

@ -103,7 +103,7 @@ int main(int argc, char *argv[])
{ {
startIds[i+1] += startIds[i] + numIds[i]; startIds[i+1] += startIds[i] + numIds[i];
} }
label nParticle = startIds[startIds.size()-1] + numIds[startIds.size()-1]; label nParticle = startIds.last() + numIds[startIds.size()-1];

View File

@ -83,7 +83,7 @@ int main(int argc, char *argv[])
Info<< "\nVmax = " << Vmax; Info<< "\nVmax = " << Vmax;
Info<< ", Vmin = " << Vmin << endl; Info<< ", Vmin = " << Vmin << endl;
Info<< "Vmax/Vmin = " << Vmax/Vmin << endl; Info<< "Vmax/Vmin = " << Vmax/Vmin << endl;
Info<< "\nEnd" << endl; Info<< "\nEnd\n" << endl;
return 0; return 0;
} }

View File

@ -90,7 +90,7 @@ int main(int argc, char *argv[])
# include "collapse.H" # include "collapse.H"
} }
Info<< "\nEnd" << endl; Info<< "\nEnd\n" << endl;
return 0; return 0;
} }

View File

@ -101,7 +101,7 @@ int main(int argc, char *argv[])
} }
} }
Info<< "\nEnd" << endl; Info<< "\nEnd\n" << endl;
return 0; return 0;
} }

View File

@ -47,7 +47,7 @@ int main(int argc, char *argv[])
# include "createMesh.H" # include "createMesh.H"
runTime.setTime(timeDirs[timeDirs.size()-1], timeDirs.size()-1); runTime.setTime(timeDirs.last(), timeDirs.size()-1);
volScalarField pMean volScalarField pMean
( (

View File

@ -1,8 +1,14 @@
EXE_INC = \ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/incompressible/RAS/RASModel \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
-I$(LIB_SRC)/meshTools/lnInclude -I$(LIB_SRC)/meshTools/lnInclude
EXE_LIBS = \ EXE_LIBS = \
-lfiniteVolume \ -lfiniteVolume \
-lincompressibleRASModels \
-lincompressibleTransportModels \
-lgenericPatchFields \ -lgenericPatchFields \
-lmeshTools -lmeshTools

View File

@ -37,6 +37,8 @@ Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "fvCFD.H" #include "fvCFD.H"
#include "singlePhaseTransportModel.H"
#include "RASModel.H"
#include "wallDist.H" #include "wallDist.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -55,51 +57,11 @@ int main(int argc, char *argv[])
#include "setRootCase.H" #include "setRootCase.H"
#include "createTime.H" #include "createTime.H"
#include "createMesh.H" #include "createMesh.H"
#include "createFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "Reading field U\n" << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
volVectorField U
(
IOobject
(
"U",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
),
mesh
);
# include "createPhi.H"
Info<< "Calculating wall distance field" << endl;
volScalarField y = wallDist(mesh).y();
// Set the mean boundary-layer thickness
dimensionedScalar ybl("ybl", dimLength, 0);
if (args.optionFound("ybl"))
{
// If the boundary-layer thickness is provided use it
ybl.value() = args.optionRead<scalar>("ybl");
}
else if (args.optionFound("Cbl"))
{
// Calculate boundary layer thickness as Cbl * mean distance to wall
ybl.value() = gAverage(y) * args.optionRead<scalar>("Cbl");
}
else
{
FatalErrorIn(args.executable())
<< "Neither option 'ybl' or 'Cbl' have been provided to calculate"
" the boundary-layer thickness"
<< exit(FatalError);
}
Info<< "\nCreating boundary-layer for U of thickness "
<< ybl.value() << " m" << nl << endl;
// Modify velocity by applying a 1/7th power law boundary-layer // Modify velocity by applying a 1/7th power law boundary-layer
// u/U0 = (y/ybl)^(1/7) // u/U0 = (y/ybl)^(1/7)
@ -114,45 +76,18 @@ int main(int argc, char *argv[])
} }
} }
Info<< "Writing U" << endl; Info<< "Writing U\n" << endl;
U.write(); U.write();
// Update/re-write phi // Update/re-write phi
phi = fvc::interpolate(U) & mesh.Sf(); phi = fvc::interpolate(U) & mesh.Sf();
phi.write(); phi.write();
// Read and modify turbulence fields if present // Calculate nut
tmp<volScalarField> tnut = turbulence->nut();
IOobject epsilonHeader volScalarField& nut = tnut();
( volScalarField S = mag(dev(symm(fvc::grad(U))));
"epsilon", nut = sqr(kappa*min(y, ybl))*::sqrt(2)*S;
runTime.timeName(),
mesh,
IOobject::MUST_READ
);
IOobject kHeader
(
"k",
runTime.timeName(),
mesh,
IOobject::MUST_READ
);
IOobject nuTildaHeader
(
"nuTilda",
runTime.timeName(),
mesh,
IOobject::MUST_READ
);
// First calculate nut
volScalarField nut
(
"nut",
sqr(kappa*min(y, ybl))*::sqrt(2)*mag(dev(symm(fvc::grad(U))))
);
if (args.optionFound("writenut")) if (args.optionFound("writenut"))
{ {
@ -160,12 +95,69 @@ int main(int argc, char *argv[])
nut.write(); nut.write();
} }
// Create G field - used by RAS wall functions
volScalarField G("RASModel::G", nut*2*sqr(S));
// Read and modify turbulence fields if present
//--- Read and modify turbulence fields
// Turbulence k
tmp<volScalarField> tk = turbulence->k();
volScalarField& k = tk();
scalar ck0 = pow025(Cmu)*kappa;
k = sqr(nut/(ck0*min(y, ybl)));
k.correctBoundaryConditions();
Info<< "Writing k\n" << endl;
k.write();
// Turbulence epsilon
tmp<volScalarField> tepsilon = turbulence->epsilon();
volScalarField& epsilon = tepsilon();
scalar ce0 = ::pow(Cmu, 0.75)/kappa;
epsilon = ce0*k*sqrt(k)/min(y, ybl);
epsilon.correctBoundaryConditions();
Info<< "Writing epsilon\n" << endl;
epsilon.write();
// Turbulence omega
IOobject omegaHeader
(
"omega",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
);
if (omegaHeader.headerOk())
{
volScalarField omega(omegaHeader, mesh);
omega = epsilon/(Cmu*k);
omega.correctBoundaryConditions();
Info<< "Writing omega\n" << endl;
omega.write();
}
// Turbulence nuTilda
IOobject nuTildaHeader
(
"nuTilda",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
);
if (nuTildaHeader.headerOk()) if (nuTildaHeader.headerOk())
{ {
Info<< "Reading field nuTilda\n" << endl;
volScalarField nuTilda(nuTildaHeader, mesh); volScalarField nuTilda(nuTildaHeader, mesh);
nuTilda = nut; nuTilda = nut;
nuTilda.correctBoundaryConditions(); nuTilda.correctBoundaryConditions();
@ -174,28 +166,6 @@ int main(int argc, char *argv[])
nuTilda.write(); nuTilda.write();
} }
if (kHeader.headerOk() && epsilonHeader.headerOk())
{
Info<< "Reading field k\n" << endl;
volScalarField k(kHeader, mesh);
Info<< "Reading field epsilon\n" << endl;
volScalarField epsilon(epsilonHeader, mesh);
scalar ck0 = ::pow(Cmu, 0.25)*kappa;
k = sqr(nut/(ck0*min(y, ybl)));
k.correctBoundaryConditions();
scalar ce0 = ::pow(Cmu, 0.75)/kappa;
epsilon = ce0*k*sqrt(k)/min(y, ybl);
epsilon.correctBoundaryConditions();
Info<< "Writing k\n" << endl;
k.write();
Info<< "Writing epsilon\n" << endl;
epsilon.write();
}
Info<< nl << "ExecutionTime = " << runTime.elapsedCpuTime() << " s" Info<< nl << "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s"

View File

@ -0,0 +1,78 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd.
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
Info<< "Reading field U\n" << endl;
volVectorField U
(
IOobject
(
"U",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
),
mesh
);
#include "createPhi.H"
singlePhaseTransportModel laminarTransport(U, phi);
autoPtr<incompressible::RASModel> turbulence
(
incompressible::RASModel::New(U, phi, laminarTransport)
);
Info<< "Calculating wall distance field" << endl;
volScalarField y = wallDist(mesh).y();
// Set the mean boundary-layer thickness
dimensionedScalar ybl("ybl", dimLength, 0);
if (args.optionFound("ybl"))
{
// If the boundary-layer thickness is provided use it
ybl.value() = args.optionRead<scalar>("ybl");
}
else if (args.optionFound("Cbl"))
{
// Calculate boundary layer thickness as Cbl * mean distance to wall
ybl.value() = gAverage(y)*args.optionRead<scalar>("Cbl");
}
else
{
FatalErrorIn(args.executable())
<< "Neither option 'ybl' or 'Cbl' have been provided to calculate "
<< "the boundary-layer thickness"
<< exit(FatalError);
}
Info<< "\nCreating boundary-layer for U of thickness "
<< ybl.value() << " m" << nl << endl;
// ************************************************************************* //

View File

@ -89,7 +89,7 @@ int main(int argc, char *argv[])
Info<< nl << "ClockTime = " << runTime.elapsedClockTime() << " s" Info<< nl << "ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl; << nl << endl;
Info << nl << "End\n" << endl; Info<< "\nEnd\n" << endl;
return 0; return 0;
} }

View File

@ -235,7 +235,7 @@ int main(int argc, char *argv[])
); );
} }
Info<< "\nEnd" << endl; Info<< "\nEnd\n" << endl;
return 0; return 0;
} }

View File

@ -1,5 +1,8 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
set -x
wmake libso tabulatedWallFunction wmake libso tabulatedWallFunction
wmake wmake
# ----------------------------------------------------------------- end-of-file

View File

@ -93,13 +93,13 @@ Foam::scalar Foam::tabulatedWallFunctions::general::interpolate
{ {
case itLinear: case itLinear:
{ {
if (xi < x[0]) if (xi <= x[0])
{ {
return fx[0]; return fx[0];
} }
else if (xi > x[x.size()-1]) else if (xi >= x.last())
{ {
return fx[x.size()-1]; return fx.last();
} }
else else
{ {

View File

@ -128,7 +128,7 @@ static void splitTri
labelledTri labelledTri
( (
f[fp2], f[fp2],
splitPoints[splitPoints.size()-1], splitPoints.last(),
f[fp1], f[fp1],
f.region() f.region()
) )
@ -144,7 +144,7 @@ static void splitTri
( (
f[fp1], f[fp1],
f[fp2], f[fp2],
splitPoints[splitPoints.size()-1], splitPoints.last(),
f.region() f.region()
) )
); );

View File

@ -130,18 +130,7 @@ OpenFOAM)
esac esac
case "$ParaView_VERSION" in case "$ParaView_VERSION" in
2*) 3*)
trap "rm -f paraFoam.pvs $caseFile 2>/dev/null; exit 0" EXIT TERM INT
touch "$caseFile"
# since we are now in the cwd, %CASE% is '$PWD/$caseFile'
sed -e s@%CASE%@$PWD/$caseFile@g \
$WM_PROJECT_DIR/bin/tools/paraFoam.pvs > paraFoam.pvs
paraview paraFoam.pvs
;;
*)
# only create/remove caseFile if it didn't already exist # only create/remove caseFile if it didn't already exist
[ -e $caseFile ] || { [ -e $caseFile ] || {
trap "rm -f $caseFile 2>/dev/null; exit 0" EXIT TERM INT trap "rm -f $caseFile 2>/dev/null; exit 0" EXIT TERM INT

View File

@ -41,8 +41,7 @@ int main(int argc, char *argv[])
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info << "End\n" << endl; Info<< "\nEnd\n" << endl;
return 0; return 0;
} }

View File

@ -1,12 +0,0 @@
# ParaView State Version 2.2
set kw(vtkTemp2) [$Application GetMainWindow]
set kw(vtkTemp29) [$kw(vtkTemp2) GetMainView]
set kw(vtkTemp980) [$kw(vtkTemp2) GetAnimationManager]
[$kw(vtkTemp2) GetRotateCameraButton] SetState 1
$kw(vtkTemp2) ChangeInteractorStyle 1
set kw(vtkTemp840) [$kw(vtkTemp2) InitializeReadCustom "FoamReader" "%CASE%"]
$kw(vtkTemp2) ReadFileInformation $kw(vtkTemp840) "%CASE%"
$kw(vtkTemp2) FinalizeRead $kw(vtkTemp840) "%CASE%"
set kw(vtkTemp868) [$kw(vtkTemp840) GetPVWidget {Filename}]
$kw(vtkTemp868) SetValue "%CASE%"

View File

@ -689,13 +689,13 @@ HTML_FILE_EXTENSION = .html
# each generated HTML page. If it is left blank doxygen will generate a # each generated HTML page. If it is left blank doxygen will generate a
# standard header. # standard header.
HTML_HEADER = FoamHeader.html HTML_HEADER = $(WM_PROJECT_DIR)/doc/Doxygen/FoamHeader.html
# The HTML_FOOTER tag can be used to specify a personal HTML footer for # The HTML_FOOTER tag can be used to specify a personal HTML footer for
# each generated HTML page. If it is left blank doxygen will generate a # each generated HTML page. If it is left blank doxygen will generate a
# standard footer. # standard footer.
HTML_FOOTER = FoamFooter.html HTML_FOOTER = $(WM_PROJECT_DIR)/doc/Doxygen/FoamFooter.html
# The HTML_STYLESHEET tag can be used to specify a user-defined cascading # The HTML_STYLESHEET tag can be used to specify a user-defined cascading
# style sheet that is used by each HTML page. It can be used to # style sheet that is used by each HTML page. It can be used to

View File

@ -222,4 +222,4 @@ The doc/Doxygen/tools directory contains miscellaneous scripts for finding
and possibly repairing documentation issues. and possibly repairing documentation issues.
Updated: 2008-03-17 Updated: 2009-11-27

Some files were not shown because too many files have changed in this diff Show More