updated DebugSwitches, surfaceWriter

- added obj surfaceWriter
- don't bother with prepended field names on obj and stl surfaceWriter.
  It fills the disk and suggests differences where there are none.
This commit is contained in:
Mark Olesen 2009-03-09 15:37:54 +01:00
parent b968e62ef9
commit 6ecdf4fc41
16 changed files with 601 additions and 72 deletions

View File

@ -29,6 +29,9 @@ Description
#include "argList.H"
#include "dictionary.H"
#include "IFstream.H"
#include "IOobject.H"
#include "HashSet.H"
using namespace Foam;
@ -38,18 +41,108 @@ using namespace Foam;
int main(int argc, char *argv[])
{
argList::noParallel();
argList::validOptions.insert("new", "");
argList::validOptions.insert("old", "");
wordList ds(debug::debugSwitches().toc());
sort(ds);
Info<< "debug switches: " << ds << endl;
Foam::argList args(argc, argv);
wordList currDebug(debug::debugSwitches().toc());
wordList currInfo(debug::infoSwitches().toc());
wordList currOpt(debug::optimisationSwitches().toc());
if (args.options().found("old") || args.options().found("new"))
{
dictionary controlDict(IFstream(findEtcFile("controlDict", true))());
wordHashSet oldDebug
(
controlDict.subDict("DebugSwitches").toc()
);
wordHashSet oldInfo
(
controlDict.subDict("InfoSwitches").toc()
);
wordHashSet oldOpt
(
controlDict.subDict("OptimisationSwitches").toc()
);
wordHashSet hashset;
wordList listing;
// list old switches - but this can't work since the (old) inserted
// switches are in both sets
// Workaround:
// 1. run without any options (get complete list)
// 2. comment out DebugSwitches, run again with -new to find new ones
// and do a diff
if (args.options().found("old"))
{
IOobject::writeDivider(Info);
hashset = oldDebug;
hashset -= currDebug;
listing = hashset.toc();
sort(listing);
Info<< "old DebugSwitches: " << listing << endl;
hashset = oldInfo;
hashset -= currInfo;
listing = hashset.toc();
sort(listing);
Info<< "old InfoSwitches: " << listing << endl;
hashset = oldOpt;
hashset -= currOpt;
listing = hashset.toc();
sort(listing);
Info<< "old OptimisationSwitches: " << listing << endl;
}
// list new switches
if (args.options().found("new"))
{
IOobject::writeDivider(Info);
hashset = currDebug;
hashset -= oldDebug;
listing = hashset.toc();
sort(listing);
Info<< "new DebugSwitches: " << listing << endl;
hashset = currInfo;
hashset -= oldInfo;
listing = hashset.toc();
sort(listing);
Info<< "new InfoSwitches: " << listing << endl;
hashset = currOpt;
hashset -= oldOpt;
listing = hashset.toc();
sort(listing);
Info<< "new OptimisationSwitches: " << listing << endl;
}
}
else
{
IOobject::writeDivider(Info);
sort(currDebug);
Info<< "DebugSwitches: " << currDebug << endl;
sort(currInfo);
Info<< "InfoSwitches: " << currInfo << endl;
sort(currOpt);
Info<< "OptimisationSwitches: " << currOpt << endl;
}
wordList is(debug::infoSwitches().toc());
sort(is);
Info<< "info switches: " << is << endl;
wordList os(debug::optimisationSwitches().toc());
sort(os);
Info<< "optimisation switches: " << os << endl;
Info<< "done" << endl;

View File

@ -40,6 +40,7 @@ Description
- dx : DX scalar or vector format
- vtk : VTK ascii format
- raw : x y z value format for use with e.g. gnuplot 'splot'.
- obj : Wavefron stl. Does not contain values!
- stl : ascii stl. Does not contain values!
@param interpolationScheme : interpolation scheme, choice of \n

View File

@ -30,6 +30,7 @@ setFormat raw;
// dx : DX scalar or vector format
// vtk : VTK ascii format
// raw : x y z value format for use with e.g. gnuplot 'splot'.
// obj : Wavefront obj. Does not contain values!
// stl : ascii stl. Does not contain values!
surfaceFormat vtk;

View File

@ -34,6 +34,7 @@ Documentation
DebugSwitches
{
Analytical 0;
APIdiffCoefFunc 0;
Ar 0;
BICCG 0;
@ -57,18 +58,25 @@ DebugSwitches
C8H18 0;
C9H20 0;
CH3OH 0;
CallbackRegistry 0;
CH4N2O 0;
CarnahanStarling 0;
CallbackRegistry 0;
CentredFitData<biLinearFitPolynomial> 0;
CentredFitData<linearFitPolynomial> 0;
CentredFitData<quadraticFitPolynomial> 0;
CentredFitData<quadraticLinearFitPolynomial> 0;
ChomiakInjector 0;
Cloud<basicKinematicParcel> 0;
Cloud<basicReactingParcel> 0;
Cloud<basicThermoParcel> 0;
Cloud<indexedParticle> 0;
Cloud<kinematicParcel> 0;
Cloud<parcel> 0;
Cloud<passiveParticle> 0;
Cloud<reactingParcel> 0;
Cloud<thermoParcel> 0;
Cloud<trackedParticle> 0;
CoEuler 0;
CompositionModel 0;
ConeInjection 0;
Constant 0;
ConstantRateDevolatilisation 0;
CrankNicholson 0;
CrossPowerLaw 0;
@ -77,6 +85,7 @@ DebugSwitches
DICGaussSeidel 0;
DILU 0;
DILUGaussSeidel 0;
DataEntry 0;
DeardorffDiffStress 0;
DispersionModel 0;
DispersionRASModel 0;
@ -107,39 +116,40 @@ DebugSwitches
H2O 0;
HashTable 0;
HeatTransferModel 0;
HerschelBulkley 0;
HrenyaSinclair 0;
IC8H18 0;
ICCG 0;
IDDESDelta 0;
IDEA 0;
IFstream 0;
IOMap<dictionary> 0;
IOPtrList<MRFZone> 0;
IOPtrList<coordinateSystem> 0;
IOPtrList<injector> 0;
IOPtrList<porousZone> 0;
IOobject 0;
InjectionModel 0;
IntegrationScheme 0;
JohnsonJackson 0;
KRR4 0;
KinematicCloud<kinematicParcel> 0;
KinematicCloud<reactingParcel> 0;
KinematicCloud<thermoParcel> 0;
KinematicParcel<reactingParcel> 0;
KinematicParcel<thermoParcel> 0;
KinematicCloud<basicKinematicParcel> 0;
KinematicCloud<basicReactingParcel> 0;
KinematicCloud<basicThermoParcel> 0;
KinematicParcel<basicReactingParcel> 0;
KinematicParcel<basicThermoParcel> 0;
LESModel 0;
LESdelta 0;
LESfilter 0;
LESmodel 0;
LISA 0;
LRR 0;
LRRDiffStress 0;
LamBremhorstKE 0;
LaunderGibsonRSTM 0;
LaunderSharmaKE 0;
LduMatrix 1;
LienCubicKE 0;
LienCubicKELowRe 0;
LienLeschzinerLowRe 0;
Lun 0;
LunSavage 0;
MB 0;
MC 0;
MCV 0;
@ -191,11 +201,12 @@ DebugSwitches
QUICK 0;
QUICKV 0;
QZeta 0;
RASModel 0;
RK 0;
RNGkEpsilon 0;
RanzMarshall 0;
ReactingCloud<reactingParcel> 0;
ReactingParcel<reactingParcel> 0;
ReactingCloud<basicReactingParcel> 0;
ReactingParcel<basicReactingParcel> 0;
Rebound 0;
ReitzDiwakar 0;
ReitzKHRT 0;
@ -208,6 +219,8 @@ DebugSwitches
SIBS 0;
SKA 0;
SLTS 0;
SRFModel 0;
SRFVelocity 0;
STARCDRotation 0;
Schaeffer 0;
SchillerNaumann 0;
@ -215,8 +228,9 @@ DebugSwitches
SingleKineticRateDevolatilisation 0;
SingleMixtureFraction 0;
Smagorinsky 0;
SmoothSolver 0;
SpalartAllmaras 0;
SpalartAllmarasDDES 0;
SpalartAllmarasIDDES 0;
SphereDrag 0;
StandardWallInteraction 0;
StaticHashTable 0;
@ -228,13 +242,17 @@ DebugSwitches
SyamlalOBrien 0;
SyamlalRogersOBrien 0;
TAB 0;
ThermoCloud<reactingParcel> 0;
ThermoCloud<thermoParcel> 0;
ThermoParcel<reactingParcel> 0;
ThermoParcel<thermoParcel> 0;
Table 0;
ThermoCloud<basicReactingParcel> 0;
ThermoCloud<basicThermoParcel> 0;
ThermoParcel<basicReactingParcel> 0;
ThermoParcel<basicThermoParcel> 0;
UMIST 0;
UMISTV 0;
Unix 0;
UpwindFitData<cubicUpwindFitPolynomial> 0;
UpwindFitData<quadraticLinearUpwindFitPolynomial> 0;
UpwindFitData<quadraticUpwindFitPolynomial> 0;
WallInteractionModel 0;
WenYu 0;
aC11H10 0;
@ -245,6 +263,9 @@ DebugSwitches
addPoint 0;
advective 0;
algebraicPair 0;
alphaContactAngle 0;
alphaFixedPressure 0;
alphatWallFunction 0;
angularOscillatingDisplacement 0;
angularOscillatingVelocity 0;
anisotropic 0;
@ -252,14 +273,21 @@ DebugSwitches
atomizationModel 0;
attachDetach 0;
autoHexMeshDriver 0;
autoLayerDriver 0;
autoRefineDriver 0;
autoSnapDriver 0;
bC11H10 0;
backward 0;
basePatch 0;
basicKinematicCloud 0;
basicKinematicParcel 0;
basicMixture 0;
basicReactingCloud 0;
basicReactingParcel 0;
basicThermo 0;
basicThermoCloud 0;
basicThermoParcel 0;
biLinearFit 0;
binaryAbsorptionEmission 0;
blended 0;
blobsSheetAtomization 0;
@ -274,7 +302,6 @@ DebugSwitches
boxToPoint 0;
breakupModel 0;
calculated 0;
cartesian 0;
cell 0;
cellClassification 0;
cellCuts 0;
@ -292,6 +319,8 @@ DebugSwitches
cellToFace 0;
cellToPoint 0;
cellZone 0;
centredCECStencil 0;
centredCFCStencil 0;
chemistryReader 0;
chemistrySolver 0;
chemkinReader 0;
@ -304,24 +333,25 @@ DebugSwitches
commSchedule 0;
commonRailInjector 0;
compound 0;
conductivityModel 0;
constInjector 0;
constant 0;
constantAbsorptionEmission 0;
constantGammaContactAngle 0;
constantAlphaContactAngle 0;
constantScatter 0;
coordinateRotation 0;
coordinateSystem 0;
coordinateSystems 0;
corrected 0;
coupled 0;
cubeRootVol 0;
cubic 0;
cubicUpwindFit 0;
curve 0;
cyclic 0;
cyclicLduInterface 0;
cyclicLduInterfaceField 0;
cylinderToCell 0;
cylindrical 0;
dataSchedule 0;
decompositionMethod 0;
definedHollowConeInjector 0;
definedInjector 0;
@ -332,6 +362,7 @@ DebugSwitches
dimensionSet 1;
directMapped 0;
directMappedPatch 0;
directMappedVelocityFlux 0;
directionMixed 0;
directional 0;
disallowDefaultFvsPatchField 0;
@ -345,6 +376,7 @@ DebugSwitches
displacementInterpolation 0;
displacementLaplacian 0;
displacementSBRStress 0;
distanceSurface 0;
downwind 0;
dragModel 0;
duplicatePoints 0;
@ -352,8 +384,8 @@ DebugSwitches
dynMixedSmagorinsky 0;
dynOneEqEddy 0;
dynSmagorinsky 0;
dynamicAlphaContactAngle 0;
dynamicFvMesh 0;
dynamicGammaContactAngle 0;
dynamicInkJetFvMesh 0;
dynamicMotionSolverFvMesh 0;
dynamicRefineFvMesh 0;
@ -363,6 +395,7 @@ DebugSwitches
empty 0;
engineMesh 0;
enrichedPatch 0;
epsilonWallFunction 0;
errorDrivenRefinement 0;
evaporationModel 0;
exponential 0;
@ -387,13 +420,20 @@ DebugSwitches
filteredLinear 0;
filteredLinear2 0;
filteredLinear2V 0;
filteredLinear3 0;
filteredLinear3V 0;
fixedEnthalpy 0;
fixedFluxBuoyantPressure 0;
fixedFluxBoussinesqBuoyantPressure 0;
fixedFluxPressure 0;
fixedGradient 0;
fixedInternalEnergy 0;
fixedInternalValue 0;
fixedNormalSlip 0;
fixedPressureCompressibleDensity 0;
fixedUnburntEnthalpy 0;
fixedValue 0;
flowRateInletVelocity 0;
fluxCorrectedVelocity 0;
foamChemistryReader 0;
foamFile 0;
@ -416,8 +456,6 @@ DebugSwitches
fvTensorMatrix 0;
fvVectorMatrix 0;
fvsPatchField 0;
gammaContactAngle 0;
gammaFixedPressure 0;
general 0;
generic 0;
genericPatch 0;
@ -429,6 +467,7 @@ DebugSwitches
gnuplot 0;
gradientDispersionRAS 0;
gradientEnthalpy 0;
gradientInternalEnergy 0;
gradientUnburntEnthalpy 0;
granularPressureModel 0;
hCombustionThermo 0;
@ -459,25 +498,29 @@ DebugSwitches
hhuMixtureThermo<veryInhomogeneousMixture<sutherlandTransport<specieThermo<janafThermo<perfectGas>>>>> 0;
hierarchical 0;
hollowConeInjector 0;
iC3H8O 0;
indexedOctree 0;
indexedParticle 0;
injectorModel 0;
injectorType 0;
inletOutlet 0;
inletOutletTotalTemperature 0;
inputMode 0;
interfaceCompression 0;
intersectedSurface 0;
inverseDistance 0;
inverseFaceDistance 0;
inversePointDistance 0;
inverseVolume 0;
isoSurface 0;
isoSurfaceCell 0;
jplot 0;
jumpCyclic 0;
kEpsilon 0;
kOmega 0;
kOmegaSST 0;
kOmegaSSTSAS 0;
kQRWallFunction 0;
kinematicCloud 0;
kinematicParcel 0;
labelField 0;
labelList 0;
labelListList 0;
@ -496,6 +539,7 @@ DebugSwitches
leastSquares 0;
leastSquaresVectors 0;
level 2;
limitWith 0;
limited 0;
limitedCubic 0;
limitedCubic01 0;
@ -510,6 +554,7 @@ DebugSwitches
limitedSurfaceInterpolationScheme 0;
limitedVanLeer 0;
linear 0;
linearFit 0;
linearUpwind 0;
linearUpwindV 0;
liquid 0;
@ -520,7 +565,6 @@ DebugSwitches
localPointRegion 0;
lowReOneEqEddy 0;
manual 0;
massFlowRateInletVelocity 0;
meshCutAndRemove 0;
meshCutter 0;
meshModifier 0;
@ -532,6 +576,7 @@ DebugSwitches
midPointAndFace 0;
mixed 0;
mixedEnthalpy 0;
mixedInternalEnergy 0;
mixedSmagorinsky 0;
mixedUnburntEnthalpy 0;
mixerFvMesh 0;
@ -544,22 +589,32 @@ DebugSwitches
motionSolver 0;
movingConeTopoFvMesh 0;
movingWallVelocity 0;
muSgsWallFunction 0;
muSgsSpalartAllmarasWallFunction 0;
multiDirRefinement 0;
multiHoleInjector 0;
multivariateSelection 0;
mutStandardRoughWallFunction 0;
mutRoughWallFunction 0;
mutSpalartAllmarasStandardRoughWallFunction 0;
mutSpalartAllmarasStandardWallFunction 0;
mutSpalartAllmarasWallFunction 0;
mutWallFunction 0;
nC3H8O 0;
nbrToCell 0;
nearestToCell 0;
nearestToPoint 0;
noAbsorptionEmission 0;
noDragModel 0;
noRadiation 0;
none 0;
normal 0;
normalToFace 0;
nuSgsWallFunction 0;
nutStandardRoughWallFunction 0;
nutStandardWallFunction 0;
nuSgsSpalartAllmarasWallFunction 0;
nutRoughWallFunction 0;
nutSpalartAllmarasStandardRoughWallFunction 0;
nutSpalartAllmarasStandardWallFunction 0;
nutSpalartAllmarasWallFunction 0;
nutWallFunction 0;
obj 0;
objectRegistry 0;
octree 0;
octreeDataEdges 0;
@ -567,7 +622,7 @@ DebugSwitches
octreeDataFaceList 0;
octreeDataTriSurface 0;
off 0;
offsetTriSurfaceMesh 0;
omegaWallFunction 0;
oneEqEddy 0;
orientedSurface 0;
oscillatingDisplacement 0;
@ -609,11 +664,13 @@ DebugSwitches
polyMeshInfo 0;
polyTopoChange 0;
polyTopoChanger 0;
powerLaw 0;
pressureDirectedInletOutletVelocity 0;
pressureDirectedInletVelocity 0;
pressureInletOutletVelocity 0;
pressureInletUniformVelocity 0;
pressureInletVelocity 0;
pressureNormalInletOutletVelocity 0;
pressureSwirlInjector 0;
primitiveMesh 0;
primitiveMeshGeometry 0;
@ -625,11 +682,13 @@ DebugSwitches
pureMixture<sutherlandTransport<specieThermo<hConstThermo<perfectGas>>>> 0;
pureMixture<sutherlandTransport<specieThermo<janafThermo<perfectGas>>>> 0;
quadratic 0;
radialModel 0;
quadraticFit 0;
quadraticLinearFit 0;
quadraticLinearUpwindFit 0;
quadraticUpwindFit 0;
radiationModel 0;
raw 0;
reactingCloud 0;
reactingParcel 0;
reaction 0;
realizableKE 0;
refinementHistory 0;
@ -637,6 +696,7 @@ DebugSwitches
reflect 0;
regIOobject 0;
regionSplit 0;
regionToCell 0;
remove 0;
removeCell 0;
removeCells 0;
@ -720,11 +780,12 @@ DebugSwitches
tensorAverageField 0;
tensorField 0;
thermoCloud 0;
thermoParcel 0;
thermophysicalFunction 0;
time 0;
timeVaryingGammaContactAngle 0;
timeVaryingAlphaContactAngle 0;
timeVaryingFlowRateInletVelocity 0;
timeVaryingMappedFixedValue 0;
timeVaryingTotalPressure 0;
timeVaryingUniformFixedValue 0;
timer 0;
topoAction 0;
@ -745,17 +806,19 @@ DebugSwitches
treeNode 0;
triSurface 0;
triSurfaceMesh 0;
triSurfaceMeshes 0;
turbulenceModel 0;
turbulentHeatFluxTemperature 0;
turbulentInlet 0;
turbulentIntensityKineticEnergyInlet 0;
turbulentMixingLengthDissipationRateInlet 0;
turbulentMixingLengthFrequencyInlet 0;
uncorrected 0;
undoableMeshCutter 0;
uniform 0;
uniformFixedValue 0;
unitInjector 0;
upwind 0;
upwindCFCStencil 0;
value 0;
vanAlbada 0;
vanAlbadaV 0;
@ -817,31 +880,30 @@ DimensionedConstants
// SI units
//- Universal gas constant [J/(kmol K)]
R 8314.51;
R 8314.51;
//- Standard pressure [Pa]
Pstd 1.0e5;
Pstd 1.0e5;
//- Standard temperature [K]
Tstd 298.15;
Tstd 298.15;
//- Stefan-Boltzmann constant [J/(K4 m2 s)]
sigmaSB sigmaSB [1 0 -3 -4 0 0 0] 5.670e-08;
sigmaSB sigmaSB [1 0 -3 -4 0 0 0] 5.670e-08;
/* USCS units
//- Universal gas constant [lbm ft2/(s2 kmol R)]
R 3406.78;
R 3406.78;
//- Standard pressure [lbm/(ft2)]
Pstd 2088.6;
Pstd 2088.6;
//- Standard temperature [degR]
Tstd 536.67;
Tstd 536.67;
//- Stefan-Boltzmann constant [lbm /(degR4 ft s)]
sigmaSB sigmaSB [1 0 -3 -4 0 0 0] 8.2292e-08;
sigmaSB sigmaSB [1 0 -3 -4 0 0 0] 8.2292e-08;
*/
}

View File

@ -41,6 +41,7 @@ $(surfWriters)/dx/dxSurfaceWriterRunTime.C
$(surfWriters)/foamFile/foamFileSurfaceWriterRunTime.C
$(surfWriters)/null/nullSurfaceWriterRunTime.C
$(surfWriters)/raw/rawSurfaceWriterRunTime.C
$(surfWriters)/obj/objSurfaceWriterRunTime.C
$(surfWriters)/stl/stlSurfaceWriterRunTime.C
$(surfWriters)/vtk/vtkSurfaceWriterRunTime.C

View File

@ -0,0 +1,120 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
\*---------------------------------------------------------------------------*/
#include "objSurfaceWriter.H"
#include "fileName.H"
#include "OFstream.H"
#include "faceList.H"
#include "OSspecific.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
Foam::objSurfaceWriter<Type>::objSurfaceWriter()
:
surfaceWriter<Type>()
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class Type>
Foam::objSurfaceWriter<Type>::~objSurfaceWriter()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
void Foam::objSurfaceWriter<Type>::write
(
const fileName& samplePath,
const fileName& timeDir,
const fileName& surfaceName,
const pointField& points,
const faceList& faces,
const fileName& fieldName,
const Field<Type>& values,
const bool verbose
) const
{
fileName surfaceDir(samplePath/timeDir);
if (!isDir(surfaceDir))
{
mkDir(surfaceDir);
}
fileName fName(surfaceDir/surfaceName + ".obj");
if (verbose)
{
Info<< "Writing field " << fieldName << " to " << fName << endl;
}
// this is a quick hack
OFstream os(fName);
os << "# Wavefront OBJ file" << nl
<< "o " << os.name().lessExt().name() << nl
<< nl
<< "# points : " << points.size() << nl
<< "# faces : " << faces.size() << nl
<< "# no zones " << nl;
os << nl
<< "# <points count=\"" << points.size() << "\">" << endl;
// Write vertex coords
forAll(points, ptI)
{
os << "v " << points[ptI].x()
<< ' ' << points[ptI].y()
<< ' ' << points[ptI].z() << nl;
}
os << "# </points>" << nl
<< nl
<< "# <faces count=\"" << faces.size() << "\">" << endl;
forAll(faces, i)
{
const face& f = faces[i];
os << 'f';
forAll(f, fp)
{
os << ' ' << f[fp] + 1;
}
os << nl;
}
os << "# </faces>" << endl;
}
// ************************************************************************* //

View File

@ -0,0 +1,105 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::objSurfaceWriter
Description
SourceFiles
objSurfaceWriter.C
\*---------------------------------------------------------------------------*/
#ifndef objSurfaceWriter_H
#define objSurfaceWriter_H
#include "surfaceWriter.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class objSurfaceWriter Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
class objSurfaceWriter
:
public surfaceWriter<Type>
{
public:
//- Runtime type information
TypeName("obj");
// Constructors
//- Construct null
objSurfaceWriter();
// Destructor
virtual ~objSurfaceWriter();
// Member Functions
// Write
//- Writes single surface to file.
virtual void write
(
const fileName& samplePath,
const fileName& timeDir,
const fileName& surfaceName,
const pointField& points,
const faceList& faces,
const fileName& fieldName,
const Field<Type>& values,
const bool verbose = false
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "objSurfaceWriter.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,44 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
\*---------------------------------------------------------------------------*/
#include "objSurfaceWriter.H"
#include "surfaceWriters.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
makeSurfaceWriters(objSurfaceWriter);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -69,7 +69,7 @@ void Foam::stlSurfaceWriter<Type>::write
mkDir(surfaceDir);
}
fileName fName(surfaceDir/fieldName + '_' + surfaceName + ".stl");
fileName fName(surfaceDir/surfaceName + ".stl");
if (verbose)
{

View File

@ -19,7 +19,33 @@ interpolationScheme cellPointFace;
writeFormat raw;
sampleSets ( face { name cone25 ; axis x ; start ( 0 0 0 ) ; end ( 0.09208087 0.042939 0 ) ; nPoints 92 ; } face { name cone55 ; axis x ; start ( 0.09208087 0.042939 0 ) ; end ( 0.153683 0.13092 0 ) ; nPoints 61 ; } face { name base ; axis x ; start ( 0.153683 0.13092 0 ) ; end ( 0.193675 0.13092 0 ) ; nPoints 40 ; } );
sampleSets
(
face
{
name cone25;
axis x;
start ( 0 0 0 );
end ( 0.09208087 0.042939 0 );
nPoints 92;
}
face
{
name cone55;
axis x;
start ( 0.09208087 0.042939 0 );
end ( 0.153683 0.13092 0 );
nPoints 61;
}
face
{
name base;
axis x;
start ( 0.153683 0.13092 0 );
end ( 0.193675 0.13092 0 );
nPoints 40;
}
);
fields ( p wallHeatTransRate );

View File

@ -21,7 +21,33 @@ setFormat raw;
surfaceFormat vtk;
sets ( cone25 { type face ; axis x ; start ( 0 0 0 ) ; end ( 0.09208087 0.042939 0 ) ; nPoints 92 ; } cone55 { type face ; axis x ; start ( 0.09208087 0.042939 0 ) ; end ( 0.153683 0.13092 0 ) ; nPoints 61 ; } base { type face ; axis x ; start ( 0.153683 0.13092 0 ) ; end ( 0.193675 0.13092 0 ) ; nPoints 40 ; } );
sets
(
cone25
{
type face;
axis x;
start ( 0 0 0 );
end ( 0.09208087 0.042939 0 );
nPoints 92;
}
cone55
{
type face;
axis x;
start ( 0.09208087 0.042939 0 );
end ( 0.153683 0.13092 0 );
nPoints 61;
}
base
{
type face;
axis x;
start ( 0.153683 0.13092 0 );
end ( 0.193675 0.13092 0 );
nPoints 40;
}
);
surfaces ( );

View File

@ -21,9 +21,19 @@ setFormat raw;
surfaceFormat vtk;
sets ( line { type face ; axis x ; start ( -5 0 0 ) ; end ( 5 0 0 ) ; nPoints 100 ; } );
sets
(
line
{
type face;
axis x;
start ( -5 0 0 );
end ( 5 0 0 );
nPoints 100;
}
);
surfaces ( );
surfaces ();
fields ( p U.component(0) T rho );

View File

@ -19,9 +19,19 @@ interpolationScheme cellPoint;
setFormat raw;
sets ( data { type uniform ; axis x ; start ( -4.995 0 0 ) ; end ( 4.995 0 0 ) ; nPoints 1000 ; } );
sets
(
data
{
type uniform;
axis x;
start ( -4.995 0 0 );
end ( 4.995 0 0 );
nPoints 1000;
}
);
surfaces ( );
surfaces ();
fields ( T magU p );

View File

@ -19,9 +19,19 @@ interpolationScheme cellPoint;
setFormat raw;
sets ( data { type uniform ; axis x ; start ( -4.995 0 0 ) ; end ( 4.995 0 0 ) ; nPoints 1000 ; } );
sets
(
data
{
type uniform;
axis x;
start ( -4.995 0 0 );
end ( 4.995 0 0 );
nPoints 1000;
}
);
surfaces ( );
surfaces ();
fields ( T magU p );

View File

@ -19,9 +19,19 @@ interpolationScheme cellPoint;
setFormat raw;
sets ( line_centreProfile { type uniform ; axis distance ; start ( 10.001 -1 0.01 ) ; end ( 10.001 1 0.01 ) ; nPoints 100 ; } );
sets
(
line_centreProfile
{
type uniform;
axis distance;
start ( 10.001 -1 0.01 );
end ( 10.001 1 0.01 );
nPoints 100;
}
);
surfaces ( );
surfaces ();
fields ( Ux );

View File

@ -19,9 +19,19 @@ interpolationScheme cellPoint;
setFormat raw;
sets ( leftPatch { type uniform ; axis y ; start ( 0 0.5 0.25 ) ; end ( 0 2 0.25 ) ; nPoints 100 ; } );
sets
(
leftPatch
{
type uniform;
axis y;
start ( 0 0.5 0.25 );
end ( 0 2 0.25 );
nPoints 100;
}
);
surfaces ( );
surfaces ();
fields ( sigmaxx );