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

This commit is contained in:
andy
2011-02-24 17:23:56 +00:00
364 changed files with 51828 additions and 6090 deletions

View File

@ -35,43 +35,44 @@
*** Core library *** Core library
+ Large number of code refinements and consistency improvements to support + Large number of code refinements and consistency improvements to support
other developments. other developments.
Parallel : using non-blocking communications wherever possible. This will + Parallel : using non-blocking communications wherever possible. This will
lead to lower requirements for MPI_BUFFER_SIZE and possibly better lead to lower requirements for MPI_BUFFER_SIZE and possibly better
start-up performance on larger numbers of processors. start-up performance on larger numbers of processors.
*** Turbulence modelling *** Turbulence modelling
*** *Updated* thermophysical libraries *** *Updated* thermophysical libraries
+ Now use the more descriptive dictionary input format, e.g. for a single + Now use the more descriptive dictionary input format, e.g. for a single
component mixture: component mixture:
#+BEGIN_SRC c++
thermoType hPsiThermo<pureMixture<sutherlandTransport<specieThermo<hConstThermo<perfectGas>>>>>;
thermoType hPsiThermo<pureMixture<sutherlandTransport<specieThermo<hConstThermo<perfectGas>>>>>; mixture
{
mixture nMoles 1;
{ molWeight 28.9;
nMoles 1; Cp 1007;
molWeight 28.9; Hf 0;
Cp 1007; As 1.4792e-06;
Hf 0; Ts 116;
As 1.4792e-06; }
Ts 116; #+END_SRC
}
*** Lagrangian intermediate library *** Lagrangian intermediate library
Extensively updated + Extensively updated
*Updated* input format + *Updated* input format
Extended to include steady cloud tracking + Extended to include steady cloud tracking
*New* collision modelling + *New* collision modelling
*Coupled* to new surface film modelling library + *Coupled* to new surface film modelling library
*New* sub-models + *New* sub-models
+ NonSphereDrag: drag model to account for non-spherical particles + NonSphereDrag: drag model to account for non-spherical particles
+ ParticleTracks: post-processing model to generate track data, typically + ParticleTracks: post-processing model to generate track data, typically
during steady calculations during steady calculations
*Updated* sub-models + *Updated* sub-models
+ Devolatilisation models: now act on a per-specie basis + Devolatilisation models: now act on a per-specie basis
*** DSMC *** DSMC
*** Dynamic Mesh *** Dynamic Mesh
*** Numerics *** Numerics
*** *Updated* command line help, e.g. `snappyHexMesh -help' now gives: *** *Updated* command line help, e.g. `snappyHexMesh -help' now gives:
#+BEGIN_SRC c++
Usage: snappyHexMesh [OPTIONS] Usage: snappyHexMesh [OPTIONS]
options: options:
-case <dir> specify alternate case directory, default is the cwd -case <dir> specify alternate case directory, default is the cwd
@ -80,12 +81,13 @@
-srcDoc display source code in browser -srcDoc display source code in browser
-doc display application documentation in browser -doc display application documentation in browser
-help print the usage -help print the usage
#+END_SRC
*** *New* basicSolidThermo solids thermophysical library *** *New* basicSolidThermo solids thermophysical library
+ Used in all conjugate heat transfer solvers + Used in all conjugate heat transfer solvers
+ constant properties + constant properties
+ temperature dependent properties + temperature dependent properties
+ temperature and direction (in local coordinate system) dependent properties + temperature and direction (in local coordinate system) dependent
properties
*** *New* Surface film library *** *New* Surface film library
+ Creation of films by particle addition, or initial film distribution + Creation of films by particle addition, or initial film distribution
+ Coupled with the lagrangian/intermediate cloud hierarchy library + Coupled with the lagrangian/intermediate cloud hierarchy library
@ -113,13 +115,16 @@
polyPatches holding data can map the data. polyPatches holding data can map the data.
*** *Updated* particle tracking algorithm *** *Updated* particle tracking algorithm
+ uses non-blocking parallel transfers + uses non-blocking parallel transfers
+ does 'minimum-tet' decomposition of face to work with warped faces (snappyHexMesh!) + does 'minimum-tet' decomposition of face to work with warped faces
(snappyHexMesh!)
+ reuses tracking state in interpolation - improves consistency and speed + reuses tracking state in interpolation - improves consistency and speed
*** *Updated* split cyclics into two separate patches. See doc/changed/splitCyclics.txt *** *Updated* split cyclics into two separate patches.
See [[./doc/changes/splitCyclic.txt]]
* *Updated* interpolation (volPointInterpolation) now works without the * *Updated* interpolation (volPointInterpolation) now works without the
globalPointPatch. Moving mesh cases can now be run non-parallel and globalPointPatch. Moving mesh cases can now be run non-parallel and
continued in parallel and reconstructed without any limitation. continued in parallel and reconstructed without any limitation.
*** *New* compact binary I/O for faces and cells. This speeds up reading/writing meshes in binary. *** *New* compact binary I/O for faces and cells.
This speeds up reading/writing meshes in binary.
*** *Updated* runTimeModifiable *** *Updated* runTimeModifiable
+ user selectable model to use for checking run-time modifiable + user selectable model to use for checking run-time modifiable
dictionaries (see also doc/changes/inotify.txt): dictionaries (see also doc/changes/inotify.txt):
@ -129,11 +134,34 @@
contents from master. contents from master.
+ inotifyMaster : only master checks and reads file. Slaves get file + inotifyMaster : only master checks and reads file. Slaves get file
contents from master. contents from master.
+ on linux optionally uses inotify instead of time stamps - more efficient for large + on linux optionally uses inotify instead of time stamps - more efficient
numbers of monitored files. No more fileModificationSkew needed. for large numbers of monitored files. No more fileModificationSkew needed.
+ single integer reduction instead of one reduction per monitored file. + single integer reduction instead of one reduction per monitored file.
+ only files that can be re-read are being checked. Drastic reduction of + only files that can be re-read are being checked. Drastic reduction of
number of files to check. number of files to check.
*** *New* #codeStream dictionary entry
Uses on-the-fly compilation of OpenFOAM C++ code to construct dictionary.
E.g. in blockMeshDict:
#+BEGIN_SRC c++
convertToMeters 0.001;
vertices #codeStream
{
code
#{
label nVerts =
readLabel(dict.lookup("nx"))
*readLabel(dict.lookup("ny"))
*readLabel(dict.lookup("nz"));
pointField verts(nVerts);
// Now fill verts here
// ..
os << verts;
#};
}
#+END_SRC
See also ./[[doc/changes/codeStream.org]]
* Solvers * Solvers
A number of new solvers have been developed for a range of engineering A number of new solvers have been developed for a range of engineering
applications. There has been a set of improvements to certain classes of applications. There has been a set of improvements to certain classes of
@ -163,6 +191,23 @@
+ takes optional fieldName to sample + takes optional fieldName to sample
+ directMapped patch added 'normal' method to calculate sample points + directMapped patch added 'normal' method to calculate sample points
to e.g. sample fields just above wall (e.g. for streaklines) to e.g. sample fields just above wall (e.g. for streaklines)
+ *New* codedFixedValue: Uses the on-the-fly code compilation from #codeStream
to provide an in-line fixedValueFvPatchScalarField. E.g.
#+BEGIN_SRC c++
outlet
{
type codedFixedValue<scalar>;
value uniform 0;
redirectType fixedValue10;
code
#{
operator==(min(10, 0.1*this->db().time().value()));
#};
}
#+END_SRC
See also [[./doc/changes/codeStream.org]]
* Utilities * Utilities
There have been some utilities added and updated in this release. There have been some utilities added and updated in this release.
*** *New* utilities *** *New* utilities
@ -182,20 +227,24 @@
+ =topoSet=: replacement of cellSet,faceSet,pointSet utilities. + =topoSet=: replacement of cellSet,faceSet,pointSet utilities.
Comparable to a dictionary driven =setSet= utility. Comparable to a dictionary driven =setSet= utility.
*** Updated utilities *** Updated utilities
+ =setFields=: optionally use faceSets to set patch values (see e.g. hotRoom tutorial). + =setFields=: optionally use faceSets to set patch values (see
e.g. =hotRoom= tutorial).
+ =blockMesh=: specify patches via dictionary instead of type only. This + =blockMesh=: specify patches via dictionary instead of type only. This
makes rereading the boundary file superfluous. see makes rereading the boundary file superfluous. see
e.g. pitzDailyDirectMapped tutorial. e.g. pitzDailyDirectMapped tutorial.
+ =setSet=: allows time range (e.g. 0:100) in combination with -batch argument + =setSet=: allows time range (e.g. 0:100) in combination with -batch
to execute the commands for multiple times. argument to execute the commands for multiple times.
+ =extrudeMesh=: + =extrudeMesh=:
- option to add extrusion to existing mesh. - option to add extrusion to existing mesh.
- works in parallel - works in parallel
+ =snappyHexMesh=:
+ extrude across multi-processor boundaries
+ preserve faceZones during layering
* Post-processing * Post-processing
+ =paraFoam=, =foamToVTK=: full support for polyhedral cell type in recent + =paraFoam=, =foamToVTK=: full support for polyhedral cell type in recent
Paraview versions. Paraview versions.
+ =foamToEnsight=: parallel continuous data. new =-nodeValues= option to generate and output nodal + =foamToEnsight=: parallel continuous data. new =-nodeValues= option to
field data. generate and output nodal field data.
+ =singleCellMesh=: new utility to convert mesh and fields to a single cell + =singleCellMesh=: new utility to convert mesh and fields to a single cell
mesh. Great for postprocessing. mesh. Great for postprocessing.
+ =steadyParticleTracks=: Generates VTK tracks from the output of the cloud + =steadyParticleTracks=: Generates VTK tracks from the output of the cloud
@ -229,3 +278,7 @@
+ multipleBoxes, hotBoxes, panel, evaporationTest + multipleBoxes, hotBoxes, panel, evaporationTest
+ =interDyMFoam= tutorials: + =interDyMFoam= tutorials:
+ testTubeMixer: showcases =solidBodyMotionFunction= + testTubeMixer: showcases =solidBodyMotionFunction=
* Other
+ compilable with =clang=
In your prefs.sh set the WM_COMPILER to Clang

View File

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

View File

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

View File

@ -1,24 +0,0 @@
// Solve the Momentum equation
tmp<fvVectorMatrix> UEqn
(
fvm::div(phi, U)
+ turbulence->divDevRhoReff(U)
);
UEqn().relax();
solve
(
UEqn()
==
rho*g
- fvc::grad(p)
/*
fvc::reconstruct
(
fvc::interpolate(rho)*(g & mesh.Sf())
- fvc::snGrad(p)*mesh.magSf()
)
*/
);

View File

@ -1,69 +0,0 @@
Info<< "Reading thermophysical properties\n" << endl;
autoPtr<basicPsiThermo> pThermo
(
basicPsiThermo::New(mesh)
);
basicPsiThermo& thermo = pThermo();
volScalarField rho
(
IOobject
(
"rho",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_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"
Info<< "Creating turbulence model\n" << endl;
autoPtr<compressible::RASModel> turbulence
(
compressible::RASModel::New
(
rho,
U,
phi,
thermo
)
);
thermo.correct();
label pRefCell = 0;
scalar pRefValue = 0.0;
setRefCell
(
p,
mesh.solutionDict().subDict("SIMPLE"),
pRefCell,
pRefValue
);
dimensionedScalar initialMass = fvc::domainIntegrate(rho);

View File

@ -1,17 +0,0 @@
{
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))
- p*fvc::div(phi/fvc::interpolate(rho))
);
hEqn.relax();
hEqn.solve();
thermo.correct();
}

View File

@ -1,59 +0,0 @@
{
rho = thermo.rho();
volScalarField rAU(1.0/UEqn().A());
surfaceScalarField rhorAUf("(rho*(1|A(U)))", fvc::interpolate(rho*rAU));
U = rAU*UEqn().H();
UEqn.clear();
phi = fvc::interpolate(rho)*(fvc::interpolate(U) & mesh.Sf());
bool closedVolume = adjustPhi(phi, U, p);
surfaceScalarField buoyancyPhi
(
rhorAUf*fvc::interpolate(rho)*(g & mesh.Sf())
);
phi += buoyancyPhi;
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
fvScalarMatrix pEqn
(
fvm::laplacian(rhorAUf, p) == fvc::div(phi)
);
pEqn.setReference(pRefCell, pRefValue);
pEqn.solve();
if (nonOrth == nNonOrthCorr)
{
// 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);
}
// Calculate the conservative fluxes
phi -= pEqn.flux();
// Explicitly relax pressure for momentum corrector
p.relax();
// Correct the momentum source with the pressure gradient flux
// calculated from the relaxed pressure
U += rAU*(rho*g - fvc::grad(p));
//U += rAU*fvc::reconstruct((buoyancyPhi - pEqn.flux())/rhorAUf);
U.correctBoundaryConditions();
}
}
#include "continuityErrs.H"
rho = thermo.rho();
rho.relax();
Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value()
<< endl;
}

View File

@ -2,6 +2,7 @@
cd ${0%/*} || exit 1 # run from this directory cd ${0%/*} || exit 1 # run from this directory
set -x set -x
wclean libso coupledDerivedFvPatchFields
wclean wclean
wclean chtMultiRegionSimpleFoam wclean chtMultiRegionSimpleFoam

View File

@ -2,6 +2,7 @@
cd ${0%/*} || exit 1 # run from this directory cd ${0%/*} || exit 1 # run from this directory
set -x set -x
wmake libso coupledDerivedFvPatchFields
wmake wmake
wmake chtMultiRegionSimpleFoam wmake chtMultiRegionSimpleFoam

View File

@ -1,5 +1,3 @@
derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C
fluid/compressibleCourantNo.C fluid/compressibleCourantNo.C
solid/solidRegionDiffNo.C solid/solidRegionDiffNo.C

View File

@ -7,7 +7,8 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basicSolidThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basicSolidThermo/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude
EXE_LIBS = \ EXE_LIBS = \
-lbasicThermophysicalModels \ -lbasicThermophysicalModels \
@ -17,4 +18,6 @@ EXE_LIBS = \
-lcompressibleRASModels \ -lcompressibleRASModels \
-lcompressibleLESModels \ -lcompressibleLESModels \
-lmeshTools \ -lmeshTools \
-lfiniteVolume -lfiniteVolume \
-lradiationModels \
-lcoupledDerivedFvPatchFields

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) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -38,6 +38,7 @@ Description
#include "compressibleCourantNo.H" #include "compressibleCourantNo.H"
#include "solidRegionDiffNo.H" #include "solidRegionDiffNo.H"
#include "basicSolidThermo.H" #include "basicSolidThermo.H"
#include "radiationModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -1,7 +1,5 @@
EXE_INC = \ EXE_INC = \
/* -DFULLDEBUG -O0 -g */ \
-I.. \ -I.. \
-I../derivedFvPatchFields \
-Ifluid \ -Ifluid \
-Isolid \ -Isolid \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
@ -9,6 +7,7 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basicSolidThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basicSolidThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
-I$(LIB_SRC)/turbulenceModels \ -I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude -I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude
@ -20,4 +19,6 @@ EXE_LIBS = \
-lspecie \ -lspecie \
-lcompressibleTurbulenceModel \ -lcompressibleTurbulenceModel \
-lcompressibleRASModels \ -lcompressibleRASModels \
-lcompressibleLESModels -lcompressibleLESModels \
-lradiationModels \
-lcoupledDerivedFvPatchFields

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) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -35,6 +35,7 @@ Description
#include "fixedGradientFvPatchFields.H" #include "fixedGradientFvPatchFields.H"
#include "regionProperties.H" #include "regionProperties.H"
#include "basicSolidThermo.H" #include "basicSolidThermo.H"
#include "radiationModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -9,6 +9,7 @@
PtrList<volScalarField> p_rghFluid(fluidRegions.size()); PtrList<volScalarField> p_rghFluid(fluidRegions.size());
PtrList<volScalarField> ghFluid(fluidRegions.size()); PtrList<volScalarField> ghFluid(fluidRegions.size());
PtrList<surfaceScalarField> ghfFluid(fluidRegions.size()); PtrList<surfaceScalarField> ghfFluid(fluidRegions.size());
PtrList<radiation::radiationModel> radiation(fluidRegions.size());
List<scalar> initialMassFluid(fluidRegions.size()); List<scalar> initialMassFluid(fluidRegions.size());
List<label> pRefCellFluid(fluidRegions.size(),0); List<label> pRefCellFluid(fluidRegions.size(),0);
@ -168,6 +169,12 @@
// Force p_rgh to be consistent with p // Force p_rgh to be consistent with p
p_rghFluid[i] = thermoFluid[i].p() - rhoFluid[i]*ghFluid[i]; p_rghFluid[i] = thermoFluid[i].p() - rhoFluid[i]*ghFluid[i];
radiation.set
(
i,
radiation::radiationModel::New(thermoFluid[i].T())
);
initialMassFluid[i] = fvc::domainIntegrate(rhoFluid[i]).value(); initialMassFluid[i] = fvc::domainIntegrate(rhoFluid[i]).value();
setRefCell setRefCell

View File

@ -7,6 +7,7 @@
== ==
fvc::div(phi/fvc::interpolate(rho), rho/psi, "div(U,p)") fvc::div(phi/fvc::interpolate(rho), rho/psi, "div(U,p)")
- (rho/psi)*fvc::div(phi/fvc::interpolate(rho)) - (rho/psi)*fvc::div(phi/fvc::interpolate(rho))
+ rad.Sh(thermo)
); );
hEqn.relax(); hEqn.relax();
@ -15,6 +16,8 @@
thermo.correct(); thermo.correct();
rad.correct();
Info<< "Min/max T:" << min(thermo.T()).value() << ' ' Info<< "Min/max T:" << min(thermo.T()).value() << ' '
<< max(thermo.T()).value() << endl; << max(thermo.T()).value() << endl;
} }

View File

@ -19,6 +19,8 @@
initialMassFluid[i] initialMassFluid[i]
); );
radiation::radiationModel& rad = radiation[i];
const label pRefCell = pRefCellFluid[i]; const label pRefCell = pRefCellFluid[i];
const scalar pRefValue = pRefValueFluid[i]; const scalar pRefValue = pRefValueFluid[i];

View File

@ -0,0 +1,4 @@
turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.C
externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C
LIB = $(FOAM_LIBBIN)/libcoupledDerivedFvPatchFields

View File

@ -0,0 +1,12 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basicSolidThermo/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude
EXE_LIBS = \
-lmeshTools \
-lbasicThermophysicalModels \
-lfiniteVolume \
-lradiationModels

View File

@ -0,0 +1,271 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2011 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 3 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, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "externalWallHeatFluxTemperatureFvPatchScalarField.H"
#include "addToRunTimeSelectionTable.H"
#include "fvPatchFieldMapper.H"
#include "volFields.H"
#include "directMappedPatchBase.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
template<>
const char*
NamedEnum
<externalWallHeatFluxTemperatureFvPatchScalarField::operationMode, 3>::names[]=
{
"fixed_heat_flux",
"fixed_heat_transfer_coefficient",
"unknown"
};
const NamedEnum
<
externalWallHeatFluxTemperatureFvPatchScalarField::operationMode, 3
>
externalWallHeatFluxTemperatureFvPatchScalarField::operationModeNames;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::externalWallHeatFluxTemperatureFvPatchScalarField::
externalWallHeatFluxTemperatureFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF
)
:
mixedFvPatchScalarField(p, iF),
temperatureCoupledBase(patch(), "undefined", "undefined-K"),
oldMode_(unknown),
q_(p.size(), 0.0),
h_(p.size(), 0.0),
Ta_(p.size(), 0.0)
{
this->refValue() = 0.0;
this->refGrad() = 0.0;
this->valueFraction() = 1.0;
}
Foam::externalWallHeatFluxTemperatureFvPatchScalarField::
externalWallHeatFluxTemperatureFvPatchScalarField
(
const externalWallHeatFluxTemperatureFvPatchScalarField& ptf,
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
mixedFvPatchScalarField(ptf, p, iF, mapper),
temperatureCoupledBase(patch(), ptf.KMethod(), ptf.KName()),
oldMode_(unknown),
q_(ptf.q_, mapper),
h_(ptf.h_, mapper),
Ta_(ptf.Ta_, mapper)
{}
Foam::externalWallHeatFluxTemperatureFvPatchScalarField::
externalWallHeatFluxTemperatureFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const dictionary& dict
)
:
mixedFvPatchScalarField(p, iF),
temperatureCoupledBase(patch(), dict),
oldMode_(unknown),
q_(p.size(), 0.0),
h_(p.size(), 0.0),
Ta_(p.size(), 0.0)
{
if (dict.found("q") && !dict.found("h") && !dict.found("Ta"))
{
oldMode_ = fixedHeatFlux;
q_ = scalarField("q", dict, p.size());
}
else if(dict.found("h") && dict.found("Ta") && !dict.found("q"))
{
oldMode_ = fixedHeatTransferCoeff;
h_ = scalarField("h", dict, p.size());
Ta_ = scalarField("Ta", dict, p.size());
}
else
{
FatalErrorIn
(
"externalWallHeatFluxTemperatureFvPatchScalarField::"
"externalWallHeatFluxTemperatureFvPatchScalarField\n"
"(\n"
" const fvPatch& p,\n"
" const DimensionedField<scalar, volMesh>& iF,\n"
" const dictionary& dict\n"
")\n"
) << "\n patch type '" << p.type()
<< "' either q or h and Ta were not found '"
<< "\n for patch " << p.name()
<< " of field " << dimensionedInternalField().name()
<< " in file " << dimensionedInternalField().objectPath()
<< exit(FatalError);
}
fvPatchScalarField::operator=(scalarField("value", dict, p.size()));
if (dict.found("refValue"))
{
// Full restart
refValue() = scalarField("refValue", dict, p.size());
refGrad() = scalarField("refGradient", dict, p.size());
valueFraction() = scalarField("valueFraction", dict, p.size());
}
else
{
// Start from user entered data. Assume fixedValue.
refValue() = *this;
refGrad() = 0.0;
valueFraction() = 1.0;
}
}
Foam::externalWallHeatFluxTemperatureFvPatchScalarField::
externalWallHeatFluxTemperatureFvPatchScalarField
(
const externalWallHeatFluxTemperatureFvPatchScalarField& tppsf
)
:
mixedFvPatchScalarField(tppsf),
temperatureCoupledBase(tppsf),
oldMode_(unknown),
q_(tppsf.q_),
h_(tppsf.h_),
Ta_(tppsf.Ta_)
{}
Foam::externalWallHeatFluxTemperatureFvPatchScalarField::
externalWallHeatFluxTemperatureFvPatchScalarField
(
const externalWallHeatFluxTemperatureFvPatchScalarField& tppsf,
const DimensionedField<scalar, volMesh>& iF
)
:
mixedFvPatchScalarField(tppsf, iF),
temperatureCoupledBase(patch(), tppsf.KMethod(), tppsf.KName()),
oldMode_(tppsf.oldMode_),
q_(tppsf.q_),
h_(tppsf.h_),
Ta_(tppsf.Ta_)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs()
{
if (updated())
{
return;
}
if(oldMode_ == fixedHeatFlux)
{
this->refGrad() = q_/K(*this);
this->refValue() = 0.0;
this->valueFraction() = 0.0;
}
else if(oldMode_ == fixedHeatTransferCoeff)
{
this->refGrad() = (Ta_ - *this)*h_/K(*this);
this->refValue() = 0.0;
this->valueFraction() = 0.0;
}
else
{
FatalErrorIn
(
"externalWallHeatFluxTemperatureFvPatchScalarField"
"::updateCoeffs()"
) << "Illegal mode " << operationModeNames[oldMode_]
<< exit(FatalError);
}
mixedFvPatchScalarField::updateCoeffs();
if (debug)
{
scalar Q = gSum(K(*this)*patch().magSf()*snGrad());
Info<< patch().boundaryMesh().mesh().name() << ':'
<< patch().name() << ':'
<< this->dimensionedInternalField().name() << " :"
<< " heatFlux:" << Q
<< " walltemperature "
<< " min:" << gMin(*this)
<< " max:" << gMax(*this)
<< " avg:" << gAverage(*this)
<< endl;
}
}
void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::write
(
Ostream& os
) const
{
mixedFvPatchScalarField::write(os);
temperatureCoupledBase::write(os);
q_.writeEntry("q", os);
h_.writeEntry("h", os);
Ta_.writeEntry("Ta", os);
this->writeEntry("value", os);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
makePatchTypeField
(
fvPatchScalarField,
externalWallHeatFluxTemperatureFvPatchScalarField
);
}
// ************************************************************************* //

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) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -22,31 +22,42 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class Class
solidWallHeatFluxTemperatureFvPatchScalarField externalWallHeatFluxTemperatureFvPatchScalarField
Description Description
Heat flux boundary condition for temperature on solid region Heat flux boundary condition for temperature on external wall.
If h and Ta are specified then fixed_heat_transfer_coefficient mode is used
If q is specified then fixed_heat_flux is used.
Example usage: Example usage:
myWallPatch myWallPatch
{ {
type solidWallHeatFluxTemperature; type externalWallHeatFluxTemperature;
K K; // Name of K field K solidThermo; // solidThermo or lookup
q uniform 1000; // Heat flux / [W/m2] q uniform 1000; // Heat flux / [W/m2]
value uniform 300.0; // Initial temperature / [K] Ta uniform 300.0; // Tambient temperature /[K]
gradient uniform 0.0; // Initial gradient / [K/m] h uniform 10.0; // Heat transfer coeff /[W/Km2]
value uniform 300.0; // Initial temperature / [K]
KName none;
} }
Note:
Only the pair h, Ta or q can be specified in the dictionary.
SourceFiles SourceFiles
solidWallHeatFluxTemperatureFvPatchScalarField.C externalWallHeatFluxTemperatureFvPatchScalarField.C
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef solidWallHeatFluxTemperatureFvPatchScalarField_H #ifndef solidWallHeatFluxTemperatureFvPatchScalarField_H
#define solidWallHeatFluxTemperatureFvPatchScalarField_H #define solidWallHeatFluxTemperatureFvPatchScalarField_H
#include "fixedGradientFvPatchFields.H" //#include "fixedGradientFvPatchFields.H"
#include "mixedFvPatchFields.H"
#include "temperatureCoupledBase.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -54,39 +65,55 @@ namespace Foam
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class solidWallHeatFluxTemperatureFvPatchScalarField Declaration Class externalWallHeatFluxTemperatureFvPatchScalarField Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class solidWallHeatFluxTemperatureFvPatchScalarField class externalWallHeatFluxTemperatureFvPatchScalarField
: :
public fixedGradientFvPatchScalarField public mixedFvPatchScalarField,
public temperatureCoupledBase
{ {
// Private data // Private data
//- how to operate the BC
enum operationMode
{
fixedHeatFlux,
fixedHeatTransferCoeff,
unknown
};
static const NamedEnum<operationMode, 3> operationModeNames;
//- Operation mode
operationMode oldMode_;
//- Heat flux / [W/m2] //- Heat flux / [W/m2]
scalarField q_; scalarField q_;
//- Name of thermal conductivity field //- Heat transfer coefficient / [W/m2K]
word KName_; scalarField h_;
//- Ambient temperature / [K]
scalarField Ta_;
public: public:
//- Runtime type information //- Runtime type information
TypeName("solidWallHeatFluxTemperature"); TypeName("externalWallHeatFluxTemperature");
// Constructors // Constructors
//- Construct from patch and internal field //- Construct from patch and internal field
solidWallHeatFluxTemperatureFvPatchScalarField externalWallHeatFluxTemperatureFvPatchScalarField
( (
const fvPatch&, const fvPatch&,
const DimensionedField<scalar, volMesh>& const DimensionedField<scalar, volMesh>&
); );
//- Construct from patch, internal field and dictionary //- Construct from patch, internal field and dictionary
solidWallHeatFluxTemperatureFvPatchScalarField externalWallHeatFluxTemperatureFvPatchScalarField
( (
const fvPatch&, const fvPatch&,
const DimensionedField<scalar, volMesh>&, const DimensionedField<scalar, volMesh>&,
@ -94,20 +121,20 @@ public:
); );
//- Construct by mapping given //- Construct by mapping given
// solidWallHeatFluxTemperatureFvPatchScalarField // externalWallHeatFluxTemperatureFvPatchScalarField
// onto a new patch // onto a new patch
solidWallHeatFluxTemperatureFvPatchScalarField externalWallHeatFluxTemperatureFvPatchScalarField
( (
const solidWallHeatFluxTemperatureFvPatchScalarField&, const externalWallHeatFluxTemperatureFvPatchScalarField&,
const fvPatch&, const fvPatch&,
const DimensionedField<scalar, volMesh>&, const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper& const fvPatchFieldMapper&
); );
//- Construct as copy //- Construct as copy
solidWallHeatFluxTemperatureFvPatchScalarField externalWallHeatFluxTemperatureFvPatchScalarField
( (
const solidWallHeatFluxTemperatureFvPatchScalarField& const externalWallHeatFluxTemperatureFvPatchScalarField&
); );
//- Construct and return a clone //- Construct and return a clone
@ -115,14 +142,14 @@ public:
{ {
return tmp<fvPatchScalarField> return tmp<fvPatchScalarField>
( (
new solidWallHeatFluxTemperatureFvPatchScalarField(*this) new externalWallHeatFluxTemperatureFvPatchScalarField(*this)
); );
} }
//- Construct as copy setting internal field reference //- Construct as copy setting internal field reference
solidWallHeatFluxTemperatureFvPatchScalarField externalWallHeatFluxTemperatureFvPatchScalarField
( (
const solidWallHeatFluxTemperatureFvPatchScalarField&, const externalWallHeatFluxTemperatureFvPatchScalarField&,
const DimensionedField<scalar, volMesh>& const DimensionedField<scalar, volMesh>&
); );
@ -134,40 +161,18 @@ public:
{ {
return tmp<fvPatchScalarField> return tmp<fvPatchScalarField>
( (
new solidWallHeatFluxTemperatureFvPatchScalarField(*this, iF) new externalWallHeatFluxTemperatureFvPatchScalarField(*this, iF)
); );
} }
// Member functions // Member functions
// Helper
//- Get K field on this patch
tmp<scalarField> K() const;
// Evaluation functions // Evaluation functions
//- Update the coefficients associated with the patch field //- Update the coefficients associated with the patch field
virtual void updateCoeffs(); virtual void updateCoeffs();
// Mapping functions
//- Map (and resize as needed) from self given a mapping object
virtual void autoMap
(
const fvPatchFieldMapper&
);
//- Reverse map the given fvPatchField onto this fvPatchField
virtual void rmap
(
const fvPatchScalarField&,
const labelList&
);
// I-O // I-O
//- Write //- Write

View File

@ -0,0 +1,234 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2011 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 "turbulentTemperatureRadCoupledMixedFvPatchScalarField.H"
#include "addToRunTimeSelectionTable.H"
#include "fvPatchFieldMapper.H"
#include "volFields.H"
#include "directMappedPatchBase.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace compressible
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
turbulentTemperatureRadCoupledMixedFvPatchScalarField::
turbulentTemperatureRadCoupledMixedFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF
)
:
mixedFvPatchScalarField(p, iF),
temperatureCoupledBase(patch(), "undefined", "undefined-K"),
TnbrName_("undefined-Tnbr"),
QrNbrName_("undefined-QrNbr"),
QrName_("undefined-Qr")
{
this->refValue() = 0.0;
this->refGrad() = 0.0;
this->valueFraction() = 1.0;
}
turbulentTemperatureRadCoupledMixedFvPatchScalarField::
turbulentTemperatureRadCoupledMixedFvPatchScalarField
(
const turbulentTemperatureRadCoupledMixedFvPatchScalarField& psf,
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
mixedFvPatchScalarField(psf, p, iF, mapper),
temperatureCoupledBase(patch(), psf.KMethod(), psf.KName()),
TnbrName_(psf.TnbrName_),
QrNbrName_(psf.QrNbrName_),
QrName_(psf.QrName_)
{}
turbulentTemperatureRadCoupledMixedFvPatchScalarField::
turbulentTemperatureRadCoupledMixedFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const dictionary& dict
)
:
mixedFvPatchScalarField(p, iF),
temperatureCoupledBase(patch(), dict),
TnbrName_(dict.lookup("Tnbr")),
QrNbrName_(dict.lookup("QrNbr")),
QrName_(dict.lookup("Qr"))
{
if (!isA<directMappedPatchBase>(this->patch().patch()))
{
FatalErrorIn
(
"turbulentTemperatureRadCoupledMixedFvPatchScalarField::"
"turbulentTemperatureRadCoupledMixedFvPatchScalarField\n"
"(\n"
" const fvPatch& p,\n"
" const DimensionedField<scalar, volMesh>& iF,\n"
" const dictionary& dict\n"
")\n"
) << "\n patch type '" << p.type()
<< "' not type '" << directMappedPatchBase::typeName << "'"
<< "\n for patch " << p.name()
<< " of field " << dimensionedInternalField().name()
<< " in file " << dimensionedInternalField().objectPath()
<< exit(FatalError);
}
fvPatchScalarField::operator=(scalarField("value", dict, p.size()));
if (dict.found("refValue"))
{
// Full restart
refValue() = scalarField("refValue", dict, p.size());
refGrad() = scalarField("refGradient", dict, p.size());
valueFraction() = scalarField("valueFraction", dict, p.size());
}
else
{
// Start from user entered data. Assume fixedValue.
refValue() = *this;
refGrad() = 0.0;
valueFraction() = 1.0;
}
}
turbulentTemperatureRadCoupledMixedFvPatchScalarField::
turbulentTemperatureRadCoupledMixedFvPatchScalarField
(
const turbulentTemperatureRadCoupledMixedFvPatchScalarField& psf,
const DimensionedField<scalar, volMesh>& iF
)
:
mixedFvPatchScalarField(psf, iF),
temperatureCoupledBase(patch(), psf.KMethod(), psf.KName()),
TnbrName_(psf.TnbrName_),
QrNbrName_(psf.QrNbrName_),
QrName_(psf.QrName_)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void turbulentTemperatureRadCoupledMixedFvPatchScalarField::updateCoeffs()
{
if (updated())
{
return;
}
// Get the coupling information from the directMappedPatchBase
const directMappedPatchBase& mpp =
refCast<const directMappedPatchBase>(patch().patch());
const polyMesh& nbrMesh = mpp.sampleMesh();
const label samplePatchI = mpp.samplePolyPatch().index();
const fvPatch& nbrPatch =
refCast<const fvMesh>(nbrMesh).boundary()[samplePatchI];
scalarField Tc = patchInternalField();
scalarField& Tp = *this;
const turbulentTemperatureRadCoupledMixedFvPatchScalarField&
nbrField = refCast
<const turbulentTemperatureRadCoupledMixedFvPatchScalarField>
(
nbrPatch.lookupPatchField<volScalarField, scalar>(TnbrName_)
);
// Swap to obtain full local values of neighbour internal field
scalarField TcNbr = nbrField.patchInternalField();
mpp.map().distribute(TcNbr);
// Swap to obtain full local values of neighbour K*delta
scalarField KDeltaNbr = nbrField.K(TcNbr)*nbrPatch.deltaCoeffs();
mpp.map().distribute(KDeltaNbr);
scalarField KDelta = K(*this)*patch().deltaCoeffs();
scalarField Qr(Tp.size(), 0.0);
if (QrName_ != "none")
{
Qr = patch().lookupPatchField<volScalarField, scalar>(QrName_);
}
scalarField QrNbr(Tp.size(), 0.0);
if (QrNbrName_ != "none")
{
QrNbr = nbrPatch.lookupPatchField<volScalarField, scalar>(QrNbrName_);
}
scalarField alpha(KDeltaNbr - (Qr + QrNbr)/Tp);
valueFraction() = alpha/(alpha + KDelta);
refValue() = (KDeltaNbr*TcNbr)/alpha;
mixedFvPatchScalarField::updateCoeffs();
}
void turbulentTemperatureRadCoupledMixedFvPatchScalarField::write
(
Ostream& os
) const
{
mixedFvPatchScalarField::write(os);
os.writeKeyword("Tnbr")<< TnbrName_ << token::END_STATEMENT << nl;
os.writeKeyword("QrNbr")<< QrNbrName_ << token::END_STATEMENT << nl;
os.writeKeyword("Qr")<< QrName_ << token::END_STATEMENT << nl;
temperatureCoupledBase::write(os);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeField
(
fvPatchScalarField,
turbulentTemperatureRadCoupledMixedFvPatchScalarField
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace compressible
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,186 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2011 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 3 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, see <http://www.gnu.org/licenses/>.
Class
Foam::
compressible::
turbulentTemperatureRadCoupledMixedFvPatchScalarField
Description
Mixed boundary condition for temperature and radiation heat transfer
to be used for in multiregion cases
Example usage:
myInterfacePatchName
{
type compressible::turbulentTemperatureRadCoupledMixed;
TNbr T; // name of T field on neighbour region
K lookup;
KName K;
QrNbr Qr; // or none. Name of Qr field on neighbour region
Qr Qr; // or none. Name of Qr field on local region
value uniform 300;
}
Needs to be on underlying directMapped(Wall)FvPatch.
Note: K : heat conduction at patch. Gets supplied how to lookup/calculate
K:
- 'lookup' : lookup volScalarField (or volSymmTensorField) with name
- 'basicThermo' : use basicThermo and compressible::RASmodel to calculate K
- 'solidThermo' : use basicSolidThermo K()
- 'directionalSolidThermo' directionalK()
Note: runs in parallel with arbitrary decomposition. Uses directMapped
functionality to calculate exchange.
SourceFiles
turbulentTemperatureRadCoupledMixedFvPatchScalarField.C
\*---------------------------------------------------------------------------*/
#ifndef turbulentTemperatureRadCoupledMixedFvPatchScalarField_H
#define turbulentTemperatureRadCoupledMixedFvPatchScalarField_H
#include "mixedFvPatchFields.H"
#include "temperatureCoupledBase.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace compressible
{
/*---------------------------------------------------------------------------*\
Class turbulentTemperatureRadCoupledMixedFvPatchScalarField Declaration
\*---------------------------------------------------------------------------*/
class turbulentTemperatureRadCoupledMixedFvPatchScalarField
:
public mixedFvPatchScalarField,
public temperatureCoupledBase
{
// Private data
//- Name of field on the neighbour region
const word TnbrName_;
//- Name of the radiative heat flux in the neighbout region
const word QrNbrName_;
//- Name of the radiative heat flux in local region
const word QrName_;
public:
//- Runtime type information
TypeName("compressible::turbulentTemperatureRadCoupledMixed");
// Constructors
//- Construct from patch and internal field
turbulentTemperatureRadCoupledMixedFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&
);
//- Construct from patch, internal field and dictionary
turbulentTemperatureRadCoupledMixedFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const dictionary&
);
//- Construct by mapping given
// turbulentTemperatureCoupledBaffleMixedFvPatchScalarField onto a
// new patch
turbulentTemperatureRadCoupledMixedFvPatchScalarField
(
const
turbulentTemperatureRadCoupledMixedFvPatchScalarField&,
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct and return a clone
virtual tmp<fvPatchScalarField> clone() const
{
return tmp<fvPatchScalarField>
(
new turbulentTemperatureRadCoupledMixedFvPatchScalarField
(
*this
)
);
}
//- Construct as copy setting internal field reference
turbulentTemperatureRadCoupledMixedFvPatchScalarField
(
const turbulentTemperatureRadCoupledMixedFvPatchScalarField&,
const DimensionedField<scalar, volMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchScalarField> clone
(
const DimensionedField<scalar, volMesh>& iF
) const
{
return tmp<fvPatchScalarField>
(
new turbulentTemperatureRadCoupledMixedFvPatchScalarField
(
*this,
iF
)
);
}
// Member functions
//- Update the coefficients associated with the patch field
virtual void updateCoeffs();
//- Write
virtual void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace compressible
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,213 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 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 3 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, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "solidWallHeatFluxTemperatureFvPatchScalarField.H"
#include "addToRunTimeSelectionTable.H"
#include "fvPatchFieldMapper.H"
#include "volFields.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::solidWallHeatFluxTemperatureFvPatchScalarField::
solidWallHeatFluxTemperatureFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF
)
:
fixedGradientFvPatchScalarField(p, iF),
q_(p.size(), 0.0),
KName_("undefined-K")
{}
Foam::solidWallHeatFluxTemperatureFvPatchScalarField::
solidWallHeatFluxTemperatureFvPatchScalarField
(
const solidWallHeatFluxTemperatureFvPatchScalarField& ptf,
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
fixedGradientFvPatchScalarField(ptf, p, iF, mapper),
q_(ptf.q_, mapper),
KName_(ptf.KName_)
{}
Foam::solidWallHeatFluxTemperatureFvPatchScalarField::
solidWallHeatFluxTemperatureFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const dictionary& dict
)
:
fixedGradientFvPatchScalarField(p, iF, dict),
q_("q", dict, p.size()),
KName_(dict.lookup("K"))
{}
Foam::solidWallHeatFluxTemperatureFvPatchScalarField::
solidWallHeatFluxTemperatureFvPatchScalarField
(
const solidWallHeatFluxTemperatureFvPatchScalarField& tppsf
)
:
fixedGradientFvPatchScalarField(tppsf),
q_(tppsf.q_),
KName_(tppsf.KName_)
{}
Foam::solidWallHeatFluxTemperatureFvPatchScalarField::
solidWallHeatFluxTemperatureFvPatchScalarField
(
const solidWallHeatFluxTemperatureFvPatchScalarField& tppsf,
const DimensionedField<scalar, volMesh>& iF
)
:
fixedGradientFvPatchScalarField(tppsf, iF),
q_(tppsf.q_),
KName_(tppsf.KName_)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::autoMap
(
const fvPatchFieldMapper& m
)
{
fixedGradientFvPatchScalarField::autoMap(m);
q_.autoMap(m);
}
void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::rmap
(
const fvPatchScalarField& ptf,
const labelList& addr
)
{
fixedGradientFvPatchScalarField::rmap(ptf, addr);
const solidWallHeatFluxTemperatureFvPatchScalarField& hfptf =
refCast<const solidWallHeatFluxTemperatureFvPatchScalarField>(ptf);
q_.rmap(hfptf.q_, addr);
}
Foam::tmp<Foam::scalarField>
Foam::solidWallHeatFluxTemperatureFvPatchScalarField::K() const
{
const fvMesh& mesh = patch().boundaryMesh().mesh();
if (mesh.objectRegistry::foundObject<volScalarField>(KName_))
{
return patch().lookupPatchField<volScalarField, scalar>(KName_);
}
else if (mesh.objectRegistry::foundObject<volSymmTensorField>(KName_))
{
const symmTensorField& KWall =
patch().lookupPatchField<volSymmTensorField, scalar>(KName_);
vectorField n(patch().nf());
return n & KWall & n;
}
else
{
FatalErrorIn
(
"solidWallHeatFluxTemperatureFvPatchScalarField::K()"
" const"
) << "Did not find field " << KName_
<< " on mesh " << mesh.name() << " patch " << patch().name()
<< endl
<< "Please set 'K' to a valid volScalarField"
<< " or a valid volSymmTensorField." << exit(FatalError);
return scalarField(0);
}
}
void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs()
{
if (updated())
{
return;
}
gradient() = q_/K();
fixedGradientFvPatchScalarField::updateCoeffs();
if (debug)
{
scalar Q = gSum(K()*patch().magSf()*snGrad());
Info<< patch().boundaryMesh().mesh().name() << ':'
<< patch().name() << ':'
<< this->dimensionedInternalField().name() << " :"
<< " heatFlux:" << Q
<< " walltemperature "
<< " min:" << gMin(*this)
<< " max:" << gMax(*this)
<< " avg:" << gAverage(*this)
<< endl;
}
}
void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::write
(
Ostream& os
) const
{
fixedGradientFvPatchScalarField::write(os);
q_.writeEntry("q", os);
os.writeKeyword("K") << KName_ << token::END_STATEMENT << nl;
this->writeEntry("value", os);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
makePatchTypeField
(
fvPatchScalarField,
solidWallHeatFluxTemperatureFvPatchScalarField
);
}
// ************************************************************************* //

View File

@ -9,6 +9,7 @@
PtrList<volScalarField> p_rghFluid(fluidRegions.size()); PtrList<volScalarField> p_rghFluid(fluidRegions.size());
PtrList<volScalarField> ghFluid(fluidRegions.size()); PtrList<volScalarField> ghFluid(fluidRegions.size());
PtrList<surfaceScalarField> ghfFluid(fluidRegions.size()); PtrList<surfaceScalarField> ghfFluid(fluidRegions.size());
PtrList<radiation::radiationModel> radiation(fluidRegions.size());
PtrList<volScalarField> DpDtFluid(fluidRegions.size()); PtrList<volScalarField> DpDtFluid(fluidRegions.size());
List<scalar> initialMassFluid(fluidRegions.size()); List<scalar> initialMassFluid(fluidRegions.size());
@ -166,6 +167,12 @@
// Force p_rgh to be consistent with p // Force p_rgh to be consistent with p
p_rghFluid[i] = thermoFluid[i].p() - rhoFluid[i]*ghFluid[i]; p_rghFluid[i] = thermoFluid[i].p() - rhoFluid[i]*ghFluid[i];
radiation.set
(
i,
radiation::radiationModel::New(thermoFluid[i].T())
);
initialMassFluid[i] = fvc::domainIntegrate(rhoFluid[i]).value(); initialMassFluid[i] = fvc::domainIntegrate(rhoFluid[i]).value();
Info<< " Adding to DpDtFluid\n" << endl; Info<< " Adding to DpDtFluid\n" << endl;

View File

@ -6,6 +6,7 @@
- fvm::laplacian(turb.alphaEff(), h) - fvm::laplacian(turb.alphaEff(), h)
== ==
DpDt DpDt
+ rad.Sh(thermo)
); );
hEqn.relax(); hEqn.relax();
@ -13,6 +14,8 @@
thermo.correct(); thermo.correct();
rad.correct();
Info<< "Min/max T:" << min(thermo.T()).value() << ' ' Info<< "Min/max T:" << min(thermo.T()).value() << ' '
<< max(thermo.T()).value() << endl; << max(thermo.T()).value() << endl;
} }

View File

@ -17,6 +17,8 @@
const volScalarField& gh = ghFluid[i]; const volScalarField& gh = ghFluid[i];
const surfaceScalarField& ghf = ghfFluid[i]; const surfaceScalarField& ghf = ghfFluid[i];
radiation::radiationModel& rad = radiation[i];
const dimensionedScalar initialMass const dimensionedScalar initialMass
( (
"initialMass", "initialMass",

View File

@ -23,16 +23,21 @@
); );
} }
fvScalarMatrix DrhoDtEqn
(
fvc::ddt(rho) + psi*correction(fvm::ddt(p))
+ fvc::div(phi)
==
parcels.Srho()
+ massSource.SuTot()
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{ {
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (
fvc::ddt(rho) + psi*correction(fvm::ddt(p)) DrhoDtEqn
+ fvc::div(phi)
- fvm::laplacian(rho*rAU, p) - fvm::laplacian(rho*rAU, p)
==
parcels.Srho()
+ massSource.SuTot()
); );
pEqn.solve(); pEqn.solve();

View File

@ -116,7 +116,9 @@
&& runTime.timeIndex() > runTime.startTimeIndex() + 1 && runTime.timeIndex() > runTime.startTimeIndex() + 1
) )
{ {
rDeltaT = rDeltaT0*max(rDeltaT/rDeltaT0, 1.0 - rDeltaTDampingCoeff); rDeltaT =
rDeltaT0
*max(rDeltaT/rDeltaT0, scalar(1.0) - rDeltaTDampingCoeff);
Info<< "Damped flow time scale min/max = " Info<< "Damped flow time scale min/max = "
<< gMin(1/rDeltaT.internalField()) << gMin(1/rDeltaT.internalField())

View File

@ -0,0 +1,3 @@
Test-codeStream.C
EXE = $(FOAM_USER_APPBIN)/Test-codeStream

View File

@ -0,0 +1 @@
EXE_INC =

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) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -21,60 +21,55 @@ License
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
InNamespace Application
Foam::resError Test-codeStream
Description Description
Residual error estimate for the fv convection operators.
SourceFiles
resErrorDiv.C
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef resErrorDiv_H #include "argList.H"
#define resErrorDiv_H #include "IOstreams.H"
#include "IOobject.H"
#include "IFstream.H"
#include "dictionary.H"
#include "errorEstimate.H" using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
namespace Foam int main(int argc, char *argv[])
{ {
argList::noParallel();
argList::validArgs.insert("dict .. dictN");
argList args(argc, argv, false, true);
namespace resError Info<< nl
{ << "FOAM_CASE=" << getEnv("FOAM_CASE") << nl
// Divergence terms << "FOAM_CASENAME=" << getEnv("FOAM_CASENAME") << nl
<< endl;
template<class Type> if (args.size() <= 1)
tmp<errorEstimate<Type> > div {
( Info<<"specify dictionaries to test\n";
const surfaceScalarField&, }
const GeometricField<Type, fvPatchField, volMesh>& else
); {
IOobject::writeDivider(Info);
for (label argI=1; argI < args.size(); ++argI)
{
const string& dictFile = args[argI];
IFstream is(dictFile);
template<class Type> dictionary dict(is);
tmp<errorEstimate<Type> > div
(
const tmp<surfaceScalarField>&,
const GeometricField<Type, fvPatchField, volMesh>&
);
} // End namespace resError Info<< dict << endl;
}
}
return 0;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "resErrorDiv.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* // // ************************************************************************* //

View File

@ -0,0 +1,43 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: Any |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object testDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// #include "codeStreamDefaults"
writeInterval #codeStream
{
codeInclude
#{
#include "fvCFD.H"
#};
codeOptions
#{
-I$(LIB_SRC)/finiteVolume/lnInclude
#};
code
#{
scalar start = 0;
scalar end = 100;
label nDumps = 5;
label interval = end - start;
Info<<"on-the-fly: " << ((interval)/nDumps) << endl;
os << ((interval)/nDumps);
#};
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -26,6 +26,7 @@ Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "string.H" #include "string.H"
#include "stringOps.H"
#include "IOstreams.H" #include "IOstreams.H"
using namespace Foam; using namespace Foam;
@ -35,11 +36,19 @@ using namespace Foam;
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
string test("$HOME kjhkjhkjh \" \\$HOME/tyetyery ${FOAM_RUN} \n ; hkjh ;$"); string test
(
" $HOME kjhkjhkjh \" \\$HOME/tyetyery ${FOAM_RUN} \n ; hkjh ;$ "
);
Info<< "string:" << test << nl << "hash:" Info<< "string:" << test << nl << "hash:"
<< unsigned(string::hash()(test)) << endl; << unsigned(string::hash()(test)) << endl;
Info<<"trimLeft: " << stringOps::trimLeft(test) << endl;
Info<<"trimRight: " << stringOps::trimRight(test) << endl;
Info<<"trim: " << stringOps::trim(test) << endl;
// test sub-strings via iterators // test sub-strings via iterators
string::const_iterator iter = test.end(); string::const_iterator iter = test.end();
string::const_iterator iter2 = test.end(); string::const_iterator iter2 = test.end();

View File

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

View File

@ -1,9 +0,0 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/errorEstimation/lnInclude
EXE_LIBS = \
-lerrorEstimation \
-lfiniteVolume \
-lmeshTools \
-ldynamicMesh

View File

@ -1,133 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 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 3 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, see <http://www.gnu.org/licenses/>.
Application
estimateScalarError
Description
Estimates the error in the solution for a scalar transport equation in the
standard form
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "errorEstimate.H"
#include "resError.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
timeSelector::addOptions();
# include "setRootCase.H"
# include "createTime.H"
instantList timeDirs = timeSelector::select0(runTime, args);
# include "createMesh.H"
Info<< "\nEstimating error in scalar transport equation\n"
<< "Reading transportProperties\n" << endl;
IOdictionary transportProperties
(
IOobject
(
"transportProperties",
runTime.constant(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
Info<< "Reading diffusivity DT\n" << endl;
dimensionedScalar DT
(
transportProperties.lookup("DT")
);
forAll(timeDirs, timeI)
{
runTime.setTime(timeDirs[timeI], timeI);
Info<< "Time = " << runTime.timeName() << endl;
mesh.readUpdate();
IOobject THeader
(
"T",
runTime.timeName(),
mesh,
IOobject::MUST_READ
);
IOobject Uheader
(
"U",
runTime.timeName(),
mesh,
IOobject::MUST_READ
);
if (THeader.headerOk() && Uheader.headerOk())
{
Info<< "Reading T" << endl;
volScalarField T(THeader, mesh);
Info<< "Reading U" << endl;
volVectorField U(Uheader, mesh);
# include "createPhi.H"
errorEstimate<scalar> ee
(
resError::div(phi, T)
- resError::laplacian(DT, T)
);
ee.residual()().write();
volScalarField e(ee.error());
e.write();
mag(e)().write();
}
else
{
Info<< " No T or U" << endl;
}
Info<< endl;
}
Info<< "End\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -1,4 +0,0 @@
icoErrorEstimate.C
EXE = $(FOAM_APPBIN)/icoErrorEstimate

View File

@ -1,9 +0,0 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/errorEstimation/lnInclude
EXE_LIBS = \
-lerrorEstimation \
-lmeshTools \
-ldynamicMesh \
-lfiniteVolume

View File

@ -1,129 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 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 3 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, see <http://www.gnu.org/licenses/>.
Application
icoErrorEstimate
Description
Estimates error for the incompressible laminar CFD application icoFoam.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "errorEstimate.H"
#include "resError.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
timeSelector::addOptions();
# include "setRootCase.H"
# include "createTime.H"
instantList timeDirs = timeSelector::select0(runTime, args);
# include "createMesh.H"
Info<< "\nEstimating error in the incompressible momentum equation\n"
<< "Reading transportProperties\n" << endl;
IOdictionary transportProperties
(
IOobject
(
"transportProperties",
runTime.constant(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
dimensionedScalar nu
(
transportProperties.lookup("nu")
);
forAll(timeDirs, timeI)
{
runTime.setTime(timeDirs[timeI], timeI);
Info<< "Time = " << runTime.timeName() << endl;
mesh.readUpdate();
IOobject pHeader
(
"p",
runTime.timeName(),
mesh,
IOobject::MUST_READ
);
IOobject Uheader
(
"U",
runTime.timeName(),
mesh,
IOobject::MUST_READ
);
if (pHeader.headerOk() && Uheader.headerOk())
{
Info<< "Reading p" << endl;
volScalarField p(pHeader, mesh);
Info<< "Reading U" << endl;
volVectorField U(Uheader, mesh);
# include "createPhi.H"
errorEstimate<vector> ee
(
resError::div(phi, U)
- resError::laplacian(nu, U)
==
-fvc::grad(p)
);
volVectorField e(ee.error());
e.write();
mag(e)().write();
}
else
{
Info<< " No p or U" << endl;
}
Info<< endl;
}
Info<< "End\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -1,4 +0,0 @@
icoMomentError.C
EXE = $(FOAM_APPBIN)/icoMomentError

View File

@ -1,9 +0,0 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/errorEstimation/lnInclude
EXE_LIBS = \
-lerrorEstimation \
-lmeshTools \
-ldynamicMesh \
-lfiniteVolume

View File

@ -1,188 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 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 3 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, see <http://www.gnu.org/licenses/>.
Application
icoMomentError
Description
Estimates error for the incompressible laminar CFD application icoFoam.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "linear.H"
#include "gaussConvectionScheme.H"
#include "gaussLaplacianScheme.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
timeSelector::addOptions();
# include "setRootCase.H"
# include "createTime.H"
instantList timeDirs = timeSelector::select0(runTime, args);
# include "createMesh.H"
Info<< "\nEstimating error in the incompressible momentum equation\n"
<< "Reading transportProperties\n" << endl;
IOdictionary transportProperties
(
IOobject
(
"transportProperties",
runTime.constant(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
dimensionedScalar nu
(
transportProperties.lookup("nu")
);
forAll(timeDirs, timeI)
{
runTime.setTime(timeDirs[timeI], timeI);
Info<< "Time = " << runTime.timeName() << endl;
mesh.readUpdate();
IOobject pHeader
(
"p",
runTime.timeName(),
mesh,
IOobject::MUST_READ
);
IOobject Uheader
(
"U",
runTime.timeName(),
mesh,
IOobject::MUST_READ
);
if (pHeader.headerOk() && Uheader.headerOk())
{
Info<< "Reading p" << endl;
volScalarField p(pHeader, mesh);
Info<< "Reading U" << endl;
volVectorField U(Uheader, mesh);
# include "createPhi.H"
volScalarField ek(0.5*magSqr(U));
volTensorField gradU(fvc::grad(U));
// Divergence of the error in U squared
volScalarField L
(
IOobject
(
"L",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedScalar("one", dimLength, 1.0)
);
L.internalField() =
mesh.V()/fvc::surfaceSum(mesh.magSf())().internalField();
// Warning: 4th row of this equation specially modified
// for the momentum equation. The "real" formulation would
// have diffusivity*(gradV && gradV)
volScalarField momError
(
IOobject
(
"momErrorL" + U.name(),
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
sqrt
(
2.0*mag
(
(
fv::gaussConvectionScheme<scalar>
(
mesh,
phi,
tmp<surfaceInterpolationScheme<scalar> >
(
new linear<scalar>(mesh)
)
).fvcDiv(phi, ek)
- nu*
fv::gaussLaplacianScheme<scalar, scalar>(mesh)
.fvcLaplacian
(
ek
)
- (U & fvc::grad(p))
// + nu*(gradU && gradU)
+ 0.5*nu*
(
gradU && (gradU + gradU.T())
)
)*L/(mag(U) + nu/L)
)
)
);
momError.boundaryField() = 0.0;
momError.write();
}
else
{
Info<< " No p or U" << endl;
}
Info<< endl;
}
Info<< "End\n" << endl;
return 0;
}
// ************************************************************************* //

View File

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

View File

@ -1,8 +0,0 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/errorEstimation/lnInclude
EXE_LIBS = \
-lmeshTools \
-ldynamicMesh \
-lfiniteVolume

View File

@ -1,185 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 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 3 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, see <http://www.gnu.org/licenses/>.
Application
momentScalarError
Description
Estimates the error in the solution for a scalar transport equation in the
standard form
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "linear.H"
#include "gaussConvectionScheme.H"
#include "gaussLaplacianScheme.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
timeSelector::addOptions();
# include "setRootCase.H"
# include "createTime.H"
instantList timeDirs = timeSelector::select0(runTime, args);
# include "createMesh.H"
Info<< "\nEstimating error in scalar transport equation\n"
<< "Reading transportProperties\n" << endl;
IOdictionary transportProperties
(
IOobject
(
"transportProperties",
runTime.constant(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
Info<< "Reading diffusivity DT\n" << endl;
dimensionedScalar DT
(
transportProperties.lookup("DT")
);
forAll(timeDirs, timeI)
{
runTime.setTime(timeDirs[timeI], timeI);
Info<< "Time = " << runTime.timeName() << endl;
mesh.readUpdate();
IOobject THeader
(
"T",
runTime.timeName(),
mesh,
IOobject::MUST_READ
);
IOobject Uheader
(
"U",
runTime.timeName(),
mesh,
IOobject::MUST_READ
);
if (THeader.headerOk() && Uheader.headerOk())
{
Info<< "Reading T" << endl;
volScalarField T(THeader, mesh);
Info<< "Reading U" << endl;
volVectorField U(Uheader, mesh);
# include "createPhi.H"
volVectorField gradT(fvc::grad(T));
volScalarField TE(0.5*sqr(T));
volScalarField L
(
IOobject
(
"L",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedScalar("one", dimLength, 1.0)
);
L.internalField() =
mesh.V()/fvc::surfaceSum(mesh.magSf())().internalField();
// Divergence of the error in the T squared
volScalarField momError
(
IOobject
(
"momErrorL" + T.name(),
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
sqrt
(
2.0*mag
(
(
fv::gaussConvectionScheme<scalar>
(
mesh,
phi,
tmp<surfaceInterpolationScheme<scalar> >
(
new linear<scalar>(mesh)
)
).fvcDiv(phi, TE)
- DT*
fv::gaussLaplacianScheme<scalar, scalar>(mesh)
.fvcLaplacian
(
TE
)
+ DT*(gradT & gradT)
)*L/(mag(U) + DT/L)
)
)
);
momError.boundaryField() = 0.0;
momError.write();
}
else
{
Info<< " No T or U" << endl;
}
Info<< endl;
}
Info<< "End\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -499,7 +499,7 @@ int main(int argc, char *argv[])
// Layers per point // Layers per point
labelList nPointLayers(extrudePatch.nPoints(), model().nLayers()); labelList nPointLayers(extrudePatch.nPoints(), model().nLayers());
// Displacement for first layer // Displacement for first layer
vectorField firstLayerDisp = displacement*model().sumThickness(1); vectorField firstLayerDisp(displacement*model().sumThickness(1));
// Expansion ratio not used. // Expansion ratio not used.
scalarField ratio(extrudePatch.nPoints(), 1.0); scalarField ratio(extrudePatch.nPoints(), 1.0);

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) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -45,6 +45,7 @@ Description
#include "IOPtrList.H" #include "IOPtrList.H"
#include "polyTopoChange.H" #include "polyTopoChange.H"
#include "polyModifyFace.H" #include "polyModifyFace.H"
#include "wordReList.H"
using namespace Foam; using namespace Foam;
@ -669,7 +670,13 @@ int main(int argc, char *argv[])
if (sourceType == "patches") if (sourceType == "patches")
{ {
labelHashSet patchSources(patches.patchSet(dict.lookup("patches"))); labelHashSet patchSources
(
patches.patchSet
(
wordReList(dict.lookup("patches"))
)
);
// Repatch faces of the patches. // Repatch faces of the patches.
forAllConstIter(labelHashSet, patchSources, iter) forAllConstIter(labelHashSet, patchSources, iter)

View File

@ -19,7 +19,6 @@ EXE_LIBS = \
-ldynamicMesh \ -ldynamicMesh \
-ledgeMesh \ -ledgeMesh \
-lengine \ -lengine \
-lerrorEstimation \
-lextrudeModel \ -lextrudeModel \
-lfieldFunctionObjects \ -lfieldFunctionObjects \
-lfileFormats \ -lfileFormats \

View File

@ -0,0 +1,14 @@
#!/bin/sh
#
# Build optional components (eg, may depend on third-party libraries)
# -----------------------------------------------------------------------------
cd ${0%/*} || exit 1 # run from this directory
set -x
# build tecio
wmake libso tecio/tecsrc
# build converter
wmake
# ----------------------------------------------------------------- end-of-file

View File

@ -1,5 +1,5 @@
EXE_INC = \ EXE_INC = \
-I$(WM_THIRD_PARTY_DIR)/tecio/tecsrc/lnInclude \ -Itecio/tecsrc/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \ -I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude -I$(LIB_SRC)/meshTools/lnInclude
@ -10,4 +10,4 @@ EXE_LIBS = \
-lfiniteVolume \ -lfiniteVolume \
-lgenericPatchFields \ -lgenericPatchFields \
-lmeshTools \ -lmeshTools \
-L$(FOAM_EXT_LIBBIN) -ltecio -ltecio

View File

@ -0,0 +1,277 @@
#!/bin/sh
MAKEWHAT=
EXTRAFLAGS=
STRIPFLAG=-s
isrelease=n
skipcompile=n
if test $# -ge 1 ; then
Platname=$1
shift
while test $# -ge 1
do
if test "$1" = "-release" ; then
isrelease=y
elif test "$1" = "-skipcompile" ; then
skipcompile=y
elif test "$1" = "-tecio" ; then
MAKEWHAT=tecio.a
else
EXTRAFLAGS="$EXTRAFLAGS $1"
fi
shift
done
else
echo "Choose platform:"
echo " "
echo " macux.104"
echo " macix64.105"
echo " sgix.62"
echo " sgix3.62"
echo " sgix.65"
echo " sgix64.65"
echo " sgix2.65"
echo " sun4.57"
echo " sun464.57"
echo " sun86.54"
echo " ibmx.43"
echo " ibmx64.43"
echo " ibmx.51"
echo " ibmx64.51"
echo " ibmx64.53"
echo " decalpha.32"
echo " compaq.51"
echo " hp7xx.11"
echo " hp7xx64.11"
echo " hpi64.11"
echo " linux.24"
echo " linuxi64.24"
echo " linux.22"
echo " linuxa.22"
echo " linuxg248x64.26"
echo " linuxg27x64.26"
echo " crayc90"
echo "->\c"
read Platname
echo "Choose:"
echo " 1. Make tecio.a only"
echo " 2. Make tecio.a and pltview"
read choice
if test $choice -eq 1 ;then
MAKEWHAT=tecio.a
fi
fi
MAKECMD=make
LINKFLAGS=
LINKLIBS=
AR=ar
ARFLAGS=qv
DISTSUBDIR2=
case $Platname in
mac*) CCOMP=g++
FINALCFLAGS="-arch ppc -arch i386 -arch ppc64 -arch x86_64 -DDARWIN -DLONGIS64 -I/usr/X11R6/include"
STRIPFLAG=-Wl,-x
LINKFLAGS="-arch ppc -arch i386 -arch ppc64 -arch x86_64"
;;
sgix.65-64) CCOMP=CC
FINALCFLAGS="-DIRISX -DLONGIS64 -mips4 -64"
LINKFLAGS="-mips4 -64"
;;
sgix64.65) CCOMP=CC
FINALCFLAGS="-DIRISX -DLONGIS64 -mips4 -64"
LINKFLAGS="-mips4 -64"
;;
sgix.65) CCOMP=CC
FINALCFLAGS="-DIRISX -mips4 -n32"
LINKFLAGS="-mips4 -n32"
;;
sgix2.65) CCOMP=CC
FINALCFLAGS="-DIRISX -o32"
LINKFLAGS="-o32"
;;
sgix.62-64) CCOMP=CC
FINALCFLAGS="-DIRISX -DIRIX62 -DLONGIS64 -mips4 -64"
LINKFLAGS="-mips4 -64"
;;
sgix.62) CCOMP=CC
FINALCFLAGS="-DIRISX -DIRIX62 -mips4 -n32"
LINKFLAGS="-mips4 -n32"
;;
sgix1.62) CCOMP=CC
FINALCFLAGS="-DIRISX -DIRIX62 -mips1 -32"
LINKFLAGS="-mips1 -32"
;;
sgix3.62) CCOMP=CC
FINALCFLAGS="-DIRISX -DIRIX62 -mips3 -n32"
LINKFLAGS="-mips3 -n32"
;;
ibmx.*) CCOMP=xlC
FINALCFLAGS=-DIBMRS6000X
;;
ibmx64.*) CCOMP=xlC
FINALCFLAGS="-DIBMRS6000X -DLONGIS64 -q64"
ARFLAGS="-X64 qv"
;;
compaq.51) CCOMP=cxx
FINALCFLAGS="-DCOMPAQX -I/usr/include -ieee_with_inexact"
;;
decalpha.32)CCOMP=cc
FINALCFLAGS="-DDECALPHAX -I/usr/include -ieee_with_inexact"
;;
hp7xx.*-64) CCOMP=aCC
FINALCFLAGS="+DD64 +DS2.0 -AA -DHPX -DLONGIS64 -I/usr/include/X11R6 -I/usr/include/Motif2.1"
LINKFLAGS="+DA2.0W +DD64 +DS2.0W"
;;
hp7xx64.11) CCOMP=aCC
FINALCFLAGS="+DA2.0W +DD64 +DS2.0W -AA -DHPX -DLONGIS64 -I/usr/include/X11R6 -I/usr/include/Motif2.1"
LINKFLAGS="+DA2.0W +DD64 +DS2.0W"
;;
hpi64.11) CCOMP=aCC
FINALCFLAGS="+DD64 -AA -DHPX -DLONGIS64 -I/usr/include/X11R6 -I/usr/include/Motif2.1"
LINKFLAGS="+DD64"
;;
hp7xx.11) CCOMP=aCC
FINALCFLAGS="+DAportable -AA -DHPX -I/usr/include/X11R6 -I/usr/include/Motif2.1"
LINKFLAGS="+DAportable"
;;
crayc90) CCOMP=cc
FINALCFLAGS="-DCRAY -DUNIXX"
;;
linux*i64.*)CCOMP=g++
FINALCFLAGS="-fPIC -DLINUX -DLINUXI64"
;;
linux*64.*) CCOMP=g++
FINALCFLAGS="-fPIC -DLINUX -DLINUX64"
;;
linux*) CCOMP=g++
FINALCFLAGS="-fPIC -DLINUX"
;;
sun4.54) CCOMP=/opt/SUNWspro/bin/CC
FINALCFLAGS="-DSUN -DSUNSOLARISX -I/usr/openwin/include -I/usr/dt/include -library=libC -library=Cstd -library=no%rwtools7 -library=no%rwtools7_dbg -xO1"
LINKFLAGS="-library=libC -library=Cstd -library=no%rwtools7 -library=no%rwtools7_dbg"
MAKECMD=/usr/ccs/bin/make
AR=/opt/SUNWspro/bin/CC
ARFLAGS="-xar -o"
;;
sun4.55) CCOMP=/opt/SUNWspro/bin/CC
FINALCFLAGS="-DSUN -DSUNSOLARISX -I/usr/openwin/include -I/usr/dt/include -library=libC -library=Cstd -library=no%rwtools7 -library=no%rwtools7_dbg -xO1"
LINKFLAGS="-library=libC -library=Cstd -library=no%rwtools7 -library=no%rwtools7_dbg"
MAKECMD=/usr/ccs/bin/make
AR=/opt/SUNWspro/bin/CC
ARFLAGS="-xar -o"
;;
sun4.57) CCOMP=/opt/SUNWspro/bin/CC
FINALCFLAGS="-DSUNSOLARISX -I/usr/openwin/include -I/usr/dt/include -library=libC -library=Cstd -library=no%rwtools7 -library=no%rwtools7_dbg -xO1"
LINKFLAGS="-library=libC -library=Cstd -library=no%rwtools7 -library=no%rwtools7_dbg"
MAKECMD=/usr/ccs/bin/make
AR=/opt/SUNWspro/bin/CC
ARFLAGS="-xar -o"
;;
sun4.57-64) CCOMP=/opt/SUNWspro/bin/CC
FINALCFLAGS="-DSUNSOLARISX -DLONGIS64 -KPIC -xarch=v9 -I/usr/openwin/include -I/usr/dt/include -library=libC -library=Cstd -library=no%rwtools7 -library=no%rwtools7_dbg -xO1"
LINKFLAGS="-KPIC -xarch=v9 -library=libC -library=Cstd -library=no%rwtools7 -library=no%rwtools7_dbg"
MAKECMD=/usr/ccs/bin/make
AR=/opt/SUNWspro/bin/CC
ARFLAGS="-xar -o"
;;
sun464.57) CCOMP=/opt/SUNWspro/bin/CC
FINALCFLAGS="-DSUNSOLARISX -DLONGIS64 -KPIC -xarch=v9 -I/usr/openwin/include -I/usr/dt/include -library=libC -library=Cstd -library=no%rwtools7 -library=no%rwtools7_dbg -xO1"
LINKFLAGS="-KPIC -xarch=v9 -library=libC -library=Cstd -library=no%rwtools7 -library=no%rwtools7_dbg"
MAKECMD=/usr/ccs/bin/make
AR=/opt/SUNWspro/bin/CC
ARFLAGS="-xar -o"
;;
sun464.59) CCOMP=/opt/SUNWspro/bin/CC
FINALCFLAGS="-DSUNSOLARISX -DLONGIS64 -KPIC -m64 -xarch=generic -I/usr/openwin/include -I/usr/dt/include -library=libC -library=Cstd -library=no%rwtools7 -library=no%rwtools7_dbg -xO1"
LINKFLAGS="-KPIC -m64 -xarch=generic -library=libC -library=Cstd -library=no%rwtools7 -library=no%rwtools7_dbg"
MAKECMD=/usr/ccs/bin/make
AR=/opt/SUNWspro/bin/CC
ARFLAGS="-xar -o"
;;
sun86.54) CCOMP=/opt/SUNWspro/bin/CC
FINALCFLAGS="-DSUN -DSUNSOLARISX -I/usr/openwin/include -I/usr/dt/include"
MAKECMD=/usr/ccs/bin/make
AR=/opt/SUNWspro/bin/CC
ARFLAGS="-xar -o"
;;
*) echo "Err: Invalid platform"
exit
;;
esac
if test "$isrelease" = "y" ; then
EXTRAFLAGS="$EXTRAFLAGS -DNO_ASSERTS"
else
STRIPFLAG=
fi
if test "$skipcompile" = "n" ; then
rm -f *.o */*.o *.a > /dev/null 2>&1
fi
rm -f *.a > /dev/null 2>&1
FINALCFLAGS="$FINALCFLAGS $EXTRAFLAGS -DUSEENUM -DTHREED"
#
# NOTE: Used to use make here but had problems with using remsh to run
# make multiple times to get 64 bit and 32 bit versions of libraries....
#
# $MAKECMD $MAKEWHAT AR=$AR CC=$CCOMP LINKFLAGS="$LINKFLAGS" STRIPFLAG=$STRIPFLAG CFLAGS="$EXTRAFLAGS -DUSEENUM -DTHREED $FINALCFLAGS"
#
#
#
cd tecsrc
BASELIST=`/bin/ls -1 *.cpp`
OBJLIST=
for file in $BASELIST
do
OBJNAME=`echo $file | sed 's/\.cpp/.o/'`
OBJLIST="$OBJLIST tecsrc/$OBJNAME"
done
if test "$skipcompile" = "n" ; then
for file in $BASELIST
do
case $file in
tecxxx.cpp) ARCHIVEFLAG=-DMAKEARCHIVE;;
arrlist.cpp) ARCHIVEFLAG=-DMAKEARCHIVE;;
datautil.cpp) ARCHIVEFLAG=-DMAKEARCHIVE;;
*) ARCHIVEFLAG= ;;
esac
echo "$CCOMP $FINALCFLAGS $ARCHIVEFLAG -c $file"
$CCOMP $FINALCFLAGS $ARCHIVEFLAG -c $file
done
fi
cd ..
pwd
echo "$AR $ARFLAGS tecio.a $OBJLIST"
$AR $ARFLAGS tecio.a $OBJLIST
if test -f /bin/ranlib ; then
/bin/ranlib tecio.a;
elif test -f /usr/bin/ranlib ; then
/usr/bin/ranlib tecio.a;
elif test -f /usr/ucb/ranlib ; then
/usr/ucb/ranlib tecio.a;
fi
echo "$CCOMP -I./tecsrc -DMAKEARCHIVE $FINALCFLAGS -c pltview.cpp"
$CCOMP -I./tecsrc -DMAKEARCHIVE $FINALCFLAGS -c pltview.cpp
echo "$CCOMP $FINALCFLAGS pltview.o tecio.a $LINKFLAGS $LINKLIBS $STRIPFLAG -lm -o pltview"
$CCOMP $FINALCFLAGS pltview.o tecio.a $LINKFLAGS $LINKLIBS $STRIPFLAG -lm -o pltview

View File

@ -0,0 +1,11 @@
# Set to appropriate C++ compiler
CPP=g++
CPPFLAGS=-I../../tecsrc ../../tecio.a
EXECUTABLE=arrow
FILES=$(EXECUTABLE).cpp
build:
$(CPP) $(FILES) $(CPPFLAGS) -o $(EXECUTABLE)
clean:
rm -f $(EXECUTABLE)

View File

@ -0,0 +1,530 @@
/* This example creates two simple polyhedral zones in the shape
* of a three-dimensional arrow. Obscured boundary faces are used.
*/
#include <stdio.h>
#include "TECIO.h"
int main()
{
/* DOCSTART:arrow_tecini.txt*/
INTEGER4 Debug = 1;
INTEGER4 VIsDouble = 1;
INTEGER4 FileType = 0;
INTEGER4 I;
/* Open the file and write the Tecplot datafile
* header information
*/
I = TECINI112((char*)"Multiple polyhedral zones", /* Name of the entire
* dataset.
*/
(char*)"X Y Z P", /* Defines the variables for the data
* file. Each zone must contain each of
* the variables listed here. The order
* of the variables in the list is used
* to define the variable number (e.g.
* X is Var 1).
*/
(char*)"Arrow.plt",
(char*)".", /* Scratch Directory */
&FileType,
&Debug,
&VIsDouble);
/* DOCEND */
/* After TECINI is called, call TECZNE to create one or more
* zones for your data file. In this example, Zone 1 contains a
* single rectangular solid created as a face-based finite-element
* (i.e. polyhedral zone). The zone has eight points (or nodes),
* six faces and one element.
*/
/* DOCSTART:arrow_teczne_rect.txt*/
/* TECZNE Parameters */
INTEGER4 ZoneType = 7; /* sets the zone type
* to polyhedral */
INTEGER4 NumPts_Rect = 8;
INTEGER4 NumElems_Rect = 1;
INTEGER4 NumFaces_Rect = 6;
INTEGER4 ICellMax = 0; /* not used */
INTEGER4 JCellMax = 0; /* not used */
INTEGER4 KCellMax = 0; /* not used */
double SolutionTime = 0.0;
INTEGER4 StrandID = 0;
INTEGER4 ParentZone = 0;
INTEGER4 IsBlock = 1;
INTEGER4 NumFaceConnections = 0; /* not used */
INTEGER4 FaceNeighborMode = 1; /* not used */
INTEGER4 SharConn = 0;
/* In a rectangular solid, each face is composed of four nodes.
* As such, the total number of face nodes is twenty-four (four
* nodes for each of the six faces).
*/
INTEGER4 TotalNumFaceNodes_Rect = 24;
/* There is one connected boundary face in this zone (the face on
* the rectangle adjacent to the arrowhead). Refer to the Data
* Format Guide for additional information. */
INTEGER4 NumConnBndryFaces_Rect = 1;
/* The connected boundary face has one connection, the face on
* the bottom of the arrowhead. A connection is an element-zone
* tuple that indicates a neighboring element (and its zone) when
* the neighboring element is in a different zone. Generally,
* there will be one boundary connection for each boundary face.
*/
INTEGER4 TotalNumBndryConns_Rect = 1;
/* For illustrative purposes, the grid variables (X, Y, and Z)
* are nodal variables (i.e. ValueLocation = 1), and the pressure
* variable (P) is a cell-centered variable (i.e.
* ValueLocation = 0).
*/
INTEGER4 ValueLocation[4] = { 1, 1, 1, 0 };
I = TECZNE112((char*)"Zone 1: Rectangular Solid",
&ZoneType,
&NumPts_Rect,
&NumElems_Rect,
&NumFaces_Rect,
&ICellMax,
&JCellMax,
&KCellMax,
&SolutionTime,
&StrandID,
&ParentZone,
&IsBlock,
&NumFaceConnections,
&FaceNeighborMode,
&TotalNumFaceNodes_Rect,
&NumConnBndryFaces_Rect,
&TotalNumBndryConns_Rect,
NULL,
ValueLocation,
NULL,
&SharConn);
/* DOCEND */
/* DOCSTART:arrow_tecdat_rect.txt*/
//set variable values (X_Rect, Y_Rect, Z_Rect & P_Rect)
double *X_Rect = new double[NumPts_Rect];
double *Y_Rect = new double[NumPts_Rect];
double *Z_Rect = new double[NumPts_Rect];
double *P_Rect = new double[NumElems_Rect];
for (INTEGER4 ii = 0; ii <= NumPts_Rect / 2; ii += 4)
{
X_Rect[ii] = 0;
X_Rect[ii+1] = 3;
X_Rect[ii+2] = 3;
X_Rect[ii+3] = 0;
Y_Rect[ii] = 3;
Y_Rect[ii+1] = 3;
Y_Rect[ii+2] = 1;
Y_Rect[ii+3] = 1;
}
for (INTEGER4 ii = 0; ii < 4; ii++)
Z_Rect[ii] = 0;
for (INTEGER4 ii = 4; ii < NumPts_Rect; ii++)
Z_Rect[ii] = -2;
P_Rect[0] = 10;
INTEGER4 IsDouble = 1;
I = TECDAT112(&NumPts_Rect, X_Rect, &IsDouble);
I = TECDAT112(&NumPts_Rect, Y_Rect, &IsDouble);
I = TECDAT112(&NumPts_Rect, Z_Rect, &IsDouble);
I = TECDAT112(&NumElems_Rect, P_Rect, &IsDouble);
/* DOCEND */
/* DOCSTART:arrow_facenodes_rect.txt*/
/* The FaceNodeCounts array is used to describe the number of
* nodes in each face of the zone. The first value in the array
* is the number of nodes in Face 1, the second value is the
* number of nodes in Face 2 and so forth. In this example, each
* face of the zone has four nodes.
*/
INTEGER4 *FaceNodeCounts_Rect = new INTEGER4[NumFaces_Rect];
//For this particular zone, each face has the 4 nodes
for (INTEGER4 ii = 0; ii < NumFaces_Rect; ii++)
FaceNodeCounts_Rect[ii] = 4;
/* The FaceNodes array is used to specify the nodes that compose
* each face. For each face (n of N), the number of nodes used
* to define the face is specified by the nth value in the
* FaceNodeCounts array. For example, if the first value in the
* FaceNodeCounts array is 4 (indicating Face 1 is composed of
* four nodes), the first four values in the FaceNodes array are
* the node numbers of the nodes in Face 1.
*
* ------------
* WARNING
* When providing the node numbers for each face, you must
* provide the node numbers in a consistent order (either
* clockwise or counter-clockwise. Providing the node numbers
* out of order results in contorted faces.
* ------------
*/
INTEGER4 *FaceNodes_Rect = new INTEGER4[TotalNumFaceNodes_Rect];
//Nodes for Face 1
FaceNodes_Rect[0] = 1;
FaceNodes_Rect[1] = 2;
FaceNodes_Rect[2] = 3;
FaceNodes_Rect[3] = 4;
//Nodes for Face 2
FaceNodes_Rect[4] = 1;
FaceNodes_Rect[5] = 4;
FaceNodes_Rect[6] = 8;
FaceNodes_Rect[7] = 5;
//Nodes for Face 3
FaceNodes_Rect[8] = 5;
FaceNodes_Rect[9] = 8;
FaceNodes_Rect[10] = 7;
FaceNodes_Rect[11] = 6;
//Nodes for Face 4
FaceNodes_Rect[12] = 2;
FaceNodes_Rect[13] = 6;
FaceNodes_Rect[14] = 7;
FaceNodes_Rect[15] = 3;
//Nodes for Face 5
FaceNodes_Rect[16] = 6;
FaceNodes_Rect[17] = 2;
FaceNodes_Rect[18] = 1;
FaceNodes_Rect[19] = 5;
//Nodes for Face 6
FaceNodes_Rect[20] = 3;
FaceNodes_Rect[21] = 7;
FaceNodes_Rect[22] = 8;
FaceNodes_Rect[23] = 4;
/* DOCEND */
/* DOCSTART:arrow_neighbors_rect.txt*/
INTEGER4 *FaceLeftElems_Rect = new INTEGER4[NumFaces_Rect];
INTEGER4 *FaceRightElems_Rect = new INTEGER4[NumFaces_Rect];
/* Since this zone has just one element, all leftelems are
* NoNeighboring Element and all right elems are itself
*/
for (INTEGER4 ii = 0; ii < NumFaces_Rect; ii++)
{
FaceRightElems_Rect[ii] = 1;
FaceLeftElems_Rect[ii] = 0;
}
/* The negative value in the FaceLeftElems array indicates that
* the face is connected to an element in another zone. In this
* case, Face 4 is connected to a face in Zone 2 (to be defined
* later in the example). The FaceBoundaryConnectionElems array
* lists all of the element numbers in other zones that the
* current zone shares boundary connections with. Similarly, the
* FaceBoundaryConnectionZones array lists all of the zone numbers
* with which the current zone shares boundaries. A negative
* value in the FaceLeftElems or FaceRightElems array indicates
* the position within these arrays that defines the neighboring
* element and zone for a face.
*
* For example, if the FaceBoundaryConnectionElems array is:
* [1 8 2] and the FaceBoundaryConnectionZones array is: [2 5 3],
* a FaceLeftElems or FaceRightElems value of -2 indicates that
* the face in question has a boundary connection with Element 8
* in Zone 5.
*/
FaceLeftElems_Rect[3] = -1;
/* DOCEND */
/* DOCSTART:arrow_tecpoly_rect.txt*/
/* The FaceBndryConnectionCounts array is used to define the
* number of boundary connections for each face that has a
* boundary connection. For example, if a zone has three boundary
* connections in total (NumConnectedBoundaryFaces), two of those
* boundary connections are in one face, and the remaining
* boundary connection is in a second face, the
* FaceBndryConnectionCounts array would be: [2 1].
* In this example, the total number of connected boundary faces
* (specified via TECZNE) is equal to one, so the
* FaceBoundaryConnectionCounts array contains a single value (1).
*/
INTEGER4 *FaceBndryConnCounts_Rect = new INTEGER4[NumConnBndryFaces_Rect];
FaceBndryConnCounts_Rect[0] = 1;
/* The value(s) in the FaceBndryConnectionElems and
* FaceBndryConnectionZones arrays specify the element number and
* zone number, respectively, that a given boundary connection is
* connected to. In this case, the boundary connection face is
* connected to Element 1 in Zone 2.
*/
INTEGER4 *FaceBndryConnElems_Rect = new INTEGER4[TotalNumBndryConns_Rect];
INTEGER4 *FaceBndryConnZones_Rect = new INTEGER4[TotalNumBndryConns_Rect];
FaceBndryConnElems_Rect[0] = 1;
FaceBndryConnZones_Rect[0] = 2;
I = TECPOLY112(FaceNodeCounts_Rect,
FaceNodes_Rect,
FaceLeftElems_Rect,
FaceRightElems_Rect,
FaceBndryConnCounts_Rect,
FaceBndryConnElems_Rect,
FaceBndryConnZones_Rect);
/* cleanup */
delete X_Rect;
delete Y_Rect;
delete Z_Rect;
delete P_Rect;
delete FaceNodeCounts_Rect;
delete FaceNodes_Rect;
delete FaceLeftElems_Rect;
delete FaceRightElems_Rect;
delete FaceBndryConnCounts_Rect;
delete FaceBndryConnElems_Rect;
delete FaceBndryConnZones_Rect;
/* DOCEND */
/* The data for Zone 1 has been written to the data file, so we
* are ready to create Zone 2. For simplicity, we will reuse many
* of the variables created for the rectangular zone that are not
* relevant to this tutorial. */
/* Zone 2 (the arrowhead or prism) has a single element composed
* of six nodes and five faces.
*/
/* DOCSTART:arrow_teczne_prism.txt*/
//TECZNE Parameters
INTEGER4 NumPts_Prism = 6;
INTEGER4 NumElems_Prism = 1;
INTEGER4 NumFaces_Prism = 5;
/* The prism is composed of two triangular faces and three
* rectangular faces. The total number of face nodes is the sum
* of the nodes in each triangular face (2 times 3) and the nodes
* in each rectangular face (3 times 4).
*/
INTEGER4 TotalNumFaceNodes_Prism = 18;
/* As with Zone 1, Zone 2 has one connected boundary face, the
* face that is connected to Zone 1.
*/
INTEGER4 NumConnBndryFaces_Prism = 1;
/* In this case, we have set the total number of boundary
* connections for the connected face to two. The first boundary
* connection is the connection to Zone 1. The second boundary
* connection is used to indicate that the face is only partially
* obscured by the face from Zone 1. If we omitted the second
* boundary connection, the connected face of the prism would
* disappear if the rectangular zone was deactivated.
*/
INTEGER4 TotalNumBndryConns_Prism = 2;
I = TECZNE112((char*)"Zone 2: Prism",
&ZoneType,
&NumPts_Prism,
&NumElems_Prism,
&NumFaces_Prism,
&ICellMax,
&JCellMax,
&KCellMax,
&SolutionTime,
&StrandID,
&ParentZone,
&IsBlock,
&NumFaceConnections,
&FaceNeighborMode,
&TotalNumFaceNodes_Prism,
&NumConnBndryFaces_Prism,
&TotalNumBndryConns_Prism,
NULL,
ValueLocation,
NULL,
&SharConn);
/* DOCEND */
/* DOCSTART:arrow_tecdat_prism.txt*/
double *X_Prism = new double[NumPts_Prism];
double *Y_Prism = new double[NumPts_Prism];
double *Z_Prism = new double[NumPts_Prism];
/* Set the X and Y variable values, one z-plane at a time */
double ZVal = 0;
for (INTEGER4 ii = 0; ii < 2; ii++)
{
// triangle in Z=ZVal plane
X_Prism[3*ii] = 3;
Y_Prism[3*ii] = 4;
Z_Prism[3*ii] = ZVal;
X_Prism[3*ii+1] = 7;
Y_Prism[3*ii+1] = 2;
Z_Prism[3*ii+1] = ZVal;
X_Prism[3*ii+2] = 3;
Y_Prism[3*ii+2] = 0;
Z_Prism[3*ii+2] = ZVal;
ZVal = ZVal - 2;
}
/* When we called TecZne, we specified that the variable 4
* (pressure) is cell-centered. As such, only NumElements number
* of values needs to be written to the data file for the pressure
* variable.
*/
double *P_Prism = new double[NumElems_Prism];
P_Prism[0] = 20;
I = TECDAT112(&NumPts_Prism, X_Prism, &IsDouble);
I = TECDAT112(&NumPts_Prism, Y_Prism, &IsDouble);
I = TECDAT112(&NumPts_Prism, Z_Prism, &IsDouble);
I = TECDAT112(&NumElems_Prism, P_Prism, &IsDouble);
/* DOCEND */
/* DOCSTART:arrow_facemap_prism.txt*/
INTEGER4 *FaceNodeCounts_Prism = new INTEGER4[NumFaces_Prism];
INTEGER4 *FaceNodes_Prism = new INTEGER4[TotalNumFaceNodes_Prism];
/* Because of the way we chose to number our faces, the first
* three faces are rectangular and the last two are triangular.
* The numbering of the faces is arbitrary, but the faces must
* be referred to consistently.
*/
for (INTEGER4 ii = 0; ii < 3; ii++)
FaceNodeCounts_Prism[ii] = 4;
for (INTEGER4 ii = 3; ii < NumFaces_Prism; ii++)
FaceNodeCounts_Prism[ii] = 3;
//Nodes for Face 1
FaceNodes_Prism[0] = 1;
FaceNodes_Prism[1] = 3;
FaceNodes_Prism[2] = 6;
FaceNodes_Prism[3] = 4;
//Nodes for Face 2
FaceNodes_Prism[4] = 1;
FaceNodes_Prism[5] = 4;
FaceNodes_Prism[6] = 5;
FaceNodes_Prism[7] = 2;
//Nodes for Face 3
FaceNodes_Prism[8] = 3;
FaceNodes_Prism[9] = 2;
FaceNodes_Prism[10] = 5;
FaceNodes_Prism[11] = 6;
//Nodes for Face 4
FaceNodes_Prism[12] = 5;
FaceNodes_Prism[13] = 4;
FaceNodes_Prism[14] = 6;
//Nodes for Face 5
FaceNodes_Prism[15] = 1;
FaceNodes_Prism[16] = 2;
FaceNodes_Prism[17] = 3;
/* DOCEND */
/* DOCSTART:arrow_neighbors_prism.txt*/
/* Since this zone has just one element, all leftelems are
* NoNeighboring Element and all right elems are itself.
*/
INTEGER4 *FaceLeftElems_Prism = new INTEGER4[NumFaces_Prism];
INTEGER4 *FaceRightElems_Prism = new INTEGER4[NumFaces_Prism];
for (INTEGER4 ii = 0; ii < NumFaces_Prism; ii++)
{
FaceRightElems_Prism[ii] = 1;
FaceLeftElems_Prism[ii] = 0;
}
/* The negative value in the FaceLeftElems array indicates that
* the face is connected to an element in another zone. In this
* case, Face 1 is connected to a face in Zone 1 (as indicated in
* Line 6). The FaceBoundaryConnectionElems array lists all of
* the element numbers in other zones that the current zone shares
* boundary connections with. Similarly, the
* FaceBoundaryConnectionZones array lists all of the zone numbers
* with which the current zone shares boundaries. A negative
* value in the FaceLeftElems or FaceRightElems array indicates
* the position within these arrays that defines the neighboring
* element and zone for a face.
*/
FaceLeftElems_Prism[0] = -1;
/* DOCEND */
/* DOCSTART:arrow_tecpoly_prism.txt*/
INTEGER4 *FaceBndryConnCounts_Prism = new INTEGER4[NumConnBndryFaces_Prism];
FaceBndryConnCounts_Prism[0] = 2;
INTEGER4 *FaceBndryConnElems_Prism = new INTEGER4[TotalNumBndryConns_Prism];
INTEGER4 *FaceBndryConnZones_Prism = new INTEGER4[TotalNumBndryConns_Prism];
/* As previously mentioned, a connected boundary face is a face
* that has either multiple neighboring faces or neighbor(s) that
* belong to another zone. Those cases are sufficient when the
* combination of all of the face<63>s neighbors completely cover the
* face. However, there are some cases (such as the bottom of the
* arrowhead) where the face is not completely covered by its
* neighbors. In those cases the face is referred to as <20>partially
* obscured<65>. A partially obscured face is indicated by
* incrementing the value in TotalNumConnectedBoundaryFaces and
* entering a value of 0 in both the FaceBndryConnectionElems and
* FaceBoundaryConnectionZones arrays for the boundary connection
* for the partially obscured face.
*/
FaceBndryConnElems_Prism[0] = 0;
FaceBndryConnZones_Prism[0] = 0;
/* Indicates that Face 1 is connected to Element 1 in Zone 1. */
FaceBndryConnElems_Prism[1] = 1;
FaceBndryConnZones_Prism[1] = 1;
I = TECPOLY112(FaceNodeCounts_Prism,
FaceNodes_Prism,
FaceLeftElems_Prism,
FaceRightElems_Prism,
FaceBndryConnCounts_Prism,
FaceBndryConnElems_Prism,
FaceBndryConnZones_Prism);
/* cleanup */
delete X_Prism;
delete Y_Prism;
delete Z_Prism;
delete P_Prism;
delete FaceNodeCounts_Prism;
delete FaceNodes_Prism;
delete FaceLeftElems_Prism;
delete FaceRightElems_Prism;
delete FaceBndryConnCounts_Prism;
delete FaceBndryConnElems_Prism;
delete FaceBndryConnZones_Prism;
/* DOCEND */
/* DOCSTART:arrow_tecend.txt*/
I = TECEND112();
/* DOCEND */
return 0;
}

View File

@ -0,0 +1,172 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="arrow"
ProjectGUID="{3C1105D7-5690-48E0-9402-111CBDC84B42}"
RootNamespace="arrow"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="..\TecIO_Examples.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="..\TecIO_Examples.vsprops"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
RuntimeLibrary="2"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<File
RelativePath=".\arrow.cpp"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -0,0 +1,11 @@
# Set to appropriate C++ compiler
CPP=g++
CPPFLAGS=-I../../tecsrc ../../tecio.a
EXECUTABLE=comtest
FILES=$(EXECUTABLE).c
build:
$(CPP) $(FILES) $(CPPFLAGS) -o $(EXECUTABLE)
clean:
rm -f $(EXECUTABLE)

View File

@ -0,0 +1,492 @@
/*
* Complex example C program to write a
* binary data file for Tecplot. This example
* does the following:
*
* 1. Open a data file called "field.plt."
* 2. Open a data file called "line.plt."
* 3. Assign values for X, Y and P. These will be used
* in both the ordered and finite-element data files.
* 4. Write out an ordered zone dimensioned 4 x 5 to "field.plt."
* 5. Assign values for XL and YL arrays.
* 6. Write out data for line plot to "line.plt." Make the data
* use double precision.
* 7. Write out a finite-element zone to "field.plt."
* 8. Write out a text record to "field.plt."
* 9. Write out a geometry (circle) record to "field.plt."
* 10. Close file 1.
* 11. Close file 2.
*/
#include <stdio.h>
#include <math.h>
#include "TECIO.h"
int main(void)
{
float X[5][4], Y[5][4], P[5][4];
double XL[50], YL[50];
double SolTime;
INTEGER4 Debug, I, J, K, L, III, NPts, NElm, DIsDouble, VIsDouble, IMax, JMax, KMax;
INTEGER4 ICellMax, JCellMax, KCellMax, ZoneType, Clipping;
INTEGER4 StrandID, ParentZn, FieldFileType, LineFileType;
INTEGER4 SharingZone[3] = {0, 0, 0};
INTEGER4 IsBlock, NumFaceConnections, FaceNeighborMode, ShareConnectivityFromZone;
INTEGER4 NM[12][4];
double XP, YP, ZP, FH, LineSpacing, PatternLength;
double BoxMargin, BoxLineThickness, TextAngle;
INTEGER4 AttachToZone, Zone, Scope, PositionCoordSys, FontType, HeightUnits;
INTEGER4 IsFilled, GeomType, LinePattern, NumEllipsePts;
INTEGER4 Anchor, BoxType, BoxColor, BoxFillColor, TextColor, Color, FillColor;
INTEGER4 ArrowheadStyle, ArrowheadAttachment, NumSegments, NumSegPts[1];
double LineThickness, ArrowheadSize, ArrowheadAngle;
float XGeomData[1], YGeomData[1], ZGeomData[1];
enum FileType { FULL = 0, GRID = 1, SOLUTION = 2 };
Debug = 2;
VIsDouble = 0;
DIsDouble = 0;
FieldFileType = FULL;
LineFileType = FULL;
/*
* Open order.plt and write the header information.
*/
I = TECINI112((char*)"DATASET WITH ONE ORDERED ZONE AND ONE FE-QUAD ZONE OVER 2 TIME STEPS",
(char*)"X Y P",
(char*)"field.plt",
(char*)".",
&FieldFileType,
&Debug,
&VIsDouble);
/*
* Open line.plt and write the header information.
*/
VIsDouble = 1;
I = TECINI112((char*)"DATASET WITH ONE I-ORDERED ZONE",
(char*)"X Y",
(char*)"line.plt",
(char*)".",
&LineFileType,
&Debug,
&VIsDouble);
/*
* Calculate values for the field variables.
*/
for (J = 0; J < 5; J++)
for (I = 0; I < 4; I++)
{
X[J][I] = (float)(I + 1);
Y[J][I] = (float)(J + 1);
P[J][I] = (float)((I + 1) * (J + 1));
}
/*
* Make sure writing to file #1.
*/
III = 1;
I = TECFIL112(&III);
/*
* Write the zone header information for the ordered zone.
*/
IMax = 4;
JMax = 5;
KMax = 1;
ICellMax = 0;
JCellMax = 0;
KCellMax = 0;
ZoneType = 0;
SolTime = 10.0;
StrandID = 1;
ParentZn = 0;
IsBlock = 1;
NumFaceConnections = 0;
FaceNeighborMode = 0;
ShareConnectivityFromZone = 0;
I = TECZNE112((char*)"Ordered Zone 1",
&ZoneType,
&IMax,
&JMax,
&KMax,
&ICellMax,
&JCellMax,
&KCellMax,
&SolTime,
&StrandID,
&ParentZn,
&IsBlock,
&NumFaceConnections,
&FaceNeighborMode,
NULL, /* PassiveVarList */
NULL, /* ValueLocation */
NULL, /* ShareVarFromZone */
0, /* TotalNumFaceNodes */
0, /* NumConnectedBoundaryFaces */
0, /* TotalNumBoundaryConnections */
&ShareConnectivityFromZone);
/*
* Write out the field data for the ordered zone.
*/
III = IMax * JMax;
I = TECDAT112(&III, &X[0][0], &DIsDouble);
I = TECDAT112(&III, &Y[0][0], &DIsDouble);
I = TECDAT112(&III, &P[0][0], &DIsDouble);
/*
* Calculate values for the I-ordered zone.
*/
for (I = 0; I < 50; I++)
{
XL[I] = I + 1;
YL[I] = sin((double)(I + 1) / 20.0);
}
/*
* Switch to the "line.plt" file (file number 2)
* and write out the line plot data.
*/
III = 2;
I = TECFIL112(&III);
/*
* Write the zone header information for the XY-data.
*/
IMax = 50;
JMax = 1;
KMax = 1;
SolTime = 0.0;
StrandID = 0; /* StaticZone */
I = TECZNE112((char*)"XY Line plot",
&ZoneType,
&IMax,
&JMax,
&KMax,
&ICellMax,
&JCellMax,
&KCellMax,
&SolTime,
&StrandID,
&ParentZn,
&IsBlock,
&NumFaceConnections,
&FaceNeighborMode,
0, /* TotalNumFaceNodes */
0, /* NumConnectedBoundaryFaces */
0, /* TotalNumBoundaryConnections */
NULL, /* PassiveVarList */
NULL, /* ValueLocation */
NULL, /* ShareVarFromZone */
&ShareConnectivityFromZone);
/*
* Write out the line plot.
*/
DIsDouble = 1;
III = IMax;
I = TECDAT112(&III, (float *) & XL[0], &DIsDouble);
I = TECDAT112(&III, (float *) & YL[0], &DIsDouble);
/*
* Switch back to the field plot file and write out
* the finite-element zone.
*/
III = 1;
I = TECFIL112(&III);
/*
* Move the coordinates so this zone's not on top of the other
*/
for (J = 0; J < 5; J++)
for (I = 0; I < 4; I++)
{
X[J][I] = (float)(I + 6);
Y[J][I] = (float)(J + 1);
P[J][I] = (float)((I + 1) * (J + 1));
}
/*
* Write the zone header information for the finite-element zone.
*/
ZoneType = 3; /* FEQuad */
NPts = 20; /* Number of points */
NElm = 12; /* Number of elements */
KMax = 0; /* Unused */
SolTime = 10.0;
StrandID = 2;
I = TECZNE112((char*)"Finite Zone 1",
&ZoneType,
&NPts,
&NElm,
&KMax,
&ICellMax,
&JCellMax,
&KCellMax,
&SolTime,
&StrandID,
&ParentZn,
&IsBlock,
&NumFaceConnections,
&FaceNeighborMode,
0, /* TotalNumFaceNodes */
0, /* NumConnectedBoundaryFaces */
0, /* TotalNumBoundaryConnections */
NULL, /* PassiveVarList */
NULL, /* ValueLocation */
NULL, /* ShareVarFromZone */
&ShareConnectivityFromZone);
/*
* Write out the field data for the finite-element zone.
*/
IMax = 4;
JMax = 5;
III = IMax * JMax;
DIsDouble = 0;
I = TECDAT112(&III, &X[0][0], &DIsDouble);
I = TECDAT112(&III, &Y[0][0], &DIsDouble);
I = TECDAT112(&III, &P[0][0], &DIsDouble);
/*
* Calculate and then write out the connectivity list.
* Note: The NM array references cells starting with
* offset of 1.
*/
for (I = 1; I < IMax; I++)
for (J = 1; J < JMax; J++)
{
K = I + (J - 1) * (IMax - 1);
L = I + (J - 1) * IMax;
NM[K-1][0] = L;
NM[K-1][1] = L + 1;
NM[K-1][2] = L + IMax + 1;
NM[K-1][3] = L + IMax;
}
I = TECNOD112((INTEGER4 *)NM);
/*
* Calculate values for the new solution variable.
*/
for (J = 0; J < 5; J++)
for (I = 0; I < 4; I++)
{
P[J][I] = (float)(2.0 * (I + 1) * (J + 1));
}
/*
* Write the zone header information for time step 2
*/
ZoneType = 0;
IMax = 4;
JMax = 5;
KMax = 1;
SolTime = 20.0;
StrandID = 1;
SharingZone[0] = 1;
SharingZone[1] = 1;
SharingZone[2] = 0; /* solution variable is not shared */
ShareConnectivityFromZone = 0;
I = TECZNE112((char*)"Ordered Zone 2",
&ZoneType,
&IMax,
&JMax,
&KMax,
&ICellMax,
&JCellMax,
&KCellMax,
&SolTime,
&StrandID,
&ParentZn,
&IsBlock,
&NumFaceConnections,
&FaceNeighborMode,
0, /* TotalNumFaceNodes */
0, /* NumConnectedBoundaryFaces */
0, /* TotalNumBoundaryConnections */
NULL,
NULL,
SharingZone,
&ShareConnectivityFromZone);
/*
* Write out the solution variable the grid variables are shared.
*/
IMax = 4;
JMax = 5;
III = IMax * JMax;
DIsDouble = 0;
I = TECDAT112(&III, &P[0][0], &DIsDouble);
/*
* Calculate values for the new solution variable.
*/
for (J = 0; J < 5; J++)
for (I = 0; I < 4; I++)
{
P[J][I] = (float)(3.0 * (I + 1) * (J + 1));
}
/*
* Write another time step for the FEZone and share from the first
*/
ZoneType = 3;
SolTime = 20.0;
StrandID = 2;
KMax = 0;
SharingZone[0] = 2;
SharingZone[1] = 2;
SharingZone[2] = 0; /* solution variable is not shared */
ShareConnectivityFromZone = 2;
I = TECZNE112((char*)"Finite Zone 2",
&ZoneType,
&NPts,
&NElm,
&KMax,
&ICellMax,
&JCellMax,
&KCellMax,
&SolTime,
&StrandID,
&ParentZn,
&IsBlock,
&NumFaceConnections,
&FaceNeighborMode,
0, /* TotalNumFaceNodes */
0, /* NumConnectedBoundaryFaces */
0, /* TotalNumBoundaryConnections */
NULL, /* PassiveVarList */
NULL, /* ValueLocation */
SharingZone,
&ShareConnectivityFromZone);
/*
* Write out the solution variable the grid variables are shared.
*/
IMax = 4;
JMax = 5;
III = IMax * JMax;
DIsDouble = 0;
I = TECDAT112(&III, &P[0][0], &DIsDouble);
/*
* Prepare to write out text record. Text is positioned
* at 0.5, 0.5 in frame units and has a height
* of 0.05 frame units.
*/
XP = 50.0;
YP = 50.0;
ZP = 0.0;
FH = 5.0;
Scope = 1; /* Local */
Clipping = 1; /* Clip to frame */
PositionCoordSys = 1; /* Frame */
FontType = 1; /* Helv Bold */
HeightUnits = 1; /* Frame */
AttachToZone = 0;
Zone = 0;
BoxType = 0; /* None */
BoxMargin = 5.0;
BoxLineThickness = 0.5;
BoxColor = 3;
BoxFillColor = 7;
TextAngle = 0.0;
Anchor = 0; /* Left */
LineSpacing = 1.0;
TextColor = 0; /* Black */
III = TECTXT112(&XP,
&YP,
&ZP,
&PositionCoordSys,
&AttachToZone,
&Zone,
&FontType,
&HeightUnits,
&FH,
&BoxType,
&BoxMargin,
&BoxLineThickness,
&BoxColor,
&BoxFillColor,
&TextAngle,
&Anchor,
&LineSpacing,
&TextColor,
&Scope,
&Clipping,
(char*)"Hi Mom",
(char*)"");
/*
* Prepare to write out geometry record (circle). Circle is
* positioned at 25, 25 (in frame units) and has a radius of
* 20 percent. Circle is drawn using a dashed line.
*/
XP = 25.0;
YP = 25.0;
ZP = 0.0;
IsFilled = 0;
Color = 0;
FillColor = 7;
GeomType = 3; /* Circle */
LinePattern = 1; /* Dashed */
LineThickness = 0.3;
PatternLength = 1.5;
NumEllipsePts = 72;
ArrowheadStyle = 0;
ArrowheadAttachment = 0;
ArrowheadSize = 0.1;
ArrowheadAngle = 15.0;
NumSegments = 1;
NumSegPts[0] = 1;
XGeomData[0] = 20.0;
YGeomData[0] = 0.0;
ZGeomData[0] = 0.0;
III = TECGEO112(&XP,
&YP,
&ZP,
&PositionCoordSys,
&AttachToZone,
&Zone,
&Color,
&FillColor,
&IsFilled,
&GeomType,
&LinePattern,
&PatternLength,
&LineThickness,
&NumEllipsePts,
&ArrowheadStyle,
&ArrowheadAttachment,
&ArrowheadSize,
&ArrowheadAngle,
&Scope,
&Clipping,
&NumSegments,
NumSegPts,
&XGeomData[0],
&YGeomData[0],
&ZGeomData[0],
(char*)"");
/*
* Close out file 1.
*/
I = TECEND112();
/*
* Close out file 2.
*/
III = 2;
I = TECFIL112(&III);
I = TECEND112();
return 0;
}

View File

@ -0,0 +1,467 @@
C
C Complex example FORTRAN program to write a
C binary data file for Tecplot. This example
C does the following:
C
C 1. Open a data file called "field.plt."
C 2. Open a data file called "line.plt."
C 3. Assign values for X, Y and P. These will be used
C in both the ordered and FE data files.
C 4. Write out an ordered zone dimensioned 4 x 5 to "field.plt."
C 5. Assign values for XL and YL arrays.
C 6. Write out data for line plot to "line.plt." Make the data
C use double precision.
C 7. Write out a finite element zone to "field.plt."
C 8. Write out a text record to "field.plt."
C 9. Write out a geometry (circle) record to "field.plt."
C 10. Close file 1.
C 11. Close file 2.
C
Program ComplexTest
Include "tecio.inc"
REAL*4 X(4,5), Y(4,5), P(4,5)
REAL*8 XL(50), YL(50)
REAL*4 XLDummy(1), YLDummy(1)
EQUIVALENCE (XLDummy(1), XL(1))
EQUIVALENCE (YLDummy(1), YL(1))
REAL*8 SolTime
INTEGER*4 Debug,I,J,K,L,III,NPts,NElm,DIsDouble,VIsDouble
INTEGER*4 IMax,JMax,KMax,NM(4,12),FileType
INTEGER*4 StrandID,ParentZn
INTEGER*4 SharingZone(3)
REAL*8 XP, YP, ZP, FH, LineSpacing, PatternLength
REAL*8 BoxMargin, BoxLineThickness, TextAngle
INTEGER*4 AttachToZone, Zone, Scope, PositionCoordSys
INTEGER*4 Clipping
INTEGER*4 FontType, HeightUnits, Anchor, BoxType
INTEGER*4 IsFilled, GeomType, LinePattern, NumEllipsePts
INTEGER*4 BoxColor, BoxFillColor, TextColor, Color, FillColor
INTEGER*4 ArrowheadStyle, ArrowheadAttachment, NumSegments
INTEGER*4 NumSegPts(1)
REAL*8 LineThickness, ArrowheadSize, ArrowheadAngle
REAL*4 XGeomData(1), YGeomData(1), ZGeomData(1)
CHARACTER*1 NULCHAR
INTEGER*4 Zero
POINTER (NullPtr,Null)
INTEGER*4 Null(*)
Debug = 2
VIsDouble = 0
FileType = 0
DIsDouble = 0
NULCHAR = CHAR(0)
Zero = 0
NullPtr = 0
C
C Open field.plt and write the header information.
C
I = TECINI112('DATASET WITH 1 ORDERED ZONE, '//
& '1 QUAD ZONE OVER 2 TIME STEPS'//NULCHAR,
& 'X Y P'//NULCHAR,
& 'field.plt'//NULCHAR,
& '.'//NULCHAR,
& FileType,
& Debug,
& VIsDouble)
C
C Open line.plt and write the header information.
C
VIsDouble = 1
I = TECINI112('DATASET WITH ONE I-ORDERED ZONE'//NULCHAR,
& 'X Y'//NULCHAR,
& 'line.plt'//NULCHAR,
& '.'//NULCHAR,
& FileType,
& Debug,
& VIsDouble)
C
C Calculate values for the field variables.
C
Do 10 J = 1,5
Do 10 I = 1,4
X(I,J) = I
Y(I,J) = J
P(I,J) = I*J
10 Continue
C
C Make sure writing to file #1.
C
III = 1
I = TECFIL112(III)
C
C Write the zone header information for the ordered zone.
C
IMax = 4
JMax = 5
KMax = 1
SolTime = 10.0
StrandID = 1
ParentZn = 0
I = TECZNE112('Ordered Zone 1'//NULCHAR,
& 0, ! ZONETYPE
& IMax,
& JMax,
& KMax,
& 0,
& 0,
& 0,
& SolTime,
& StrandID,
& ParentZn,
& 1, ! ISBLOCK
& 0, ! NumFaceConnections
& 0, ! FaceNeighborMode
& 0, ! TotalNumFaceNodes
& 0, ! NumConnectedBoundaryFaces
& 0, ! TotalNumBoundaryConnections
& Null, ! PassiveVarList
& Null, ! ValueLocation
& Null, ! ShareVarFromZone
& 0) ! ShareConnectivityFromZone)
C
C Write out the field data for the ordered zone.
C
III = IMax*JMax
I = TECDAT112(III,X,DIsDouble)
I = TECDAT112(III,Y,DIsDouble)
I = TECDAT112(III,P,DIsDouble)
C
C Calculate values for the I-ordered zone.
C
Do 20 I = 1,50
XL(I) = I
YL(I) = sin(I/20.0)
20 Continue
C
C Switch to the 'line.plt' file (file number 2)
C and write out the line plot data.
C
III = 2
I = TECFIL112(III)
C
C Write the zone header information for the XY-data.
C
IMax = 50
JMax = 1
KMax = 1
SolTime = 0.0
StrandID = 0
I = TECZNE112('XY Line plot'//NULCHAR,
& 0,
& IMax,
& JMax,
& KMax,
& 0,
& 0,
& 0,
& SolTime,
& StrandID,
& ParentZn,
& 1,
& 0,
& 0,
& 0,
& 0,
& 0,
& Null,
& Null,
& Null,
& 0)
C
C Write out the line plot.
C
DIsDouble = 1
III = IMax
I = TECDAT112(III,XLDummy,DIsDouble)
I = TECDAT112(III,YLDummy,DIsDouble)
C
C Switch back to the field plot file and write out
C the finite-element zone.
C
III = 1
I = TECFIL112(III)
C
C Move the coordinates so this zone's not on top of the other
C
Do 30 J = 1,5
Do 30 I = 1,4
X(I,J) = I+5
Y(I,J) = J
P(I,J) = I*J
30 Continue
C
C Write the zone header information for the finite-element zone.
C
NPts = 20
NElm = 12
KMax = 1
SolTime = 10.0
StrandID = 2
I = TECZNE112('Finite Zone 1'//NULCHAR,
& 3, ! FEQUADRILATERAL
& NPts,
& NElm,
& KMax,
& 0,
& 0,
& 0,
& SolTime,
& StrandID,
& ParentZn,
& 1,
& 0,
& 0,
& 0,
& 0,
& 0,
& Null,
& Null,
& Null,
& 0)
C
C Write out the field data for the finite-element zone.
C
IMax = 4
JMax = 5
III = IMax*JMax
DIsDouble = 0
I = TECDAT112(III,X,DIsDouble)
I = TECDAT112(III,Y,DIsDouble)
I = TECDAT112(III,P,DIsDouble)
C
C Calculate and then write out the connectivity list.
C Note: The NM array references cells starting with
C offset of 1.
C
Do 40 I = 1,IMax-1
Do 40 J = 1,JMax-1
K = I+(J-1)*(IMax-1)
L = I+(J-1)*IMax
NM(1,K) = L
NM(2,K) = L+1
NM(3,K) = L+IMax+1
NM(4,K) = L+IMax
40 Continue
I = TECNOD112(NM)
C
C Calculate vlues for the new solution variable.
C
Do 50 J = 1,5
Do 50 I = 1,4
P(I,J) = 2*I*J
50 Continue
C
C Write the zone header information for time step 2
C
IMax = 4
JMax = 5
KMax = 1
SolTime = 20.0
StrandID = 1
SharingZone(1) = 1
SharingZone(2) = 1
SharingZone(3) = 0
I = TECZNE112('Ordered Zone 2'//NULCHAR,
& 0, ! ORDERED
& IMax,
& JMax,
& KMax,
& 0,
& 0,
& 0,
& SolTime,
& StrandID,
& ParentZn,
& 1,
& 0,
& 0,
& 0,
& 0,
& 0,
& Null,
& Null,
& SharingZone,
& 0)
C
C Write out the solution variable the grid variables are shared.
C
IMax = 4
JMax = 5
III = IMax*JMax
DIsDouble = 0
I = TECDAT112(III,P,DIsDouble)
C
C Calculate values for the new solution variable.
C
Do 60 J = 1,5
Do 60 I = 1,4
P(I,J) = 3*I*J
60 Continue
C
C Write another time step for the FEZone and share from the first
C
SolTime = 20.0
StrandID = 2
KMax = 0
SharingZone(1) = 2
SharingZone(2) = 2
SharingZone(3) = 0
I = TECZNE112('Finite Zone 2'//NULCHAR,
& 3, ! FEQUADRILATERAL
& NPts,
& NElm,
& KMax,
& 0,
& 0,
& 0,
& SolTime,
& StrandID,
& ParentZn,
& 1,
& 0,
& 0,
& 0,
& 0,
& 0,
& Null,
& Null,
& SharingZone,
& 2)
C
C Write out the solution variable the grid variables are shared.
C
IMax = 4
JMax = 5
III = IMax*JMax
DIsDouble = 0
I = TECDAT112(III,P,DIsDouble)
C
C Prepare to write out text record. Text is positioned
C at 50, 50 in frame units and has a height 5 frame units.
C
XP = 50
YP = 50
FH = 5
Scope = 1
Clipping = 0
PositionCoordSys = 1
FontType = 1
HeightUnits = 1
AttachToZone = 0
Zone = 0
BoxType = 0
BoxMargin = 5.0
BoxLineThickness = 0.5
BoxColor = 3
BoxFillColor = 7
TextAngle = 0.0
Anchor = 0
LineSpacing = 1.5
TextColor = 0
III = TECTXT112(XP,
& YP,
& 0.0d0,
& PositionCoordSys,
& AttachToZone,
& Zone,
& FontType,
& HeightUnits,
& FH,
& BoxType,
& BoxMargin,
& BoxLineThickness,
& BoxColor,
& BoxFillColor,
& TextAngle,
& Anchor,
& LineSpacing,
& TextColor,
& Scope,
& Clipping,
& 'Hi Mom'//NULCHAR,
& NULCHAR)
C
C Prepare to write out geometry record (circle). Circle is
C positioned at 25, 25 in frame units and has a radius of 30.
C Circle is drawn using a dashed line pattern.
C
XP = 25
YP = 25
ZP = 0.0
IsFilled = 0
Color = 0
FillColor = 7
GeomType = 2
LinePattern = 1
LineThickness = 0.3
PatternLength = 1
NumEllipsePts = 72
ArrowheadStyle = 0
ArrowheadAttachment = 0
ArrowheadSize = 0.0
ArrowheadAngle = 15.0
NumSegments = 1
NumSegPts(1) = 1
XGeomData(1) = 30
YGeomData(1) = 0.0
ZGeomData(1) = 0.0
III = TECGEO112(XP,
& YP,
& ZP,
& PositionCoordSys,
& AttachToZone,
& Zone,
& Color,
& FillColor,
& IsFilled,
& GeomType,
& LinePattern,
& PatternLength,
& LineThickness,
& NumEllipsePts,
& ArrowheadStyle,
& ArrowheadAttachment,
& ArrowheadSize,
& ArrowheadAngle,
& Scope,
& Clipping,
& NumSegments,
& NumSegPts,
& XGeomData,
& YGeomData,
& ZGeomData,
& NULCHAR)
C
C Close out file 1.
C
I = TECEND112()
C
C Close out file 2.
C
III = 2
I = TECFIL112(III)
I = TECEND112()
STOP
END

View File

@ -0,0 +1,467 @@
!
! Complex example FORTRAN program to write a
! binary data file for Tecplot. This example
! does the following:
!
! 1. Open a data file called "field.plt."
! 2. Open a data file called "line.plt."
! 3. Assign values for X, Y and P. These will be used
! in both the ordered and FE data files.
! 4. Write out an ordered zone dimensioned 4 x 5 to "field.plt."
! 5. Assign values for XL and YL arrays.
! 6. Write out data for line plot to "line.plt." Make the data
! use double precision.
! 7. Write out a finite element zone to "field.plt."
! 8. Write out a text record to "field.plt."
! 9. Write out a geometry (circle) record to "field.plt."
! 10. Close file 1.
! 11. Close file 2.
!
Program ComplexTest
Include "tecio.f90"
REAL*4 X(4,5), Y(4,5), P(4,5)
REAL*8 XL(50), YL(50)
REAL*4 XLDummy(1), YLDummy(1)
EQUIVALENCE (XLDummy(1), XL(1))
EQUIVALENCE (YLDummy(1), YL(1))
REAL*8 SolTime
INTEGER*4 Debug,I,J,K,L,III,NPts,NElm,DIsDouble,VIsDouble,FileType
INTEGER*4 IMax,JMax,KMax,NM(4,12)
INTEGER*4 StrandID,ParentZn
INTEGER*4 SharingZone(3)
REAL*8 XP, YP, ZP, FH, LineSpacing, PatternLength
REAL*8 BoxMargin, BoxLineThickness, TextAngle
INTEGER*4 AttachToZone, Zone, Scope, PositionCoordSys
INTEGER*4 Clipping
INTEGER*4 FontType, HeightUnits, Anchor, BoxType
INTEGER*4 IsFilled, GeomType, LinePattern, NumEllipsePts
INTEGER*4 BoxColor, BoxFillColor, TextColor, Color, FillColor
INTEGER*4 ArrowheadStyle, ArrowheadAttachment, NumSegments
INTEGER*4 NumSegPts(1)
REAL*8 LineThickness, ArrowheadSize, ArrowheadAngle
REAL*4 XGeomData(1), YGeomData(1), ZGeomData(1)
CHARACTER*1 NULCHAR
INTEGER*4 Zero
POINTER (NullPtr,Null)
INTEGER*4 Null(*)
Debug = 2
VIsDouble = 0
FileType = 0
DIsDouble = 0
NULCHAR = CHAR(0)
Zero = 0
NullPtr = 0
!
! Open field.plt and write the header information.
!
I = TECINI112('DATASET WITH 1 ORDERED ZONE, '// &
'1 QUAD ZONE OVER 2 TIME STEPS'//NULCHAR, &
'X Y P'//NULCHAR, &
'field.plt'//NULCHAR, &
'.'//NULCHAR, &
FileType, &
Debug, &
VIsDouble)
!
! Open line.plt and write the header information.
!
VIsDouble = 1
I = TECINI112('DATASET WITH ONE I-ORDERED ZONE'//NULCHAR, &
'X Y'//NULCHAR, &
'line.plt'//NULCHAR, &
'.'//NULCHAR, &
FileType, &
Debug, &
VIsDouble)
!
! Calculate values for the field variables.
!
Do 10 J = 1,5
Do 10 I = 1,4
X(I,J) = I
Y(I,J) = J
P(I,J) = I*J
10 Continue
!
! Make sure writing to file #1.
!
III = 1
I = TECFIL112(III)
!
! Write the zone header information for the ordered zone.
!
IMax = 4
JMax = 5
KMax = 1
SolTime = 10.0
StrandID = 1
ParentZn = 0
I = TECZNE112('Ordered Zone 1'//NULCHAR, &
0, & ! ZONETYPE
IMax, &
JMax, &
KMax, &
0, &
0, &
0, &
SolTime, &
StrandID, &
ParentZn, &
1, & ! ISBLOCK
0, & ! NumFaceConnections
0, & ! FaceNeighborMode
0, & ! TotalNumFaceNodes
0, & ! NumConnectedBoundaryFaces
0, & ! TotalNumBoundaryConnections
Null, & ! PassiveVarList
Null, & ! ValueLocation
Null, & ! ShareVarFromZone
0) ! ShareConnectivityFromZone)
!
! Write out the field data for the ordered zone.
!
III = IMax*JMax
I = TECDAT112(III,X,DIsDouble)
I = TECDAT112(III,Y,DIsDouble)
I = TECDAT112(III,P,DIsDouble)
!
! Calculate values for the I-ordered zone.
!
Do 20 I = 1,50
XL(I) = I
YL(I) = sin(I/20.0)
20 Continue
!
! Switch to the 'line.plt' file (file number 2)
! and write out the line plot data.
!
III = 2
I = TECFIL112(III)
!
! Write the zone header information for the XY-data.
!
IMax = 50
JMax = 1
KMax = 1
SolTime = 0.0
StrandID = 0
I = TECZNE112('XY Line plot'//NULCHAR, &
0, &
IMax, &
JMax, &
KMax, &
0, &
0, &
0, &
SolTime, &
StrandID, &
ParentZn, &
1, &
0, &
0, &
0, &
0, &
0, &
Null, &
Null, &
Null, &
0)
!
! Write out the line plot.
!
DIsDouble = 1
III = IMax
I = TECDAT112(III,XLDummy,DIsDouble)
I = TECDAT112(III,YLDummy,DIsDouble)
!
! Switch back to the field plot file and write out
! the finite-element zone.
!
III = 1
I = TECFIL112(III)
!
! Move the coordinates so this zone's not on top of the other
!
Do 30 J = 1,5
Do 30 I = 1,4
X(I,J) = I+5
Y(I,J) = J
P(I,J) = I*J
30 Continue
!
! Write the zone header information for the finite-element zone.
!
NPts = 20
NElm = 12
KMax = 1
SolTime = 10.0
StrandID = 2
I = TECZNE112('Finite Zone 1'//NULCHAR, &
3, & ! FEQUADRILATERAL
NPts, &
NElm, &
KMax, &
0, &
0, &
0, &
SolTime, &
StrandID, &
ParentZn, &
1, &
0, &
0, &
0, &
0, &
0, &
Null, &
Null, &
Null, &
0)
!
! Write out the field data for the finite-element zone.
!
IMax = 4
JMax = 5
III = IMax*JMax
DIsDouble = 0
I = TECDAT112(III,X,DIsDouble)
I = TECDAT112(III,Y,DIsDouble)
I = TECDAT112(III,P,DIsDouble)
!
! Calculate and then write out the connectivity list.
! Note: The NM array references cells starting with
! offset of 1.
!
Do 40 I = 1,IMax-1
Do 40 J = 1,JMax-1
K = I+(J-1)*(IMax-1)
L = I+(J-1)*IMax
NM(1,K) = L
NM(2,K) = L+1
NM(3,K) = L+IMax+1
NM(4,K) = L+IMax
40 Continue
I = TECNOD112(NM)
!
! Calculate vlues for the new solution variable.
!
Do 50 J = 1,5
Do 50 I = 1,4
P(I,J) = 2*I*J
50 Continue
!
! Write the zone header information for time step 2
!
IMax = 4
JMax = 5
KMax = 1
SolTime = 20.0
StrandID = 1
SharingZone(1) = 1
SharingZone(2) = 1
SharingZone(3) = 0
I = TECZNE112('Ordered Zone 2'//NULCHAR, &
0, & ! ORDERED
IMax, &
JMax, &
KMax, &
0, &
0, &
0, &
SolTime, &
StrandID, &
ParentZn, &
1, &
0, &
0, &
0, &
0, &
0, &
Null, &
Null, &
SharingZone, &
0)
!
! Write out the solution variable the grid variables are shared.
!
IMax = 4
JMax = 5
III = IMax*JMax
DIsDouble = 0
I = TECDAT112(III,P,DIsDouble)
!
! Calculate values for the new solution variable.
!
Do 60 J = 1,5
Do 60 I = 1,4
P(I,J) = 3*I*J
60 Continue
!
! Write another time step for the FEZone and share from the first
!
SolTime = 20.0
StrandID = 2
KMax = 0
SharingZone(1) = 2
SharingZone(2) = 2
SharingZone(3) = 0
I = TECZNE112('Finite Zone 2'//NULCHAR, &
3, & ! FEQUADRILATERAL
NPts, &
NElm, &
KMax, &
0, &
0, &
0, &
SolTime, &
StrandID, &
ParentZn, &
1, &
0, &
0, &
0, &
0, &
0, &
Null, &
Null, &
SharingZone, &
2)
!
! Write out the solution variable the grid variables are shared.
!
IMax = 4
JMax = 5
III = IMax*JMax
DIsDouble = 0
I = TECDAT112(III,P,DIsDouble)
!
! Prepare to write out text record. Text is positioned
! at 50, 50 in frame units and has a height 5 frame units.
!
XP = 50
YP = 50
FH = 5
Scope = 1
Clipping = 0
PositionCoordSys = 1
FontType = 1
HeightUnits = 1
AttachToZone = 0
Zone = 0
BoxType = 0
BoxMargin = 5.0
BoxLineThickness = 0.5
BoxColor = 3
BoxFillColor = 7
TextAngle = 0.0
Anchor = 0
LineSpacing = 1.5
TextColor = 0
III = TECTXT112(XP, &
YP, &
0.0d0, &
PositionCoordSys, &
AttachToZone, &
Zone, &
FontType, &
HeightUnits, &
FH, &
BoxType, &
BoxMargin, &
BoxLineThickness, &
BoxColor, &
BoxFillColor, &
TextAngle, &
Anchor, &
LineSpacing, &
TextColor, &
Scope, &
Clipping, &
'Hi Mom'//NULCHAR, &
NULCHAR)
!
! Prepare to write out geometry record (circle). Circle is
! positioned at 25, 25 in frame units and has a radius of 30.
! Circle is drawn using a dashed line pattern.
!
XP = 25
YP = 25
ZP = 0.0
IsFilled = 0
Color = 0
FillColor = 7
GeomType = 2
LinePattern = 1
LineThickness = 0.3
PatternLength = 1
NumEllipsePts = 72
ArrowheadStyle = 0
ArrowheadAttachment = 0
ArrowheadSize = 0.0
ArrowheadAngle = 15.0
NumSegments = 1
NumSegPts(1) = 1
XGeomData(1) = 30
YGeomData(1) = 0.0
ZGeomData(1) = 0.0
III = TECGEO112(XP, &
YP, &
ZP, &
PositionCoordSys, &
AttachToZone, &
Zone, &
Color, &
FillColor, &
IsFilled, &
GeomType, &
LinePattern, &
PatternLength, &
LineThickness, &
NumEllipsePts, &
ArrowheadStyle, &
ArrowheadAttachment, &
ArrowheadSize, &
ArrowheadAngle, &
Scope, &
Clipping, &
NumSegments, &
NumSegPts, &
XGeomData, &
YGeomData, &
ZGeomData, &
NULCHAR)
!
! Close out file 1.
!
I = TECEND112()
!
! Close out file 2.
!
III = 2
I = TECFIL112(III)
I = TECEND112()
STOP
END

View File

@ -0,0 +1,346 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="comtestc"
ProjectGUID="{723FBFD1-5AF2-4154-B77A-CE3849EAFCA2}"
RootNamespace="comtestc"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
<Platform
Name="x64"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(PlatformName)/$(ConfigurationName)"
IntermediateDirectory="$(SolutionDir)$(PlatformName)/$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="..\TecIO_Examples.vsprops"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="2"
AdditionalLibraryDirectories=""
GenerateDebugInformation="true"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|x64"
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="..\TecIO_Examples.vsprops"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="2"
AdditionalLibraryDirectories=""
GenerateDebugInformation="true"
SubSystem="1"
TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(PlatformName)/$(ConfigurationName)"
IntermediateDirectory="$(SolutionDir)$(PlatformName)/$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="..\TecIO_Examples.vsprops"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="1"
AdditionalLibraryDirectories=""
GenerateDebugInformation="true"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|x64"
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="..\TecIO_Examples.vsprops"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="1"
AdditionalLibraryDirectories=""
GenerateDebugInformation="true"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<File
RelativePath=".\comtest.c"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<VisualStudioProject ProjectCreator="Intel Fortran" Keyword="Console Application" Version="9.10" ProjectIdGuid="{861BC05F-1E95-401A-A80E-7589ADD1C79E}">
<Platforms>
<Platform Name="Win32"/></Platforms>
<Configurations>
<Configuration Name="Debug|Win32" OutputDirectory="$(SolutionDir)$(PlatformName)/$(ConfigurationName)" IntermediateDirectory="$(SolutionDir)$(PlatformName)/$(ConfigurationName)" DeleteExtensionsOnClean="*.obj;*.mod;*.pdb;*.asm;*.map;*.dyn;*.dpi;*.tmp;*.log;*.ilk;*.exe;$(TargetPath)">
<Tool Name="VFMidlTool" SuppressStartupBanner="true" HeaderFileName="$(InputName).h" TypeLibraryName="$(IntDir)/$(InputName).tlb"/>
<Tool Name="VFPreBuildEventTool"/>
<Tool Name="VFFortranCompilerTool" SuppressStartupBanner="true" DebugInformationFormat="debugEnabled" Optimization="optimizeDisabled" AdditionalIncludeDirectories="$(TEC_360_2009)/Include" ModulePath="$(INTDIR)/" ObjectFile="$(INTDIR)/" Traceback="true" BoundsCheck="true" RuntimeLibrary="rtMultiThreadedDebug" CompileOnly="true"/>
<Tool Name="VFPostBuildEventTool"/>
<Tool Name="VFCustomBuildTool"/>
<Tool Name="VFLinkerTool" OutputFile="$(OUTDIR)/comtestf.exe" LinkIncremental="linkIncrementalNo" SuppressStartupBanner="true" AdditionalLibraryDirectories="$(TEC_360_2009)/Bin" GenerateDebugInformation="true" ProgramDatabaseFile="$(OUTDIR)/comtestf.pdb" SubSystem="subSystemConsole" AdditionalDependencies="tecio.lib"/>
<Tool Name="VFResourceCompilerTool" ResourceOutputFileName="$(IntDir)/$(InputName).res"/>
<Tool Name="VFPreLinkEventTool"/></Configuration>
<Configuration Name="Release|Win32" OutputDirectory="$(SolutionDir)$(PlatformName)/$(ConfigurationName)" IntermediateDirectory="$(SolutionDir)$(PlatformName)/$(ConfigurationName)" DeleteExtensionsOnClean="*.obj;*.mod;*.pdb;*.asm;*.map;*.dyn;*.dpi;*.tmp;*.log;*.ilk;*.exe;$(TargetPath)" MustRebuild="true">
<Tool Name="VFMidlTool" SwitchesHaveChanged="true" SuppressStartupBanner="true" HeaderFileName="$(InputName).h" TypeLibraryName="$(IntDir)/$(InputName).tlb"/>
<Tool Name="VFPreBuildEventTool"/>
<Tool Name="VFFortranCompilerTool" SwitchesHaveChanged="true" SuppressStartupBanner="true" AdditionalIncludeDirectories="$(TEC_360_2009)/Include" ModulePath="$(INTDIR)/" ObjectFile="$(INTDIR)/" RuntimeLibrary="rtMultiThreaded" CompileOnly="true"/>
<Tool Name="VFPostBuildEventTool"/>
<Tool Name="VFCustomBuildTool"/>
<Tool Name="VFLinkerTool" SwitchesHaveChanged="true" MustRebuild="true" OutputFile="$(OUTDIR)/comtestf.exe" LinkIncremental="linkIncrementalNo" SuppressStartupBanner="true" AdditionalLibraryDirectories="$(TEC_360_2009)/Bin" SubSystem="subSystemConsole" AdditionalDependencies="tecio.lib"/>
<Tool Name="VFResourceCompilerTool" SwitchesHaveChanged="true" ResourceOutputFileName="$(IntDir)/$(InputName).res"/>
<Tool Name="VFPreLinkEventTool"/></Configuration></Configurations>
<Files>
<File RelativePath="comtest.f90"/></Files>
<Globals/></VisualStudioProject>

View File

@ -0,0 +1,11 @@
# Set to appropriate C++ compiler
CPP=g++
CPPFLAGS=-I../../tecsrc ../../tecio.a
EXECUTABLE=faceneighbors
FILES=$(EXECUTABLE).cpp
build:
$(CPP) $(FILES) $(CPPFLAGS) -o $(EXECUTABLE)
clean:
rm -f $(EXECUTABLE)

View File

@ -0,0 +1,354 @@
/* This example illustrates how to create two simple
* FE-quadilateral zones and create a face neighbor
* connection between the two zones. In order to keep the
* example as simple as possible, error checking is not included.
*/
#include "TECIO.h"
#include "MASTER.h"
int main()
{
/* Initialize the Data File using TECINI. TECINI is required
* for all data files. It is used to: open the data file and
* initialize the file header information (name the data file,
* the variables for the data file, and the file type).
*/
/* DOCSTART:faceneighbors_tecini.txt*/
INTEGER4 Debug = 1;
INTEGER4 VIsDouble = 0;
INTEGER4 FileType = 0;
INTEGER4 I = 0; /* Used to track return codes */
I = TECINI112((char*)"Face Neighbors Example", /* Specifies the name
* of the entire
* dataset
*/
(char*)"X Y P", /* Defines the
* variables for the
* data file. Each
* zone must contain
* each of the vars
* listed. The order
* of the variables in
* the list is used to
* define the variable
* number (e.g. X is
* Var 1.)
*/
(char*)"FaceNeighbors.plt", /* Specifies the
* file name.
*/
(char*)".",
&FileType, /* The FileType is set to
* zero, indicating it is
* a full file (containing
* both grid and solution
* data).
*/
&Debug,
&VIsDouble);
/* DOCEND */
/* After TECINI is called, call TECZNE to create one or
* more zones for your data file.
*/
/* DOCSTART:faceneighbors_teczne1.txt*/
INTEGER4 ZoneType = 3; /* set the zone type to
* FEQuadrilateral
*/
INTEGER4 NumPts = 6;
INTEGER4 NumElems = 2;
INTEGER4 NumFaces = 8;
INTEGER4 ICellMax = 0; /* not used */
INTEGER4 JCellMax = 0; /* not used */
INTEGER4 KCellMax = 0; /* not used */
double SolTime = 360.0;
INTEGER4 StrandID = 0; /* StaticZone */
INTEGER4 ParentZn = 0;
INTEGER4 IsBlock = 1; /* Block */
INTEGER4 NFConns = 1; /* Specify the number of Face
* Neighbor Connections in the
* Zone. When this value is
* greater than zero, TECFACE must
* be called prior to creating the
* next zone or ending the file.
*/
/* Specify the Face Neighbor Mode.
* A value of 2 indicated that the face neighbor mode is global
* one-to-one. The scope of the face neighbors (local or
* global) is with respect to the zones. A value of global
* indicates that the face neighbor(s) is/are shared aross zones;
* a value of local indicates that the face neighbor(s) are
* shared within the current zone. The terms one-to-one and
* one-to-many are used to indicate whether the face in question
* is shared with one cell or several cells.
* For example, if your data is arranged as follows:
-----------------------
| | | |
| 1 | 2 | 3 |
| | | |
-----------------------
| | |
| 4 | 5 |
| | |
-----------------------
* The face between 1 & 4 is local-one-to-one. The face between
* 5 and (2 & 3) is local one-to-many.
*/
INTEGER4 FNMode = 2;
INTEGER4 TotalNumFaceNodes = 1; /* Not used for
* FEQuad zones*/
INTEGER4 NumConnectedBoundaryFaces = 1; /* Not used for
* FEQuad zones*/
INTEGER4 TotalNumBoundaryConnections = 1; /* Not used for
* FEQuad zones*/
INTEGER4 ShrConn = 0;
INTEGER4 ValueLocation[3] = {1, 1, 1}; /* Specify the variable
* values at the nodes.
* NOTE: Because all of
* the variables are
* defined at the nodes,
* we can just pass
* NULL for this array.
* We are providing the
* array for illustration
* purposes.
*/
I = TECZNE112((char*)"Zone 1",
&ZoneType,
&NumPts,
&NumElems,
&NumFaces,
&ICellMax,
&JCellMax,
&KCellMax,
&SolTime,
&StrandID,
&ParentZn,
&IsBlock,
&NFConns,
&FNMode,
&TotalNumFaceNodes,
&NumConnectedBoundaryFaces,
&TotalNumBoundaryConnections,
NULL,
ValueLocation,
NULL,
&ShrConn);
/* DOCEND */
/* Set up the variable values. The variable values will be
* written to the file using TECDAT. Because we are specifying
* nodal variables (as specified via the ValueLocation
* parameter in TECZNE, each variable is dimensioned by the
* number of points (NumPts) in the Zone. You have the option
* to specify some variables with nodal values and some with
* cell-centered values. Refer to the Binary Function
* Reference for details.
*/
/* DOCSTART:faceneighbors_tecdat1.txt*/
float *X = new float[NumPts];
float *Y = new float[NumPts];
float *P = new float[NumPts];
/* For this example, we will create 2 rectangular cells in Zone
* 1. Before defining your variables, you must establish a
* consistent node numbering scheme for your data. Once the
* node numbers are defined, supply the variable values in the
* node numbering order. In this example, node 1 is defined at
* X = 0 and Y = 0. As such, the first value supplied for X
* (i.e. X[0]) is 0. Similarly, the first value supplied for Y
* is 0.
*
* It is important that you refer to node numbers consistently.
* The node numbers will be used later to define the
* connectivity for each element.
*/
X[0] = 0;
X[1] = 0;
X[2] = 1;
X[3] = 1;
X[4] = 2;
X[5] = 2;
Y[0] = 0;
Y[1] = 1;
Y[2] = 0;
Y[3] = 1;
Y[4] = 0;
Y[5] = 1;
for (INTEGER4 ii = 0; ii < NumPts; ii++)
P[ii] = (float)(NumPts - ii);
INTEGER4 DIsDouble = 0; /* Set DIsDouble to zero to use
* variables in float format.
*/
/* Call TECDAT once for each variable */
I = TECDAT112(&NumPts, &X[0], &DIsDouble);
I = TECDAT112(&NumPts, &Y[0], &DIsDouble);
I = TECDAT112(&NumPts, &P[0], &DIsDouble);
/* DOCEND */
/* Define the face neighbors connections.
* The Connectivity List is used to specify the nodes that
* compose each element. When working with nodal variables, the
* numbering of the nodes is implicitly defined when the
* variables are declared. The first value of each variable is
* for node one, the second value for node two, and so on.
*
* Because this zone contains two quadilateral elements, we must
* supply 8 values in the connectivity list. The first four
* values define the nodes that form element 1. Similarly, the
* second four values define the nodes that form element 2.
*/
/* DOCSTART:faceneighbors_tecnod1.txt*/
INTEGER4 ConnList[8] = {1, 3, 4, 2,
3, 5, 6, 4
};
I = TECNOD112(ConnList);
/* DOCEND */
/* TIP! It is important to provide the node list in either a
* clockwise or counter-clockwise order. Otherwise, your
* elements will be misformed. For example, if the first two
* numbers in the above connectivity list, the zone would
* appear as follows:
*/
/* Now that TECNOD has been called, the creation of Zone 1
* is complete. However, in this example, we will define a
* face neighbor between Zone 1 and Zone 2 (to be created
* later in the example). Face Neighbor connections are used
* to define connections that are not created via the
* connectivity list. For example, local face neighbors may
* need to be defined when a zone wraps itself and global face
* neighbors may need to be defined to smooth edges across
* zones. Face Neighbors are used when deriving variables and
* drawing contours.
*
* In this example, we are creating a face neighbor connection
* between cell 2 in Zone 1 and cell 1 in Zone 2. The
* information required when specifying face neighbors
* depends upon the type of connection.
*
* In this case, we must supply (in this order):
* - the cell number in the current zone that contains the
* - the number of the face in that cell that contains the
* face neighbor
* - the number of the other zone to which the face is
* connected
* - the number of the cell in the other zone to which the
* face is connected
* The face numbering for cell-based finite elements is
* defined using the picture displayed in the Data Format
* Guide. In this example, face 2 in cell 2 in the current
* zone is connected to cell 1 in zone 2.
*/
/* DOCSTART:faceneighbors_tecface1.txt*/
INTEGER4 FaceConn[4] = {2, 2, 2, 1};
I = TECFACE112(FaceConn);
/* DOCEND */
/* The creation of Zone 1 is complete. We are ready to create
* Zone 2. For simplicity, Zone 2 is a copy of Zone 1 shifted
* along the X-axis. As such, many of the variables used to
* create Zone 1 are re-used here.
*/
/* DOCSTART:faceneighbors_teczne2.txt*/
/* Call TECZNE to create Zone 2 */
I = TECZNE112((char*)"Zone 2",
&ZoneType,
&NumPts,
&NumElems,
&NumFaces,
&ICellMax,
&JCellMax,
&KCellMax,
&SolTime,
&StrandID,
&ParentZn,
&IsBlock,
&NFConns,
&FNMode,
&TotalNumFaceNodes,
&NumConnectedBoundaryFaces,
&TotalNumBoundaryConnections,
NULL,
ValueLocation,
NULL,
&ShrConn);
/* DOCEND */
/* Define the variables for Zone 2. Because Zone 2 is a copy
* of Zone 1, shifted along the X-axis, we can share the Y
* variable definition used to Zone. We will also create a
* second pressure variable for Zone 2 (P2).
*/
/* DOCSTART:faceneighbors_tecdat2.txt*/
float *X2 = new float[NumPts];
float *P2 = new float[NumPts];
for (INTEGER4 ii = 0; ii < NumPts; ii++)
{
X2[ii] = X[ii] + 2;
P2[ii] = 2 * (float)ii;
}
I = TECDAT112(&NumPts, &X2[0], &DIsDouble);
I = TECDAT112(&NumPts, &Y[0], &DIsDouble);
I = TECDAT112(&NumPts, &P2[0], &DIsDouble);
delete X;
delete Y;
delete P;
delete X2;
delete P2;
/* DOCEND */
/* As with Zone 1, we must define the connectivity list for
* Zone 2. Because, the node numbering restarts at one for each
* new zone and the nodal arrangement is identical between the
* two zones, we may reuse the connectivity list from Zone 1.
*/
/* DOCSTART:faceneighbors_tecnod2.txt*/
I = TECNOD112(ConnList);
/* DOCEND */
/* We will now specify the face neighbor connection with
* respect to our new current zone of Zone 2.
*/
/* DOCSTART:faceneighbors_tecface2.txt*/
INTEGER4 FaceConn2[4] = {1, 4, 1, 2}; /* cell 1, face 4 in
* current zone is a
* neighbor to cell 2 in
* zone 1.
*/
I = TECFACE112(FaceConn2);
/* DOCEND */
/* Call TECEND to close the file */
/* DOCSTART:faceneighbors_tecend.txt*/
I = TECEND112();
/* DOCEND */
return 0;
}

View File

@ -0,0 +1,172 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="faceneighbors"
ProjectGUID="{1074FD63-4831-4D1B-8A27-94A3AC33A509}"
RootNamespace="faceneighbors"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="..\TecIO_Examples.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="..\TecIO_Examples.vsprops"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
RuntimeLibrary="2"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<File
RelativePath=".\faceneighbors.cpp"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -0,0 +1,11 @@
# Set to appropriate C++ compiler
CPP=g++
CPPFLAGS=-I../../tecsrc ../../tecio.a
EXECUTABLE=gridsolution
FILES=$(EXECUTABLE).cpp
build:
$(CPP) $(FILES) $(CPPFLAGS) -o $(EXECUTABLE)
clean:
rm -f $(EXECUTABLE)

View File

@ -0,0 +1,376 @@
/* This example illustrates using separate grid
* and solution files.
*/
#include "TECIO.h"
#include "MASTER.h" /* for defintion of NULL */
int main()
{
/* DOCSTART:gridsolution_grid_tecini.txt*/
INTEGER4 I; /* use to check return values */
INTEGER4 Debug = 1;
INTEGER4 VIsDouble = 0;
INTEGER4 FileType = 1; /* 1 = grid file. */
I = TECINI112((char*)"Example: Separate grid and solution files",
(char*)"X Y Z", /* Defines the variables for the data file.
* Each zone must contain each of the vars
* listed here. The order of the variables
* in the list is used to define the
* variable number (e.g. X is Variable 1).
* When referring to variables in other
* TecIO functions, you will refer to the
* variable by its number.
*/
(char*)"grid.plt",
(char*)".", /* scratch directory */
&FileType,
&Debug,
&VIsDouble);
/* DOCEND */
/* DOCSTART:gridsolution_grid_teczne.txt*/
/* TECZNE Parameters */
INTEGER4 ZoneType = 7; /* FE Polyhedron */
INTEGER4 NumPts = 20; /* the number of unique
* nodes in the zone.
*/
INTEGER4 NumElems = 1;
INTEGER4 NumFaces = 12; /* the number of unique
* faces in the zone.
*/
INTEGER4 ICellMax = 0; /* not used */
INTEGER4 JCellMax = 0; /* not used */
INTEGER4 KCellMax = 0; /* not used */
double SolutionTime = 0.0;
INTEGER4 StrandID = 1; /* time strand for
* unsteady solution.
*/
INTEGER4 ParentZone = 0;
INTEGER4 IsBlock = 1;
INTEGER4 NumFaceConnections = 0;
INTEGER4 FaceNeighborMode = 1;
INTEGER4 SharConn = 0;
/* For this zone, the total number of face nodes is
* five times number of faces, because each face
* is a pentagon.
*/
INTEGER4 TotalNumFaceNodes = 5 * NumFaces;
/* This zone has no connected boundary faces.
*/
INTEGER4 TotalNumBndryFaces = 0;
INTEGER4 TotalNumBndryConns = 0;
I = TECZNE112((char*)"Dodecahedron", /* Name of the zone. */
&ZoneType,
&NumPts,
&NumElems,
&NumFaces,
&ICellMax,
&JCellMax,
&KCellMax,
&SolutionTime,
&StrandID,
&ParentZone,
&IsBlock,
&NumFaceConnections,
&FaceNeighborMode,
&TotalNumFaceNodes,
&TotalNumBndryFaces,
&TotalNumBndryConns,
NULL,
NULL, /* All nodal variables */
NULL,
&SharConn);
/* DOCEND */
/* DOCSTART:gridsolution_grid_tecdat.txt*/
/* TECDAT Parameters */
double Phi = 0.5 * (1.0 + sqrt(5.0));
double Pi = 3.141592653578;
double *X = new double[NumPts];
double *Y = new double[NumPts];
double *Z = new double[NumPts];
int Count = 0;
for(int J = 0; J <= 4; J++)
{
X[Count] = 2.0 * cos(2.0 / 5.0 * Pi * J);
Y[Count] = 2.0 * sin(2.0 / 5.0 * Pi * J);
Z[Count] = Phi + 1.0;
Count++;
X[Count] = -X[Count - 1];
Y[Count] = -Y[Count - 1];
Z[Count] = -Z[Count - 1];
Count++;
X[Count] = 2.0 * Phi * cos(2.0 / 5.0 * Pi * J);
Y[Count] = 2.0 * Phi * sin(2.0 / 5.0 * Pi * J);
Z[Count] = Phi - 1.0;
Count++;
X[Count] = -X[Count - 1];
Y[Count] = -Y[Count - 1];
Z[Count] = -Z[Count - 1];
Count++;
}
INTEGER4 IsDouble = 1;
I = TECDAT112(&NumPts, X, &IsDouble);
I = TECDAT112(&NumPts, Y, &IsDouble);
I = TECDAT112(&NumPts, Z, &IsDouble);
delete X;
delete Y;
delete Z;
/* DOCEND */
/* DOCSTART:gridsolution_grid_facenodes.txt*/
/* TecPoly Parameters */
/* Create a FaceNodes array, dimensioned by the total number
* of face nodes in the zone.
*/
INTEGER4 *FaceNodes = new INTEGER4[TotalNumFaceNodes];
int n = 0;
/* Face Nodes for face 1 of the dodecahedron */
FaceNodes[n++] = 2;
FaceNodes[n++] = 6;
FaceNodes[n++] = 10;
FaceNodes[n++] = 14;
FaceNodes[n++] = 18;
/* Face Nodes for face 2 */
FaceNodes[n++] = 6;
FaceNodes[n++] = 8;
FaceNodes[n++] = 19;
FaceNodes[n++] = 12;
FaceNodes[n++] = 10;
/* Face Nodes for face 3 */
FaceNodes[n++] = 3;
FaceNodes[n++] = 12;
FaceNodes[n++] = 10;
FaceNodes[n++] = 14;
FaceNodes[n++] = 16;
/* Face Nodes for face 4 */
FaceNodes[n++] = 7;
FaceNodes[n++] = 16;
FaceNodes[n++] = 14;
FaceNodes[n++] = 18;
FaceNodes[n++] = 20;
/* Face Nodes for face 5 */
FaceNodes[n++] = 2;
FaceNodes[n++] = 4;
FaceNodes[n++] = 11;
FaceNodes[n++] = 20;
FaceNodes[n++] = 18;
/* Face Nodes for face 6 */
FaceNodes[n++] = 2;
FaceNodes[n++] = 4;
FaceNodes[n++] = 15;
FaceNodes[n++] = 8;
FaceNodes[n++] = 6;
/* Face Nodes for face 7 */
FaceNodes[n++] = 1;
FaceNodes[n++] = 3;
FaceNodes[n++] = 12;
FaceNodes[n++] = 19;
FaceNodes[n++] = 17;
/* Face Nodes for face 8 */
FaceNodes[n++] = 1;
FaceNodes[n++] = 3;
FaceNodes[n++] = 16;
FaceNodes[n++] = 7;
FaceNodes[n++] = 5;
/* Face Nodes for face 9 */
FaceNodes[n++] = 5;
FaceNodes[n++] = 7;
FaceNodes[n++] = 20;
FaceNodes[n++] = 11;
FaceNodes[n++] = 9;
/* Face Nodes for face 10 */
FaceNodes[n++] = 4;
FaceNodes[n++] = 11;
FaceNodes[n++] = 9;
FaceNodes[n++] = 13;
FaceNodes[n++] = 15;
/* Face Nodes for face 11 */
FaceNodes[n++] = 8;
FaceNodes[n++] = 15;
FaceNodes[n++] = 13;
FaceNodes[n++] = 17;
FaceNodes[n++] = 19;
/* Face Nodes for face 12 */
FaceNodes[n++] = 1;
FaceNodes[n++] = 5;
FaceNodes[n++] = 9;
FaceNodes[n++] = 13;
FaceNodes[n++] = 17;
/* DOCEND */
/* Specify the number of nodes for each face, and the right and
* left neighboring elements. The neighboring elements can be
* determined using the right-hand rule. For each face, curl
* the fingers of your right hand in the direction of
* incrementing node numbers (i.e. from Node 1 to Node 2 and
* so on). Your thumb will point toward the right element.
* A value of zero indicates that there is no
* neighboring element on that side. A negative value
* indicates that the neighboring element is in another zone.
* In that case, the number is a pointer into the
* FaceBndryConnectionElems and FaceBndryConnectionZones arrays.
*/
/* DOCSTART:gridsolution_grid_tecpoly.txt*/
INTEGER4 *FaceNodeCounts = new INTEGER4[NumFaces];
INTEGER4 *FaceLeftElems = new INTEGER4[NumFaces];
INTEGER4 *FaceRightElems = new INTEGER4[NumFaces];
/* For this particular zone, each face has the 5 nodes. */
for(int J = 0; J < NumFaces; J++)
FaceNodeCounts[J] = 5;
/* Set the right and left elements for each face. */
FaceRightElems[0] = 1;
FaceRightElems[1] = 1;
FaceRightElems[2] = 0;
FaceRightElems[3] = 0;
FaceRightElems[4] = 0;
FaceRightElems[5] = 1;
FaceRightElems[6] = 1;
FaceRightElems[7] = 0;
FaceRightElems[8] = 0;
FaceRightElems[9] = 1;
FaceRightElems[10] = 1;
FaceRightElems[11] = 0;
FaceLeftElems[0] = 0;
FaceLeftElems[1] = 0;
FaceLeftElems[2] = 1;
FaceLeftElems[3] = 1;
FaceLeftElems[4] = 1;
FaceLeftElems[5] = 0;
FaceLeftElems[6] = 0;
FaceLeftElems[7] = 1;
FaceLeftElems[8] = 1;
FaceLeftElems[9] = 0;
FaceLeftElems[10] = 0;
FaceLeftElems[11] = 1;
I = TECPOLY112(FaceNodeCounts,
FaceNodes,
FaceLeftElems,
FaceRightElems,
NULL, /* No boundary connections. */
NULL,
NULL);
delete FaceNodes;
delete FaceLeftElems;
delete FaceRightElems;
/* DOCEND */
/* DOCSTART:gridsolution_grid_tecend.txt*/
I = TECEND112();
/* DOCEND */
/* DOCSTART:gridsolution_solution_tecini.txt*/
for(int J = 0; J < 5; J++)
{
char SolutionFileName[128];
sprintf(SolutionFileName, "solution%d.plt", J);
/* DOCSTART:gridsolution_solution_tecini.txt*/
FileType = 2; /* 1 = solution file. */
I = TECINI112((char*)"Example: Separate grid and solution files",
(char*)"P T", /* Defines the variables for the solution file.
* Note that these are different variables from
* the grid file.
*/
SolutionFileName,
(char*)".", /* scratch directory */
&FileType,
&Debug,
&VIsDouble);
/* DOCEND */
/* DOCSTART:gridsolution_solution_teczne.txt*/
/* TECZNE Parameters are mostly unchanged from creation of the grid file. */
TotalNumFaceNodes = 0;
SolutionTime = J;
char ZoneName[128];
sprintf(ZoneName, "Dodecahedron Time=%g", SolutionTime);
I = TECZNE112(ZoneName,
&ZoneType,
&NumPts,
&NumElems,
&NumFaces,
&ICellMax,
&JCellMax,
&KCellMax,
&SolutionTime,
&StrandID,
&ParentZone,
&IsBlock,
&NumFaceConnections,
&FaceNeighborMode,
&TotalNumFaceNodes,
&TotalNumBndryFaces,
&TotalNumBndryConns,
NULL,
NULL, /* All nodal variables */
NULL,
&SharConn);
/* DOCEND */
/* DOCSTART:gridsolution_solution_tecdat.txt*/
/* TECDAT Parameters */
double *P = new double[NumPts];
double *T = new double[NumPts];
for(int K = 0; K < NumPts; K++)
{
P[K] = (double)(K + J);
T[K] = 1.0 + K + K;
}
I = TECDAT112(&NumPts, P, &IsDouble);
I = TECDAT112(&NumPts, T, &IsDouble);
delete P;
delete T;
/* DOCEND */
/* DOCSTART:gridsolution_solution_tecend.txt*/
I = TECEND112();
/* DOCEND */
}
return 0;
}

View File

@ -0,0 +1,321 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="gridsolution"
ProjectGUID="{D2747EA6-7807-42E1-984D-C946B3D97D95}"
RootNamespace="mulitplepolygons"
>
<Platforms>
<Platform
Name="Win32"
/>
<Platform
Name="x64"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="..\TecIO_Examples.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="..\TecIO_Examples.vsprops"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
RuntimeLibrary="2"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|x64"
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="..\TecIO_Examples.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|x64"
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="..\TecIO_Examples.vsprops"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
RuntimeLibrary="2"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<File
RelativePath=".\gridsolution.cpp"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -0,0 +1,11 @@
# Set to appropriate C++ compiler
CPP=g++
CPPFLAGS=-I../../tecsrc ../../tecio.a
EXECUTABLE=ij_ordered
FILES=$(EXECUTABLE).cpp
build:
$(CPP) $(FILES) $(CPPFLAGS) -o $(EXECUTABLE)
clean:
rm -f $(EXECUTABLE)

View File

@ -0,0 +1,149 @@
/* This example creates a simple set of IJ-ordered zones */
/* DOCSTART:ij_ordered.txt*/
#include "TECIO.h"
#include "MASTER.h" /* for defintion of NULL */
int main()
{
INTEGER4 Debug = 1;
INTEGER4 VIsDouble = 0;
INTEGER4 FileType = 0;
INTEGER4 I = 0; /* Used to track return codes */
/*
* Open the file and write the tecplot datafile
* header information
*/
I = TECINI112((char*)"IJ Ordered Zones", /* Name of the entire
* dataset.
*/
(char*)"X Y P", /* Defines the variables for the data
* file. Each zone must contain each of
* the variables listed here. The order
* of the variables in the list is used
* to define the variable number (e.g.
* X is Var 1).
*/
(char*)"ij_ordered.plt",
(char*)".", /* Scratch Directory */
&FileType,
&Debug,
&VIsDouble);
float X1[4];
float Y1[4];
float P1[4];
float X2[4];
float Y2[4];
float P2[4];
INTEGER4 ICellMax = 0;
INTEGER4 JCellMax = 0;
INTEGER4 KCellMax = 0;
INTEGER4 DIsDouble = 0;
double SolTime = 360.0;
INTEGER4 StrandID = 0; /* StaticZone */
INTEGER4 ParentZn = 0;
INTEGER4 IsBlock = 1; /* Block */
INTEGER4 NFConns = 0;
INTEGER4 FNMode = 0;
INTEGER4 TotalNumFaceNodes = 1;
INTEGER4 TotalNumBndryFaces = 1;
INTEGER4 TotalNumBndryConnections = 1;
INTEGER4 ShrConn = 0;
/*Ordered Zone Parameters*/
INTEGER4 IMax = 2;
INTEGER4 JMax = 2;
INTEGER4 KMax = 1;
X1[0] = .125;
Y1[0] = .5;
P1[0] = 5;
X1[1] = .625;
Y1[1] = .5;
P1[1] = 7.5;
X1[2] = .125;
Y1[2] = .875;
P1[2] = 10;
X1[3] = .625;
Y1[3] = .875;
P1[3] = 7.5;
X2[0] = .375;
Y2[0] = .125;
P2[0] = 5;
X2[1] = .875;
Y2[1] = .125;
P2[1] = 7.5;
X2[2] = .375;
Y2[2] = .5;
P2[2] = 10;
X2[3] = .875;
Y2[3] = .5;
P2[3] = 7.5;
/* Ordered Zone */
INTEGER4 ZoneType = 0;
I = TECZNE112((char*)"Ordered Zone",
&ZoneType,
&IMax,
&JMax,
&KMax,
&ICellMax,
&JCellMax,
&KCellMax,
&SolTime,
&StrandID,
&ParentZn,
&IsBlock,
&NFConns,
&FNMode,
&TotalNumFaceNodes,
&TotalNumBndryFaces,
&TotalNumBndryConnections,
NULL,
NULL,
NULL,
&ShrConn);
INTEGER4 III = IMax * JMax * KMax;
I = TECDAT112(&III, X1, &DIsDouble);
I = TECDAT112(&III, Y1, &DIsDouble);
I = TECDAT112(&III, P1, &DIsDouble);
I = TECZNE112((char*)"Ordered Zone2",
&ZoneType,
&IMax,
&JMax,
&KMax,
&ICellMax,
&JCellMax,
&KCellMax,
&SolTime,
&StrandID,
&ParentZn,
&IsBlock,
&NFConns,
&FNMode,
&TotalNumFaceNodes,
&TotalNumBndryFaces,
&TotalNumBndryConnections,
NULL,
NULL,
NULL,
&ShrConn);
I = TECDAT112(&III, X2, &DIsDouble);
I = TECDAT112(&III, Y2, &DIsDouble);
I = TECDAT112(&III, P2, &DIsDouble);
I = TECEND112();
return 0;
}
/* DOCEND */

View File

@ -0,0 +1,172 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="ij_ordered"
ProjectGUID="{47556A00-C441-4B9A-8920-91CA63AC1595}"
RootNamespace="ij_ordered"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="..\TecIO_Examples.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="..\TecIO_Examples.vsprops"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
RuntimeLibrary="2"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<File
RelativePath=".\ij_ordered.cpp"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -0,0 +1,11 @@
# Set to appropriate C++ compiler
CPP=g++
CPPFLAGS=-I../../tecsrc ../../tecio.a
EXECUTABLE=multiplefiles
FILES=$(EXECUTABLE).cpp
build:
$(CPP) $(FILES) $(CPPFLAGS) -o $(EXECUTABLE)
clean:
rm -f $(EXECUTABLE)

View File

@ -0,0 +1,214 @@
/* This example illustrates working with TecFil to create multiple
* plt files simultaneously.
*/
#if defined _MSC_VER
#pragma warning (disable: 4996) /* Windows strcpy warning off */
#endif
/* DOCSTART:mulitplefiles.txt */
#include "TECIO.h"
#include "MASTER.h" /* for defintion of NULL */
#include <string.h>
int main()
{
/*
* Open the file and write the tecplot datafile
* header information
*/
INTEGER4 Debug = 1;
INTEGER4 VIsDouble = 0;
INTEGER4 FileType = 0;
INTEGER4 I = 0; /* Used to check the return value */
I = TECINI112((char*)"SIMPLE DATASET", /* Name of the entire dataset.*/
(char*)"X1 Y1 P1", /* Defines the variables for the data
* file. Each zone must contain each of
* the variables listed here. The order
* of the variables in the list is used
* to define the variable number (e.g.
* X1 is Var 1).
*/
(char*)"file1.plt",
(char*)".", /* Scratch Directory */
&FileType,
&Debug,
&VIsDouble);
/* Set the parameters for TecZne */
INTEGER4 ZoneType = 0; /* sets the zone type to
* ordered
*/
INTEGER4 IMax = 2; /* Create an IJ-ordered zone,
* by using IMax and JMax
* values that are greater
* than one, and setting KMax
* to one.
*/
INTEGER4 JMax = 2;
INTEGER4 KMax = 1;
double SolTime = 0;
INTEGER4 StrandID = 0; /* StaticZone */
INTEGER4 ParentZn = 0; /* used for surface streams */
INTEGER4 ICellMax = 0; /* not used */
INTEGER4 JCellMax = 0; /* not used */
INTEGER4 KCellMax = 0; /* not used */
INTEGER4 IsBlock = 1; /* Block */
INTEGER4 NFConns = 0; /* this example does not use
* face neighbors */
INTEGER4 FNMode = 0;
INTEGER4 TotalNumFaceNodes = 1;
INTEGER4 TotalNumBndryFaces = 1;
INTEGER4 TotalNumBndryConn = 1;
INTEGER4 ShrConn = 0;
/* Create an Ordered Zone */
I = TECZNE112((char*)"Ordered Zone",
&ZoneType,
&IMax,
&JMax,
&KMax,
&ICellMax,
&JCellMax,
&KCellMax,
&SolTime,
&StrandID,
&ParentZn,
&IsBlock,
&NFConns,
&FNMode,
&TotalNumFaceNodes,
&TotalNumBndryFaces,
&TotalNumBndryConn,
NULL,
NULL,
NULL,
&ShrConn);
/* Set the variable values for the ordered zone. */
float X1[4];
float Y1[4];
float P1[4];
X1[0] = 0.125;
Y1[0] = 0.5;
P1[0] = 7.5;
X1[1] = 0.625;
Y1[1] = 0.5;
P1[1] = 10.0;
X1[2] = 0.125;
Y1[2] = 0.875;
P1[2] = 5.0;
X1[3] = 0.625;
Y1[3] = 0.875;
P1[3] = 7.5;
INTEGER4 DIsDouble = 0; /* set DIsDouble to 0, for float
* values.
*/
INTEGER4 III = IMax * JMax * KMax;
I = TECDAT112(&III, X1, &DIsDouble);
I = TECDAT112(&III, Y1, &DIsDouble);
I = TECDAT112(&III, P1, &DIsDouble);
/* Open a new data file. note: the first file is still open
* because TecEnd was not called.
*/
I = TECINI112((char*)"Auxiliary Data",
(char*)"X1 Y1 P1",
(char*)"file2.plt",
(char*)".",
&FileType,
&Debug,
&VIsDouble);
/* Switch the active file to the newly created data file
* (file2.plt) which is the second file opened with TECINI112
* so we use 2.
*/
INTEGER4 WhichFile = 2;
I = TECFIL112(&WhichFile);
/* Create a second zone, using many of the values from the first
* zone, and write it to the second data file.
*/
I = TECZNE112((char*)"Ordered Zone2",
&ZoneType,
&IMax,
&JMax,
&KMax,
&ICellMax,
&JCellMax,
&KCellMax,
&SolTime,
&StrandID,
&ParentZn,
&IsBlock,
&NFConns,
&FNMode,
&TotalNumFaceNodes,
&TotalNumBndryFaces,
&TotalNumBndryConn,
NULL,
NULL,
NULL,
&ShrConn);
/* set the variable values for the second zone */
float X2[4];
float Y2[4];
float P2[4];
X2[0] = 0.375;
Y2[0] = 0.125;
P2[0] = 5;
X2[1] = 0.875;
Y2[1] = 0.125;
P2[1] = 7.5;
X2[2] = 0.375;
Y2[2] = 0.5;
P2[2] = 10;
Y2[3] = 0.5;
X2[3] = 0.875;
P2[3] = 7.5;
III = IMax * JMax * KMax;
I = TECDAT112(&III, X2, &DIsDouble);
I = TECDAT112(&III, Y2, &DIsDouble);
I = TECDAT112(&III, P2, &DIsDouble);
/* Switch to the first file. */
WhichFile = 1;
I = TECFIL112(&WhichFile);
/* Create an auxiliary data value and write it to the file */
char DeformationValue[128];
strcpy(DeformationValue, "0.98");
I = TECAUXSTR112((char*)"DeformationValue",
DeformationValue);
/* Close the first file */
I = TECEND112();
/* The remaining file will become the active file. As such,
* TecFil does not need to be called again to close the second
* file.
*/
I = TECEND112();
return 0;
}
/* DOCEND */

View File

@ -0,0 +1,172 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="multiplefiles"
ProjectGUID="{93CB23B2-530F-4D6F-900F-893815299C7F}"
RootNamespace="multiplefiles"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="..\TecIO_Examples.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="..\TecIO_Examples.vsprops"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
RuntimeLibrary="2"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<File
RelativePath=".\multiplefiles.cpp"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -0,0 +1,11 @@
# Set to appropriate C++ compiler
CPP=g++
CPPFLAGS=-I../../tecsrc ../../tecio.a
EXECUTABLE=multiplepolygons
FILES=$(EXECUTABLE).cpp
build:
$(CPP) $(FILES) $(CPPFLAGS) -o $(EXECUTABLE)
clean:
rm -f $(EXECUTABLE)

View File

@ -0,0 +1,569 @@
/* This example illustrates using TecPoly to create two polygonal
* zones. The first zone contains six hexagons, and the second
* zone contains a hexagon and an octagon. Refer to the Data
* Format Guide for a picture of the configuration, including node
* and face numbers.
*/
#include "TECIO.h"
#include "MASTER.h" /* for defintion of NULL */
int main()
{
/* DOCSTART:hexagons_tecini.txt*/
INTEGER4 I; /* use to check return values */
INTEGER4 Debug = 1;
INTEGER4 VIsDouble = 0;
INTEGER4 FileType = 0;
I = TECINI112((char*)"Example: Multiple polygonal zones",
(char*)"X Y P", /* Defines the variables for the data file.
* Each zone must contain each of the vars
* listed here. The order of the variables
* in the list is used to define the
* variable number (e.g. X is Variable 1).
* When referring to variables in other
* TecIO functions, you will refer to the
* variable by its number.
*/
(char*)"HexagonsAndOctagon.plt",
(char*)".", /* scratch directory */
&FileType,
&Debug,
&VIsDouble);
/* DOCEND */
/* DOCSTART:hexagons_zone1_teczne.txt*/
/* TECZNE Parameters */
INTEGER4 ZoneType = 6; /* FE Polygon */
INTEGER4 NumPts_Z1 = 13; /* the number of unique
* nodes in the zone.
*/
INTEGER4 NumElems_Z1 = 3;
INTEGER4 NumFaces_Z1 = 15; /* the number of unique
* faces in the zone.
*/
INTEGER4 ICellMax = 0; /* not used */
INTEGER4 JCellMax = 0; /* not used */
INTEGER4 KCellMax = 0; /* not used */
double SolutionTime = 0.0;
INTEGER4 StrandID = 0;
INTEGER4 ParentZone = 0;
INTEGER4 IsBlock = 1;
INTEGER4 NumFaceConnections = 0;
INTEGER4 FaceNeighborMode = 1;
INTEGER4 SharConn = 0;
INTEGER4 ValueLocation[3] = { 1, 1, 0 };
/* For a polygonal zone, the total number of face nodes is
* twice the total number of faces. This is because each face
* is composed of exactly two nodes.
*/
INTEGER4 TotalNumFaceNodes_Z1 = 2 * NumFaces_Z1;
/* A boundary face is a face that is neighbored by an element
* or elements in another zone or zone(s). In Zone 1, Face 9,
* Face 10 and Face 12 have a neighbor in Zone 2. Therefore,
* the total number of boundary faces is <20>3<EFBFBD>.
*/
INTEGER4 TotalNumBndryFaces_Z1 = 3;
/* Each boundary face has one or more boundary connections. A
* boundary connection is defined as another element in another
* zone. Face 9 has a boundary connection with Element 1 in
* Zone 2. In this example, each boundary face is connected to
* one other element, so the total number of boundary
* connections is equivalent to the total number of boundary
* faces (3).
*/
INTEGER4 TotalNumBndryConns_Z1 = 3;
I = TECZNE112((char*)"Zone 1: 3 Hexagons", /* Specifies the name of
* the entire dataset. When
* the file is loaded into
* Tecplot, the value is
* available via the Data
* Set Info dialog.
*/
&ZoneType,
&NumPts_Z1,
&NumElems_Z1,
&NumFaces_Z1,
&ICellMax,
&JCellMax,
&KCellMax,
&SolutionTime,
&StrandID,
&ParentZone,
&IsBlock,
&NumFaceConnections,
&FaceNeighborMode,
&TotalNumFaceNodes_Z1,
&TotalNumBndryFaces_Z1,
&TotalNumBndryConns_Z1,
NULL,
ValueLocation,
NULL,
&SharConn);
/* DOCEND */
/* DOCSTART:hexagons_zone1_tecdat.txt*/
/* TECDAT Parameters */
double *X_Z1 = new double[NumPts_Z1];
double *Y_Z1 = new double[NumPts_Z1];
X_Z1[0] = 1;
Y_Z1[0] = 6;
X_Z1[1] = 2;
Y_Z1[1] = 6;
X_Z1[2] = 3;
Y_Z1[2] = 5;
X_Z1[3] = 2;
Y_Z1[3] = 4;
X_Z1[4] = 1;
Y_Z1[4] = 4;
X_Z1[5] = 0;
Y_Z1[5] = 5;
X_Z1[6] = 4;
Y_Z1[6] = 5;
X_Z1[7] = 5;
Y_Z1[7] = 4;
X_Z1[8] = 4;
Y_Z1[8] = 3;
X_Z1[9] = 3;
Y_Z1[9] = 3;
X_Z1[10] = 2;
Y_Z1[10] = 2;
X_Z1[11] = 1;
Y_Z1[11] = 2;
X_Z1[12] = 0;
Y_Z1[12] = 3;
double *P_Z1 = new double[NumElems_Z1];
P_Z1[0] = 2;
P_Z1[1] = 4;
P_Z1[2] = 5;
INTEGER4 IsDouble = 1;
I = TECDAT112(&NumPts_Z1, X_Z1, &IsDouble);
I = TECDAT112(&NumPts_Z1, Y_Z1, &IsDouble);
I = TECDAT112(&NumElems_Z1, P_Z1, &IsDouble);
delete X_Z1;
delete Y_Z1;
delete P_Z1;
/* DOCEND */
/* DOCSTART:hexagons_zone1_facenodes.txt*/
/* TecPoly Parameters */
/* Create a FaceNodes array, dimensioned by the total number
* of face nodes in the zone.
*/
INTEGER4 *FaceNodes_Z1 = new INTEGER4[TotalNumFaceNodes_Z1];
/* Face Nodes for Element 1 */
FaceNodes_Z1[0] = 1;
FaceNodes_Z1[1] = 2;
FaceNodes_Z1[2] = 2;
FaceNodes_Z1[3] = 3;
FaceNodes_Z1[4] = 3;
FaceNodes_Z1[5] = 4;
FaceNodes_Z1[6] = 4;
FaceNodes_Z1[7] = 5;
FaceNodes_Z1[8] = 5;
FaceNodes_Z1[9] = 6;
FaceNodes_Z1[10] = 6;
FaceNodes_Z1[11] = 1;
/* Face Nodes for Element 2 */
FaceNodes_Z1[12] = 3;
FaceNodes_Z1[13] = 7;
FaceNodes_Z1[14] = 7;
FaceNodes_Z1[15] = 8;
FaceNodes_Z1[16] = 8;
FaceNodes_Z1[17] = 9;
FaceNodes_Z1[18] = 9;
FaceNodes_Z1[19] = 10;
FaceNodes_Z1[20] = 10;
FaceNodes_Z1[21] = 4;
/* Face Nodes for Element 3 */
FaceNodes_Z1[22] = 10;
FaceNodes_Z1[23] = 11;
FaceNodes_Z1[24] = 11;
FaceNodes_Z1[25] = 12;
FaceNodes_Z1[26] = 12;
FaceNodes_Z1[27] = 13;
FaceNodes_Z1[28] = 13;
FaceNodes_Z1[29] = 5;
/* DOCEND */
/* Specify the right and left neighboring elements.
* The neighboring elements can be determined using the
* right-hand rule. For each face, place your right-hand along
* the face with your fingers pointing the direction of
* incrementing node numbers (i.e. from Node 1 to Node 2). The
* right side of your hand will indicate the right element,
* and the left side of your hand will indicate the left
* element. A value of zero indicates that there is no
* neighboring element on that side. A negative value
* indicates that the neighboring element is in another zone.
* The number is a pointer into the FaceBndryConnectionElems
* and FaceBndryConnectionZones arrays.
*/
/* DOCSTART:hexagons_zone1_neighbors.txt*/
INTEGER4 *FaceLeftElems_Z1 = new INTEGER4[NumFaces_Z1];
INTEGER4 *FaceRightElems_Z1 = new INTEGER4[NumFaces_Z1];
/* Left Face Elems for Element 1 */
FaceLeftElems_Z1[0] = 0;
FaceLeftElems_Z1[1] = 0;
FaceLeftElems_Z1[2] = 2;
FaceLeftElems_Z1[3] = 3;
FaceLeftElems_Z1[4] = 0;
/* Left Face Elems for Element 2 */
FaceLeftElems_Z1[5] = 0;
FaceLeftElems_Z1[6] = 0;
FaceLeftElems_Z1[7] = 0;
FaceLeftElems_Z1[8] = -1;
FaceLeftElems_Z1[9] = -2;
FaceLeftElems_Z1[10] = 2;
/* Left Face Elems for Element 3 */
FaceLeftElems_Z1[11] = -3;
FaceLeftElems_Z1[12] = 0;
FaceLeftElems_Z1[13] = 0;
FaceLeftElems_Z1[14] = 0;
/* Set Right Face Elems. Because of the way we numbered the
* nodes and faces, the right element for every face is the
* element itself.
*/
for (INTEGER4 ii = 0; ii < 6; ii++)
FaceRightElems_Z1[ii] = 1;
for (INTEGER4 ii = 6; ii < 10; ii++)
FaceRightElems_Z1[ii] = 2;
for (INTEGER4 ii = 10; ii <= 14; ii++)
FaceRightElems_Z1[ii] = 3;
/* DOCEND */
/* DOCSTART:hexagons_zone1_tecpoly.txt */
/* The FaceBndryConnectionCounts array is used to define the
* number of boundary connections for each face that has a
* boundary connection. For example, if a zone has three
* boundary connections in total (NumConnectedBoundaryFaces),
* two of those boundary connections are in one face, and the
* remaining boundary connection is in a second face, the
* FaceBndryConnectionCounts array would be: [2 1].
*
* In this example, the total number of connected boundary
* faces (specified via TECZNE) is equal to three. Each
* boundary face is connected to only one other element,
* so the FaceBoundaryConnectionCounts array is (1, 1, 1).
*/
INTEGER4 FaceBndryConnectionCounts_Z1[3] = {1, 1, 1};
/* The value(s) in the FaceBndryConnectionElems and
* FaceBndryConnectionZones arrays specifies the element number
* and zone number, respectively, that a given boundary
* connection is connected to. In this case, the first
* boundary connection face is connected to Element 1 in Zone 2
* and the remaining connection is to Element 2 in Zone 2.
*/
INTEGER4 FaceBndryConnectionElems_Z1[3] = {1, 2, 2};
INTEGER4 FaceBndryConnectionZones_Z1[3] = {2, 2, 2};
I = TECPOLY112(NULL, /* Not used for polygon zones */
FaceNodes_Z1,
FaceLeftElems_Z1,
FaceRightElems_Z1,
FaceBndryConnectionCounts_Z1,
FaceBndryConnectionElems_Z1,
FaceBndryConnectionZones_Z1);
delete FaceNodes_Z1;
delete FaceLeftElems_Z1;
delete FaceRightElems_Z1;
/* DOCEND */
/* Define Zone 2. Zone 2 contains an octagon and a hexagon. */
/* TECZNE Parameters */
/* DOCSTART:hexagons_zone2_teczne.txt*/
INTEGER4 NumPts_Z2 = 12; /* number of unique
* nodes in the zone
*/
INTEGER4 NumElems_Z2 = 2;
INTEGER4 NumFaces_Z2 = 13; /* number of unique
* faces in the zone
*/
INTEGER4 NumFaceConnections_Z2 = 0;
/* In polygonal zones, each face has exactly two nodes */
INTEGER4 TotalNumFaceNodes_Z2 = NumFaces_Z2 * 2;
/* A boundary face is a face that is neighbored by an element or
* elements from another zone or zone(s). In Zone 2, Face 6,
* Face 7 and Face 13 have a neighbor in Zone 1. Therefore, the
* total number of boundary faces is <20>3<EFBFBD>.
*/
INTEGER4 TotalNumBndryFaces_Z2 = 3;
/* Each boundary face has one or more boundary connections. In
* this example, each boundary face is connected to one other
* element (i.e. the number of boundary faces and the number of
* boundary connections is one-to-one).
*/
INTEGER4 TotalNumBndryConns_Z2 = 3;
I = TECZNE112((char*)"Zone 2: 1 Hexagon and 1 Octagon",
&ZoneType,
&NumPts_Z2,
&NumElems_Z2,
&NumFaces_Z2,
&ICellMax,
&JCellMax,
&KCellMax,
&SolutionTime,
&StrandID,
&ParentZone,
&IsBlock,
&NumFaceConnections_Z2,
&FaceNeighborMode,
&TotalNumFaceNodes_Z2,
&TotalNumBndryFaces_Z2,
&TotalNumBndryConns_Z2,
NULL,
ValueLocation,
NULL,
&SharConn);
/* DOCEND */
/* TECDAT Parameters */
/* DOCSTART:hexagons_zone2_tecdat.txt*/
double *X_Z2 = new double[NumPts_Z2];
double *Y_Z2 = new double[NumPts_Z2];
X_Z2[0] = 5;
Y_Z2[0] = 4;
X_Z2[1] = 6;
Y_Z2[1] = 4;
X_Z2[2] = 7;
Y_Z2[2] = 3;
X_Z2[3] = 6;
Y_Z2[3] = 2;
X_Z2[4] = 5;
Y_Z2[4] = 2;
X_Z2[5] = 4;
Y_Z2[5] = 3;
X_Z2[6] = 3;
Y_Z2[6] = 3;
X_Z2[7] = 5;
Y_Z2[7] = 1;
X_Z2[8] = 4;
Y_Z2[8] = 0;
X_Z2[9] = 3;
Y_Z2[9] = 0;
X_Z2[10] = 2;
Y_Z2[10] = 1;
X_Z2[11] = 2;
Y_Z2[11] = 2;
/* In the call to TecZne, P was set to a cell centered variable.
* As such, only two values need to be defined.
*/
double *P_Z2 = new double[NumPts_Z2];
P_Z2[0] = 8;
P_Z2[1] = 6;
I = TECDAT112(&NumPts_Z2, X_Z2, &IsDouble);
I = TECDAT112(&NumPts_Z2, Y_Z2, &IsDouble);
I = TECDAT112(&NumElems_Z2, P_Z2, &IsDouble);
delete X_Z2;
delete Y_Z2;
delete P_Z2;
/* DOCEND */
/* TecPoly Parameters */
/* DOCSTART:hexagons_zone2_facemap.txt*/
INTEGER4 *FaceNodes_Z2;
FaceNodes_Z2 = new INTEGER4[TotalNumFaceNodes_Z2];
/* Face Nodes for Element 1 */
FaceNodes_Z2[0] = 1;
FaceNodes_Z2[1] = 2;
FaceNodes_Z2[2] = 2;
FaceNodes_Z2[3] = 3;
FaceNodes_Z2[4] = 3;
FaceNodes_Z2[5] = 4;
FaceNodes_Z2[6] = 4;
FaceNodes_Z2[7] = 5;
FaceNodes_Z2[8] = 5;
FaceNodes_Z2[9] = 6;
FaceNodes_Z2[10] = 6;
FaceNodes_Z2[11] = 1;
/* Face Nodes for Element 2 */
FaceNodes_Z2[12] = 7;
FaceNodes_Z2[13] = 6;
FaceNodes_Z2[14] = 5;
FaceNodes_Z2[15] = 8;
FaceNodes_Z2[16] = 8;
FaceNodes_Z2[17] = 9;
FaceNodes_Z2[18] = 9;
FaceNodes_Z2[19] = 10;
FaceNodes_Z2[20] = 10;
FaceNodes_Z2[21] = 11;
FaceNodes_Z2[22] = 11;
FaceNodes_Z2[23] = 12;
FaceNodes_Z2[24] = 12;
FaceNodes_Z2[25] = 7;
/* DOCEND */
/* DOCSTART:hexagons_zone2_tecpoly.txt*/
/* Specify the right and left neighboring elements.
* The neighboring elements can be determined using the
* right-hand rule. For each face, place your right-hand along
* the face with your fingers pointing the direction of
* incrementing node numbers (i.e. from Node 1 to Node 2). The
* right side of your hand will indicate the right element,
* and the left side of your hand will indicate the left
* element. A value of zero indicates that there is no
* neighboring element on that side. A negative value
* indicates that the neighboring element is in another zone.
* The number is a pointer into the FaceBndryConnectionElems
* and FaceBndryConnectionZones arrays.
*/
INTEGER4 *FaceLeftElems_Z2 = new INTEGER4[NumFaces_Z2];
INTEGER4 *FaceRightElems_Z2 = new INTEGER4[NumFaces_Z2];
/* Left Face Elems for Element 1 */
FaceLeftElems_Z2[0] = 0;
FaceLeftElems_Z2[1] = 0;
FaceLeftElems_Z2[2] = 0;
FaceLeftElems_Z2[3] = 0;
FaceLeftElems_Z2[4] = 2;
FaceLeftElems_Z2[5] = -1;
/* Left Face Elems for Element 2 */
FaceLeftElems_Z2[6] = -2;
FaceLeftElems_Z2[7] = 0;
FaceLeftElems_Z2[8] = 0;
FaceLeftElems_Z2[9] = 0;
FaceLeftElems_Z2[10] = 0;
FaceLeftElems_Z2[11] = 0;
FaceLeftElems_Z2[12] = -3;
/* Set Right Face Elems. Because of the way we numbered the
* nodes and faces, the right element for every face is the
* element itself. */
for (INTEGER4 ii = 0; ii < 6; ii++)
FaceRightElems_Z2[ii] = 1;
for (INTEGER4 ii = 6; ii < 13; ii++)
FaceRightElems_Z2[ii] = 2;
/* DOCEND */
/* DOCSTART:hexagons_zone2_tecpoly.txt*/
/* The FaceBndryConnectionCounts array is used to define the
* number of boundary connections for each face that has a
* boundary connection. In this example, the total number of
* connected boundary faces (specified via TECZNE) is equal to
* three. Each boundary face is connected to only one other
* element, so the FaceBoundaryConnectionCounts array is
* (1, 1, 1).
*/
INTEGER4 FaceBndryConnectionCounts_Z2[3] = {1, 1, 1};
/* The value(s) in the FaceBndryConnectionElems and
* FaceBndryConnectionZones arrays specifies that element
* number and zone number, respectively, that a given boundary
* connection is connected to. In this case, the first boundary
* connection face is connected to Element 2 in Zone 1 and the
* remaining connections are Element 3 in Zone 1.
*/
INTEGER4 FaceBndryConnectionElems_Z2[3] = {2, 3, 3};
INTEGER4 FaceBndryConnectionZones_Z2[3] = {1, 1, 1};
I = TECPOLY112(NULL,
FaceNodes_Z2,
FaceLeftElems_Z2,
FaceRightElems_Z2,
FaceBndryConnectionCounts_Z2,
FaceBndryConnectionElems_Z2,
FaceBndryConnectionZones_Z2);
delete FaceNodes_Z2;
delete FaceLeftElems_Z2;
delete FaceRightElems_Z2;
/* DOCEND */
/* DOCSTART:hexagons_tecend.txt*/
I = TECEND112();
/* DOCEND */
return 0;
}

View File

@ -0,0 +1,172 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="multiplepolygons"
ProjectGUID="{D2747EA6-7807-42E1-984D-C946B3D97D95}"
RootNamespace="mulitplepolygons"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="..\TecIO_Examples.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="..\TecIO_Examples.vsprops"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
RuntimeLibrary="2"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<File
RelativePath=".\multiplepolygons.cpp"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -0,0 +1,11 @@
# Set to appropriate C++ compiler
CPP=g++
CPPFLAGS=-I../../tecsrc ../../tecio.a
EXECUTABLE=octagon
FILES=$(EXECUTABLE).cpp
build:
$(CPP) $(FILES) $(CPPFLAGS) -o $(EXECUTABLE)
clean:
rm -f $(EXECUTABLE)

View File

@ -0,0 +1,248 @@
/* This example illustrates how to create a zone with a single
* polygonal cell. Please refer to the Data Format Guide for
* additional information, including figures that display node
* numbering.
*/
#include "TECIO.h"
#include "MASTER.h" /* for defintion of NULL */
int main()
{
/* DOCSTART:octagon_tecini.txt*/
INTEGER4 Debug = 1;
INTEGER4 VIsDouble = 0;
INTEGER4 FileType = 0;
INTEGER4 I; /* used to check return codes */
/*
* Open the file and write the Tecplot datafile
* header information
*/
I = TECINI112((char*)"Octagon",
(char*)"X Y P", /* Defines the variables for the data
* file. Each zone must contain each
* of the vars listed here. The order
* of the variables in the list is
* used to define the variable number
* (e.g. X is Variable 1). When
* referring to variables in other
* TecIO functions, you will refer to
* thevariable by its number.
*/
(char*)"Octagon.plt",
(char*)".", /* scratch directory */
&FileType,
&Debug,
&VIsDouble);
/* DOCEND */
/* Declare TECZNE variables */
/* DOCSTART:octagon_teczne.txt*/
/* In this example, we will create a single octagonal cell in
* Tecplot 360's polyhedral file format.
*/
INTEGER4 ZoneType = 6; /* FEPolygon */
INTEGER4 NumNodes = 8; /* Number of nodes in the octagon.*/
INTEGER4 NumElems = 1; /* Number of octagonal elements. */
INTEGER4 NumFaces = 8; /* Number of faces in the octagon.*/
INTEGER4 ICellMax = 0; /* Not Used */
INTEGER4 JCellMax = 0; /* Not Used */
INTEGER4 KCellMax = 0; /* Not Used */
double SolTime = 360.0;
INTEGER4 StrandID = 0; /* Static Zone */
INTEGER4 ParentZn = 0; /* No Parent Zone */
INTEGER4 IsBlock = 1; /* Block */
INTEGER4 NFConns = 0;
INTEGER4 FNMode = 0;
/* For polygonal zones, the total number of face nodes is equal
* to twice the number of nodes. This is because, each face
* has exactly two nodes.
*/
INTEGER4 NumFaceNodes = 2 * NumNodes;
/* Boundary Faces and Boundary Connections are not used in this
* example.
*/
INTEGER4 NumBFaces = 0;
INTEGER4 NumBConnections = 0;
INTEGER4 ShrConn = 0;
I = TECZNE112((char*)"Octagonal Zone",
&ZoneType,
&NumNodes,
&NumElems,
&NumFaces,
&ICellMax,
&JCellMax,
&KCellMax,
&SolTime,
&StrandID,
&ParentZn,
&IsBlock,
&NFConns,
&FNMode,
&NumFaceNodes,
&NumBFaces,
&NumBConnections,
NULL,
NULL, /* When Value Location is not specified,
* Tecplot will treat all variables as
* nodal variables.
*/
NULL,
&ShrConn);
/* DOCEND */
/* Establish numbering.
* For this example, we will a single octagonal cell.
* Before defining your variables, you must establish a
* consistent node numbering scheme for your data. Once the
* node numbers are defined, supply the variable values in the
* node numbering order. In this example, node 1 is defined at
* X = 0 and Y = 0. As such, the first value supplied for X
* (i.e. X[0]) is 0. Similarly, the first value supplied for
* Y is 0.
*
* It is important that you refer to node numbers consistently.
* The node numbers will be used later to define the
* connectivity for each element.
*/
/* TECDAT Variables */
/* Set up the variable values. The variable values will be
* written to the file using TECDAT. Because we are specifying
* nodal variables (as specified via the ValueLocation
* parameter in TECZNE, each variable is dimensioned by the
* number of points (NumPts) in the Zone. You have the option
* to specify some variables with nodal values and some with
* cell-centered values. Refer to the Binary Function Reference
* for details.
*/
/* DOCSTART:octagon_tecdat.txt*/
float *X = new float[NumNodes];
float *Y = new float[NumNodes];
float *P = new float[NumNodes];
//Define the grid values.
X[0] = 0.25;
Y[0] = 0.0;
X[1] = 0.75;
Y[1] = 0.0;
X[2] = 1.0;
Y[2] = 0.25;
X[3] = 1.0;
Y[3] = 0.75;
X[4] = 0.75;
Y[4] = 1.0;
X[5] = 0.25;
Y[5] = 1.0;
X[6] = 0.0;
Y[6] = 0.75;
X[7] = 0.0;
Y[7] = 0.25;
for (INTEGER4 ii = 0; ii < 8; ii++)
P[ii] = .5;
/* Write out the field data using TECDAT */
INTEGER4 DIsDouble = 0; /* set IsDouble to 0 to use float
* variables. */
I = TECDAT112(&NumNodes, X, &DIsDouble);
I = TECDAT112(&NumNodes, Y, &DIsDouble);
I = TECDAT112(&NumNodes, P, &DIsDouble);
delete X;
delete Y;
delete P;
/* DOCEND */
/* Define the Face Nodes.
* The FaceNodes array is used to indicate which nodes define
* which face. As mentioned earlier, the number of the nodes is
* implicitly defined by the order in which the nodal data is
* provided. The first value of each nodal variable describes
* node 1, the second value describes node 2, and so on.
*
* The face numbering is implicitly defined. Because there are
* two nodes in each face, the first two nodes provided define
* face 1, the next two define face 2 and so on. If there was
* a variable number of nodes used to define the faces, the
* array would be more complicated.
*/
/* DOCSTART:octagon_facenodes.txt*/
INTEGER4 *FaceNodes = new INTEGER4[NumFaceNodes];
/*
* Loop over number of sides, and set each side to two
* consecutive nodes.
*/
for (INTEGER4 ii = 0; ii < 8; ii++)
{
FaceNodes[2*ii] = ii + 1;
FaceNodes[2*ii+1] = ii + 2;
}
FaceNodes[15] = 1;
/* DOCEND */
/* Define the right and left elements of each face.
* The last step for writing out the polyhedral data is to
* define the right and left neighboring elements for each
* face. The neighboring elements can be determined using the
* right-hand rule. For each face, place your right-hand along
* the face which your fingers pointing the direction of
* incrementing node numbers (i.e. from node 1 to node 2).
* Your right thumb will point towards the right element; the
* element on the other side of your hand is the left element.
*
* The number zero is used to indicate that there isn't an
* element on that side of the face.
*
* Because of the way we numbered the nodes and faces, the
* right element for every face is the element itself
* (element 1) and the left element is "no-neighboring element"
* (element 0).
*/
/* DOCSTART:octagon_rightleft.txt*/
INTEGER4 *FaceLeftElems = new INTEGER4[NumFaces];
INTEGER4 *FaceRightElems = new INTEGER4[NumFaces];
for (INTEGER4 ii = 0; ii < NumFaces; ii++)
{
FaceLeftElems[ii] = 0;
FaceRightElems[ii] = 1;
}
/* DOCEND */
/* Write the polyhedral data to the file. */
/* DOCSTART:octagon_tecpoly.txt*/
I = TECPOLY112(NULL,
FaceNodes,
FaceLeftElems,
FaceRightElems,
NULL,
NULL,
NULL);
delete FaceNodes;
delete FaceLeftElems;
delete FaceRightElems;
/* DOCEND */
/* DOCSTART:octagon_tecend.txt*/
I = TECEND112();
/* DOCEND */
return 0;
}

View File

@ -0,0 +1,172 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="octagon"
ProjectGUID="{C4BEE7D4-6449-468F-81CC-3BEFDA554F31}"
RootNamespace="octagon"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="..\TecIO_Examples.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="..\TecIO_Examples.vsprops"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
RuntimeLibrary="2"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<File
RelativePath=".\octagon.cpp"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -0,0 +1,11 @@
# Set to appropriate C++ compiler
CPP=g++
CPPFLAGS=-I../../tecsrc ../../tecio.a
EXECUTABLE=pyramid
FILES=$(EXECUTABLE).cpp
build:
$(CPP) $(FILES) $(CPPFLAGS) -o $(EXECUTABLE)
clean:
rm -f $(EXECUTABLE)

View File

@ -0,0 +1,222 @@
/* This example creates a zone with a single polyhedral cell. */
/* DOCSTART:pyramid.txt*/
#include "TECIO.h"
#include "MASTER.h" /* for defintion of NULL */
int main()
{
/* Call TECINI112 */
INTEGER4 FileType = 0; /* 0 for full file */
INTEGER4 Debug = 0;
INTEGER4 VIsDouble = 1;
INTEGER4 I = 0; /* use to check return codes */
I = TECINI112((char*)"Pyramid", /* Data Set Title */
(char*)"X Y Z", /* Variable List */
(char*)"pyramid.plt", /* File Name */
(char*)".", /* Scratch Directory */
&(FileType),
&(Debug),
&(VIsDouble));
/* Call TECZNE112 */
INTEGER4 ZoneType = 7; /* 7 for FEPolyhedron */
INTEGER4 NumNodes = 5; /* number of unique nodes */
INTEGER4 NumElems = 1; /* number of elements */
INTEGER4 NumFaces = 5; /* number of unique faces */
INTEGER4 ICellMax = 0; /* Not Used, set to zero */
INTEGER4 JCellMax = 0; /* Not Used, set to zero */
INTEGER4 KCellMax = 0; /* Not Used, set to zero */
double SolTime = 12.65; /* solution time */
INTEGER4 StrandID = 0; /* static zone */
INTEGER4 ParentZone = 0; /* no parent zone */
INTEGER4 IsBlock = 1; /* block format */
INTEGER4 NFConns = 0; /* not used for FEPolyhedron
* zones
*/
INTEGER4 FNMode = 0; /* not used for FEPolyhedron
* zones
*/
INTEGER4 *PassiveVarArray = NULL;
INTEGER4 *ValueLocArray = NULL;
INTEGER4 *VarShareArray = NULL;
INTEGER4 ShrConn = 0;
/* The number of face nodes in the zone. This example creates
* a zone with a single pyramidal cell. This cell has four
* triangular faces and one rectangular face, yielding a total
* of 16 face nodes.
*/
INTEGER4 NumFaceNodes = 16;
INTEGER4 NumBConns = 0; /* No Boundary Connections */
INTEGER4 NumBItems = 0; /* No Boundary Items */
I = TECZNE112((char*)"Polyhedral Zone (Octahedron)",
&ZoneType,
&NumNodes,
&NumElems,
&NumFaces,
&ICellMax,
&JCellMax,
&KCellMax,
&SolTime,
&StrandID,
&ParentZone,
&IsBlock,
&NFConns,
&FNMode,
&NumFaceNodes,
&NumBConns,
&NumBItems,
PassiveVarArray,
ValueLocArray,
VarShareArray,
&ShrConn);
/* Initialize arrays of nodal data */
double *X = new double[NumNodes];
double *Y = new double[NumNodes];
double *Z = new double[NumNodes];
X[0] = 0;
Y[0] = 0;
Z[0] = 0;
X[1] = 1;
Y[1] = 1;
Z[1] = 2;
X[2] = 2;
Y[2] = 0;
Z[2] = 0;
X[3] = 2;
Y[3] = 2;
Z[3] = 0;
X[4] = 0;
Y[4] = 2;
Z[4] = 0;
/* Write the data (using TECDAT112) */
INTEGER4 DIsDouble = 1; /* One for double precision */
I = TECDAT112(&NumNodes, X, &DIsDouble);
I = TECDAT112(&NumNodes, Y, &DIsDouble);
I = TECDAT112(&NumNodes, Z, &DIsDouble);
delete X;
delete Y;
delete Z;
/* Define the Face Nodes.
* The FaceNodes array is used to indicate which nodes define
* which face. As mentioned earlier, the number of the nodes is
* implicitly defined by the order in which the nodal data is
* provided. The first value of each nodal variable describes
* node 1, the second value describes node 2, and so on.
*
* The face numbering is implicitly defined. Because there are
* two nodes in each face, the first two nodes provided define
* face 1, the next two define face 2 and so on. If there was
* a variable number of nodes used to define the faces, the
* array would be more complicated.
*/
INTEGER4 *FaceNodeCounts = new INTEGER4[NumFaces];
/* The first four faces are triangular, i.e. have three nodes.
* The fifth face is rectangular, i.e. has four nodes. */
FaceNodeCounts[0] = 3;
FaceNodeCounts[1] = 3;
FaceNodeCounts[2] = 3;
FaceNodeCounts[3] = 3;
FaceNodeCounts[4] = 4;
INTEGER4 *FaceNodes = new INTEGER4[NumFaceNodes];
/* Face Nodes for Face 1 */
FaceNodes[0] = 1;
FaceNodes[1] = 2;
FaceNodes[2] = 3;
/* Face Nodes for Face 2 */
FaceNodes[3] = 3;
FaceNodes[4] = 2;
FaceNodes[5] = 4;
/* Face Nodes for Face 3 */
FaceNodes[6] = 5;
FaceNodes[7] = 2;
FaceNodes[8] = 4;
/* Face Nodes for Face 4 */
FaceNodes[9] = 1;
FaceNodes[10] = 2;
FaceNodes[11] = 5;
/* Face Nodes for Face 5 */
FaceNodes[12] = 1;
FaceNodes[13] = 5;
FaceNodes[14] = 4;
FaceNodes[15] = 3;
/* Define the right and left elements of each face.
*
* The last step for writing out the polyhedral data is to
* define the right and left neighboring elements for each
* face. The neighboring elements can be determined using the
* right-hand rule. For each face, place your right-hand along
* the face which your fingers pointing the direction of
* incrementing node numbers (i.e. from node 1 to node 2).
* Your right thumb will point towards the right element; the
* element on the other side of your hand is the left element.
*
* The number zero is used to indicate that there isn't an
* element on that side of the face.
*
* Because of the way we numbered the nodes and faces, the
* right element for every face is the element itself
* (element 1) and the left element is "no-neighboring element"
* (element 0).
*/
INTEGER4 *FaceLeftElems = new INTEGER4[NumFaces];
FaceLeftElems[0] = 1;
FaceLeftElems[1] = 1;
FaceLeftElems[2] = 0;
FaceLeftElems[3] = 0;
FaceLeftElems[4] = 0;
INTEGER4 *FaceRightElems = new INTEGER4[NumFaces];
FaceRightElems[0] = 0;
FaceRightElems[1] = 0;
FaceRightElems[2] = 1;
FaceRightElems[3] = 1;
FaceRightElems[4] = 1;
/* Write the face map (created above) using TECPOLY112. */
I = TECPOLY112(FaceNodeCounts, /* The face node counts array */
FaceNodes, /* The face nodes array */
FaceLeftElems, /* The left elements array */
FaceRightElems, /* The right elements array */
NULL, /* No boundary connection counts */
NULL, /* No boundary connection elements */
NULL); /* No boundary connection zones */
delete FaceNodeCounts;
delete FaceNodes;
delete FaceLeftElems;
delete FaceRightElems;
I = TECEND112();
return 0;
}
/* DOCEND */

View File

@ -0,0 +1,172 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="pyramid"
ProjectGUID="{CFED06AE-48C6-491C-AE5F-E1B7882A44E9}"
RootNamespace="pyramid"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="..\TecIO_Examples.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="..\TecIO_Examples.vsprops"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
RuntimeLibrary="2"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<File
RelativePath=".\pyramid.cpp"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -0,0 +1,11 @@
# Set to appropriate C++ compiler
CPP=g++
CPPFLAGS=-I../../tecsrc ../../tecio.a
EXECUTABLE=simtest
FILES=$(EXECUTABLE).c
build:
$(CPP) $(FILES) $(CPPFLAGS) -o $(EXECUTABLE)
clean:
rm -f $(EXECUTABLE)

View File

@ -0,0 +1,100 @@
/*
* Simple example c program to write a
* binary datafile for tecplot. This example
* does the following:
*
* 1. Open a datafile called "t.plt"
* 2. Assign values for X,Y, and P
* 3. Write out a zone dimensioned 4x5
* 4. Close the datafile.
*/
#include "TECIO.h"
#ifndef NULL
#define NULL 0
#endif
enum FileType { FULL = 0, GRID = 1, SOLUTION = 2 };
int main(void)
{
float X[5][4], Y[5][4], P[5][4];
double SolTime;
INTEGER4 Debug, I, J, III, DIsDouble, VIsDouble, IMax, JMax, KMax, ZoneType, StrandID, ParentZn, IsBlock;
INTEGER4 ICellMax, JCellMax, KCellMax, NFConns, FNMode, ShrConn, FileType;
Debug = 1;
VIsDouble = 0;
DIsDouble = 0;
IMax = 4;
JMax = 5;
KMax = 1;
ZoneType = 0; /* Ordered */
SolTime = 360.0;
StrandID = 0; /* StaticZone */
ParentZn = 0; /* No Parent */
IsBlock = 1; /* Block */
ICellMax = 0;
JCellMax = 0;
KCellMax = 0;
NFConns = 0;
FNMode = 0;
ShrConn = 0;
FileType = FULL;
/*
* Open the file and write the tecplot datafile
* header information
*/
I = TECINI112((char*)"SIMPLE DATASET",
(char*)"X Y P",
(char*)"t.plt",
(char*)".",
&FileType,
&Debug,
&VIsDouble);
for (J = 0; J < 5; J++)
for (I = 0; I < 4; I++)
{
X[J][I] = (float)(I + 1);
Y[J][I] = (float)(J + 1);
P[J][I] = (float)((I + 1) * (J + 1));
}
/*
* Write the zone header information.
*/
I = TECZNE112((char*)"Simple Zone",
&ZoneType,
&IMax,
&JMax,
&KMax,
&ICellMax,
&JCellMax,
&KCellMax,
&SolTime,
&StrandID,
&ParentZn,
&IsBlock,
&NFConns,
&FNMode,
0, /* TotalNumFaceNodes */
0, /* NumConnectedBoundaryFaces */
0, /* TotalNumBoundaryConnections */
NULL, /* PassiveVarList */
NULL, /* ValueLocation = Nodal */
NULL, /* SharVarFromZone */
&ShrConn);
/*
* Write out the field data.
*/
III = IMax * JMax;
I = TECDAT112(&III, &X[0][0], &DIsDouble);
I = TECDAT112(&III, &Y[0][0], &DIsDouble);
I = TECDAT112(&III, &P[0][0], &DIsDouble);
I = TECEND112();
return 0;
}

View File

@ -0,0 +1,98 @@
C
C Simple example fortran program to write a
C binary datafile for tecplot. This example
C does the following:
C
C 1. Open a datafile called "t.plt"
C 2. Assign values for X,Y, and P
C 3. Write out a zone dimensioned 4x5
C 4. Close the datafile.
C
C
program test
INCLUDE 'tecio.inc'
character*1 NULLCHR
Integer*4 Debug,III,NPts,NElm
Dimension X(4,5), Y(4,5), P(4,5)
Real*8 SolTime
Integer*4 VIsDouble, FileType
Integer*4 ZoneType,StrandID,ParentZn,IsBlock
Integer*4 ICellMax,JCellMax,KCellMax,NFConns,FNMode,ShrConn
POINTER (NullPtr,Null)
Integer*4 Null(*)
NULLCHR = CHAR(0)
NullPtr = 0
Debug = 1
FileType = 0
VIsDouble = 0
IMax = 4
JMax = 5
KMax = 1
ZoneType = 0
SolTime = 360.0
StrandID = 0
ParentZn = 0
IsBlock = 1
ICellMax = 0
JCellMax = 0
KCellMax = 0
NFConns = 0
FNMode = 0
ShrConn = 0
C
C... Open the file and write the tecplot datafile
C... header information.
C
I = TecIni112('SIMPLE DATASET'//NULLCHR,
& 'X Y P'//NULLCHR,
& 't.plt'//NULLCHR,
& '.'//NULLCHR,
& FileType,
& Debug,
& VIsDouble)
Do 10 I = 1,4
Do 10 J = 1,5
X(I,J) = I
Y(I,J) = J
P(I,J) = I*J
10 Continue
C
C... Write the zone header information.
C
I = TecZne112('Simple Zone'//NULLCHR,
& ZoneType,
& IMax,
& JMax,
& KMax,
& ICellMax,
& JCellMax,
& KCellMax,
& SolTime,
& StrandID,
& ParentZn,
& IsBlock,
& NFConns,
& FNMode,
& 0,
& 0,
& 0,
& Null,
& Null,
& Null,
& ShrConn)
C
C... Write out the field data.
C
III = IMax*JMax
I = TecDat112(III,X,0)
I = TecDat112(III,Y,0)
I = TecDat112(III,P,0)
I = TecEnd112()
Stop
End

View File

@ -0,0 +1,98 @@
!
! Simple example fortran program to write a
! binary datafile for tecplot. This example
! does the following:
!
! 1. Open a datafile called "t.plt"
! 2. Assign values for X,Y, and P
! 3. Write out a zone dimensioned 4x5
! 4. Close the datafile.
!
!
program test
INCLUDE 'tecio.f90'
character*1 NULLCHR
Integer*4 Debug,III,NPts,NElm
Dimension X(4,5), Y(4,5), P(4,5)
Real*8 SolTime
Integer*4 VIsDouble, FileType
Integer*4 ZoneType,StrandID,ParentZn,IsBlock
Integer*4 ICellMax,JCellMax,KCellMax,NFConns,FNMode,ShrConn
POINTER (NullPtr,Null)
Integer*4 Null(*)
NULLCHR = CHAR(0)
NullPtr = 0
Debug = 1
FileType = 0
VIsDouble = 0
IMax = 4
JMax = 5
KMax = 1
ZoneType = 0
SolTime = 360.0
StrandID = 0
ParentZn = 0
IsBlock = 1
ICellMax = 0
JCellMax = 0
KCellMax = 0
NFConns = 0
FNMode = 0
ShrConn = 0
!
!... Open the file and write the tecplot datafile
!... header information.
!
I = TecIni112('SIMPLE DATASET'//NULLCHR, &
'X Y P'//NULLCHR, &
't.plt'//NULLCHR, &
'.'//NULLCHR, &
FileType, &
Debug, &
VIsDouble)
Do 10 I = 1,4
Do 10 J = 1,5
X(I,J) = I
Y(I,J) = J
P(I,J) = I*J
10 Continue
!
!... Write the zone header information.
!
I = TecZne112('Simple Zone'//NULLCHR, &
ZoneType, &
IMax, &
JMax, &
KMax, &
ICellMax, &
JCellMax, &
KCellMax, &
SolTime, &
StrandID, &
ParentZn, &
IsBlock, &
NFConns, &
FNMode, &
0, &
0, &
0, &
Null, &
Null, &
Null, &
ShrConn)
!
!... Write out the field data.
!
III = IMax*JMax
I = TecDat112(III,X,0)
I = TecDat112(III,Y,0)
I = TecDat112(III,P,0)
I = TecEnd112()
Stop
End

View File

@ -0,0 +1,346 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="simtestc"
ProjectGUID="{62FA6E8C-388E-4047-BC9D-574B470B94DE}"
RootNamespace="simtestc"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
<Platform
Name="x64"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(PlatformName)/$(ConfigurationName)"
IntermediateDirectory="$(SolutionDir)$(PlatformName)/$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="..\TecIO_Examples.vsprops"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="2"
AdditionalLibraryDirectories=""
GenerateDebugInformation="true"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|x64"
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="..\TecIO_Examples.vsprops"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="2"
AdditionalLibraryDirectories=""
GenerateDebugInformation="true"
SubSystem="1"
TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(PlatformName)/$(ConfigurationName)"
IntermediateDirectory="$(SolutionDir)$(PlatformName)/$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="..\TecIO_Examples.vsprops"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="1"
AdditionalLibraryDirectories=""
GenerateDebugInformation="true"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|x64"
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="..\TecIO_Examples.vsprops"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="1"
AdditionalLibraryDirectories=""
GenerateDebugInformation="true"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<File
RelativePath=".\simtest.c"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<VisualStudioProject ProjectCreator="Intel Fortran" Keyword="Console Application" Version="9.10" ProjectIdGuid="{861BC05F-1E95-401A-A80E-7589ADD1C79E}">
<Platforms>
<Platform Name="Win32"/></Platforms>
<Configurations>
<Configuration Name="Debug|Win32" OutputDirectory="$(SolutionDir)$(PlatformName)/$(ConfigurationName)" IntermediateDirectory="$(SolutionDir)$(PlatformName)/$(ConfigurationName)" DeleteExtensionsOnClean="*.obj;*.mod;*.pdb;*.asm;*.map;*.dyn;*.dpi;*.tmp;*.log;*.ilk;*.exe;$(TargetPath)">
<Tool Name="VFMidlTool" SuppressStartupBanner="true" HeaderFileName="$(InputName).h" TypeLibraryName="$(IntDir)/$(InputName).tlb"/>
<Tool Name="VFPreBuildEventTool"/>
<Tool Name="VFPostBuildEventTool"/>
<Tool Name="VFFortranCompilerTool" SuppressStartupBanner="true" DebugInformationFormat="debugEnabled" Optimization="optimizeDisabled" AdditionalIncludeDirectories="$(TEC_360_2009)/Include" ModulePath="$(INTDIR)/" ObjectFile="$(INTDIR)/" Traceback="true" BoundsCheck="true" RuntimeLibrary="rtMultiThreadedDebug" CompileOnly="true"/>
<Tool Name="VFCustomBuildTool"/>
<Tool Name="VFLinkerTool" OutputFile="$(OUTDIR)/simtestf.exe" LinkIncremental="linkIncrementalNo" SuppressStartupBanner="true" AdditionalLibraryDirectories="$(TEC_360_2009)/Bin" GenerateDebugInformation="true" ProgramDatabaseFile="$(OUTDIR)/simtestf.pdb" SubSystem="subSystemConsole" AdditionalDependencies="tecio.lib"/>
<Tool Name="VFPreLinkEventTool"/>
<Tool Name="VFResourceCompilerTool" ResourceOutputFileName="$(IntDir)/$(InputName).res"/></Configuration>
<Configuration Name="Release|Win32" OutputDirectory="$(SolutionDir)$(PlatformName)/$(ConfigurationName)" IntermediateDirectory="$(SolutionDir)$(PlatformName)/$(ConfigurationName)" DeleteExtensionsOnClean="*.obj;*.mod;*.pdb;*.asm;*.map;*.dyn;*.dpi;*.tmp;*.log;*.ilk;*.exe;$(TargetPath)">
<Tool Name="VFMidlTool" SuppressStartupBanner="true" HeaderFileName="$(InputName).h" TypeLibraryName="$(IntDir)/$(InputName).tlb"/>
<Tool Name="VFPreBuildEventTool"/>
<Tool Name="VFPostBuildEventTool"/>
<Tool Name="VFFortranCompilerTool" SuppressStartupBanner="true" AdditionalIncludeDirectories="$(TEC_360_2009)/Include" ModulePath="$(INTDIR)/" ObjectFile="$(INTDIR)/" RuntimeLibrary="rtMultiThreaded" CompileOnly="true"/>
<Tool Name="VFCustomBuildTool"/>
<Tool Name="VFLinkerTool" OutputFile="$(OUTDIR)/simtestf.exe" LinkIncremental="linkIncrementalNo" SuppressStartupBanner="true" AdditionalLibraryDirectories="$(TEC_360_2009)/Bin" SubSystem="subSystemConsole" AdditionalDependencies="tecio.lib"/>
<Tool Name="VFPreLinkEventTool"/>
<Tool Name="VFResourceCompilerTool" ResourceOutputFileName="$(IntDir)/$(InputName).res"/></Configuration></Configurations>
<Files>
<File RelativePath="simtest.f90"/></Files>
<Globals/></VisualStudioProject>

View File

@ -0,0 +1,11 @@
# Set to appropriate C++ compiler
CPP=g++
CPPFLAGS=-I../../tecsrc ../../tecio.a
EXECUTABLE=squares
FILES=$(EXECUTABLE).cpp
build:
$(CPP) $(FILES) $(CPPFLAGS) -o $(EXECUTABLE)
clean:
rm -f $(EXECUTABLE)

View File

@ -0,0 +1,124 @@
/* This example creates a group of square geometries, each with a
* different fill color */
#if defined _MSC_VER
#pragma warning (disable: 4996) /* Windows strcpy warning off */
#endif
/* DOCSTART:tecgeo.txt*/
#include "TECIO.h"
#include <string.h>
int main()
{
INTEGER4 Debug = 1;
INTEGER4 VIsDouble = 0;
INTEGER4 FileType = 0;
INTEGER4 I = 0; /* use to check return values */
/* Open the file and write the tecplot datafile
* header information
*/
I = TECINI112((char*)"Square Geometries",
(char*)"X Y P",
(char*)"squares.plt",
(char*)".",
&FileType,
&Debug,
&VIsDouble);
double ZPos = 0.0; /* N/A for squares */
double XPos;
double YPos;
INTEGER4 PosCoordMode = 0; /* use grid coordinates */
/* opt not to attach the text to a given zone. When text is
* attached to a given zone, it is displayed only when the zone
* is displayed.
*/
INTEGER4 AttachToZone = 0;
INTEGER4 Zone = 1;
/* Set the Geometry Style Values */
INTEGER4 Color = 0; /* set the outline color to
* black
*/
INTEGER4 IsFilled = 1;
INTEGER4 GeomType = 2; /* set the geometry type to
* square
*/
INTEGER4 LinePattern = 5; /* set the line pattern to
* DashDotDot
*/
double PatternLength = .1;
double LineThick = .2;
/* N/A for square geometries */
INTEGER4 NumPts = 100;
INTEGER4 ArrowStyle = 1;
INTEGER4 ArrowAttach = 0;
double ArrowSize = 1;
double ArrowAngle = 30;
INTEGER4 NumSegments = 15;
INTEGER4 NumSegPts = 25;
INTEGER4 Scope = 1; /* set the text to "local", i.e.
* available in the current frame
* only.
*/
INTEGER4 Clipping = 1;
/* Specify the length of a side of the square. The units used
* are those defined with PosCoordMode.
*/
float XGeomData = 2.5;
float YGeomData = 0; /* N/A for square geometries */
float ZGeomData = 0; /* N/A for square geometries */
char * MFC = new char[128];
strcpy(MFC, "SQUARE");
for (INTEGER4 ii = 0; ii <= 7; ii++)
{
INTEGER4 FillColor = ii;
XPos = (double) ii;
YPos = (double) ii;
I = TECGEO112(&XPos,
&YPos,
&ZPos,
&PosCoordMode,
&AttachToZone,
&Zone,
&Color,
&FillColor,
&IsFilled,
&GeomType,
&LinePattern,
&PatternLength,
&LineThick,
&NumPts,
&ArrowStyle,
&ArrowAttach,
&ArrowSize,
&ArrowAngle,
&Scope,
&Clipping,
&NumSegments,
&NumSegPts,
&XGeomData,
&YGeomData,
&ZGeomData,
MFC);
}
I = TECEND112();
delete MFC;
return 0;
}
/* DOCEND */

View File

@ -0,0 +1,172 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="squares"
ProjectGUID="{2E5EC0A5-5902-4A66-8A67-A61EC9EB0855}"
RootNamespace="squares"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="..\TecIO_Examples.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="..\TecIO_Examples.vsprops"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
RuntimeLibrary="2"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<File
RelativePath=".\squares.cpp"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

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