From cadba3c278e9e581d9aa4c10ef6cc7290c046819 Mon Sep 17 00:00:00 2001 From: graham Date: Tue, 14 Jul 2009 18:46:46 +0100 Subject: [PATCH 001/454] Adding new MixedDiffuseSpecular wall collision model. --- .../makeDsmcParcelWallInteractionModels.C | 7 + .../MixedDiffuseSpecular.C | 140 ++++++++++++++++++ .../MixedDiffuseSpecular.H | 106 +++++++++++++ 3 files changed, 253 insertions(+) create mode 100644 src/lagrangian/dsmc/submodels/WallInteractionModel/MixedDiffuseSpecular/MixedDiffuseSpecular.C create mode 100644 src/lagrangian/dsmc/submodels/WallInteractionModel/MixedDiffuseSpecular/MixedDiffuseSpecular.H diff --git a/src/lagrangian/dsmc/parcels/derived/dsmcParcel/makeDsmcParcelWallInteractionModels.C b/src/lagrangian/dsmc/parcels/derived/dsmcParcel/makeDsmcParcelWallInteractionModels.C index f15d0bdadd..b67f66ec85 100644 --- a/src/lagrangian/dsmc/parcels/derived/dsmcParcel/makeDsmcParcelWallInteractionModels.C +++ b/src/lagrangian/dsmc/parcels/derived/dsmcParcel/makeDsmcParcelWallInteractionModels.C @@ -28,6 +28,7 @@ License #include "DsmcCloud.H" #include "MaxwellianThermal.H" #include "SpecularReflection.H" +#include "MixedDiffuseSpecular.H" namespace Foam { @@ -46,6 +47,12 @@ namespace Foam DsmcCloud, dsmcParcel ); + makeWallInteractionModelType + ( + MixedDiffuseSpecular, + DsmcCloud, + dsmcParcel + ); }; diff --git a/src/lagrangian/dsmc/submodels/WallInteractionModel/MixedDiffuseSpecular/MixedDiffuseSpecular.C b/src/lagrangian/dsmc/submodels/WallInteractionModel/MixedDiffuseSpecular/MixedDiffuseSpecular.C new file mode 100644 index 0000000000..a12fff43d1 --- /dev/null +++ b/src/lagrangian/dsmc/submodels/WallInteractionModel/MixedDiffuseSpecular/MixedDiffuseSpecular.C @@ -0,0 +1,140 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "MixedDiffuseSpecular.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::MixedDiffuseSpecular::MixedDiffuseSpecular +( + const dictionary& dict, + CloudType& cloud +) +: + WallInteractionModel(dict, cloud, typeName), + diffuseFraction_(readScalar(this->coeffDict().lookup("diffuseFraction"))) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template +Foam::MixedDiffuseSpecular::~MixedDiffuseSpecular() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +void Foam::MixedDiffuseSpecular::correct +( + const wallPolyPatch& wpp, + const label faceId, + vector& U, + scalar& Ei, + label typeId +) +{ + label wppIndex = wpp.index(); + + label wppLocalFace = wpp.whichFace(faceId); + + vector nw = wpp.faceAreas()[wppLocalFace]; + + // Normal unit vector + nw /= mag(nw); + + // Normal velocity magnitude + scalar magUn = U & nw; + + CloudType& cloud(this->owner()); + + Random& rndGen(cloud.rndGen()); + + if (diffuseFraction_ > rndGen.scalar01()) + { + // Diffuse reflection + + // Wall tangential velocity (flow direction) + vector Ut = U - magUn*nw; + + while (mag(Ut) < SMALL) + { + // If the incident velocity is parallel to the face normal, no + // tangential direction can be chosen. Add a perturbation to the + // incoming velocity and recalculate. + + U = vector + ( + U.x()*(0.8 + 0.2*rndGen.scalar01()), + U.y()*(0.8 + 0.2*rndGen.scalar01()), + U.z()*(0.8 + 0.2*rndGen.scalar01()) + ); + + magUn = U & nw; + + Ut = U - magUn*nw; + } + + // Wall tangential unit vector + vector tw1 = Ut/mag(Ut); + + // Other tangential unit vector + vector tw2 = nw^tw1; + + scalar T = cloud.T().boundaryField()[wppIndex][wppLocalFace]; + + scalar mass = cloud.constProps(typeId).mass(); + + scalar iDof = cloud.constProps(typeId).internalDegreesOfFreedom(); + + U = + sqrt(CloudType::kb*T/mass) + *( + rndGen.GaussNormal()*tw1 + + rndGen.GaussNormal()*tw2 + - sqrt(-2.0*log(max(1 - rndGen.scalar01(), VSMALL)))*nw + ); + + U += cloud.U().boundaryField()[wppIndex][wppLocalFace]; + + Ei = cloud.equipartitionInternalEnergy(T, iDof); + } + else + { + // Specular reflection + + if (magUn > 0.0) + { + U -= 2.0*magUn*nw; + } + } + +} + + +// ************************************************************************* // diff --git a/src/lagrangian/dsmc/submodels/WallInteractionModel/MixedDiffuseSpecular/MixedDiffuseSpecular.H b/src/lagrangian/dsmc/submodels/WallInteractionModel/MixedDiffuseSpecular/MixedDiffuseSpecular.H new file mode 100644 index 0000000000..b84f43d8f6 --- /dev/null +++ b/src/lagrangian/dsmc/submodels/WallInteractionModel/MixedDiffuseSpecular/MixedDiffuseSpecular.H @@ -0,0 +1,106 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::MixedDiffuseSpecular + +Description + Wall interaction setting microscopic velocity to a random one drawn from a + Maxwellian distribution corresponding to a specified temperature + +\*---------------------------------------------------------------------------*/ + +#ifndef MixedDiffuseSpecular_H +#define MixedDiffuseSpecular_H + +#include "WallInteractionModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +/*---------------------------------------------------------------------------*\ + Class MixedDiffuseSpecular Declaration +\*---------------------------------------------------------------------------*/ + +template +class MixedDiffuseSpecular +: + public WallInteractionModel +{ + // Private data + + //- Fraction of wall interactions that are diffuse + scalar diffuseFraction_; + + +public: + + //- Runtime type information + TypeName("MixedDiffuseSpecular"); + + + // Constructors + + //- Construct from dictionary + MixedDiffuseSpecular + ( + const dictionary& dict, + CloudType& cloud + ); + + + // Destructor + virtual ~MixedDiffuseSpecular(); + + + // Member Functions + + //- Apply wall correction + virtual void correct + ( + const wallPolyPatch& wpp, + const label faceId, + vector& U, + scalar& Ei, + label typeId + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "MixedDiffuseSpecular.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // From 9321f7e1e5bf1ee919cf16a7f1e7f388d6f7133e Mon Sep 17 00:00:00 2001 From: graham Date: Wed, 15 Jul 2009 15:28:04 +0100 Subject: [PATCH 002/454] Adding pressure field measurement, internal and surface. --- .../dsmcFieldsCalc/dsmcFieldsCalc.C | 11 ++++- .../utilities/dsmcFields/dsmcFields.C | 43 ++++++++++++++++++- 2 files changed, 51 insertions(+), 3 deletions(-) diff --git a/applications/utilities/postProcessing/miscellaneous/dsmcFieldsCalc/dsmcFieldsCalc.C b/applications/utilities/postProcessing/miscellaneous/dsmcFieldsCalc/dsmcFieldsCalc.C index 95077df225..34f231850f 100644 --- a/applications/utilities/postProcessing/miscellaneous/dsmcFieldsCalc/dsmcFieldsCalc.C +++ b/applications/utilities/postProcessing/miscellaneous/dsmcFieldsCalc/dsmcFieldsCalc.C @@ -113,7 +113,16 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh) return; } - wordList extensiveVVFNames(IStringStream ("(momentumMean)")()); + wordList extensiveVVFNames + ( + IStringStream + ( + "( \ + momentumMean \ + fDMean \ + )" + )() + ); PtrList extensiveVVFs(extensiveVVFNames.size()); diff --git a/src/postProcessing/functionObjects/utilities/dsmcFields/dsmcFields.C b/src/postProcessing/functionObjects/utilities/dsmcFields/dsmcFields.C index 8957dee17c..7056fba521 100644 --- a/src/postProcessing/functionObjects/utilities/dsmcFields/dsmcFields.C +++ b/src/postProcessing/functionObjects/utilities/dsmcFields/dsmcFields.C @@ -106,6 +106,7 @@ void Foam::dsmcFields::write() word linearKEMeanName = "linearKEMean"; word internalEMeanName = "internalEMean"; word iDofMeanName = "iDofMean"; + word fDMeanName = "fDMean"; const volScalarField& rhoNMean = obr_.lookupObject ( @@ -137,6 +138,11 @@ void Foam::dsmcFields::write() iDofMeanName ); + volVectorField fDMean = obr_.lookupObject + ( + fDMeanName + ); + if (min(mag(rhoNMean)).value() > VSMALL) { Info<< "Calculating dsmcFields." << endl; @@ -165,7 +171,7 @@ void Foam::dsmcFields::write() IOobject::NO_READ ), 2.0/(3.0*dsmcCloud::kb*rhoNMean) - *(linearKEMean - 0.5*rhoMMean*(UMean & UMean)) + *(linearKEMean - 0.5*rhoMMean*(UMean & UMean)) ); Info<< " Calculating internalT field." << endl; @@ -192,9 +198,36 @@ void Foam::dsmcFields::write() IOobject::NO_READ ), 2.0/(dsmcCloud::kb*(3.0*rhoNMean + iDofMean)) - *(linearKEMean - 0.5*rhoMMean*(UMean & UMean) + internalEMean) + *(linearKEMean - 0.5*rhoMMean*(UMean & UMean) + internalEMean) ); + Info<< " Calculating pressure field." << endl; + volScalarField p + ( + IOobject + ( + "p", + obr_.time().timeName(), + obr_, + IOobject::NO_READ + ), + dsmcCloud::kb*rhoNMean*translationalT + ); + + const fvMesh& mesh = fDMean.mesh(); + + forAll(mesh.boundaryMesh(), i) + { + const polyPatch& patch = mesh.boundaryMesh()[i]; + + if (isA(patch)) + { + p.boundaryField()[i] = + fDMean.boundaryField()[i] + & (patch.faceAreas()/mag(patch.faceAreas())); + } + } + Info<< " mag(UMean) max/min : " << max(mag(UMean)).value() << " " << min(mag(UMean)).value() << endl; @@ -211,6 +244,10 @@ void Foam::dsmcFields::write() << max(overallT).value() << " " << min(overallT).value() << endl; + Info<< " p max/min : " + << max(p).value() << " " + << min(p).value() << endl; + UMean.write(); translationalT.write(); @@ -219,6 +256,8 @@ void Foam::dsmcFields::write() overallT.write(); + p.write(); + Info<< "dsmcFields written." << nl << endl; } else From 103cd27ef563091d959268b9cc92691662e3dfb7 Mon Sep 17 00:00:00 2001 From: graham Date: Fri, 17 Jul 2009 15:40:11 +0100 Subject: [PATCH 003/454] Measurement of surface velocity. Created momentum and rhoM field inside the cloud - duplicated memory with solver for the moment. --- .../clouds/Templates/DsmcCloud/DsmcCloud.C | 79 ++++++++ .../clouds/Templates/DsmcCloud/DsmcCloud.H | 40 +++-- .../clouds/Templates/DsmcCloud/DsmcCloudI.H | 169 ++++++++---------- .../parcels/Templates/DsmcParcel/DsmcParcel.C | 42 +++-- .../MaxwellianThermal/MaxwellianThermal.C | 8 +- .../MixedDiffuseSpecular.C | 12 +- .../SpecularReflection/SpecularReflection.C | 6 +- 7 files changed, 225 insertions(+), 131 deletions(-) diff --git a/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.C b/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.C index 23aa3dc478..8615135a26 100644 --- a/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.C +++ b/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.C @@ -490,6 +490,23 @@ void Foam::DsmcCloud::resetSurfaceDataFields() { fDBF[p] = vector::zero; } + + volVectorField::GeometricBoundaryField& momentumBF + ( + momentum_.boundaryField() + ); + + forAll(momentumBF, p) + { + momentumBF[p] = vector::zero; + } + + volScalarField::GeometricBoundaryField& rhoMBF(rhoM_.boundaryField()); + + forAll(rhoMBF, p) + { + rhoMBF[p] = VSMALL; + } } @@ -591,6 +608,37 @@ Foam::DsmcCloud::DsmcCloud vector::zero ) ), + momentum_ + ( + IOobject + ( + this->name() + "momentum_", + mesh_.time().timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensionedVector + ( + "zero", + dimensionSet(1, -2, -1, 0, 0), + vector::zero + ) + ), + rhoM_ + ( + IOobject + ( + this->name() + "rhoM_", + mesh_.time().timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensionedScalar("zero", dimensionSet(1, -3, 0, 0, 0), 0.0) + ), constProps_(), rndGen_(label(149382906) + 7183*Pstream::myProcNo()), T_(T), @@ -703,6 +751,37 @@ Foam::DsmcCloud::DsmcCloud vector::zero ) ), + momentum_ + ( + IOobject + ( + this->name() + "momentum_", + mesh_.time().timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensionedVector + ( + "zero", + dimensionSet(1, -2, -1, 0, 0), + vector::zero + ) + ), + rhoM_ + ( + IOobject + ( + this->name() + "rhoM_", + mesh_.time().timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensionedScalar("zero", dimensionSet(1, -3, 0, 0, 0), 0.0) + ), constProps_(), rndGen_(label(971501) + 1526*Pstream::myProcNo()), T_ diff --git a/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.H b/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.H index 76b1dd7e79..40f3935eee 100644 --- a/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.H +++ b/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.H @@ -110,6 +110,12 @@ class DsmcCloud //- Force density at surface field volVectorField fD_; + //- Momentum density field + volVectorField momentum_; + + //- Mass density field + volScalarField rhoM_; + //- Parcel constant properties - one for each type List constProps_; @@ -254,19 +260,19 @@ public: inline scalar cachedDeltaT() const; - // References to the surface data collection fields + // References to the boundary fields for surface data collection - //- Return heat flux at surface field - inline const volScalarField& q() const; + //- Return non-const heat flux boundary field reference + inline volScalarField::GeometricBoundaryField& qBF(); - //- Return non-const heat flux at surface field - inline volScalarField& q(); + //- Return non-const force density at boundary field reference + inline volVectorField::GeometricBoundaryField& fDBF(); - //- Return force density at surface field - inline const volVectorField& fD() const; + //- Return non-const momentum density boundary field reference + inline volVectorField::GeometricBoundaryField& momentumBF(); - //- Return non-const force density at surface field - inline volVectorField& fD(); + //- Return non-const mass density boundary field reference + inline volScalarField::GeometricBoundaryField& rhoMBF(); // References to the macroscopic fields @@ -391,17 +397,20 @@ public: // Fields + //- Return heat flux at surface field + inline const volScalarField& q() const; + + //- Return force density at surface field + inline const volVectorField& fD() const; + //- Return the real particle number density field inline const tmp rhoN() const; //- Return the particle mass density field - inline const tmp rhoM() const; - - //- Return the field of number of DSMC particles - inline const tmp dsmcRhoN() const; + inline const volScalarField& rhoM(); //- Return the momentum density field - inline const tmp momentum() const; + inline const volVectorField& momentum(); //- Return the total linear kinetic energy (translational and // thermal density field @@ -413,6 +422,9 @@ public: //- Return the average internal degrees of freedom field inline const tmp iDof() const; + //- Return the field of number of DSMC particles + inline const tmp dsmcRhoN() const; + // Cloud evolution functions diff --git a/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloudI.H b/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloudI.H index 3529702fdd..07ac87bd2c 100644 --- a/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloudI.H +++ b/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloudI.H @@ -135,30 +135,34 @@ inline Foam::scalar Foam::DsmcCloud::cachedDeltaT() const template -inline const Foam::volScalarField& Foam::DsmcCloud::q() const +inline Foam::volScalarField::GeometricBoundaryField& +Foam::DsmcCloud::qBF() { - return q_; + return q_.boundaryField(); } template -inline Foam::volScalarField& Foam::DsmcCloud::q() +inline Foam::volVectorField::GeometricBoundaryField& +Foam::DsmcCloud::fDBF() { - return q_; + return fD_.boundaryField(); } template -inline const Foam::volVectorField& Foam::DsmcCloud::fD() const +inline Foam::volVectorField::GeometricBoundaryField& +Foam::DsmcCloud::momentumBF() { - return fD_; + return momentum_.boundaryField(); } template -inline Foam::volVectorField& Foam::DsmcCloud::fD() +inline Foam::volScalarField::GeometricBoundaryField& +Foam::DsmcCloud::rhoMBF() { - return fD_; + return rhoM_.boundaryField(); } @@ -373,6 +377,20 @@ Foam::DsmcCloud::maxwellianMostProbableSpeed } +template +inline const Foam::volScalarField& Foam::DsmcCloud::q() const +{ + return q_; +} + + +template +inline const Foam::volVectorField& Foam::DsmcCloud::fD() const +{ + return fD_; +} + + template inline const Foam::tmp Foam::DsmcCloud::rhoN() const @@ -411,116 +429,44 @@ Foam::DsmcCloud::rhoN() const template -inline const Foam::tmp -Foam::DsmcCloud::rhoM() const +inline const Foam::volScalarField& Foam::DsmcCloud::rhoM() { - tmp trhoM - ( - new volScalarField - ( - IOobject - ( - this->name() + "rhoM", - this->db().time().timeName(), - this->db(), - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - mesh_, - dimensionedScalar("zero", dimensionSet(1, -3, 0, 0, 0), VSMALL) - ) - ); + scalarField& rM = rhoM_.internalField(); + + rM = VSMALL; - scalarField& rhoM = trhoM().internalField(); forAllConstIter(typename DsmcCloud, *this, iter) { const ParcelType& p = iter(); const label cellI = p.cell(); - rhoM[cellI] += constProps(p.typeId()).mass(); + rM[cellI] += constProps(p.typeId()).mass(); } - rhoM *= nParticle_/mesh().cellVolumes(); + rM *= nParticle_/mesh().cellVolumes(); - return trhoM; + return rhoM_; } template -inline const Foam::tmp -Foam::DsmcCloud::dsmcRhoN() const +inline const Foam::volVectorField& Foam::DsmcCloud::momentum() { - tmp tdsmcRhoN - ( - new volScalarField - ( - IOobject - ( - this->name() + "dsmcRhoN", - this->db().time().timeName(), - this->db(), - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - mesh_, - dimensionedScalar("zero", dimensionSet(0, -3, 0, 0, 0), 0.0) - ) - ); + vectorField& mom = momentum_.internalField(); + + mom = vector::zero; - scalarField& dsmcRhoN = tdsmcRhoN().internalField(); forAllConstIter(typename DsmcCloud, *this, iter) { const ParcelType& p = iter(); const label cellI = p.cell(); - dsmcRhoN[cellI]++; + mom[cellI] += constProps(p.typeId()).mass()*p.U(); } - return tdsmcRhoN; -} + mom *= nParticle_/mesh().cellVolumes(); - -template -inline const Foam::tmp -Foam::DsmcCloud::momentum() const -{ - tmp tmomentum - ( - new volVectorField - ( - IOobject - ( - this->name() + "momentum", - this->db().time().timeName(), - this->db(), - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - mesh_, - dimensionedVector - ( - "zero", - dimensionSet(1, -2, -1, 0, 0), - vector::zero - ) - ) - ); - - vectorField& momentum = tmomentum().internalField(); - forAllConstIter(typename DsmcCloud, *this, iter) - { - const ParcelType& p = iter(); - const label cellI = p.cell(); - - momentum[cellI] += constProps(p.typeId()).mass()*p.U(); - } - - momentum *= nParticle_/mesh().cellVolumes(); - - return tmomentum; + return momentum_; } @@ -636,6 +582,41 @@ Foam::DsmcCloud::iDof() const } +template +inline const Foam::tmp +Foam::DsmcCloud::dsmcRhoN() const +{ + tmp tdsmcRhoN + ( + new volScalarField + ( + IOobject + ( + this->name() + "dsmcRhoN", + this->db().time().timeName(), + this->db(), + IOobject::NO_READ, + IOobject::NO_WRITE, + false + ), + mesh_, + dimensionedScalar("zero", dimensionSet(0, -3, 0, 0, 0), 0.0) + ) + ); + + scalarField& dsmcRhoN = tdsmcRhoN().internalField(); + forAllConstIter(typename DsmcCloud, *this, iter) + { + const ParcelType& p = iter(); + const label cellI = p.cell(); + + dsmcRhoN[cellI]++; + } + + return tdsmcRhoN; +} + + template inline void Foam::DsmcCloud::clear() { diff --git a/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.C b/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.C index c52d92d20f..e11a5e73ea 100644 --- a/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.C +++ b/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.C @@ -114,10 +114,30 @@ void Foam::DsmcParcel::hitWallPatch TrackData& td ) { + label wppIndex = wpp.index(); + + label wppLocalFace = wpp.whichFace(this->face()); + + const scalar fA = mag(wpp.faceAreas()[wppLocalFace]); + + const scalar deltaT = td.cloud().cachedDeltaT(); + const constantProperties& constProps(td.cloud().constProps(typeId_)); scalar m = constProps.mass(); + vector nw = wpp.faceAreas()[wppLocalFace]; + nw /= mag(nw); + + scalar U_dot_nw = U_ & nw; + vector Ut = U_ - U_dot_nw*nw; + + td.cloud().momentumBF()[wppIndex][wppLocalFace] += + m*Ut/max(mag(U_dot_nw)*fA, VSMALL); + + td.cloud().rhoMBF()[wppIndex][wppLocalFace] += + m/max(mag(U_dot_nw)*fA, VSMALL); + // pre-interaction energy scalar preIE = 0.5*m*(U_ & U_) + Ei_; @@ -133,27 +153,29 @@ void Foam::DsmcParcel::hitWallPatch typeId_ ); + U_dot_nw = U_ & nw; + Ut = U_ - U_dot_nw*nw; + + td.cloud().momentumBF()[wppIndex][wppLocalFace] += + m*Ut/max(mag(U_dot_nw)*fA, VSMALL); + + td.cloud().rhoMBF()[wppIndex][wppLocalFace] += + m/max(mag(U_dot_nw)*fA, VSMALL); + // post-interaction energy scalar postIE = 0.5*m*(U_ & U_) + Ei_; // post-interaction momentum vector postIMom = m*U_; - label wppIndex = wpp.index(); - - label wppLocalFace = wpp.whichFace(this->face()); - - const scalar fA = mag(wpp.faceAreas()[wppLocalFace]); - - const scalar deltaT = td.cloud().cachedDeltaT(); - scalar deltaQ = td.cloud().nParticle()*(preIE - postIE)/(deltaT*fA); vector deltaFD = td.cloud().nParticle()*(preIMom - postIMom)/(deltaT*fA); - td.cloud().q().boundaryField()[wppIndex][wppLocalFace] += deltaQ; + td.cloud().qBF()[wppIndex][wppLocalFace] += deltaQ; + + td.cloud().fDBF()[wppIndex][wppLocalFace] += deltaFD; - td.cloud().fD().boundaryField()[wppIndex][wppLocalFace] += deltaFD; } diff --git a/src/lagrangian/dsmc/submodels/WallInteractionModel/MaxwellianThermal/MaxwellianThermal.C b/src/lagrangian/dsmc/submodels/WallInteractionModel/MaxwellianThermal/MaxwellianThermal.C index e7213561c0..6ad452793b 100644 --- a/src/lagrangian/dsmc/submodels/WallInteractionModel/MaxwellianThermal/MaxwellianThermal.C +++ b/src/lagrangian/dsmc/submodels/WallInteractionModel/MaxwellianThermal/MaxwellianThermal.C @@ -68,10 +68,10 @@ void Foam::MaxwellianThermal::correct nw /= mag(nw); // Normal velocity magnitude - scalar magUn = U & nw; + scalar U_dot_nw = U & nw; // Wall tangential velocity (flow direction) - vector Ut = U - magUn*nw; + vector Ut = U - U_dot_nw*nw; CloudType& cloud(this->owner()); @@ -90,9 +90,9 @@ void Foam::MaxwellianThermal::correct U.z()*(0.8 + 0.2*rndGen.scalar01()) ); - magUn = U & nw; + U_dot_nw = U & nw; - Ut = U - magUn*nw; + Ut = U - U_dot_nw*nw; } // Wall tangential unit vector diff --git a/src/lagrangian/dsmc/submodels/WallInteractionModel/MixedDiffuseSpecular/MixedDiffuseSpecular.C b/src/lagrangian/dsmc/submodels/WallInteractionModel/MixedDiffuseSpecular/MixedDiffuseSpecular.C index a12fff43d1..d491dfa406 100644 --- a/src/lagrangian/dsmc/submodels/WallInteractionModel/MixedDiffuseSpecular/MixedDiffuseSpecular.C +++ b/src/lagrangian/dsmc/submodels/WallInteractionModel/MixedDiffuseSpecular/MixedDiffuseSpecular.C @@ -69,7 +69,7 @@ void Foam::MixedDiffuseSpecular::correct nw /= mag(nw); // Normal velocity magnitude - scalar magUn = U & nw; + scalar U_dot_nw = U & nw; CloudType& cloud(this->owner()); @@ -80,7 +80,7 @@ void Foam::MixedDiffuseSpecular::correct // Diffuse reflection // Wall tangential velocity (flow direction) - vector Ut = U - magUn*nw; + vector Ut = U - U_dot_nw*nw; while (mag(Ut) < SMALL) { @@ -95,9 +95,9 @@ void Foam::MixedDiffuseSpecular::correct U.z()*(0.8 + 0.2*rndGen.scalar01()) ); - magUn = U & nw; + U_dot_nw = U & nw; - Ut = U - magUn*nw; + Ut = U - U_dot_nw*nw; } // Wall tangential unit vector @@ -128,9 +128,9 @@ void Foam::MixedDiffuseSpecular::correct { // Specular reflection - if (magUn > 0.0) + if (U_dot_nw > 0.0) { - U -= 2.0*magUn*nw; + U -= 2.0*U_dot_nw*nw; } } diff --git a/src/lagrangian/dsmc/submodels/WallInteractionModel/SpecularReflection/SpecularReflection.C b/src/lagrangian/dsmc/submodels/WallInteractionModel/SpecularReflection/SpecularReflection.C index 1fb5ab3208..bed84b8c68 100644 --- a/src/lagrangian/dsmc/submodels/WallInteractionModel/SpecularReflection/SpecularReflection.C +++ b/src/lagrangian/dsmc/submodels/WallInteractionModel/SpecularReflection/SpecularReflection.C @@ -63,11 +63,11 @@ void Foam::SpecularReflection::correct vector nw = wpp.faceAreas()[wpp.whichFace(faceId)]; nw /= mag(nw); - scalar magUn = U & nw; + scalar U_dot_nw = U & nw; - if (magUn > 0.0) + if (U_dot_nw > 0.0) { - U -= 2.0*magUn*nw; + U -= 2.0*U_dot_nw*nw; } } From 85d7852fc350270c175090e8ccd1e45b4b99b056 Mon Sep 17 00:00:00 2001 From: graham Date: Fri, 17 Jul 2009 18:17:26 +0100 Subject: [PATCH 004/454] Renamed U_ and T_ to boundaryU_ and boundaryT_. Moved all fields and field reading into the DsmcCloud, all calculation and resetting to single functions for all fields. Changed constructors so that no fields are supplied to the solver called from dsmcFoam and an initialisation dictionary is supplied by dsmcInitialise. --- .../dsmc/dsmcFoam/createFields.H | 162 -------- .../discreteMethods/dsmc/dsmcFoam/dsmcFoam.C | 42 +- .../dsmcInitialise/dsmcInitialise.C | 14 +- .../clouds/Templates/DsmcCloud/DsmcCloud.C | 375 +++++++++++++----- .../clouds/Templates/DsmcCloud/DsmcCloud.H | 123 +++--- .../clouds/Templates/DsmcCloud/DsmcCloudI.H | 248 ++---------- .../dsmc/clouds/derived/dsmcCloud/dsmcCloud.C | 10 +- .../dsmc/clouds/derived/dsmcCloud/dsmcCloud.H | 19 +- .../FreeStream/FreeStream.C | 7 +- .../MaxwellianThermal/MaxwellianThermal.C | 4 +- .../MixedDiffuseSpecular.C | 4 +- 11 files changed, 433 insertions(+), 575 deletions(-) delete mode 100644 applications/solvers/discreteMethods/dsmc/dsmcFoam/createFields.H diff --git a/applications/solvers/discreteMethods/dsmc/dsmcFoam/createFields.H b/applications/solvers/discreteMethods/dsmc/dsmcFoam/createFields.H deleted file mode 100644 index d024bd2017..0000000000 --- a/applications/solvers/discreteMethods/dsmc/dsmcFoam/createFields.H +++ /dev/null @@ -1,162 +0,0 @@ - - Info<< nl << "Reading field boundaryT" << endl; - volScalarField boundaryT - ( - IOobject - ( - "boundaryT", - runTime.timeName(), - mesh, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh - ); - - Info<< nl << "Reading field boundaryU" << endl; - volVectorField boundaryU - ( - IOobject - ( - "boundaryU", - runTime.timeName(), - mesh, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh - ); - - Info<< nl << "Reading field rhoN (number density)" << endl; - volScalarField rhoN - ( - IOobject - ( - "rhoN", - runTime.timeName(), - mesh, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh - ); - - Info<< nl << "Reading field rhoM (mass density)" << endl; - volScalarField rhoM - ( - IOobject - ( - "rhoM", - runTime.timeName(), - mesh, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh - ); - - Info<< nl << "Reading field rhoNdsmc (dsmc particle density)" << endl; - volScalarField dsmcRhoN - ( - IOobject - ( - "dsmcRhoN", - runTime.timeName(), - mesh, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh - ); - - Info<< nl << "Reading field momentum (momentum density)" << endl; - volVectorField momentum - ( - IOobject - ( - "momentum", - runTime.timeName(), - mesh, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh - ); - - Info<< nl << "Reading field linearKE (linear kinetic energy density)" - << endl; - - volScalarField linearKE - ( - IOobject - ( - "linearKE", - runTime.timeName(), - mesh, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh - ); - - Info<< nl << "Reading field internalE (internal energy density)" << endl; - volScalarField internalE - ( - IOobject - ( - "internalE", - runTime.timeName(), - mesh, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh - ); - - Info<< nl << "Reading field iDof (internal degree of freedom density)" - << endl; - - volScalarField iDof - ( - IOobject - ( - "iDof", - runTime.timeName(), - mesh, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh - ); - - Info<< nl << "Reading field q (surface heat transfer)" << endl; - volScalarField q - ( - IOobject - ( - "q", - runTime.timeName(), - mesh, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh - ); - - Info<< nl << "Reading field fD (surface force density)" << endl; - volVectorField fD - ( - IOobject - ( - "fD", - runTime.timeName(), - mesh, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh - ); - - Info<< nl << "Constructing dsmcCloud " << endl; - - dsmcCloud dsmc("dsmc", boundaryT, boundaryU); diff --git a/applications/solvers/discreteMethods/dsmc/dsmcFoam/dsmcFoam.C b/applications/solvers/discreteMethods/dsmc/dsmcFoam/dsmcFoam.C index 7a4d8ce8b9..89c7c817e9 100644 --- a/applications/solvers/discreteMethods/dsmc/dsmcFoam/dsmcFoam.C +++ b/applications/solvers/discreteMethods/dsmc/dsmcFoam/dsmcFoam.C @@ -40,53 +40,21 @@ int main(int argc, char *argv[]) #include "setRootCase.H" #include "createTime.H" #include "createMesh.H" - #include "createFields.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + Info<< nl << "Constructing dsmcCloud " << endl; + + dsmcCloud dsmc("dsmc", mesh); + Info<< "\nStarting time loop\n" << endl; - while (runTime.run()) + while (runTime.loop()) { - runTime++; - Info<< "Time = " << runTime.timeName() << nl << endl; - // Carry out dsmcCloud timestep - dsmc.evolve(); - // Retrieve flow field data from dsmcCloud - - rhoN = dsmc.rhoN(); - rhoN.correctBoundaryConditions(); - - rhoM = dsmc.rhoM(); - rhoM.correctBoundaryConditions(); - - dsmcRhoN = dsmc.dsmcRhoN(); - dsmcRhoN.correctBoundaryConditions(); - - momentum = dsmc.momentum(); - momentum.correctBoundaryConditions(); - - linearKE = dsmc.linearKE(); - linearKE.correctBoundaryConditions(); - - internalE = dsmc.internalE(); - internalE.correctBoundaryConditions(); - - iDof = dsmc.iDof(); - iDof.correctBoundaryConditions(); - - // Retrieve surface field data from dsmcCloud - - q = dsmc.q(); - - fD = dsmc.fD(); - - // Print status of dsmcCloud - dsmc.info(); runTime.write(); diff --git a/applications/utilities/preProcessing/dsmcInitialise/dsmcInitialise.C b/applications/utilities/preProcessing/dsmcInitialise/dsmcInitialise.C index f8b831001d..9e7725ec23 100644 --- a/applications/utilities/preProcessing/dsmcInitialise/dsmcInitialise.C +++ b/applications/utilities/preProcessing/dsmcInitialise/dsmcInitialise.C @@ -44,9 +44,21 @@ int main(int argc, char *argv[]) // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + IOdictionary dsmcInitialiseDict + ( + IOobject + ( + "dsmcInitialiseDict", + mesh.time().system(), + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE + ) + ); + Info<< "Initialising dsmc for Time = " << runTime.timeName() << nl << endl; - dsmcCloud dsmc("dsmc", mesh); + dsmcCloud dsmc("dsmc", mesh, dsmcInitialiseDict); label totalMolecules = dsmc.size(); diff --git a/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.C b/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.C index 8615135a26..92a6d944d9 100644 --- a/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.C +++ b/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.C @@ -475,38 +475,99 @@ void Foam::DsmcCloud::collisions() template -void Foam::DsmcCloud::resetSurfaceDataFields() +void Foam::DsmcCloud::resetFields() { - volScalarField::GeometricBoundaryField& qBF(q_.boundaryField()); + q_ = dimensionedScalar("zero", dimensionSet(1, 0, -3, 0, 0), 0.0); - forAll(qBF, p) - { - qBF[p] = 0.0; - } - - volVectorField::GeometricBoundaryField& fDBF(fD_.boundaryField()); - - forAll(fDBF, p) - { - fDBF[p] = vector::zero; - } - - volVectorField::GeometricBoundaryField& momentumBF + fD_ = dimensionedVector ( - momentum_.boundaryField() + "zero", + dimensionSet(1, -1, -2, 0, 0), + vector::zero ); - forAll(momentumBF, p) + rhoN_ = dimensionedScalar("zero", dimensionSet(0, -3, 0, 0, 0), VSMALL); + + rhoM_ = dimensionedScalar("zero", dimensionSet(1, -3, 0, 0, 0), VSMALL); + + dsmcRhoN_ = dimensionedScalar("zero", dimensionSet(0, -3, 0, 0, 0), 0.0); + + linearKE_ = dimensionedScalar("zero", dimensionSet(1, -1, -2, 0, 0), 0.0); + + internalE_ = dimensionedScalar("zero", dimensionSet(1, -1, -2, 0, 0), 0.0); + + iDof_ = dimensionedScalar("zero", dimensionSet(0, -3, 0, 0, 0), VSMALL); + + momentum_ = dimensionedVector + ( + "zero", + dimensionSet(1, -2, -1, 0, 0), + vector::zero + ); +} + + +template +void Foam::DsmcCloud::calculateFields() +{ + scalarField& rhoN = rhoN_.internalField(); + rhoN = VSMALL; + + scalarField& rhoM = rhoM_.internalField(); + rhoM = VSMALL; + + scalarField& dsmcRhoN = dsmcRhoN_.internalField(); + dsmcRhoN = 0.0; + + scalarField& linearKE = linearKE_.internalField(); + linearKE = 0.0; + + scalarField& internalE = internalE_.internalField(); + internalE = 0.0; + + scalarField& iDof = iDof_.internalField(); + iDof = VSMALL; + + vectorField& momentum = momentum_.internalField(); + momentum = vector::zero; + + forAllConstIter(typename DsmcCloud, *this, iter) { - momentumBF[p] = vector::zero; + const ParcelType& p = iter(); + const label cellI = p.cell(); + + rhoN[cellI]++; + + rhoM[cellI] += constProps(p.typeId()).mass(); + + dsmcRhoN[cellI]++; + + linearKE[cellI] += 0.5*constProps(p.typeId()).mass()*(p.U() & p.U()); + + internalE[cellI] += p.Ei(); + + iDof[cellI] += constProps(p.typeId()).internalDegreesOfFreedom(); + + momentum[cellI] += constProps(p.typeId()).mass()*p.U(); } - volScalarField::GeometricBoundaryField& rhoMBF(rhoM_.boundaryField()); + rhoN *= nParticle_/mesh().cellVolumes(); + rhoN_.correctBoundaryConditions(); - forAll(rhoMBF, p) - { - rhoMBF[p] = VSMALL; - } + rhoM *= nParticle_/mesh().cellVolumes(); + rhoM_.correctBoundaryConditions(); + + linearKE *= nParticle_/mesh().cellVolumes(); + linearKE_.correctBoundaryConditions(); + + internalE *= nParticle_/mesh().cellVolumes(); + internalE_.correctBoundaryConditions(); + + iDof *= nParticle_/mesh().cellVolumes(); + iDof_.correctBoundaryConditions(); + + momentum *= nParticle_/mesh().cellVolumes(); + momentum_.correctBoundaryConditions(); } @@ -542,14 +603,13 @@ template Foam::DsmcCloud::DsmcCloud ( const word& cloudName, - const volScalarField& T, - const volVectorField& U + const fvMesh& mesh ) : - Cloud(T.mesh(), cloudName, false), + Cloud(mesh, cloudName, false), DsmcBaseCloud(), cloudName_(cloudName), - mesh_(T.mesh()), + mesh_(mesh), particleProperties_ ( IOobject @@ -581,68 +641,142 @@ Foam::DsmcCloud::DsmcCloud ( IOobject ( - this->name() + "q_", + "q", mesh_.time().timeName(), mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE + IOobject::MUST_READ, + IOobject::AUTO_WRITE ), - mesh_, - dimensionedScalar("zero", dimensionSet(1, 0, -3, 0, 0), 0.0) + mesh_ ), fD_ ( IOobject ( - this->name() + "fD_", + "fD", mesh_.time().timeName(), mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE + IOobject::MUST_READ, + IOobject::AUTO_WRITE ), - mesh_, - dimensionedVector - ( - "zero", - dimensionSet(1, -1, -2, 0, 0), - vector::zero - ) + mesh_ ), - momentum_ + rhoN_ ( IOobject ( - this->name() + "momentum_", + "rhoN", mesh_.time().timeName(), mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE + IOobject::MUST_READ, + IOobject::AUTO_WRITE ), - mesh_, - dimensionedVector - ( - "zero", - dimensionSet(1, -2, -1, 0, 0), - vector::zero - ) + mesh_ ), rhoM_ ( IOobject ( - this->name() + "rhoM_", + "rhoM", mesh_.time().timeName(), mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE + IOobject::MUST_READ, + IOobject::AUTO_WRITE ), - mesh_, - dimensionedScalar("zero", dimensionSet(1, -3, 0, 0, 0), 0.0) + mesh_ + ), + dsmcRhoN_ + ( + IOobject + ( + "dsmcRhoN", + mesh_.time().timeName(), + mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh_ + ), + linearKE_ + ( + IOobject + ( + "linearKE", + mesh_.time().timeName(), + mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh_ + ), + internalE_ + ( + IOobject + ( + "internalE", + mesh_.time().timeName(), + mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh_ + ), + iDof_ + ( + IOobject + ( + "iDof", + mesh_.time().timeName(), + mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh_ + ), + momentum_ + ( + IOobject + ( + "momentum", + mesh_.time().timeName(), + mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh_ ), constProps_(), rndGen_(label(149382906) + 7183*Pstream::myProcNo()), - T_(T), - U_(U), + boundaryT_ + ( + volScalarField + ( + IOobject + ( + "boundaryT", + mesh_.time().timeName(), + mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh_ + ) + ), + boundaryU_ + ( + volVectorField + ( + IOobject + ( + "boundaryU", + mesh_.time().timeName(), + mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh_ + ) + ), binaryCollisionModel_ ( BinaryCollisionModel >::New @@ -685,7 +819,8 @@ template Foam::DsmcCloud::DsmcCloud ( const word& cloudName, - const fvMesh& mesh + const fvMesh& mesh, + const IOdictionary& dsmcInitialiseDict ) : Cloud(mesh, cloudName, false), @@ -751,6 +886,84 @@ Foam::DsmcCloud::DsmcCloud vector::zero ) ), + rhoN_ + ( + IOobject + ( + this->name() + "rhoN_", + mesh_.time().timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensionedScalar("zero", dimensionSet(0, -3, 0, 0, 0), VSMALL) + ), + rhoM_ + ( + IOobject + ( + this->name() + "rhoM_", + mesh_.time().timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensionedScalar("zero", dimensionSet(1, -3, 0, 0, 0), VSMALL) + ), + dsmcRhoN_ + ( + IOobject + ( + this->name() + "dsmcRhoN_", + mesh_.time().timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensionedScalar("zero", dimensionSet(0, -3, 0, 0, 0), 0.0) + ), + linearKE_ + ( + IOobject + ( + this->name() + "linearKE_", + mesh_.time().timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensionedScalar("zero", dimensionSet(1, -1, -2, 0, 0), 0.0) + ), + internalE_ + ( + IOobject + ( + this->name() + "internalE_", + mesh_.time().timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensionedScalar("zero", dimensionSet(1, -1, -2, 0, 0), 0.0) + ), + iDof_ + ( + IOobject + ( + this->name() + "iDof_", + mesh_.time().timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensionedScalar("zero", dimensionSet(0, -3, 0, 0, 0), VSMALL) + ), momentum_ ( IOobject @@ -769,28 +982,15 @@ Foam::DsmcCloud::DsmcCloud vector::zero ) ), - rhoM_ - ( - IOobject - ( - this->name() + "rhoM_", - mesh_.time().timeName(), - mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - mesh_, - dimensionedScalar("zero", dimensionSet(1, -3, 0, 0, 0), 0.0) - ), constProps_(), rndGen_(label(971501) + 1526*Pstream::myProcNo()), - T_ + boundaryT_ ( volScalarField ( IOobject ( - "T", + "boundaryT", mesh_.time().timeName(), mesh_, IOobject::NO_READ, @@ -800,13 +1000,13 @@ Foam::DsmcCloud::DsmcCloud dimensionedScalar("zero", dimensionSet(0, 0, 0, 1, 0), 0.0) ) ), - U_ + boundaryU_ ( volVectorField ( IOobject ( - "U", + "boundaryU", mesh_.time().timeName(), mesh_, IOobject::NO_READ, @@ -829,18 +1029,6 @@ Foam::DsmcCloud::DsmcCloud buildConstProps(); - IOdictionary dsmcInitialiseDict - ( - IOobject - ( - "dsmcInitialiseDict", - mesh_.time().system(), - mesh_, - IOobject::MUST_READ, - IOobject::NO_WRITE - ) - ); - initialise(dsmcInitialiseDict); } @@ -862,8 +1050,8 @@ void Foam::DsmcCloud::evolve() typename ParcelType::trackData td(*this); - // Reset the surface data collection fields - resetSurfaceDataFields(); + // Reset the data collection fields + resetFields(); if (debug) { @@ -878,6 +1066,9 @@ void Foam::DsmcCloud::evolve() // Calculate new velocities via stochastic collisions collisions(); + + // Calculate the volume field data + calculateFields(); } diff --git a/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.H b/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.H index 40f3935eee..ac90e1b854 100644 --- a/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.H +++ b/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.H @@ -110,12 +110,27 @@ class DsmcCloud //- Force density at surface field volVectorField fD_; - //- Momentum density field - volVectorField momentum_; + //- number density field + volScalarField rhoN_; //- Mass density field volScalarField rhoM_; + //- dsmc particle density field + volScalarField dsmcRhoN_; + + //- linear kinetic energy density field + volScalarField linearKE_; + + //- Internal energy density field + volScalarField internalE_; + + // Internal degree of freedom density field + volScalarField iDof_; + + //- Momentum density field + volVectorField momentum_; + //- Parcel constant properties - one for each type List constProps_; @@ -127,13 +142,13 @@ class DsmcCloud scalar cachedDeltaT_; - // References to the macroscopic fields + // boundary value fields - //- Temperature - const volScalarField& T_; + //- boundary temperature + volScalarField boundaryT_; - //- Velocity - const volVectorField& U_; + //- boundary velocity + volVectorField boundaryU_; // References to the cloud sub-models @@ -165,8 +180,11 @@ class DsmcCloud //- Calculate collisions between molecules void collisions(); - //- Reset the surface data accumulation field values - void resetSurfaceDataFields(); + //- Reset the data accumulation field values to zero + void resetFields(); + + //- Calculate the volume field data + void calculateFields(); //- Disallow default bitwise copy construct DsmcCloud(const DsmcCloud&); @@ -185,21 +203,22 @@ public: // Constructors - //- Construct given name and mesh, will read Parcels from file - DsmcCloud - ( - const word& cloudName, - const volScalarField& T, - const volVectorField& U - ); - - //- Construct given name and mesh. Used to initialise. + //- Construct given name and mesh, will read Parcels and fields from + // file DsmcCloud ( const word& cloudName, const fvMesh& mesh ); + //- Construct given name, mesh and initialisation dictionary. + DsmcCloud + ( + const word& cloudName, + const fvMesh& mesh, + const IOdictionary& dsmcInitialiseDict + ); + //- Destructor virtual ~DsmcCloud(); @@ -268,20 +287,48 @@ public: //- Return non-const force density at boundary field reference inline volVectorField::GeometricBoundaryField& fDBF(); - //- Return non-const momentum density boundary field reference - inline volVectorField::GeometricBoundaryField& momentumBF(); - //- Return non-const mass density boundary field reference inline volScalarField::GeometricBoundaryField& rhoMBF(); + //- Return non-const momentum density boundary field reference + inline volVectorField::GeometricBoundaryField& momentumBF(); + // References to the macroscopic fields //- Return macroscopic temperature - inline const volScalarField& T() const; + inline const volScalarField& boundaryT() const; //- Return macroscopic velocity - inline const volVectorField& U() const; + inline const volVectorField& boundaryU() const; + + //- Return heat flux at surface field + inline const volScalarField& q() const; + + //- Return force density at surface field + inline const volVectorField& fD() const; + + //- Return the real particle number density field + inline const volScalarField& rhoN() const; + + //- Return the particle mass density field + inline const volScalarField& rhoM() const; + + //- Return the field of number of DSMC particles + inline const volScalarField& dsmcRhoN() const; + + //- Return the total linear kinetic energy (translational and + // thermal density field + inline const volScalarField& linearKE() const; + + //- Return the internal energy density field + inline const volScalarField& internalE() const; + + //- Return the average internal degrees of freedom field + inline const volScalarField& iDof() const; + + //- Return the momentum density field + inline const volVectorField& momentum() const; // Kinetic theory helper functions @@ -395,35 +442,6 @@ public: void dumpParticlePositions() const; - // Fields - - //- Return heat flux at surface field - inline const volScalarField& q() const; - - //- Return force density at surface field - inline const volVectorField& fD() const; - - //- Return the real particle number density field - inline const tmp rhoN() const; - - //- Return the particle mass density field - inline const volScalarField& rhoM(); - - //- Return the momentum density field - inline const volVectorField& momentum(); - - //- Return the total linear kinetic energy (translational and - // thermal density field - inline const tmp linearKE() const; - - //- Return the internal energy density field - inline const tmp internalE() const; - - //- Return the average internal degrees of freedom field - inline const tmp iDof() const; - - //- Return the field of number of DSMC particles - inline const tmp dsmcRhoN() const; // Cloud evolution functions @@ -441,7 +459,6 @@ public: //- Evolve the cloud (move, collide) void evolve(); - //- Clear the Cloud inline void clear(); diff --git a/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloudI.H b/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloudI.H index 07ac87bd2c..5b780ee171 100644 --- a/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloudI.H +++ b/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloudI.H @@ -167,16 +167,18 @@ Foam::DsmcCloud::rhoMBF() template -inline const Foam::volScalarField& Foam::DsmcCloud::T() const +inline const Foam::volScalarField& +Foam::DsmcCloud::boundaryT() const { - return T_; + return boundaryT_; } template -inline const Foam::volVectorField& Foam::DsmcCloud::U() const +inline const Foam::volVectorField& +Foam::DsmcCloud::boundaryU() const { - return U_; + return boundaryU_; } @@ -392,228 +394,56 @@ inline const Foam::volVectorField& Foam::DsmcCloud::fD() const template -inline const Foam::tmp +inline const Foam::volScalarField& Foam::DsmcCloud::rhoN() const { - tmp trhoN - ( - new volScalarField - ( - IOobject - ( - this->name() + "rhoN", - this->db().time().timeName(), - this->db(), - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - mesh_, - dimensionedScalar("zero", dimensionSet(0, -3, 0, 0, 0), VSMALL) - ) - ); - - scalarField& rhoN = trhoN().internalField(); - forAllConstIter(typename DsmcCloud, *this, iter) - { - const ParcelType& p = iter(); - const label cellI = p.cell(); - - rhoN[cellI]++; - } - - rhoN *= nParticle_/mesh().cellVolumes(); - - return trhoN; + return rhoN_; } template -inline const Foam::volScalarField& Foam::DsmcCloud::rhoM() +inline const Foam::volScalarField& Foam::DsmcCloud::rhoM() const { - scalarField& rM = rhoM_.internalField(); - - rM = VSMALL; - - forAllConstIter(typename DsmcCloud, *this, iter) - { - const ParcelType& p = iter(); - const label cellI = p.cell(); - - rM[cellI] += constProps(p.typeId()).mass(); - } - - rM *= nParticle_/mesh().cellVolumes(); - return rhoM_; } template -inline const Foam::volVectorField& Foam::DsmcCloud::momentum() -{ - vectorField& mom = momentum_.internalField(); - - mom = vector::zero; - - forAllConstIter(typename DsmcCloud, *this, iter) - { - const ParcelType& p = iter(); - const label cellI = p.cell(); - - mom[cellI] += constProps(p.typeId()).mass()*p.U(); - } - - mom *= nParticle_/mesh().cellVolumes(); - - return momentum_; -} - - -template -inline const Foam::tmp -Foam::DsmcCloud::linearKE() const -{ - tmp tlinearKE - ( - new volScalarField - ( - IOobject - ( - this->name() + "linearKE", - this->db().time().timeName(), - this->db(), - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - mesh_, - dimensionedScalar("zero", dimensionSet(1, -1, -2, 0, 0), 0.0) - ) - ); - - scalarField& linearKE = tlinearKE().internalField(); - forAllConstIter(typename DsmcCloud, *this, iter) - { - const ParcelType& p = iter(); - const label cellI = p.cell(); - - linearKE[cellI] += 0.5*constProps(p.typeId()).mass()*(p.U() & p.U()); - } - - linearKE *= nParticle_/mesh().cellVolumes(); - - return tlinearKE; -} - - -template -inline const Foam::tmp -Foam::DsmcCloud::internalE() const -{ - tmp tinternalE - ( - new volScalarField - ( - IOobject - ( - this->name() + "internalE", - this->db().time().timeName(), - this->db(), - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - mesh_, - dimensionedScalar("zero", dimensionSet(1, -1, -2, 0, 0), 0.0) - ) - ); - - scalarField& internalE = tinternalE().internalField(); - forAllConstIter(typename DsmcCloud, *this, iter) - { - const ParcelType& p = iter(); - const label cellI = p.cell(); - - internalE[cellI] += p.Ei(); - } - - internalE *= nParticle_/mesh().cellVolumes(); - - return tinternalE; -} - - -template -inline const Foam::tmp -Foam::DsmcCloud::iDof() const -{ - tmp tiDof - ( - new volScalarField - ( - IOobject - ( - this->name() + "iDof", - this->db().time().timeName(), - this->db(), - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - mesh_, - dimensionedScalar("zero", dimensionSet(0, -3, 0, 0, 0), VSMALL) - ) - ); - - scalarField& iDof = tiDof().internalField(); - - forAllConstIter(typename DsmcCloud, *this, iter) - { - const ParcelType& p = iter(); - const label cellI = p.cell(); - - iDof[cellI] += constProps(p.typeId()).internalDegreesOfFreedom(); - } - - iDof *= nParticle_/mesh().cellVolumes(); - - return tiDof; -} - - -template -inline const Foam::tmp +inline const Foam::volScalarField& Foam::DsmcCloud::dsmcRhoN() const { - tmp tdsmcRhoN - ( - new volScalarField - ( - IOobject - ( - this->name() + "dsmcRhoN", - this->db().time().timeName(), - this->db(), - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - mesh_, - dimensionedScalar("zero", dimensionSet(0, -3, 0, 0, 0), 0.0) - ) - ); + return dsmcRhoN_; +} - scalarField& dsmcRhoN = tdsmcRhoN().internalField(); - forAllConstIter(typename DsmcCloud, *this, iter) - { - const ParcelType& p = iter(); - const label cellI = p.cell(); - dsmcRhoN[cellI]++; - } +template +inline const Foam::volScalarField& +Foam::DsmcCloud::linearKE() const +{ + return linearKE_; +} - return tdsmcRhoN; + +template +inline const Foam::volScalarField& +Foam::DsmcCloud::internalE() const +{ + return internalE_; +} + + +template +inline const Foam::volScalarField& +Foam::DsmcCloud::iDof() const +{ + return iDof_; +} + + +template +inline const Foam::volVectorField& Foam::DsmcCloud::momentum() const +{ + return momentum_; } diff --git a/src/lagrangian/dsmc/clouds/derived/dsmcCloud/dsmcCloud.C b/src/lagrangian/dsmc/clouds/derived/dsmcCloud/dsmcCloud.C index 425e47a705..1f45f25e49 100644 --- a/src/lagrangian/dsmc/clouds/derived/dsmcCloud/dsmcCloud.C +++ b/src/lagrangian/dsmc/clouds/derived/dsmcCloud/dsmcCloud.C @@ -39,11 +39,10 @@ namespace Foam Foam::dsmcCloud::dsmcCloud ( const word& cloudName, - const volScalarField& T, - const volVectorField& U + const fvMesh& mesh ) : - DsmcCloud(cloudName, T, U) + DsmcCloud(cloudName, mesh) { dsmcParcel::readFields(*this); } @@ -52,10 +51,11 @@ Foam::dsmcCloud::dsmcCloud Foam::dsmcCloud::dsmcCloud ( const word& cloudName, - const fvMesh& mesh + const fvMesh& mesh, + const IOdictionary& dsmcInitialiseDict ) : - DsmcCloud(cloudName, mesh) + DsmcCloud(cloudName, mesh, dsmcInitialiseDict) {} diff --git a/src/lagrangian/dsmc/clouds/derived/dsmcCloud/dsmcCloud.H b/src/lagrangian/dsmc/clouds/derived/dsmcCloud/dsmcCloud.H index ad63aca9fc..953e487e8d 100644 --- a/src/lagrangian/dsmc/clouds/derived/dsmcCloud/dsmcCloud.H +++ b/src/lagrangian/dsmc/clouds/derived/dsmcCloud/dsmcCloud.H @@ -69,21 +69,22 @@ public: // Constructors - //- Construct from components - dsmcCloud - ( - const word& cloudName, - const volScalarField& T, - const volVectorField& U - ); - - //- Construct from name and mesh, used to initialise. + //- Construct given name and mesh, will read Parcels and fields from + // file dsmcCloud ( const word& cloudName, const fvMesh& mesh ); + //- Construct given name, mesh and initialisation dictionary. + dsmcCloud + ( + const word& cloudName, + const fvMesh& mesh, + const IOdictionary& dsmcInitialiseDict + ); + //- Destructor ~dsmcCloud(); diff --git a/src/lagrangian/dsmc/submodels/InflowBoundaryModel/FreeStream/FreeStream.C b/src/lagrangian/dsmc/submodels/InflowBoundaryModel/FreeStream/FreeStream.C index 0f0e135e4c..f02fcad0dc 100644 --- a/src/lagrangian/dsmc/submodels/InflowBoundaryModel/FreeStream/FreeStream.C +++ b/src/lagrangian/dsmc/submodels/InflowBoundaryModel/FreeStream/FreeStream.C @@ -136,12 +136,12 @@ void Foam::FreeStream::inflow() const volScalarField::GeometricBoundaryField& boundaryT ( - cloud.T().boundaryField() + cloud.boundaryT().boundaryField() ); const volVectorField::GeometricBoundaryField& boundaryU ( - cloud.U().boundaryField() + cloud.boundaryU().boundaryField() ); forAll(patches_, p) @@ -165,7 +165,8 @@ void Foam::FreeStream::inflow() if (min(boundaryT[patchI]) < SMALL) { FatalErrorIn ("Foam::FreeStream::inflow()") - << "Zero boundary temperature detected, check boundaryT condition." << nl + << "Zero boundary temperature detected, check boundaryT " + << "condition." << nl << nl << abort(FatalError); } diff --git a/src/lagrangian/dsmc/submodels/WallInteractionModel/MaxwellianThermal/MaxwellianThermal.C b/src/lagrangian/dsmc/submodels/WallInteractionModel/MaxwellianThermal/MaxwellianThermal.C index 6ad452793b..51452e7c1f 100644 --- a/src/lagrangian/dsmc/submodels/WallInteractionModel/MaxwellianThermal/MaxwellianThermal.C +++ b/src/lagrangian/dsmc/submodels/WallInteractionModel/MaxwellianThermal/MaxwellianThermal.C @@ -101,7 +101,7 @@ void Foam::MaxwellianThermal::correct // Other tangential unit vector vector tw2 = nw^tw1; - scalar T = cloud.T().boundaryField()[wppIndex][wppLocalFace]; + scalar T = cloud.boundaryT().boundaryField()[wppIndex][wppLocalFace]; scalar mass = cloud.constProps(typeId).mass(); @@ -115,7 +115,7 @@ void Foam::MaxwellianThermal::correct - sqrt(-2.0*log(max(1 - rndGen.scalar01(), VSMALL)))*nw ); - U += cloud.U().boundaryField()[wppIndex][wppLocalFace]; + U += cloud.boundaryU().boundaryField()[wppIndex][wppLocalFace]; Ei = cloud.equipartitionInternalEnergy(T, iDof); } diff --git a/src/lagrangian/dsmc/submodels/WallInteractionModel/MixedDiffuseSpecular/MixedDiffuseSpecular.C b/src/lagrangian/dsmc/submodels/WallInteractionModel/MixedDiffuseSpecular/MixedDiffuseSpecular.C index d491dfa406..9d22415f3c 100644 --- a/src/lagrangian/dsmc/submodels/WallInteractionModel/MixedDiffuseSpecular/MixedDiffuseSpecular.C +++ b/src/lagrangian/dsmc/submodels/WallInteractionModel/MixedDiffuseSpecular/MixedDiffuseSpecular.C @@ -106,7 +106,7 @@ void Foam::MixedDiffuseSpecular::correct // Other tangential unit vector vector tw2 = nw^tw1; - scalar T = cloud.T().boundaryField()[wppIndex][wppLocalFace]; + scalar T = cloud.boundaryT().boundaryField()[wppIndex][wppLocalFace]; scalar mass = cloud.constProps(typeId).mass(); @@ -120,7 +120,7 @@ void Foam::MixedDiffuseSpecular::correct - sqrt(-2.0*log(max(1 - rndGen.scalar01(), VSMALL)))*nw ); - U += cloud.U().boundaryField()[wppIndex][wppLocalFace]; + U += cloud.boundaryU().boundaryField()[wppIndex][wppLocalFace]; Ei = cloud.equipartitionInternalEnergy(T, iDof); } From c0972656454cd443c5c26a689204ed049f1ecdad Mon Sep 17 00:00:00 2001 From: graham Date: Tue, 21 Jul 2009 15:10:23 +0100 Subject: [PATCH 005/454] Adding normal velocity weighted measurements to face values of linearKE, internalE, rhoN and iDof fields to measure surface temperatures. --- .../clouds/Templates/DsmcCloud/DsmcCloud.C | 7 ---- .../clouds/Templates/DsmcCloud/DsmcCloud.H | 15 ++++++++ .../clouds/Templates/DsmcCloud/DsmcCloudI.H | 38 +++++++++++++++++-- .../parcels/Templates/DsmcParcel/DsmcParcel.C | 38 +++++++++++++++---- 4 files changed, 80 insertions(+), 18 deletions(-) diff --git a/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.C b/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.C index 92a6d944d9..bb51dbd24b 100644 --- a/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.C +++ b/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.C @@ -511,25 +511,18 @@ template void Foam::DsmcCloud::calculateFields() { scalarField& rhoN = rhoN_.internalField(); - rhoN = VSMALL; scalarField& rhoM = rhoM_.internalField(); - rhoM = VSMALL; scalarField& dsmcRhoN = dsmcRhoN_.internalField(); - dsmcRhoN = 0.0; scalarField& linearKE = linearKE_.internalField(); - linearKE = 0.0; scalarField& internalE = internalE_.internalField(); - internalE = 0.0; scalarField& iDof = iDof_.internalField(); - iDof = VSMALL; vectorField& momentum = momentum_.internalField(); - momentum = vector::zero; forAllConstIter(typename DsmcCloud, *this, iter) { diff --git a/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.H b/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.H index ac90e1b854..67deff457b 100644 --- a/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.H +++ b/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.H @@ -287,9 +287,24 @@ public: //- Return non-const force density at boundary field reference inline volVectorField::GeometricBoundaryField& fDBF(); + //- Return non-const number density boundary field reference + inline volScalarField::GeometricBoundaryField& rhoNBF(); + //- Return non-const mass density boundary field reference inline volScalarField::GeometricBoundaryField& rhoMBF(); + //- Return non-const linear kinetic energy density boundary + // field reference + inline volScalarField::GeometricBoundaryField& linearKEBF(); + + //- Return non-const internal energy density boundary field + // reference + inline volScalarField::GeometricBoundaryField& internalEBF(); + + //- Return non-const internal degree of freedom density boundary + // field reference + inline volScalarField::GeometricBoundaryField& iDofBF(); + //- Return non-const momentum density boundary field reference inline volVectorField::GeometricBoundaryField& momentumBF(); diff --git a/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloudI.H b/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloudI.H index 5b780ee171..f2dcb16bce 100644 --- a/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloudI.H +++ b/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloudI.H @@ -151,10 +151,10 @@ Foam::DsmcCloud::fDBF() template -inline Foam::volVectorField::GeometricBoundaryField& -Foam::DsmcCloud::momentumBF() +inline Foam::volScalarField::GeometricBoundaryField& +Foam::DsmcCloud::rhoNBF() { - return momentum_.boundaryField(); + return rhoN_.boundaryField(); } @@ -166,6 +166,38 @@ Foam::DsmcCloud::rhoMBF() } +template +inline Foam::volScalarField::GeometricBoundaryField& +Foam::DsmcCloud::linearKEBF() +{ + return linearKE_.boundaryField(); +} + + +template +inline Foam::volScalarField::GeometricBoundaryField& +Foam::DsmcCloud::internalEBF() +{ + return internalE_.boundaryField(); +} + + +template +inline Foam::volScalarField::GeometricBoundaryField& +Foam::DsmcCloud::iDofBF() +{ + return iDof_.boundaryField(); +} + + +template +inline Foam::volVectorField::GeometricBoundaryField& +Foam::DsmcCloud::momentumBF() +{ + return momentum_.boundaryField(); +} + + template inline const Foam::volScalarField& Foam::DsmcCloud::boundaryT() const diff --git a/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.C b/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.C index e11a5e73ea..ffd3485fdb 100644 --- a/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.C +++ b/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.C @@ -130,13 +130,24 @@ void Foam::DsmcParcel::hitWallPatch nw /= mag(nw); scalar U_dot_nw = U_ & nw; + vector Ut = U_ - U_dot_nw*nw; - td.cloud().momentumBF()[wppIndex][wppLocalFace] += - m*Ut/max(mag(U_dot_nw)*fA, VSMALL); + scalar invMagUnfA = 1/max(mag(U_dot_nw)*fA, VSMALL); - td.cloud().rhoMBF()[wppIndex][wppLocalFace] += - m/max(mag(U_dot_nw)*fA, VSMALL); + td.cloud().rhoNBF()[wppIndex][wppLocalFace] += invMagUnfA; + + td.cloud().rhoMBF()[wppIndex][wppLocalFace] += m*invMagUnfA; + + td.cloud().linearKEBF()[wppIndex][wppLocalFace] += + 0.5*m*(U_ & U_)*invMagUnfA; + + td.cloud().internalEBF()[wppIndex][wppLocalFace] += Ei_*invMagUnfA; + + td.cloud().iDofBF()[wppIndex][wppLocalFace] += + constProps.internalDegreesOfFreedom()*invMagUnfA; + + td.cloud().momentumBF()[wppIndex][wppLocalFace] += m*Ut*invMagUnfA; // pre-interaction energy scalar preIE = 0.5*m*(U_ & U_) + Ei_; @@ -154,13 +165,24 @@ void Foam::DsmcParcel::hitWallPatch ); U_dot_nw = U_ & nw; + Ut = U_ - U_dot_nw*nw; - td.cloud().momentumBF()[wppIndex][wppLocalFace] += - m*Ut/max(mag(U_dot_nw)*fA, VSMALL); + invMagUnfA = 1/max(mag(U_dot_nw)*fA, VSMALL); - td.cloud().rhoMBF()[wppIndex][wppLocalFace] += - m/max(mag(U_dot_nw)*fA, VSMALL); + td.cloud().rhoNBF()[wppIndex][wppLocalFace] += invMagUnfA; + + td.cloud().rhoMBF()[wppIndex][wppLocalFace] += m*invMagUnfA; + + td.cloud().linearKEBF()[wppIndex][wppLocalFace] += + 0.5*m*(U_ & U_)*invMagUnfA; + + td.cloud().internalEBF()[wppIndex][wppLocalFace] += Ei_*invMagUnfA; + + td.cloud().iDofBF()[wppIndex][wppLocalFace] += + constProps.internalDegreesOfFreedom()*invMagUnfA; + + td.cloud().momentumBF()[wppIndex][wppLocalFace] += m*Ut*invMagUnfA; // post-interaction energy scalar postIE = 0.5*m*(U_ & U_) + Ei_; From 85aa1c889047e5443da1d5b3cdadf8ad81036525 Mon Sep 17 00:00:00 2001 From: graham Date: Tue, 21 Jul 2009 17:17:01 +0100 Subject: [PATCH 006/454] Reordering of internal temperature calculation to avoid FPEs. iDof was defaulting to VSMALL (1e-300) for monoatomics but being multiplied by kb: O(1e-23) for field calculation. --- .../functionObjects/utilities/dsmcFields/dsmcFields.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/postProcessing/functionObjects/utilities/dsmcFields/dsmcFields.C b/src/postProcessing/functionObjects/utilities/dsmcFields/dsmcFields.C index 7056fba521..ab6190af8b 100644 --- a/src/postProcessing/functionObjects/utilities/dsmcFields/dsmcFields.C +++ b/src/postProcessing/functionObjects/utilities/dsmcFields/dsmcFields.C @@ -184,7 +184,7 @@ void Foam::dsmcFields::write() obr_, IOobject::NO_READ ), - 2.0/(dsmcCloud::kb*iDofMean)*internalEMean + (2.0/dsmcCloud::kb)*(internalEMean/iDofMean) ); Info<< " Calculating overallT field." << endl; From 138e54af76c884e110d227f9068613ae233a02ff Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 3 Aug 2009 11:48:09 +0100 Subject: [PATCH 007/454] do not check files when subcycling --- src/OpenFOAM/db/Time/Time.C | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/OpenFOAM/db/Time/Time.C b/src/OpenFOAM/db/Time/Time.C index cc2c8e710d..fa9b3e6a91 100644 --- a/src/OpenFOAM/db/Time/Time.C +++ b/src/OpenFOAM/db/Time/Time.C @@ -638,10 +638,10 @@ Foam::Time& Foam::Time::operator+=(const scalar deltaT) Foam::Time& Foam::Time::operator++() { - readModifiedObjects(); - if (!subCycling_) { + readModifiedObjects(); + if (timeIndex_ == startTimeIndex_) { functionObjects_.start(); From 876135a83df5bd469ae1a0d0050580d0e52d165b Mon Sep 17 00:00:00 2001 From: mattijs Date: Tue, 4 Aug 2009 16:42:54 +0100 Subject: [PATCH 008/454] forcing scheduling calculation --- ...llMixedTemperatureCoupledFvPatchScalarField.C | 4 +++- .../directMappedFixedValueFvPatchField.C | 16 ++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallMixedTemperatureCoupled/solidWallMixedTemperatureCoupledFvPatchScalarField.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallMixedTemperatureCoupled/solidWallMixedTemperatureCoupledFvPatchScalarField.C index 5bec567310..a2940ef12b 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallMixedTemperatureCoupled/solidWallMixedTemperatureCoupledFvPatchScalarField.C +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallMixedTemperatureCoupled/solidWallMixedTemperatureCoupledFvPatchScalarField.C @@ -208,6 +208,9 @@ void Foam::solidWallMixedTemperatureCoupledFvPatchScalarField::updateCoeffs() patch().patch() ); const polyMesh& nbrMesh = mpp.sampleMesh(); + // Force recalculation of mapping and schedule + const mapDistribute& distMap = mpp.map(); + (void)distMap.schedule(); tmp intFld = patchInternalField(); @@ -217,7 +220,6 @@ void Foam::solidWallMixedTemperatureCoupledFvPatchScalarField::updateCoeffs() // to be updated the first time round the iteration (i.e. when // switching regions) but unfortunately we don't have this information. - const mapDistribute& distMap = mpp.map(); const fvPatch& nbrPatch = refCast ( nbrMesh diff --git a/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedValue/directMappedFixedValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedValue/directMappedFixedValueFvPatchField.C index d85e393fd8..e62987148d 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedValue/directMappedFixedValueFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedValue/directMappedFixedValueFvPatchField.C @@ -114,12 +114,12 @@ directMappedFixedValueFvPatchField::directMappedFixedValueFvPatchField << exit(FatalError); } - // Force calculation of schedule (uses parallel comms) - const directMappedPatchBase& mpp = refCast - ( - this->patch().patch() - ); - (void)mpp.map().schedule(); + //// Force calculation of schedule (uses parallel comms) + //const directMappedPatchBase& mpp = refCast + //( + // this->patch().patch() + //); + //(void)mpp.map().schedule(); } @@ -166,6 +166,10 @@ void directMappedFixedValueFvPatchField::updateCoeffs() directMappedFixedValueFvPatchField::patch().patch() ); const mapDistribute& distMap = mpp.map(); + + // Force recalculation of schedule + (void)distMap.schedule(); + const fvMesh& nbrMesh = refCast(mpp.sampleMesh()); const word& fldName = this->dimensionedInternalField().name(); From 0b16a73a5a9606c5aef3e22e8c9f44249f0318e3 Mon Sep 17 00:00:00 2001 From: mattijs Date: Tue, 4 Aug 2009 16:43:08 +0100 Subject: [PATCH 009/454] better error checking if restart --- .../polyTopoChange/polyTopoChange/hexRef8.C | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8.C b/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8.C index af4a37bead..926f2f4913 100644 --- a/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8.C +++ b/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8.C @@ -350,6 +350,18 @@ void Foam::hexRef8::modFace // Bit complex way to determine the unrefined edge length. Foam::scalar Foam::hexRef8::getLevel0EdgeLength() const { + if (cellLevel_.size() != mesh_.nCells()) + { + FatalErrorIn + ( + "hexRef8::getLevel0EdgeLength() const" + ) << "Number of cells in mesh:" << mesh_.nCells() + << " does not equal size of cellLevel:" << cellLevel_.size() + << endl + << "This might be because of a restart with inconsistent cellLevel." + << abort(FatalError); + } + // Determine minimum edge length per refinement level // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From fe0745476dc00a361023e16975174a3ba973b61c Mon Sep 17 00:00:00 2001 From: mattijs Date: Tue, 4 Aug 2009 16:43:38 +0100 Subject: [PATCH 010/454] revert to reading surfaces from constant so parallel works out of the box --- .../utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C | 4 ++-- .../autoHexMesh/autoHexMeshDriver/autoHexMeshDriver.C | 4 +++- .../autoHexMesh/autoHexMeshDriver/autoRefineDriver.C | 5 +++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C index 6f086523dd..9a0825ac91 100644 --- a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C +++ b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C @@ -203,8 +203,8 @@ int main(int argc, char *argv[]) IOobject ( "abc", // dummy name - //mesh.time().constant(), // instance - mesh.time().findInstance("triSurface", word::null),// instance + mesh.time().constant(), // instance + //mesh.time().findInstance("triSurface", word::null),// instance "triSurface", // local mesh.time(), // registry IOobject::MUST_READ, diff --git a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoHexMeshDriver.C b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoHexMeshDriver.C index 3c2221f8d0..1612a23dea 100644 --- a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoHexMeshDriver.C +++ b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoHexMeshDriver.C @@ -225,7 +225,9 @@ Foam::autoHexMeshDriver::autoHexMeshDriver IOobject ( "abc", // dummy name - mesh_.time().findInstance("triSurface", word::null),// inst + //mesh_.time().findInstance("triSurface", word::null), + // instance + mesh_.time().constant(), // instance "triSurface", // local mesh_.time(), // registry IOobject::MUST_READ, diff --git a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoRefineDriver.C b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoRefineDriver.C index 0ac24a5574..a9b31b9bd1 100644 --- a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoRefineDriver.C +++ b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoRefineDriver.C @@ -78,8 +78,9 @@ Foam::label Foam::autoRefineDriver::readFeatureEdges IOobject ( featFileName, // name - mesh.time().findInstance("triSurface", featFileName), - // instance + //mesh.time().findInstance("triSurface", featFileName), + // // instance + mesh.time().constant(), // instance "triSurface", // local mesh.time(), // registry IOobject::MUST_READ, From f3e40598a0df280b4ba34cfa15dde337fe1c9458 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Tue, 4 Aug 2009 18:02:07 +0200 Subject: [PATCH 011/454] applyWallFunctionBoundaryConditions - use mvBak() --- .../applyWallFunctionBoundaryConditions.C | 13 ++++++------- .../foamUpgradeFvSolution/foamUpgradeFvSolution.C | 15 ++++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/applications/utilities/preProcessing/applyWallFunctionBoundaryConditions/applyWallFunctionBoundaryConditions.C b/applications/utilities/preProcessing/applyWallFunctionBoundaryConditions/applyWallFunctionBoundaryConditions.C index e44e2910b7..d9164987ff 100644 --- a/applications/utilities/preProcessing/applyWallFunctionBoundaryConditions/applyWallFunctionBoundaryConditions.C +++ b/applications/utilities/preProcessing/applyWallFunctionBoundaryConditions/applyWallFunctionBoundaryConditions.C @@ -190,13 +190,12 @@ void replaceBoundaryType const_cast(IOdictionary::typeName) = oldTypeName; const_cast(dict.type()) = dict.headerClassName(); - // Make a backup of the old field - word backupName(dict.name() + ".old"); - Info<< " copying " << dict.name() << " to " - << backupName << endl; - IOdictionary dictOld = dict; - dictOld.rename(backupName); - dictOld.regIOobject::write(); + // Make a backup of the old file + if (mvBak(dict.objectPath(), "old")) + { + Info<< " Backup original file to " + << (dict.objectPath() + ".old") << endl; + } // Loop through boundary patches and update const polyBoundaryMesh& bMesh = mesh.boundaryMesh(); diff --git a/applications/utilities/preProcessing/foamUpgradeFvSolution/foamUpgradeFvSolution.C b/applications/utilities/preProcessing/foamUpgradeFvSolution/foamUpgradeFvSolution.C index d2e7981c68..9c96a9a4c2 100644 --- a/applications/utilities/preProcessing/foamUpgradeFvSolution/foamUpgradeFvSolution.C +++ b/applications/utilities/preProcessing/foamUpgradeFvSolution/foamUpgradeFvSolution.C @@ -84,11 +84,12 @@ int main(int argc, char *argv[]) } else { - mv - ( - solutionDict.objectPath(), - solutionDict.objectPath() + ".old" - ); + if (mvBak(solutionDict.objectPath(), "old")) + { + Info<< "Backup to " + << (solutionDict.objectPath() + ".old") << nl; + } + solutionDict.writeObject ( @@ -97,8 +98,8 @@ int main(int argc, char *argv[]) IOstream::UNCOMPRESSED ); - Info<< "Backup to " << (solutionDict.objectPath() + ".old") << nl - << "Write to " << solutionDict.objectPath() << nl << endl; + Info<< "Write to " + << solutionDict.objectPath() << nl << endl; } } From d4864d9b6ebea9e2bd9513c88dbd6c17ffde3bd5 Mon Sep 17 00:00:00 2001 From: henry Date: Tue, 4 Aug 2009 22:13:54 +0100 Subject: [PATCH 012/454] Moved the "generic" BCs into a separate library and included it only in those utilities which need this functionality. Solvers will now check the correctness of the BCs on read. --- .../utilities/mesh/advanced/refineHexMesh/Make/options | 3 ++- .../utilities/mesh/advanced/removeFaces/Make/options | 3 ++- .../utilities/mesh/conversion/polyDualMesh/Make/options | 1 + .../utilities/mesh/manipulation/createBaffles/Make/options | 3 ++- .../mesh/manipulation/mergeOrSplitBaffles/Make/options | 1 + .../utilities/mesh/manipulation/renumberMesh/Make/options | 1 + .../mesh/manipulation/splitMeshRegions/Make/options | 1 + .../utilities/mesh/manipulation/stitchMesh/Make/options | 5 +++-- .../utilities/mesh/manipulation/transformPoints/Make/options | 3 ++- .../utilities/miscellaneous/foamFormatConvert/Make/options | 2 +- .../utilities/miscellaneous/patchSummary/Make/options | 3 ++- .../utilities/parallelProcessing/decomposePar/Make/options | 1 + .../utilities/parallelProcessing/reconstructPar/Make/options | 1 + .../dataConversion/foamDataToFluent/Make/options | 3 ++- applications/utilities/postProcessing/foamCalc/Make/options | 1 + .../graphics/PV3FoamReader/vtkPV3Foam/Make/options | 1 + .../graphics/PVFoamReader/vtkFoam/Make/options | 1 + .../postProcessing/graphics/ensightFoamReader/Make/options | 1 + .../postProcessing/graphics/fieldview9Reader/Make/options | 1 + .../postProcessing/lagrangian/particleTracks/Make/options | 1 + .../miscellaneous/execFlowFunctionObjects/Make/options | 3 ++- .../postProcessing/miscellaneous/postChannel/Make/options | 1 + .../utilities/postProcessing/miscellaneous/ptot/Make/options | 3 ++- .../utilities/postProcessing/miscellaneous/wdot/Make/options | 3 ++- .../utilities/postProcessing/patch/patchAverage/Make/options | 3 ++- .../postProcessing/patch/patchIntegrate/Make/options | 3 ++- .../postProcessing/sampling/probeLocations/Make/options | 1 + .../utilities/postProcessing/sampling/sample/Make/options | 1 + .../postProcessing/scalarField/pPrime2/Make/options | 4 +++- .../postProcessing/stressField/stressComponents/Make/options | 1 + .../utilities/postProcessing/turbulence/R/Make/options | 3 ++- .../turbulence/createTurbulenceFields/Make/options | 3 ++- .../utilities/postProcessing/velocityField/Co/Make/options | 5 +++-- .../postProcessing/velocityField/Lambda2/Make/options | 3 ++- .../utilities/postProcessing/velocityField/Mach/Make/options | 1 + .../utilities/postProcessing/velocityField/Pe/Make/options | 1 + .../utilities/postProcessing/velocityField/Q/Make/options | 3 ++- .../postProcessing/velocityField/enstrophy/Make/options | 3 ++- .../postProcessing/velocityField/flowType/Make/options | 3 ++- .../postProcessing/velocityField/streamFunction/Make/options | 3 ++- .../postProcessing/velocityField/uprime/Make/options | 3 ++- .../postProcessing/velocityField/vorticity/Make/options | 4 +++- .../utilities/postProcessing/wall/wallGradU/Make/options | 3 ++- .../utilities/postProcessing/wall/wallHeatFlux/Make/options | 1 + .../postProcessing/wall/wallShearStress/Make/options | 3 ++- .../utilities/postProcessing/wall/yPlusLES/Make/options | 3 ++- .../utilities/postProcessing/wall/yPlusRAS/Make/options | 1 + .../utilities/preProcessing/applyBoundaryLayer/Make/options | 1 + .../applyWallFunctionBoundaryConditions/Make/options | 4 ++-- .../utilities/preProcessing/engineSwirl/Make/options | 5 ++++- applications/utilities/preProcessing/mapFields/Make/options | 3 ++- applications/utilities/preProcessing/setFields/Make/options | 1 + etc/controlDict | 1 - src/OpenFOAM/Make/files | 1 - src/finiteVolume/Make/files | 1 - src/genericPatchFields/Make/files | 4 ++++ src/genericPatchFields/Make/options | 5 +++++ .../genericFvPatchField}/genericFvPatchField.C | 0 .../genericFvPatchField}/genericFvPatchField.H | 0 .../genericFvPatchField}/genericFvPatchFields.C | 0 .../genericFvPatchField}/genericFvPatchFields.H | 0 .../genericPointPatchField}/genericPointPatchField.C | 0 .../genericPointPatchField}/genericPointPatchField.H | 0 .../genericPointPatchField}/genericPointPatchFields.C | 0 .../genericPointPatchField}/genericPointPatchFields.H | 0 65 files changed, 96 insertions(+), 36 deletions(-) create mode 100644 src/genericPatchFields/Make/files create mode 100644 src/genericPatchFields/Make/options rename src/{finiteVolume/fields/fvPatchFields/basic/generic => genericPatchFields/genericFvPatchField}/genericFvPatchField.C (100%) rename src/{finiteVolume/fields/fvPatchFields/basic/generic => genericPatchFields/genericFvPatchField}/genericFvPatchField.H (100%) rename src/{finiteVolume/fields/fvPatchFields/basic/generic => genericPatchFields/genericFvPatchField}/genericFvPatchFields.C (100%) rename src/{finiteVolume/fields/fvPatchFields/basic/generic => genericPatchFields/genericFvPatchField}/genericFvPatchFields.H (100%) rename src/{OpenFOAM/fields/pointPatchFields/basic/generic => genericPatchFields/genericPointPatchField}/genericPointPatchField.C (100%) rename src/{OpenFOAM/fields/pointPatchFields/basic/generic => genericPatchFields/genericPointPatchField}/genericPointPatchField.H (100%) rename src/{OpenFOAM/fields/pointPatchFields/basic/generic => genericPatchFields/genericPointPatchField}/genericPointPatchFields.C (100%) rename src/{OpenFOAM/fields/pointPatchFields/basic/generic => genericPatchFields/genericPointPatchField}/genericPointPatchFields.H (100%) diff --git a/applications/utilities/mesh/advanced/refineHexMesh/Make/options b/applications/utilities/mesh/advanced/refineHexMesh/Make/options index 376f4dff51..baa7b45f00 100644 --- a/applications/utilities/mesh/advanced/refineHexMesh/Make/options +++ b/applications/utilities/mesh/advanced/refineHexMesh/Make/options @@ -7,4 +7,5 @@ EXE_INC = \ EXE_LIBS = \ -ldynamicMesh \ -lmeshTools \ - -lfiniteVolume + -lfiniteVolume \ + -lgenericPatchFields diff --git a/applications/utilities/mesh/advanced/removeFaces/Make/options b/applications/utilities/mesh/advanced/removeFaces/Make/options index 4acbc2cd2e..63c5dc5d78 100644 --- a/applications/utilities/mesh/advanced/removeFaces/Make/options +++ b/applications/utilities/mesh/advanced/removeFaces/Make/options @@ -6,4 +6,5 @@ EXE_INC = \ EXE_LIBS = \ -lmeshTools \ -ldynamicMesh \ - -lfiniteVolume + -lfiniteVolume \ + -lgenericPatchFields diff --git a/applications/utilities/mesh/conversion/polyDualMesh/Make/options b/applications/utilities/mesh/conversion/polyDualMesh/Make/options index dc318df998..f3d9c89aac 100644 --- a/applications/utilities/mesh/conversion/polyDualMesh/Make/options +++ b/applications/utilities/mesh/conversion/polyDualMesh/Make/options @@ -5,5 +5,6 @@ EXE_INC = \ EXE_LIBS = \ -lfiniteVolume \ + -lgenericPatchFields \ -ldynamicMesh \ -lmeshTools diff --git a/applications/utilities/mesh/manipulation/createBaffles/Make/options b/applications/utilities/mesh/manipulation/createBaffles/Make/options index d4ab8c1b6b..f7e0c60fed 100644 --- a/applications/utilities/mesh/manipulation/createBaffles/Make/options +++ b/applications/utilities/mesh/manipulation/createBaffles/Make/options @@ -6,4 +6,5 @@ EXE_INC = \ EXE_LIBS = \ -ldynamicMesh \ -lmeshTools \ - -lfiniteVolume + -lfiniteVolume \ + -lgenericPatchFields diff --git a/applications/utilities/mesh/manipulation/mergeOrSplitBaffles/Make/options b/applications/utilities/mesh/manipulation/mergeOrSplitBaffles/Make/options index 792a51bf7f..523fc41d30 100644 --- a/applications/utilities/mesh/manipulation/mergeOrSplitBaffles/Make/options +++ b/applications/utilities/mesh/manipulation/mergeOrSplitBaffles/Make/options @@ -5,5 +5,6 @@ EXE_INC = \ EXE_LIBS = \ -lfiniteVolume \ + -lgenericPatchFields \ -lmeshTools \ -ldynamicMesh diff --git a/applications/utilities/mesh/manipulation/renumberMesh/Make/options b/applications/utilities/mesh/manipulation/renumberMesh/Make/options index 8a7e5d1674..a8d7971b3b 100644 --- a/applications/utilities/mesh/manipulation/renumberMesh/Make/options +++ b/applications/utilities/mesh/manipulation/renumberMesh/Make/options @@ -8,4 +8,5 @@ EXE_LIBS = \ -lmeshTools \ -ldynamicMesh \ -lfiniteVolume \ + -lgenericPatchFields \ -ldecompositionMethods diff --git a/applications/utilities/mesh/manipulation/splitMeshRegions/Make/options b/applications/utilities/mesh/manipulation/splitMeshRegions/Make/options index 9b8c3dea8c..da1b9c5016 100644 --- a/applications/utilities/mesh/manipulation/splitMeshRegions/Make/options +++ b/applications/utilities/mesh/manipulation/splitMeshRegions/Make/options @@ -5,5 +5,6 @@ EXE_INC = \ EXE_LIBS = \ -lfiniteVolume \ + -lgenericPatchFields \ -ldynamicMesh \ -lmeshTools diff --git a/applications/utilities/mesh/manipulation/stitchMesh/Make/options b/applications/utilities/mesh/manipulation/stitchMesh/Make/options index 98adec69d3..ac523b8282 100644 --- a/applications/utilities/mesh/manipulation/stitchMesh/Make/options +++ b/applications/utilities/mesh/manipulation/stitchMesh/Make/options @@ -1,9 +1,10 @@ EXE_INC = \ -I$(LIB_SRC)/dynamicMesh/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ - -I$(LIB_SRC)/finiteVolume/lnInclude + -I$(LIB_SRC)/finiteVolume/lnInclude EXE_LIBS = \ -ldynamicMesh \ -lmeshTools \ - -lfiniteVolume + -lfiniteVolume \ + -lgenericPatchFields diff --git a/applications/utilities/mesh/manipulation/transformPoints/Make/options b/applications/utilities/mesh/manipulation/transformPoints/Make/options index fa15f12452..16eb624bec 100644 --- a/applications/utilities/mesh/manipulation/transformPoints/Make/options +++ b/applications/utilities/mesh/manipulation/transformPoints/Make/options @@ -2,4 +2,5 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude EXE_LIBS = \ - -lfiniteVolume + -lfiniteVolume \ + -lgenericPatchFields diff --git a/applications/utilities/miscellaneous/foamFormatConvert/Make/options b/applications/utilities/miscellaneous/foamFormatConvert/Make/options index 10105d2d8a..b2bc2047e3 100644 --- a/applications/utilities/miscellaneous/foamFormatConvert/Make/options +++ b/applications/utilities/miscellaneous/foamFormatConvert/Make/options @@ -6,5 +6,5 @@ EXE_INC = \ EXE_LIBS = \ -lmeshTools \ -lfiniteVolume \ + -lgenericPatchFields \ -llagrangian - diff --git a/applications/utilities/miscellaneous/patchSummary/Make/options b/applications/utilities/miscellaneous/patchSummary/Make/options index fa15f12452..16eb624bec 100644 --- a/applications/utilities/miscellaneous/patchSummary/Make/options +++ b/applications/utilities/miscellaneous/patchSummary/Make/options @@ -2,4 +2,5 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude EXE_LIBS = \ - -lfiniteVolume + -lfiniteVolume \ + -lgenericPatchFields diff --git a/applications/utilities/parallelProcessing/decomposePar/Make/options b/applications/utilities/parallelProcessing/decomposePar/Make/options index 4b1adfd7ba..a1b8151fdd 100644 --- a/applications/utilities/parallelProcessing/decomposePar/Make/options +++ b/applications/utilities/parallelProcessing/decomposePar/Make/options @@ -6,6 +6,7 @@ EXE_INC = \ EXE_LIBS = \ -lfiniteVolume \ + -lgenericPatchFields \ -ldecompositionMethods \ -llagrangian \ -lmeshTools diff --git a/applications/utilities/parallelProcessing/reconstructPar/Make/options b/applications/utilities/parallelProcessing/reconstructPar/Make/options index 6aa54bb838..b041c31836 100644 --- a/applications/utilities/parallelProcessing/reconstructPar/Make/options +++ b/applications/utilities/parallelProcessing/reconstructPar/Make/options @@ -4,5 +4,6 @@ EXE_INC = \ EXE_LIBS = \ -lfiniteVolume \ + -lgenericPatchFields \ -llagrangian \ -lmeshTools diff --git a/applications/utilities/postProcessing/dataConversion/foamDataToFluent/Make/options b/applications/utilities/postProcessing/dataConversion/foamDataToFluent/Make/options index fa15f12452..16eb624bec 100644 --- a/applications/utilities/postProcessing/dataConversion/foamDataToFluent/Make/options +++ b/applications/utilities/postProcessing/dataConversion/foamDataToFluent/Make/options @@ -2,4 +2,5 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude EXE_LIBS = \ - -lfiniteVolume + -lfiniteVolume \ + -lgenericPatchFields diff --git a/applications/utilities/postProcessing/foamCalc/Make/options b/applications/utilities/postProcessing/foamCalc/Make/options index dbe9ddc048..a49fb12041 100644 --- a/applications/utilities/postProcessing/foamCalc/Make/options +++ b/applications/utilities/postProcessing/foamCalc/Make/options @@ -4,4 +4,5 @@ EXE_INC = \ EXE_LIBS = \ -lfiniteVolume \ + -lgenericPatchFields \ -lfoamCalcFunctions diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/Make/options b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/Make/options index b40ecb51d7..1e936c1d5d 100644 --- a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/Make/options +++ b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/Make/options @@ -12,6 +12,7 @@ EXE_INC = \ LIB_LIBS = \ -lfiniteVolume \ + -lgenericPatchFields \ -llagrangian \ -lmeshTools \ $(GLIBS) diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/Make/options b/applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/Make/options index 670c68424b..7dd2c76c8b 100644 --- a/applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/Make/options +++ b/applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/Make/options @@ -5,4 +5,5 @@ EXE_INC = \ LIB_LIBS = \ -lfiniteVolume \ + -lgenericPatchFields \ $(GLIBS) diff --git a/applications/utilities/postProcessing/graphics/ensightFoamReader/Make/options b/applications/utilities/postProcessing/graphics/ensightFoamReader/Make/options index 7a5a2e9b1c..8d21a9eae4 100644 --- a/applications/utilities/postProcessing/graphics/ensightFoamReader/Make/options +++ b/applications/utilities/postProcessing/graphics/ensightFoamReader/Make/options @@ -7,5 +7,6 @@ EXE_INC = \ LIB_LIBS = \ -lOpenFOAM \ -lfiniteVolume \ + -lgenericPatchFields \ -llagrangian \ $(PROJECT_LIBS) diff --git a/applications/utilities/postProcessing/graphics/fieldview9Reader/Make/options b/applications/utilities/postProcessing/graphics/fieldview9Reader/Make/options index b21a3eef2d..1303d319af 100644 --- a/applications/utilities/postProcessing/graphics/fieldview9Reader/Make/options +++ b/applications/utilities/postProcessing/graphics/fieldview9Reader/Make/options @@ -99,4 +99,5 @@ EXE_INC = \ EXE_LIBS = \ $(FV_LIBS) \ -lfiniteVolume \ + -lgenericPatchFields \ -lmeshTools diff --git a/applications/utilities/postProcessing/lagrangian/particleTracks/Make/options b/applications/utilities/postProcessing/lagrangian/particleTracks/Make/options index 1adeeefa12..a61c912ba0 100644 --- a/applications/utilities/postProcessing/lagrangian/particleTracks/Make/options +++ b/applications/utilities/postProcessing/lagrangian/particleTracks/Make/options @@ -4,4 +4,5 @@ EXE_INC = \ EXE_LIBS = \ -lfiniteVolume \ + -lgenericPatchFields \ -llagrangian diff --git a/applications/utilities/postProcessing/miscellaneous/execFlowFunctionObjects/Make/options b/applications/utilities/postProcessing/miscellaneous/execFlowFunctionObjects/Make/options index fe46b10d13..66477ecd8e 100644 --- a/applications/utilities/postProcessing/miscellaneous/execFlowFunctionObjects/Make/options +++ b/applications/utilities/postProcessing/miscellaneous/execFlowFunctionObjects/Make/options @@ -15,4 +15,5 @@ EXE_LIBS = \ -lspecie \ -lcompressibleRASModels \ -lcompressibleLESModels \ - -lfiniteVolume + -lfiniteVolume \ + -lgenericPatchFields diff --git a/applications/utilities/postProcessing/miscellaneous/postChannel/Make/options b/applications/utilities/postProcessing/miscellaneous/postChannel/Make/options index b90b6fdd4e..c5e4b6238b 100644 --- a/applications/utilities/postProcessing/miscellaneous/postChannel/Make/options +++ b/applications/utilities/postProcessing/miscellaneous/postChannel/Make/options @@ -6,4 +6,5 @@ EXE_INC = \ EXE_LIBS = \ -lmeshTools \ -lfiniteVolume \ + -lgenericPatchFields \ -lsampling diff --git a/applications/utilities/postProcessing/miscellaneous/ptot/Make/options b/applications/utilities/postProcessing/miscellaneous/ptot/Make/options index fa15f12452..16eb624bec 100644 --- a/applications/utilities/postProcessing/miscellaneous/ptot/Make/options +++ b/applications/utilities/postProcessing/miscellaneous/ptot/Make/options @@ -2,4 +2,5 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude EXE_LIBS = \ - -lfiniteVolume + -lfiniteVolume \ + -lgenericPatchFields diff --git a/applications/utilities/postProcessing/miscellaneous/wdot/Make/options b/applications/utilities/postProcessing/miscellaneous/wdot/Make/options index fa15f12452..16eb624bec 100644 --- a/applications/utilities/postProcessing/miscellaneous/wdot/Make/options +++ b/applications/utilities/postProcessing/miscellaneous/wdot/Make/options @@ -2,4 +2,5 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude EXE_LIBS = \ - -lfiniteVolume + -lfiniteVolume \ + -lgenericPatchFields diff --git a/applications/utilities/postProcessing/patch/patchAverage/Make/options b/applications/utilities/postProcessing/patch/patchAverage/Make/options index fa15f12452..16eb624bec 100644 --- a/applications/utilities/postProcessing/patch/patchAverage/Make/options +++ b/applications/utilities/postProcessing/patch/patchAverage/Make/options @@ -2,4 +2,5 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude EXE_LIBS = \ - -lfiniteVolume + -lfiniteVolume \ + -lgenericPatchFields diff --git a/applications/utilities/postProcessing/patch/patchIntegrate/Make/options b/applications/utilities/postProcessing/patch/patchIntegrate/Make/options index fa15f12452..16eb624bec 100644 --- a/applications/utilities/postProcessing/patch/patchIntegrate/Make/options +++ b/applications/utilities/postProcessing/patch/patchIntegrate/Make/options @@ -2,4 +2,5 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude EXE_LIBS = \ - -lfiniteVolume + -lfiniteVolume \ + -lgenericPatchFields diff --git a/applications/utilities/postProcessing/sampling/probeLocations/Make/options b/applications/utilities/postProcessing/sampling/probeLocations/Make/options index 04b22c08a4..44392ffc44 100644 --- a/applications/utilities/postProcessing/sampling/probeLocations/Make/options +++ b/applications/utilities/postProcessing/sampling/probeLocations/Make/options @@ -7,6 +7,7 @@ EXE_INC = \ EXE_LIBS = \ -lfiniteVolume \ + -lgenericPatchFields \ -lmeshTools \ -lsampling \ -ltriSurface \ diff --git a/applications/utilities/postProcessing/sampling/sample/Make/options b/applications/utilities/postProcessing/sampling/sample/Make/options index ae583f3388..4877a53003 100644 --- a/applications/utilities/postProcessing/sampling/sample/Make/options +++ b/applications/utilities/postProcessing/sampling/sample/Make/options @@ -8,6 +8,7 @@ EXE_INC = \ EXE_LIBS = \ -lfiniteVolume \ + -lgenericPatchFields \ -lmeshTools \ -lsampling \ -lsurfMesh \ diff --git a/applications/utilities/postProcessing/scalarField/pPrime2/Make/options b/applications/utilities/postProcessing/scalarField/pPrime2/Make/options index fa15f12452..02fc4c17b1 100644 --- a/applications/utilities/postProcessing/scalarField/pPrime2/Make/options +++ b/applications/utilities/postProcessing/scalarField/pPrime2/Make/options @@ -2,4 +2,6 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude EXE_LIBS = \ - -lfiniteVolume + -lfiniteVolume \ + -lgenericPatchFields + diff --git a/applications/utilities/postProcessing/stressField/stressComponents/Make/options b/applications/utilities/postProcessing/stressField/stressComponents/Make/options index be60a20b9f..d1016e9d4d 100644 --- a/applications/utilities/postProcessing/stressField/stressComponents/Make/options +++ b/applications/utilities/postProcessing/stressField/stressComponents/Make/options @@ -5,5 +5,6 @@ EXE_INC = \ EXE_LIBS = \ -lfiniteVolume \ + -lgenericPatchFields \ -lincompressibleRASModels \ -lincompressibleTransportModels diff --git a/applications/utilities/postProcessing/turbulence/R/Make/options b/applications/utilities/postProcessing/turbulence/R/Make/options index 5e71b80afa..0bab1a4e41 100644 --- a/applications/utilities/postProcessing/turbulence/R/Make/options +++ b/applications/utilities/postProcessing/turbulence/R/Make/options @@ -7,4 +7,5 @@ EXE_INC = \ EXE_LIBS = \ -lincompressibleRASModels \ -lincompressibleTransportModels \ - -lfiniteVolume + -lfiniteVolume \ + -lgenericPatchFields diff --git a/applications/utilities/postProcessing/turbulence/createTurbulenceFields/Make/options b/applications/utilities/postProcessing/turbulence/createTurbulenceFields/Make/options index a524a0aae5..8862565863 100644 --- a/applications/utilities/postProcessing/turbulence/createTurbulenceFields/Make/options +++ b/applications/utilities/postProcessing/turbulence/createTurbulenceFields/Make/options @@ -7,4 +7,5 @@ EXE_INC = \ EXE_LIBS = \ -lincompressibleRASModels \ -lincompressibleTransportModels \ - -lfiniteVolume \ No newline at end of file + -lfiniteVolume \ + -lgenericPatchFields diff --git a/applications/utilities/postProcessing/velocityField/Co/Make/options b/applications/utilities/postProcessing/velocityField/Co/Make/options index 7bd0a2d1e0..9103ae90ec 100644 --- a/applications/utilities/postProcessing/velocityField/Co/Make/options +++ b/applications/utilities/postProcessing/velocityField/Co/Make/options @@ -1,7 +1,8 @@ EXE_INC = \ -I$(LIB_SRC)/postProcessing/postCalc \ - -I$(LIB_SRC)/finiteVolume/lnInclude + -I$(LIB_SRC)/finiteVolume/lnInclude EXE_LIBS = \ $(FOAM_LIBBIN)/postCalc.o \ - -lfiniteVolume + -lfiniteVolume \ + -lgenericPatchFields diff --git a/applications/utilities/postProcessing/velocityField/Lambda2/Make/options b/applications/utilities/postProcessing/velocityField/Lambda2/Make/options index cbe51627f2..9103ae90ec 100644 --- a/applications/utilities/postProcessing/velocityField/Lambda2/Make/options +++ b/applications/utilities/postProcessing/velocityField/Lambda2/Make/options @@ -4,4 +4,5 @@ EXE_INC = \ EXE_LIBS = \ $(FOAM_LIBBIN)/postCalc.o \ - -lfiniteVolume + -lfiniteVolume \ + -lgenericPatchFields diff --git a/applications/utilities/postProcessing/velocityField/Mach/Make/options b/applications/utilities/postProcessing/velocityField/Mach/Make/options index 132e3be94a..c9733e397a 100644 --- a/applications/utilities/postProcessing/velocityField/Mach/Make/options +++ b/applications/utilities/postProcessing/velocityField/Mach/Make/options @@ -6,5 +6,6 @@ EXE_INC = \ EXE_LIBS = \ $(FOAM_LIBBIN)/postCalc.o \ -lfiniteVolume \ + -lgenericPatchFields \ -lbasicThermophysicalModels \ -lspecie diff --git a/applications/utilities/postProcessing/velocityField/Pe/Make/options b/applications/utilities/postProcessing/velocityField/Pe/Make/options index aa00dc2b59..7675f43a75 100644 --- a/applications/utilities/postProcessing/velocityField/Pe/Make/options +++ b/applications/utilities/postProcessing/velocityField/Pe/Make/options @@ -18,4 +18,5 @@ EXE_LIBS = \ -lcompressibleRASModels \ -lcompressibleLESModels \ -lfiniteVolume \ + -lgenericPatchFields \ -lmeshTools diff --git a/applications/utilities/postProcessing/velocityField/Q/Make/options b/applications/utilities/postProcessing/velocityField/Q/Make/options index cbe51627f2..9103ae90ec 100644 --- a/applications/utilities/postProcessing/velocityField/Q/Make/options +++ b/applications/utilities/postProcessing/velocityField/Q/Make/options @@ -4,4 +4,5 @@ EXE_INC = \ EXE_LIBS = \ $(FOAM_LIBBIN)/postCalc.o \ - -lfiniteVolume + -lfiniteVolume \ + -lgenericPatchFields diff --git a/applications/utilities/postProcessing/velocityField/enstrophy/Make/options b/applications/utilities/postProcessing/velocityField/enstrophy/Make/options index cbe51627f2..9103ae90ec 100644 --- a/applications/utilities/postProcessing/velocityField/enstrophy/Make/options +++ b/applications/utilities/postProcessing/velocityField/enstrophy/Make/options @@ -4,4 +4,5 @@ EXE_INC = \ EXE_LIBS = \ $(FOAM_LIBBIN)/postCalc.o \ - -lfiniteVolume + -lfiniteVolume \ + -lgenericPatchFields diff --git a/applications/utilities/postProcessing/velocityField/flowType/Make/options b/applications/utilities/postProcessing/velocityField/flowType/Make/options index cbe51627f2..9103ae90ec 100644 --- a/applications/utilities/postProcessing/velocityField/flowType/Make/options +++ b/applications/utilities/postProcessing/velocityField/flowType/Make/options @@ -4,4 +4,5 @@ EXE_INC = \ EXE_LIBS = \ $(FOAM_LIBBIN)/postCalc.o \ - -lfiniteVolume + -lfiniteVolume \ + -lgenericPatchFields diff --git a/applications/utilities/postProcessing/velocityField/streamFunction/Make/options b/applications/utilities/postProcessing/velocityField/streamFunction/Make/options index fa15f12452..16eb624bec 100644 --- a/applications/utilities/postProcessing/velocityField/streamFunction/Make/options +++ b/applications/utilities/postProcessing/velocityField/streamFunction/Make/options @@ -2,4 +2,5 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude EXE_LIBS = \ - -lfiniteVolume + -lfiniteVolume \ + -lgenericPatchFields diff --git a/applications/utilities/postProcessing/velocityField/uprime/Make/options b/applications/utilities/postProcessing/velocityField/uprime/Make/options index cbe51627f2..9103ae90ec 100644 --- a/applications/utilities/postProcessing/velocityField/uprime/Make/options +++ b/applications/utilities/postProcessing/velocityField/uprime/Make/options @@ -4,4 +4,5 @@ EXE_INC = \ EXE_LIBS = \ $(FOAM_LIBBIN)/postCalc.o \ - -lfiniteVolume + -lfiniteVolume \ + -lgenericPatchFields diff --git a/applications/utilities/postProcessing/velocityField/vorticity/Make/options b/applications/utilities/postProcessing/velocityField/vorticity/Make/options index cbe51627f2..35db088457 100644 --- a/applications/utilities/postProcessing/velocityField/vorticity/Make/options +++ b/applications/utilities/postProcessing/velocityField/vorticity/Make/options @@ -4,4 +4,6 @@ EXE_INC = \ EXE_LIBS = \ $(FOAM_LIBBIN)/postCalc.o \ - -lfiniteVolume + -lfiniteVolume \ + -lgenericPatchFields + diff --git a/applications/utilities/postProcessing/wall/wallGradU/Make/options b/applications/utilities/postProcessing/wall/wallGradU/Make/options index fa15f12452..16eb624bec 100644 --- a/applications/utilities/postProcessing/wall/wallGradU/Make/options +++ b/applications/utilities/postProcessing/wall/wallGradU/Make/options @@ -2,4 +2,5 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude EXE_LIBS = \ - -lfiniteVolume + -lfiniteVolume \ + -lgenericPatchFields diff --git a/applications/utilities/postProcessing/wall/wallHeatFlux/Make/options b/applications/utilities/postProcessing/wall/wallHeatFlux/Make/options index 8cdfe23fd1..4d244f56ba 100644 --- a/applications/utilities/postProcessing/wall/wallHeatFlux/Make/options +++ b/applications/utilities/postProcessing/wall/wallHeatFlux/Make/options @@ -10,5 +10,6 @@ EXE_LIBS = \ -lcompressibleRASModels \ -lreactionThermophysicalModels \ -lfiniteVolume \ + -lgenericPatchFields \ -lspecie \ -lbasicThermophysicalModels diff --git a/applications/utilities/postProcessing/wall/wallShearStress/Make/options b/applications/utilities/postProcessing/wall/wallShearStress/Make/options index 89632547e0..8862565863 100644 --- a/applications/utilities/postProcessing/wall/wallShearStress/Make/options +++ b/applications/utilities/postProcessing/wall/wallShearStress/Make/options @@ -7,4 +7,5 @@ EXE_INC = \ EXE_LIBS = \ -lincompressibleRASModels \ -lincompressibleTransportModels \ - -lfiniteVolume + -lfiniteVolume \ + -lgenericPatchFields diff --git a/applications/utilities/postProcessing/wall/yPlusLES/Make/options b/applications/utilities/postProcessing/wall/yPlusLES/Make/options index f6131ce41c..d7446846b0 100644 --- a/applications/utilities/postProcessing/wall/yPlusLES/Make/options +++ b/applications/utilities/postProcessing/wall/yPlusLES/Make/options @@ -9,4 +9,5 @@ EXE_INC = \ EXE_LIBS = \ -lincompressibleLESModels \ -lincompressibleTransportModels \ - -lfiniteVolume + -lfiniteVolume \ + -lgenericPatchFields diff --git a/applications/utilities/postProcessing/wall/yPlusRAS/Make/options b/applications/utilities/postProcessing/wall/yPlusRAS/Make/options index 459989eb9d..888f9e440e 100644 --- a/applications/utilities/postProcessing/wall/yPlusRAS/Make/options +++ b/applications/utilities/postProcessing/wall/yPlusRAS/Make/options @@ -14,5 +14,6 @@ EXE_LIBS = \ -lspecie \ -lcompressibleRASModels \ -lfiniteVolume \ + -lgenericPatchFields \ -lmeshTools \ -lsampling diff --git a/applications/utilities/preProcessing/applyBoundaryLayer/Make/options b/applications/utilities/preProcessing/applyBoundaryLayer/Make/options index d27c95d033..06d42b6c3c 100644 --- a/applications/utilities/preProcessing/applyBoundaryLayer/Make/options +++ b/applications/utilities/preProcessing/applyBoundaryLayer/Make/options @@ -4,4 +4,5 @@ EXE_INC = \ EXE_LIBS = \ -lfiniteVolume \ + -lgenericPatchFields \ -lmeshTools diff --git a/applications/utilities/preProcessing/applyWallFunctionBoundaryConditions/Make/options b/applications/utilities/preProcessing/applyWallFunctionBoundaryConditions/Make/options index 1d01ecc4c3..7a1f8e278d 100644 --- a/applications/utilities/preProcessing/applyWallFunctionBoundaryConditions/Make/options +++ b/applications/utilities/preProcessing/applyWallFunctionBoundaryConditions/Make/options @@ -9,5 +9,5 @@ EXE_LIBS = \ -lbasicThermophysicalModels \ -lspecie \ -lcompressibleRASModels \ - -lfiniteVolume - + -lfiniteVolume \ + -lgenericPatchFields diff --git a/applications/utilities/preProcessing/engineSwirl/Make/options b/applications/utilities/preProcessing/engineSwirl/Make/options index 725122ea1d..02fc4c17b1 100644 --- a/applications/utilities/preProcessing/engineSwirl/Make/options +++ b/applications/utilities/preProcessing/engineSwirl/Make/options @@ -1,4 +1,7 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude -EXE_LIBS = -lfiniteVolume +EXE_LIBS = \ + -lfiniteVolume \ + -lgenericPatchFields + diff --git a/applications/utilities/preProcessing/mapFields/Make/options b/applications/utilities/preProcessing/mapFields/Make/options index 148fd04d48..7bd964094e 100644 --- a/applications/utilities/preProcessing/mapFields/Make/options +++ b/applications/utilities/preProcessing/mapFields/Make/options @@ -8,4 +8,5 @@ EXE_LIBS = \ -lsampling \ -lmeshTools \ -llagrangian \ - -lfiniteVolume + -lfiniteVolume \ + -lgenericPatchFields diff --git a/applications/utilities/preProcessing/setFields/Make/options b/applications/utilities/preProcessing/setFields/Make/options index d27c95d033..06d42b6c3c 100644 --- a/applications/utilities/preProcessing/setFields/Make/options +++ b/applications/utilities/preProcessing/setFields/Make/options @@ -4,4 +4,5 @@ EXE_INC = \ EXE_LIBS = \ -lfiniteVolume \ + -lgenericPatchFields \ -lmeshTools diff --git a/etc/controlDict b/etc/controlDict index f95e8ef56c..c1d7416515 100644 --- a/etc/controlDict +++ b/etc/controlDict @@ -366,7 +366,6 @@ DebugSwitches directMappedVelocityFlux 0; directionMixed 0; directional 0; - disallowGenericFvsPatchField 0; disallowGenericFvPatchField 0; disallowGenericPointPatchField 0; disallowGenericPolyPatch 0; diff --git a/src/OpenFOAM/Make/files b/src/OpenFOAM/Make/files index 8e2f04c359..e608e4695b 100644 --- a/src/OpenFOAM/Make/files +++ b/src/OpenFOAM/Make/files @@ -478,7 +478,6 @@ $(pointPatchFields)/pointPatchField/pointPatchFields.C basicPointPatchFields = $(pointPatchFields)/basic $(basicPointPatchFields)/calculated/calculatedPointPatchFields.C -$(basicPointPatchFields)/generic/genericPointPatchFields.C $(basicPointPatchFields)/coupled/coupledPointPatchFields.C $(basicPointPatchFields)/value/valuePointPatchFields.C $(basicPointPatchFields)/fixedValue/fixedValuePointPatchFields.C diff --git a/src/finiteVolume/Make/files b/src/finiteVolume/Make/files index 6be4b7f3f4..7ecbf878a6 100644 --- a/src/finiteVolume/Make/files +++ b/src/finiteVolume/Make/files @@ -86,7 +86,6 @@ $(basicFvPatchFields)/coupled/coupledFvPatchFields.C $(basicFvPatchFields)/directionMixed/directionMixedFvPatchFields.C $(basicFvPatchFields)/fixedGradient/fixedGradientFvPatchFields.C $(basicFvPatchFields)/fixedValue/fixedValueFvPatchFields.C -$(basicFvPatchFields)/generic/genericFvPatchFields.C $(basicFvPatchFields)/mixed/mixedFvPatchFields.C $(basicFvPatchFields)/sliced/slicedFvPatchFields.C $(basicFvPatchFields)/transform/transformFvPatchFields.C diff --git a/src/genericPatchFields/Make/files b/src/genericPatchFields/Make/files new file mode 100644 index 0000000000..333d154a6d --- /dev/null +++ b/src/genericPatchFields/Make/files @@ -0,0 +1,4 @@ +genericFvPatchField/genericFvPatchFields.C +genericPointPatchField/genericPointPatchFields.C + +LIB = $(FOAM_LIBBIN)/libgenericPatchFields diff --git a/src/genericPatchFields/Make/options b/src/genericPatchFields/Make/options new file mode 100644 index 0000000000..fa15f12452 --- /dev/null +++ b/src/genericPatchFields/Make/options @@ -0,0 +1,5 @@ +EXE_INC = \ + -I$(LIB_SRC)/finiteVolume/lnInclude + +EXE_LIBS = \ + -lfiniteVolume diff --git a/src/finiteVolume/fields/fvPatchFields/basic/generic/genericFvPatchField.C b/src/genericPatchFields/genericFvPatchField/genericFvPatchField.C similarity index 100% rename from src/finiteVolume/fields/fvPatchFields/basic/generic/genericFvPatchField.C rename to src/genericPatchFields/genericFvPatchField/genericFvPatchField.C diff --git a/src/finiteVolume/fields/fvPatchFields/basic/generic/genericFvPatchField.H b/src/genericPatchFields/genericFvPatchField/genericFvPatchField.H similarity index 100% rename from src/finiteVolume/fields/fvPatchFields/basic/generic/genericFvPatchField.H rename to src/genericPatchFields/genericFvPatchField/genericFvPatchField.H diff --git a/src/finiteVolume/fields/fvPatchFields/basic/generic/genericFvPatchFields.C b/src/genericPatchFields/genericFvPatchField/genericFvPatchFields.C similarity index 100% rename from src/finiteVolume/fields/fvPatchFields/basic/generic/genericFvPatchFields.C rename to src/genericPatchFields/genericFvPatchField/genericFvPatchFields.C diff --git a/src/finiteVolume/fields/fvPatchFields/basic/generic/genericFvPatchFields.H b/src/genericPatchFields/genericFvPatchField/genericFvPatchFields.H similarity index 100% rename from src/finiteVolume/fields/fvPatchFields/basic/generic/genericFvPatchFields.H rename to src/genericPatchFields/genericFvPatchField/genericFvPatchFields.H diff --git a/src/OpenFOAM/fields/pointPatchFields/basic/generic/genericPointPatchField.C b/src/genericPatchFields/genericPointPatchField/genericPointPatchField.C similarity index 100% rename from src/OpenFOAM/fields/pointPatchFields/basic/generic/genericPointPatchField.C rename to src/genericPatchFields/genericPointPatchField/genericPointPatchField.C diff --git a/src/OpenFOAM/fields/pointPatchFields/basic/generic/genericPointPatchField.H b/src/genericPatchFields/genericPointPatchField/genericPointPatchField.H similarity index 100% rename from src/OpenFOAM/fields/pointPatchFields/basic/generic/genericPointPatchField.H rename to src/genericPatchFields/genericPointPatchField/genericPointPatchField.H diff --git a/src/OpenFOAM/fields/pointPatchFields/basic/generic/genericPointPatchFields.C b/src/genericPatchFields/genericPointPatchField/genericPointPatchFields.C similarity index 100% rename from src/OpenFOAM/fields/pointPatchFields/basic/generic/genericPointPatchFields.C rename to src/genericPatchFields/genericPointPatchField/genericPointPatchFields.C diff --git a/src/OpenFOAM/fields/pointPatchFields/basic/generic/genericPointPatchFields.H b/src/genericPatchFields/genericPointPatchField/genericPointPatchFields.H similarity index 100% rename from src/OpenFOAM/fields/pointPatchFields/basic/generic/genericPointPatchFields.H rename to src/genericPatchFields/genericPointPatchField/genericPointPatchFields.H From 2c62c83b4b0374b27cfdff7106a0bd30df4678d4 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Wed, 5 Aug 2009 08:46:19 +0200 Subject: [PATCH 013/454] actually compile genericPatchFields lib - also have it use LIB_LIBS to always load finiteVolume --- src/Allwmake | 1 + src/genericPatchFields/Make/options | 2 +- .../genericFvPatchField/genericFvPatchField.H | 3 ++- .../genericPointPatchField/genericPointPatchField.H | 3 ++- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Allwmake b/src/Allwmake index b1b166e234..1fcbb76d33 100755 --- a/src/Allwmake +++ b/src/Allwmake @@ -32,6 +32,7 @@ decompositionMethods/Allwmake wmake libso meshTools wmake libso finiteVolume +wmake libso genericPatchFields wmake libso sampling diff --git a/src/genericPatchFields/Make/options b/src/genericPatchFields/Make/options index fa15f12452..71b7873964 100644 --- a/src/genericPatchFields/Make/options +++ b/src/genericPatchFields/Make/options @@ -1,5 +1,5 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude -EXE_LIBS = \ +LIB_LIBS = \ -lfiniteVolume diff --git a/src/genericPatchFields/genericFvPatchField/genericFvPatchField.H b/src/genericPatchFields/genericFvPatchField/genericFvPatchField.H index 1144b11010..694bc92b52 100644 --- a/src/genericPatchFields/genericFvPatchField/genericFvPatchField.H +++ b/src/genericPatchFields/genericFvPatchField/genericFvPatchField.H @@ -26,7 +26,8 @@ Class Foam::genericFvPatchField Description - Foam::genericFvPatchField + A generic version of calculatedFvPatchField, useful as a fallback for + handling unknown patch types. SourceFiles genericFvPatchField.C diff --git a/src/genericPatchFields/genericPointPatchField/genericPointPatchField.H b/src/genericPatchFields/genericPointPatchField/genericPointPatchField.H index bedd11b4ec..8ce85fded1 100644 --- a/src/genericPatchFields/genericPointPatchField/genericPointPatchField.H +++ b/src/genericPatchFields/genericPointPatchField/genericPointPatchField.H @@ -26,7 +26,8 @@ Class Foam::genericPointPatchField Description - Foam::genericPointPatchField + A generic version of calculatedPointPatchField, useful as a fallback for + handling unknown patch types. SourceFiles genericPointPatchField.C From c4fd345ab1de53a2e385008813cba037de2b3978 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 5 Aug 2009 10:46:03 +0100 Subject: [PATCH 014/454] added solverFreq to read(), and changed fvm->fvmSup header --- .../radiation/radiationModel/radiationModel/radiationModel.C | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/thermophysicalModels/radiation/radiationModel/radiationModel/radiationModel.C b/src/thermophysicalModels/radiation/radiationModel/radiationModel/radiationModel.C index 2aaa7d7e67..be93dc011e 100644 --- a/src/thermophysicalModels/radiation/radiationModel/radiationModel/radiationModel.C +++ b/src/thermophysicalModels/radiation/radiationModel/radiationModel/radiationModel.C @@ -27,7 +27,7 @@ License #include "radiationModel.H" #include "absorptionEmissionModel.H" #include "scatterModel.H" -#include "fvm.H" +#include "fvmSup.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -112,6 +112,9 @@ bool Foam::radiation::radiationModel::read() lookup("radiation") >> radiation_; coeffs_ = subDict(type() + "Coeffs"); + lookup("solverFreq") >> solverFreq_, + solverFreq_ = max(1, solverFreq_); + return true; } else From df37b6b4313b62bc46bb882f889e0b8d597184cd Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 5 Aug 2009 11:38:16 +0100 Subject: [PATCH 015/454] read not pure virtual --- .../radiation/radiationModel/radiationModel/radiationModel.H | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/thermophysicalModels/radiation/radiationModel/radiationModel/radiationModel.H b/src/thermophysicalModels/radiation/radiationModel/radiationModel/radiationModel.H index 4d01dee1cf..aae443461e 100644 --- a/src/thermophysicalModels/radiation/radiationModel/radiationModel/radiationModel.H +++ b/src/thermophysicalModels/radiation/radiationModel/radiationModel/radiationModel.H @@ -163,7 +163,7 @@ public: virtual void calculate() = 0; //- Read radiationProperties dictionary - virtual bool read() = 0; + virtual bool read(); // Access From eba6c985a9ba1fe846b69ee08cf1175be825988f Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 5 Aug 2009 16:11:47 +0100 Subject: [PATCH 016/454] added rawTopoFvChanger mesh --- .../incompressible/pimpleDyMFoam/Make/options | 1 + .../compressibleInterDyMFoam/Make/options | 3 +- src/dynamicMesh/Make/files | 5 +- src/topoChangerFvMesh/Make/files | 1 + .../rawTopoChangerFvMesh.C | 180 ++++++++++++++++++ .../rawTopoChangerFvMesh.H | 117 ++++++++++++ .../rawTopoChangerFvMeshTemplates.C | 107 +++++++++++ 7 files changed, 409 insertions(+), 5 deletions(-) create mode 100644 src/topoChangerFvMesh/rawTopoChangerFvMesh/rawTopoChangerFvMesh.C create mode 100644 src/topoChangerFvMesh/rawTopoChangerFvMesh/rawTopoChangerFvMesh.H create mode 100644 src/topoChangerFvMesh/rawTopoChangerFvMesh/rawTopoChangerFvMeshTemplates.C diff --git a/applications/solvers/incompressible/pimpleDyMFoam/Make/options b/applications/solvers/incompressible/pimpleDyMFoam/Make/options index e14eec2585..40023adad7 100644 --- a/applications/solvers/incompressible/pimpleDyMFoam/Make/options +++ b/applications/solvers/incompressible/pimpleDyMFoam/Make/options @@ -9,6 +9,7 @@ EXE_INC = \ EXE_LIBS = \ -ldynamicFvMesh \ + -ltopoChangerFvMesh \ -ldynamicMesh \ -lmeshTools \ -lincompressibleTransportModels \ diff --git a/applications/solvers/multiphase/compressibleInterDyMFoam/Make/options b/applications/solvers/multiphase/compressibleInterDyMFoam/Make/options index af146aaa38..75094c8b16 100644 --- a/applications/solvers/multiphase/compressibleInterDyMFoam/Make/options +++ b/applications/solvers/multiphase/compressibleInterDyMFoam/Make/options @@ -16,5 +16,6 @@ EXE_LIBS = \ -lfiniteVolume \ -ldynamicMesh \ -lmeshTools \ - -ldynamicFvMesh + -ldynamicFvMesh \ + -ltopoChangerFvMesh diff --git a/src/dynamicMesh/Make/files b/src/dynamicMesh/Make/files index 2343124597..e59bbe3800 100644 --- a/src/dynamicMesh/Make/files +++ b/src/dynamicMesh/Make/files @@ -16,16 +16,13 @@ $(enrichedPatch)/enrichedPatchPointPoints.C $(enrichedPatch)/enrichedPatchCutFaces.C $(enrichedPatch)/enrichedPatchMasterPoints.C -/* polyTopoChange/polyTopoChange/polyTopoChange.C */ -polyTopoChange/polyTopoChange/topoAction/topoActions.C polyMeshModifier = polyTopoChange/polyMeshModifier $(polyMeshModifier)/polyMeshModifier.C $(polyMeshModifier)/newPolyMeshModifier.C +polyTopoChange/polyTopoChange/topoAction/topoActions.C polyTopoChange/polyTopoChanger/polyTopoChanger.C -/* polyTopoChange/polyTopoChanger/polyTopoChangerChangeMesh.C */ - polyTopoChange/polyTopoChange/polyTopoChange.C polyTopoChange/polyTopoChange/addPatchCellLayer.C polyTopoChange/polyTopoChange/edgeCollapser.C diff --git a/src/topoChangerFvMesh/Make/files b/src/topoChangerFvMesh/Make/files index 838500fd8b..1788317304 100644 --- a/src/topoChangerFvMesh/Make/files +++ b/src/topoChangerFvMesh/Make/files @@ -1,4 +1,5 @@ topoChangerFvMesh/topoChangerFvMesh.C +rawTopoChangerFvMesh/rawTopoChangerFvMesh.C /* linearValveFvMesh/linearValveFvMesh.C diff --git a/src/topoChangerFvMesh/rawTopoChangerFvMesh/rawTopoChangerFvMesh.C b/src/topoChangerFvMesh/rawTopoChangerFvMesh/rawTopoChangerFvMesh.C new file mode 100644 index 0000000000..ccfb392b2e --- /dev/null +++ b/src/topoChangerFvMesh/rawTopoChangerFvMesh/rawTopoChangerFvMesh.C @@ -0,0 +1,180 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 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 "rawTopoChangerFvMesh.H" +#include "mapPolyMesh.H" +#include "addToRunTimeSelectionTable.H" +#include "volFields.H" +#include "linear.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(rawTopoChangerFvMesh, 0); + addToRunTimeSelectionTable + ( + topoChangerFvMesh, + rawTopoChangerFvMesh, + IOobject + ); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +// Construct from components +Foam::rawTopoChangerFvMesh::rawTopoChangerFvMesh(const IOobject& io) +: + topoChangerFvMesh(io) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::rawTopoChangerFvMesh::~rawTopoChangerFvMesh() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +bool Foam::rawTopoChangerFvMesh::update() +{ + // Do mesh changes (use inflation - put new points in topoChangeMap) + Info<< "rawTopoChangerFvMesh : Checking for topology changes..." + << endl; + autoPtr topoChangeMap = topoChanger_.changeMesh(true); + + bool hasChanged = topoChangeMap.valid(); + + if (hasChanged) + { + Info<< "rawTopoChangerFvMesh : Done topology changes..." + << endl; + + // Temporary: fix fields on patch faces created out of nothing + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + // Two situations: + // - internal faces inflated out of nothing + // - patch faces created out of previously internal faces + + // Is face mapped in any way + PackedList<1> mappedFace(nFaces()); + + const label nOldInternal = topoChangeMap().oldPatchStarts()[0]; + + const labelList& faceMap = topoChangeMap().faceMap(); + for (label faceI = 0; faceI < nInternalFaces(); faceI++) + { + if (faceMap[faceI] >= 0) + { + mappedFace[faceI] = 1; + } + } + for (label faceI = nInternalFaces(); faceI < nFaces(); faceI++) + { + if (faceMap[faceI] >= 0 && faceMap[faceI] >= nOldInternal) + { + mappedFace[faceI] = 1; + } + } + + const List& fromFaces = topoChangeMap().facesFromFacesMap(); + + forAll(fromFaces, i) + { + mappedFace[fromFaces[i].index()] = 1; + } + + const List& fromEdges = topoChangeMap().facesFromEdgesMap(); + + forAll(fromEdges, i) + { + mappedFace[fromEdges[i].index()] = 1; + } + + const List& fromPts = topoChangeMap().facesFromPointsMap(); + + forAll(fromPts, i) + { + mappedFace[fromPts[i].index()] = 1; + } + + // Set unmapped faces to zero + Info<< "rawTopoChangerFvMesh : zeroing unmapped boundary values." + << endl; + zeroUnmappedValues(mappedFace); + zeroUnmappedValues(mappedFace); + zeroUnmappedValues(mappedFace); + zeroUnmappedValues(mappedFace); + zeroUnmappedValues(mappedFace); + + // Special handling for phi: set unmapped faces to recreated phi + Info<< "rawTopoChangerFvMesh :" + << " recreating phi for unmapped boundary values." << endl; + const volVectorField& U = lookupObject("U"); + surfaceScalarField& phi = const_cast + ( + lookupObject("phi") + ); + setUnmappedValues + ( + phi, + mappedFace, + (linearInterpolate(U) & Sf())() + ); + + + if (topoChangeMap().hasMotionPoints()) + { + pointField newPoints = topoChangeMap().preMotionPoints(); + + // Give the meshModifiers opportunity to modify points + Info<< "rawTopoChangerFvMesh :" + << " calling modifyMotionPoints." << endl; + topoChanger_.modifyMotionPoints(newPoints); + + // Actually move points + Info<< "rawTopoChangerFvMesh :" + << " calling movePoints." << endl; + + movePoints(newPoints); + } + } + else + { + //Pout<< "rawTopoChangerFvMesh :" + // << " no topology changes..." << endl; + } + + changing(hasChanged); + + return hasChanged; +} + + +// ************************************************************************* // diff --git a/src/topoChangerFvMesh/rawTopoChangerFvMesh/rawTopoChangerFvMesh.H b/src/topoChangerFvMesh/rawTopoChangerFvMesh/rawTopoChangerFvMesh.H new file mode 100644 index 0000000000..612829c3c8 --- /dev/null +++ b/src/topoChangerFvMesh/rawTopoChangerFvMesh/rawTopoChangerFvMesh.H @@ -0,0 +1,117 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::rawTopoChangerFvMesh + +Description + topoChangerFvMesh without any added functionality. + + Note: run without FOAM_SETNAN. Temporary has unitialised patch + data when faces get created out of nothing. + +SourceFiles + rawTopoChangerFvMesh.C + +\*---------------------------------------------------------------------------*/ + +#ifndef rawTopoChangerFvMesh_H +#define rawTopoChangerFvMesh_H + +#include "topoChangerFvMesh.H" +#include "PackedList.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of classes + +/*---------------------------------------------------------------------------*\ + Class rawTopoChangerFvMesh Declaration +\*---------------------------------------------------------------------------*/ + +class rawTopoChangerFvMesh +: + public topoChangerFvMesh +{ + // Private Member Functions + + //- Set unmapped values + template class PatchField, class GeoMesh> + static void setUnmappedValues + ( + GeometricField& fld, + const PackedList<1>& mappedFace, + const GeometricField& baseFld + ); + + template class PatchField, class GeoMesh> + void zeroUnmappedValues(const PackedList<1>&) const; + + //- Disallow default bitwise copy construct + rawTopoChangerFvMesh(const rawTopoChangerFvMesh&); + + //- Disallow default bitwise assignment + void operator=(const rawTopoChangerFvMesh&); + +public: + + //- Runtime type information + TypeName("rawTopoChangerFvMesh"); + + + // Constructors + + //- Construct from database + explicit rawTopoChangerFvMesh(const IOobject& io); + + // Destructor + + virtual ~rawTopoChangerFvMesh(); + + + // Member Functions + + //- Update the mesh for both mesh motion and topology change + virtual bool update(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "rawTopoChangerFvMeshTemplates.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/topoChangerFvMesh/rawTopoChangerFvMesh/rawTopoChangerFvMeshTemplates.C b/src/topoChangerFvMesh/rawTopoChangerFvMesh/rawTopoChangerFvMeshTemplates.C new file mode 100644 index 0000000000..0be0306186 --- /dev/null +++ b/src/topoChangerFvMesh/rawTopoChangerFvMesh/rawTopoChangerFvMeshTemplates.C @@ -0,0 +1,107 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "rawTopoChangerFvMesh.H" +#include "Time.H" + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template class PatchField, class GeoMesh> +void Foam::rawTopoChangerFvMesh::setUnmappedValues +( + GeometricField& fld, + const PackedList<1>& mappedFace, + const GeometricField& baseFld +) +{ + //Pout<< "Checking field " << fld.name() << endl; + + forAll(fld.boundaryField(), patchI) + { + PatchField& fvp = const_cast&> + ( + fld.boundaryField()[patchI] + ); + + label start = fvp.patch().patch().start(); + forAll(fvp, i) + { + if (!mappedFace[start+i]) + { + //Pout<< "** Resetting unassigned value on patch " + // << fvp.patch().name() + // << " localface:" << i + // << " to:" << baseFld.boundaryField()[patchI][i] << endl; + fvp[i] = baseFld.boundaryField()[patchI][i]; + } + } + } +} + + +template class PatchField, class GeoMesh> +void Foam::rawTopoChangerFvMesh::zeroUnmappedValues +( + const PackedList<1>& mappedFace +) const +{ + typedef GeometricField FieldType; + + const wordList fldNames(names(FieldType::typeName)); + + forAll(fldNames, i) + { + //Pout<< "Checking field " << fldNames[i] << endl; + + FieldType& fld = const_cast + ( + lookupObject(fldNames[i]) + ); + + setUnmappedValues + ( + fld, + mappedFace, + FieldType + ( + IOobject + ( + "zero", + time().timeName(), + *this, + IOobject::NO_READ, + IOobject::NO_WRITE, + false + ), + *this, + dimensioned("0", fld.dimensions(), pTraits::zero) + ) + ); + } +} + + +// ************************************************************************* // From 73ae3ddc6dd0f8ec490e3da6a20652e9c140b3a8 Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 5 Aug 2009 21:31:30 +0100 Subject: [PATCH 017/454] include topoChangerFvMesh --- applications/solvers/multiphase/interDyMFoam/Make/options | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/applications/solvers/multiphase/interDyMFoam/Make/options b/applications/solvers/multiphase/interDyMFoam/Make/options index b9aa770576..6bbea18fd6 100644 --- a/applications/solvers/multiphase/interDyMFoam/Make/options +++ b/applications/solvers/multiphase/interDyMFoam/Make/options @@ -17,4 +17,5 @@ EXE_LIBS = \ -lfiniteVolume \ -ldynamicMesh \ -lmeshTools \ - -ldynamicFvMesh + -ldynamicFvMesh \ + -ltopoChangerFvMesh From a3cd621b5398e44e496222f974a7e9db65792407 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Thu, 6 Aug 2009 08:42:08 +0200 Subject: [PATCH 018/454] update docs for fileName, word, wordRe --- src/OpenFOAM/primitives/strings/fileName/fileName.H | 1 + src/OpenFOAM/primitives/strings/word/word.H | 5 ++--- src/OpenFOAM/primitives/strings/wordRe/wordRe.H | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/OpenFOAM/primitives/strings/fileName/fileName.H b/src/OpenFOAM/primitives/strings/fileName/fileName.H index 709e70920b..e69502d742 100644 --- a/src/OpenFOAM/primitives/strings/fileName/fileName.H +++ b/src/OpenFOAM/primitives/strings/fileName/fileName.H @@ -28,6 +28,7 @@ Class Description A class for handling file names. + A fileName is a string of characters without whitespace or quotes. A fileName can be - constructed from a char*, a string or a word - concatenated by adding a '/' separator diff --git a/src/OpenFOAM/primitives/strings/word/word.H b/src/OpenFOAM/primitives/strings/word/word.H index 5c910b7891..2b067ad51f 100644 --- a/src/OpenFOAM/primitives/strings/word/word.H +++ b/src/OpenFOAM/primitives/strings/word/word.H @@ -28,9 +28,8 @@ Class Description A class for handling words, derived from string. - A word is a string of characters containing no whitespace and may be - constructed from a string by removing whitespace. Words are delimited - by whitespace. + A word is a string of characters without whitespace, quotes, slashes, + semicolons or brace brackets. Words are delimited by whitespace. SourceFiles word.C diff --git a/src/OpenFOAM/primitives/strings/wordRe/wordRe.H b/src/OpenFOAM/primitives/strings/wordRe/wordRe.H index 741d76e553..d499998145 100644 --- a/src/OpenFOAM/primitives/strings/wordRe/wordRe.H +++ b/src/OpenFOAM/primitives/strings/wordRe/wordRe.H @@ -29,7 +29,7 @@ Description A wordRe is a word, but can also have a regular expression for matching words. - By default the constructors will generally preserve the argument as + By default the constructors will generally preserve the argument as a string literal and the assignment operators will use the wordRe::DETECT compOption to scan the string for regular expression meta characters and/or invalid word characters and react accordingly. From 60549b30f58867ac242f95ca32d3ce4c7623b300 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Thu, 6 Aug 2009 14:53:40 +0200 Subject: [PATCH 019/454] ensightFoamReader - updated README* and global_extern*h from ensight-82 - still using the same version of the reader API (2.03) - this seems to solve strange issues with genericPatchField symbols, but it still doesn't get the reader module working. - added in the release information (the build string) --- .../ensightFoamReader/README_USERD_2.05 | 4543 ++++++++++++++++ .../ensightFoamReader/README_USERD_2.06 | 4603 ++++++++++++++++ .../ensightFoamReader/README_USERD_2.07 | 4617 ++++++++++++++++ .../ensightFoamReader/README_USERD_2.08 | 4653 +++++++++++++++++ .../ensightFoamReader/README_USERD_IN_BUFFERS | 1447 +++++ .../graphics/ensightFoamReader/USERD_API.H | 2 + .../USERD_get_reader_release.H | 18 + .../USERD_get_reader_version.H | 4 +- .../graphics/ensightFoamReader/globalFoam.H | 2 +- .../ensightFoamReader/global_extern.h | 161 +- .../ensightFoamReader/global_extern_proto.h | 497 +- .../graphics/ensightFoamReader/libuserd.C | 4 +- 12 files changed, 20460 insertions(+), 91 deletions(-) create mode 100644 applications/utilities/postProcessing/graphics/ensightFoamReader/README_USERD_2.05 create mode 100644 applications/utilities/postProcessing/graphics/ensightFoamReader/README_USERD_2.06 create mode 100644 applications/utilities/postProcessing/graphics/ensightFoamReader/README_USERD_2.07 create mode 100644 applications/utilities/postProcessing/graphics/ensightFoamReader/README_USERD_2.08 create mode 100644 applications/utilities/postProcessing/graphics/ensightFoamReader/README_USERD_IN_BUFFERS create mode 100644 applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_API.H create mode 100644 applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_reader_release.H diff --git a/applications/utilities/postProcessing/graphics/ensightFoamReader/README_USERD_2.05 b/applications/utilities/postProcessing/graphics/ensightFoamReader/README_USERD_2.05 new file mode 100644 index 0000000000..b92bb1c988 --- /dev/null +++ b/applications/utilities/postProcessing/graphics/ensightFoamReader/README_USERD_2.05 @@ -0,0 +1,4543 @@ +README_USERD_2.05 +================= +-------------------------------------- +EnSight User Defined Reader Capability ===> (API 2.05) +-------------------------------------- +A user defined reader capability is included in EnSight which can allow +otherwise unsupported structured or unstructured data to be read. The user +defined reader capability utilizes dynamic shared libraries composed of +routines defined in this document but produced by you, the user, (or some +third party). This capability is currently available for dec, ibm, hp, sgi, +sun, linux, alpha linux, and NT servers. + +You should refer to beginning of README_USERD_2.0 and/or README_1.0_to_2.0 +for a discussion of the differences between API 1.0 and API 2.*. + +***>> API 2.05 additional capabilities (beyond API 2.04): +Routines to handle material species. + USERD_get_number_of_species + USERD_get_matsp_info + +Routines to handle variable extraction parameters after a read, and then +update the variables accordingly. Similar to the extra GUI capabilities +(which are processed before a read). (Can actually be added to pre-2.05 readers) + USERD_get_var_extract_gui_numbers + USERD_get_var_extract_gui_defaults + USERD_set_var_extract_gui_data + +Routines to obtain rigid body values from a reader. +(Routines were added - EnSight is now using for Nastran and STL readers + with Dynasty rigid body motion data file) + USERD_rigidbody_existence + USERD_rigidbody_values + +Routine that lets reader know when EnSight is getting the right side of a time +interval for variable interpolation between steps. Not generally needed for +most readers - however, may be needed for those that implement rigid body, and +wish to cache left and right timespan information for interpolation within the +reader itself. (Can actually be added to pre-2.05 readers) + USERD_set_right_side + + +***>> API 2.04 additional capabilities (beyond API 2.03): +Routines to handle failed elements. Basically +a.One routine to return a flag indicating the existence of + failed elements in at least one part in at least one + timestep in the model. +b.A second routine to return a matrix of flags indexed by part and + element type indicating which parts and element types have failed + elements at the current time step. +c.Finally a third routine to return an array of flags for a given + part and element type that is number of elements of that type long + indicating which elements have failed, and which have not failed. + + +***>> API 2.03 additional capabilities (beyond API 2.01): +1. Routines to handle materials +2. Routines to handle nsided and nfaced elements +3. Modified routine to handle structured ranges + + +**************************************************************************** +Note: The dummy_gold reader, the Ensight Gold example reader, the + ABAQUS_ODB reader and the LS-DYNA reader have been moved to + this 2.04 API level. +**************************************************************************** + + +The process for producing a user defined reader is: +--------------------------------------------------- +1. Write code for all pertinent routines in the library (Unless someone else + has done this for you). + + This is of course where the work is done by the user. The word + "pertinent" is used because depending on the nature of the data, some + of the routines in the library may be dummy routines. + + The source code for a dummy_gold library and for various other + working or sample libraries is copied from the installation CD during + installation. These will be located in directories under: + + $CEI_HOME/ensight76/user_defined_src/readers + + examples: + -------- + Basic dummy_gold routines provide skeleton for a new reader + $CEI_HOME/ensight76/user_defined_src/readers/dummy_gold + + Sample library which reads unstructured binary EnSight Gold data + $CEI_HOME/ensight76/user_defined_src/readers/ensight_gold + + You may find it useful to place your library source in this area as + well, but are not limited to this location. + + * ===> The descriptions of each library routine and the order that the + routines are called, which is provided in this file, along with + the example libraries, should make it possible for you to produce + code for your own data reader. + + +2. Produce the dynamic shared library. + + This is a compiling and loading process which varies according to + the type of machine you are on. In the user-defined-reader source + tree we have tried to isolate the machine dependent parts of the + build process using a set of files in the 'config' directory. In this + directory there is a configuration file for each platform on which + EnSight is supported. Before you can compile the installed readers + you should run the script called 'init' in the config directory. + + i.e. (for UNIX) + cd config + ./init sgi_6.5_n64 + cd .. + make + + If you are compiling for Windows NT, there are two options. If you + have the Cygwin GNU utilities installed, you can use GNU make as for + Unix. Otherwise, there is a script called makeall.cmd which will + build all of the readers using nmake. The Makefiles in each reader + directory will work using either make or nmake. + + i.e. (WIN32 Cygwin) (using nmake) + cd config cd config + sh init win32 cp win32 config + cd .. cd .. + mkdir lib + make makeall.cmd + + If you have platform-specific portions of code in your reader, the + build system defines a set of flags which can be used within + #ifdef ... #endif regions in your source, as shown in the table + below. + + Because the readers are now dynamically opened by EnSight, you may + have to include dependent libraries on your link-line to avoid having + unresolved symbols. If you are having problems with a reader, start + ensight as "ensight7 -readerdbg" and you will get feedback on any + problems encountered in loading a reader. If there are unresolved + symbols, you need to find the library which contains the missing + symbols and link it into your reader by adding it to the example + link commands below. + + If you choose to use a different build environment for your reader, + you should take care to use compatible compilation flags to ensure + compatibilty with the EnSight executables, most notably on the SGI + and HP-UX 11.0 platforms, which should use the following flags: + + sgi_6.2_o32: -mips2 + sgi_6.2_n64: -mips4 -64 + sgi_6.5_n32: -mips3 + sgi_6.5_n64: -mips4 -64 + hp_11.0_32: +DA2.0 + hp_11.0_64: +DA2.0W + + ______________________________________________________________________ + | MACHINE | OS flag | SHARED LIBRARY NAME PRODUCED | + | TYPE |------------------------------------------------------------| + | | LD COMMAND USED IN MAKEFILE | + ====================================================================== + ______________________________________________________________________ + | sgi | -DSGI | libuserd-X.so | + | |------------------------------------------------------------| + | | ld -shared -all -o libuserd-X.so libuserd-X.o | + ---------------------------------------------------------------------- + ______________________________________________________________________ + | hp | -DHP | libuserd-X.sl | + | |------------------------------------------------------------| + | | ld -b -o libuserd-X.sl libuserd-X.o | + ---------------------------------------------------------------------- + ______________________________________________________________________ + | sun | -DSUN | libuserd-X.so | + | |------------------------------------------------------------| + | | ld -G -o libuserd-X.so libuserd-X.o | + ---------------------------------------------------------------------- + ______________________________________________________________________ + | dec | -DDEC | libuserd-X.so | + | |------------------------------------------------------------| + | | ld -shared -all -o libuserd-X.so libuserd-X.o -lc | + ---------------------------------------------------------------------- + ______________________________________________________________________ + | linux | -DLINUX | libuserd-X.so | + | |------------------------------------------------------------| + | | ld -shared -o libuserd-X.so libuserd-X.o -lc | + ---------------------------------------------------------------------- + ______________________________________________________________________ + | alpha | -DALINUX | libuserd-X.so | + | linux |------------------------------------------------------------| + | | ld -shared -o libuserd-X.so libuserd-X.o -lc | + ---------------------------------------------------------------------- + ______________________________________________________________________ + | ibm | -DIBM | libuserd-X.so | + | |------------------------------------------------------------| + | | ld -G -o libuserd-X.so libuserd-X.o -bnoentry -bexpall -lc | + ---------------------------------------------------------------------- + + Once you have created your library, you should place it in a directory + of your choice or in the standard reader location: + + $CEI_HOME/ensight76/machines/$CEI_ARCH/lib_readers + + For example, if you created a reader for "mydata", you should create + the reader libuserd-mydata.so and place the file in your own reader + directory (see section 3 below) or in the standard location: + + $CEI_HOME/ensight76/machines/$CEI_ARCH/lib_readers/libuserd-mydata.so + + +3. By default EnSight will load all readers found in the directory: + + $CEI_HOME/ensight76/machines/$CEI_ARCH/lib_readers + + Files with names "libuserd-X.so" (where X is a name unique to the reader) + are assumed to be user-defined readers. + + There are two methods which can be used to supplement the default + behavior. + + (1) A feature which is useful for site-level or user-level configuration + is the optional environment variable $ENSIGHT7_READER. This + variable directs EnSight to load all readers in the specified reader + directory (you should probably specify a full path) before loading + the built-in readers. If the same reader exists in both directories + (as determined by the name returned by USERD_get_name_of_reader(), + NOT by the filename), the locally configured reader will take + precedence. + + (2) A useful feature for end-users is the use of the libuserd-devel + reader. EnSight will search for a reader named libuserd-devel.so + (.sl for HP or .dll for NT). This reader can exist anywhere in the + library path (see below) of the user. This is useful for an + individual actively developing a reader because the existence of a + libuserd-devel library will take precedence over any other library + which returns the same name from USERD_get_name_of_reader(). + + As an example, a site may install commonly used readers in a common + location, and users can set the ENSIGHT7_READER variable to access them: + + setenv ENSIGHT7_READER /usr/local/lib/e7readers + + A user working on a new reader may compile the reader and place it in + a directory specified by the library path: + + cp libuserd-myreader.so ~/lib/libuserd-devel.so + setenv ~/lib:$ + + The user is responsible for correctly configuring the library path + variable in order to make use of the libuserd-devel feature. The + library environment variables used are: + + Machine type Environment variable to set + ------------ --------------------------- + sgi LD_LIBRARY_PATH + dec LD_LIBRARY_PATH + sun LD_LIBRARY_PATH + linux LD_LIBRARY_PATH + alpha linux LD_LIBRARY_PATH + hp SHLIB_PATH + ibm LIBPATH + +As always, EnSight support is available if you need it. + +------------------------------- +Quick Index of Library Routines +------------------------------- + +Generally Needed for UNSTRUCTURED data +-------------------------------------- +USERD_get_part_coords part's node coordinates +USERD_get_part_node_ids part's node ids +USERD_get_part_elements_by_type part's element connectivites +USERD_get_part_element_ids_by_type part's element ids + + +Generally Needed for BLOCK data +-------------------------------------- +USERD_get_block_coords_by_component block coordinates +USERD_get_block_iblanking block iblanking values +USERD_get_ghosts_in_block_flag block ghost cell existence? +USERD_get_block_ghost_flags block ghost cell flags + + These routines, which formerly were only for unstructured data, will now + also be called for structured data if you specify that ids will be given + in the USERD_get_node_label_status and USERD_get_element_label_status rotuines + ------------------------------------------------------------------------------ + USERD_get_part_node_ids part's node ids + USERD_get_part_element_ids_by_type part's element ids + + +Generally needed for either or both kinds of data +------------------------------------------------- +USERD_get_name_of_reader name of reader for GUI +USERD_get_reader_version provide reader version number +USERD_get_reader_descrip provide GUI more description (optional) + +USERD_set_filenames filenames entered in GUI +USERD_set_server_number server which of how many + +USERD_get_number_of_timesets number of timesets +USERD_get_timeset_description description of timeset +USERD_get_geom_timeset_number timeset # to use for geom + +USERD_get_num_of_time_steps number of time steps +USERD_get_sol_times solution time values +USERD_set_time_set_and_step current timeset and time step + +USERD_get_gold_part_build_info Gets the info needed for part building process +USERD_get_changing_geometry_status changing geometry? +USERD_get_node_label_status node labels? +USERD_get_element_label_status element labels? +USERD_get_model_extents provide model bounding extents +USERD_get_number_of_files_in_dataset number of files in model +USERD_get_dataset_query_file_info info about each model file +USERD_get_descrip_lines file associated description lines +USERD_get_number_of_model_parts number of model parts +USERD_get_part_build_info part/block type/descrip etc. +USERD_get_maxsize_info part/block allocation maximums +USERD_get_ghosts_in_model_flag model contains ghost cells? +USERD_get_nsided_conn Gets the element connectivities for nsided + elements. (utilizes the number of nodes + per element obtained in + USERD_get_part_elements_by_type) +USERD_get_nfaced_nodes_per_face Gets the number of nodes per face for nfaced + elements (utilizes the number of faces + per element obtained in + USERD_get_part_elements_by_type) +USERD_get_nfaced_conn Gets the element connectivities for nfaced + elements (utilizes the number of nodes + per face obtained in + USERD_get_nfaced_nodes_per_face) + + +USERD_get_border_availability part border provided? +USERD_get_border_elements_by_type part border conn and parent info + +USERD_get_number_of_variables number of variables +USERD_get_gold_variable_info variable type/descrip etc. +USERD_get_var_by_component part or block variable values +USERD_get_constant_val constant variable's value +USERD_get_var_value_at_specific node's or element's variable value over time +USERD_stop_part_building cleanup after part build routine + +USERD_get_number_of_material_sets Gets the number of material sets +USERD_get_matf_set_info Gets the material set indices and names +USERD_get_number_of_materials Gets the number of materials +USERD_get_matf_var_info Gets the material indices and descriptions +USERD_size_matf_data Gets the length of either the + material ids list, + mixed-material ids list, or + mixed-material values list +USERD_load_matf_data Gets the material ids list, + mixed-material ids list, or + mixed-material values list + +USERD_bkup archive routine + +USERD_exit_routine cleanup upon exit routine + + +--------------------------- +Optional Extra GUI Info +Adds Toggle(s), Pulldown(s) Field(s) +that can be used for additonal input +--------------------------- +USERD_get_extra_gui_numbers Gets the number of toggles, pulldowns and fields +USERD_get_extra_gui_defaults Gets the default values for the GUI members +USERD_set_extra_gui_data Returns the answers provided by the user + +USERD_rigidbody_existence Returns whether rigid body transformation + data exists for the model. +USERD_rigidbody_values Returns the euler and location values for a + given part + +USERD_set_right_side Simply informs the reader when the time set + is for the right side of a time span during + variable interpolation between time steps. + +New at 2.04 +----------- + +/* ---------------------------------------------------------- + * + * Failure criteria in LS-DYNA + * if fail flag == threshold_val1 (0.0) then element fails + * logic_criteria2 not used + * threshold_val2 not used + * threshold_operator2 not used + * Return (Z_ERR) if this is not used. + * Return Z_OK if failed element feature should be used + * + * threshold_operator1 & 2 can be one of the following + * Z_ELE_FAILED_NONE, - disables checking + * Z_ELE_FAILED_GREATER, - greater than + * Z_ELE_FAILED_LESS, - less than + * Z_ELE_FAILED_EQUAL, - equal + * Z_ELE_FAILED_NOT_EQUAL, - not equal + * Z_ELE_FAILED_MANY - not used + * + * logic_criteria2 + * Z_ELE_FAILED_LOGIC_NONE, + * Z_ELE_FAILED_LOGIC_AND, + * Z_ELE_FAILED_LOGIC_OR, + * Z_ELE_FAILED_LOGIC_MANY + * + * ---------------------------------------------------------- */ + +int USERD_get_uns_failed_params( + char *fail_var_name, /* variable name to be used in failure + must be scalar, per elem */ + float *threshold_val1, /* number to compare for failure */ + float *threshold_val2, /* number to compare for failure */ + int *threshold_operator1, /* Z_GREATER_THAN, Z_LESS_THAN, + Z_EQUAL_TO */ + int *threshold_operator2, /* Z_GREATER_THAN, Z_LESS_THAN, + Z_EQUAL_TO */ + int *logic_criteria2 + + +------------------------- +Order Routines are called +------------------------- + +The various main operations are given basically in the order they will +be performed. Within each operation, the order the routines will be +called is given. + +1. Setting name in the gui, and specifying one or two input fields + + USERD_get_name_of_reader + USERD_get_reader_descrip (optional) + USERD_get_extra_gui_numbers (optional) + USERD_get_extra_gui_defaults (optional) + +2. Getting the reader version (also distinguishes between API's) + + USERD_get_reader_version + +3. Setting filenames and getting timeset and time info + + USERD_set_server_number + USERD_set_extra_gui_data (optional) + USERD_set_filenames + USERD_get_number_of_timesets + USERD_get_geom_timeset_number + + for each timeset: + USERD_get_timeset_description + USERD_get_num_of_time_steps + USERD_get_sol_times + + USERD_set_time_set_and_step + +4. Gathering info for part builder + + USERD_set_time_set_and_step + USERD_get_changing_geometry_status + USERD_get_node_label_status + USERD_get_element_label_status + USERD_get_number_of_files_in_dataset + USERD_get_dataset_query_file_info + USERD_get_descrip_lines (for geometry) + USERD_get_number_of_model_parts + USERD_get_uns_failed_model_flag + USERD_get_gold_part_build_info + USERD_get_uns_failed_etype_flags + USERD_get_ghosts_in_model_flag + USERD_get_maxsize_info + USERD_get_get_ghosts_in_block_flag (if any ghost cells in model) + USERD_get_model_extents OR (for model extents) + USERD_get_part_coords AND/OR + USERD_get_block_coords_by_component + +5. Gathering Variable info + + USERD_get_number_of_variables + USERD_get_gold_variable_info + +6. Part building (per part created) + + both unstructured and structured: + -------------------------------- + USERD_set_time_set_and_step + + if unstructured part: + -------------------- + USERD_get_part_element_ids_by_type + USERD_get_part_elements_by_type + + If any nsided elements: + + USERD_get_nsided_conn + + If any nfaced elements: + + USERD_get_nfaced_nodes_per_face + USERD_get_nfaced_conn + + USERD_get_part_coords + USERD_get_part_node_ids + USERD_get_uns_failed_elist_flags + + else if structured part: + ----------------------- + USERD_get_block_iblanking + USERD_get_block_coords_by_component + USERD_get_block_ghost_flags (If ghost cells in part) + USERD_get_part_node_ids (If node ids given) + USERD_get_part_element_ids_by_type (If element ids given) + + both again: + ---------- + USERD_get_border_availability (If border representation + USERD_get_border_elements_by_type is selected) + + USERD_stop_part_building (only once when part builder + dialog is closed) + +7. Loading Variables + + constants: + --------- + USERD_set_time_set_and_step + USERD_get_constant_val + + scalars/vectors/tensors: + ------------------------ + USERD_get_descrip_lines + USERD_set_time_set_and_step + USERD_get_var_by_component + +8. Changing geometry + + changing coords only (per part): + -------------------- + USERD_set_time_set_and_step + USERD_get_descrip_lines + USERD_get_part_coords + USERD_get_uns_failed_model_flag + USERD_get_uns_failed_etype_flags + USERD_get_uns_failed_elist_flags + USERD_get_block_coords_by_component + + changing connectivity (per part): + --------------------- + USERD_set_time_set_and_step + USERD_get_descrip_lines + USERD_get_number_of_model_parts + USERD_get_uns_failed_model_flag + USERD_get_gold_part_build_info + USERD_get_uns_failed_etype_flags + USERD_get_ghosts_in_model_flag + USERD_get_get_ghosts_in_block_flag (if any ghost cells in model) + USERD_get_model_extents OR + USERD_get_part_coords AND/OR + USERD_get_block_coords_by_component + USERD_get_part_element_ids_by_type + USERD_get_part_elements_by_type + USERD_get_part_coords + USERD_get_part_node_ids + USERD_get_uns_failed_elist_flags + USERD_get_block_iblanking + USERD_get_block_coords_by_component + USERD_get_block_ghost_flags (If ghost cells in part) + USERD_get_part_node_ids (If node ids given) + USERD_get_part_element_ids_by_type (If element ids given) + + USERD_get_border_availability (If border representation + USERD_get_border_elements_by_type is selected) + + +9. Node or Element queries over time + + USERD_get_var_value_at_specific + +10. To see if materials in the model + + USERD_get_number_of_material_sets + USERD_get_matf_set_info + + If any material sets in the model (calls these once per material set): + USERD_get_number_of_materials + USERD_get_matf_var_info + + For each elment type of each part containing material ids, calls: + USERD_size_matf_data + USERD_load_matf_data + + If there are any elements with mixed materials, when a domain or + interface is created, calls these again per part: + + USERD_size_matf_data + USERD_load_matf_data + +11. To modify the variable extraction parameters and have the variables + update accordingly. + + USERD_get_var_extract_gui_numbers + USERD_get_var_extract_gui_defaults + USERD_set_var_extract_gui_data + + + +----------------------- +Detailed Specifications +----------------------- + +Include files: +-------------- +The following header file is required in any file containing these library +routines. + + #include "global_extern.h" + +And it references: + + #include "global_extern_proto.h" + + + +******************************************************************************* +****************************** Special Note *********************************** +******************************************************************************* + +Make sure you use the proper define in the global_extern.h header file, namely: +#define USERD_API_204 + +Also, Make sure the api version in the USERD_get_reader_version routine is set +to "2.04" or larger. + +Make sure your reader has access to the global_extern_proto.h This is a new +file which is accessed from the new global_extern.h + +******************************************************************************* +******************************************************************************* + + +Basis of arrays: +--------------- +Unless explicitly stated otherwise, all arrays are zero based - in true C +fashion. + + +Global variables: +---------------- +You will generally need to have a few global variables which are shared by +the various library routines. The detailed specifications below have assumed +the following are available. (Their names describe their purpose, and they +will be used in helping describe the details of the routines below). + +static int Numparts_available = 0; +static int Num_unstructured_parts = 0; +static int Num_structured_blocks = 0; + +/* Note: Numparts_available = Num_unstructured_parts + Num_structured_blocks */ + +static int Num_timesets = 1; +static int Current_timeset = 1; +static int Geom_timeset_number = 1; + +static int Num_time_steps[Z_MAXSETS] = 1; +static int Current_time_step = 0; +static int Num_variables = 0; +static int Num_dataset_files = 0; + +static int Server_Number = 1; Which server of +static int Tot_Servers = 1; the total number of servers + + + +_________________________________________ +----------------------------------------- +Library Routines (in alphabetical order): +_________________________________________ +----------------------------------------- + +-------------------------------------------------------------------- +USERD_bkup + + Description: + ----------- + This routine is called during the EnSight archive process. You can + use it to save or restore info relating to your user defined reader. + + Specification: + ------------- + int USERD_bkup(FILE *archive_file, + int backup_type) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) archive_file = The archive file pointer + + (IN) backup_type = Z_SAVE_ARCHIVE for saving archive + Z_REST_ARCHIVE for restoring archive + + Notes: + ----- + * Since EnSight's archive file is saved in binary form, you should + also do any writing to it or reading from it in binary. + + * You should archive any variables, which will be needed for + future operations, that will not be read or computed again + before they will be needed. These are typically global + variables. + + * Make sure that the number of bytes that you write on a save and + the number of bytes that you read on a restore are identical!! + + * If any of the variables you save are allocated arrays, you must + do the allocations before restoring into them. + +-------------------------------------------------------------------- +USERD_exit_routine + + Description: + ----------- + This routine is called as EnSight is exiting. It can be used to clean + up anything needed - such as removing temporary files, etc. - or can simply + be a dummy. + + Specification: + ------------- + void USERD_exit_routine( void ) + + Arguments: + --------- + none + +-------------------------------------------------------------------- +USERD_get_block_coords_by_component + + Description: + ----------- + Get the coordinates of a given structured block, a component at a time. + + Specification: + ------------- + int USERD_get_block_coords_by_component(int block_number, + int which_component, + float *coord_array) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) block_number = The block part number + (1-based index of part table, namely: + + 1 ... Numparts_available. + + It is NOT the part_id that + is loaded in USERD_get_gold_part_build_info) + + (IN) which_component = Z_COMPX if x component wanted + = Z_COMPY if y component wanted + = Z_COMPZ if z component wanted + + (OUT) coord_array = 1D array containing x,y, or z + coordinate component of each node + + (Array will have been allocated + i*j*k for the block long) + + Notes: + ----- + * Not called unless Num_structured_blocks is > 0 + + * Will be based on Current_time_step + + + +-------------------------------------------------------------------- +USERD_get_block_iblanking + + Description: + ----------- + Get the iblanking value at each node of a block (if the block is + iblanked). + + Specification: + ------------- + int USERD_get_block_iblanking(int block_number, + int *iblank_array) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) block_number = The block part number + (1-based index of part table, namely: + + 1 ... Numparts_available. + + It is NOT the part_id that + is loaded in USERD_get_gold_part_build_info) + + (OUT) iblank_array = 1D array containing iblank value + for each node. + + (Array will have been allocated + i*j*k for the block long) + + possible values are: Z_EXT = exterior + Z_INT = interior + Z_BND = boundary + Z_INTBND = internal boundary + Z_SYM = symmetry plane + + Notes: + ----- + * Not called unless Num_structured_blocks is > 0 and you have + some iblanked blocks + + * Will be based on Current_time_step + + + +---------------------------------------------------------------------- +USERD_get_block_ghost_flags + + Description: + ----------- + Get the ghost_flags value at each element of a block containing ghost cells. + + Specification: + ------------- + int USERD_get_block_ghost_flags(int block_number, + int *ghost_flags) + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) block_number = The block number + (1-based index of part table, namely: + + 1 ... Numparts_available. + + It is NOT the part_id that + is loaded in USERD_get_gold_part_build_info) + + (OUT) ghost_flags = 1D array containing ghost flag value + for each block cell. + + (Array will have been allocated + (i-1)*(j-1)*(k-1) for the block long) + + possible values are: 0 = non-ghost cell (normal cell) + >0 = ghost cell + + Notes: + ----- + * This routine is new in the 2.01 API + + * This will be based on Current_time_step + + * Only called for structured "block" parts that have some ghost cells + as indicated by the USERD_get_ghost_in_block_flag. The model must + of course also have been indicated to have some ghost cells in the + USERD_get_ghost_in_model_flag routine. + + * It is sufficient to set the value to be 1 to flag as a ghost cell, + but the value can be any non-zero value, so you could use it to + indicate which block or which server (for Server-of-server use) the + cell is actually in. + + + +-------------------------------------------------------------------- +USERD_get_border_availability + + Description: + ----------- + Finds out if border elements are provided by the reader for the + desired part, or will need to be computed internally by EnSight. + + Specification: + ------------- + int USERD_get_border_availability(int part_number, + int number_of_elements[Z_MAXTYPE]) + + Returns: + ------- + Z_OK if border elements will be provided by the reader. + (number_of_elements array will be loaded and + USERD_get_border_elements_by_type will be called) + + Z_ERR if border elements are not available - thus EnSight must compute. + (USERD_get_border_elements_by_type will not be called) + + + Arguments: + --------- + (IN) part_number = The part number + (1-based index of part table, namely: + + 1 ... Numparts_available. + + It is NOT the part_id that + is loaded in USERD_get_gold_part_build_info) + + (OUT) number_of_elements = 2D array containing number of + each type of border element in + the part. + ------------ + Possible types are: + + Z_POINT = point + Z_BAR02 = 2-noded bar + Z_BAR03 = 3-noded bar + Z_TRI03 = 3-noded triangle + Z_TRI06 = 6-noded triangle + Z_QUA04 = 4-noded quadrilateral + Z_QUA08 = 8-noded quadrilateral + + Notes: + ----- + * Only called if border representation is used. + + * Will be based on Current_time_step + + + +-------------------------------------------------------------------- +USERD_get_border_elements_by_type + + Description: + ----------- + Provides border element connectivity and parent information. + + Specification: + ------------- + int USERD_get_border_elements_by_type(int part_number, + int element_type, + int **conn_array, + short *parent_element_type, + int *parent_element_num) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) part_number = The part number + (1-based index of part table, namely: + + 1 ... Numparts_available. + + It is NOT the part_id that + is loaded in USERD_get_gold_part_build_info) + + (IN) element_type = One of the following (See global_extern.h) + Z_POINT node point element + Z_BAR02 2 node bar + Z_BAR03 3 node bar + Z_TRI03 3 node triangle + Z_TRI06 6 node triangle + Z_QUA04 4 node quad + Z_QUA08 8 node quad + + (OUT) conn_array = 2D array containing connectivity + of each border element of the type. + + (Array will have been allocated + num_of_elements of the type by + connectivity length of the type) + + ex) If number_of_elements[Z_TRI03] = 25 + number_of_elements[Z_QUA04] = 100 + number_of_elements[Z_QUA08] = 30 + as obtained in: + USERD_get_border_availability + + Then the allocated dimensions available + for this routine will be: + conn_array[25][3] when called with Z_TRI03 + + conn_array[100][4] when called with Z_QUA04 + + conn_array[30][8] when called with Z_QUA08 + + (OUT) parent_element_type = 1D array containing element type of the + parent element (the one that the border + element is a face/edge of). + + (Array will have been allocated + num_of_elements of the type long) + + (OUT) parent_element_num = 1D array containing element number of the + parent element (the one that the border + element is a face/edge of). + + (Array will have been allocated + num_of_elements of the type long) + + + Notes: + ----- + * Not called unless USERD_get_border_availability returned Z_OK + + * Will be based on Current_time_step + + + +-------------------------------------------------------------------- +USERD_get_changing_geometry_status + + Description: + ----------- + Gets the changing geometry status for the model + + Specification: + ------------- + int USERD_get_changing_geometry_status( void ) + + Returns: + ------- + Z_STATIC if geometry does not change + Z_CHANGE_COORDS if changing coordinates only + Z_CHANGE_CONN if changing connectivity + + Arguments: + --------- + none + + Notes: + ----- + * EnSight does not support changing number of parts. But the + coords and/or the connectivity of the parts can change. Note that + a part is allowed to be empty (number of nodes and elements equal + to zero). + + +-------------------------------------------------------------------- +USERD_get_constant_val + + Description: + ----------- + Get the value of a constant at a time step + + Specification: + ------------- + float USERD_get_constant_value(int which_var, + int imag_data) + + Returns: + ------- + Value of the requested constant variable + + Arguments: + --------- + (IN) which_var = The variable number + + (IN) imag_data = TRUE if want imaginary data value. + FALSE if want real data value. + + Notes: + ----- + * Will be based on Current_time_step + + + +-------------------------------------------------------------------- +USERD_get_dataset_query_file_info + + Description: + ----------- + Get the information about files in the dataset. Used for the + dataset query option within EnSight. + + Specification: + ------------- + int USERD_get_dataset_query_file_info(Z_QFILES *qfiles) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (OUT) qfiles = Structure containing information about each file + of the dataset. The Z_QFILES structure is defined + in the global_extern.h file + + (The structure will have been allocated + Num_dataset_files long, with 10 description + lines per file). + + qfiles[].name = The name of the file + (Z_MAXFILENP is the dimensioned length + of the name) + + qfiles[].sizeb = The number of bytes in the file + (Typically obtained with a call to the + "stat" system routine) (Is a long) + + qfiles[].timemod = The time the file was last modified + (Z_MAXTIMLEN is the dimensioned length + of this string) + (Typically obtained with a call to the + "stat" system routine) + + qfiles[].num_d_lines = The number of description lines you + are providing from the file. Max = 10 + + qfiles[].f_desc[] = The description line(s) per file, + qfiles[].num_d_lines of them + (Z_MAXFILENP is the allocated length of + each line) + + Notes: + ----- + * If Num_dataset_files is 0, this routine will not be called. + (See USERD_get_number_of_files_in_dataset) + + +-------------------------------------------------------------------- +USERD_get_descrip_lines + + Description: + ----------- + Get two description lines associated with geometry per time step, + or one description line associated with a variable per time step. + + Specification: + ------------- + int USERD_get_descrip_lines(int which_type, + int which_var, + int imag_data, + char line1[Z_BUFL], + char line2[Z_BUFL]) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) which_type = Z_GEOM for geometry (2 lines) + = Z_VARI for variable (1 line) + + (IN) which_var = If it is a variable, which one. + Ignored if geometry type. + + (IN) imag_data = TRUE if want imaginary data file. + FALSE if want real data file. + + (OUT) line1 = The 1st geometry description line, + or the variable description line. + + (OUT) line2 = The 2nd geometry description line + Not used if variable type. + + Notes: + ----- + * Will be based on Current_time_step + + * These are the lines EnSight can echo to the screen in + annotation mode. + + + +-------------------------------------------------------------------- +USERD_get_element_label_status + + Description: + ----------- + Answers the question as to whether element labels will be provided. + + Specification: + ------------- + int USERD_get_element_label_status( void ) + + Returns: + ------- + TRUE if element labels will be provided + FALSE if element labels will NOT be provided + + Arguments: + --------- + none + + Notes: + ----- + * element lables are needed in order to do any element querying, or + element labeling on-screen within EnSight. + + * Prior to API 2.01: + ----------------- + For unstructured parts, you can read them from your file if + available, or can assign them, etc. They need to be unique + per part, and are often unique per model. + + API 1.0: + USERD_get_element_ids_for_part is used to obtain the ids, + on a part by part basis, if TRUE status is returned here. + + API 2.0: + USERD_get_part_element_ids_by_type is used to obtain the ids, + on a per part, per type basis, if TRUE status is returned here. + + For structured parts, EnSight will assign ids if you return a + status of TRUE here. You cannot assign them youself!! + + * Starting at API 2.01: + -------------------- + For both unstructured and structured parts, you can read them + from your file if available, or can assign them, etc. They need + to be unique per part, and are often unique per model (especially + if you are dealing with a decomposed dataset). + + USERD_get_part_element_ids_by_type is used to obtain the ids, + on an element type by part basis, if TRUE status is returned here. + + * Will call USERD_get_part_element_ids_by_type for each type of + of each part if this routine returns TRUE. +-------------------------------------------------------------------- +USERD_get_geom_timeset_number - + + Description: + ----------- + Gets the timeset number to be used for geometry + + Specification: + ------------- + int USERD_get_geom_timeset_number( void ) + + Returns: + ------- + Geom_timeset_number = The timeset number that will be used for geometry. + For example, if USERD_get_number_of timesets + returns 2, the valid timeset numbers would be + 1 or 2. + + Arguments: + --------- + none + + Notes: + ----- + * If your model is static, which you indicated by returning a zero + in USERD_get_number_of_timesets, you can return a zero here as well. + + + +-------------------------------------------------------------------- +USERD_get_gold_part_build_info + + Description: + ----------- + Gets the info needed for the part building process. + + Specification: + ------------- + int USERD_get_gold_part_build_info(int *part_id, + int *part_types, + char *part_description[Z_BUFL], + int *number_of_nodes, + int *number_of_elements[Z_MAXTYPE], + int *ijk_dimensions[9], + int *iblanking_options[6]) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (OUT) part_id = Array containing the external part + ids for each of the model parts. + + IMPORTANT: + Parts numbers must be >= 1, because + of the way they are used in the GUI + + ******************************************* + The ids provided here are the numbers by + which the parts will be referred to in the + GUI (if possible). They are basically + labels as far as you are concerned. + + Note: The part numbers you pass to routines + which receive a part_number or block_number + or which_part as an argument are the 1-based + table index of the parts! + + example: If Numparts_available = 3 + + Table index part_id + ----------- ------- + 1 13 + 2 57 + 3 125 + + ^ ^ + | | + | These are placed in: + | part_id[0] = 13 + | part_id[1] = 57 + | part_id[2] = 125 + | for GUI labeling purposes. + | + These implied table indices are the part_number, + block_number, or which_part numbers that you would + pass to routines like: + + USERD_get_part_coords(int part_number,... + USERD_get_part_node_ids(int part_number,... + USERD_get_part_elements_by_type(int part_number,... + USERD_get_part_element_ids_by_type(int part_number,... + USERD_get_block_coords_by_component(int block_number,... + USERD_get_block_iblanking(int block_number,... + USERD_get_block_ghost_flags(int block_number,... + USERD_get_ghosts_in_block_flag(int block_number) + USERD_get_border_availability(int part_number,... + USERD_get_border_elements_by_type(int part_number,... + USERD_get_var_by_component(int which_variable, + int which_part,... + USERD_get_var_value_at_specific(int which_var, + int which_node_or_elem, + int which_part,... + ******************************************** + + (Array will have been allocated + Numparts_available long) + + (OUT) part_types = Array containing one of the + following for each model part: + + Z_UNSTRUCTURED or + Z_STRUCTURED or + Z_IBLANKED + + (Array will have been allocated + Numparts_available long) + + (OUT) part_description = Array containing a description + for each of the model parts + + (Array will have been allocated + Numparts_available by Z_BUFL + long) + + (OUT) number_of_nodes = Number of unstructured nodes in the part + + (Array will have been allocated + Numparts_available long) + + (OUT) number_of_elements = 2D array containing number of + each type of element for each + unstructured model part. + ------------ + Possible types are: + + Z_POINT = point + Z_BAR02 = 2-noded bar + Z_BAR03 = 3-noded bar + Z_TRI03 = 3-noded triangle + Z_TRI06 = 6-noded triangle + Z_QUA04 = 4-noded quadrilateral + Z_QUA08 = 8-noded quadrilateral + Z_TET04 = 4-noded tetrahedron + Z_TET10 = 10-noded tetrahedron + Z_PYR05 = 5-noded pyramid + Z_PYR13 = 13-noded pyramid + Z_PEN06 = 6-noded pentahedron + Z_PEN15 = 15-noded pentahedron + Z_HEX08 = 8-noded hexahedron + Z_HEX20 = 20-noded hexahedron + + Z_G_POINT = ghost node point element + Z_G_BAR02 = 2 node ghost bar + Z_G_BAR03 = 3 node ghost bar + Z_G_TRI03 = 3 node ghost triangle + Z_G_TRI06 = 6 node ghost triangle + Z_G_QUA04 = 4 node ghost quad + Z_G_QUA08 = 8 node ghost quad + Z_G_TET04 = 4 node ghost tetrahedron + Z_G_TET10 = 10 node ghost tetrahedron + Z_G_PYR05 = 5 node ghost pyramid + Z_G_PYR13 = 13 node ghost pyramid + Z_G_PEN06 = 6 node ghost pentahedron + Z_G_PEN15 = 15 node ghost pentahedron + Z_G_HEX08 = 8 node ghost hexahedron + Z_G_HEX20 = 20 node ghost hexahedron + + (Ignored unless Z_UNSTRUCTURED type) + + (Array will have been allocated + Numparts_available by + Z_MAXTYPE long) + + (OUT) ijk_dimensions = 2D array containing ijk dimension info + for structured blocks + + For Z_UNSTRUCTURED - is ignored + + For Z_STRUCTURED or Z_IBLANKED + + Prior to version 2.03: + ---------------------- + (Array will have been allocated + Numparts_available by 3 long) + + ijk_dimensions[][0] = I dimension + ijk_dimensions[][1] = J dimension + ijk_dimensions[][2] = K dimension + + + Starting at version 2.03: + ------------------------ + (Array will have been allocated + Numparts_available by 9 long) + + There are two ways to do this: + ------------------------------ + 1. The simple one, without ranges. + + This is good for all structured models + that will NOT be used in EnSight's + Server of Servers + + Simply provide the ijk dimensions in the + first three slots and place a -1 in + the 4th slot. (The remaining slots will + be ignored). + + Thus, + ijk_dimensions[][0] = I dimension of block + ijk_dimensions[][1] = J dimension of block + ijk_dimensions[][2] = K dimension of block + ijk_dimensions[][3] = -1 + + (J planes) + 4 *-------*-------* + | | | ijk_dimension[0][0] = 3 + | | | ijk_dimension[0][1] = 4 + | | | ijk_dimension[0][2] = 1 + 3 *-------*-------* + | | | ijk_dimension[0][4] = -1 + | | | + | | | + 2 *-------*-------* + | | | + | | | + | | | + 1 *-------*-------* + 1 2 3 (I planes) + + + + 2. Using ranges. + + This one can be used anytime, but MUST + be used if EnSight's Server of Servers + is to be used! + + The first 3 slots contain the ijk dimension + of the complete block (of which this may be + a portion). The last 6 slots contain the + ijk min and max ranges within the complete. + + Thus, + ijk_dimensions[][0] = I dim of complete block + ijk_dimensions[][1] = J dim of complete block + ijk_dimensions[][2] = K dim of complete block + + ijk_dimensions[][3] = Imin of portion (1-based) + ijk_dimensions[][4] = Imax of portion (1-based) + ijk_dimensions[][5] = Jmin of portion (1-based) + ijk_dimensions[][6] = Jmax of portion (1-based) + ijk_dimensions[][7] = Kmin of portion (1-based) + ijk_dimensions[][8] = Kmax of portion (1-based) + + + example1: (Model has one part, a simple 2D block, + and want whole thing) + + (J planes) + 4 *-------*-------* + | | | ijk_dimension[0][0] = 3 + | | | ijk_dimension[0][1] = 4 + | | | ijk_dimension[0][2] = 1 + 3 *-------*-------* + | | | ijk_dimension[0][3] = 1 + | | | ijk_dimension[0][4] = 3 + | | | ijk_dimension[0][5] = 1 + 2 *-------*-------* ijk_dimension[0][6] = 4 + | | | ijk_dimension[0][7] = 1 + | | | ijk_dimension[0][8] = 1 + | | | + 1 *-------*-------* + 1 2 3 (I planes) + + + example2: (Want to have the block represented + in two portions - 2 parts) + + (J planes) top portion + 4 *-------*-------* + | | | ijk_dimension[0][0] = 3 + | | | ijk_dimension[0][1] = 4 + | | | ijk_dimension[0][2] = 1 + 3 *-------*-------* + . . . ijk_dimension[0][3] = 1 + . . . ijk_dimension[0][4] = 3 + . . . ijk_dimension[0][5] = 3 + 2 ................. ijk_dimension[0][6] = 4 + . . . ijk_dimension[0][7] = 1 + . . . ijk_dimension[0][8] = 1 + . . . + 1 ................. + 1 2 3 (I planes) + + + (J planes) bottom portion + 4 ................. + . . . ijk_dimension[1][0] = 3 + . . . ijk_dimension[2][1] = 4 + . . . ijk_dimension[3][2] = 1 + 3 *-------*-------* + | | | ijk_dimension[1][3] = 1 + | | | ijk_dimension[1][4] = 3 + | | | ijk_dimension[1][5] = 1 + 2 *-------*-------* ijk_dimension[1][6] = 3 + | | | ijk_dimension[1][7] = 1 + | | | ijk_dimension[1][8] = 1 + | | | + 1 *-------*-------* + 1 2 3 (I planes) + + + And note that if you were partioning this block for + EnSight's Server of Servers, you would only have one part, + instead of two. Each SOS server would return its appropriate + ranges in the last 6 slots. The first 3 slots would remain constant. + + + (OUT) iblanking_options = 2D array containing iblanking + options possible for each + structured model part. + ---------- + (Ignored unless Z_IBLANKED type) + + (Array will have been allocated + Numparts_available by 6 long) + + iblanking_options[][Z_EXT] = TRUE if external (outside) + [][Z_INT] = TRUE if internal (inside) + [][Z_BND] = TRUE if boundary + [][Z_INTBND] = TRUE if internal boundary + [][Z_SYM] = TRUE if symmetry surface + + + Notes: + ----- + * If you haven't built a table of pointers to the different parts, + you might want to do so here as you gather the needed info. + + * Will be based on Current_time_step + + +-------------------------------------------------------------------- +USERD_get_gold_variable_info + + Description: + ----------- + Get the variable descriptions, types and filenames + + Specification: + ------------- + int USERD_get_gold_variable_info(char **var_description, + char **var_filename, + int *var_type, + int *var_classify, + int *var_complex, + char **var_ifilename, + float *var_freq, + int *var_contran, + int *var_timeset) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (OUT) var_description = Variable descriptions + + (Array will have been allocated + Num_variables by Z_BUFL long) + + variable description restrictions: + ---------------------------------- + 1. Only first 19 characters used in EnSight. + 2. Leading and trailing whitespace will be removed by EnSight. + 3. Illegal characters will be replaced by underscores. + 4. Thay may not start with a numeric digit. + 4. No two variables may have the same description. + + + (OUT) var_filename = Variable real filenames + + (Array will have been allocated + Num_variables by Z_BUFL long) + + (OUT) var_type = Variable type + + (Array will have been allocated + Num_variables long) + + types are: Z_CONSTANT + Z_SCALAR + Z_VECTOR + Z_TENSOR + Z_TENSOR9 + + (OUT) var_classify = Variable classification + + (Array will have been allocated + Num_variables long) + + types are: Z_PER_NODE + Z_PER_ELEM + + (OUT) var_complex = TRUE if complex, FALSE otherwise + + (Array will have been allocated + Num_variables long) + + (OUT) var_ifilename = Variable imaginary filenames (if complex) + + (Array will have been allocated + Num_variables by Z_BUFL long) + + (OUT) var_freq = complex frequency (if complex) + + (Array will have been allocated + Num_variables long) + + (OUT) var_contran = TRUE if constant changes per time step + FALSE if constant truly same at all time steps + + (Array will have been allocated + Num_variables long) + + (OUT) var_timeset = Timeset the variable will use (1 based). + (For static models, set it to 1) + + (Array will have been allocated + Num_variables long) + + For example: If USERD_get_number_of_timesets + returns 2, the valid + timeset_number's would be 1 or 2 + + + Notes: + ----- + * The implied variable numbers apply, but be aware that the + arrays are zero based. + So for variable 1, will need to provide var_description[0] + var_filename[0] + var_type[0] + var_classify[0] + var_complex[0] + var_ifilename[0] + var_freq[0] + var_contran[0] + var_timeset[0] + + + for variable 2, will need to provide var_description[1] + var_filename[1] + var_type[1] + var_classify[1] + var_complex[1] + var_ifilename[1] + var_freq[1] + var_contran[1] + var_timeset[1] + etc. + + + + +-------------------------------------------------------------------- +USERD_get_ghosts_in_block_flag + + Description: + ----------- + Gets whether ghost cells present in block or not + + Specification: + ------------- + int USERD_get_ghosts_in_block_flag(int block_number) + + Returns: + ------- + TRUE if any ghost cells in this structured part + FALSE if no ghost cells in this structured part + + Arguments: + --------- + (IN) block_number = The block part number + (1-based index of part table, namely: + + 1 ... Numparts_available. + + It is NOT the part_id that + is loaded in USERD_get_gold_part_build_info) + + Notes: + ----- + * This routine is new in the 2.01 API + * This will be based on Current_time_step + + * Intended for structured parts only, value will be ignored for + unstructured parts + + + +-------------------------------------------------------------------- +USERD_get_ghosts_in_model_flag + + Description: + ----------- + Answers the question as to whether any ghost cells in the model. + + Specification: + ------------- + int USERD_get_ghosts_in_model_flag( void ) + + Returns: + ------- + TRUE if any ghost cells in the model + FALSE if no ghost cells in the model + + Arguments: + --------- + + Notes: + ----- + * This routine is new in the 2.01 API + +------------------------------------------------------------------------- +USERD_get_matf_set_info + + Description: + ----------- + Get the material set ids and names + + Specification: + ------------- + int USERD_get_matf_set_info(int *mat_set_ids, + char **mat_set_name) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (OUT) mat_set_ids = 1D material set ids array + + (Array will have been allocated + Num_material_sets long) + + (OUT) mat_set_name = 2D material set name array + + (Array will have been allocated + Num_material_sets by Z_BUFL long) + + Notes: + ----- + * Will not be called if Num_material_sets is zero + * See USERD_get_number_of_material_sets header for explanatory example + + +-------------------------------------------------------------------- +USERD_get_matf_var_info + + Description: + ----------- + Gets the material ids and descriptions for the material set + + Specification: + ------------- + int USERD_get_matf_var_info(int set_index, + int *mat_ids, + char **mat_desc) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) set_index = the material set index (zero based) + + (OUT) mat_ids[set_index] = 1D integer array containing the material + ids to associated with each material + + (Array will have been allocated + Num_materials[set_index] long) + + (OUT) mat_desc[set_index] = 2D char array containing the material + descriptions to associated with each material + + (Array will have been allocated + Num_materials[set_index] by Z_BUFL long) + + Notes: + ----- + * See USERD_get_number_of_material_sets header for explanatory example + * Will not be called if Num_material_sets is zero, or + Num_materials[set_index] is zero + + + + +-------------------------------------------------------------------- +USERD_get_maxsize_info + + Description: + ----------- + Gets maximum part sizes for efficient memory allocation. + + Transient models (especially those that increase in size) can cause + reallocations, at time step changes, to keep chewing up more and + more memory. The way to avoid this is to know what the maximum + size of such memory will be, and allocate for this maximum initially. + + Accordingly, if you choose to provide this information (it is optional), + EnSight will take advantage of it. + + + Specification: + ------------- + int USERD_get_maxsize_info(int *max_number_of_nodes, + int *max_number_of_elements[Z_MAXTYPE], + int *max_ijk_dimensions[3]) + + Returns: + ------- + Z_OK if supplying maximum data + Z_ERR if not supplying maximum data, or some error occurred + while trying to obtain it. + + Arguments: + --------- + (OUT) max_number_of_nodes = Maximum number of unstructured nodes + in the part (over all time). + + (Array will have been allocated + Numparts_available long) + + (OUT) max_number_of_elements = 2D array containing maximum number of + each type of element for each + unstructured model part (over all time). + ------------ + Possible types are: + + Z_POINT = point + Z_BAR02 = 2-noded bar + Z_BAR03 = 3-noded bar + Z_TRI03 = 3-noded triangle + Z_TRI06 = 6-noded triangle + Z_QUA04 = 4-noded quadrilateral + Z_QUA08 = 8-noded quadrilateral + Z_TET04 = 4-noded tetrahedron + Z_TET10 = 10-noded tetrahedron + Z_PYR05 = 5-noded pyramid + Z_PYR13 = 13-noded pyramid + Z_PEN06 = 6-noded pentahedron + Z_PEN15 = 15-noded pentahedron + Z_HEX08 = 8-noded hexahedron + Z_HEX20 = 20-noded hexahedron + + Z_G_POINT = ghost node point element + Z_G_BAR02 = 2 node ghost bar + Z_G_BAR03 = 3 node ghost bar + Z_G_TRI03 = 3 node ghost triangle + Z_G_TRI06 = 6 node ghost triangle + Z_G_QUA04 = 4 node ghost quad + Z_G_QUA08 = 8 node ghost quad + Z_G_TET04 = 4 node ghost tetrahedron + Z_G_TET10 = 10 node ghost tetrahedron + Z_G_PYR05 = 5 node ghost pyramid + Z_G_PYR13 = 13 node ghost pyramid + Z_G_PEN06 = 6 node ghost pentahedron + Z_G_PEN15 = 15 node ghost pentahedron + Z_G_HEX08 = 8 node ghost hexahedron + Z_G_HEX20 = 20 node ghost hexahedron + + (Ignored unless Z_UNSTRUCTURED type) + + (Array will have been allocated + Numparts_available by + Z_MAXTYPE long) + + (OUT) max_ijk_dimensions = 2D array containing maximum ijk dimensions + for each structured model part (over all time). + ---------- + (Ignored if Z_UNSTRUCTURED type) + + (Array will have been allocated + Numparts_available by 3 long) + + max_ijk_dimensions[][0] = maximum I dimension + max_ijk_dimensions[][1] = maximum J dimension + max_ijk_dimensions[][2] = maximum K dimension + + Notes: + ----- + * You need to have first called USERD_get_number_of_model_parts and + USERD_get_gold_part_build_info, so Numparts_available is known and + so EnSight will know what the type is (Z_UNSTRUCTURED, Z_STRUCTURED, + or Z_IBLANKED) of each part. + + * This will NOT be based on Current_time_step - it is to be the maximum + values over all time!! + + * This information is optional. If you return Z_ERR, Ensight will still + process things fine, reallocating as needed, etc. However, for + large transient models you will likely use considerably more memory + and take more processing time for the memory reallocations. So, if it + is possible to provide this information "up front", it is recommended + to do so. + + +-------------------------------------------------------------------- +USERD_get_model_extents + + Description: + ----------- + Gets the model bounding box extents. If this routine supplys them + EnSight will not have to spend time doing so. If this routine + returns Z_ERR, EnSight will have to take the time to touch all the + nodes and gather the extent info. + + Specification: + ------------- + int USERD_get_model_extents(float extents[6]) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful (whereupon EnSight will determine by reading + all coords of all parts) + + Arguments: + --------- + (OUT) extents[0] = min x + [1] = max x + [2] = min y + [3] = max y + [4] = min z + [5] = max z + + Notes: + ----- + * This will be based on Current_time_step + + +-------------------------------------------------------------------- +USERD_get_name_of_reader + + Description: + ----------- + Gets the name of your user defined reader. The user interface will + ask for this and include it in the available reader list. + + Specification: + ------------- + int USERD_get_name_of_reader(char reader_name[Z_MAX_USERD_NAME], + int *two_fields) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (OUT) reader_name = the name of the your reader or data format. + (max length is Z_MAX_USERD_NAME, which is 20) + + (OUT) two_fields = FALSE if only one data field is + required. + TRUE if two data fields required + + -1 if one field (Geom) required + and one field (Param) is optional + Param field can contain any text + for example a file name, modifiers, + etc. that can be used to modify the + reader's behavior. + + + Notes: + ----- + * Always called. Please be sure to provide a name for your custom + reader format. + +-------------------------------------------------------------------- +USERD_get_nfaced_conn + + Description: + ----------- + Gets the array containing the connectivity of nsided faces of nfaced elements + + Specification: + -------------int + int USERD_get_nfaced_conn(int part_number, + int *nfaced_conn_array) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) part_number = the part number + + (OUT) nfaced_conn_array = 1D array of nsided face connectivies of nfaced + elements + + (int array will have been allocated long enough to + hold all the nsided face connectivities. Which is + the sum of all the nodes per face values in the + nfaced_npf_array of USERD_get_nfaced_nodes_per_face) + + Notes: + ----- + * Will not be called unless there are some nfaced elements in the part + + * Providing nfaced information to Ensight: + + 1. In USERD_get_gold_part_build_info, provide the number of nfaced + polyhedral elements in the part. + + 2. In USERD_get_part_elements_by_type, provide (in the conn_array), + the number of faces per nfaced element. (as if connectivity + length of an nfaced element is one) + + 3. In this routine, provide the streamed number of nodes per face + for each of the faces of the nfaced elements. + + + Simple example: 11 10 12 + +--------+-----+ + 2 nfaced elements: /| |\ /| + (1 7-faced / | | \ / | + 1 5-sided) / | | +9 | + / | | /| | + /7 | 8 / | | + +-----------+/ | | | + | |5 | |4 | |6 + | +-----|--+--|--+ + | / | \ | / + | / | \|/3 + | / | + + | / | / + |/1 |2 / + +-----------+/ + + 1. In USERD_get_gold_part_build_info: + number_of_elements[Z_NFACED] = 2 + . + /|\ + | + 2. In USERD_get_part_elements_by_type: + length of conn_array will be: 2 x 1 + for element_type of Z_NFACED: + conn_array[0][0] = 7 (for the 7-faced element) + conn_array[1][0] = 5 (for the 5-faced element) + + == + Sum 12 <---------+ + | + 3. In USERD_get_faced_nodes_per_face: | + length of nfaced_npf_array will be: 12 + + nfaced_npf_array[0] = 5 (5-noded top face of 7-faced element) + nfaced_npf_array[1] = 5 (5-noded bot face of 7-faced element) + nfaced_npf_array[2] = 4 (4-noded front face of 7-faced element) + nfaced_npf_array[3] = 4 (4-noded left face of 7-faced element) + nfaced_npf_array[4] = 4 (4-noded back face of 7-faced element) + nfaced_npf_array[5] = 4 (4-noded right front face of 7-faced element) + nfaced_npf_array[6] = 4 (4-noded right back face of 7-faced element) + + nfaced_npf_array[7] = 3 (3-noded top face of 5-faced element) + nfaced_npf_array[8] = 3 (3-noded bot face of 5-faced element) + nfaced_npf_array[9] = 4 (4-noded back face of 5-faced element) + nfaced_npf_array[10] = 4 (4-noded right face of 5-faced element) + nfaced_npf_array[11] = 4 (4-noded left front face of 5-faced element) + + == + Sum 48 <-------------+ + | + 4. In this function: | + length of the nfaced_conn_array will be: 48 + + nsided_conn_array[0] = 7 (conn of 5-noded top face of 7-faced elem) + nsided_conn_array[1] = 8 + nsided_conn_array[2] = 9 + nsided_conn_array[3] = 10 + nsided_conn_array[4] = 11 + + nsided_conn_array[5] = 1 (conn of 5-noded bot face of 7-faced elem) + nsided_conn_array[6] = 5 + nsided_conn_array[7] = 4 + nsided_conn_array[8] = 3 + nsided_conn_array[9] = 2 + + nsided_conn_array[10] = 1 (conn of 4-noded front face of 7-faced elem) + nsided_conn_array[11] = 2 + nsided_conn_array[12] = 8 + nsided_conn_array[13] = 7 + + nsided_conn_array[14] = 5 (conn of 4-noded left face of 7-faced elem) + nsided_conn_array[15] = 1 + nsided_conn_array[16] = 7 + nsided_conn_array[17] = 11 + + nsided_conn_array[18] = 4 (conn of 4-noded back face of 7-faced elem) + nsided_conn_array[19] = 5 + nsided_conn_array[20] = 11 + nsided_conn_array[21] = 10 + + nsided_conn_array[22] = 2 (conn of 4-noded right front face of 7-faced) + nsided_conn_array[23] = 3 + nsided_conn_array[24] = 9 + nsided_conn_array[25] = 8 + + nsided_conn_array[26] = 3 (conn of 4-noded right back face of 7-faced) + nsided_conn_array[27] = 4 + nsided_conn_array[28] = 10 + nsided_conn_array[29] = 9 + + nsided_conn_array[30] = 9 (conn of 3-noded top face of 5-faced elem) + nsided_conn_array[32] = 12 + nsided_conn_array[32] = 10 + + nsided_conn_array[33] = 3 (conn of 3-noded bot face of 5-faced elem) + nsided_conn_array[34] = 4 + nsided_conn_array[35] = 6 + + nsided_conn_array[36] = 6 (conn of 4-noded back face of 5-faced elem) + nsided_conn_array[37] = 4 + nsided_conn_array[38] = 10 + nsided_conn_array[39] = 12 + + nsided_conn_array[40] = 3 (conn of 4-noded right face of 5-faced elem) + nsided_conn_array[41] = 6 + nsided_conn_array[42] = 12 + nsided_conn_array[43] = 9 + + nsided_conn_array[44] = 4 (conn of 4-noded left front face of 5-faced) + nsided_conn_array[45] = 3 + nsided_conn_array[46] = 9 + nsided_conn_array[47] = 10 + + + +-------------------------------------------------------------------- +USERD_get_nfaced_nodes_per_face - + + Description: + ----------- + Gets the array containing the number of nodes per face for each face + of the nfaced elements. + + Specification: + ------------- + int USERD_get_nfaced_nodes_per_face(int part_number, + int *nfaced_npf_array) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) part_number = the part number + + (OUT) nfaced_npf_array = 1D array of nodes per face for all faces of + nfaced elements + + (int array will have been allocated long enough + to hold all the nodes_per_face values. Which is + the sum of all the number of faces per element + values in the conn_array of + USERD_get_part_elements_by_type) + + Notes: + ----- + * Will not be called unless there are some nfaced elements in the + the part + + * Providing nfaced information to Ensight: + + 1. In USERD_get_gold_part_build_info, provide the number of nfaced + polyhedral elements in the part. + + 2. In USERD_get_part_elements_by_type, provide (in the conn_array), + the number of faces per nfaced element. (as if connectivity + length of an nfaced element is one) + + 3. In this routine, provide the streamed number of nodes per face + for each of the faces of the nfaced elements. + + + Simple example: 11 10 12 + +--------+-----+ + 2 nfaced elements: /| |\ /| + (1 7-faced / | | \ / | + 1 5-sided) / | | +9 | + / | | /| | + /7 | 8 / | | + +-----------+/ | | | + | |5 | |4 | |6 + | +-----|--+--|--+ + | / | \ | / + | / | \|/3 + | / | + + | / | / + |/1 |2 / + +-----------+/ + + 1. In USERD_get_gold_part_build_info: + number_of_elements[Z_NFACED] = 2 + . + /|\ + | + 2. In USERD_get_part_elements_by_type: + length of conn_array will be: 2 x 1 + for element_type of Z_NFACED: + conn_array[0][0] = 7 (for the 7-faced element) + conn_array[1][0] = 5 (for the 5-faced element) + + == + Sum 12 <---------+ + | + 3. In this routine: | + length of nfaced_npf_array will be: 12 + + nfaced_npf_array[0] = 5 (5-noded top face of 7-faced element) + nfaced_npf_array[1] = 5 (5-noded bot face of 7-faced element) + nfaced_npf_array[2] = 4 (4-noded front face of 7-faced element) + nfaced_npf_array[3] = 4 (4-noded left face of 7-faced element) + nfaced_npf_array[4] = 4 (4-noded back face of 7-faced element) + nfaced_npf_array[5] = 4 (4-noded right front face of 7-faced element) + nfaced_npf_array[6] = 4 (4-noded right back face of 7-faced element) + + nfaced_npf_array[7] = 3 (3-noded top face of 5-faced element) + nfaced_npf_array[8] = 3 (3-noded bot face of 5-faced element) + nfaced_npf_array[9] = 4 (4-noded back face of 5-faced element) + nfaced_npf_array[10] = 4 (4-noded right face of 5-faced element) + nfaced_npf_array[11] = 4 (4-noded left front face of 5-faced element) + + == + Sum 48 <-------------+ + | + 4. In USERD_get_nfaced_conn: | + length of the nfaced_conn_array will be: 48 + + nsided_conn_array[0] = 7 (conn of 5-noded top face of 7-faced elem) + nsided_conn_array[1] = 8 + nsided_conn_array[2] = 9 + nsided_conn_array[3] = 10 + nsided_conn_array[4] = 11 + + nsided_conn_array[5] = 1 (conn of 5-noded bot face of 7-faced elem) + nsided_conn_array[6] = 5 + nsided_conn_array[7] = 4 + nsided_conn_array[8] = 3 + nsided_conn_array[9] = 2 + + nsided_conn_array[10] = 1 (conn of 4-noded front face of 7-faced elem) + nsided_conn_array[11] = 2 + nsided_conn_array[12] = 8 + nsided_conn_array[13] = 7 + + nsided_conn_array[14] = 5 (conn of 4-noded left face of 7-faced elem) + nsided_conn_array[15] = 1 + nsided_conn_array[16] = 7 + nsided_conn_array[17] = 11 + + nsided_conn_array[18] = 4 (conn of 4-noded back face of 7-faced elem) + nsided_conn_array[19] = 5 + nsided_conn_array[20] = 11 + nsided_conn_array[21] = 10 + + nsided_conn_array[22] = 2 (conn of 4-noded right front face of 7-faced) + nsided_conn_array[23] = 3 + nsided_conn_array[24] = 9 + nsided_conn_array[25] = 8 + + nsided_conn_array[26] = 3 (conn of 4-noded right back face of 7-faced) + nsided_conn_array[27] = 4 + nsided_conn_array[28] = 10 + nsided_conn_array[29] = 9 + + nsided_conn_array[30] = 9 (conn of 3-noded top face of 5-faced elem) + nsided_conn_array[32] = 12 + nsided_conn_array[32] = 10 + + nsided_conn_array[33] = 3 (conn of 3-noded bot face of 5-faced elem) + nsided_conn_array[34] = 4 + nsided_conn_array[35] = 6 + + nsided_conn_array[36] = 6 (conn of 4-noded back face of 5-faced elem) + nsided_conn_array[37] = 4 + nsided_conn_array[38] = 10 + nsided_conn_array[39] = 12 + + nsided_conn_array[40] = 3 (conn of 4-noded right face of 5-faced elem) + nsided_conn_array[41] = 6 + nsided_conn_array[42] = 12 + nsided_conn_array[43] = 9 + + nsided_conn_array[44] = 4 (conn of 4-noded left front face of 5-faced) + nsided_conn_array[45] = 3 + nsided_conn_array[46] = 9 + nsided_conn_array[47] = 10 + + + + +-------------------------------------------------------------------- +USERD_get_node_label_status + + Description: + ----------- + Answers the question as to whether node labels will be provided. + + Specification: + ------------- + int USERD_get_node_label_status( void ) + + Returns: + ------- + TRUE if node labels will be provided + FALSE if node labels will NOT be provided + + Arguments: + --------- + none + + Notes: + ----- + * Node ids are needed in order to do any node querying, or node + labeling on-screen within EnSight. + + * Prior to API 2.01: + ----------------- + For unstructured parts, you can read them from your file if + available, or can assign them, etc. They need to be unique + per part, and are often unique per model. They must also be + positive numbers greater than zero. + + USERD_get_part_node_ids is used to obtain the ids, if the + status returned here is TRUE. + + (Unlike API 1.0, where the connectivity of elements had to be + according to the node ids - API 2.0's element connectivities + are not affected either way by the status here.) + + For structured parts, EnSight will assign ids if you return a + status of TRUE here. You cannot assign them yourself!! + + * Starting at API 2.01: + -------------------- + For both unstructured and structured parts, you can read them + from your file if available, or can assign them, etc. They need + to be unique per part, and are often unique per model. They must + also be positive numbers greater than zero. + + USERD_get_part_node_ids is used to obtain the ids, if the + status returned here is TRUE. + + * Will call USERD_get_part_node_ids for each part if this routine + returns TRUE. + +-------------------------------------------------------------------- +USERD_get_nsided_conn - + + Description: + ----------- + Gets the array containing the connectivity of nsided elements + + Specification: + ------------- + int USERD_get_nsided_conn(int part_number, + int *nsided_conn_array) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) part_number = the part number + + (OUT) nsided_conn_array = 1D array of nsided connectivies + + (int array will have been allocated long enough + to hold all the nsided connectivities. Which is + the sum of all the nodes_per_element values in + the conn_array of USERD_get_part_elements_by_type) + + + Notes: + ----- + * Will not be called unless there are some nsided elements in the the part. + + * Providing nsided information to Ensight: + + 1. In USERD_get_gold_part_build_info, provide the number of nsided + elements in the part. + + 2. In USERD_get_part_elements_by_type, provide (in the conn_array), + the number of nodes per nsided element. (as if connectivity + length of an nsided element is one) + + 3. In this routine, provide the streamed connectivities for each of the + nsided elements. + + + Simple example: 5 6 + +--------+ + 3 nsided elements: /| \ + (1 4-sided / | \ + 1 3-sided / | \ + 1 7-sided) / | \ 7 + /3 |4 + + +-----+ | + | | | + | | |8 + | | + + | | / + | | / + | | / + |1 |2 /9 + +-----+--------+ + + 1. In USERD_get_gold_part_build_info: + number_of_elements[Z_NSIDED] = 3 + . + /|\ + | + 2. In USERD_get_part_elements_by_type: + length of conn_array will be: 3 x 1 + + for element_type of Z_NSIDED: + conn_array[0][0] = 4 (for the 4-sided element) + conn_array[1][0] = 3 (for the 3-sided element) + conn_array[2][0] = 7 (for the 7-sided element) + + Sum === + 14 <---------+ + | + 3. In this routine: | + length of nsided_conn_array will be: 14 + + nsided_conn_array[0] = 1 (connectivity of 4-sided element) + nsided_conn_array[1] = 2 + nsided_conn_array[2] = 4 + nsided_conn_array[3] = 3 + + nsided_conn_array[4] = 3 (connectivity of 3-sided element) + nsided_conn_array[5] = 4 + nsided_conn_array[6] = 5 + + nsided_conn_array[7] = 2 (connectivity of 7-sided element) + nsided_conn_array[8] = 9 + nsided_conn_array[9] = 8 + nsided_conn_array[10] = 7 + nsided_conn_array[11] = 6 + nsided_conn_array[12] = 5 + nsided_conn_array[13] = 4 + + + + +-------------------------------------------------------------------- +USERD_get_num_of_time_steps + + Description: + ----------- + Gets the number of time steps of data available for desired timeset. + + Specification: + ------------- + int USERD_get_num_of_time_steps( int timeset_number ) + + Returns: + ------- + Number of time steps in timeset (>0 if okay, <=0 if problems). + + Arguments: + --------- + (IN) timeset number = the timeset number + + For example: If USERD_get_number_of_timesets + returns 2, the valid + timeset_number's would be 1 and 2 + + Notes: + ----- + * This should be >= 1 1 indicates a static model + >1 indicates a transient model + + * Num_time_steps[timeset_number] would be set here + + + +-------------------------------------------------------------------- +USERD_get_number_of_files_in_dataset + + Description: + ----------- + Get the total number of files in the dataset. Used for the + dataset query option within EnSight. + + Specification: + ------------- + int USERD_get_number_of_files_in_dataset( void ) + + Returns: + ------- + The total number of files in the dataset. + + Arguments: + --------- + none + + Notes: + ----- + * You can be as complete as you want about this. If you don't + care about the dataset query option, return a value of 0 + If you only want certain files, you can just include them. But, + you will need to supply the info in USERD_get_dataset_query_file_info + for each file you include here. + + * Num_dataset_files would be set here + + +-------------------------------------------------------------------- +USERD_get_number_of_material_sets - + + Description: + ----------- + Get the number of material sets in the model + + Specification: + ------------- + int USERD_get_number_of_material_sets( void ) + + + Returns: + ------- + Num_material_sets = number of material sets + (Zero would indicate that you have no materials + to deal with in the model) + + or + + -1 if an error condition + + Arguments: + --------- + none + + Notes: + ----- + * You may want to keep this as a global for use in other routines. + + ############################################################### + NOTE: For EnSight 7.6, only one material set is supported + within EnSight. + Thus the only valid returns here are: + 0 (no materials) + 1 (for the one material set allowed) + or -1 (if an error) + + If the casefile has more than this, this reader will + read them, but EnSight will issue an error message and + choke on them! + ############################################################### + + ================================================================ + A very simple explanatory example, to use as a reference for the + materials routines: + + Given a 2D mesh composed of 9 quad (Z_QUA04) elements, with two materials. + Most of the model is material 1, but the top left corner is material 9 - + basically as shown: + + + *--------*--------*--------* + | | / | | + | Mat 9 / | | + | | / | | + | |/ | | + | e7 / e8 | e9 | + | /| | | + | / | | | + | / | | | + *----/---*--------*--------* + | / | | | + | / | | | + | / | Mat 1 | + |/ | | | + | e4 | e5 | e6 | + | | | | + | | | | + | | | | + *--------*--------*--------* + | | | | + | | | | + | | | | + | | | | + | e1 | e2 | e3 | + | | | | + | | | | + | | | | + *--------*--------*--------* + + + Thus, in this routine, set: + Num_material_sets = 1 + + In USERD_get_matf_set_info, set: + mat_set_ids[0] = 1 + mat_set_name[0] = "Material Set 1" (or whatever name desired) + + In USERD_get_number_of_materials, input would be set_index = 0, and + would need to set: + Num_materials[0] = 2 + + For simplicity, the ids and descriptions that would be returned in + USERD_get_matf_var_info could be: + mat_ids[0] = 1 + mat_ids[1] = 9 + mat_desc[0] = "mat 1" (or whatever desired) + mat_desc[2] = "mat 9" + + The per element material ids list would need to be: + + material ids: + ------------- + ids_list[0] = 1 (material id 1, for elem e1) + ids_list[1] = 1 ( " e2) + ids_list[2] = 1 ( " e3) + ids_list[3] = -1 (negative of index into mixed-material id list, for elem e4) + ids_list[5] = 1 (material id 1, for elem e5) + ids_list[5] = 1 ( " e6) + ids_list[5] = -5 (negative of index into mixed-material id list, for elem e7) + ids_list[5] = -9 ( " e8) + ids_list[5] = 1 (material id 1, for elem e9) + + Finally we need the mixed material ids list and the mixed materials values list, + which would need to be: + + mixed-material ids: + ------------------- + ==> 1 ids_list[0] = 2 (the -1 in the material variable points here, + 2 indicates that two materials are present) + 2 ids_list[1] = 1 (1st material is 1) + 3 ids_list[2] = 9 (2nd material is 9) + 4 ids_list[3] = -1 (negative of index into mixed-material val_list) + ==> 5 ids_list[4] = 2 (the -5 in the material variable points here, + 2 indicates that two materials are present) + 6 ids_list[5] = 1 (1st material is 1) + 7 ids_list[6] = 9 (2nd material is 9) + 8 ids_list[7] = -3 (negative of index into mixed-material val_list) + ==> 9 ids_list[8] = 2 etc. + 10 ids_list[9] = 1 + 11 ids_list[10] = 9 + 12 ids_list[11] = -5 + + mixed-material values: + ---------------------- + ==> 1 val_list[0] = 0.875 (the -1 in the mixed-material ids_list points here, + and this is the value for material 1) + 2 val_list[1] = 0.125 (the value for material 9) + ==> 3 val_list[2] = 0.125 (the -3 in the mixed-materials ids_list points here) + 4 val_list[3] = 0.875 + ==> 5 val_list[4] = 0.875 (the -5 in the mixed-materials ids_list points here) + 6 val_list[5] = 0.125 + + So, USERD_size_matf_data would need to return + matf_size = 8, when called with set_id = 1 + part_id = 1 + wtyp = Z_QUA04 + mat_type = Z_MAT_INDEX + + matf_size = 12, when called with set_id = 1 + part_id = 1 + mat_type = Z_MIX_INDEX + + = 6, when called with set_id = 1 + part_id = 1 + mat_type = Z_MIX_VALUE + + And, USERD_load_matf_data would need to return: + the int array ids_list as shown above when called with: + set_id = 1 + part_id = 1 + wtyp = Z_QUA04 + mat_type = Z_MAT_INDEX (indicating id list). + + the int array ids_list as shown above when called with: + set_id = 1 + part_id = 1 + mat_type = Z_MIX_INDEX (indicating id list). + + the float array val_list as shown above when called with: + set_id = 1 + part_id = 1 + mat_type = Z_MIX_VALUE (indicating val list). + + +------------------------------------------------------------------------- +USERD_get_number_of_materials + + Description: + ----------- + Gets the number of materials in the material set + + Specification: + ------------- + int USERD_get_number_of_materials( int set_index ) + + Returns: + ------- + Num_materials[set_index] = Number of materials in the set + 0 indicates no materials information present + -1 indicates an error + Arguments: + --------- + (IN) set_index = the material set index (zero based) + + Notes: + ----- + * See USERD_get_number_of_material_sets header for explanatory example + * Will not be called if Num_material_sets is zero + * You may want to keep this as a global for use in other routines. + + + +-------------------------------------------------------------------- +USERD_get_number_of_model_parts + + Description: + ----------- + Gets the total number of unstructured and structured parts + in the model, for which you can supply information. + + Specification: + ------------- + int USERD_get_number_of_model_parts( void ) + + Returns: + ------- + Number of parts (>0 if okay, <=0 if problems). + + Arguments: + --------- + none + + Notes: + ----- + * If going to have to read down through the parts in order to + know how many, you may want to build a table of pointers to + the various parts, so you can easily get to particular parts in + later processes. If you can simply read the number of parts + at the head of the file, then you would probably not build the + table at this time. + + * This routine would set Numparts_available, which is equal to + Num_unstructured_parts + Num_structured_blocks. + + + +-------------------------------------------------------------------- +USERD_get_number_of_timesets + + Description: + ----------- + Gets the number of timesets used in the model. + + Specification: + ------------- + int USERD_get_number_of_timesets( void ) + + Returns: + ------- + Number of timesets in the model + + Arguments: + --------- + none + + Notes: + ----- + * Num_timesets would be set here + + * If you have a static model, both geometry and variables, you should + return a value of zero. + + * If you have a transient model, then you should return one or more. + + For example: + + Geometry Variables No. of timesets + --------- ------------------------------ --------------- + static static 0 + static transient, all using same timeset 1 + + transient transient, all using same timeset as geom 1 + + static transient, using 3 different timesets 3 + + transient transient, using 3 different timesets and + none of them the same as the + geometry timeset 4 + etc. + + NOTE: ALL GEOMETRY MUST USE THE SAME TIMESET!!! You will have to provide + the timeset number to use + for geometry in: + USERD_get_geom_timeset_number + + Variables can use the same timeset as the geometry, or can use + other timesets. More than one variable can use the same timeset. + + example: changing geometry at 5 steps, 0.0, 1.0, 2.0, 3.0, 4.0 + variable 1 provided at these same five steps + variable 2 provided at 3 steps, 0.5, 1.25, 3.33 + + This routine should return a value of 2, because only + two different timesets are needed. Timeset 1 would be for the + geometry and variable 1 (they both use it). Timeset 2 would + be for variable 2, which needs its own in this case. + + + + + +-------------------------------------------------------------------- +USERD_get_number_of_variables + + Description: + ----------- + Get the number of variables for which you will be providing info. + + Specification: + ------------- + int USERD_get_number_of_variables( void ) + + Returns: + ------- + Number of variables (includes constant, scalar, vector and tensor types) + (>=0 if okay, <0 if problem) + + Arguments: + --------- + none + + Notes: + ----- + ***************************************************************** + * Variable numbers, by which references will be made, are implied + here. If you say there are 3 variables, the variable numbers + will be 1, 2, and 3. + ***************************************************************** + + * Num_variables would be set here + + + +-------------------------------------------------------------------- +USERD_get_part_coords + + Description: + ----------- + Gets the coordinates for an unstructured part. + + Specification: + ------------- + int USERD_get_part_coords(int part_number, float **coord_array) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) part_number = The part number + (1-based index of part table, namely: + + 1 ... Numparts_available. + + It is NOT the part_id that + is loaded in USERD_get_gold_part_build_info) + + (OUT) coord_array = 2D float array which contains, + x,y,z coordinates of each node + in the part. + + (IMPORTANT: The second dimension of this aray is 1-based!!!) + + (Array will have been allocated + 3 by (number_of_nodes + 1) for the part + long - see USERD_get_gold_part_build_info) + + + ex) If number_of_nodes = 100 + as obtained in: + USERD_get_gold_part_build_info + + Then the allocated dimensions of the + pointer sent to this routine will be: + coord_array[3][101] + + Ignore the coord_array[0][0] + coord_array[1][0] + coord_array[2][0] locations and start + the node coordinates at: + coord_array[0][1] + coord_array[1][1] + coord_array[2][1] + + coord_array[0][2] + coord_array[1][2] + coord_array[2][2] + + etc. + + Notes: + ----- + * Not called unless Num_unstructured_parts is > 0 + + * Will be based on Current_time_step + + +-------------------------------------------------------------------- +USERD_get_part_element_ids_by_type + + Description: + ----------- + Gets the ids for the elements of a particular type for an unstructured + or structured part. + + Specification: + ------------- + int USERD_get_part_element_ids_by_type(int part_number, + int element_type, + int *elemid_array) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) part_number = The part number + (1-based index of part table, namely: + + 1 ... Numparts_available. + + It is NOT the part_id that + is loaded in USERD_get_gold_part_build_info) + + (IN) element_type = One of the following (See global_extern.h) + Z_POINT node point element + Z_BAR02 2 node bar + Z_BAR03 3 node bar + Z_TRI03 3 node triangle + Z_TRI06 6 node triangle + Z_QUA04 4 node quad + Z_QUA08 8 node quad + Z_TET04 4 node tetrahedron + Z_TET10 10 node tetrahedron + Z_PYR05 5 node pyramid + Z_PYR13 13 node pyramid + Z_PEN06 6 node pentahedron + Z_PEN15 15 node pentahedron + Z_HEX08 8 node hexahedron + Z_HEX20 20 node hexahedron + + Z_G_POINT ghost node point element + Z_G_BAR02 2 node ghost bar + Z_G_BAR03 3 node ghost bar + Z_G_TRI03 3 node ghost triangle + Z_G_TRI06 6 node ghost triangle + Z_G_QUA04 4 node ghost quad + Z_G_QUA08 8 node ghost quad + Z_G_TET04 4 node ghost tetrahedron + Z_G_TET10 10 node ghost tetrahedron + Z_G_PYR05 5 node ghost pyramid + Z_G_PYR13 13 node ghost pyramid + Z_G_PEN06 6 node ghost pentahedron + Z_G_PEN15 15 node ghost pentahedron + Z_G_HEX08 8 node ghost hexahedron + Z_G_HEX20 20 node ghost hexahedron + + (OUT) elemid_array = 1D array containing id of each + element of the type. + + (Array will have been allocated + number_of_elements of the type long) + + ex) If number_of_elements[Z_TRI03] = 25 + number_of_elements[Z_QUA04] = 100 + number_of_elements[Z_HEX08] = 30 + as obtained in: + USERD_get_gold_part_build_info + + Then the allocated dimensions available + for this routine will be: + conn_array[25] when called with Z_TRI03 + + conn_array[100] when called with Z_QUA04 + + conn_array[30] when called with Z_HEX08 + + Notes: + ----- + * Not called unless element label status is set to TRUE in + USERD_get_element_label_status + + * Will be based on Current_time_step + + + +-------------------------------------------------------------------- +USERD_get_part_elements_by_type + + Description: + ----------- + Gets the connectivities for the elements of a particular type in an + unstructured part + + Specification: + ------------- + int USERD_get_part_elements_by_type(int part_number, + int element_type, + int **conn_array) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) part_number = The part number + (1-based index of part table, namely: + + 1 ... Numparts_available. + + It is NOT the part_id that + is loaded in USERD_get_gold_part_build_info) + + (IN) element_type = One of the following (See global_extern.h) + Z_POINT node point element + Z_BAR02 2 node bar + Z_BAR03 3 node bar + Z_TRI03 3 node triangle + Z_TRI06 6 node triangle + Z_QUA04 4 node quad + Z_QUA08 8 node quad + Z_TET04 4 node tetrahedron + Z_TET10 10 node tetrahedron + Z_PYR05 5 node pyramid + Z_PYR13 13 node pyramid + Z_PEN06 6 node pentahedron + Z_PEN15 15 node pentahedron + Z_HEX08 8 node hexahedron + Z_HEX20 20 node hexahedron + + Z_G_POINT ghost node point element + Z_G_BAR02 2 node ghost bar + Z_G_BAR03 3 node ghost bar + Z_G_TRI03 3 node ghost triangle + Z_G_TRI06 6 node ghost triangle + Z_G_QUA04 4 node ghost quad + Z_G_QUA08 8 node ghost quad + Z_G_TET04 4 node ghost tetrahedron + Z_G_TET10 10 node ghost tetrahedron + Z_G_PYR05 5 node ghost pyramid + Z_G_PYR13 13 node ghost pyramid + Z_G_PEN06 6 node ghost pentahedron + Z_G_PEN15 15 node ghost pentahedron + Z_G_HEX08 8 node ghost hexahedron + Z_G_HEX20 20 node ghost hexahedron + + + (OUT) conn_array = 2D array containing connectivity + of each element of the type. + + (Array will have been allocated + num_of_elements of the type by + connectivity length of the type) + + ex) If number_of_elements[Z_TRI03] = 25 + number_of_elements[Z_QUA04] = 100 + number_of_elements[Z_HEX08] = 30 + as obtained in: + USERD_get_gold_part_build_info + + Then the allocated dimensions available + for this routine will be: + conn_array[25][3] when called with Z_TRI03 + + conn_array[100][4] when called with Z_QUA04 + + conn_array[30][8] when called with Z_HEX08 + + Notes: + ----- + * Not called unless Num_unstructured_parts is > 0 + + * Will be based on Current_time_step + + +-------------------------------------------------------------------- +USERD_get_part_node_ids + + Description: + ----------- + Gets the node ids of an unstructured or structured part. + + Specification: + ------------- + int USERD_get_part_node_ids(int part_number, int *nodeid_array) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) part_number = The part number + (1-based index of part table, namely: + + 1 ... Numparts_available. + + It is NOT the part_id that + is loaded in USERD_get_gold_part_build_info) + + (OUT) nodeid_array = 1D array containing node ids of + each node in the part. + + (IMPORTANT: This array is 1-based!!!) + + (Array will have been allocated + (number_of_nodes + 1) for the part long + see USERD_get_gold_part_build_info) + + ex) If number_of_nodes = 100 + as obtained in: + USERD_get_gold_part_build_info + + Then the allocated dimensions of the + pointer sent to this routine will be: + nodeid_array[101] + + Ignore the nodeid_array[0] location and start + the node ids at: + nodeid_array[1] + + nodeid_array[2] + + etc. + + Notes: + ----- + * Not called unless node label status is TRUE, as returned from + USERD_get_node_label_status + + * Will be based on Current_time_step + + * The ids are purely labels, used when displaying or querying node ids. + However, any node id < 0 will never be displayed + + +-------------------------------------------------------------------- +USERD_get_reader_descrip + + Description: + ----------- + Gets the description of the reader, so gui can give more info + + Specification: + ------------- + int USERD_get_reader_descrip(char descrip[Z_MAXFILENP]) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (OUT) descrip = the description of the reader (max length is MAXFILENP, + which is 255) + + Notes: + ----- + * OPTIONAL ROUTINE! You can have it or not. + + + +-------------------------------------------------------------------- +USERD_get_reader_version + + Description: + ----------- + Gets the version number of the user defined reader + + Specification: + ------------- + int USERD_get_reader_version(char version_number[Z_MAX_USERD_NAME]) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful (and will assume is version 1.0) + + Arguments: + --------- + (OUT) version_number = the version number of the reader + (max length is Z_MAX_USERD_NAME, which + is 20) + + Notes: + ----- + * This needs to be "2.000" or greater. Otherwise EnSight will assume + this reader is API 1.0 + + * should set it to "2.010" for this version of the API + + + + +-------------------------------------------------------------------- +USERD_get_sol_times + + Description: + ----------- + Get the solution times associated with each time step for + desired timeset. + + Specification: + ------------- + int USERD_get_sol_times(int timeset_number, + float *solution_times) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) timeset_number = the timeset number + + For example: If USERD_get_number_of_timesets + returns 2, the valid + timeset_number's would be 1 and 2 + + (OUT) solution_times = 1D array of solution times per time step + + (Array will have been allocated + Num_time_steps[timeset_number] long) + + Notes: + ----- + * The solution times must be non-negative and increasing. + + + +-------------------------------------------------------------------- +USERD_get_timeset_description - + + Description: + ----------- + Get the description to associate with the desired timeset. + + Specification: + ------------- + int USERD_get_timeset_description(int timeset_number, + char timeset_description[Z_BUFL]) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) timeset_number = the timeset number + + For example: If USERD_get_number_of_timesets + returns 2, the valid + timeset_number's would be 1 and 2 + + (OUT) timeset_description = timeset description string + + + Notes: + ----- + * A string of NULLs is valid for timeset_description + + + + +-------------------------------------------------------------------- +USERD_get_var_by_component + + Description: + ----------- + Gets the values of a variable component. Both unstructured and structured + parts use this routine. + + if Z_PER_NODE: + Get the component value at each node for a given variable in the part. + + or if Z_PER_ELEM: + Get the component value at each element of a specific part and type + for a given variable. + + Specification: + ------------- + int USERD_get_var_by_component(int which_variable, + int which_part, + int var_type, + int which_type, + int imag_data, + int component, + float *var_array) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + or: Z_UNDEF, in which case you need not load any values into var_array + + + Arguments: + --------- + (IN) which_variable = The variable number + + (IN) which_part Since EnSight Version 7.4 + ------------------------- + = The part number + + (1-based index of part table, namely: + + 1 ... Numparts_available. + + It is NOT the part_id that + is loaded in USERD_get_gold_part_build_info) + + Prior to EnSight Version 7.4 + ---------------------------- + = The part id This is the part_id label loaded + in USERD_get_gold_part_build_info. + It is NOT the part table index. + + (IN) var_type = Z_SCALAR + Z_VECTOR + Z_TENSOR (symmetric tensor) + Z_TENSOR9 (asymmetric tensor) + + (IN) which_type + + if Z_PER_NODE: Not used + + if Z_PER_ELEM: = The element type + Z_POINT node point element + Z_BAR02 2 node bar + Z_BAR03 3 node bar + Z_TRI03 3 node triangle + Z_TRI06 6 node triangle + Z_QUA04 4 node quad + Z_QUA08 8 node quad + Z_TET04 4 node tetrahedron + Z_TET10 10 node tetrahedron + Z_PYR05 5 node pyramid + Z_PYR13 13 node pyramid + Z_PEN06 6 node pentahedron + Z_PEN15 15 node pentahedron + Z_HEX08 8 node hexahedron + Z_HEX20 20 node hexahedron + + Z_G_POINT ghost node point element + Z_G_BAR02 2 node ghost bar + Z_G_BAR03 3 node ghost bar + Z_G_TRI03 3 node ghost triangle + Z_G_TRI06 6 node ghost triangle + Z_G_QUA04 4 node ghost quad + Z_G_QUA08 8 node ghost quad + Z_G_TET04 4 node ghost tetrahedron + Z_G_TET10 10 node ghost tetrahedron + Z_G_PYR05 5 node ghost pyramid + Z_G_PYR13 13 node ghost pyramid + Z_G_PEN06 6 node ghost pentahedron + Z_G_PEN15 15 node ghost pentahedron + Z_G_HEX08 8 node ghost hexahedron + Z_G_HEX20 20 node ghost hexahedron + + (IN) imag_data = TRUE if imag component + FALSE if real component + + (IN) component = The component: (0 if Z_SCALAR) + (0 - 2 if Z_VECTOR) + (0 - 5 if Z_TENSOR) + (0 - 8 if Z_TENSOR9) + + * 6 Symmetric Indicies, 0:5 * + * ---------------------------- * + * | 11 12 13 | | 0 3 4 | * + * | | | | * + * T = | 22 23 | = | 1 5 | * + * | | | | * + * | 33 | | 2 | * + + + * 9 General Indicies, 0:8 * + * ---------------------------- * + * | 11 12 13 | | 0 3 4 | * + * | | | | * + * T = | 21 22 23 | = | 6 1 5 | * + * | | | | * + * | 31 32 33 | | 7 8 2 | * + + (OUT) var_array + + ----------------------------------------------------------------------- + (IMPORTANT: this array is 1-based for both Z_PER_NODE and Z_PER_ELEM!!!) + ----------------------------------------------------------------------- + + if Z_PER_NODE: = 1D array containing variable component value + for each node. + + (Array will have been allocated + (number_of_nodes + 1) long) + + Info stored in this fashion: + var_array[0] = not used + var_array[1] = var component for node 1 of part + var_array[2] = var_component for node 2 of part + var_array[3] = var_component for node 3 of part + etc. + + if Z_PER_ELEM: = 1D array containing variable component + value for each element of a particular + part and type. + + (Array will have been allocated + (number_of_elements[which_part][which_type] + 1) + long. See USERD_get_gold_part_build_info) + + Info stored in this fashion: + var_array[1] = var component for elem 1 (of part and type) + var_array[2] = var component for elem 2 (of part and type) + var_array[3] = var component for elem 3 (of part and type) + etc. + + Notes: + ----- + * Not called unless Num_variables is > 0 + + * The per_node or per_elem classification must be obtainable from the + variable number (a var_classify array needs to be retained) + + * Will be based on Current_time_step + + * If the variable is not defined for this part, simply return with a + value of Z_UNDEF. EnSight will treat the variable as undefined for + this part. + + +-------------------------------------------------------------------- +USERD_get_var_value_at_specific + + Description: + ----------- + if Z_PER_NODE: + Get the value of a particular variable at a particular node in a + particular part at a particular time. + + or if Z_PER_ELEM: + Get the value of a particular variable at a particular element of + a particular type in a particular part at a particular time. + + + Specification: + ------------- + int USERD_get_var_value_at_specific(int which_var, + int which_node_or_elem, + int which_part, + int which_elem_type, + int time_step, + float values[3], + int imag_data) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) which_var = The variable number + + (IN) which_node_or_elem + + If Z_PER_NODE: + = The node number. This is not the id, but is + the index of the global node + list (1 based), or the block's + node list (1 based). + + Thus, coord_array[1] + coord_array[2] + coord_array[3] + . | + . |which_node_or_elem index + . ---- + + + If Z_PER_ELEM: + = The element number. This is not the id, but is + the element number index + of the number_of_element array + (see USERD_get_gold_part_build_info), + or the block's element list (1 based). + + Thus, for which_part: + conn_array[which_elem_type][0] + conn_array[which_elem_type][1] + conn_array[which_elem_type][2] + . | + . which_node_or_elem index + . ---- + + + (IN) which_part Since EnSight Version 7.4 + ------------------------- + = The part number + + (1-based index of part table, namely: + + 1 ... Numparts_available. + + It is NOT the part_id that + is loaded in USERD_get_gold_part_build_info) + + Prior to EnSight Version 7.4 + ---------------------------- + = The part id This is the part_id label loaded + in USERD_get_gold_part_build_info. + It is NOT the part table index. + + + (IN) which_elem_type + + If Z_PER_NODE, or block part: + = Not used + + If Z_PER_ELEM: + = The element type. This is the element type index + of the number_of_element array + (see USERD_get_gold_part_build_info) + + (IN) time_step = The time step + + (IN) imag_data = TRUE if want imaginary value. + FALSE if want real value. + + (OUT) values = scalar or vector component value(s) + values[0] = scalar or vector[0] + values[1] = vector[1] + values[2] = vector[2] + + + Notes: + ----- + * This routine is used in node querys over time (or element querys over + time for Z_PER_ELEM variables). If these operations are not critical + to you, this can be a dummy routine. + + * The per_node or per_elem classification must be obtainable from the + variable number (a var_classify array needs to be retained) + + * The time step given is for the proper variable timeset. + + +---------------------------------------------------------------------- +USERD_load_matf_data + + Description: + ----------- + Get the material id list, mixed-material id list, or + mixed-material values list for the given material set and part (and + element type if material id list) + + Specification: + ------------- + int USERD_load_matf_data( int set_index, + int part_id, + int wtyp, + int mat_type, + int *ids_list, + float *val_list) + + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) set_index = the material set index (zero based) + + (IN) part_id = the part number desired + + (IN) wtyp = the element type (used for Z_MAT_INDEX only) + + Z_POINT node point element + Z_BAR02 2 node bar + Z_BAR03 3 node bar + Z_TRI03 3 node triangle + Z_TRI06 6 node triangle + Z_QUA04 4 node quad + Z_QUA08 8 node quad + Z_TET04 4 node tetrahedron + Z_TET10 10 node tetrahedron + Z_PYR05 5 node pyramid + Z_PYR13 13 node pyramid + Z_PEN06 6 node pentahedron + Z_PEN15 15 node pentahedron + Z_HEX08 8 node hexahedron + Z_HEX20 20 node hexahedron + Z_NSIDED nsided polygon + Z_NFACED nfaced polyhedron + + Z_G_POINT ghost node point element + Z_G_BAR02 2 node ghost bar + Z_G_BAR03 3 node ghost bar + Z_G_TRI03 3 node ghost triangle + Z_G_TRI06 6 node ghost triangle + Z_G_QUA04 4 node ghost quad + Z_G_QUA08 8 node ghost quad + Z_G_TET04 4 node ghost tetrahedron + Z_G_TET10 10 node ghost tetrahedron + Z_G_PYR05 5 node ghost pyramid + Z_G_PYR13 13 node ghost pyramid + Z_G_PEN06 6 node ghost pentahedron + Z_G_PEN15 15 node ghost pentahedron + Z_G_HEX08 8 node ghost hexahedron + Z_G_HEX20 20 node ghost hexahedron + Z_G_NSIDED ghost nsided polygon + Z_G_NFACED ghost nfaced polyhedron + + (IN) mat_type = Z_MAT_INDEX for material ids list + Z_MIX_INDEX for mixed-material ids list + Z_MIX_VALUE for mixed-material values list + + (OUT) ids_list = If mat_type is Z_MAT_INDEX: + --------------------------- + 1D material id list + (Int array will have been allocated + the appropriate size, as returned in + USERD_size_matf_data for mat_type Z_MAT_INDEX) + + If mat_type is Z_MIX_INDEX: + --------------------------- + 1D mixed-material id list + (Int array will have been allocated + the appropriate size, as returned in + USERD_size_matf_data for mat_type Z_MIX_INDEX) + + (OUT) val_list = 1D mixed-materials values list + (only used if mat_type is Z_MIX_VALUE) + + (Float array will have been allocated + the appropriate size, as returned in + USERD_size_matf_data for mat_type Z_MIX_VALUE) + + Notes: + ----- + * See USERD_get_number_of_material_sets header for explanatory example + * Will not be called if Num_material_sets is zero, + or Num_materials[set_index] is zero, + or the appropriate size from USERD_size_matf_data is zero + + + +-------------------------------------------------------------------- +USERD_set_filenames + + Description: + ----------- + Receives the geometry and result filenames entered in the data + dialog. The user written code will have to store and use these + as needed. The user written code must manage its own files!! + + Specification: + ------------- + int USERD_set_filenames(char filename_1[], + char filename_2[], + char the_path[], + int swapbytes) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) filename_1 = the filename entered into the geometry + field of the data dialog. + + (IN) param_2 = The usage of this string depends on + 'two_fields' in USERD_get_name_of_reader. + + If two_fields is FALSE then it's empty. + + If two_fields is TRUE, this is the + manditory results file entered + into the result field of the data dialog. + + If two_fields is -1, then this contains + optional text (filenames, modifiers, etc.) + that can be parsed and used to modify + reader + + (IN) the_path = the path info from the data dialog. + Note: filename_1 and filename_2 have already + had the path prepended to them. This + is provided in case it is needed for + filenames contained in one of the files + + (IN) swapbytes = TRUE if should swap bytes when reading data. + = FALSE normally. + + Notes: + ----- + * Since you must manage everything from the input that is entered in + these data dialog fields, this is an important routine! + + * It may be that you will need to have an executive type file that contains + info and other filenames within it, like EnSight6's case file. + + +-------------------------------------------------------------------- +USERD_set_server_number + + Description: + ----------- + Receives the server number of how many total servers. + + Specification: + ------------- + int USERD_set_server_number(int cur_serv, + int tot_servs) + + Returns: + ------- + nothing + + Arguments: + --------- + (IN) cur_serv = the current server. + + (IN) tot_servs = the total number of servers. + + Notes: + ----- + * Only useful if your user defined reader is being used with EnSight's + Server-of-Server capability. And even then, it may or may not be + something that you can take advantage of. If your data is already + partitioned in some manner, such that you can access the proper + portions using this information. + + For all non-SOS uses, this will simply be 1 of 1 + + + +-------------------------------------------------------------------- +USERD_set_time_set_and_step + + Description: + ----------- + Set the current time step in the desired timeset. All functions that + need time, and that do not explicitly pass it in, will use the timeset + and step set by this routine, if needed. + + Specification: + ------------- + void USERD_set_time_set_and_step(int timeset_number, + int time_step) + + Returns: + ------- + nothing + + Arguments: + --------- + (IN) timeset_number = the timeset number (1 based). + + For example: If USERD_get_number_of_timesets + returns 2, the valid timeset_number's + would be 1 and 2. + + (IN) time_step = The current time step to set + + Notes: + ----- + * Current_time_step and Current_timeset would be set here + + +-------------------------------------------------------------------- +USERD_size_matf_data + + Description: + ----------- + Get the length of the material id list, mixed-material id list, or + mixed-material values list for the given material set and part (and + element type if material id list) + + Specification: + ------------- + int USERD_size_matf_data( int set_index, + int part_id, + int wtyp, + int mat_type, + int *matf_size) + + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) set_index = the material set index (zero based) + + (IN) part_id = the part number desired + + (IN) wtyp = the element type (used for Z_MAT_INDEX only) + + Z_POINT node point element + Z_BAR02 2 node bar + Z_BAR03 3 node bar + Z_TRI03 3 node triangle + Z_TRI06 6 node triangle + Z_QUA04 4 node quad + Z_QUA08 8 node quad + Z_TET04 4 node tetrahedron + Z_TET10 10 node tetrahedron + Z_PYR05 5 node pyramid + Z_PYR13 13 node pyramid + Z_PEN06 6 node pentahedron + Z_PEN15 15 node pentahedron + Z_HEX08 8 node hexahedron + Z_HEX20 20 node hexahedron + Z_NSIDED nsided polygon + Z_NFACED nfaced polyhedron + + Z_G_POINT ghost node point element + Z_G_BAR02 2 node ghost bar + Z_G_BAR03 3 node ghost bar + Z_G_TRI03 3 node ghost triangle + Z_G_TRI06 6 node ghost triangle + Z_G_QUA04 4 node ghost quad + Z_G_QUA08 8 node ghost quad + Z_G_TET04 4 node ghost tetrahedron + Z_G_TET10 10 node ghost tetrahedron + Z_G_PYR05 5 node ghost pyramid + Z_G_PYR13 13 node ghost pyramid + Z_G_PEN06 6 node ghost pentahedron + Z_G_PEN15 15 node ghost pentahedron + Z_G_HEX08 8 node ghost hexahedron + Z_G_HEX20 20 node ghost hexahedron + Z_G_NSIDED ghost nsided polygon + Z_G_NFACED ghost nfaced polyhedron + + (IN) mat_type = Z_MAT_INDEX for material ids list + Z_MIX_INDEX for mixed-material ids list + Z_MIX_VALUE for mixed-material values list + + (OUT) matf_size = the length of the material id list, or + mixed-material id list, or + mixed-material values list + for the given material set and part number + (and element type if Z_MAT_INDEX) + + Notes: + ----- + * See USERD_get_number_of_material_sets header for explanatory example + * Will not be called if Num_material_sets is zero, or + Num_materials[set_index] is zero + + + + +-------------------------------------------------------------------- +USERD_stop_part_building + + Description: + ----------- + This routine called when the part building dialog is closed. It is + provided in case you desire to release memory, etc. that was only needed + during the part building process. + + Specification: + ------------- + void USERD_stop_part_building( void ) + + Returns: + ------- + nothing + + Arguments: + --------- + none + + Notes: + ----- + +-------------------------------------------------------------------- +USERD_rigidbody_existence + + Description: + ----------- + Gets the existence of rigid body values or not in the model + + Specification: + ------------- + int USERD_rigidbody_existence( void ) + + Returns: + ------- + Z_OK if rigid body values exist for the model + Z_UNDEF if no rigid body values exist + Z_ERR if an error + + Arguments: + --------- + none + + Notes: + ----- + * This will be based on Current_time_step + + +-------------------------------------------------------------------- +USERD_rigidbody_values + + Description: + ----------- + Gets the rigid body values for each part + + Specification: + ------------- + int USERD_rigidbody_values(int part_number, + float values[7]) + + Returns: + ------- + Z_OK if rigid body values exist for the model + Z_UNDEF if no rigid body values exist + Z_ERR if an error + + Arguments: + --------- + (IN) part_number = The part number + + (1-based index of part table, namely: + + 1 ... Numparts_available. + + It is NOT the part_id that + is loaded in USERD_get_gold_part_build_info) + + (OUT) values values[0] = IX (x location) + values[1] = IY (y location) + values[2] = IZ (z location) + values[3] = E0 (e0 euler value) + values[4] = E1 (e1 euler value) + values[5] = E2 (e2 euler value) + values[6] = E3 (e3 euler value) + + + Notes: + ----- + * This will be based on Current_time_step + * It will not be called unless USERD_rigidbody_existence indicates + that there are some values in the model by returning Z_OK. + + +-------------------------------------------------------------------- +USERD_set_right_side + + Description: + ----------- + Informs the reader that the time currently set is the right side of a time + span used for variable interpolation between time steps + + Specification: + ------------- + void USERD_set_right_side( void ) + + Returns: + ------- + + Arguments: + --------- + none + + Notes: + ----- + * Applies to Current_time_step + + + + + +------------------------------------------------------------------ + ENHANCED GUI ROUTINES + +-------------------------------------------------------------------- +USERD_get_extra_gui_numbers + + Description: + ----------- + The Enhanced GUI routines are added to allow + the user to customize a portion of the Data + Reader dialog to pass in options to their + user defined reader. + + Specification: + ------------- + void USERD__get_extra_gui_numbers(int *num_Toggles, + int *num_pulldowns, + int *num_fields) + + Returns: + ------- + + Arguments: + --------- + (OUT) num_Toggles = number of toggles that will be provided + + num_pulldowns = number of pulldowns that will be provided + + num_fields = number of fields that will be provided + + Notes: + ----- + There are three routines that work together: + USERD_get_extra_gui_numbers + USERD_get_extra_gui_defaults + USERD_set_extra_gui_data + + The existence of these routine indicates that + you wish to add customize entries to the + Data Reader dialog. + + If you don't want the extra GUI features, + simply delete these routines, or change their + names to something such as + USERD_DISABLED_get_extra_gui_defaults + + The presence of these routines + will ensure that EnSight will call them and + use their data to modify the extraction parameters set + with some or all of the following: + toggles, pulldown menu and fields. + + The user can then interact with the enhanced + GUI and then send their choices to + USERD_set_extra_gui_data + + Therefore if USERD_get_extra_gui_numbers + exists then the other two must exist. + + If none exist, then the GUI will be unchanged. + + Toggle data will return an integer + TRUE if checked + FALSE if unchecked + + Pulldown menu will return an integer representing + the menu item selected + + Field will return a string Z_LEN_GUI_FIELD_STR long. + + If all the enhanced GUI features are enabled it + might look something like this + + =================================================== + [] Title 1 [X] Title 3 + [X]Title 2 [X] Title 4 + + Pulldown Menu -> + Menu Choice 1 + Menu Choice 2 + Menu Choice 3 + + Data Field Title 1 ____________________________ + + Data Field Title 2 ____________________________ + ===================================================== + + This routine defines the numbers of toggles, pulldowns & fields + + The following are defined in the global_extern.h + Z_MAX_NUM_GUI_PULL_ITEMS max num GUI pulldowns + Z_LEN_GUI_PULL_STR max length of GUI pulldown string + Z_LEN_GUI_FIELD_STR max length of field string + Z_LEN_GUI_TITLE_STR max length of title string + + The library is loaded, this routine is + called, then the library is unloaded. + + Do not define globals in this routine + as when the library is unloaded, you'll + lose them. + + +-------------------------------------------------------------------- +USERD_get_extra_gui_defaults + + Description: + ----------- + This routine defines the Titles, status, + List choices, strings, etc that are fed + up to the GUI. + + Specification: + ------------- + int USERD_get_extra_gui_defaults(char **toggle_Title, + int *toggle_default_status, + char **pulldown_Title, + int *pulldown_number_in_list, + int *pulldown_default_selection, + char ***pulldown_item_strings, + char **field_Title, + char **field_user_string) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (OUT) toggle_Title = title for each toggle + array dimension is [num_toggles] by + [Z_LEN_GUI_TITLE_STR] long + + toggle_default_status = Setting for each toggle (TRUE or FALSE) + array dimension is [num_toggles] long + + pulldown_Title = title for each pulldown + array dimension is [num_pulldowns] by + [Z_LEN_GUI_TITLE_STR] long + + pulldown_number_in_list = number of items in each pulldown + array dimension is [num_pulldowns] long + + pulldown_default_selection = pulldown item selection for each pulldown + array dimension is [num_pulldowns] long + + pulldown_item_strings = pulldown item strings + array is [num_pulldowns] by + [Z_MAX_NUM_GUI_PULL_ITEMS] by + [Z_LEN_GUI_PULL_STR] long + + field_Title = title for each field + array dimension is [num_fields] by + [Z_LEN_GUI_TITLE_STR] long + + field_user_string = content of the field + array dimension is [num_fields] by + [Z_LEN_GUI_TITLE_STR] long + + + + Notes: + ----- + * The library is loaded, this routine is called, then the library is unloaded. + + * Do not define globals in this routine as when the library is unloaded, you'll + lose them. + + + +-------------------------------------------------------------------- +USERD_set_extra_gui_data + + Description: + ----------- + This routine sets the new values for the toggles, pulldowns, and fields. + + Specification: + ------------- + void USERD_set_extra_gui_data( + int *toggle, /* [num_toggle] */ + int *pulldown, /* [num_pulldown] */ + char **field_text /* [num_fields][Z_LEN_GUI_FIELD_STR]*/) + + Returns: + ------- + + Arguments: + --------- + (IN) toggle = setting for each toggle. TRUE or FALSE + array dimension is [num_toggles] long + + pulldown = item chosen in each pulldown. (0 based) + array dimension is [num_pulldowns] long + + field_text = content of the field + array dimension is [num_fields] by + [Z_LEN_GUI_TITLE_STR] long + + + Notes: + ----- + * This routine is called when the library is permanently + loaded to the EnSight session, so define your globals + in this and later routines. + + * It's up to you to change your reader behavior according to + user entries! + + + +-------------------------------------------------------------------- +USERD_get_var_extract_gui_numbers + + Description: + ----------- + The Var_Extract_GUI routines are added to allow + the user to customize a extraction parameters + for variables "after" the file has been read. + These things can be modified and the variables will + be update/refreshed according to the new parameters set + + Specification: + ------------- + void USERD_get_var_extract_gui_numbers(int *num_Toggles, + int *num_pulldowns, + int *num_fields) + + + Returns: + ------- + + Arguments: + --------- + (OUT) num_Toggles = number of toggles that will be provided + + num_pulldowns = number of pulldowns that will be provided + + num_fields = number of fields that will be provided + + Notes: + ----- + There are three routines that work together: + USERD_get_var_extract_gui_numbers + USERD_get_var_extract_gui_defaults (this one) + USERD_set_var_extract_gui_data + + The existence of these routine indicates that + you wish to have the Var Extract Parameters dialog. + + If you don't want the extra GUI features, + simply delete these routines, or change their + names to something such as + USERD_DISABLED_get_var_extract_gui_defaults + + The presence of these routines + will ensure that EnSight will call them and + use their data to modify the extraction parameters set + with some or all of the following: + toggles, pulldown menu and fields. + + The user can then interact with the enhanced + GUI and then send their choices to + USERD_set_extra_gui_data + + Therefore if USERD_get_var_extract_gui_numbers + exists then the other two must exist. + + If none exist, then the GUI will be unchanged. + + Toggle data will return an integer + TRUE if checked + FALSE if unchecked + + Pulldown menu will return an integer representing + the menu item selected + + Field will return a string Z_LEN_GUI_FIELD_STR long. + + If all the enhanced GUI features are enabled it + might look something like this + + =================================================== + [] Title 1 [X] Title 3 + [X]Title 2 [X] Title 4 + + Pulldown Menu -> + Menu Choice 1 + Menu Choice 2 + Menu Choice 3 + + Data Field Title 1 ____________________________ + + Data Field Title 2 ____________________________ + ===================================================== + + This routine defines the numbers of toggles, pulldowns & fields + + The following are defined in the global_extern.h + Z_MAX_NUM_GUI_PULL_ITEMS max num GUI pulldowns + Z_LEN_GUI_PULL_STR max length of GUI pulldown string + Z_LEN_GUI_FIELD_STR max length of field string + Z_LEN_GUI_TITLE_STR max length of title string + + The library is loaded, this routine is + called, then the library is unloaded. + + Do not define globals in this routine + as when the library is unloaded, you'll + lose them. + + +-------------------------------------------------------------------- +USERD_get_var_extract_gui_defaults + + Description: + ----------- + This routine defines the Titles, status, + List choices, strings, etc that are fed + up to the GUI. + + Specification: + ------------- + int USERD_get_var_extract_gui_defaults(char **toggle_Title, + int *toggle_default_status, + char **pulldown_Title, + int *pulldown_number_in_list, + int *pulldown_default_selection, + char ***pulldown_item_strings, + char **field_Title, + char **field_user_string) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (OUT) toggle_Title = title for each toggle + array dimension is [num_toggles] by + [Z_LEN_GUI_TITLE_STR] long + + toggle_default_status = Setting for each toggle (TRUE or FALSE) + array dimension is [num_toggles] long + + pulldown_Title = title for each pulldown + array dimension is [num_pulldowns] by + [Z_LEN_GUI_TITLE_STR] long + + pulldown_number_in_list = number of items in each pulldown + array dimension is [num_pulldowns] long + + pulldown_default_selection = pulldown item selection for each pulldown + array dimension is [num_pulldowns] long + + pulldown_item_strings = pulldown item strings + array is [num_pulldowns] by + [Z_MAX_NUM_GUI_PULL_ITEMS] by + [Z_LEN_GUI_PULL_STR] long + + field_Title = title for each field + array dimension is [num_fields] by + [Z_LEN_GUI_TITLE_STR] long + + field_user_string = content of the field + array dimension is [num_fields] by + [Z_LEN_GUI_TITLE_STR] long + + + + Notes: + ----- + * The library is loaded, this routine is called, then the library is unloaded. + + * Do not define globals in this routine as when the library is unloaded, you'll + lose them. + + + +-------------------------------------------------------------------- +USERD_set_var_extract_gui_data + + Description: + ----------- + This routine sets the new values for the toggles, pulldowns, and fields. + + Specification: + ------------- + void USERD_set_var_extract_gui_data( + int *toggle, /* [num_toggle] */ + int *pulldown, /* [num_pulldown] */ + char **field_text /* [num_fields][Z_LEN_GUI_FIELD_STR]*/) + + Returns: + ------- + + Arguments: + --------- + (IN) toggle = setting for each toggle. TRUE or FALSE + array dimension is [num_toggles] long + + pulldown = item chosen in each pulldown. (0 based) + array dimension is [num_pulldowns] long + + field_text = content of the field + array dimension is [num_fields] by + [Z_LEN_GUI_TITLE_STR] long + + + Notes: + ----- + * This routine is called when the library is permanently + loaded to the EnSight session, so define your globals + in this and later routines. + + * It's up to you to change your reader behavior according to + user entries! + + + + + +----------------------------------------------------------------------------------- +/* ---------------------------------------------------------- + * New in EnSight 8 is the capability to remove (fail) elements + * based on variable threshold values. Basically the variable + * name, a couple of thresholds, a couple of values and a logic + * criteria are read in from this routine. Every element that + * satisfies the failure criteria is removed and not used in + * EnSight calculations. + * + * Example Failure criteria + * Let fail_var_name = "fail_flag" + * threshold_val1 = 0 + * threshold_operator1 = Z_EQUAL_TO + * logic_criteria2 not used + * threshold_val2 not used + * threshold_operator2 not used + * For each value of "fail_flag" at each element, + * if fail flag == threshold_val1 (0.0) then element fails + * Return (Z_ERR) if this is not used. + * Return (Z_OK) if failed element feature should be used + * + * threshold_operator1 & 2 can be one of the following + * Z_ELE_FAILED_NONE, - disables checking + * Z_ELE_FAILED_GREATER, - greater than + * Z_ELE_FAILED_LESS, - less than + * Z_ELE_FAILED_EQUAL, - equal + * Z_ELE_FAILED_NOT_EQUAL, - not equal + * Z_ELE_FAILED_MANY - not used + * + * logic_criteria2 + * Z_ELE_FAILED_LOGIC_NONE, + * Z_ELE_FAILED_LOGIC_AND, + * Z_ELE_FAILED_LOGIC_OR, + * Z_ELE_FAILED_LOGIC_MANY + * + * ---------------------------------------------------------- */ +int USERD_get_uns_failed_params( + char *fail_var_name, /* variable name to be used in failure + must be scalar, per elem */ + float *threshold_val1, /* number to compare for failure */ + float *threshold_val2, /* number to compare for failure */ + int *threshold_operator1, /* Z_GREATER_THAN, Z_LESS_THAN, + Z_EQUAL_TO */ + int *threshold_operator2, /* Z_GREATER_THAN, Z_LESS_THAN, + Z_EQUAL_TO */ + int *logic_criteria2 + + + + +---- end of document ---- diff --git a/applications/utilities/postProcessing/graphics/ensightFoamReader/README_USERD_2.06 b/applications/utilities/postProcessing/graphics/ensightFoamReader/README_USERD_2.06 new file mode 100644 index 0000000000..88c4955c81 --- /dev/null +++ b/applications/utilities/postProcessing/graphics/ensightFoamReader/README_USERD_2.06 @@ -0,0 +1,4603 @@ +README_USERD_2.06 +================= +-------------------------------------- +EnSight User Defined Reader Capability ===> (API 2.06) +-------------------------------------- +A user defined reader capability is included in EnSight which can allow +otherwise unsupported structured or unstructured data to be read. The user +defined reader capability utilizes dynamic shared libraries composed of +routines defined in this document but produced by you, the user, (or some +third party). This capability is currently available for dec, ibm, hp, sgi, +sun, linux, alpha linux, and NT servers. + +You should refer to beginning of README_USERD_2.0 and/or README_1.0_to_2.0 +for a discussion of the differences between API 1.0 and API 2.*. + +***>> API 2.06 additional capabilities (beyond API 2.05): +Routines to allow userd defined readers for structured data +to deal with min, max, and stride within the reader itself +instead of within EnSight. + USERD_get_structured_reader_cinching + USERD_set_block_range_and_stride + + +***>> API 2.05 additional capabilities (beyond API 2.04): +Routines to handle material species. + USERD_get_number_of_species + USERD_get_matsp_info + +Routines to handle variable extraction parameters after a read, and then +update the variables accordingly. Similar to the extra GUI capabilities +(which are processed before a read). (Can actually be added to pre-2.05 readers) + USERD_get_var_extract_gui_numbers + USERD_get_var_extract_gui_defaults + USERD_set_var_extract_gui_data + +Routines to obtain rigid body values from a reader. +(Routines were added - EnSight is now using for Nastran and STL readers + with Dynasty rigid body motion data file) + USERD_rigidbody_existence + USERD_rigidbody_values + +Routine that lets reader know when EnSight is getting the right side of a time +interval for variable interpolation between steps. Not generally needed for +most readers - however, may be needed for those that implement rigid body, and +wish to cache left and right timespan information for interpolation within the +reader itself. (Can actually be added to pre-2.05 readers) + USERD_set_right_side + + +***>> API 2.04 additional capabilities (beyond API 2.03): +Routines to handle failed elements. Basically +a.One routine to return a flag indicating the existence of + failed elements in at least one part in at least one + timestep in the model. +b.A second routine to return a matrix of flags indexed by part and + element type indicating which parts and element types have failed + elements at the current time step. +c.Finally a third routine to return an array of flags for a given + part and element type that is number of elements of that type long + indicating which elements have failed, and which have not failed. + + +***>> API 2.03 additional capabilities (beyond API 2.01): +1. Routines to handle materials +2. Routines to handle nsided and nfaced elements +3. Modified routine to handle structured ranges + + +**************************************************************************** +Note: Only the the Ensight Gold example reader, has been moved to + this 2.06 API level. And it is purely for an example - it does not + actually provide a benefit. +**************************************************************************** + + +The process for producing a user defined reader is: +--------------------------------------------------- +1. Write code for all pertinent routines in the library (Unless someone else + has done this for you). + + This is of course where the work is done by the user. The word + "pertinent" is used because depending on the nature of the data, some + of the routines in the library may be dummy routines. + + The source code for a dummy_gold library and for various other + working or sample libraries is copied from the installation CD during + installation. These will be located in directories under: + + $CEI_HOME/ensight76/user_defined_src/readers + + examples: + -------- + Basic dummy_gold routines provide skeleton for a new reader + $CEI_HOME/ensight76/user_defined_src/readers/dummy_gold + + Sample library which reads unstructured binary EnSight Gold data + $CEI_HOME/ensight76/user_defined_src/readers/ensight_gold + + You may find it useful to place your library source in this area as + well, but are not limited to this location. + + * ===> The descriptions of each library routine and the order that the + routines are called, which is provided in this file, along with + the example libraries, should make it possible for you to produce + code for your own data reader. + + +2. Produce the dynamic shared library. + + This is a compiling and loading process which varies according to + the type of machine you are on. In the user-defined-reader source + tree we have tried to isolate the machine dependent parts of the + build process using a set of files in the 'config' directory. In this + directory there is a configuration file for each platform on which + EnSight is supported. Before you can compile the installed readers + you should run the script called 'init' in the config directory. + + i.e. (for UNIX) + cd config + ./init sgi_6.5_n64 + cd .. + make + + If you are compiling for Windows NT, there are two options. If you + have the Cygwin GNU utilities installed, you can use GNU make as for + Unix. Otherwise, there is a script called makeall.cmd which will + build all of the readers using nmake. The Makefiles in each reader + directory will work using either make or nmake. + + i.e. (WIN32 Cygwin) (using nmake) + cd config cd config + sh init win32 cp win32 config + cd .. cd .. + mkdir lib + make makeall.cmd + + If you have platform-specific portions of code in your reader, the + build system defines a set of flags which can be used within + #ifdef ... #endif regions in your source, as shown in the table + below. + + Because the readers are now dynamically opened by EnSight, you may + have to include dependent libraries on your link-line to avoid having + unresolved symbols. If you are having problems with a reader, start + ensight as "ensight7 -readerdbg" and you will get feedback on any + problems encountered in loading a reader. If there are unresolved + symbols, you need to find the library which contains the missing + symbols and link it into your reader by adding it to the example + link commands below. + + If you choose to use a different build environment for your reader, + you should take care to use compatible compilation flags to ensure + compatibilty with the EnSight executables, most notably on the SGI + and HP-UX 11.0 platforms, which should use the following flags: + + sgi_6.2_o32: -mips2 + sgi_6.2_n64: -mips4 -64 + sgi_6.5_n32: -mips3 + sgi_6.5_n64: -mips4 -64 + hp_11.0_32: +DA2.0 + hp_11.0_64: +DA2.0W + + ______________________________________________________________________ + | MACHINE | OS flag | SHARED LIBRARY NAME PRODUCED | + | TYPE |------------------------------------------------------------| + | | LD COMMAND USED IN MAKEFILE | + ====================================================================== + ______________________________________________________________________ + | sgi | -DSGI | libuserd-X.so | + | |------------------------------------------------------------| + | | ld -shared -all -o libuserd-X.so libuserd-X.o | + ---------------------------------------------------------------------- + ______________________________________________________________________ + | hp | -DHP | libuserd-X.sl | + | |------------------------------------------------------------| + | | ld -b -o libuserd-X.sl libuserd-X.o | + ---------------------------------------------------------------------- + ______________________________________________________________________ + | sun | -DSUN | libuserd-X.so | + | |------------------------------------------------------------| + | | ld -G -o libuserd-X.so libuserd-X.o | + ---------------------------------------------------------------------- + ______________________________________________________________________ + | dec | -DDEC | libuserd-X.so | + | |------------------------------------------------------------| + | | ld -shared -all -o libuserd-X.so libuserd-X.o -lc | + ---------------------------------------------------------------------- + ______________________________________________________________________ + | linux | -DLINUX | libuserd-X.so | + | |------------------------------------------------------------| + | | ld -shared -o libuserd-X.so libuserd-X.o -lc | + ---------------------------------------------------------------------- + ______________________________________________________________________ + | alpha | -DALINUX | libuserd-X.so | + | linux |------------------------------------------------------------| + | | ld -shared -o libuserd-X.so libuserd-X.o -lc | + ---------------------------------------------------------------------- + ______________________________________________________________________ + | ibm | -DIBM | libuserd-X.so | + | |------------------------------------------------------------| + | | ld -G -o libuserd-X.so libuserd-X.o -bnoentry -bexpall -lc | + ---------------------------------------------------------------------- + + Once you have created your library, you should place it in a directory + of your choice or in the standard reader location: + + $CEI_HOME/ensight76/machines/$CEI_ARCH/lib_readers + + For example, if you created a reader for "mydata", you should create + the reader libuserd-mydata.so and place the file in your own reader + directory (see section 3 below) or in the standard location: + + $CEI_HOME/ensight76/machines/$CEI_ARCH/lib_readers/libuserd-mydata.so + + +3. By default EnSight will load all readers found in the directory: + + $CEI_HOME/ensight76/machines/$CEI_ARCH/lib_readers + + Files with names "libuserd-X.so" (where X is a name unique to the reader) + are assumed to be user-defined readers. + + There are two methods which can be used to supplement the default + behavior. + + (1) A feature which is useful for site-level or user-level configuration + is the optional environment variable $ENSIGHT7_READER. This + variable directs EnSight to load all readers in the specified reader + directory (you should probably specify a full path) before loading + the built-in readers. If the same reader exists in both directories + (as determined by the name returned by USERD_get_name_of_reader(), + NOT by the filename), the locally configured reader will take + precedence. + + (2) A useful feature for end-users is the use of the libuserd-devel + reader. EnSight will search for a reader named libuserd-devel.so + (.sl for HP or .dll for NT). This reader can exist anywhere in the + library path (see below) of the user. This is useful for an + individual actively developing a reader because the existence of a + libuserd-devel library will take precedence over any other library + which returns the same name from USERD_get_name_of_reader(). + + As an example, a site may install commonly used readers in a common + location, and users can set the ENSIGHT7_READER variable to access them: + + setenv ENSIGHT7_READER /usr/local/lib/e7readers + + A user working on a new reader may compile the reader and place it in + a directory specified by the library path: + + cp libuserd-myreader.so ~/lib/libuserd-devel.so + setenv ~/lib:$ + + The user is responsible for correctly configuring the library path + variable in order to make use of the libuserd-devel feature. The + library environment variables used are: + + Machine type Environment variable to set + ------------ --------------------------- + sgi LD_LIBRARY_PATH + dec LD_LIBRARY_PATH + sun LD_LIBRARY_PATH + linux LD_LIBRARY_PATH + alpha linux LD_LIBRARY_PATH + hp SHLIB_PATH + ibm LIBPATH + +As always, EnSight support is available if you need it. + +------------------------------- +Quick Index of Library Routines +------------------------------- + +Generally Needed for UNSTRUCTURED data +-------------------------------------- +USERD_get_part_coords part's node coordinates +USERD_get_part_node_ids part's node ids +USERD_get_part_elements_by_type part's element connectivites +USERD_get_part_element_ids_by_type part's element ids + + +Generally Needed for BLOCK data +-------------------------------------- +USERD_get_block_coords_by_component block coordinates +USERD_get_block_iblanking block iblanking values +USERD_get_ghosts_in_block_flag block ghost cell existence? +USERD_get_block_ghost_flags block ghost cell flags + + These routines, which formerly were only for unstructured data, will now + also be called for structured data if you specify that ids will be given + in the USERD_get_node_label_status and USERD_get_element_label_status rotuines + ------------------------------------------------------------------------------ + USERD_get_part_node_ids part's node ids + USERD_get_part_element_ids_by_type part's element ids + + +Generally needed for either or both kinds of data +------------------------------------------------- +USERD_get_name_of_reader name of reader for GUI +USERD_get_reader_release release string of reader +USERD_get_reader_version provide reader version number +USERD_get_reader_descrip provide GUI more description (optional) + +USERD_get_extra_gui_numbers Gets the number of toggles, pulldowns and fields +USERD_get_extra_gui_defaults Gets the default values for the GUI members +USERD_set_extra_gui_data Returns the answers provided by the user + +USERD_set_filenames filenames entered in GUI +USERD_set_server_number server which of how many + +USERD_get_number_of_timesets number of timesets +USERD_get_timeset_description description of timeset +USERD_get_geom_timeset_number timeset # to use for geom + +USERD_get_num_of_time_steps number of time steps +USERD_get_sol_times solution time values +USERD_set_time_set_and_step current timeset and time step + +USERD_get_changing_geometry_status changing geometry? +USERD_get_node_label_status node labels? +USERD_get_element_label_status element labels? +USERD_get_model_extents provide model bounding extents +USERD_get_number_of_files_in_dataset number of files in model +USERD_get_dataset_query_file_info info about each model file +USERD_get_descrip_lines file associated description lines +USERD_get_number_of_model_parts number of model parts +USERD_get_gold_part_build_info Gets the info needed for part building process +USERD_get_part_build_info part/block type/descrip etc. +USERD_get_maxsize_info part/block allocation maximums +USERD_get_ghosts_in_model_flag model contains ghost cells? +USERD_get_nsided_conn Gets the element connectivities for nsided + elements. (utilizes the number of nodes + per element obtained in + USERD_get_part_elements_by_type) +USERD_get_nfaced_nodes_per_face Gets the number of nodes per face for nfaced + elements (utilizes the number of faces + per element obtained in + USERD_get_part_elements_by_type) +USERD_get_nfaced_conn Gets the element connectivities for nfaced + elements (utilizes the number of nodes + per face obtained in + USERD_get_nfaced_nodes_per_face) + + +USERD_get_border_availability part border provided? +USERD_get_border_elements_by_type part border conn and parent info + +USERD_get_number_of_variables number of variables +USERD_get_gold_variable_info variable type/descrip etc. +USERD_get_var_by_component part or block variable values +USERD_get_constant_val constant variable's value +USERD_get_var_value_at_specific node's or element's variable value over time +USERD_stop_part_building cleanup after part build routine + +USERD_get_number_of_material_sets Gets the number of material sets +USERD_get_matf_set_info Gets the material set indices and names +USERD_get_number_of_materials Gets the number of materials +USERD_get_matf_var_info Gets the material indices and descriptions +USERD_size_matf_data Gets the length of either the + material ids list, + mixed-material ids list, or + mixed-material values list +USERD_load_matf_data Gets the material ids list, + mixed-material ids list, or + mixed-material values list + +USERD_bkup archive routine + +USERD_exit_routine cleanup upon exit routine + +USERD_get_uns_failed_params Gets thresholds/criteria for failure + +USERD_rigidbody_existence Returns whether rigid body transformation + data exists for the model. +USERD_rigidbody_values Returns the euler and location values for a + given part + +USERD_set_right_side Simply informs the reader when the time set + is for the right side of a time span during + variable interpolation between time steps. + +USERD_get_structured_reader_cinching Tells if the reader will do structured + cinching +USERD_set_block_range_and_stride Sets the min, max, and stride of a block + if doing structured cinching + + +------------------------- +Order Routines are called +------------------------- + +The various main operations are given basically in the order they will +be performed. Within each operation, the order the routines will be +called is given. + +1. Setting name in the gui, and specifying one or two input fields + + USERD_get_name_of_reader + USERD_get_reader_descrip (optional) + USERD_get_extra_gui_numbers (optional) + USERD_get_extra_gui_defaults (optional) + +2. Getting the reader version (also distinguishes between API's) + + USERD_get_reader_version + +3. Setting filenames and getting timeset and time info + + (optional if reader has + USERD_get_extra_gui_defaults routine) + USERD_get_structured_reader_cinching + USERD_set_server_number + USERD_set_extra_gui_data (optional) + USERD_set_filenames + USERD_get_number_of_timesets + USERD_get_geom_timeset_number + + for each timeset: + USERD_get_timeset_description + USERD_get_num_of_time_steps + USERD_get_sol_times + + USERD_set_time_set_and_step + +4. Gathering info for part builder + + USERD_set_time_set_and_step + USERD_get_changing_geometry_status + USERD_get_node_label_status + USERD_get_element_label_status + USERD_get_number_of_files_in_dataset + USERD_get_dataset_query_file_info + USERD_get_descrip_lines (for geometry) + USERD_get_number_of_model_parts + USERD_get_gold_part_build_info + USERD_get_ghosts_in_model_flag + USERD_get_maxsize_info + USERD_get_get_ghosts_in_block_flag (if any ghost cells in model) + USERD_get_model_extents OR (for model extents) + USERD_get_part_coords AND/OR + (if doing structured reader cinching + USERD_get_block_coords_by_component + +5. Gathering Variable info + + USERD_get_number_of_variables + USERD_get_gold_variable_info + +6. Part building (per part created) + + both unstructured and structured: + -------------------------------- + USERD_set_time_set_and_step + + if unstructured part: + -------------------- + USERD_get_part_element_ids_by_type + USERD_get_part_elements_by_type + + If any nsided elements: + + USERD_get_nsided_conn + + If any nfaced elements: + + USERD_get_nfaced_nodes_per_face + USERD_get_nfaced_conn + + USERD_get_part_coords + USERD_get_part_node_ids + + else if structured part: + ----------------------- + USERD_get_block_iblanking + (if doing structured reader cinching + USERD_get_block_coords_by_component + USERD_get_block_ghost_flags (If ghost cells in part) + USERD_get_part_node_ids (If node ids given) + USERD_get_part_element_ids_by_type (If element ids given) + + both again: + ---------- + USERD_get_border_availability (If border representation + USERD_get_border_elements_by_type is selected) + + USERD_stop_part_building (only once when part builder + dialog is closed) + +7. Loading Variables + + constants: + --------- + USERD_set_time_set_and_step + USERD_get_constant_val + + scalars/vectors/tensors: + ------------------------ + USERD_get_descrip_lines + USERD_set_time_set_and_step + (if doing structured reader cinching + USERD_get_var_by_component + +8. Changing geometry + + changing coords only (per part): + -------------------- + USERD_set_time_set_and_step + USERD_get_descrip_lines + USERD_get_part_coords + (if doing structured reader cinching + USERD_get_block_coords_by_component + + changing connectivity (per part): + --------------------- + USERD_set_time_set_and_step + USERD_get_descrip_lines + USERD_get_number_of_model_parts + USERD_get_gold_part_build_info + USERD_get_ghosts_in_model_flag + USERD_get_get_ghosts_in_block_flag (if any ghost cells in model) + USERD_get_model_extents OR + USERD_get_part_coords AND/OR + (if doing structured reader cinching + USERD_get_block_coords_by_component + USERD_get_part_element_ids_by_type + USERD_get_part_elements_by_type + USERD_get_part_coords + USERD_get_part_node_ids + USERD_get_block_iblanking + (if doing structured reader cinching + USERD_get_block_coords_by_component + USERD_get_block_ghost_flags (If ghost cells in part) + USERD_get_part_node_ids (If node ids given) + USERD_get_part_element_ids_by_type (If element ids given) + + USERD_get_border_availability (If border representation + USERD_get_border_elements_by_type is selected) + + +9. Node or Element queries over time + + USERD_get_var_value_at_specific + +10. To see if materials in the model + + USERD_get_number_of_material_sets + USERD_get_matf_set_info + + If any material sets in the model (calls these once per material set): + USERD_get_number_of_materials + USERD_get_matf_var_info + + For each elment type of each part containing material ids, calls: + USERD_size_matf_data + USERD_load_matf_data + + If there are any elements with mixed materials, when a domain or + interface is created, calls these again per part: + + USERD_size_matf_data + USERD_load_matf_data + +11. To modify the variable extraction parameters and have the variables + update accordingly. + + USERD_get_var_extract_gui_numbers + USERD_get_var_extract_gui_defaults + USERD_set_var_extract_gui_data + + + +----------------------- +Detailed Specifications +----------------------- + +Include files: +-------------- +The following header file is required in any file containing these library +routines. + + #include "global_extern.h" + +And it references: + + #include "global_extern_proto.h" + + + +******************************************************************************* +****************************** Special Note *********************************** +******************************************************************************* + +Make sure you use the proper define in the global_extern.h header file, namely: +#define USERD_API_204 + +Also, Make sure the api version in the USERD_get_reader_version routine is set +to "2.04" or larger. + +Make sure your reader has access to the global_extern_proto.h This is a new +file which is accessed from the new global_extern.h + +******************************************************************************* +******************************************************************************* + + +Basis of arrays: +--------------- +Unless explicitly stated otherwise, all arrays are zero based - in true C +fashion. + + +Global variables: +---------------- +You will generally need to have a few global variables which are shared by +the various library routines. The detailed specifications below have assumed +the following are available. (Their names describe their purpose, and they +will be used in helping describe the details of the routines below). + +static int Numparts_available = 0; +static int Num_unstructured_parts = 0; +static int Num_structured_blocks = 0; + +/* Note: Numparts_available = Num_unstructured_parts + Num_structured_blocks */ + +static int Num_timesets = 1; +static int Current_timeset = 1; +static int Geom_timeset_number = 1; + +static int Num_time_steps[Z_MAXSETS] = 1; +static int Current_time_step = 0; +static int Num_variables = 0; +static int Num_dataset_files = 0; + +static int Server_Number = 1; Which server of +static int Tot_Servers = 1; the total number of servers + + + +_________________________________________ +----------------------------------------- +Library Routines (in alphabetical order): +_________________________________________ +----------------------------------------- + +-------------------------------------------------------------------- +USERD_bkup + + Description: + ----------- + This routine is called during the EnSight archive process. You can + use it to save or restore info relating to your user defined reader. + + Specification: + ------------- + int USERD_bkup(FILE *archive_file, + int backup_type) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) archive_file = The archive file pointer + + (IN) backup_type = Z_SAVE_ARCHIVE for saving archive + Z_REST_ARCHIVE for restoring archive + + Notes: + ----- + * Since EnSight's archive file is saved in binary form, you should + also do any writing to it or reading from it in binary. + + * You should archive any variables, which will be needed for + future operations, that will not be read or computed again + before they will be needed. These are typically global + variables. + + * Make sure that the number of bytes that you write on a save and + the number of bytes that you read on a restore are identical!! + + * If any of the variables you save are allocated arrays, you must + do the allocations before restoring into them. + +-------------------------------------------------------------------- +USERD_exit_routine + + Description: + ----------- + This routine is called as EnSight is exiting. It can be used to clean + up anything needed - such as removing temporary files, etc. - or can simply + be a dummy. + + Specification: + ------------- + void USERD_exit_routine( void ) + + Arguments: + --------- + none + +-------------------------------------------------------------------- +USERD_get_block_coords_by_component + + Description: + ----------- + Get the coordinates of a given structured block, a component at a time. + + Specification: + ------------- + int USERD_get_block_coords_by_component(int block_number, + int which_component, + float *coord_array) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) block_number = The block part number + (1-based index of part table, namely: + + 1 ... Numparts_available. + + It is NOT the part_id that + is loaded in USERD_get_gold_part_build_info) + + (IN) which_component = Z_COMPX if x component wanted + = Z_COMPY if y component wanted + = Z_COMPZ if z component wanted + + (OUT) coord_array = 1D array containing x,y, or z + coordinate component of each node + + (Array will have been allocated + i*j*k for the block long) + + Notes: + ----- + * Not called unless Num_structured_blocks is > 0 + + * Will be based on Current_time_step + + + +-------------------------------------------------------------------- +USERD_get_block_iblanking + + Description: + ----------- + Get the iblanking value at each node of a block (if the block is + iblanked). + + Specification: + ------------- + int USERD_get_block_iblanking(int block_number, + int *iblank_array) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) block_number = The block part number + (1-based index of part table, namely: + + 1 ... Numparts_available. + + It is NOT the part_id that + is loaded in USERD_get_gold_part_build_info) + + (OUT) iblank_array = 1D array containing iblank value + for each node. + + (Array will have been allocated + i*j*k for the block long) + + possible values are: Z_EXT = exterior + Z_INT = interior + Z_BND = boundary + Z_INTBND = internal boundary + Z_SYM = symmetry plane + + Notes: + ----- + * Not called unless Num_structured_blocks is > 0 and you have + some iblanked blocks + + * Will be based on Current_time_step + + + +---------------------------------------------------------------------- +USERD_get_block_ghost_flags + + Description: + ----------- + Get the ghost_flags value at each element of a block containing ghost cells. + + Specification: + ------------- + int USERD_get_block_ghost_flags(int block_number, + int *ghost_flags) + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) block_number = The block number + (1-based index of part table, namely: + + 1 ... Numparts_available. + + It is NOT the part_id that + is loaded in USERD_get_gold_part_build_info) + + (OUT) ghost_flags = 1D array containing ghost flag value + for each block cell. + + (Array will have been allocated + (i-1)*(j-1)*(k-1) for the block long) + + possible values are: 0 = non-ghost cell (normal cell) + >0 = ghost cell + + Notes: + ----- + * This routine is new in the 2.01 API + + * This will be based on Current_time_step + + * Only called for structured "block" parts that have some ghost cells + as indicated by the USERD_get_ghost_in_block_flag. The model must + of course also have been indicated to have some ghost cells in the + USERD_get_ghost_in_model_flag routine. + + * It is sufficient to set the value to be 1 to flag as a ghost cell, + but the value can be any non-zero value, so you could use it to + indicate which block or which server (for Server-of-server use) the + cell is actually in. + + + +-------------------------------------------------------------------- +USERD_get_border_availability + + Description: + ----------- + Finds out if border elements are provided by the reader for the + desired part, or will need to be computed internally by EnSight. + + Specification: + ------------- + int USERD_get_border_availability(int part_number, + int number_of_elements[Z_MAXTYPE]) + + Returns: + ------- + Z_OK if border elements will be provided by the reader. + (number_of_elements array will be loaded and + USERD_get_border_elements_by_type will be called) + + Z_ERR if border elements are not available - thus EnSight must compute. + (USERD_get_border_elements_by_type will not be called) + + + Arguments: + --------- + (IN) part_number = The part number + (1-based index of part table, namely: + + 1 ... Numparts_available. + + It is NOT the part_id that + is loaded in USERD_get_gold_part_build_info) + + (OUT) number_of_elements = 2D array containing number of + each type of border element in + the part. + ------------ + Possible types are: + + Z_POINT = point + Z_BAR02 = 2-noded bar + Z_BAR03 = 3-noded bar + Z_TRI03 = 3-noded triangle + Z_TRI06 = 6-noded triangle + Z_QUA04 = 4-noded quadrilateral + Z_QUA08 = 8-noded quadrilateral + + Notes: + ----- + * Only called if border representation is used. + + * Will be based on Current_time_step + + + +-------------------------------------------------------------------- +USERD_get_border_elements_by_type + + Description: + ----------- + Provides border element connectivity and parent information. + + Specification: + ------------- + int USERD_get_border_elements_by_type(int part_number, + int element_type, + int **conn_array, + short *parent_element_type, + int *parent_element_num) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) part_number = The part number + (1-based index of part table, namely: + + 1 ... Numparts_available. + + It is NOT the part_id that + is loaded in USERD_get_gold_part_build_info) + + (IN) element_type = One of the following (See global_extern.h) + Z_POINT node point element + Z_BAR02 2 node bar + Z_BAR03 3 node bar + Z_TRI03 3 node triangle + Z_TRI06 6 node triangle + Z_QUA04 4 node quad + Z_QUA08 8 node quad + + (OUT) conn_array = 2D array containing connectivity + of each border element of the type. + + (Array will have been allocated + num_of_elements of the type by + connectivity length of the type) + + ex) If number_of_elements[Z_TRI03] = 25 + number_of_elements[Z_QUA04] = 100 + number_of_elements[Z_QUA08] = 30 + as obtained in: + USERD_get_border_availability + + Then the allocated dimensions available + for this routine will be: + conn_array[25][3] when called with Z_TRI03 + + conn_array[100][4] when called with Z_QUA04 + + conn_array[30][8] when called with Z_QUA08 + + (OUT) parent_element_type = 1D array containing element type of the + parent element (the one that the border + element is a face/edge of). + + (Array will have been allocated + num_of_elements of the type long) + + (OUT) parent_element_num = 1D array containing element number of the + parent element (the one that the border + element is a face/edge of). + + (Array will have been allocated + num_of_elements of the type long) + + + Notes: + ----- + * Not called unless USERD_get_border_availability returned Z_OK + + * Will be based on Current_time_step + + + +-------------------------------------------------------------------- +USERD_get_changing_geometry_status + + Description: + ----------- + Gets the changing geometry status for the model + + Specification: + ------------- + int USERD_get_changing_geometry_status( void ) + + Returns: + ------- + Z_STATIC if geometry does not change + Z_CHANGE_COORDS if changing coordinates only + Z_CHANGE_CONN if changing connectivity + + Arguments: + --------- + none + + Notes: + ----- + * EnSight does not support changing number of parts. But the + coords and/or the connectivity of the parts can change. Note that + a part is allowed to be empty (number of nodes and elements equal + to zero). + + +-------------------------------------------------------------------- +USERD_get_constant_val + + Description: + ----------- + Get the value of a constant at a time step + + Specification: + ------------- + float USERD_get_constant_value(int which_var, + int imag_data) + + Returns: + ------- + Value of the requested constant variable + + Arguments: + --------- + (IN) which_var = The variable number + + (IN) imag_data = TRUE if want imaginary data value. + FALSE if want real data value. + + Notes: + ----- + * Will be based on Current_time_step + + + +-------------------------------------------------------------------- +USERD_get_dataset_query_file_info + + Description: + ----------- + Get the information about files in the dataset. Used for the + dataset query option within EnSight. + + Specification: + ------------- + int USERD_get_dataset_query_file_info(Z_QFILES *qfiles) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (OUT) qfiles = Structure containing information about each file + of the dataset. The Z_QFILES structure is defined + in the global_extern.h file + + (The structure will have been allocated + Num_dataset_files long, with 10 description + lines per file). + + qfiles[].name = The name of the file + (Z_MAXFILENP is the dimensioned length + of the name) + + qfiles[].sizeb = The number of bytes in the file + (Typically obtained with a call to the + "stat" system routine) (Is a long) + + qfiles[].timemod = The time the file was last modified + (Z_MAXTIMLEN is the dimensioned length + of this string) + (Typically obtained with a call to the + "stat" system routine) + + qfiles[].num_d_lines = The number of description lines you + are providing from the file. Max = 10 + + qfiles[].f_desc[] = The description line(s) per file, + qfiles[].num_d_lines of them + (Z_MAXFILENP is the allocated length of + each line) + + Notes: + ----- + * If Num_dataset_files is 0, this routine will not be called. + (See USERD_get_number_of_files_in_dataset) + + +-------------------------------------------------------------------- +USERD_get_descrip_lines + + Description: + ----------- + Get two description lines associated with geometry per time step, + or one description line associated with a variable per time step. + + Specification: + ------------- + int USERD_get_descrip_lines(int which_type, + int which_var, + int imag_data, + char line1[Z_BUFL], + char line2[Z_BUFL]) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) which_type = Z_GEOM for geometry (2 lines) + = Z_VARI for variable (1 line) + + (IN) which_var = If it is a variable, which one. + Ignored if geometry type. + + (IN) imag_data = TRUE if want imaginary data file. + FALSE if want real data file. + + (OUT) line1 = The 1st geometry description line, + or the variable description line. + + (OUT) line2 = The 2nd geometry description line + Not used if variable type. + + Notes: + ----- + * Will be based on Current_time_step + + * These are the lines EnSight can echo to the screen in + annotation mode. + + + +-------------------------------------------------------------------- +USERD_get_element_label_status + + Description: + ----------- + Answers the question as to whether element labels will be provided. + + Specification: + ------------- + int USERD_get_element_label_status( void ) + + Returns: + ------- + TRUE if element labels will be provided + FALSE if element labels will NOT be provided + + Arguments: + --------- + none + + Notes: + ----- + * element lables are needed in order to do any element querying, or + element labeling on-screen within EnSight. + + * Prior to API 2.01: + ----------------- + For unstructured parts, you can read them from your file if + available, or can assign them, etc. They need to be unique + per part, and are often unique per model. + + API 1.0: + USERD_get_element_ids_for_part is used to obtain the ids, + on a part by part basis, if TRUE status is returned here. + + API 2.0: + USERD_get_part_element_ids_by_type is used to obtain the ids, + on a per part, per type basis, if TRUE status is returned here. + + For structured parts, EnSight will assign ids if you return a + status of TRUE here. You cannot assign them youself!! + + * Starting at API 2.01: + -------------------- + For both unstructured and structured parts, you can read them + from your file if available, or can assign them, etc. They need + to be unique per part, and are often unique per model (especially + if you are dealing with a decomposed dataset). + + USERD_get_part_element_ids_by_type is used to obtain the ids, + on an element type by part basis, if TRUE status is returned here. + + * Will call USERD_get_part_element_ids_by_type for each type of + of each part if this routine returns TRUE. +-------------------------------------------------------------------- +USERD_get_geom_timeset_number - + + Description: + ----------- + Gets the timeset number to be used for geometry + + Specification: + ------------- + int USERD_get_geom_timeset_number( void ) + + Returns: + ------- + Geom_timeset_number = The timeset number that will be used for geometry. + For example, if USERD_get_number_of timesets + returns 2, the valid timeset numbers would be + 1 or 2. + + Arguments: + --------- + none + + Notes: + ----- + * If your model is static, which you indicated by returning a zero + in USERD_get_number_of_timesets, you can return a zero here as well. + + + +-------------------------------------------------------------------- +USERD_get_gold_part_build_info + + Description: + ----------- + Gets the info needed for the part building process. + + Specification: + ------------- + int USERD_get_gold_part_build_info(int *part_id, + int *part_types, + char *part_description[Z_BUFL], + int *number_of_nodes, + int *number_of_elements[Z_MAXTYPE], + int *ijk_dimensions[9], + int *iblanking_options[6]) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (OUT) part_id = Array containing the external part + ids for each of the model parts. + + IMPORTANT: + Parts numbers must be >= 1, because + of the way they are used in the GUI + + ******************************************* + The ids provided here are the numbers by + which the parts will be referred to in the + GUI (if possible). They are basically + labels as far as you are concerned. + + Note: The part numbers you pass to routines + which receive a part_number or block_number + or which_part as an argument are the 1-based + table index of the parts! + + example: If Numparts_available = 3 + + Table index part_id + ----------- ------- + 1 13 + 2 57 + 3 125 + + ^ ^ + | | + | These are placed in: + | part_id[0] = 13 + | part_id[1] = 57 + | part_id[2] = 125 + | for GUI labeling purposes. + | + These implied table indices are the part_number, + block_number, or which_part numbers that you would + pass to routines like: + + USERD_get_part_coords(int part_number,... + USERD_get_part_node_ids(int part_number,... + USERD_get_part_elements_by_type(int part_number,... + USERD_get_part_element_ids_by_type(int part_number,... + USERD_get_block_coords_by_component(int block_number,... + USERD_get_block_iblanking(int block_number,... + USERD_get_block_ghost_flags(int block_number,... + USERD_get_ghosts_in_block_flag(int block_number) + USERD_get_border_availability(int part_number,... + USERD_get_border_elements_by_type(int part_number,... + USERD_get_var_by_component(int which_variable, + int which_part,... + USERD_get_var_value_at_specific(int which_var, + int which_node_or_elem, + int which_part,... + ******************************************** + + (Array will have been allocated + Numparts_available long) + + (OUT) part_types = Array containing one of the + following for each model part: + + Z_UNSTRUCTURED or + Z_STRUCTURED or + Z_IBLANKED + + (Array will have been allocated + Numparts_available long) + + (OUT) part_description = Array containing a description + for each of the model parts + + (Array will have been allocated + Numparts_available by Z_BUFL + long) + + (OUT) number_of_nodes = Number of unstructured nodes in the part + + (Array will have been allocated + Numparts_available long) + + (OUT) number_of_elements = 2D array containing number of + each type of element for each + unstructured model part. + ------------ + Possible types are: + + Z_POINT = point + Z_BAR02 = 2-noded bar + Z_BAR03 = 3-noded bar + Z_TRI03 = 3-noded triangle + Z_TRI06 = 6-noded triangle + Z_QUA04 = 4-noded quadrilateral + Z_QUA08 = 8-noded quadrilateral + Z_TET04 = 4-noded tetrahedron + Z_TET10 = 10-noded tetrahedron + Z_PYR05 = 5-noded pyramid + Z_PYR13 = 13-noded pyramid + Z_PEN06 = 6-noded pentahedron + Z_PEN15 = 15-noded pentahedron + Z_HEX08 = 8-noded hexahedron + Z_HEX20 = 20-noded hexahedron + + Z_G_POINT = ghost node point element + Z_G_BAR02 = 2 node ghost bar + Z_G_BAR03 = 3 node ghost bar + Z_G_TRI03 = 3 node ghost triangle + Z_G_TRI06 = 6 node ghost triangle + Z_G_QUA04 = 4 node ghost quad + Z_G_QUA08 = 8 node ghost quad + Z_G_TET04 = 4 node ghost tetrahedron + Z_G_TET10 = 10 node ghost tetrahedron + Z_G_PYR05 = 5 node ghost pyramid + Z_G_PYR13 = 13 node ghost pyramid + Z_G_PEN06 = 6 node ghost pentahedron + Z_G_PEN15 = 15 node ghost pentahedron + Z_G_HEX08 = 8 node ghost hexahedron + Z_G_HEX20 = 20 node ghost hexahedron + + (Ignored unless Z_UNSTRUCTURED type) + + (Array will have been allocated + Numparts_available by + Z_MAXTYPE long) + + (OUT) ijk_dimensions = 2D array containing ijk dimension info + for structured blocks + + For Z_UNSTRUCTURED - is ignored + + For Z_STRUCTURED or Z_IBLANKED + + Prior to version 2.03: + ---------------------- + (Array will have been allocated + Numparts_available by 3 long) + + ijk_dimensions[][0] = I dimension + ijk_dimensions[][1] = J dimension + ijk_dimensions[][2] = K dimension + + + Starting at version 2.03: + ------------------------ + (Array will have been allocated + Numparts_available by 9 long) + + There are two ways to do this: + ------------------------------ + 1. The simple one, without ranges. + + This is good for all structured models + that will NOT be used in EnSight's + Server of Servers + + Simply provide the ijk dimensions in the + first three slots and place a -1 in + the 4th slot. (The remaining slots will + be ignored). + + Thus, + ijk_dimensions[][0] = I dimension of block + ijk_dimensions[][1] = J dimension of block + ijk_dimensions[][2] = K dimension of block + ijk_dimensions[][3] = -1 + + (J planes) + 4 *-------*-------* + | | | ijk_dimension[0][0] = 3 + | | | ijk_dimension[0][1] = 4 + | | | ijk_dimension[0][2] = 1 + 3 *-------*-------* + | | | ijk_dimension[0][4] = -1 + | | | + | | | + 2 *-------*-------* + | | | + | | | + | | | + 1 *-------*-------* + 1 2 3 (I planes) + + + + 2. Using ranges. + + This one can be used anytime, but MUST + be used if EnSight's Server of Servers + is to be used! + + The first 3 slots contain the ijk dimension + of the complete block (of which this may be + a portion). The last 6 slots contain the + ijk min and max ranges within the complete. + + Thus, + ijk_dimensions[][0] = I dim of complete block + ijk_dimensions[][1] = J dim of complete block + ijk_dimensions[][2] = K dim of complete block + + ijk_dimensions[][3] = Imin of portion (1-based) + ijk_dimensions[][4] = Imax of portion (1-based) + ijk_dimensions[][5] = Jmin of portion (1-based) + ijk_dimensions[][6] = Jmax of portion (1-based) + ijk_dimensions[][7] = Kmin of portion (1-based) + ijk_dimensions[][8] = Kmax of portion (1-based) + + + example1: (Model has one part, a simple 2D block, + and want whole thing) + + (J planes) + 4 *-------*-------* + | | | ijk_dimension[0][0] = 3 + | | | ijk_dimension[0][1] = 4 + | | | ijk_dimension[0][2] = 1 + 3 *-------*-------* + | | | ijk_dimension[0][3] = 1 + | | | ijk_dimension[0][4] = 3 + | | | ijk_dimension[0][5] = 1 + 2 *-------*-------* ijk_dimension[0][6] = 4 + | | | ijk_dimension[0][7] = 1 + | | | ijk_dimension[0][8] = 1 + | | | + 1 *-------*-------* + 1 2 3 (I planes) + + + example2: (Want to have the block represented + in two portions - 2 parts) + + (J planes) top portion + 4 *-------*-------* + | | | ijk_dimension[0][0] = 3 + | | | ijk_dimension[0][1] = 4 + | | | ijk_dimension[0][2] = 1 + 3 *-------*-------* + . . . ijk_dimension[0][3] = 1 + . . . ijk_dimension[0][4] = 3 + . . . ijk_dimension[0][5] = 3 + 2 ................. ijk_dimension[0][6] = 4 + . . . ijk_dimension[0][7] = 1 + . . . ijk_dimension[0][8] = 1 + . . . + 1 ................. + 1 2 3 (I planes) + + + (J planes) bottom portion + 4 ................. + . . . ijk_dimension[1][0] = 3 + . . . ijk_dimension[2][1] = 4 + . . . ijk_dimension[3][2] = 1 + 3 *-------*-------* + | | | ijk_dimension[1][3] = 1 + | | | ijk_dimension[1][4] = 3 + | | | ijk_dimension[1][5] = 1 + 2 *-------*-------* ijk_dimension[1][6] = 3 + | | | ijk_dimension[1][7] = 1 + | | | ijk_dimension[1][8] = 1 + | | | + 1 *-------*-------* + 1 2 3 (I planes) + + + And note that if you were partioning this block for + EnSight's Server of Servers, you would only have one part, + instead of two. Each SOS server would return its appropriate + ranges in the last 6 slots. The first 3 slots would remain constant. + + + (OUT) iblanking_options = 2D array containing iblanking + options possible for each + structured model part. + ---------- + (Ignored unless Z_IBLANKED type) + + (Array will have been allocated + Numparts_available by 6 long) + + iblanking_options[][Z_EXT] = TRUE if external (outside) + [][Z_INT] = TRUE if internal (inside) + [][Z_BND] = TRUE if boundary + [][Z_INTBND] = TRUE if internal boundary + [][Z_SYM] = TRUE if symmetry surface + + + Notes: + ----- + * If you haven't built a table of pointers to the different parts, + you might want to do so here as you gather the needed info. + + * Will be based on Current_time_step + + +-------------------------------------------------------------------- +USERD_get_gold_variable_info + + Description: + ----------- + Get the variable descriptions, types and filenames + + Specification: + ------------- + int USERD_get_gold_variable_info(char **var_description, + char **var_filename, + int *var_type, + int *var_classify, + int *var_complex, + char **var_ifilename, + float *var_freq, + int *var_contran, + int *var_timeset) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (OUT) var_description = Variable descriptions + + (Array will have been allocated + Num_variables by Z_BUFL long) + + variable description restrictions: + ---------------------------------- + 1. Only first 19 characters used in EnSight. + 2. Leading and trailing whitespace will be removed by EnSight. + 3. Illegal characters will be replaced by underscores. + 4. Thay may not start with a numeric digit. + 4. No two variables may have the same description. + + + (OUT) var_filename = Variable real filenames + + (Array will have been allocated + Num_variables by Z_BUFL long) + + (OUT) var_type = Variable type + + (Array will have been allocated + Num_variables long) + + types are: Z_CONSTANT + Z_SCALAR + Z_VECTOR + Z_TENSOR + Z_TENSOR9 + + (OUT) var_classify = Variable classification + + (Array will have been allocated + Num_variables long) + + types are: Z_PER_NODE + Z_PER_ELEM + + (OUT) var_complex = TRUE if complex, FALSE otherwise + + (Array will have been allocated + Num_variables long) + + (OUT) var_ifilename = Variable imaginary filenames (if complex) + + (Array will have been allocated + Num_variables by Z_BUFL long) + + (OUT) var_freq = complex frequency (if complex) + + (Array will have been allocated + Num_variables long) + + (OUT) var_contran = TRUE if constant changes per time step + FALSE if constant truly same at all time steps + + (Array will have been allocated + Num_variables long) + + (OUT) var_timeset = Timeset the variable will use (1 based). + (For static models, set it to 1) + + (Array will have been allocated + Num_variables long) + + For example: If USERD_get_number_of_timesets + returns 2, the valid + timeset_number's would be 1 or 2 + + + Notes: + ----- + * The implied variable numbers apply, but be aware that the + arrays are zero based. + So for variable 1, will need to provide var_description[0] + var_filename[0] + var_type[0] + var_classify[0] + var_complex[0] + var_ifilename[0] + var_freq[0] + var_contran[0] + var_timeset[0] + + + for variable 2, will need to provide var_description[1] + var_filename[1] + var_type[1] + var_classify[1] + var_complex[1] + var_ifilename[1] + var_freq[1] + var_contran[1] + var_timeset[1] + etc. + + + + +-------------------------------------------------------------------- +USERD_get_ghosts_in_block_flag + + Description: + ----------- + Gets whether ghost cells present in block or not + + Specification: + ------------- + int USERD_get_ghosts_in_block_flag(int block_number) + + Returns: + ------- + TRUE if any ghost cells in this structured part + FALSE if no ghost cells in this structured part + + Arguments: + --------- + (IN) block_number = The block part number + (1-based index of part table, namely: + + 1 ... Numparts_available. + + It is NOT the part_id that + is loaded in USERD_get_gold_part_build_info) + + Notes: + ----- + * This routine is new in the 2.01 API + * This will be based on Current_time_step + + * Intended for structured parts only, value will be ignored for + unstructured parts + + + +-------------------------------------------------------------------- +USERD_get_ghosts_in_model_flag + + Description: + ----------- + Answers the question as to whether any ghost cells in the model. + + Specification: + ------------- + int USERD_get_ghosts_in_model_flag( void ) + + Returns: + ------- + TRUE if any ghost cells in the model + FALSE if no ghost cells in the model + + Arguments: + --------- + + Notes: + ----- + * This routine is new in the 2.01 API + +------------------------------------------------------------------------- +USERD_get_matf_set_info + + Description: + ----------- + Get the material set ids and names + + Specification: + ------------- + int USERD_get_matf_set_info(int *mat_set_ids, + char **mat_set_name) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (OUT) mat_set_ids = 1D material set ids array + + (Array will have been allocated + Num_material_sets long) + + (OUT) mat_set_name = 2D material set name array + + (Array will have been allocated + Num_material_sets by Z_BUFL long) + + Notes: + ----- + * Will not be called if Num_material_sets is zero + * See USERD_get_number_of_material_sets header for explanatory example + + +-------------------------------------------------------------------- +USERD_get_matf_var_info + + Description: + ----------- + Gets the material ids and descriptions for the material set + + Specification: + ------------- + int USERD_get_matf_var_info(int set_index, + int *mat_ids, + char **mat_desc) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) set_index = the material set index (zero based) + + (OUT) mat_ids[set_index] = 1D integer array containing the material + ids to associated with each material + + (Array will have been allocated + Num_materials[set_index] long) + + (OUT) mat_desc[set_index] = 2D char array containing the material + descriptions to associated with each material + + (Array will have been allocated + Num_materials[set_index] by Z_BUFL long) + + Notes: + ----- + * See USERD_get_number_of_material_sets header for explanatory example + * Will not be called if Num_material_sets is zero, or + Num_materials[set_index] is zero + + + + +-------------------------------------------------------------------- +USERD_get_maxsize_info + + Description: + ----------- + Gets maximum part sizes for efficient memory allocation. + + Transient models (especially those that increase in size) can cause + reallocations, at time step changes, to keep chewing up more and + more memory. The way to avoid this is to know what the maximum + size of such memory will be, and allocate for this maximum initially. + + Accordingly, if you choose to provide this information (it is optional), + EnSight will take advantage of it. + + + Specification: + ------------- + int USERD_get_maxsize_info(int *max_number_of_nodes, + int *max_number_of_elements[Z_MAXTYPE], + int *max_ijk_dimensions[3]) + + Returns: + ------- + Z_OK if supplying maximum data + Z_ERR if not supplying maximum data, or some error occurred + while trying to obtain it. + + Arguments: + --------- + (OUT) max_number_of_nodes = Maximum number of unstructured nodes + in the part (over all time). + + (Array will have been allocated + Numparts_available long) + + (OUT) max_number_of_elements = 2D array containing maximum number of + each type of element for each + unstructured model part (over all time). + ------------ + Possible types are: + + Z_POINT = point + Z_BAR02 = 2-noded bar + Z_BAR03 = 3-noded bar + Z_TRI03 = 3-noded triangle + Z_TRI06 = 6-noded triangle + Z_QUA04 = 4-noded quadrilateral + Z_QUA08 = 8-noded quadrilateral + Z_TET04 = 4-noded tetrahedron + Z_TET10 = 10-noded tetrahedron + Z_PYR05 = 5-noded pyramid + Z_PYR13 = 13-noded pyramid + Z_PEN06 = 6-noded pentahedron + Z_PEN15 = 15-noded pentahedron + Z_HEX08 = 8-noded hexahedron + Z_HEX20 = 20-noded hexahedron + + Z_G_POINT = ghost node point element + Z_G_BAR02 = 2 node ghost bar + Z_G_BAR03 = 3 node ghost bar + Z_G_TRI03 = 3 node ghost triangle + Z_G_TRI06 = 6 node ghost triangle + Z_G_QUA04 = 4 node ghost quad + Z_G_QUA08 = 8 node ghost quad + Z_G_TET04 = 4 node ghost tetrahedron + Z_G_TET10 = 10 node ghost tetrahedron + Z_G_PYR05 = 5 node ghost pyramid + Z_G_PYR13 = 13 node ghost pyramid + Z_G_PEN06 = 6 node ghost pentahedron + Z_G_PEN15 = 15 node ghost pentahedron + Z_G_HEX08 = 8 node ghost hexahedron + Z_G_HEX20 = 20 node ghost hexahedron + + (Ignored unless Z_UNSTRUCTURED type) + + (Array will have been allocated + Numparts_available by + Z_MAXTYPE long) + + (OUT) max_ijk_dimensions = 2D array containing maximum ijk dimensions + for each structured model part (over all time). + ---------- + (Ignored if Z_UNSTRUCTURED type) + + (Array will have been allocated + Numparts_available by 3 long) + + max_ijk_dimensions[][0] = maximum I dimension + max_ijk_dimensions[][1] = maximum J dimension + max_ijk_dimensions[][2] = maximum K dimension + + Notes: + ----- + * You need to have first called USERD_get_number_of_model_parts and + USERD_get_gold_part_build_info, so Numparts_available is known and + so EnSight will know what the type is (Z_UNSTRUCTURED, Z_STRUCTURED, + or Z_IBLANKED) of each part. + + * This will NOT be based on Current_time_step - it is to be the maximum + values over all time!! + + * This information is optional. If you return Z_ERR, Ensight will still + process things fine, reallocating as needed, etc. However, for + large transient models you will likely use considerably more memory + and take more processing time for the memory reallocations. So, if it + is possible to provide this information "up front", it is recommended + to do so. + + +-------------------------------------------------------------------- +USERD_get_model_extents + + Description: + ----------- + Gets the model bounding box extents. If this routine supplys them + EnSight will not have to spend time doing so. If this routine + returns Z_ERR, EnSight will have to take the time to touch all the + nodes and gather the extent info. + + Specification: + ------------- + int USERD_get_model_extents(float extents[6]) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful (whereupon EnSight will determine by reading + all coords of all parts) + + Arguments: + --------- + (OUT) extents[0] = min x + [1] = max x + [2] = min y + [3] = max y + [4] = min z + [5] = max z + + Notes: + ----- + * This will be based on Current_time_step + + +-------------------------------------------------------------------- +USERD_get_name_of_reader + + Description: + ----------- + Gets the name of your user defined reader. The user interface will + ask for this and include it in the available reader list. + + Specification: + ------------- + int USERD_get_name_of_reader(char reader_name[Z_MAX_USERD_NAME], + int *two_fields) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (OUT) reader_name = the name of the your reader or data format. + (max length is Z_MAX_USERD_NAME, which is 20) + + (OUT) two_fields = FALSE if only one data field is + required. + TRUE if two data fields required + + -1 if one field (Geom) required + and one field (Param) is optional + Param field can contain any text + for example a file name, modifiers, + etc. that can be used to modify the + reader's behavior. + + + Notes: + ----- + * Always called. Please be sure to provide a name for your custom + reader format. + +-------------------------------------------------------------------- +USERD_get_nfaced_conn + + Description: + ----------- + Gets the array containing the connectivity of nsided faces of nfaced elements + + Specification: + -------------int + int USERD_get_nfaced_conn(int part_number, + int *nfaced_conn_array) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) part_number = the part number + + (OUT) nfaced_conn_array = 1D array of nsided face connectivies of nfaced + elements + + (int array will have been allocated long enough to + hold all the nsided face connectivities. Which is + the sum of all the nodes per face values in the + nfaced_npf_array of USERD_get_nfaced_nodes_per_face) + + Notes: + ----- + * Will not be called unless there are some nfaced elements in the part + + * Providing nfaced information to Ensight: + + 1. In USERD_get_gold_part_build_info, provide the number of nfaced + polyhedral elements in the part. + + 2. In USERD_get_part_elements_by_type, provide (in the conn_array), + the number of faces per nfaced element. (as if connectivity + length of an nfaced element is one) + + 3. In this routine, provide the streamed number of nodes per face + for each of the faces of the nfaced elements. + + + Simple example: 11 10 12 + +--------+-----+ + 2 nfaced elements: /| |\ /| + (1 7-faced / | | \ / | + 1 5-sided) / | | +9 | + / | | /| | + /7 | 8 / | | + +-----------+/ | | | + | |5 | |4 | |6 + | +-----|--+--|--+ + | / | \ | / + | / | \|/3 + | / | + + | / | / + |/1 |2 / + +-----------+/ + + 1. In USERD_get_gold_part_build_info: + number_of_elements[Z_NFACED] = 2 + . + /|\ + | + 2. In USERD_get_part_elements_by_type: + length of conn_array will be: 2 x 1 + for element_type of Z_NFACED: + conn_array[0][0] = 7 (for the 7-faced element) + conn_array[1][0] = 5 (for the 5-faced element) + + == + Sum 12 <---------+ + | + 3. In USERD_get_faced_nodes_per_face: | + length of nfaced_npf_array will be: 12 + + nfaced_npf_array[0] = 5 (5-noded top face of 7-faced element) + nfaced_npf_array[1] = 5 (5-noded bot face of 7-faced element) + nfaced_npf_array[2] = 4 (4-noded front face of 7-faced element) + nfaced_npf_array[3] = 4 (4-noded left face of 7-faced element) + nfaced_npf_array[4] = 4 (4-noded back face of 7-faced element) + nfaced_npf_array[5] = 4 (4-noded right front face of 7-faced element) + nfaced_npf_array[6] = 4 (4-noded right back face of 7-faced element) + + nfaced_npf_array[7] = 3 (3-noded top face of 5-faced element) + nfaced_npf_array[8] = 3 (3-noded bot face of 5-faced element) + nfaced_npf_array[9] = 4 (4-noded back face of 5-faced element) + nfaced_npf_array[10] = 4 (4-noded right face of 5-faced element) + nfaced_npf_array[11] = 4 (4-noded left front face of 5-faced element) + + == + Sum 48 <-------------+ + | + 4. In this function: | + length of the nfaced_conn_array will be: 48 + + nsided_conn_array[0] = 7 (conn of 5-noded top face of 7-faced elem) + nsided_conn_array[1] = 8 + nsided_conn_array[2] = 9 + nsided_conn_array[3] = 10 + nsided_conn_array[4] = 11 + + nsided_conn_array[5] = 1 (conn of 5-noded bot face of 7-faced elem) + nsided_conn_array[6] = 5 + nsided_conn_array[7] = 4 + nsided_conn_array[8] = 3 + nsided_conn_array[9] = 2 + + nsided_conn_array[10] = 1 (conn of 4-noded front face of 7-faced elem) + nsided_conn_array[11] = 2 + nsided_conn_array[12] = 8 + nsided_conn_array[13] = 7 + + nsided_conn_array[14] = 5 (conn of 4-noded left face of 7-faced elem) + nsided_conn_array[15] = 1 + nsided_conn_array[16] = 7 + nsided_conn_array[17] = 11 + + nsided_conn_array[18] = 4 (conn of 4-noded back face of 7-faced elem) + nsided_conn_array[19] = 5 + nsided_conn_array[20] = 11 + nsided_conn_array[21] = 10 + + nsided_conn_array[22] = 2 (conn of 4-noded right front face of 7-faced) + nsided_conn_array[23] = 3 + nsided_conn_array[24] = 9 + nsided_conn_array[25] = 8 + + nsided_conn_array[26] = 3 (conn of 4-noded right back face of 7-faced) + nsided_conn_array[27] = 4 + nsided_conn_array[28] = 10 + nsided_conn_array[29] = 9 + + nsided_conn_array[30] = 9 (conn of 3-noded top face of 5-faced elem) + nsided_conn_array[32] = 12 + nsided_conn_array[32] = 10 + + nsided_conn_array[33] = 3 (conn of 3-noded bot face of 5-faced elem) + nsided_conn_array[34] = 4 + nsided_conn_array[35] = 6 + + nsided_conn_array[36] = 6 (conn of 4-noded back face of 5-faced elem) + nsided_conn_array[37] = 4 + nsided_conn_array[38] = 10 + nsided_conn_array[39] = 12 + + nsided_conn_array[40] = 3 (conn of 4-noded right face of 5-faced elem) + nsided_conn_array[41] = 6 + nsided_conn_array[42] = 12 + nsided_conn_array[43] = 9 + + nsided_conn_array[44] = 4 (conn of 4-noded left front face of 5-faced) + nsided_conn_array[45] = 3 + nsided_conn_array[46] = 9 + nsided_conn_array[47] = 10 + + + +-------------------------------------------------------------------- +USERD_get_nfaced_nodes_per_face - + + Description: + ----------- + Gets the array containing the number of nodes per face for each face + of the nfaced elements. + + Specification: + ------------- + int USERD_get_nfaced_nodes_per_face(int part_number, + int *nfaced_npf_array) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) part_number = the part number + + (OUT) nfaced_npf_array = 1D array of nodes per face for all faces of + nfaced elements + + (int array will have been allocated long enough + to hold all the nodes_per_face values. Which is + the sum of all the number of faces per element + values in the conn_array of + USERD_get_part_elements_by_type) + + Notes: + ----- + * Will not be called unless there are some nfaced elements in the + the part + + * Providing nfaced information to Ensight: + + 1. In USERD_get_gold_part_build_info, provide the number of nfaced + polyhedral elements in the part. + + 2. In USERD_get_part_elements_by_type, provide (in the conn_array), + the number of faces per nfaced element. (as if connectivity + length of an nfaced element is one) + + 3. In this routine, provide the streamed number of nodes per face + for each of the faces of the nfaced elements. + + + Simple example: 11 10 12 + +--------+-----+ + 2 nfaced elements: /| |\ /| + (1 7-faced / | | \ / | + 1 5-sided) / | | +9 | + / | | /| | + /7 | 8 / | | + +-----------+/ | | | + | |5 | |4 | |6 + | +-----|--+--|--+ + | / | \ | / + | / | \|/3 + | / | + + | / | / + |/1 |2 / + +-----------+/ + + 1. In USERD_get_gold_part_build_info: + number_of_elements[Z_NFACED] = 2 + . + /|\ + | + 2. In USERD_get_part_elements_by_type: + length of conn_array will be: 2 x 1 + for element_type of Z_NFACED: + conn_array[0][0] = 7 (for the 7-faced element) + conn_array[1][0] = 5 (for the 5-faced element) + + == + Sum 12 <---------+ + | + 3. In this routine: | + length of nfaced_npf_array will be: 12 + + nfaced_npf_array[0] = 5 (5-noded top face of 7-faced element) + nfaced_npf_array[1] = 5 (5-noded bot face of 7-faced element) + nfaced_npf_array[2] = 4 (4-noded front face of 7-faced element) + nfaced_npf_array[3] = 4 (4-noded left face of 7-faced element) + nfaced_npf_array[4] = 4 (4-noded back face of 7-faced element) + nfaced_npf_array[5] = 4 (4-noded right front face of 7-faced element) + nfaced_npf_array[6] = 4 (4-noded right back face of 7-faced element) + + nfaced_npf_array[7] = 3 (3-noded top face of 5-faced element) + nfaced_npf_array[8] = 3 (3-noded bot face of 5-faced element) + nfaced_npf_array[9] = 4 (4-noded back face of 5-faced element) + nfaced_npf_array[10] = 4 (4-noded right face of 5-faced element) + nfaced_npf_array[11] = 4 (4-noded left front face of 5-faced element) + + == + Sum 48 <-------------+ + | + 4. In USERD_get_nfaced_conn: | + length of the nfaced_conn_array will be: 48 + + nsided_conn_array[0] = 7 (conn of 5-noded top face of 7-faced elem) + nsided_conn_array[1] = 8 + nsided_conn_array[2] = 9 + nsided_conn_array[3] = 10 + nsided_conn_array[4] = 11 + + nsided_conn_array[5] = 1 (conn of 5-noded bot face of 7-faced elem) + nsided_conn_array[6] = 5 + nsided_conn_array[7] = 4 + nsided_conn_array[8] = 3 + nsided_conn_array[9] = 2 + + nsided_conn_array[10] = 1 (conn of 4-noded front face of 7-faced elem) + nsided_conn_array[11] = 2 + nsided_conn_array[12] = 8 + nsided_conn_array[13] = 7 + + nsided_conn_array[14] = 5 (conn of 4-noded left face of 7-faced elem) + nsided_conn_array[15] = 1 + nsided_conn_array[16] = 7 + nsided_conn_array[17] = 11 + + nsided_conn_array[18] = 4 (conn of 4-noded back face of 7-faced elem) + nsided_conn_array[19] = 5 + nsided_conn_array[20] = 11 + nsided_conn_array[21] = 10 + + nsided_conn_array[22] = 2 (conn of 4-noded right front face of 7-faced) + nsided_conn_array[23] = 3 + nsided_conn_array[24] = 9 + nsided_conn_array[25] = 8 + + nsided_conn_array[26] = 3 (conn of 4-noded right back face of 7-faced) + nsided_conn_array[27] = 4 + nsided_conn_array[28] = 10 + nsided_conn_array[29] = 9 + + nsided_conn_array[30] = 9 (conn of 3-noded top face of 5-faced elem) + nsided_conn_array[32] = 12 + nsided_conn_array[32] = 10 + + nsided_conn_array[33] = 3 (conn of 3-noded bot face of 5-faced elem) + nsided_conn_array[34] = 4 + nsided_conn_array[35] = 6 + + nsided_conn_array[36] = 6 (conn of 4-noded back face of 5-faced elem) + nsided_conn_array[37] = 4 + nsided_conn_array[38] = 10 + nsided_conn_array[39] = 12 + + nsided_conn_array[40] = 3 (conn of 4-noded right face of 5-faced elem) + nsided_conn_array[41] = 6 + nsided_conn_array[42] = 12 + nsided_conn_array[43] = 9 + + nsided_conn_array[44] = 4 (conn of 4-noded left front face of 5-faced) + nsided_conn_array[45] = 3 + nsided_conn_array[46] = 9 + nsided_conn_array[47] = 10 + + + + +-------------------------------------------------------------------- +USERD_get_node_label_status + + Description: + ----------- + Answers the question as to whether node labels will be provided. + + Specification: + ------------- + int USERD_get_node_label_status( void ) + + Returns: + ------- + TRUE if node labels will be provided + FALSE if node labels will NOT be provided + + Arguments: + --------- + none + + Notes: + ----- + * Node ids are needed in order to do any node querying, or node + labeling on-screen within EnSight. + + * Prior to API 2.01: + ----------------- + For unstructured parts, you can read them from your file if + available, or can assign them, etc. They need to be unique + per part, and are often unique per model. They must also be + positive numbers greater than zero. + + USERD_get_part_node_ids is used to obtain the ids, if the + status returned here is TRUE. + + (Unlike API 1.0, where the connectivity of elements had to be + according to the node ids - API 2.0's element connectivities + are not affected either way by the status here.) + + For structured parts, EnSight will assign ids if you return a + status of TRUE here. You cannot assign them yourself!! + + * Starting at API 2.01: + -------------------- + For both unstructured and structured parts, you can read them + from your file if available, or can assign them, etc. They need + to be unique per part, and are often unique per model. They must + also be positive numbers greater than zero. + + USERD_get_part_node_ids is used to obtain the ids, if the + status returned here is TRUE. + + * Will call USERD_get_part_node_ids for each part if this routine + returns TRUE. + +-------------------------------------------------------------------- +USERD_get_nsided_conn - + + Description: + ----------- + Gets the array containing the connectivity of nsided elements + + Specification: + ------------- + int USERD_get_nsided_conn(int part_number, + int *nsided_conn_array) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) part_number = the part number + + (OUT) nsided_conn_array = 1D array of nsided connectivies + + (int array will have been allocated long enough + to hold all the nsided connectivities. Which is + the sum of all the nodes_per_element values in + the conn_array of USERD_get_part_elements_by_type) + + + Notes: + ----- + * Will not be called unless there are some nsided elements in the the part. + + * Providing nsided information to Ensight: + + 1. In USERD_get_gold_part_build_info, provide the number of nsided + elements in the part. + + 2. In USERD_get_part_elements_by_type, provide (in the conn_array), + the number of nodes per nsided element. (as if connectivity + length of an nsided element is one) + + 3. In this routine, provide the streamed connectivities for each of the + nsided elements. + + + Simple example: 5 6 + +--------+ + 3 nsided elements: /| \ + (1 4-sided / | \ + 1 3-sided / | \ + 1 7-sided) / | \ 7 + /3 |4 + + +-----+ | + | | | + | | |8 + | | + + | | / + | | / + | | / + |1 |2 /9 + +-----+--------+ + + 1. In USERD_get_gold_part_build_info: + number_of_elements[Z_NSIDED] = 3 + . + /|\ + | + 2. In USERD_get_part_elements_by_type: + length of conn_array will be: 3 x 1 + + for element_type of Z_NSIDED: + conn_array[0][0] = 4 (for the 4-sided element) + conn_array[1][0] = 3 (for the 3-sided element) + conn_array[2][0] = 7 (for the 7-sided element) + + Sum === + 14 <---------+ + | + 3. In this routine: | + length of nsided_conn_array will be: 14 + + nsided_conn_array[0] = 1 (connectivity of 4-sided element) + nsided_conn_array[1] = 2 + nsided_conn_array[2] = 4 + nsided_conn_array[3] = 3 + + nsided_conn_array[4] = 3 (connectivity of 3-sided element) + nsided_conn_array[5] = 4 + nsided_conn_array[6] = 5 + + nsided_conn_array[7] = 2 (connectivity of 7-sided element) + nsided_conn_array[8] = 9 + nsided_conn_array[9] = 8 + nsided_conn_array[10] = 7 + nsided_conn_array[11] = 6 + nsided_conn_array[12] = 5 + nsided_conn_array[13] = 4 + + + + +-------------------------------------------------------------------- +USERD_get_num_of_time_steps + + Description: + ----------- + Gets the number of time steps of data available for desired timeset. + + Specification: + ------------- + int USERD_get_num_of_time_steps( int timeset_number ) + + Returns: + ------- + Number of time steps in timeset (>0 if okay, <=0 if problems). + + Arguments: + --------- + (IN) timeset number = the timeset number + + For example: If USERD_get_number_of_timesets + returns 2, the valid + timeset_number's would be 1 and 2 + + Notes: + ----- + * This should be >= 1 1 indicates a static model + >1 indicates a transient model + + * Num_time_steps[timeset_number] would be set here + + + +-------------------------------------------------------------------- +USERD_get_number_of_files_in_dataset + + Description: + ----------- + Get the total number of files in the dataset. Used for the + dataset query option within EnSight. + + Specification: + ------------- + int USERD_get_number_of_files_in_dataset( void ) + + Returns: + ------- + The total number of files in the dataset. + + Arguments: + --------- + none + + Notes: + ----- + * You can be as complete as you want about this. If you don't + care about the dataset query option, return a value of 0 + If you only want certain files, you can just include them. But, + you will need to supply the info in USERD_get_dataset_query_file_info + for each file you include here. + + * Num_dataset_files would be set here + + +-------------------------------------------------------------------- +USERD_get_number_of_material_sets - + + Description: + ----------- + Get the number of material sets in the model + + Specification: + ------------- + int USERD_get_number_of_material_sets( void ) + + + Returns: + ------- + Num_material_sets = number of material sets + (Zero would indicate that you have no materials + to deal with in the model) + + or + + -1 if an error condition + + Arguments: + --------- + none + + Notes: + ----- + * You may want to keep this as a global for use in other routines. + + ############################################################### + NOTE: For EnSight 7.6, only one material set is supported + within EnSight. + Thus the only valid returns here are: + 0 (no materials) + 1 (for the one material set allowed) + or -1 (if an error) + + If the casefile has more than this, this reader will + read them, but EnSight will issue an error message and + choke on them! + ############################################################### + + ================================================================ + A very simple explanatory example, to use as a reference for the + materials routines: + + Given a 2D mesh composed of 9 quad (Z_QUA04) elements, with two materials. + Most of the model is material 1, but the top left corner is material 9 - + basically as shown: + + + *--------*--------*--------* + | | / | | + | Mat 9 / | | + | | / | | + | |/ | | + | e7 / e8 | e9 | + | /| | | + | / | | | + | / | | | + *----/---*--------*--------* + | / | | | + | / | | | + | / | Mat 1 | + |/ | | | + | e4 | e5 | e6 | + | | | | + | | | | + | | | | + *--------*--------*--------* + | | | | + | | | | + | | | | + | | | | + | e1 | e2 | e3 | + | | | | + | | | | + | | | | + *--------*--------*--------* + + + Thus, in this routine, set: + Num_material_sets = 1 + + In USERD_get_matf_set_info, set: + mat_set_ids[0] = 1 + mat_set_name[0] = "Material Set 1" (or whatever name desired) + + In USERD_get_number_of_materials, input would be set_index = 0, and + would need to set: + Num_materials[0] = 2 + + For simplicity, the ids and descriptions that would be returned in + USERD_get_matf_var_info could be: + mat_ids[0] = 1 + mat_ids[1] = 9 + mat_desc[0] = "mat 1" (or whatever desired) + mat_desc[2] = "mat 9" + + The per element material ids list would need to be: + + material ids: + ------------- + ids_list[0] = 1 (material id 1, for elem e1) + ids_list[1] = 1 ( " e2) + ids_list[2] = 1 ( " e3) + ids_list[3] = -1 (negative of index into mixed-material id list, for elem e4) + ids_list[5] = 1 (material id 1, for elem e5) + ids_list[5] = 1 ( " e6) + ids_list[5] = -5 (negative of index into mixed-material id list, for elem e7) + ids_list[5] = -9 ( " e8) + ids_list[5] = 1 (material id 1, for elem e9) + + Finally we need the mixed material ids list and the mixed materials values list, + which would need to be: + + mixed-material ids: + ------------------- + ==> 1 ids_list[0] = 2 (the -1 in the material variable points here, + 2 indicates that two materials are present) + 2 ids_list[1] = 1 (1st material is 1) + 3 ids_list[2] = 9 (2nd material is 9) + 4 ids_list[3] = -1 (negative of index into mixed-material val_list) + ==> 5 ids_list[4] = 2 (the -5 in the material variable points here, + 2 indicates that two materials are present) + 6 ids_list[5] = 1 (1st material is 1) + 7 ids_list[6] = 9 (2nd material is 9) + 8 ids_list[7] = -3 (negative of index into mixed-material val_list) + ==> 9 ids_list[8] = 2 etc. + 10 ids_list[9] = 1 + 11 ids_list[10] = 9 + 12 ids_list[11] = -5 + + mixed-material values: + ---------------------- + ==> 1 val_list[0] = 0.875 (the -1 in the mixed-material ids_list points here, + and this is the value for material 1) + 2 val_list[1] = 0.125 (the value for material 9) + ==> 3 val_list[2] = 0.125 (the -3 in the mixed-materials ids_list points here) + 4 val_list[3] = 0.875 + ==> 5 val_list[4] = 0.875 (the -5 in the mixed-materials ids_list points here) + 6 val_list[5] = 0.125 + + So, USERD_size_matf_data would need to return + matf_size = 8, when called with set_id = 1 + part_id = 1 + wtyp = Z_QUA04 + mat_type = Z_MAT_INDEX + + matf_size = 12, when called with set_id = 1 + part_id = 1 + mat_type = Z_MIX_INDEX + + = 6, when called with set_id = 1 + part_id = 1 + mat_type = Z_MIX_VALUE + + And, USERD_load_matf_data would need to return: + the int array ids_list as shown above when called with: + set_id = 1 + part_id = 1 + wtyp = Z_QUA04 + mat_type = Z_MAT_INDEX (indicating id list). + + the int array ids_list as shown above when called with: + set_id = 1 + part_id = 1 + mat_type = Z_MIX_INDEX (indicating id list). + + the float array val_list as shown above when called with: + set_id = 1 + part_id = 1 + mat_type = Z_MIX_VALUE (indicating val list). + + +------------------------------------------------------------------------- +USERD_get_number_of_materials + + Description: + ----------- + Gets the number of materials in the material set + + Specification: + ------------- + int USERD_get_number_of_materials( int set_index ) + + Returns: + ------- + Num_materials[set_index] = Number of materials in the set + 0 indicates no materials information present + -1 indicates an error + Arguments: + --------- + (IN) set_index = the material set index (zero based) + + Notes: + ----- + * See USERD_get_number_of_material_sets header for explanatory example + * Will not be called if Num_material_sets is zero + * You may want to keep this as a global for use in other routines. + + + +-------------------------------------------------------------------- +USERD_get_number_of_model_parts + + Description: + ----------- + Gets the total number of unstructured and structured parts + in the model, for which you can supply information. + + Specification: + ------------- + int USERD_get_number_of_model_parts( void ) + + Returns: + ------- + Number of parts (>0 if okay, <=0 if problems). + + Arguments: + --------- + none + + Notes: + ----- + * If going to have to read down through the parts in order to + know how many, you may want to build a table of pointers to + the various parts, so you can easily get to particular parts in + later processes. If you can simply read the number of parts + at the head of the file, then you would probably not build the + table at this time. + + * This routine would set Numparts_available, which is equal to + Num_unstructured_parts + Num_structured_blocks. + + + +-------------------------------------------------------------------- +USERD_get_number_of_timesets + + Description: + ----------- + Gets the number of timesets used in the model. + + Specification: + ------------- + int USERD_get_number_of_timesets( void ) + + Returns: + ------- + Number of timesets in the model + + Arguments: + --------- + none + + Notes: + ----- + * Num_timesets would be set here + + * If you have a static model, both geometry and variables, you should + return a value of zero. + + * If you have a transient model, then you should return one or more. + + For example: + + Geometry Variables No. of timesets + --------- ------------------------------ --------------- + static static 0 + static transient, all using same timeset 1 + + transient transient, all using same timeset as geom 1 + + static transient, using 3 different timesets 3 + + transient transient, using 3 different timesets and + none of them the same as the + geometry timeset 4 + etc. + + NOTE: ALL GEOMETRY MUST USE THE SAME TIMESET!!! You will have to provide + the timeset number to use + for geometry in: + USERD_get_geom_timeset_number + + Variables can use the same timeset as the geometry, or can use + other timesets. More than one variable can use the same timeset. + + example: changing geometry at 5 steps, 0.0, 1.0, 2.0, 3.0, 4.0 + variable 1 provided at these same five steps + variable 2 provided at 3 steps, 0.5, 1.25, 3.33 + + This routine should return a value of 2, because only + two different timesets are needed. Timeset 1 would be for the + geometry and variable 1 (they both use it). Timeset 2 would + be for variable 2, which needs its own in this case. + + + + + +-------------------------------------------------------------------- +USERD_get_number_of_variables + + Description: + ----------- + Get the number of variables for which you will be providing info. + + Specification: + ------------- + int USERD_get_number_of_variables( void ) + + Returns: + ------- + Number of variables (includes constant, scalar, vector and tensor types) + (>=0 if okay, <0 if problem) + + Arguments: + --------- + none + + Notes: + ----- + ***************************************************************** + * Variable numbers, by which references will be made, are implied + here. If you say there are 3 variables, the variable numbers + will be 1, 2, and 3. + ***************************************************************** + + * Num_variables would be set here + + + +-------------------------------------------------------------------- +USERD_get_part_coords + + Description: + ----------- + Gets the coordinates for an unstructured part. + + Specification: + ------------- + int USERD_get_part_coords(int part_number, float **coord_array) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) part_number = The part number + (1-based index of part table, namely: + + 1 ... Numparts_available. + + It is NOT the part_id that + is loaded in USERD_get_gold_part_build_info) + + (OUT) coord_array = 2D float array which contains, + x,y,z coordinates of each node + in the part. + + (IMPORTANT: The second dimension of this aray is 1-based!!!) + + (Array will have been allocated + 3 by (number_of_nodes + 1) for the part + long - see USERD_get_gold_part_build_info) + + + ex) If number_of_nodes = 100 + as obtained in: + USERD_get_gold_part_build_info + + Then the allocated dimensions of the + pointer sent to this routine will be: + coord_array[3][101] + + Ignore the coord_array[0][0] + coord_array[1][0] + coord_array[2][0] locations and start + the node coordinates at: + coord_array[0][1] + coord_array[1][1] + coord_array[2][1] + + coord_array[0][2] + coord_array[1][2] + coord_array[2][2] + + etc. + + Notes: + ----- + * Not called unless Num_unstructured_parts is > 0 + + * Will be based on Current_time_step + + +-------------------------------------------------------------------- +USERD_get_part_element_ids_by_type + + Description: + ----------- + Gets the ids for the elements of a particular type for an unstructured + or structured part. + + Specification: + ------------- + int USERD_get_part_element_ids_by_type(int part_number, + int element_type, + int *elemid_array) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) part_number = The part number + (1-based index of part table, namely: + + 1 ... Numparts_available. + + It is NOT the part_id that + is loaded in USERD_get_gold_part_build_info) + + (IN) element_type = One of the following (See global_extern.h) + Z_POINT node point element + Z_BAR02 2 node bar + Z_BAR03 3 node bar + Z_TRI03 3 node triangle + Z_TRI06 6 node triangle + Z_QUA04 4 node quad + Z_QUA08 8 node quad + Z_TET04 4 node tetrahedron + Z_TET10 10 node tetrahedron + Z_PYR05 5 node pyramid + Z_PYR13 13 node pyramid + Z_PEN06 6 node pentahedron + Z_PEN15 15 node pentahedron + Z_HEX08 8 node hexahedron + Z_HEX20 20 node hexahedron + + Z_G_POINT ghost node point element + Z_G_BAR02 2 node ghost bar + Z_G_BAR03 3 node ghost bar + Z_G_TRI03 3 node ghost triangle + Z_G_TRI06 6 node ghost triangle + Z_G_QUA04 4 node ghost quad + Z_G_QUA08 8 node ghost quad + Z_G_TET04 4 node ghost tetrahedron + Z_G_TET10 10 node ghost tetrahedron + Z_G_PYR05 5 node ghost pyramid + Z_G_PYR13 13 node ghost pyramid + Z_G_PEN06 6 node ghost pentahedron + Z_G_PEN15 15 node ghost pentahedron + Z_G_HEX08 8 node ghost hexahedron + Z_G_HEX20 20 node ghost hexahedron + + (OUT) elemid_array = 1D array containing id of each + element of the type. + + (Array will have been allocated + number_of_elements of the type long) + + ex) If number_of_elements[Z_TRI03] = 25 + number_of_elements[Z_QUA04] = 100 + number_of_elements[Z_HEX08] = 30 + as obtained in: + USERD_get_gold_part_build_info + + Then the allocated dimensions available + for this routine will be: + conn_array[25] when called with Z_TRI03 + + conn_array[100] when called with Z_QUA04 + + conn_array[30] when called with Z_HEX08 + + Notes: + ----- + * Not called unless element label status is set to TRUE in + USERD_get_element_label_status + + * Will be based on Current_time_step + + + +-------------------------------------------------------------------- +USERD_get_part_elements_by_type + + Description: + ----------- + Gets the connectivities for the elements of a particular type in an + unstructured part + + Specification: + ------------- + int USERD_get_part_elements_by_type(int part_number, + int element_type, + int **conn_array) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) part_number = The part number + (1-based index of part table, namely: + + 1 ... Numparts_available. + + It is NOT the part_id that + is loaded in USERD_get_gold_part_build_info) + + (IN) element_type = One of the following (See global_extern.h) + Z_POINT node point element + Z_BAR02 2 node bar + Z_BAR03 3 node bar + Z_TRI03 3 node triangle + Z_TRI06 6 node triangle + Z_QUA04 4 node quad + Z_QUA08 8 node quad + Z_TET04 4 node tetrahedron + Z_TET10 10 node tetrahedron + Z_PYR05 5 node pyramid + Z_PYR13 13 node pyramid + Z_PEN06 6 node pentahedron + Z_PEN15 15 node pentahedron + Z_HEX08 8 node hexahedron + Z_HEX20 20 node hexahedron + + Z_G_POINT ghost node point element + Z_G_BAR02 2 node ghost bar + Z_G_BAR03 3 node ghost bar + Z_G_TRI03 3 node ghost triangle + Z_G_TRI06 6 node ghost triangle + Z_G_QUA04 4 node ghost quad + Z_G_QUA08 8 node ghost quad + Z_G_TET04 4 node ghost tetrahedron + Z_G_TET10 10 node ghost tetrahedron + Z_G_PYR05 5 node ghost pyramid + Z_G_PYR13 13 node ghost pyramid + Z_G_PEN06 6 node ghost pentahedron + Z_G_PEN15 15 node ghost pentahedron + Z_G_HEX08 8 node ghost hexahedron + Z_G_HEX20 20 node ghost hexahedron + + + (OUT) conn_array = 2D array containing connectivity + of each element of the type. + + (Array will have been allocated + num_of_elements of the type by + connectivity length of the type) + + ex) If number_of_elements[Z_TRI03] = 25 + number_of_elements[Z_QUA04] = 100 + number_of_elements[Z_HEX08] = 30 + as obtained in: + USERD_get_gold_part_build_info + + Then the allocated dimensions available + for this routine will be: + conn_array[25][3] when called with Z_TRI03 + + conn_array[100][4] when called with Z_QUA04 + + conn_array[30][8] when called with Z_HEX08 + + Notes: + ----- + * Not called unless Num_unstructured_parts is > 0 + + * Will be based on Current_time_step + + +-------------------------------------------------------------------- +USERD_get_part_node_ids + + Description: + ----------- + Gets the node ids of an unstructured or structured part. + + Specification: + ------------- + int USERD_get_part_node_ids(int part_number, int *nodeid_array) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) part_number = The part number + (1-based index of part table, namely: + + 1 ... Numparts_available. + + It is NOT the part_id that + is loaded in USERD_get_gold_part_build_info) + + (OUT) nodeid_array = 1D array containing node ids of + each node in the part. + + (IMPORTANT: This array is 1-based!!!) + + (Array will have been allocated + (number_of_nodes + 1) for the part long + see USERD_get_gold_part_build_info) + + ex) If number_of_nodes = 100 + as obtained in: + USERD_get_gold_part_build_info + + Then the allocated dimensions of the + pointer sent to this routine will be: + nodeid_array[101] + + Ignore the nodeid_array[0] location and start + the node ids at: + nodeid_array[1] + + nodeid_array[2] + + etc. + + Notes: + ----- + * Not called unless node label status is TRUE, as returned from + USERD_get_node_label_status + + * Will be based on Current_time_step + + * The ids are purely labels, used when displaying or querying node ids. + However, any node id < 0 will never be displayed + + +-------------------------------------------------------------------- +USERD_get_reader_descrip + + Description: + ----------- + Gets the description of the reader, so gui can give more info + + Specification: + ------------- + int USERD_get_reader_descrip(char descrip[Z_MAXFILENP]) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (OUT) descrip = the description of the reader (max length is MAXFILENP, + which is 255) + + Notes: + ----- + * OPTIONAL ROUTINE! You can have it or not. + + + +-------------------------------------------------------------------- +USERD_get_reader_version + + Description: + ----------- + Gets the version number of the user defined reader + + Specification: + ------------- + int USERD_get_reader_version(char version_number[Z_MAX_USERD_NAME]) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful (and will assume is version 1.0) + + Arguments: + --------- + (OUT) version_number = the version number of the reader + (max length is Z_MAX_USERD_NAME, which + is 20) + + Notes: + ----- + * This needs to be "2.000" or greater. Otherwise EnSight will assume + this reader is API 1.0 + + * should set it to "2.010" for this version of the API + + + + +-------------------------------------------------------------------- +USERD_get_sol_times + + Description: + ----------- + Get the solution times associated with each time step for + desired timeset. + + Specification: + ------------- + int USERD_get_sol_times(int timeset_number, + float *solution_times) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) timeset_number = the timeset number + + For example: If USERD_get_number_of_timesets + returns 2, the valid + timeset_number's would be 1 and 2 + + (OUT) solution_times = 1D array of solution times per time step + + (Array will have been allocated + Num_time_steps[timeset_number] long) + + Notes: + ----- + * The solution times must be non-negative and increasing. + + + +-------------------------------------------------------------------- +USERD_get_timeset_description - + + Description: + ----------- + Get the description to associate with the desired timeset. + + Specification: + ------------- + int USERD_get_timeset_description(int timeset_number, + char timeset_description[Z_BUFL]) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) timeset_number = the timeset number + + For example: If USERD_get_number_of_timesets + returns 2, the valid + timeset_number's would be 1 and 2 + + (OUT) timeset_description = timeset description string + + + Notes: + ----- + * A string of NULLs is valid for timeset_description + + + + +-------------------------------------------------------------------- +USERD_get_var_by_component + + Description: + ----------- + Gets the values of a variable component. Both unstructured and structured + parts use this routine. + + if Z_PER_NODE: + Get the component value at each node for a given variable in the part. + + or if Z_PER_ELEM: + Get the component value at each element of a specific part and type + for a given variable. + + Specification: + ------------- + int USERD_get_var_by_component(int which_variable, + int which_part, + int var_type, + int which_type, + int imag_data, + int component, + float *var_array) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + or: Z_UNDEF, in which case you need not load any values into var_array + + + Arguments: + --------- + (IN) which_variable = The variable number + + (IN) which_part Since EnSight Version 7.4 + ------------------------- + = The part number + + (1-based index of part table, namely: + + 1 ... Numparts_available. + + It is NOT the part_id that + is loaded in USERD_get_gold_part_build_info) + + Prior to EnSight Version 7.4 + ---------------------------- + = The part id This is the part_id label loaded + in USERD_get_gold_part_build_info. + It is NOT the part table index. + + (IN) var_type = Z_SCALAR + Z_VECTOR + Z_TENSOR (symmetric tensor) + Z_TENSOR9 (asymmetric tensor) + + (IN) which_type + + if Z_PER_NODE: Not used + + if Z_PER_ELEM: = The element type + Z_POINT node point element + Z_BAR02 2 node bar + Z_BAR03 3 node bar + Z_TRI03 3 node triangle + Z_TRI06 6 node triangle + Z_QUA04 4 node quad + Z_QUA08 8 node quad + Z_TET04 4 node tetrahedron + Z_TET10 10 node tetrahedron + Z_PYR05 5 node pyramid + Z_PYR13 13 node pyramid + Z_PEN06 6 node pentahedron + Z_PEN15 15 node pentahedron + Z_HEX08 8 node hexahedron + Z_HEX20 20 node hexahedron + + Z_G_POINT ghost node point element + Z_G_BAR02 2 node ghost bar + Z_G_BAR03 3 node ghost bar + Z_G_TRI03 3 node ghost triangle + Z_G_TRI06 6 node ghost triangle + Z_G_QUA04 4 node ghost quad + Z_G_QUA08 8 node ghost quad + Z_G_TET04 4 node ghost tetrahedron + Z_G_TET10 10 node ghost tetrahedron + Z_G_PYR05 5 node ghost pyramid + Z_G_PYR13 13 node ghost pyramid + Z_G_PEN06 6 node ghost pentahedron + Z_G_PEN15 15 node ghost pentahedron + Z_G_HEX08 8 node ghost hexahedron + Z_G_HEX20 20 node ghost hexahedron + + (IN) imag_data = TRUE if imag component + FALSE if real component + + (IN) component = The component: (0 if Z_SCALAR) + (0 - 2 if Z_VECTOR) + (0 - 5 if Z_TENSOR) + (0 - 8 if Z_TENSOR9) + + * 6 Symmetric Indicies, 0:5 * + * ---------------------------- * + * | 11 12 13 | | 0 3 4 | * + * | | | | * + * T = | 22 23 | = | 1 5 | * + * | | | | * + * | 33 | | 2 | * + + + * 9 General Indicies, 0:8 * + * ---------------------------- * + * | 11 12 13 | | 0 3 4 | * + * | | | | * + * T = | 21 22 23 | = | 6 1 5 | * + * | | | | * + * | 31 32 33 | | 7 8 2 | * + + (OUT) var_array + + ----------------------------------------------------------------------- + (IMPORTANT: this array is 1-based for both Z_PER_NODE and Z_PER_ELEM!!!) + ----------------------------------------------------------------------- + + if Z_PER_NODE: = 1D array containing variable component value + for each node. + + (Array will have been allocated + (number_of_nodes + 1) long) + + Info stored in this fashion: + var_array[0] = not used + var_array[1] = var component for node 1 of part + var_array[2] = var_component for node 2 of part + var_array[3] = var_component for node 3 of part + etc. + + if Z_PER_ELEM: = 1D array containing variable component + value for each element of a particular + part and type. + + (Array will have been allocated + (number_of_elements[which_part][which_type] + 1) + long. See USERD_get_gold_part_build_info) + + Info stored in this fashion: + var_array[1] = var component for elem 1 (of part and type) + var_array[2] = var component for elem 2 (of part and type) + var_array[3] = var component for elem 3 (of part and type) + etc. + + Notes: + ----- + * Not called unless Num_variables is > 0 + + * The per_node or per_elem classification must be obtainable from the + variable number (a var_classify array needs to be retained) + + * Will be based on Current_time_step + + * If the variable is not defined for this part, simply return with a + value of Z_UNDEF. EnSight will treat the variable as undefined for + this part. + + +-------------------------------------------------------------------- +USERD_get_var_value_at_specific + + Description: + ----------- + if Z_PER_NODE: + Get the value of a particular variable at a particular node in a + particular part at a particular time. + + or if Z_PER_ELEM: + Get the value of a particular variable at a particular element of + a particular type in a particular part at a particular time. + + + Specification: + ------------- + int USERD_get_var_value_at_specific(int which_var, + int which_node_or_elem, + int which_part, + int which_elem_type, + int time_step, + float values[3], + int imag_data) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) which_var = The variable number + + (IN) which_node_or_elem + + If Z_PER_NODE: + = The node number. This is not the id, but is + the index of the global node + list (1 based), or the block's + node list (1 based). + + Thus, coord_array[1] + coord_array[2] + coord_array[3] + . | + . |which_node_or_elem index + . ---- + + + If Z_PER_ELEM: + = The element number. This is not the id, but is + the element number index + of the number_of_element array + (see USERD_get_gold_part_build_info), + or the block's element list (1 based). + + Thus, for which_part: + conn_array[which_elem_type][0] + conn_array[which_elem_type][1] + conn_array[which_elem_type][2] + . | + . which_node_or_elem index + . ---- + + + (IN) which_part Since EnSight Version 7.4 + ------------------------- + = The part number + + (1-based index of part table, namely: + + 1 ... Numparts_available. + + It is NOT the part_id that + is loaded in USERD_get_gold_part_build_info) + + Prior to EnSight Version 7.4 + ---------------------------- + = The part id This is the part_id label loaded + in USERD_get_gold_part_build_info. + It is NOT the part table index. + + + (IN) which_elem_type + + If Z_PER_NODE, or block part: + = Not used + + If Z_PER_ELEM: + = The element type. This is the element type index + of the number_of_element array + (see USERD_get_gold_part_build_info) + + (IN) time_step = The time step + + (IN) imag_data = TRUE if want imaginary value. + FALSE if want real value. + + (OUT) values = scalar or vector component value(s) + values[0] = scalar or vector[0] + values[1] = vector[1] + values[2] = vector[2] + + + Notes: + ----- + * This routine is used in node querys over time (or element querys over + time for Z_PER_ELEM variables). If these operations are not critical + to you, this can be a dummy routine. + + * The per_node or per_elem classification must be obtainable from the + variable number (a var_classify array needs to be retained) + + * The time step given is for the proper variable timeset. + + +---------------------------------------------------------------------- +USERD_load_matf_data + + Description: + ----------- + Get the material id list, mixed-material id list, or + mixed-material values list for the given material set and part (and + element type if material id list) + + Specification: + ------------- + int USERD_load_matf_data( int set_index, + int part_id, + int wtyp, + int mat_type, + int *ids_list, + float *val_list) + + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) set_index = the material set index (zero based) + + (IN) part_id = the part number desired + + (IN) wtyp = the element type (used for Z_MAT_INDEX only) + + Z_POINT node point element + Z_BAR02 2 node bar + Z_BAR03 3 node bar + Z_TRI03 3 node triangle + Z_TRI06 6 node triangle + Z_QUA04 4 node quad + Z_QUA08 8 node quad + Z_TET04 4 node tetrahedron + Z_TET10 10 node tetrahedron + Z_PYR05 5 node pyramid + Z_PYR13 13 node pyramid + Z_PEN06 6 node pentahedron + Z_PEN15 15 node pentahedron + Z_HEX08 8 node hexahedron + Z_HEX20 20 node hexahedron + Z_NSIDED nsided polygon + Z_NFACED nfaced polyhedron + + Z_G_POINT ghost node point element + Z_G_BAR02 2 node ghost bar + Z_G_BAR03 3 node ghost bar + Z_G_TRI03 3 node ghost triangle + Z_G_TRI06 6 node ghost triangle + Z_G_QUA04 4 node ghost quad + Z_G_QUA08 8 node ghost quad + Z_G_TET04 4 node ghost tetrahedron + Z_G_TET10 10 node ghost tetrahedron + Z_G_PYR05 5 node ghost pyramid + Z_G_PYR13 13 node ghost pyramid + Z_G_PEN06 6 node ghost pentahedron + Z_G_PEN15 15 node ghost pentahedron + Z_G_HEX08 8 node ghost hexahedron + Z_G_HEX20 20 node ghost hexahedron + Z_G_NSIDED ghost nsided polygon + Z_G_NFACED ghost nfaced polyhedron + + (IN) mat_type = Z_MAT_INDEX for material ids list + Z_MIX_INDEX for mixed-material ids list + Z_MIX_VALUE for mixed-material values list + + (OUT) ids_list = If mat_type is Z_MAT_INDEX: + --------------------------- + 1D material id list + (Int array will have been allocated + the appropriate size, as returned in + USERD_size_matf_data for mat_type Z_MAT_INDEX) + + If mat_type is Z_MIX_INDEX: + --------------------------- + 1D mixed-material id list + (Int array will have been allocated + the appropriate size, as returned in + USERD_size_matf_data for mat_type Z_MIX_INDEX) + + (OUT) val_list = 1D mixed-materials values list + (only used if mat_type is Z_MIX_VALUE) + + (Float array will have been allocated + the appropriate size, as returned in + USERD_size_matf_data for mat_type Z_MIX_VALUE) + + Notes: + ----- + * See USERD_get_number_of_material_sets header for explanatory example + * Will not be called if Num_material_sets is zero, + or Num_materials[set_index] is zero, + or the appropriate size from USERD_size_matf_data is zero + + + +-------------------------------------------------------------------- +USERD_set_filenames + + Description: + ----------- + Receives the geometry and result filenames entered in the data + dialog. The user written code will have to store and use these + as needed. The user written code must manage its own files!! + + Specification: + ------------- + int USERD_set_filenames(char filename_1[], + char filename_2[], + char the_path[], + int swapbytes) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) filename_1 = the filename entered into the geometry + field of the data dialog. + + (IN) param_2 = The usage of this string depends on + 'two_fields' in USERD_get_name_of_reader. + + If two_fields is FALSE then it's empty. + + If two_fields is TRUE, this is the + manditory results file entered + into the result field of the data dialog. + + If two_fields is -1, then this contains + optional text (filenames, modifiers, etc.) + that can be parsed and used to modify + reader + + (IN) the_path = the path info from the data dialog. + Note: filename_1 and filename_2 have already + had the path prepended to them. This + is provided in case it is needed for + filenames contained in one of the files + + (IN) swapbytes = TRUE if should swap bytes when reading data. + = FALSE normally. + + Notes: + ----- + * Since you must manage everything from the input that is entered in + these data dialog fields, this is an important routine! + + * It may be that you will need to have an executive type file that contains + info and other filenames within it, like EnSight6's case file. + + +-------------------------------------------------------------------- +USERD_set_server_number + + Description: + ----------- + Receives the server number of how many total servers. + + Specification: + ------------- + int USERD_set_server_number(int cur_serv, + int tot_servs) + + Returns: + ------- + nothing + + Arguments: + --------- + (IN) cur_serv = the current server. + + (IN) tot_servs = the total number of servers. + + Notes: + ----- + * Only useful if your user defined reader is being used with EnSight's + Server-of-Server capability. And even then, it may or may not be + something that you can take advantage of. If your data is already + partitioned in some manner, such that you can access the proper + portions using this information. + + For all non-SOS uses, this will simply be 1 of 1 + + + +-------------------------------------------------------------------- +USERD_set_time_set_and_step + + Description: + ----------- + Set the current time step in the desired timeset. All functions that + need time, and that do not explicitly pass it in, will use the timeset + and step set by this routine, if needed. + + Specification: + ------------- + void USERD_set_time_set_and_step(int timeset_number, + int time_step) + + Returns: + ------- + nothing + + Arguments: + --------- + (IN) timeset_number = the timeset number (1 based). + + For example: If USERD_get_number_of_timesets + returns 2, the valid timeset_number's + would be 1 and 2. + + (IN) time_step = The current time step to set + + Notes: + ----- + * Current_time_step and Current_timeset would be set here + + +-------------------------------------------------------------------- +USERD_size_matf_data + + Description: + ----------- + Get the length of the material id list, mixed-material id list, or + mixed-material values list for the given material set and part (and + element type if material id list) + + Specification: + ------------- + int USERD_size_matf_data( int set_index, + int part_id, + int wtyp, + int mat_type, + int *matf_size) + + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) set_index = the material set index (zero based) + + (IN) part_id = the part number desired + + (IN) wtyp = the element type (used for Z_MAT_INDEX only) + + Z_POINT node point element + Z_BAR02 2 node bar + Z_BAR03 3 node bar + Z_TRI03 3 node triangle + Z_TRI06 6 node triangle + Z_QUA04 4 node quad + Z_QUA08 8 node quad + Z_TET04 4 node tetrahedron + Z_TET10 10 node tetrahedron + Z_PYR05 5 node pyramid + Z_PYR13 13 node pyramid + Z_PEN06 6 node pentahedron + Z_PEN15 15 node pentahedron + Z_HEX08 8 node hexahedron + Z_HEX20 20 node hexahedron + Z_NSIDED nsided polygon + Z_NFACED nfaced polyhedron + + Z_G_POINT ghost node point element + Z_G_BAR02 2 node ghost bar + Z_G_BAR03 3 node ghost bar + Z_G_TRI03 3 node ghost triangle + Z_G_TRI06 6 node ghost triangle + Z_G_QUA04 4 node ghost quad + Z_G_QUA08 8 node ghost quad + Z_G_TET04 4 node ghost tetrahedron + Z_G_TET10 10 node ghost tetrahedron + Z_G_PYR05 5 node ghost pyramid + Z_G_PYR13 13 node ghost pyramid + Z_G_PEN06 6 node ghost pentahedron + Z_G_PEN15 15 node ghost pentahedron + Z_G_HEX08 8 node ghost hexahedron + Z_G_HEX20 20 node ghost hexahedron + Z_G_NSIDED ghost nsided polygon + Z_G_NFACED ghost nfaced polyhedron + + (IN) mat_type = Z_MAT_INDEX for material ids list + Z_MIX_INDEX for mixed-material ids list + Z_MIX_VALUE for mixed-material values list + + (OUT) matf_size = the length of the material id list, or + mixed-material id list, or + mixed-material values list + for the given material set and part number + (and element type if Z_MAT_INDEX) + + Notes: + ----- + * See USERD_get_number_of_material_sets header for explanatory example + * Will not be called if Num_material_sets is zero, or + Num_materials[set_index] is zero + + + + +-------------------------------------------------------------------- +USERD_stop_part_building + + Description: + ----------- + This routine called when the part building dialog is closed. It is + provided in case you desire to release memory, etc. that was only needed + during the part building process. + + Specification: + ------------- + void USERD_stop_part_building( void ) + + Returns: + ------- + nothing + + Arguments: + --------- + none + + Notes: + ----- + +-------------------------------------------------------------------- +USERD_rigidbody_existence + + Description: + ----------- + Gets the existence of rigid body values or not in the model + + Specification: + ------------- + int USERD_rigidbody_existence( void ) + + Returns: + ------- + Z_OK if rigid body values exist for the model + Z_UNDEF if no rigid body values exist + Z_ERR if an error + + Arguments: + --------- + none + + Notes: + ----- + * This will be based on Current_time_step + + +-------------------------------------------------------------------- +USERD_rigidbody_values + + Description: + ----------- + Gets the rigid body values for each part + + Specification: + ------------- + int USERD_rigidbody_values(int part_number, + float values[7]) + + Returns: + ------- + Z_OK if rigid body values exist for the model + Z_UNDEF if no rigid body values exist + Z_ERR if an error + + Arguments: + --------- + (IN) part_number = The part number + + (1-based index of part table, namely: + + 1 ... Numparts_available. + + It is NOT the part_id that + is loaded in USERD_get_gold_part_build_info) + + (OUT) values values[0] = IX (x location) + values[1] = IY (y location) + values[2] = IZ (z location) + values[3] = E0 (e0 euler value) + values[4] = E1 (e1 euler value) + values[5] = E2 (e2 euler value) + values[6] = E3 (e3 euler value) + + + Notes: + ----- + * This will be based on Current_time_step + * It will not be called unless USERD_rigidbody_existence indicates + that there are some values in the model by returning Z_OK. + + +-------------------------------------------------------------------- +USERD_set_right_side + + Description: + ----------- + Informs the reader that the time currently set is the right side of a time + span used for variable interpolation between time steps + + Specification: + ------------- + void USERD_set_right_side( void ) + + Returns: + ------- + + Arguments: + --------- + none + + Notes: + ----- + * Applies to Current_time_step + + + + + +------------------------------------------------------------------ + ENHANCED GUI ROUTINES + +-------------------------------------------------------------------- +USERD_get_extra_gui_numbers + + Description: + ----------- + The Enhanced GUI routines are added to allow + the user to customize a portion of the Data + Reader dialog to pass in options to their + user defined reader. + + Specification: + ------------- + void USERD__get_extra_gui_numbers(int *num_Toggles, + int *num_pulldowns, + int *num_fields) + + Returns: + ------- + + Arguments: + --------- + (OUT) num_Toggles = number of toggles that will be provided + + num_pulldowns = number of pulldowns that will be provided + + num_fields = number of fields that will be provided + + Notes: + ----- + There are three routines that work together: + USERD_get_extra_gui_numbers + USERD_get_extra_gui_defaults + USERD_set_extra_gui_data + + The existence of these routine indicates that + you wish to add customize entries to the + Data Reader dialog. + + If you don't want the extra GUI features, + simply delete these routines, or change their + names to something such as + USERD_DISABLED_get_extra_gui_defaults + + The presence of these routines + will ensure that EnSight will call them and + use their data to modify the extraction parameters set + with some or all of the following: + toggles, pulldown menu and fields. + + The user can then interact with the enhanced + GUI and then send their choices to + USERD_set_extra_gui_data + + Therefore if USERD_get_extra_gui_numbers + exists then the other two must exist. + + If none exist, then the GUI will be unchanged. + + Toggle data will return an integer + TRUE if checked + FALSE if unchecked + + Pulldown menu will return an integer representing + the menu item selected + + Field will return a string Z_LEN_GUI_FIELD_STR long. + + If all the enhanced GUI features are enabled it + might look something like this + + =================================================== + [] Title 1 [X] Title 3 + [X]Title 2 [X] Title 4 + + Pulldown Menu -> + Menu Choice 1 + Menu Choice 2 + Menu Choice 3 + + Data Field Title 1 ____________________________ + + Data Field Title 2 ____________________________ + ===================================================== + + This routine defines the numbers of toggles, pulldowns & fields + + The following are defined in the global_extern.h + Z_MAX_NUM_GUI_PULL_ITEMS max num GUI pulldowns + Z_LEN_GUI_PULL_STR max length of GUI pulldown string + Z_LEN_GUI_FIELD_STR max length of field string + Z_LEN_GUI_TITLE_STR max length of title string + + The library is loaded, this routine is + called, then the library is unloaded. + + Do not define globals in this routine + as when the library is unloaded, you'll + lose them. + + +-------------------------------------------------------------------- +USERD_get_extra_gui_defaults + + Description: + ----------- + This routine defines the Titles, status, + List choices, strings, etc that are fed + up to the GUI. + + Specification: + ------------- + int USERD_get_extra_gui_defaults(char **toggle_Title, + int *toggle_default_status, + char **pulldown_Title, + int *pulldown_number_in_list, + int *pulldown_default_selection, + char ***pulldown_item_strings, + char **field_Title, + char **field_user_string) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (OUT) toggle_Title = title for each toggle + array dimension is [num_toggles] by + [Z_LEN_GUI_TITLE_STR] long + + toggle_default_status = Setting for each toggle (TRUE or FALSE) + array dimension is [num_toggles] long + + pulldown_Title = title for each pulldown + array dimension is [num_pulldowns] by + [Z_LEN_GUI_TITLE_STR] long + + pulldown_number_in_list = number of items in each pulldown + array dimension is [num_pulldowns] long + + pulldown_default_selection = pulldown item selection for each pulldown + array dimension is [num_pulldowns] long + + pulldown_item_strings = pulldown item strings + array is [num_pulldowns] by + [Z_MAX_NUM_GUI_PULL_ITEMS] by + [Z_LEN_GUI_PULL_STR] long + + field_Title = title for each field + array dimension is [num_fields] by + [Z_LEN_GUI_TITLE_STR] long + + field_user_string = content of the field + array dimension is [num_fields] by + [Z_LEN_GUI_TITLE_STR] long + + + + Notes: + ----- + * The library is loaded, this routine is called, then the library is unloaded. + + * Do not define globals in this routine as when the library is unloaded, you'll + lose them. + + + +-------------------------------------------------------------------- +USERD_set_extra_gui_data + + Description: + ----------- + This routine sets the new values for the toggles, pulldowns, and fields. + + Specification: + ------------- + void USERD_set_extra_gui_data( + int *toggle, /* [num_toggle] */ + int *pulldown, /* [num_pulldown] */ + char **field_text /* [num_fields][Z_LEN_GUI_FIELD_STR]*/) + + Returns: + ------- + + Arguments: + --------- + (IN) toggle = setting for each toggle. TRUE or FALSE + array dimension is [num_toggles] long + + pulldown = item chosen in each pulldown. (0 based) + array dimension is [num_pulldowns] long + + field_text = content of the field + array dimension is [num_fields] by + [Z_LEN_GUI_TITLE_STR] long + + + Notes: + ----- + * This routine is called when the library is permanently + loaded to the EnSight session, so define your globals + in this and later routines. + + * It's up to you to change your reader behavior according to + user entries! + + + +-------------------------------------------------------------------- +USERD_get_var_extract_gui_numbers + + Description: + ----------- + The Var_Extract_GUI routines are added to allow + the user to customize a extraction parameters + for variables "after" the file has been read. + These things can be modified and the variables will + be update/refreshed according to the new parameters set + + Specification: + ------------- + void USERD_get_var_extract_gui_numbers(int *num_Toggles, + int *num_pulldowns, + int *num_fields) + + + Returns: + ------- + + Arguments: + --------- + (OUT) num_Toggles = number of toggles that will be provided + + num_pulldowns = number of pulldowns that will be provided + + num_fields = number of fields that will be provided + + Notes: + ----- + There are three routines that work together: + USERD_get_var_extract_gui_numbers + USERD_get_var_extract_gui_defaults (this one) + USERD_set_var_extract_gui_data + + The existence of these routine indicates that + you wish to have the Var Extract Parameters dialog. + + If you don't want the extra GUI features, + simply delete these routines, or change their + names to something such as + USERD_DISABLED_get_var_extract_gui_defaults + + The presence of these routines + will ensure that EnSight will call them and + use their data to modify the extraction parameters set + with some or all of the following: + toggles, pulldown menu and fields. + + The user can then interact with the enhanced + GUI and then send their choices to + USERD_set_extra_gui_data + + Therefore if USERD_get_var_extract_gui_numbers + exists then the other two must exist. + + If none exist, then the GUI will be unchanged. + + Toggle data will return an integer + TRUE if checked + FALSE if unchecked + + Pulldown menu will return an integer representing + the menu item selected + + Field will return a string Z_LEN_GUI_FIELD_STR long. + + If all the enhanced GUI features are enabled it + might look something like this + + =================================================== + [] Title 1 [X] Title 3 + [X]Title 2 [X] Title 4 + + Pulldown Menu -> + Menu Choice 1 + Menu Choice 2 + Menu Choice 3 + + Data Field Title 1 ____________________________ + + Data Field Title 2 ____________________________ + ===================================================== + + This routine defines the numbers of toggles, pulldowns & fields + + The following are defined in the global_extern.h + Z_MAX_NUM_GUI_PULL_ITEMS max num GUI pulldowns + Z_LEN_GUI_PULL_STR max length of GUI pulldown string + Z_LEN_GUI_FIELD_STR max length of field string + Z_LEN_GUI_TITLE_STR max length of title string + + The library is loaded, this routine is + called, then the library is unloaded. + + Do not define globals in this routine + as when the library is unloaded, you'll + lose them. + + +-------------------------------------------------------------------- +USERD_get_var_extract_gui_defaults + + Description: + ----------- + This routine defines the Titles, status, + List choices, strings, etc that are fed + up to the GUI. + + Specification: + ------------- + int USERD_get_var_extract_gui_defaults(char **toggle_Title, + int *toggle_default_status, + char **pulldown_Title, + int *pulldown_number_in_list, + int *pulldown_default_selection, + char ***pulldown_item_strings, + char **field_Title, + char **field_user_string) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (OUT) toggle_Title = title for each toggle + array dimension is [num_toggles] by + [Z_LEN_GUI_TITLE_STR] long + + toggle_default_status = Setting for each toggle (TRUE or FALSE) + array dimension is [num_toggles] long + + pulldown_Title = title for each pulldown + array dimension is [num_pulldowns] by + [Z_LEN_GUI_TITLE_STR] long + + pulldown_number_in_list = number of items in each pulldown + array dimension is [num_pulldowns] long + + pulldown_default_selection = pulldown item selection for each pulldown + array dimension is [num_pulldowns] long + + pulldown_item_strings = pulldown item strings + array is [num_pulldowns] by + [Z_MAX_NUM_GUI_PULL_ITEMS] by + [Z_LEN_GUI_PULL_STR] long + + field_Title = title for each field + array dimension is [num_fields] by + [Z_LEN_GUI_TITLE_STR] long + + field_user_string = content of the field + array dimension is [num_fields] by + [Z_LEN_GUI_TITLE_STR] long + + + + Notes: + ----- + * The library is loaded, this routine is called, then the library is unloaded. + + * Do not define globals in this routine as when the library is unloaded, you'll + lose them. + + + +-------------------------------------------------------------------- +USERD_set_var_extract_gui_data + + Description: + ----------- + This routine sets the new values for the toggles, pulldowns, and fields. + + Specification: + ------------- + void USERD_set_var_extract_gui_data( + int *toggle, /* [num_toggle] */ + int *pulldown, /* [num_pulldown] */ + char **field_text /* [num_fields][Z_LEN_GUI_FIELD_STR]*/) + + Returns: + ------- + + Arguments: + --------- + (IN) toggle = setting for each toggle. TRUE or FALSE + array dimension is [num_toggles] long + + pulldown = item chosen in each pulldown. (0 based) + array dimension is [num_pulldowns] long + + field_text = content of the field + array dimension is [num_fields] by + [Z_LEN_GUI_TITLE_STR] long + + + Notes: + ----- + * This routine is called when the library is permanently + loaded to the EnSight session, so define your globals + in this and later routines. + + * It's up to you to change your reader behavior according to + user entries! + + + + + +----------------------------------------------------------------------------------- +/* ---------------------------------------------------------- + * New in EnSight 8 is the capability to remove (fail) elements + * based on variable threshold values. Basically the variable + * name, a couple of thresholds, a couple of values and a logic + * criteria are read in from this routine. Every element that + * satisfies the failure criteria is removed and not used in + * EnSight calculations. + * + * Example Failure criteria + * Let fail_var_name = "fail_flag" + * threshold_val1 = 0 + * threshold_operator1 = Z_EQUAL_TO + * logic_criteria2 not used + * threshold_val2 not used + * threshold_operator2 not used + * For each value of "fail_flag" at each element, + * if fail flag == threshold_val1 (0.0) then element fails + * Return (Z_ERR) if this is not used. + * Return (Z_OK) if failed element feature should be used + * + * threshold_operator1 & 2 can be one of the following + * Z_ELE_FAILED_NONE, - disables checking + * Z_ELE_FAILED_GREATER, - greater than + * Z_ELE_FAILED_LESS, - less than + * Z_ELE_FAILED_EQUAL, - equal + * Z_ELE_FAILED_NOT_EQUAL, - not equal + * Z_ELE_FAILED_MANY - not used + * + * logic_criteria2 + * Z_ELE_FAILED_LOGIC_NONE, + * Z_ELE_FAILED_LOGIC_AND, + * Z_ELE_FAILED_LOGIC_OR, + * Z_ELE_FAILED_LOGIC_MANY + * + * ---------------------------------------------------------- */ +int USERD_get_uns_failed_params( + char *fail_var_name, /* variable name to be used in failure + must be scalar, per elem */ + float *threshold_val1, /* number to compare for failure */ + float *threshold_val2, /* number to compare for failure */ + int *threshold_operator1, /* Z_GREATER_THAN, Z_LESS_THAN, + Z_EQUAL_TO */ + int *threshold_operator2, /* Z_GREATER_THAN, Z_LESS_THAN, + Z_EQUAL_TO */ + int *logic_criteria2 + + +/*-------------------------------------------------------------------- + * USERD_get_structured_reader_cinching - + *-------------------------------------------------------------------- + * + * Gets whether this reader will do structured cinching for block data + * This means that it will handle the min, max, and step values for a + * given block and return the coordinate components or variable components + * in their "cinched" state when partial extraction or striding is used. + * This is as opposed to returning the entire component (ignoring min, max + * and stride) and letting Ensight pick out the values actually used. + * + * returns: Z_OK if the reader will handle the + * min, max, and stride and return + * the cinched values only. + * + * Z_UNDEF or Z_ERR if will return entire component + * and rely on EnSight to cinch. + * + * Notes: + * Unless you can actually pull out the desired min, max, and stride + * without using a full component of memory, don't enable this feature. + *--------------------------------------------------------------------*/ +int +USERD_get_structured_reader_cinching( void ) + + + +/*-------------------------------------------------------------------- + * USERD_set_block_range_and_stride - + *-------------------------------------------------------------------- + * + * Sets the min, max, and step values in each of the i, j, and k, directions + * for the given part. + * + * (IN) part_number = The part number + * + * (1-based index of part table, namely: + * + * 1 ... Numparts_available. + * + * It is NOT the part_id that + * is loaded in + * USERD_get_gold_part_build_info) + * + * (IN) mini = min i plane desired (zero based) + * maxi = max i plane desired (zero based) + * stepi = i stride + * minj = min j plane desired (zero based) + * maxj = max j plane desired (zero based) + * stepj = j stride + * mink = min k plane desired (zero based) + * maxk = max k plane desired (zero based) + * stepk = k stride + * + * + * returns: Z_OK if no problems + * Z_ERR if an error + * + * Notes: + * * It will not be called unless USERD_get_structured_reader_cinching + * indicates that this reader does structured cinching by returning + * a Z_OK. + * + * * It will actually be called before each geom component and before + * each part variable - so if you are storing things locally, you should + * make this routine be able to quickly check whether anything needs + * updated or not. + * + * * If the stride (step) does not hit right on the max, the last element + * in each direction will be shortened appropriately. + * For example, if a block had 0 to 12 in the i direction, + * and the user specified min = 1 + * max = 8 + * step = 3 + * + * 0 1 2 3 4 5 6 7 8 9 10 11 12 + * | | | | | | | | | | | | | + * + * | | | | + * + * Namely, the coarser cell boundaries in this direction would be at 1, 4, +7, and 8 + * + *--------------------------------------------------------------------*/ +int +USERD_set_block_range_and_stride(int part_number, + int mini, int maxi, int stepi, + int minj, int maxj, int stepj, + int mink, int maxk, int stepk) + + + +---- end of document ---- diff --git a/applications/utilities/postProcessing/graphics/ensightFoamReader/README_USERD_2.07 b/applications/utilities/postProcessing/graphics/ensightFoamReader/README_USERD_2.07 new file mode 100644 index 0000000000..3b52eed3a3 --- /dev/null +++ b/applications/utilities/postProcessing/graphics/ensightFoamReader/README_USERD_2.07 @@ -0,0 +1,4617 @@ +README_USERD_2.07 +================= +-------------------------------------- +EnSight User Defined Reader Capability ===> (API 2.07) +-------------------------------------- +A user defined reader capability is included in EnSight which can allow +otherwise unsupported structured or unstructured data to be read. The user +defined reader capability utilizes dynamic shared libraries composed of +routines defined in this document but produced by you, the user, (or some +third party). This capability is currently available for dec, ibm, hp, sgi, +sun, linux, alpha linux, and NT servers. + +You should refer to beginning of README_USERD_2.0 and/or README_1.0_to_2.0 +for a discussion of the differences between API 1.0 and API 2.*. + +***>> API 2.07 additional capabilities (beyond API 2.06): +Optional routine to allow userd defined readers to indicate their auto +distribute preference when used with SOS. This is used to set the auto +distribute flag default in the client. If the function does not exist, +then it defaults to 'use auto distribute'. If the function does exist and +indicates 'no auto distribute', then it's up to the UDR to decompose a +distributed data set. + USERD_prefer_auto_distribute +Optional routine to allow userd defined readers to indicate their +preference for the 'Set file...' button labels in the client's File->Open +dialog. If the function does not exist or it returns a null string for +an argument, then the default values are used. + USERD_set_filename_button_labels + +***>> API 2.06 additional capabilities (beyond API 2.05): +Routines to allow userd defined readers for structured data +to deal with min, max, and stride within the reader itself +instead of within EnSight. + USERD_get_structured_reader_cinching + USERD_set_block_range_and_stride + + +***>> API 2.05 additional capabilities (beyond API 2.04): +Routines to handle material species. + USERD_get_number_of_species + USERD_get_matsp_info + +Routines to handle variable extraction parameters after a read, and then +update the variables accordingly. Similar to the extra GUI capabilities +(which are processed before a read). (Can actually be added to pre-2.05 readers) + USERD_get_var_extract_gui_numbers + USERD_get_var_extract_gui_defaults + USERD_set_var_extract_gui_data + +Routines to obtain rigid body values from a reader. +(Routines were added - EnSight is now using for Nastran and STL readers + with Dynasty rigid body motion data file) + USERD_rigidbody_existence + USERD_rigidbody_values + +Routine that lets reader know when EnSight is getting the right side of a time +interval for variable interpolation between steps. Not generally needed for +most readers - however, may be needed for those that implement rigid body, and +wish to cache left and right timespan information for interpolation within the +reader itself. (Can actually be added to pre-2.05 readers) + USERD_set_right_side + + +***>> API 2.04 additional capabilities (beyond API 2.03): +Routines to handle failed elements. Basically +a.One routine to return a flag indicating the existence of + failed elements in at least one part in at least one + timestep in the model. +b.A second routine to return a matrix of flags indexed by part and + element type indicating which parts and element types have failed + elements at the current time step. +c.Finally a third routine to return an array of flags for a given + part and element type that is number of elements of that type long + indicating which elements have failed, and which have not failed. + + +***>> API 2.03 additional capabilities (beyond API 2.01): +1. Routines to handle materials +2. Routines to handle nsided and nfaced elements +3. Modified routine to handle structured ranges + + +**************************************************************************** +Note: Only the the Ensight Gold example reader, has been moved to + this 2.06 API level. And it is purely for an example - it does not + actually provide a benefit. +**************************************************************************** + + +The process for producing a user defined reader is: +--------------------------------------------------- +1. Write code for all pertinent routines in the library (Unless someone else + has done this for you). + + This is of course where the work is done by the user. The word + "pertinent" is used because depending on the nature of the data, some + of the routines in the library may be dummy routines. + + The source code for a dummy_gold library and for various other + working or sample libraries is copied from the installation CD during + installation. These will be located in directories under: + + $CEI_HOME/ensight76/user_defined_src/readers + + examples: + -------- + Basic dummy_gold routines provide skeleton for a new reader + $CEI_HOME/ensight76/user_defined_src/readers/dummy_gold + + Sample library which reads unstructured binary EnSight Gold data + $CEI_HOME/ensight76/user_defined_src/readers/ensight_gold + + You may find it useful to place your library source in this area as + well, but are not limited to this location. + + * ===> The descriptions of each library routine and the order that the + routines are called, which is provided in this file, along with + the example libraries, should make it possible for you to produce + code for your own data reader. + + +2. Produce the dynamic shared library. + + This is a compiling and loading process which varies according to + the type of machine you are on. In the user-defined-reader source + tree we have tried to isolate the machine dependent parts of the + build process using a set of files in the 'config' directory. In this + directory there is a configuration file for each platform on which + EnSight is supported. Before you can compile the installed readers + you should run the script called 'init' in the config directory. + + i.e. (for UNIX) + cd config + ./init sgi_6.5_n64 + cd .. + make + + If you are compiling for Windows NT, there are two options. If you + have the Cygwin GNU utilities installed, you can use GNU make as for + Unix. Otherwise, there is a script called makeall.cmd which will + build all of the readers using nmake. The Makefiles in each reader + directory will work using either make or nmake. + + i.e. (WIN32 Cygwin) (using nmake) + cd config cd config + sh init win32 cp win32 config + cd .. cd .. + mkdir lib + make makeall.cmd + + If you have platform-specific portions of code in your reader, the + build system defines a set of flags which can be used within + #ifdef ... #endif regions in your source, as shown in the table + below. + + Because the readers are now dynamically opened by EnSight, you may + have to include dependent libraries on your link-line to avoid having + unresolved symbols. If you are having problems with a reader, start + ensight as "ensight7 -readerdbg" and you will get feedback on any + problems encountered in loading a reader. If there are unresolved + symbols, you need to find the library which contains the missing + symbols and link it into your reader by adding it to the example + link commands below. + + If you choose to use a different build environment for your reader, + you should take care to use compatible compilation flags to ensure + compatibilty with the EnSight executables, most notably on the SGI + and HP-UX 11.0 platforms, which should use the following flags: + + sgi_6.2_o32: -mips2 + sgi_6.2_n64: -mips4 -64 + sgi_6.5_n32: -mips3 + sgi_6.5_n64: -mips4 -64 + hp_11.0_32: +DA2.0 + hp_11.0_64: +DA2.0W + + ______________________________________________________________________ + | MACHINE | OS flag | SHARED LIBRARY NAME PRODUCED | + | TYPE |------------------------------------------------------------| + | | LD COMMAND USED IN MAKEFILE | + ====================================================================== + ______________________________________________________________________ + | sgi | -DSGI | libuserd-X.so | + | |------------------------------------------------------------| + | | ld -shared -all -o libuserd-X.so libuserd-X.o | + ---------------------------------------------------------------------- + ______________________________________________________________________ + | hp | -DHP | libuserd-X.sl | + | |------------------------------------------------------------| + | | ld -b -o libuserd-X.sl libuserd-X.o | + ---------------------------------------------------------------------- + ______________________________________________________________________ + | sun | -DSUN | libuserd-X.so | + | |------------------------------------------------------------| + | | ld -G -o libuserd-X.so libuserd-X.o | + ---------------------------------------------------------------------- + ______________________________________________________________________ + | dec | -DDEC | libuserd-X.so | + | |------------------------------------------------------------| + | | ld -shared -all -o libuserd-X.so libuserd-X.o -lc | + ---------------------------------------------------------------------- + ______________________________________________________________________ + | linux | -DLINUX | libuserd-X.so | + | |------------------------------------------------------------| + | | ld -shared -o libuserd-X.so libuserd-X.o -lc | + ---------------------------------------------------------------------- + ______________________________________________________________________ + | alpha | -DALINUX | libuserd-X.so | + | linux |------------------------------------------------------------| + | | ld -shared -o libuserd-X.so libuserd-X.o -lc | + ---------------------------------------------------------------------- + ______________________________________________________________________ + | ibm | -DIBM | libuserd-X.so | + | |------------------------------------------------------------| + | | ld -G -o libuserd-X.so libuserd-X.o -bnoentry -bexpall -lc | + ---------------------------------------------------------------------- + + Once you have created your library, you should place it in a directory + of your choice or in the standard reader location: + + $CEI_HOME/ensight76/machines/$CEI_ARCH/lib_readers + + For example, if you created a reader for "mydata", you should create + the reader libuserd-mydata.so and place the file in your own reader + directory (see section 3 below) or in the standard location: + + $CEI_HOME/ensight76/machines/$CEI_ARCH/lib_readers/libuserd-mydata.so + + +3. By default EnSight will load all readers found in the directory: + + $CEI_HOME/ensight76/machines/$CEI_ARCH/lib_readers + + Files with names "libuserd-X.so" (where X is a name unique to the reader) + are assumed to be user-defined readers. + + There are two methods which can be used to supplement the default + behavior. + + (1) A feature which is useful for site-level or user-level configuration + is the optional environment variable $ENSIGHT7_READER. This + variable directs EnSight to load all readers in the specified reader + directory (you should probably specify a full path) before loading + the built-in readers. If the same reader exists in both directories + (as determined by the name returned by USERD_get_name_of_reader(), + NOT by the filename), the locally configured reader will take + precedence. + + (2) A useful feature for end-users is the use of the libuserd-devel + reader. EnSight will search for a reader named libuserd-devel.so + (.sl for HP or .dll for NT). This reader can exist anywhere in the + library path (see below) of the user. This is useful for an + individual actively developing a reader because the existence of a + libuserd-devel library will take precedence over any other library + which returns the same name from USERD_get_name_of_reader(). + + As an example, a site may install commonly used readers in a common + location, and users can set the ENSIGHT7_READER variable to access them: + + setenv ENSIGHT7_READER /usr/local/lib/e7readers + + A user working on a new reader may compile the reader and place it in + a directory specified by the library path: + + cp libuserd-myreader.so ~/lib/libuserd-devel.so + setenv ~/lib:$ + + The user is responsible for correctly configuring the library path + variable in order to make use of the libuserd-devel feature. The + library environment variables used are: + + Machine type Environment variable to set + ------------ --------------------------- + sgi LD_LIBRARY_PATH + dec LD_LIBRARY_PATH + sun LD_LIBRARY_PATH + linux LD_LIBRARY_PATH + alpha linux LD_LIBRARY_PATH + hp SHLIB_PATH + ibm LIBPATH + +As always, EnSight support is available if you need it. + +------------------------------- +Quick Index of Library Routines +------------------------------- + +Generally Needed for UNSTRUCTURED data +-------------------------------------- +USERD_get_part_coords part's node coordinates +USERD_get_part_node_ids part's node ids +USERD_get_part_elements_by_type part's element connectivites +USERD_get_part_element_ids_by_type part's element ids + + +Generally Needed for BLOCK data +-------------------------------------- +USERD_get_block_coords_by_component block coordinates +USERD_get_block_iblanking block iblanking values +USERD_get_ghosts_in_block_flag block ghost cell existence? +USERD_get_block_ghost_flags block ghost cell flags + + These routines, which formerly were only for unstructured data, will now + also be called for structured data if you specify that ids will be given + in the USERD_get_node_label_status and USERD_get_element_label_status rotuines + ------------------------------------------------------------------------------ + USERD_get_part_node_ids part's node ids + USERD_get_part_element_ids_by_type part's element ids + + +Generally needed for either or both kinds of data +------------------------------------------------- +USERD_get_name_of_reader name of reader for GUI +USERD_get_reader_release release string of reader +USERD_get_reader_version provide reader version number +USERD_get_reader_descrip provide GUI more description (optional) + +USERD_get_extra_gui_numbers Gets the number of toggles, pulldowns and fields +USERD_get_extra_gui_defaults Gets the default values for the GUI members +USERD_set_extra_gui_data Returns the answers provided by the user + +USERD_set_filenames filenames entered in GUI +USERD_set_server_number server which of how many + +USERD_get_number_of_timesets number of timesets +USERD_get_timeset_description description of timeset +USERD_get_geom_timeset_number timeset # to use for geom + +USERD_get_num_of_time_steps number of time steps +USERD_get_sol_times solution time values +USERD_set_time_set_and_step current timeset and time step + +USERD_get_changing_geometry_status changing geometry? +USERD_get_node_label_status node labels? +USERD_get_element_label_status element labels? +USERD_get_model_extents provide model bounding extents +USERD_get_number_of_files_in_dataset number of files in model +USERD_get_dataset_query_file_info info about each model file +USERD_get_descrip_lines file associated description lines +USERD_get_number_of_model_parts number of model parts +USERD_get_gold_part_build_info Gets the info needed for part building process +USERD_get_part_build_info part/block type/descrip etc. +USERD_get_maxsize_info part/block allocation maximums +USERD_get_ghosts_in_model_flag model contains ghost cells? +USERD_get_nsided_conn Gets the element connectivities for nsided + elements. (utilizes the number of nodes + per element obtained in + USERD_get_part_elements_by_type) +USERD_get_nfaced_nodes_per_face Gets the number of nodes per face for nfaced + elements (utilizes the number of faces + per element obtained in + USERD_get_part_elements_by_type) +USERD_get_nfaced_conn Gets the element connectivities for nfaced + elements (utilizes the number of nodes + per face obtained in + USERD_get_nfaced_nodes_per_face) + + +USERD_get_border_availability part border provided? +USERD_get_border_elements_by_type part border conn and parent info + +USERD_get_number_of_variables number of variables +USERD_get_gold_variable_info variable type/descrip etc. +USERD_get_var_by_component part or block variable values +USERD_get_constant_val constant variable's value +USERD_get_var_value_at_specific node's or element's variable value over time +USERD_stop_part_building cleanup after part build routine + +USERD_get_number_of_material_sets Gets the number of material sets +USERD_get_matf_set_info Gets the material set indices and names +USERD_get_number_of_materials Gets the number of materials +USERD_get_matf_var_info Gets the material indices and descriptions +USERD_size_matf_data Gets the length of either the + material ids list, + mixed-material ids list, or + mixed-material values list +USERD_load_matf_data Gets the material ids list, + mixed-material ids list, or + mixed-material values list + +USERD_bkup archive routine + +USERD_exit_routine cleanup upon exit routine + +USERD_get_uns_failed_params Gets thresholds/criteria for failure + +USERD_rigidbody_existence Returns whether rigid body transformation + data exists for the model. +USERD_rigidbody_values Returns the euler and location values for a + given part + +USERD_set_right_side Simply informs the reader when the time set + is for the right side of a time span during + variable interpolation between time steps. + +USERD_get_structured_reader_cinching Tells if the reader will do structured + cinching +USERD_set_block_range_and_stride Sets the min, max, and stride of a block + if doing structured cinching + + +------------------------- +Order Routines are called +------------------------- + +The various main operations are given basically in the order they will +be performed. Within each operation, the order the routines will be +called is given. + +1. Setting name in the gui, and specifying one or two input fields + + USERD_get_name_of_reader + USERD_get_reader_descrip (optional) + USERD_get_extra_gui_numbers (optional) + USERD_get_extra_gui_defaults (optional) + +2. Getting the reader version (also distinguishes between API's) + + USERD_get_reader_version + +3. Setting filenames and getting timeset and time info + + (optional if reader has + USERD_get_extra_gui_defaults routine) + USERD_get_structured_reader_cinching + USERD_set_server_number + USERD_set_extra_gui_data (optional) + USERD_set_filenames + USERD_get_number_of_timesets + USERD_get_geom_timeset_number + + for each timeset: + USERD_get_timeset_description + USERD_get_num_of_time_steps + USERD_get_sol_times + + USERD_set_time_set_and_step + +4. Gathering info for part builder + + USERD_set_time_set_and_step + USERD_get_changing_geometry_status + USERD_get_node_label_status + USERD_get_element_label_status + USERD_get_number_of_files_in_dataset + USERD_get_dataset_query_file_info + USERD_get_descrip_lines (for geometry) + USERD_get_number_of_model_parts + USERD_get_gold_part_build_info + USERD_get_ghosts_in_model_flag + USERD_get_maxsize_info + USERD_get_get_ghosts_in_block_flag (if any ghost cells in model) + USERD_get_model_extents OR (for model extents) + USERD_get_part_coords AND/OR + (if doing structured reader cinching + USERD_get_block_coords_by_component + +5. Gathering Variable info + + USERD_get_number_of_variables + USERD_get_gold_variable_info + +6. Part building (per part created) + + both unstructured and structured: + -------------------------------- + USERD_set_time_set_and_step + + if unstructured part: + -------------------- + USERD_get_part_element_ids_by_type + USERD_get_part_elements_by_type + + If any nsided elements: + + USERD_get_nsided_conn + + If any nfaced elements: + + USERD_get_nfaced_nodes_per_face + USERD_get_nfaced_conn + + USERD_get_part_coords + USERD_get_part_node_ids + + else if structured part: + ----------------------- + USERD_get_block_iblanking + (if doing structured reader cinching + USERD_get_block_coords_by_component + USERD_get_block_ghost_flags (If ghost cells in part) + USERD_get_part_node_ids (If node ids given) + USERD_get_part_element_ids_by_type (If element ids given) + + both again: + ---------- + USERD_get_border_availability (If border representation + USERD_get_border_elements_by_type is selected) + + USERD_stop_part_building (only once when part builder + dialog is closed) + +7. Loading Variables + + constants: + --------- + USERD_set_time_set_and_step + USERD_get_constant_val + + scalars/vectors/tensors: + ------------------------ + USERD_get_descrip_lines + USERD_set_time_set_and_step + (if doing structured reader cinching + USERD_get_var_by_component + +8. Changing geometry + + changing coords only (per part): + -------------------- + USERD_set_time_set_and_step + USERD_get_descrip_lines + USERD_get_part_coords + (if doing structured reader cinching + USERD_get_block_coords_by_component + + changing connectivity (per part): + --------------------- + USERD_set_time_set_and_step + USERD_get_descrip_lines + USERD_get_number_of_model_parts + USERD_get_gold_part_build_info + USERD_get_ghosts_in_model_flag + USERD_get_get_ghosts_in_block_flag (if any ghost cells in model) + USERD_get_model_extents OR + USERD_get_part_coords AND/OR + (if doing structured reader cinching + USERD_get_block_coords_by_component + USERD_get_part_element_ids_by_type + USERD_get_part_elements_by_type + USERD_get_part_coords + USERD_get_part_node_ids + USERD_get_block_iblanking + (if doing structured reader cinching + USERD_get_block_coords_by_component + USERD_get_block_ghost_flags (If ghost cells in part) + USERD_get_part_node_ids (If node ids given) + USERD_get_part_element_ids_by_type (If element ids given) + + USERD_get_border_availability (If border representation + USERD_get_border_elements_by_type is selected) + + +9. Node or Element queries over time + + USERD_get_var_value_at_specific + +10. To see if materials in the model + + USERD_get_number_of_material_sets + USERD_get_matf_set_info + + If any material sets in the model (calls these once per material set): + USERD_get_number_of_materials + USERD_get_matf_var_info + + For each elment type of each part containing material ids, calls: + USERD_size_matf_data + USERD_load_matf_data + + If there are any elements with mixed materials, when a domain or + interface is created, calls these again per part: + + USERD_size_matf_data + USERD_load_matf_data + +11. To modify the variable extraction parameters and have the variables + update accordingly. + + USERD_get_var_extract_gui_numbers + USERD_get_var_extract_gui_defaults + USERD_set_var_extract_gui_data + + + +----------------------- +Detailed Specifications +----------------------- + +Include files: +-------------- +The following header file is required in any file containing these library +routines. + + #include "global_extern.h" + +And it references: + + #include "global_extern_proto.h" + + + +******************************************************************************* +****************************** Special Note *********************************** +******************************************************************************* + +Make sure you use the proper define in the global_extern.h header file, namely: +#define USERD_API_204 + +Also, Make sure the api version in the USERD_get_reader_version routine is set +to "2.04" or larger. + +Make sure your reader has access to the global_extern_proto.h This is a new +file which is accessed from the new global_extern.h + +******************************************************************************* +******************************************************************************* + + +Basis of arrays: +--------------- +Unless explicitly stated otherwise, all arrays are zero based - in true C +fashion. + + +Global variables: +---------------- +You will generally need to have a few global variables which are shared by +the various library routines. The detailed specifications below have assumed +the following are available. (Their names describe their purpose, and they +will be used in helping describe the details of the routines below). + +static int Numparts_available = 0; +static int Num_unstructured_parts = 0; +static int Num_structured_blocks = 0; + +/* Note: Numparts_available = Num_unstructured_parts + Num_structured_blocks */ + +static int Num_timesets = 1; +static int Current_timeset = 1; +static int Geom_timeset_number = 1; + +static int Num_time_steps[Z_MAXSETS] = 1; +static int Current_time_step = 0; +static int Num_variables = 0; +static int Num_dataset_files = 0; + +static int Server_Number = 1; Which server of +static int Tot_Servers = 1; the total number of servers + + + +_________________________________________ +----------------------------------------- +Library Routines (in alphabetical order): +_________________________________________ +----------------------------------------- + +-------------------------------------------------------------------- +USERD_bkup + + Description: + ----------- + This routine is called during the EnSight archive process. You can + use it to save or restore info relating to your user defined reader. + + Specification: + ------------- + int USERD_bkup(FILE *archive_file, + int backup_type) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) archive_file = The archive file pointer + + (IN) backup_type = Z_SAVE_ARCHIVE for saving archive + Z_REST_ARCHIVE for restoring archive + + Notes: + ----- + * Since EnSight's archive file is saved in binary form, you should + also do any writing to it or reading from it in binary. + + * You should archive any variables, which will be needed for + future operations, that will not be read or computed again + before they will be needed. These are typically global + variables. + + * Make sure that the number of bytes that you write on a save and + the number of bytes that you read on a restore are identical!! + + * If any of the variables you save are allocated arrays, you must + do the allocations before restoring into them. + +-------------------------------------------------------------------- +USERD_exit_routine + + Description: + ----------- + This routine is called as EnSight is exiting. It can be used to clean + up anything needed - such as removing temporary files, etc. - or can simply + be a dummy. + + Specification: + ------------- + void USERD_exit_routine( void ) + + Arguments: + --------- + none + +-------------------------------------------------------------------- +USERD_get_block_coords_by_component + + Description: + ----------- + Get the coordinates of a given structured block, a component at a time. + + Specification: + ------------- + int USERD_get_block_coords_by_component(int block_number, + int which_component, + float *coord_array) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) block_number = The block part number + (1-based index of part table, namely: + + 1 ... Numparts_available. + + It is NOT the part_id that + is loaded in USERD_get_gold_part_build_info) + + (IN) which_component = Z_COMPX if x component wanted + = Z_COMPY if y component wanted + = Z_COMPZ if z component wanted + + (OUT) coord_array = 1D array containing x,y, or z + coordinate component of each node + + (Array will have been allocated + i*j*k for the block long) + + Notes: + ----- + * Not called unless Num_structured_blocks is > 0 + + * Will be based on Current_time_step + + + +-------------------------------------------------------------------- +USERD_get_block_iblanking + + Description: + ----------- + Get the iblanking value at each node of a block (if the block is + iblanked). + + Specification: + ------------- + int USERD_get_block_iblanking(int block_number, + int *iblank_array) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) block_number = The block part number + (1-based index of part table, namely: + + 1 ... Numparts_available. + + It is NOT the part_id that + is loaded in USERD_get_gold_part_build_info) + + (OUT) iblank_array = 1D array containing iblank value + for each node. + + (Array will have been allocated + i*j*k for the block long) + + possible values are: Z_EXT = exterior + Z_INT = interior + Z_BND = boundary + Z_INTBND = internal boundary + Z_SYM = symmetry plane + + Notes: + ----- + * Not called unless Num_structured_blocks is > 0 and you have + some iblanked blocks + + * Will be based on Current_time_step + + + +---------------------------------------------------------------------- +USERD_get_block_ghost_flags + + Description: + ----------- + Get the ghost_flags value at each element of a block containing ghost cells. + + Specification: + ------------- + int USERD_get_block_ghost_flags(int block_number, + int *ghost_flags) + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) block_number = The block number + (1-based index of part table, namely: + + 1 ... Numparts_available. + + It is NOT the part_id that + is loaded in USERD_get_gold_part_build_info) + + (OUT) ghost_flags = 1D array containing ghost flag value + for each block cell. + + (Array will have been allocated + (i-1)*(j-1)*(k-1) for the block long) + + possible values are: 0 = non-ghost cell (normal cell) + >0 = ghost cell + + Notes: + ----- + * This routine is new in the 2.01 API + + * This will be based on Current_time_step + + * Only called for structured "block" parts that have some ghost cells + as indicated by the USERD_get_ghost_in_block_flag. The model must + of course also have been indicated to have some ghost cells in the + USERD_get_ghost_in_model_flag routine. + + * It is sufficient to set the value to be 1 to flag as a ghost cell, + but the value can be any non-zero value, so you could use it to + indicate which block or which server (for Server-of-server use) the + cell is actually in. + + + +-------------------------------------------------------------------- +USERD_get_border_availability + + Description: + ----------- + Finds out if border elements are provided by the reader for the + desired part, or will need to be computed internally by EnSight. + + Specification: + ------------- + int USERD_get_border_availability(int part_number, + int number_of_elements[Z_MAXTYPE]) + + Returns: + ------- + Z_OK if border elements will be provided by the reader. + (number_of_elements array will be loaded and + USERD_get_border_elements_by_type will be called) + + Z_ERR if border elements are not available - thus EnSight must compute. + (USERD_get_border_elements_by_type will not be called) + + + Arguments: + --------- + (IN) part_number = The part number + (1-based index of part table, namely: + + 1 ... Numparts_available. + + It is NOT the part_id that + is loaded in USERD_get_gold_part_build_info) + + (OUT) number_of_elements = 2D array containing number of + each type of border element in + the part. + ------------ + Possible types are: + + Z_POINT = point + Z_BAR02 = 2-noded bar + Z_BAR03 = 3-noded bar + Z_TRI03 = 3-noded triangle + Z_TRI06 = 6-noded triangle + Z_QUA04 = 4-noded quadrilateral + Z_QUA08 = 8-noded quadrilateral + + Notes: + ----- + * Only called if border representation is used. + + * Will be based on Current_time_step + + + +-------------------------------------------------------------------- +USERD_get_border_elements_by_type + + Description: + ----------- + Provides border element connectivity and parent information. + + Specification: + ------------- + int USERD_get_border_elements_by_type(int part_number, + int element_type, + int **conn_array, + short *parent_element_type, + int *parent_element_num) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) part_number = The part number + (1-based index of part table, namely: + + 1 ... Numparts_available. + + It is NOT the part_id that + is loaded in USERD_get_gold_part_build_info) + + (IN) element_type = One of the following (See global_extern.h) + Z_POINT node point element + Z_BAR02 2 node bar + Z_BAR03 3 node bar + Z_TRI03 3 node triangle + Z_TRI06 6 node triangle + Z_QUA04 4 node quad + Z_QUA08 8 node quad + + (OUT) conn_array = 2D array containing connectivity + of each border element of the type. + + (Array will have been allocated + num_of_elements of the type by + connectivity length of the type) + + ex) If number_of_elements[Z_TRI03] = 25 + number_of_elements[Z_QUA04] = 100 + number_of_elements[Z_QUA08] = 30 + as obtained in: + USERD_get_border_availability + + Then the allocated dimensions available + for this routine will be: + conn_array[25][3] when called with Z_TRI03 + + conn_array[100][4] when called with Z_QUA04 + + conn_array[30][8] when called with Z_QUA08 + + (OUT) parent_element_type = 1D array containing element type of the + parent element (the one that the border + element is a face/edge of). + + (Array will have been allocated + num_of_elements of the type long) + + (OUT) parent_element_num = 1D array containing element number of the + parent element (the one that the border + element is a face/edge of). + + (Array will have been allocated + num_of_elements of the type long) + + + Notes: + ----- + * Not called unless USERD_get_border_availability returned Z_OK + + * Will be based on Current_time_step + + + +-------------------------------------------------------------------- +USERD_get_changing_geometry_status + + Description: + ----------- + Gets the changing geometry status for the model + + Specification: + ------------- + int USERD_get_changing_geometry_status( void ) + + Returns: + ------- + Z_STATIC if geometry does not change + Z_CHANGE_COORDS if changing coordinates only + Z_CHANGE_CONN if changing connectivity + + Arguments: + --------- + none + + Notes: + ----- + * EnSight does not support changing number of parts. But the + coords and/or the connectivity of the parts can change. Note that + a part is allowed to be empty (number of nodes and elements equal + to zero). + + +-------------------------------------------------------------------- +USERD_get_constant_val + + Description: + ----------- + Get the value of a constant at a time step + + Specification: + ------------- + float USERD_get_constant_value(int which_var, + int imag_data) + + Returns: + ------- + Value of the requested constant variable + + Arguments: + --------- + (IN) which_var = The variable number + + (IN) imag_data = TRUE if want imaginary data value. + FALSE if want real data value. + + Notes: + ----- + * Will be based on Current_time_step + + + +-------------------------------------------------------------------- +USERD_get_dataset_query_file_info + + Description: + ----------- + Get the information about files in the dataset. Used for the + dataset query option within EnSight. + + Specification: + ------------- + int USERD_get_dataset_query_file_info(Z_QFILES *qfiles) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (OUT) qfiles = Structure containing information about each file + of the dataset. The Z_QFILES structure is defined + in the global_extern.h file + + (The structure will have been allocated + Num_dataset_files long, with 10 description + lines per file). + + qfiles[].name = The name of the file + (Z_MAXFILENP is the dimensioned length + of the name) + + qfiles[].sizeb = The number of bytes in the file + (Typically obtained with a call to the + "stat" system routine) (Is a long) + + qfiles[].timemod = The time the file was last modified + (Z_MAXTIMLEN is the dimensioned length + of this string) + (Typically obtained with a call to the + "stat" system routine) + + qfiles[].num_d_lines = The number of description lines you + are providing from the file. Max = 10 + + qfiles[].f_desc[] = The description line(s) per file, + qfiles[].num_d_lines of them + (Z_MAXFILENP is the allocated length of + each line) + + Notes: + ----- + * If Num_dataset_files is 0, this routine will not be called. + (See USERD_get_number_of_files_in_dataset) + + +-------------------------------------------------------------------- +USERD_get_descrip_lines + + Description: + ----------- + Get two description lines associated with geometry per time step, + or one description line associated with a variable per time step. + + Specification: + ------------- + int USERD_get_descrip_lines(int which_type, + int which_var, + int imag_data, + char line1[Z_BUFL], + char line2[Z_BUFL]) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) which_type = Z_GEOM for geometry (2 lines) + = Z_VARI for variable (1 line) + + (IN) which_var = If it is a variable, which one. + Ignored if geometry type. + + (IN) imag_data = TRUE if want imaginary data file. + FALSE if want real data file. + + (OUT) line1 = The 1st geometry description line, + or the variable description line. + + (OUT) line2 = The 2nd geometry description line + Not used if variable type. + + Notes: + ----- + * Will be based on Current_time_step + + * These are the lines EnSight can echo to the screen in + annotation mode. + + + +-------------------------------------------------------------------- +USERD_get_element_label_status + + Description: + ----------- + Answers the question as to whether element labels will be provided. + + Specification: + ------------- + int USERD_get_element_label_status( void ) + + Returns: + ------- + TRUE if element labels will be provided + FALSE if element labels will NOT be provided + + Arguments: + --------- + none + + Notes: + ----- + * element lables are needed in order to do any element querying, or + element labeling on-screen within EnSight. + + * Prior to API 2.01: + ----------------- + For unstructured parts, you can read them from your file if + available, or can assign them, etc. They need to be unique + per part, and are often unique per model. + + API 1.0: + USERD_get_element_ids_for_part is used to obtain the ids, + on a part by part basis, if TRUE status is returned here. + + API 2.0: + USERD_get_part_element_ids_by_type is used to obtain the ids, + on a per part, per type basis, if TRUE status is returned here. + + For structured parts, EnSight will assign ids if you return a + status of TRUE here. You cannot assign them youself!! + + * Starting at API 2.01: + -------------------- + For both unstructured and structured parts, you can read them + from your file if available, or can assign them, etc. They need + to be unique per part, and are often unique per model (especially + if you are dealing with a decomposed dataset). + + USERD_get_part_element_ids_by_type is used to obtain the ids, + on an element type by part basis, if TRUE status is returned here. + + * Will call USERD_get_part_element_ids_by_type for each type of + of each part if this routine returns TRUE. +-------------------------------------------------------------------- +USERD_get_geom_timeset_number - + + Description: + ----------- + Gets the timeset number to be used for geometry + + Specification: + ------------- + int USERD_get_geom_timeset_number( void ) + + Returns: + ------- + Geom_timeset_number = The timeset number that will be used for geometry. + For example, if USERD_get_number_of timesets + returns 2, the valid timeset numbers would be + 1 or 2. + + Arguments: + --------- + none + + Notes: + ----- + * If your model is static, which you indicated by returning a zero + in USERD_get_number_of_timesets, you can return a zero here as well. + + + +-------------------------------------------------------------------- +USERD_get_gold_part_build_info + + Description: + ----------- + Gets the info needed for the part building process. + + Specification: + ------------- + int USERD_get_gold_part_build_info(int *part_id, + int *part_types, + char *part_description[Z_BUFL], + int *number_of_nodes, + int *number_of_elements[Z_MAXTYPE], + int *ijk_dimensions[9], + int *iblanking_options[6]) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (OUT) part_id = Array containing the external part + ids for each of the model parts. + + IMPORTANT: + Parts numbers must be >= 1, because + of the way they are used in the GUI + + ******************************************* + The ids provided here are the numbers by + which the parts will be referred to in the + GUI (if possible). They are basically + labels as far as you are concerned. + + Note: The part numbers you pass to routines + which receive a part_number or block_number + or which_part as an argument are the 1-based + table index of the parts! + + example: If Numparts_available = 3 + + Table index part_id + ----------- ------- + 1 13 + 2 57 + 3 125 + + ^ ^ + | | + | These are placed in: + | part_id[0] = 13 + | part_id[1] = 57 + | part_id[2] = 125 + | for GUI labeling purposes. + | + These implied table indices are the part_number, + block_number, or which_part numbers that you would + pass to routines like: + + USERD_get_part_coords(int part_number,... + USERD_get_part_node_ids(int part_number,... + USERD_get_part_elements_by_type(int part_number,... + USERD_get_part_element_ids_by_type(int part_number,... + USERD_get_block_coords_by_component(int block_number,... + USERD_get_block_iblanking(int block_number,... + USERD_get_block_ghost_flags(int block_number,... + USERD_get_ghosts_in_block_flag(int block_number) + USERD_get_border_availability(int part_number,... + USERD_get_border_elements_by_type(int part_number,... + USERD_get_var_by_component(int which_variable, + int which_part,... + USERD_get_var_value_at_specific(int which_var, + int which_node_or_elem, + int which_part,... + ******************************************** + + (Array will have been allocated + Numparts_available long) + + (OUT) part_types = Array containing one of the + following for each model part: + + Z_UNSTRUCTURED or + Z_STRUCTURED or + Z_IBLANKED + + (Array will have been allocated + Numparts_available long) + + (OUT) part_description = Array containing a description + for each of the model parts + + (Array will have been allocated + Numparts_available by Z_BUFL + long) + + (OUT) number_of_nodes = Number of unstructured nodes in the part + + (Array will have been allocated + Numparts_available long) + + (OUT) number_of_elements = 2D array containing number of + each type of element for each + unstructured model part. + ------------ + Possible types are: + + Z_POINT = point + Z_BAR02 = 2-noded bar + Z_BAR03 = 3-noded bar + Z_TRI03 = 3-noded triangle + Z_TRI06 = 6-noded triangle + Z_QUA04 = 4-noded quadrilateral + Z_QUA08 = 8-noded quadrilateral + Z_TET04 = 4-noded tetrahedron + Z_TET10 = 10-noded tetrahedron + Z_PYR05 = 5-noded pyramid + Z_PYR13 = 13-noded pyramid + Z_PEN06 = 6-noded pentahedron + Z_PEN15 = 15-noded pentahedron + Z_HEX08 = 8-noded hexahedron + Z_HEX20 = 20-noded hexahedron + + Z_G_POINT = ghost node point element + Z_G_BAR02 = 2 node ghost bar + Z_G_BAR03 = 3 node ghost bar + Z_G_TRI03 = 3 node ghost triangle + Z_G_TRI06 = 6 node ghost triangle + Z_G_QUA04 = 4 node ghost quad + Z_G_QUA08 = 8 node ghost quad + Z_G_TET04 = 4 node ghost tetrahedron + Z_G_TET10 = 10 node ghost tetrahedron + Z_G_PYR05 = 5 node ghost pyramid + Z_G_PYR13 = 13 node ghost pyramid + Z_G_PEN06 = 6 node ghost pentahedron + Z_G_PEN15 = 15 node ghost pentahedron + Z_G_HEX08 = 8 node ghost hexahedron + Z_G_HEX20 = 20 node ghost hexahedron + + (Ignored unless Z_UNSTRUCTURED type) + + (Array will have been allocated + Numparts_available by + Z_MAXTYPE long) + + (OUT) ijk_dimensions = 2D array containing ijk dimension info + for structured blocks + + For Z_UNSTRUCTURED - is ignored + + For Z_STRUCTURED or Z_IBLANKED + + Prior to version 2.03: + ---------------------- + (Array will have been allocated + Numparts_available by 3 long) + + ijk_dimensions[][0] = I dimension + ijk_dimensions[][1] = J dimension + ijk_dimensions[][2] = K dimension + + + Starting at version 2.03: + ------------------------ + (Array will have been allocated + Numparts_available by 9 long) + + There are two ways to do this: + ------------------------------ + 1. The simple one, without ranges. + + This is good for all structured models + that will NOT be used in EnSight's + Server of Servers + + Simply provide the ijk dimensions in the + first three slots and place a -1 in + the 4th slot. (The remaining slots will + be ignored). + + Thus, + ijk_dimensions[][0] = I dimension of block + ijk_dimensions[][1] = J dimension of block + ijk_dimensions[][2] = K dimension of block + ijk_dimensions[][3] = -1 + + (J planes) + 4 *-------*-------* + | | | ijk_dimension[0][0] = 3 + | | | ijk_dimension[0][1] = 4 + | | | ijk_dimension[0][2] = 1 + 3 *-------*-------* + | | | ijk_dimension[0][4] = -1 + | | | + | | | + 2 *-------*-------* + | | | + | | | + | | | + 1 *-------*-------* + 1 2 3 (I planes) + + + + 2. Using ranges. + + This one can be used anytime, but MUST + be used if EnSight's Server of Servers + is to be used! + + The first 3 slots contain the ijk dimension + of the complete block (of which this may be + a portion). The last 6 slots contain the + ijk min and max ranges within the complete. + + Thus, + ijk_dimensions[][0] = I dim of complete block + ijk_dimensions[][1] = J dim of complete block + ijk_dimensions[][2] = K dim of complete block + + ijk_dimensions[][3] = Imin of portion (1-based) + ijk_dimensions[][4] = Imax of portion (1-based) + ijk_dimensions[][5] = Jmin of portion (1-based) + ijk_dimensions[][6] = Jmax of portion (1-based) + ijk_dimensions[][7] = Kmin of portion (1-based) + ijk_dimensions[][8] = Kmax of portion (1-based) + + + example1: (Model has one part, a simple 2D block, + and want whole thing) + + (J planes) + 4 *-------*-------* + | | | ijk_dimension[0][0] = 3 + | | | ijk_dimension[0][1] = 4 + | | | ijk_dimension[0][2] = 1 + 3 *-------*-------* + | | | ijk_dimension[0][3] = 1 + | | | ijk_dimension[0][4] = 3 + | | | ijk_dimension[0][5] = 1 + 2 *-------*-------* ijk_dimension[0][6] = 4 + | | | ijk_dimension[0][7] = 1 + | | | ijk_dimension[0][8] = 1 + | | | + 1 *-------*-------* + 1 2 3 (I planes) + + + example2: (Want to have the block represented + in two portions - 2 parts) + + (J planes) top portion + 4 *-------*-------* + | | | ijk_dimension[0][0] = 3 + | | | ijk_dimension[0][1] = 4 + | | | ijk_dimension[0][2] = 1 + 3 *-------*-------* + . . . ijk_dimension[0][3] = 1 + . . . ijk_dimension[0][4] = 3 + . . . ijk_dimension[0][5] = 3 + 2 ................. ijk_dimension[0][6] = 4 + . . . ijk_dimension[0][7] = 1 + . . . ijk_dimension[0][8] = 1 + . . . + 1 ................. + 1 2 3 (I planes) + + + (J planes) bottom portion + 4 ................. + . . . ijk_dimension[1][0] = 3 + . . . ijk_dimension[2][1] = 4 + . . . ijk_dimension[3][2] = 1 + 3 *-------*-------* + | | | ijk_dimension[1][3] = 1 + | | | ijk_dimension[1][4] = 3 + | | | ijk_dimension[1][5] = 1 + 2 *-------*-------* ijk_dimension[1][6] = 3 + | | | ijk_dimension[1][7] = 1 + | | | ijk_dimension[1][8] = 1 + | | | + 1 *-------*-------* + 1 2 3 (I planes) + + + And note that if you were partioning this block for + EnSight's Server of Servers, you would only have one part, + instead of two. Each SOS server would return its appropriate + ranges in the last 6 slots. The first 3 slots would remain constant. + + + (OUT) iblanking_options = 2D array containing iblanking + options possible for each + structured model part. + ---------- + (Ignored unless Z_IBLANKED type) + + (Array will have been allocated + Numparts_available by 6 long) + + iblanking_options[][Z_EXT] = TRUE if external (outside) + [][Z_INT] = TRUE if internal (inside) + [][Z_BND] = TRUE if boundary + [][Z_INTBND] = TRUE if internal boundary + [][Z_SYM] = TRUE if symmetry surface + + + Notes: + ----- + * If you haven't built a table of pointers to the different parts, + you might want to do so here as you gather the needed info. + + * Will be based on Current_time_step + + +-------------------------------------------------------------------- +USERD_get_gold_variable_info + + Description: + ----------- + Get the variable descriptions, types and filenames + + Specification: + ------------- + int USERD_get_gold_variable_info(char **var_description, + char **var_filename, + int *var_type, + int *var_classify, + int *var_complex, + char **var_ifilename, + float *var_freq, + int *var_contran, + int *var_timeset) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (OUT) var_description = Variable descriptions + + (Array will have been allocated + Num_variables by Z_BUFL long) + + variable description restrictions: + ---------------------------------- + 1. Only first 19 characters used in EnSight. + 2. Leading and trailing whitespace will be removed by EnSight. + 3. Illegal characters will be replaced by underscores. + 4. Thay may not start with a numeric digit. + 4. No two variables may have the same description. + + + (OUT) var_filename = Variable real filenames + + (Array will have been allocated + Num_variables by Z_BUFL long) + + (OUT) var_type = Variable type + + (Array will have been allocated + Num_variables long) + + types are: Z_CONSTANT + Z_SCALAR + Z_VECTOR + Z_TENSOR + Z_TENSOR9 + + (OUT) var_classify = Variable classification + + (Array will have been allocated + Num_variables long) + + types are: Z_PER_NODE + Z_PER_ELEM + + (OUT) var_complex = TRUE if complex, FALSE otherwise + + (Array will have been allocated + Num_variables long) + + (OUT) var_ifilename = Variable imaginary filenames (if complex) + + (Array will have been allocated + Num_variables by Z_BUFL long) + + (OUT) var_freq = complex frequency (if complex) + + (Array will have been allocated + Num_variables long) + + (OUT) var_contran = TRUE if constant changes per time step + FALSE if constant truly same at all time steps + + (Array will have been allocated + Num_variables long) + + (OUT) var_timeset = Timeset the variable will use (1 based). + (For static models, set it to 1) + + (Array will have been allocated + Num_variables long) + + For example: If USERD_get_number_of_timesets + returns 2, the valid + timeset_number's would be 1 or 2 + + + Notes: + ----- + * The implied variable numbers apply, but be aware that the + arrays are zero based. + So for variable 1, will need to provide var_description[0] + var_filename[0] + var_type[0] + var_classify[0] + var_complex[0] + var_ifilename[0] + var_freq[0] + var_contran[0] + var_timeset[0] + + + for variable 2, will need to provide var_description[1] + var_filename[1] + var_type[1] + var_classify[1] + var_complex[1] + var_ifilename[1] + var_freq[1] + var_contran[1] + var_timeset[1] + etc. + + + + +-------------------------------------------------------------------- +USERD_get_ghosts_in_block_flag + + Description: + ----------- + Gets whether ghost cells present in block or not + + Specification: + ------------- + int USERD_get_ghosts_in_block_flag(int block_number) + + Returns: + ------- + TRUE if any ghost cells in this structured part + FALSE if no ghost cells in this structured part + + Arguments: + --------- + (IN) block_number = The block part number + (1-based index of part table, namely: + + 1 ... Numparts_available. + + It is NOT the part_id that + is loaded in USERD_get_gold_part_build_info) + + Notes: + ----- + * This routine is new in the 2.01 API + * This will be based on Current_time_step + + * Intended for structured parts only, value will be ignored for + unstructured parts + + + +-------------------------------------------------------------------- +USERD_get_ghosts_in_model_flag + + Description: + ----------- + Answers the question as to whether any ghost cells in the model. + + Specification: + ------------- + int USERD_get_ghosts_in_model_flag( void ) + + Returns: + ------- + TRUE if any ghost cells in the model + FALSE if no ghost cells in the model + + Arguments: + --------- + + Notes: + ----- + * This routine is new in the 2.01 API + +------------------------------------------------------------------------- +USERD_get_matf_set_info + + Description: + ----------- + Get the material set ids and names + + Specification: + ------------- + int USERD_get_matf_set_info(int *mat_set_ids, + char **mat_set_name) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (OUT) mat_set_ids = 1D material set ids array + + (Array will have been allocated + Num_material_sets long) + + (OUT) mat_set_name = 2D material set name array + + (Array will have been allocated + Num_material_sets by Z_BUFL long) + + Notes: + ----- + * Will not be called if Num_material_sets is zero + * See USERD_get_number_of_material_sets header for explanatory example + + +-------------------------------------------------------------------- +USERD_get_matf_var_info + + Description: + ----------- + Gets the material ids and descriptions for the material set + + Specification: + ------------- + int USERD_get_matf_var_info(int set_index, + int *mat_ids, + char **mat_desc) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) set_index = the material set index (zero based) + + (OUT) mat_ids[set_index] = 1D integer array containing the material + ids to associated with each material + + (Array will have been allocated + Num_materials[set_index] long) + + (OUT) mat_desc[set_index] = 2D char array containing the material + descriptions to associated with each material + + (Array will have been allocated + Num_materials[set_index] by Z_BUFL long) + + Notes: + ----- + * See USERD_get_number_of_material_sets header for explanatory example + * Will not be called if Num_material_sets is zero, or + Num_materials[set_index] is zero + + + + +-------------------------------------------------------------------- +USERD_get_maxsize_info + + Description: + ----------- + Gets maximum part sizes for efficient memory allocation. + + Transient models (especially those that increase in size) can cause + reallocations, at time step changes, to keep chewing up more and + more memory. The way to avoid this is to know what the maximum + size of such memory will be, and allocate for this maximum initially. + + Accordingly, if you choose to provide this information (it is optional), + EnSight will take advantage of it. + + + Specification: + ------------- + int USERD_get_maxsize_info(int *max_number_of_nodes, + int *max_number_of_elements[Z_MAXTYPE], + int *max_ijk_dimensions[3]) + + Returns: + ------- + Z_OK if supplying maximum data + Z_ERR if not supplying maximum data, or some error occurred + while trying to obtain it. + + Arguments: + --------- + (OUT) max_number_of_nodes = Maximum number of unstructured nodes + in the part (over all time). + + (Array will have been allocated + Numparts_available long) + + (OUT) max_number_of_elements = 2D array containing maximum number of + each type of element for each + unstructured model part (over all time). + ------------ + Possible types are: + + Z_POINT = point + Z_BAR02 = 2-noded bar + Z_BAR03 = 3-noded bar + Z_TRI03 = 3-noded triangle + Z_TRI06 = 6-noded triangle + Z_QUA04 = 4-noded quadrilateral + Z_QUA08 = 8-noded quadrilateral + Z_TET04 = 4-noded tetrahedron + Z_TET10 = 10-noded tetrahedron + Z_PYR05 = 5-noded pyramid + Z_PYR13 = 13-noded pyramid + Z_PEN06 = 6-noded pentahedron + Z_PEN15 = 15-noded pentahedron + Z_HEX08 = 8-noded hexahedron + Z_HEX20 = 20-noded hexahedron + + Z_G_POINT = ghost node point element + Z_G_BAR02 = 2 node ghost bar + Z_G_BAR03 = 3 node ghost bar + Z_G_TRI03 = 3 node ghost triangle + Z_G_TRI06 = 6 node ghost triangle + Z_G_QUA04 = 4 node ghost quad + Z_G_QUA08 = 8 node ghost quad + Z_G_TET04 = 4 node ghost tetrahedron + Z_G_TET10 = 10 node ghost tetrahedron + Z_G_PYR05 = 5 node ghost pyramid + Z_G_PYR13 = 13 node ghost pyramid + Z_G_PEN06 = 6 node ghost pentahedron + Z_G_PEN15 = 15 node ghost pentahedron + Z_G_HEX08 = 8 node ghost hexahedron + Z_G_HEX20 = 20 node ghost hexahedron + + (Ignored unless Z_UNSTRUCTURED type) + + (Array will have been allocated + Numparts_available by + Z_MAXTYPE long) + + (OUT) max_ijk_dimensions = 2D array containing maximum ijk dimensions + for each structured model part (over all time). + ---------- + (Ignored if Z_UNSTRUCTURED type) + + (Array will have been allocated + Numparts_available by 3 long) + + max_ijk_dimensions[][0] = maximum I dimension + max_ijk_dimensions[][1] = maximum J dimension + max_ijk_dimensions[][2] = maximum K dimension + + Notes: + ----- + * You need to have first called USERD_get_number_of_model_parts and + USERD_get_gold_part_build_info, so Numparts_available is known and + so EnSight will know what the type is (Z_UNSTRUCTURED, Z_STRUCTURED, + or Z_IBLANKED) of each part. + + * This will NOT be based on Current_time_step - it is to be the maximum + values over all time!! + + * This information is optional. If you return Z_ERR, Ensight will still + process things fine, reallocating as needed, etc. However, for + large transient models you will likely use considerably more memory + and take more processing time for the memory reallocations. So, if it + is possible to provide this information "up front", it is recommended + to do so. + + +-------------------------------------------------------------------- +USERD_get_model_extents + + Description: + ----------- + Gets the model bounding box extents. If this routine supplys them + EnSight will not have to spend time doing so. If this routine + returns Z_ERR, EnSight will have to take the time to touch all the + nodes and gather the extent info. + + Specification: + ------------- + int USERD_get_model_extents(float extents[6]) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful (whereupon EnSight will determine by reading + all coords of all parts) + + Arguments: + --------- + (OUT) extents[0] = min x + [1] = max x + [2] = min y + [3] = max y + [4] = min z + [5] = max z + + Notes: + ----- + * This will be based on Current_time_step + + +-------------------------------------------------------------------- +USERD_get_name_of_reader + + Description: + ----------- + Gets the name of your user defined reader. The user interface will + ask for this and include it in the available reader list. + + Specification: + ------------- + int USERD_get_name_of_reader(char reader_name[Z_MAX_USERD_NAME], + int *two_fields) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (OUT) reader_name = the name of the your reader or data format. + (max length is Z_MAX_USERD_NAME, which is 20) + + (OUT) two_fields = FALSE if only one data field is + required. + TRUE if two data fields required + + -1 if one field (Geom) required + and one field (Param) is optional + Param field can contain any text + for example a file name, modifiers, + etc. that can be used to modify the + reader's behavior. + + + Notes: + ----- + * Always called. Please be sure to provide a name for your custom + reader format. + +-------------------------------------------------------------------- +USERD_get_nfaced_conn + + Description: + ----------- + Gets the array containing the connectivity of nsided faces of nfaced elements + + Specification: + -------------int + int USERD_get_nfaced_conn(int part_number, + int *nfaced_conn_array) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) part_number = the part number + + (OUT) nfaced_conn_array = 1D array of nsided face connectivies of nfaced + elements + + (int array will have been allocated long enough to + hold all the nsided face connectivities. Which is + the sum of all the nodes per face values in the + nfaced_npf_array of USERD_get_nfaced_nodes_per_face) + + Notes: + ----- + * Will not be called unless there are some nfaced elements in the part + + * Providing nfaced information to Ensight: + + 1. In USERD_get_gold_part_build_info, provide the number of nfaced + polyhedral elements in the part. + + 2. In USERD_get_part_elements_by_type, provide (in the conn_array), + the number of faces per nfaced element. (as if connectivity + length of an nfaced element is one) + + 3. In this routine, provide the streamed number of nodes per face + for each of the faces of the nfaced elements. + + + Simple example: 11 10 12 + +--------+-----+ + 2 nfaced elements: /| |\ /| + (1 7-faced / | | \ / | + 1 5-sided) / | | +9 | + / | | /| | + /7 | 8 / | | + +-----------+/ | | | + | |5 | |4 | |6 + | +-----|--+--|--+ + | / | \ | / + | / | \|/3 + | / | + + | / | / + |/1 |2 / + +-----------+/ + + 1. In USERD_get_gold_part_build_info: + number_of_elements[Z_NFACED] = 2 + . + /|\ + | + 2. In USERD_get_part_elements_by_type: + length of conn_array will be: 2 x 1 + for element_type of Z_NFACED: + conn_array[0][0] = 7 (for the 7-faced element) + conn_array[1][0] = 5 (for the 5-faced element) + + == + Sum 12 <---------+ + | + 3. In USERD_get_faced_nodes_per_face: | + length of nfaced_npf_array will be: 12 + + nfaced_npf_array[0] = 5 (5-noded top face of 7-faced element) + nfaced_npf_array[1] = 5 (5-noded bot face of 7-faced element) + nfaced_npf_array[2] = 4 (4-noded front face of 7-faced element) + nfaced_npf_array[3] = 4 (4-noded left face of 7-faced element) + nfaced_npf_array[4] = 4 (4-noded back face of 7-faced element) + nfaced_npf_array[5] = 4 (4-noded right front face of 7-faced element) + nfaced_npf_array[6] = 4 (4-noded right back face of 7-faced element) + + nfaced_npf_array[7] = 3 (3-noded top face of 5-faced element) + nfaced_npf_array[8] = 3 (3-noded bot face of 5-faced element) + nfaced_npf_array[9] = 4 (4-noded back face of 5-faced element) + nfaced_npf_array[10] = 4 (4-noded right face of 5-faced element) + nfaced_npf_array[11] = 4 (4-noded left front face of 5-faced element) + + == + Sum 48 <-------------+ + | + 4. In this function: | + length of the nfaced_conn_array will be: 48 + + nsided_conn_array[0] = 7 (conn of 5-noded top face of 7-faced elem) + nsided_conn_array[1] = 8 + nsided_conn_array[2] = 9 + nsided_conn_array[3] = 10 + nsided_conn_array[4] = 11 + + nsided_conn_array[5] = 1 (conn of 5-noded bot face of 7-faced elem) + nsided_conn_array[6] = 5 + nsided_conn_array[7] = 4 + nsided_conn_array[8] = 3 + nsided_conn_array[9] = 2 + + nsided_conn_array[10] = 1 (conn of 4-noded front face of 7-faced elem) + nsided_conn_array[11] = 2 + nsided_conn_array[12] = 8 + nsided_conn_array[13] = 7 + + nsided_conn_array[14] = 5 (conn of 4-noded left face of 7-faced elem) + nsided_conn_array[15] = 1 + nsided_conn_array[16] = 7 + nsided_conn_array[17] = 11 + + nsided_conn_array[18] = 4 (conn of 4-noded back face of 7-faced elem) + nsided_conn_array[19] = 5 + nsided_conn_array[20] = 11 + nsided_conn_array[21] = 10 + + nsided_conn_array[22] = 2 (conn of 4-noded right front face of 7-faced) + nsided_conn_array[23] = 3 + nsided_conn_array[24] = 9 + nsided_conn_array[25] = 8 + + nsided_conn_array[26] = 3 (conn of 4-noded right back face of 7-faced) + nsided_conn_array[27] = 4 + nsided_conn_array[28] = 10 + nsided_conn_array[29] = 9 + + nsided_conn_array[30] = 9 (conn of 3-noded top face of 5-faced elem) + nsided_conn_array[32] = 12 + nsided_conn_array[32] = 10 + + nsided_conn_array[33] = 3 (conn of 3-noded bot face of 5-faced elem) + nsided_conn_array[34] = 4 + nsided_conn_array[35] = 6 + + nsided_conn_array[36] = 6 (conn of 4-noded back face of 5-faced elem) + nsided_conn_array[37] = 4 + nsided_conn_array[38] = 10 + nsided_conn_array[39] = 12 + + nsided_conn_array[40] = 3 (conn of 4-noded right face of 5-faced elem) + nsided_conn_array[41] = 6 + nsided_conn_array[42] = 12 + nsided_conn_array[43] = 9 + + nsided_conn_array[44] = 4 (conn of 4-noded left front face of 5-faced) + nsided_conn_array[45] = 3 + nsided_conn_array[46] = 9 + nsided_conn_array[47] = 10 + + + +-------------------------------------------------------------------- +USERD_get_nfaced_nodes_per_face - + + Description: + ----------- + Gets the array containing the number of nodes per face for each face + of the nfaced elements. + + Specification: + ------------- + int USERD_get_nfaced_nodes_per_face(int part_number, + int *nfaced_npf_array) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) part_number = the part number + + (OUT) nfaced_npf_array = 1D array of nodes per face for all faces of + nfaced elements + + (int array will have been allocated long enough + to hold all the nodes_per_face values. Which is + the sum of all the number of faces per element + values in the conn_array of + USERD_get_part_elements_by_type) + + Notes: + ----- + * Will not be called unless there are some nfaced elements in the + the part + + * Providing nfaced information to Ensight: + + 1. In USERD_get_gold_part_build_info, provide the number of nfaced + polyhedral elements in the part. + + 2. In USERD_get_part_elements_by_type, provide (in the conn_array), + the number of faces per nfaced element. (as if connectivity + length of an nfaced element is one) + + 3. In this routine, provide the streamed number of nodes per face + for each of the faces of the nfaced elements. + + + Simple example: 11 10 12 + +--------+-----+ + 2 nfaced elements: /| |\ /| + (1 7-faced / | | \ / | + 1 5-sided) / | | +9 | + / | | /| | + /7 | 8 / | | + +-----------+/ | | | + | |5 | |4 | |6 + | +-----|--+--|--+ + | / | \ | / + | / | \|/3 + | / | + + | / | / + |/1 |2 / + +-----------+/ + + 1. In USERD_get_gold_part_build_info: + number_of_elements[Z_NFACED] = 2 + . + /|\ + | + 2. In USERD_get_part_elements_by_type: + length of conn_array will be: 2 x 1 + for element_type of Z_NFACED: + conn_array[0][0] = 7 (for the 7-faced element) + conn_array[1][0] = 5 (for the 5-faced element) + + == + Sum 12 <---------+ + | + 3. In this routine: | + length of nfaced_npf_array will be: 12 + + nfaced_npf_array[0] = 5 (5-noded top face of 7-faced element) + nfaced_npf_array[1] = 5 (5-noded bot face of 7-faced element) + nfaced_npf_array[2] = 4 (4-noded front face of 7-faced element) + nfaced_npf_array[3] = 4 (4-noded left face of 7-faced element) + nfaced_npf_array[4] = 4 (4-noded back face of 7-faced element) + nfaced_npf_array[5] = 4 (4-noded right front face of 7-faced element) + nfaced_npf_array[6] = 4 (4-noded right back face of 7-faced element) + + nfaced_npf_array[7] = 3 (3-noded top face of 5-faced element) + nfaced_npf_array[8] = 3 (3-noded bot face of 5-faced element) + nfaced_npf_array[9] = 4 (4-noded back face of 5-faced element) + nfaced_npf_array[10] = 4 (4-noded right face of 5-faced element) + nfaced_npf_array[11] = 4 (4-noded left front face of 5-faced element) + + == + Sum 48 <-------------+ + | + 4. In USERD_get_nfaced_conn: | + length of the nfaced_conn_array will be: 48 + + nsided_conn_array[0] = 7 (conn of 5-noded top face of 7-faced elem) + nsided_conn_array[1] = 8 + nsided_conn_array[2] = 9 + nsided_conn_array[3] = 10 + nsided_conn_array[4] = 11 + + nsided_conn_array[5] = 1 (conn of 5-noded bot face of 7-faced elem) + nsided_conn_array[6] = 5 + nsided_conn_array[7] = 4 + nsided_conn_array[8] = 3 + nsided_conn_array[9] = 2 + + nsided_conn_array[10] = 1 (conn of 4-noded front face of 7-faced elem) + nsided_conn_array[11] = 2 + nsided_conn_array[12] = 8 + nsided_conn_array[13] = 7 + + nsided_conn_array[14] = 5 (conn of 4-noded left face of 7-faced elem) + nsided_conn_array[15] = 1 + nsided_conn_array[16] = 7 + nsided_conn_array[17] = 11 + + nsided_conn_array[18] = 4 (conn of 4-noded back face of 7-faced elem) + nsided_conn_array[19] = 5 + nsided_conn_array[20] = 11 + nsided_conn_array[21] = 10 + + nsided_conn_array[22] = 2 (conn of 4-noded right front face of 7-faced) + nsided_conn_array[23] = 3 + nsided_conn_array[24] = 9 + nsided_conn_array[25] = 8 + + nsided_conn_array[26] = 3 (conn of 4-noded right back face of 7-faced) + nsided_conn_array[27] = 4 + nsided_conn_array[28] = 10 + nsided_conn_array[29] = 9 + + nsided_conn_array[30] = 9 (conn of 3-noded top face of 5-faced elem) + nsided_conn_array[32] = 12 + nsided_conn_array[32] = 10 + + nsided_conn_array[33] = 3 (conn of 3-noded bot face of 5-faced elem) + nsided_conn_array[34] = 4 + nsided_conn_array[35] = 6 + + nsided_conn_array[36] = 6 (conn of 4-noded back face of 5-faced elem) + nsided_conn_array[37] = 4 + nsided_conn_array[38] = 10 + nsided_conn_array[39] = 12 + + nsided_conn_array[40] = 3 (conn of 4-noded right face of 5-faced elem) + nsided_conn_array[41] = 6 + nsided_conn_array[42] = 12 + nsided_conn_array[43] = 9 + + nsided_conn_array[44] = 4 (conn of 4-noded left front face of 5-faced) + nsided_conn_array[45] = 3 + nsided_conn_array[46] = 9 + nsided_conn_array[47] = 10 + + + + +-------------------------------------------------------------------- +USERD_get_node_label_status + + Description: + ----------- + Answers the question as to whether node labels will be provided. + + Specification: + ------------- + int USERD_get_node_label_status( void ) + + Returns: + ------- + TRUE if node labels will be provided + FALSE if node labels will NOT be provided + + Arguments: + --------- + none + + Notes: + ----- + * Node ids are needed in order to do any node querying, or node + labeling on-screen within EnSight. + + * Prior to API 2.01: + ----------------- + For unstructured parts, you can read them from your file if + available, or can assign them, etc. They need to be unique + per part, and are often unique per model. They must also be + positive numbers greater than zero. + + USERD_get_part_node_ids is used to obtain the ids, if the + status returned here is TRUE. + + (Unlike API 1.0, where the connectivity of elements had to be + according to the node ids - API 2.0's element connectivities + are not affected either way by the status here.) + + For structured parts, EnSight will assign ids if you return a + status of TRUE here. You cannot assign them yourself!! + + * Starting at API 2.01: + -------------------- + For both unstructured and structured parts, you can read them + from your file if available, or can assign them, etc. They need + to be unique per part, and are often unique per model. They must + also be positive numbers greater than zero. + + USERD_get_part_node_ids is used to obtain the ids, if the + status returned here is TRUE. + + * Will call USERD_get_part_node_ids for each part if this routine + returns TRUE. + +-------------------------------------------------------------------- +USERD_get_nsided_conn - + + Description: + ----------- + Gets the array containing the connectivity of nsided elements + + Specification: + ------------- + int USERD_get_nsided_conn(int part_number, + int *nsided_conn_array) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) part_number = the part number + + (OUT) nsided_conn_array = 1D array of nsided connectivies + + (int array will have been allocated long enough + to hold all the nsided connectivities. Which is + the sum of all the nodes_per_element values in + the conn_array of USERD_get_part_elements_by_type) + + + Notes: + ----- + * Will not be called unless there are some nsided elements in the the part. + + * Providing nsided information to Ensight: + + 1. In USERD_get_gold_part_build_info, provide the number of nsided + elements in the part. + + 2. In USERD_get_part_elements_by_type, provide (in the conn_array), + the number of nodes per nsided element. (as if connectivity + length of an nsided element is one) + + 3. In this routine, provide the streamed connectivities for each of the + nsided elements. + + + Simple example: 5 6 + +--------+ + 3 nsided elements: /| \ + (1 4-sided / | \ + 1 3-sided / | \ + 1 7-sided) / | \ 7 + /3 |4 + + +-----+ | + | | | + | | |8 + | | + + | | / + | | / + | | / + |1 |2 /9 + +-----+--------+ + + 1. In USERD_get_gold_part_build_info: + number_of_elements[Z_NSIDED] = 3 + . + /|\ + | + 2. In USERD_get_part_elements_by_type: + length of conn_array will be: 3 x 1 + + for element_type of Z_NSIDED: + conn_array[0][0] = 4 (for the 4-sided element) + conn_array[1][0] = 3 (for the 3-sided element) + conn_array[2][0] = 7 (for the 7-sided element) + + Sum === + 14 <---------+ + | + 3. In this routine: | + length of nsided_conn_array will be: 14 + + nsided_conn_array[0] = 1 (connectivity of 4-sided element) + nsided_conn_array[1] = 2 + nsided_conn_array[2] = 4 + nsided_conn_array[3] = 3 + + nsided_conn_array[4] = 3 (connectivity of 3-sided element) + nsided_conn_array[5] = 4 + nsided_conn_array[6] = 5 + + nsided_conn_array[7] = 2 (connectivity of 7-sided element) + nsided_conn_array[8] = 9 + nsided_conn_array[9] = 8 + nsided_conn_array[10] = 7 + nsided_conn_array[11] = 6 + nsided_conn_array[12] = 5 + nsided_conn_array[13] = 4 + + + + +-------------------------------------------------------------------- +USERD_get_num_of_time_steps + + Description: + ----------- + Gets the number of time steps of data available for desired timeset. + + Specification: + ------------- + int USERD_get_num_of_time_steps( int timeset_number ) + + Returns: + ------- + Number of time steps in timeset (>0 if okay, <=0 if problems). + + Arguments: + --------- + (IN) timeset number = the timeset number + + For example: If USERD_get_number_of_timesets + returns 2, the valid + timeset_number's would be 1 and 2 + + Notes: + ----- + * This should be >= 1 1 indicates a static model + >1 indicates a transient model + + * Num_time_steps[timeset_number] would be set here + + + +-------------------------------------------------------------------- +USERD_get_number_of_files_in_dataset + + Description: + ----------- + Get the total number of files in the dataset. Used for the + dataset query option within EnSight. + + Specification: + ------------- + int USERD_get_number_of_files_in_dataset( void ) + + Returns: + ------- + The total number of files in the dataset. + + Arguments: + --------- + none + + Notes: + ----- + * You can be as complete as you want about this. If you don't + care about the dataset query option, return a value of 0 + If you only want certain files, you can just include them. But, + you will need to supply the info in USERD_get_dataset_query_file_info + for each file you include here. + + * Num_dataset_files would be set here + + +-------------------------------------------------------------------- +USERD_get_number_of_material_sets - + + Description: + ----------- + Get the number of material sets in the model + + Specification: + ------------- + int USERD_get_number_of_material_sets( void ) + + + Returns: + ------- + Num_material_sets = number of material sets + (Zero would indicate that you have no materials + to deal with in the model) + + or + + -1 if an error condition + + Arguments: + --------- + none + + Notes: + ----- + * You may want to keep this as a global for use in other routines. + + ############################################################### + NOTE: For EnSight 7.6, only one material set is supported + within EnSight. + Thus the only valid returns here are: + 0 (no materials) + 1 (for the one material set allowed) + or -1 (if an error) + + If the casefile has more than this, this reader will + read them, but EnSight will issue an error message and + choke on them! + ############################################################### + + ================================================================ + A very simple explanatory example, to use as a reference for the + materials routines: + + Given a 2D mesh composed of 9 quad (Z_QUA04) elements, with two materials. + Most of the model is material 1, but the top left corner is material 9 - + basically as shown: + + + *--------*--------*--------* + | | / | | + | Mat 9 / | | + | | / | | + | |/ | | + | e7 / e8 | e9 | + | /| | | + | / | | | + | / | | | + *----/---*--------*--------* + | / | | | + | / | | | + | / | Mat 1 | + |/ | | | + | e4 | e5 | e6 | + | | | | + | | | | + | | | | + *--------*--------*--------* + | | | | + | | | | + | | | | + | | | | + | e1 | e2 | e3 | + | | | | + | | | | + | | | | + *--------*--------*--------* + + + Thus, in this routine, set: + Num_material_sets = 1 + + In USERD_get_matf_set_info, set: + mat_set_ids[0] = 1 + mat_set_name[0] = "Material Set 1" (or whatever name desired) + + In USERD_get_number_of_materials, input would be set_index = 0, and + would need to set: + Num_materials[0] = 2 + + For simplicity, the ids and descriptions that would be returned in + USERD_get_matf_var_info could be: + mat_ids[0] = 1 + mat_ids[1] = 9 + mat_desc[0] = "mat 1" (or whatever desired) + mat_desc[2] = "mat 9" + + The per element material ids list would need to be: + + material ids: + ------------- + ids_list[0] = 1 (material id 1, for elem e1) + ids_list[1] = 1 ( " e2) + ids_list[2] = 1 ( " e3) + ids_list[3] = -1 (negative of index into mixed-material id list, for elem e4) + ids_list[5] = 1 (material id 1, for elem e5) + ids_list[5] = 1 ( " e6) + ids_list[5] = -5 (negative of index into mixed-material id list, for elem e7) + ids_list[5] = -9 ( " e8) + ids_list[5] = 1 (material id 1, for elem e9) + + Finally we need the mixed material ids list and the mixed materials values list, + which would need to be: + + mixed-material ids: + ------------------- + ==> 1 ids_list[0] = 2 (the -1 in the material variable points here, + 2 indicates that two materials are present) + 2 ids_list[1] = 1 (1st material is 1) + 3 ids_list[2] = 9 (2nd material is 9) + 4 ids_list[3] = -1 (negative of index into mixed-material val_list) + ==> 5 ids_list[4] = 2 (the -5 in the material variable points here, + 2 indicates that two materials are present) + 6 ids_list[5] = 1 (1st material is 1) + 7 ids_list[6] = 9 (2nd material is 9) + 8 ids_list[7] = -3 (negative of index into mixed-material val_list) + ==> 9 ids_list[8] = 2 etc. + 10 ids_list[9] = 1 + 11 ids_list[10] = 9 + 12 ids_list[11] = -5 + + mixed-material values: + ---------------------- + ==> 1 val_list[0] = 0.875 (the -1 in the mixed-material ids_list points here, + and this is the value for material 1) + 2 val_list[1] = 0.125 (the value for material 9) + ==> 3 val_list[2] = 0.125 (the -3 in the mixed-materials ids_list points here) + 4 val_list[3] = 0.875 + ==> 5 val_list[4] = 0.875 (the -5 in the mixed-materials ids_list points here) + 6 val_list[5] = 0.125 + + So, USERD_size_matf_data would need to return + matf_size = 8, when called with set_id = 1 + part_id = 1 + wtyp = Z_QUA04 + mat_type = Z_MAT_INDEX + + matf_size = 12, when called with set_id = 1 + part_id = 1 + mat_type = Z_MIX_INDEX + + = 6, when called with set_id = 1 + part_id = 1 + mat_type = Z_MIX_VALUE + + And, USERD_load_matf_data would need to return: + the int array ids_list as shown above when called with: + set_id = 1 + part_id = 1 + wtyp = Z_QUA04 + mat_type = Z_MAT_INDEX (indicating id list). + + the int array ids_list as shown above when called with: + set_id = 1 + part_id = 1 + mat_type = Z_MIX_INDEX (indicating id list). + + the float array val_list as shown above when called with: + set_id = 1 + part_id = 1 + mat_type = Z_MIX_VALUE (indicating val list). + + +------------------------------------------------------------------------- +USERD_get_number_of_materials + + Description: + ----------- + Gets the number of materials in the material set + + Specification: + ------------- + int USERD_get_number_of_materials( int set_index ) + + Returns: + ------- + Num_materials[set_index] = Number of materials in the set + 0 indicates no materials information present + -1 indicates an error + Arguments: + --------- + (IN) set_index = the material set index (zero based) + + Notes: + ----- + * See USERD_get_number_of_material_sets header for explanatory example + * Will not be called if Num_material_sets is zero + * You may want to keep this as a global for use in other routines. + + + +-------------------------------------------------------------------- +USERD_get_number_of_model_parts + + Description: + ----------- + Gets the total number of unstructured and structured parts + in the model, for which you can supply information. + + Specification: + ------------- + int USERD_get_number_of_model_parts( void ) + + Returns: + ------- + Number of parts (>0 if okay, <=0 if problems). + + Arguments: + --------- + none + + Notes: + ----- + * If going to have to read down through the parts in order to + know how many, you may want to build a table of pointers to + the various parts, so you can easily get to particular parts in + later processes. If you can simply read the number of parts + at the head of the file, then you would probably not build the + table at this time. + + * This routine would set Numparts_available, which is equal to + Num_unstructured_parts + Num_structured_blocks. + + + +-------------------------------------------------------------------- +USERD_get_number_of_timesets + + Description: + ----------- + Gets the number of timesets used in the model. + + Specification: + ------------- + int USERD_get_number_of_timesets( void ) + + Returns: + ------- + Number of timesets in the model + + Arguments: + --------- + none + + Notes: + ----- + * Num_timesets would be set here + + * If you have a static model, both geometry and variables, you should + return a value of zero. + + * If you have a transient model, then you should return one or more. + + For example: + + Geometry Variables No. of timesets + --------- ------------------------------ --------------- + static static 0 + static transient, all using same timeset 1 + + transient transient, all using same timeset as geom 1 + + static transient, using 3 different timesets 3 + + transient transient, using 3 different timesets and + none of them the same as the + geometry timeset 4 + etc. + + NOTE: ALL GEOMETRY MUST USE THE SAME TIMESET!!! You will have to provide + the timeset number to use + for geometry in: + USERD_get_geom_timeset_number + + Variables can use the same timeset as the geometry, or can use + other timesets. More than one variable can use the same timeset. + + example: changing geometry at 5 steps, 0.0, 1.0, 2.0, 3.0, 4.0 + variable 1 provided at these same five steps + variable 2 provided at 3 steps, 0.5, 1.25, 3.33 + + This routine should return a value of 2, because only + two different timesets are needed. Timeset 1 would be for the + geometry and variable 1 (they both use it). Timeset 2 would + be for variable 2, which needs its own in this case. + + + + + +-------------------------------------------------------------------- +USERD_get_number_of_variables + + Description: + ----------- + Get the number of variables for which you will be providing info. + + Specification: + ------------- + int USERD_get_number_of_variables( void ) + + Returns: + ------- + Number of variables (includes constant, scalar, vector and tensor types) + (>=0 if okay, <0 if problem) + + Arguments: + --------- + none + + Notes: + ----- + ***************************************************************** + * Variable numbers, by which references will be made, are implied + here. If you say there are 3 variables, the variable numbers + will be 1, 2, and 3. + ***************************************************************** + + * Num_variables would be set here + + + +-------------------------------------------------------------------- +USERD_get_part_coords + + Description: + ----------- + Gets the coordinates for an unstructured part. + + Specification: + ------------- + int USERD_get_part_coords(int part_number, float **coord_array) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) part_number = The part number + (1-based index of part table, namely: + + 1 ... Numparts_available. + + It is NOT the part_id that + is loaded in USERD_get_gold_part_build_info) + + (OUT) coord_array = 2D float array which contains, + x,y,z coordinates of each node + in the part. + + (IMPORTANT: The second dimension of this aray is 1-based!!!) + + (Array will have been allocated + 3 by (number_of_nodes + 1) for the part + long - see USERD_get_gold_part_build_info) + + + ex) If number_of_nodes = 100 + as obtained in: + USERD_get_gold_part_build_info + + Then the allocated dimensions of the + pointer sent to this routine will be: + coord_array[3][101] + + Ignore the coord_array[0][0] + coord_array[1][0] + coord_array[2][0] locations and start + the node coordinates at: + coord_array[0][1] + coord_array[1][1] + coord_array[2][1] + + coord_array[0][2] + coord_array[1][2] + coord_array[2][2] + + etc. + + Notes: + ----- + * Not called unless Num_unstructured_parts is > 0 + + * Will be based on Current_time_step + + +-------------------------------------------------------------------- +USERD_get_part_element_ids_by_type + + Description: + ----------- + Gets the ids for the elements of a particular type for an unstructured + or structured part. + + Specification: + ------------- + int USERD_get_part_element_ids_by_type(int part_number, + int element_type, + int *elemid_array) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) part_number = The part number + (1-based index of part table, namely: + + 1 ... Numparts_available. + + It is NOT the part_id that + is loaded in USERD_get_gold_part_build_info) + + (IN) element_type = One of the following (See global_extern.h) + Z_POINT node point element + Z_BAR02 2 node bar + Z_BAR03 3 node bar + Z_TRI03 3 node triangle + Z_TRI06 6 node triangle + Z_QUA04 4 node quad + Z_QUA08 8 node quad + Z_TET04 4 node tetrahedron + Z_TET10 10 node tetrahedron + Z_PYR05 5 node pyramid + Z_PYR13 13 node pyramid + Z_PEN06 6 node pentahedron + Z_PEN15 15 node pentahedron + Z_HEX08 8 node hexahedron + Z_HEX20 20 node hexahedron + + Z_G_POINT ghost node point element + Z_G_BAR02 2 node ghost bar + Z_G_BAR03 3 node ghost bar + Z_G_TRI03 3 node ghost triangle + Z_G_TRI06 6 node ghost triangle + Z_G_QUA04 4 node ghost quad + Z_G_QUA08 8 node ghost quad + Z_G_TET04 4 node ghost tetrahedron + Z_G_TET10 10 node ghost tetrahedron + Z_G_PYR05 5 node ghost pyramid + Z_G_PYR13 13 node ghost pyramid + Z_G_PEN06 6 node ghost pentahedron + Z_G_PEN15 15 node ghost pentahedron + Z_G_HEX08 8 node ghost hexahedron + Z_G_HEX20 20 node ghost hexahedron + + (OUT) elemid_array = 1D array containing id of each + element of the type. + + (Array will have been allocated + number_of_elements of the type long) + + ex) If number_of_elements[Z_TRI03] = 25 + number_of_elements[Z_QUA04] = 100 + number_of_elements[Z_HEX08] = 30 + as obtained in: + USERD_get_gold_part_build_info + + Then the allocated dimensions available + for this routine will be: + conn_array[25] when called with Z_TRI03 + + conn_array[100] when called with Z_QUA04 + + conn_array[30] when called with Z_HEX08 + + Notes: + ----- + * Not called unless element label status is set to TRUE in + USERD_get_element_label_status + + * Will be based on Current_time_step + + + +-------------------------------------------------------------------- +USERD_get_part_elements_by_type + + Description: + ----------- + Gets the connectivities for the elements of a particular type in an + unstructured part + + Specification: + ------------- + int USERD_get_part_elements_by_type(int part_number, + int element_type, + int **conn_array) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) part_number = The part number + (1-based index of part table, namely: + + 1 ... Numparts_available. + + It is NOT the part_id that + is loaded in USERD_get_gold_part_build_info) + + (IN) element_type = One of the following (See global_extern.h) + Z_POINT node point element + Z_BAR02 2 node bar + Z_BAR03 3 node bar + Z_TRI03 3 node triangle + Z_TRI06 6 node triangle + Z_QUA04 4 node quad + Z_QUA08 8 node quad + Z_TET04 4 node tetrahedron + Z_TET10 10 node tetrahedron + Z_PYR05 5 node pyramid + Z_PYR13 13 node pyramid + Z_PEN06 6 node pentahedron + Z_PEN15 15 node pentahedron + Z_HEX08 8 node hexahedron + Z_HEX20 20 node hexahedron + + Z_G_POINT ghost node point element + Z_G_BAR02 2 node ghost bar + Z_G_BAR03 3 node ghost bar + Z_G_TRI03 3 node ghost triangle + Z_G_TRI06 6 node ghost triangle + Z_G_QUA04 4 node ghost quad + Z_G_QUA08 8 node ghost quad + Z_G_TET04 4 node ghost tetrahedron + Z_G_TET10 10 node ghost tetrahedron + Z_G_PYR05 5 node ghost pyramid + Z_G_PYR13 13 node ghost pyramid + Z_G_PEN06 6 node ghost pentahedron + Z_G_PEN15 15 node ghost pentahedron + Z_G_HEX08 8 node ghost hexahedron + Z_G_HEX20 20 node ghost hexahedron + + + (OUT) conn_array = 2D array containing connectivity + of each element of the type. + + (Array will have been allocated + num_of_elements of the type by + connectivity length of the type) + + ex) If number_of_elements[Z_TRI03] = 25 + number_of_elements[Z_QUA04] = 100 + number_of_elements[Z_HEX08] = 30 + as obtained in: + USERD_get_gold_part_build_info + + Then the allocated dimensions available + for this routine will be: + conn_array[25][3] when called with Z_TRI03 + + conn_array[100][4] when called with Z_QUA04 + + conn_array[30][8] when called with Z_HEX08 + + Notes: + ----- + * Not called unless Num_unstructured_parts is > 0 + + * Will be based on Current_time_step + + +-------------------------------------------------------------------- +USERD_get_part_node_ids + + Description: + ----------- + Gets the node ids of an unstructured or structured part. + + Specification: + ------------- + int USERD_get_part_node_ids(int part_number, int *nodeid_array) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) part_number = The part number + (1-based index of part table, namely: + + 1 ... Numparts_available. + + It is NOT the part_id that + is loaded in USERD_get_gold_part_build_info) + + (OUT) nodeid_array = 1D array containing node ids of + each node in the part. + + (IMPORTANT: This array is 1-based!!!) + + (Array will have been allocated + (number_of_nodes + 1) for the part long + see USERD_get_gold_part_build_info) + + ex) If number_of_nodes = 100 + as obtained in: + USERD_get_gold_part_build_info + + Then the allocated dimensions of the + pointer sent to this routine will be: + nodeid_array[101] + + Ignore the nodeid_array[0] location and start + the node ids at: + nodeid_array[1] + + nodeid_array[2] + + etc. + + Notes: + ----- + * Not called unless node label status is TRUE, as returned from + USERD_get_node_label_status + + * Will be based on Current_time_step + + * The ids are purely labels, used when displaying or querying node ids. + However, any node id < 0 will never be displayed + + +-------------------------------------------------------------------- +USERD_get_reader_descrip + + Description: + ----------- + Gets the description of the reader, so gui can give more info + + Specification: + ------------- + int USERD_get_reader_descrip(char descrip[Z_MAXFILENP]) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (OUT) descrip = the description of the reader (max length is MAXFILENP, + which is 255) + + Notes: + ----- + * OPTIONAL ROUTINE! You can have it or not. + + + +-------------------------------------------------------------------- +USERD_get_reader_version + + Description: + ----------- + Gets the version number of the user defined reader + + Specification: + ------------- + int USERD_get_reader_version(char version_number[Z_MAX_USERD_NAME]) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful (and will assume is version 1.0) + + Arguments: + --------- + (OUT) version_number = the version number of the reader + (max length is Z_MAX_USERD_NAME, which + is 20) + + Notes: + ----- + * This needs to be "2.000" or greater. Otherwise EnSight will assume + this reader is API 1.0 + + * should set it to "2.010" for this version of the API + + + + +-------------------------------------------------------------------- +USERD_get_sol_times + + Description: + ----------- + Get the solution times associated with each time step for + desired timeset. + + Specification: + ------------- + int USERD_get_sol_times(int timeset_number, + float *solution_times) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) timeset_number = the timeset number + + For example: If USERD_get_number_of_timesets + returns 2, the valid + timeset_number's would be 1 and 2 + + (OUT) solution_times = 1D array of solution times per time step + + (Array will have been allocated + Num_time_steps[timeset_number] long) + + Notes: + ----- + * The solution times must be non-negative and increasing. + + + +-------------------------------------------------------------------- +USERD_get_timeset_description - + + Description: + ----------- + Get the description to associate with the desired timeset. + + Specification: + ------------- + int USERD_get_timeset_description(int timeset_number, + char timeset_description[Z_BUFL]) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) timeset_number = the timeset number + + For example: If USERD_get_number_of_timesets + returns 2, the valid + timeset_number's would be 1 and 2 + + (OUT) timeset_description = timeset description string + + + Notes: + ----- + * A string of NULLs is valid for timeset_description + + + + +-------------------------------------------------------------------- +USERD_get_var_by_component + + Description: + ----------- + Gets the values of a variable component. Both unstructured and structured + parts use this routine. + + if Z_PER_NODE: + Get the component value at each node for a given variable in the part. + + or if Z_PER_ELEM: + Get the component value at each element of a specific part and type + for a given variable. + + Specification: + ------------- + int USERD_get_var_by_component(int which_variable, + int which_part, + int var_type, + int which_type, + int imag_data, + int component, + float *var_array) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + or: Z_UNDEF, in which case you need not load any values into var_array + + + Arguments: + --------- + (IN) which_variable = The variable number + + (IN) which_part Since EnSight Version 7.4 + ------------------------- + = The part number + + (1-based index of part table, namely: + + 1 ... Numparts_available. + + It is NOT the part_id that + is loaded in USERD_get_gold_part_build_info) + + Prior to EnSight Version 7.4 + ---------------------------- + = The part id This is the part_id label loaded + in USERD_get_gold_part_build_info. + It is NOT the part table index. + + (IN) var_type = Z_SCALAR + Z_VECTOR + Z_TENSOR (symmetric tensor) + Z_TENSOR9 (asymmetric tensor) + + (IN) which_type + + if Z_PER_NODE: Not used + + if Z_PER_ELEM: = The element type + Z_POINT node point element + Z_BAR02 2 node bar + Z_BAR03 3 node bar + Z_TRI03 3 node triangle + Z_TRI06 6 node triangle + Z_QUA04 4 node quad + Z_QUA08 8 node quad + Z_TET04 4 node tetrahedron + Z_TET10 10 node tetrahedron + Z_PYR05 5 node pyramid + Z_PYR13 13 node pyramid + Z_PEN06 6 node pentahedron + Z_PEN15 15 node pentahedron + Z_HEX08 8 node hexahedron + Z_HEX20 20 node hexahedron + + Z_G_POINT ghost node point element + Z_G_BAR02 2 node ghost bar + Z_G_BAR03 3 node ghost bar + Z_G_TRI03 3 node ghost triangle + Z_G_TRI06 6 node ghost triangle + Z_G_QUA04 4 node ghost quad + Z_G_QUA08 8 node ghost quad + Z_G_TET04 4 node ghost tetrahedron + Z_G_TET10 10 node ghost tetrahedron + Z_G_PYR05 5 node ghost pyramid + Z_G_PYR13 13 node ghost pyramid + Z_G_PEN06 6 node ghost pentahedron + Z_G_PEN15 15 node ghost pentahedron + Z_G_HEX08 8 node ghost hexahedron + Z_G_HEX20 20 node ghost hexahedron + + (IN) imag_data = TRUE if imag component + FALSE if real component + + (IN) component = The component: (0 if Z_SCALAR) + (0 - 2 if Z_VECTOR) + (0 - 5 if Z_TENSOR) + (0 - 8 if Z_TENSOR9) + + * 6 Symmetric Indicies, 0:5 * + * ---------------------------- * + * | 11 12 13 | | 0 3 4 | * + * | | | | * + * T = | 22 23 | = | 1 5 | * + * | | | | * + * | 33 | | 2 | * + + + * 9 General Indicies, 0:8 * + * ---------------------------- * + * | 11 12 13 | | 0 3 4 | * + * | | | | * + * T = | 21 22 23 | = | 6 1 5 | * + * | | | | * + * | 31 32 33 | | 7 8 2 | * + + (OUT) var_array + + ----------------------------------------------------------------------- + (IMPORTANT: this array is 1-based for both Z_PER_NODE and Z_PER_ELEM!!!) + ----------------------------------------------------------------------- + + if Z_PER_NODE: = 1D array containing variable component value + for each node. + + (Array will have been allocated + (number_of_nodes + 1) long) + + Info stored in this fashion: + var_array[0] = not used + var_array[1] = var component for node 1 of part + var_array[2] = var_component for node 2 of part + var_array[3] = var_component for node 3 of part + etc. + + if Z_PER_ELEM: = 1D array containing variable component + value for each element of a particular + part and type. + + (Array will have been allocated + (number_of_elements[which_part][which_type] + 1) + long. See USERD_get_gold_part_build_info) + + Info stored in this fashion: + var_array[1] = var component for elem 1 (of part and type) + var_array[2] = var component for elem 2 (of part and type) + var_array[3] = var component for elem 3 (of part and type) + etc. + + Notes: + ----- + * Not called unless Num_variables is > 0 + + * The per_node or per_elem classification must be obtainable from the + variable number (a var_classify array needs to be retained) + + * Will be based on Current_time_step + + * If the variable is not defined for this part, simply return with a + value of Z_UNDEF. EnSight will treat the variable as undefined for + this part. + + +-------------------------------------------------------------------- +USERD_get_var_value_at_specific + + Description: + ----------- + if Z_PER_NODE: + Get the value of a particular variable at a particular node in a + particular part at a particular time. + + or if Z_PER_ELEM: + Get the value of a particular variable at a particular element of + a particular type in a particular part at a particular time. + + + Specification: + ------------- + int USERD_get_var_value_at_specific(int which_var, + int which_node_or_elem, + int which_part, + int which_elem_type, + int time_step, + float values[3], + int imag_data) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) which_var = The variable number + + (IN) which_node_or_elem + + If Z_PER_NODE: + = The node number. This is not the id, but is + the index of the global node + list (1 based), or the block's + node list (1 based). + + Thus, coord_array[1] + coord_array[2] + coord_array[3] + . | + . |which_node_or_elem index + . ---- + + + If Z_PER_ELEM: + = The element number. This is not the id, but is + the element number index + of the number_of_element array + (see USERD_get_gold_part_build_info), + or the block's element list (1 based). + + Thus, for which_part: + conn_array[which_elem_type][0] + conn_array[which_elem_type][1] + conn_array[which_elem_type][2] + . | + . which_node_or_elem index + . ---- + + + (IN) which_part Since EnSight Version 7.4 + ------------------------- + = The part number + + (1-based index of part table, namely: + + 1 ... Numparts_available. + + It is NOT the part_id that + is loaded in USERD_get_gold_part_build_info) + + Prior to EnSight Version 7.4 + ---------------------------- + = The part id This is the part_id label loaded + in USERD_get_gold_part_build_info. + It is NOT the part table index. + + + (IN) which_elem_type + + If Z_PER_NODE, or block part: + = Not used + + If Z_PER_ELEM: + = The element type. This is the element type index + of the number_of_element array + (see USERD_get_gold_part_build_info) + + (IN) time_step = The time step + + (IN) imag_data = TRUE if want imaginary value. + FALSE if want real value. + + (OUT) values = scalar or vector component value(s) + values[0] = scalar or vector[0] + values[1] = vector[1] + values[2] = vector[2] + + + Notes: + ----- + * This routine is used in node querys over time (or element querys over + time for Z_PER_ELEM variables). If these operations are not critical + to you, this can be a dummy routine. + + * The per_node or per_elem classification must be obtainable from the + variable number (a var_classify array needs to be retained) + + * The time step given is for the proper variable timeset. + + +---------------------------------------------------------------------- +USERD_load_matf_data + + Description: + ----------- + Get the material id list, mixed-material id list, or + mixed-material values list for the given material set and part (and + element type if material id list) + + Specification: + ------------- + int USERD_load_matf_data( int set_index, + int part_id, + int wtyp, + int mat_type, + int *ids_list, + float *val_list) + + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) set_index = the material set index (zero based) + + (IN) part_id = the part number desired + + (IN) wtyp = the element type (used for Z_MAT_INDEX only) + + Z_POINT node point element + Z_BAR02 2 node bar + Z_BAR03 3 node bar + Z_TRI03 3 node triangle + Z_TRI06 6 node triangle + Z_QUA04 4 node quad + Z_QUA08 8 node quad + Z_TET04 4 node tetrahedron + Z_TET10 10 node tetrahedron + Z_PYR05 5 node pyramid + Z_PYR13 13 node pyramid + Z_PEN06 6 node pentahedron + Z_PEN15 15 node pentahedron + Z_HEX08 8 node hexahedron + Z_HEX20 20 node hexahedron + Z_NSIDED nsided polygon + Z_NFACED nfaced polyhedron + + Z_G_POINT ghost node point element + Z_G_BAR02 2 node ghost bar + Z_G_BAR03 3 node ghost bar + Z_G_TRI03 3 node ghost triangle + Z_G_TRI06 6 node ghost triangle + Z_G_QUA04 4 node ghost quad + Z_G_QUA08 8 node ghost quad + Z_G_TET04 4 node ghost tetrahedron + Z_G_TET10 10 node ghost tetrahedron + Z_G_PYR05 5 node ghost pyramid + Z_G_PYR13 13 node ghost pyramid + Z_G_PEN06 6 node ghost pentahedron + Z_G_PEN15 15 node ghost pentahedron + Z_G_HEX08 8 node ghost hexahedron + Z_G_HEX20 20 node ghost hexahedron + Z_G_NSIDED ghost nsided polygon + Z_G_NFACED ghost nfaced polyhedron + + (IN) mat_type = Z_MAT_INDEX for material ids list + Z_MIX_INDEX for mixed-material ids list + Z_MIX_VALUE for mixed-material values list + + (OUT) ids_list = If mat_type is Z_MAT_INDEX: + --------------------------- + 1D material id list + (Int array will have been allocated + the appropriate size, as returned in + USERD_size_matf_data for mat_type Z_MAT_INDEX) + + If mat_type is Z_MIX_INDEX: + --------------------------- + 1D mixed-material id list + (Int array will have been allocated + the appropriate size, as returned in + USERD_size_matf_data for mat_type Z_MIX_INDEX) + + (OUT) val_list = 1D mixed-materials values list + (only used if mat_type is Z_MIX_VALUE) + + (Float array will have been allocated + the appropriate size, as returned in + USERD_size_matf_data for mat_type Z_MIX_VALUE) + + Notes: + ----- + * See USERD_get_number_of_material_sets header for explanatory example + * Will not be called if Num_material_sets is zero, + or Num_materials[set_index] is zero, + or the appropriate size from USERD_size_matf_data is zero + + + +-------------------------------------------------------------------- +USERD_set_filenames + + Description: + ----------- + Receives the geometry and result filenames entered in the data + dialog. The user written code will have to store and use these + as needed. The user written code must manage its own files!! + + Specification: + ------------- + int USERD_set_filenames(char filename_1[], + char filename_2[], + char the_path[], + int swapbytes) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) filename_1 = the filename entered into the geometry + field of the data dialog. + + (IN) param_2 = The usage of this string depends on + 'two_fields' in USERD_get_name_of_reader. + + If two_fields is FALSE then it's empty. + + If two_fields is TRUE, this is the + manditory results file entered + into the result field of the data dialog. + + If two_fields is -1, then this contains + optional text (filenames, modifiers, etc.) + that can be parsed and used to modify + reader + + (IN) the_path = the path info from the data dialog. + Note: filename_1 and filename_2 have already + had the path prepended to them. This + is provided in case it is needed for + filenames contained in one of the files + + (IN) swapbytes = TRUE if should swap bytes when reading data. + = FALSE normally. + + Notes: + ----- + * Since you must manage everything from the input that is entered in + these data dialog fields, this is an important routine! + + * It may be that you will need to have an executive type file that contains + info and other filenames within it, like EnSight6's case file. + + +-------------------------------------------------------------------- +USERD_set_server_number + + Description: + ----------- + Receives the server number of how many total servers. + + Specification: + ------------- + int USERD_set_server_number(int cur_serv, + int tot_servs) + + Returns: + ------- + nothing + + Arguments: + --------- + (IN) cur_serv = the current server. + + (IN) tot_servs = the total number of servers. + + Notes: + ----- + * Only useful if your user defined reader is being used with EnSight's + Server-of-Server capability. And even then, it may or may not be + something that you can take advantage of. If your data is already + partitioned in some manner, such that you can access the proper + portions using this information. + + For all non-SOS uses, this will simply be 1 of 1 + + + +-------------------------------------------------------------------- +USERD_set_time_set_and_step + + Description: + ----------- + Set the current time step in the desired timeset. All functions that + need time, and that do not explicitly pass it in, will use the timeset + and step set by this routine, if needed. + + Specification: + ------------- + void USERD_set_time_set_and_step(int timeset_number, + int time_step) + + Returns: + ------- + nothing + + Arguments: + --------- + (IN) timeset_number = the timeset number (1 based). + + For example: If USERD_get_number_of_timesets + returns 2, the valid timeset_number's + would be 1 and 2. + + (IN) time_step = The current time step to set + + Notes: + ----- + * Current_time_step and Current_timeset would be set here + + +-------------------------------------------------------------------- +USERD_size_matf_data + + Description: + ----------- + Get the length of the material id list, mixed-material id list, or + mixed-material values list for the given material set and part (and + element type if material id list) + + Specification: + ------------- + int USERD_size_matf_data( int set_index, + int part_id, + int wtyp, + int mat_type, + int *matf_size) + + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) set_index = the material set index (zero based) + + (IN) part_id = the part number desired + + (IN) wtyp = the element type (used for Z_MAT_INDEX only) + + Z_POINT node point element + Z_BAR02 2 node bar + Z_BAR03 3 node bar + Z_TRI03 3 node triangle + Z_TRI06 6 node triangle + Z_QUA04 4 node quad + Z_QUA08 8 node quad + Z_TET04 4 node tetrahedron + Z_TET10 10 node tetrahedron + Z_PYR05 5 node pyramid + Z_PYR13 13 node pyramid + Z_PEN06 6 node pentahedron + Z_PEN15 15 node pentahedron + Z_HEX08 8 node hexahedron + Z_HEX20 20 node hexahedron + Z_NSIDED nsided polygon + Z_NFACED nfaced polyhedron + + Z_G_POINT ghost node point element + Z_G_BAR02 2 node ghost bar + Z_G_BAR03 3 node ghost bar + Z_G_TRI03 3 node ghost triangle + Z_G_TRI06 6 node ghost triangle + Z_G_QUA04 4 node ghost quad + Z_G_QUA08 8 node ghost quad + Z_G_TET04 4 node ghost tetrahedron + Z_G_TET10 10 node ghost tetrahedron + Z_G_PYR05 5 node ghost pyramid + Z_G_PYR13 13 node ghost pyramid + Z_G_PEN06 6 node ghost pentahedron + Z_G_PEN15 15 node ghost pentahedron + Z_G_HEX08 8 node ghost hexahedron + Z_G_HEX20 20 node ghost hexahedron + Z_G_NSIDED ghost nsided polygon + Z_G_NFACED ghost nfaced polyhedron + + (IN) mat_type = Z_MAT_INDEX for material ids list + Z_MIX_INDEX for mixed-material ids list + Z_MIX_VALUE for mixed-material values list + + (OUT) matf_size = the length of the material id list, or + mixed-material id list, or + mixed-material values list + for the given material set and part number + (and element type if Z_MAT_INDEX) + + Notes: + ----- + * See USERD_get_number_of_material_sets header for explanatory example + * Will not be called if Num_material_sets is zero, or + Num_materials[set_index] is zero + + + + +-------------------------------------------------------------------- +USERD_stop_part_building + + Description: + ----------- + This routine called when the part building dialog is closed. It is + provided in case you desire to release memory, etc. that was only needed + during the part building process. + + Specification: + ------------- + void USERD_stop_part_building( void ) + + Returns: + ------- + nothing + + Arguments: + --------- + none + + Notes: + ----- + +-------------------------------------------------------------------- +USERD_rigidbody_existence + + Description: + ----------- + Gets the existence of rigid body values or not in the model + + Specification: + ------------- + int USERD_rigidbody_existence( void ) + + Returns: + ------- + Z_OK if rigid body values exist for the model + Z_UNDEF if no rigid body values exist + Z_ERR if an error + + Arguments: + --------- + none + + Notes: + ----- + * This will be based on Current_time_step + + +-------------------------------------------------------------------- +USERD_rigidbody_values + + Description: + ----------- + Gets the rigid body values for each part + + Specification: + ------------- + int USERD_rigidbody_values(int part_number, + float values[7]) + + Returns: + ------- + Z_OK if rigid body values exist for the model + Z_UNDEF if no rigid body values exist + Z_ERR if an error + + Arguments: + --------- + (IN) part_number = The part number + + (1-based index of part table, namely: + + 1 ... Numparts_available. + + It is NOT the part_id that + is loaded in USERD_get_gold_part_build_info) + + (OUT) values values[0] = IX (x location) + values[1] = IY (y location) + values[2] = IZ (z location) + values[3] = E0 (e0 euler value) + values[4] = E1 (e1 euler value) + values[5] = E2 (e2 euler value) + values[6] = E3 (e3 euler value) + + + Notes: + ----- + * This will be based on Current_time_step + * It will not be called unless USERD_rigidbody_existence indicates + that there are some values in the model by returning Z_OK. + + +-------------------------------------------------------------------- +USERD_set_right_side + + Description: + ----------- + Informs the reader that the time currently set is the right side of a time + span used for variable interpolation between time steps + + Specification: + ------------- + void USERD_set_right_side( void ) + + Returns: + ------- + + Arguments: + --------- + none + + Notes: + ----- + * Applies to Current_time_step + + + + + +------------------------------------------------------------------ + ENHANCED GUI ROUTINES + +-------------------------------------------------------------------- +USERD_get_extra_gui_numbers + + Description: + ----------- + The Enhanced GUI routines are added to allow + the user to customize a portion of the Data + Reader dialog to pass in options to their + user defined reader. + + Specification: + ------------- + void USERD__get_extra_gui_numbers(int *num_Toggles, + int *num_pulldowns, + int *num_fields) + + Returns: + ------- + + Arguments: + --------- + (OUT) num_Toggles = number of toggles that will be provided + + num_pulldowns = number of pulldowns that will be provided + + num_fields = number of fields that will be provided + + Notes: + ----- + There are three routines that work together: + USERD_get_extra_gui_numbers + USERD_get_extra_gui_defaults + USERD_set_extra_gui_data + + The existence of these routine indicates that + you wish to add customize entries to the + Data Reader dialog. + + If you don't want the extra GUI features, + simply delete these routines, or change their + names to something such as + USERD_DISABLED_get_extra_gui_defaults + + The presence of these routines + will ensure that EnSight will call them and + use their data to modify the extraction parameters set + with some or all of the following: + toggles, pulldown menu and fields. + + The user can then interact with the enhanced + GUI and then send their choices to + USERD_set_extra_gui_data + + Therefore if USERD_get_extra_gui_numbers + exists then the other two must exist. + + If none exist, then the GUI will be unchanged. + + Toggle data will return an integer + TRUE if checked + FALSE if unchecked + + Pulldown menu will return an integer representing + the menu item selected + + Field will return a string Z_LEN_GUI_FIELD_STR long. + + If all the enhanced GUI features are enabled it + might look something like this + + =================================================== + [] Title 1 [X] Title 3 + [X]Title 2 [X] Title 4 + + Pulldown Menu -> + Menu Choice 1 + Menu Choice 2 + Menu Choice 3 + + Data Field Title 1 ____________________________ + + Data Field Title 2 ____________________________ + ===================================================== + + This routine defines the numbers of toggles, pulldowns & fields + + The following are defined in the global_extern.h + Z_MAX_NUM_GUI_PULL_ITEMS max num GUI pulldowns + Z_LEN_GUI_PULL_STR max length of GUI pulldown string + Z_LEN_GUI_FIELD_STR max length of field string + Z_LEN_GUI_TITLE_STR max length of title string + + The library is loaded, this routine is + called, then the library is unloaded. + + Do not define globals in this routine + as when the library is unloaded, you'll + lose them. + + +-------------------------------------------------------------------- +USERD_get_extra_gui_defaults + + Description: + ----------- + This routine defines the Titles, status, + List choices, strings, etc that are fed + up to the GUI. + + Specification: + ------------- + int USERD_get_extra_gui_defaults(char **toggle_Title, + int *toggle_default_status, + char **pulldown_Title, + int *pulldown_number_in_list, + int *pulldown_default_selection, + char ***pulldown_item_strings, + char **field_Title, + char **field_user_string) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (OUT) toggle_Title = title for each toggle + array dimension is [num_toggles] by + [Z_LEN_GUI_TITLE_STR] long + + toggle_default_status = Setting for each toggle (TRUE or FALSE) + array dimension is [num_toggles] long + + pulldown_Title = title for each pulldown + array dimension is [num_pulldowns] by + [Z_LEN_GUI_TITLE_STR] long + + pulldown_number_in_list = number of items in each pulldown + array dimension is [num_pulldowns] long + + pulldown_default_selection = pulldown item selection for each pulldown + array dimension is [num_pulldowns] long + + pulldown_item_strings = pulldown item strings + array is [num_pulldowns] by + [Z_MAX_NUM_GUI_PULL_ITEMS] by + [Z_LEN_GUI_PULL_STR] long + + field_Title = title for each field + array dimension is [num_fields] by + [Z_LEN_GUI_TITLE_STR] long + + field_user_string = content of the field + array dimension is [num_fields] by + [Z_LEN_GUI_TITLE_STR] long + + + + Notes: + ----- + * The library is loaded, this routine is called, then the library is unloaded. + + * Do not define globals in this routine as when the library is unloaded, you'll + lose them. + + + +-------------------------------------------------------------------- +USERD_set_extra_gui_data + + Description: + ----------- + This routine sets the new values for the toggles, pulldowns, and fields. + + Specification: + ------------- + void USERD_set_extra_gui_data( + int *toggle, /* [num_toggle] */ + int *pulldown, /* [num_pulldown] */ + char **field_text /* [num_fields][Z_LEN_GUI_FIELD_STR]*/) + + Returns: + ------- + + Arguments: + --------- + (IN) toggle = setting for each toggle. TRUE or FALSE + array dimension is [num_toggles] long + + pulldown = item chosen in each pulldown. (0 based) + array dimension is [num_pulldowns] long + + field_text = content of the field + array dimension is [num_fields] by + [Z_LEN_GUI_TITLE_STR] long + + + Notes: + ----- + * This routine is called when the library is permanently + loaded to the EnSight session, so define your globals + in this and later routines. + + * It's up to you to change your reader behavior according to + user entries! + + + +-------------------------------------------------------------------- +USERD_get_var_extract_gui_numbers + + Description: + ----------- + The Var_Extract_GUI routines are added to allow + the user to customize a extraction parameters + for variables "after" the file has been read. + These things can be modified and the variables will + be update/refreshed according to the new parameters set + + Specification: + ------------- + void USERD_get_var_extract_gui_numbers(int *num_Toggles, + int *num_pulldowns, + int *num_fields) + + + Returns: + ------- + + Arguments: + --------- + (OUT) num_Toggles = number of toggles that will be provided + + num_pulldowns = number of pulldowns that will be provided + + num_fields = number of fields that will be provided + + Notes: + ----- + There are three routines that work together: + USERD_get_var_extract_gui_numbers + USERD_get_var_extract_gui_defaults (this one) + USERD_set_var_extract_gui_data + + The existence of these routine indicates that + you wish to have the Var Extract Parameters dialog. + + If you don't want the extra GUI features, + simply delete these routines, or change their + names to something such as + USERD_DISABLED_get_var_extract_gui_defaults + + The presence of these routines + will ensure that EnSight will call them and + use their data to modify the extraction parameters set + with some or all of the following: + toggles, pulldown menu and fields. + + The user can then interact with the enhanced + GUI and then send their choices to + USERD_set_extra_gui_data + + Therefore if USERD_get_var_extract_gui_numbers + exists then the other two must exist. + + If none exist, then the GUI will be unchanged. + + Toggle data will return an integer + TRUE if checked + FALSE if unchecked + + Pulldown menu will return an integer representing + the menu item selected + + Field will return a string Z_LEN_GUI_FIELD_STR long. + + If all the enhanced GUI features are enabled it + might look something like this + + =================================================== + [] Title 1 [X] Title 3 + [X]Title 2 [X] Title 4 + + Pulldown Menu -> + Menu Choice 1 + Menu Choice 2 + Menu Choice 3 + + Data Field Title 1 ____________________________ + + Data Field Title 2 ____________________________ + ===================================================== + + This routine defines the numbers of toggles, pulldowns & fields + + The following are defined in the global_extern.h + Z_MAX_NUM_GUI_PULL_ITEMS max num GUI pulldowns + Z_LEN_GUI_PULL_STR max length of GUI pulldown string + Z_LEN_GUI_FIELD_STR max length of field string + Z_LEN_GUI_TITLE_STR max length of title string + + The library is loaded, this routine is + called, then the library is unloaded. + + Do not define globals in this routine + as when the library is unloaded, you'll + lose them. + + +-------------------------------------------------------------------- +USERD_get_var_extract_gui_defaults + + Description: + ----------- + This routine defines the Titles, status, + List choices, strings, etc that are fed + up to the GUI. + + Specification: + ------------- + int USERD_get_var_extract_gui_defaults(char **toggle_Title, + int *toggle_default_status, + char **pulldown_Title, + int *pulldown_number_in_list, + int *pulldown_default_selection, + char ***pulldown_item_strings, + char **field_Title, + char **field_user_string) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (OUT) toggle_Title = title for each toggle + array dimension is [num_toggles] by + [Z_LEN_GUI_TITLE_STR] long + + toggle_default_status = Setting for each toggle (TRUE or FALSE) + array dimension is [num_toggles] long + + pulldown_Title = title for each pulldown + array dimension is [num_pulldowns] by + [Z_LEN_GUI_TITLE_STR] long + + pulldown_number_in_list = number of items in each pulldown + array dimension is [num_pulldowns] long + + pulldown_default_selection = pulldown item selection for each pulldown + array dimension is [num_pulldowns] long + + pulldown_item_strings = pulldown item strings + array is [num_pulldowns] by + [Z_MAX_NUM_GUI_PULL_ITEMS] by + [Z_LEN_GUI_PULL_STR] long + + field_Title = title for each field + array dimension is [num_fields] by + [Z_LEN_GUI_TITLE_STR] long + + field_user_string = content of the field + array dimension is [num_fields] by + [Z_LEN_GUI_TITLE_STR] long + + + + Notes: + ----- + * The library is loaded, this routine is called, then the library is unloaded. + + * Do not define globals in this routine as when the library is unloaded, you'll + lose them. + + + +-------------------------------------------------------------------- +USERD_set_var_extract_gui_data + + Description: + ----------- + This routine sets the new values for the toggles, pulldowns, and fields. + + Specification: + ------------- + void USERD_set_var_extract_gui_data( + int *toggle, /* [num_toggle] */ + int *pulldown, /* [num_pulldown] */ + char **field_text /* [num_fields][Z_LEN_GUI_FIELD_STR]*/) + + Returns: + ------- + + Arguments: + --------- + (IN) toggle = setting for each toggle. TRUE or FALSE + array dimension is [num_toggles] long + + pulldown = item chosen in each pulldown. (0 based) + array dimension is [num_pulldowns] long + + field_text = content of the field + array dimension is [num_fields] by + [Z_LEN_GUI_TITLE_STR] long + + + Notes: + ----- + * This routine is called when the library is permanently + loaded to the EnSight session, so define your globals + in this and later routines. + + * It's up to you to change your reader behavior according to + user entries! + + + + + +----------------------------------------------------------------------------------- +/* ---------------------------------------------------------- + * New in EnSight 8 is the capability to remove (fail) elements + * based on variable threshold values. Basically the variable + * name, a couple of thresholds, a couple of values and a logic + * criteria are read in from this routine. Every element that + * satisfies the failure criteria is removed and not used in + * EnSight calculations. + * + * Example Failure criteria + * Let fail_var_name = "fail_flag" + * threshold_val1 = 0 + * threshold_operator1 = Z_EQUAL_TO + * logic_criteria2 not used + * threshold_val2 not used + * threshold_operator2 not used + * For each value of "fail_flag" at each element, + * if fail flag == threshold_val1 (0.0) then element fails + * Return (Z_ERR) if this is not used. + * Return (Z_OK) if failed element feature should be used + * + * threshold_operator1 & 2 can be one of the following + * Z_ELE_FAILED_NONE, - disables checking + * Z_ELE_FAILED_GREATER, - greater than + * Z_ELE_FAILED_LESS, - less than + * Z_ELE_FAILED_EQUAL, - equal + * Z_ELE_FAILED_NOT_EQUAL, - not equal + * Z_ELE_FAILED_MANY - not used + * + * logic_criteria2 + * Z_ELE_FAILED_LOGIC_NONE, + * Z_ELE_FAILED_LOGIC_AND, + * Z_ELE_FAILED_LOGIC_OR, + * Z_ELE_FAILED_LOGIC_MANY + * + * ---------------------------------------------------------- */ +int USERD_get_uns_failed_params( + char *fail_var_name, /* variable name to be used in failure + must be scalar, per elem */ + float *threshold_val1, /* number to compare for failure */ + float *threshold_val2, /* number to compare for failure */ + int *threshold_operator1, /* Z_GREATER_THAN, Z_LESS_THAN, + Z_EQUAL_TO */ + int *threshold_operator2, /* Z_GREATER_THAN, Z_LESS_THAN, + Z_EQUAL_TO */ + int *logic_criteria2 + + +/*-------------------------------------------------------------------- + * USERD_get_structured_reader_cinching - + *-------------------------------------------------------------------- + * + * Gets whether this reader will do structured cinching for block data + * This means that it will handle the min, max, and step values for a + * given block and return the coordinate components or variable components + * in their "cinched" state when partial extraction or striding is used. + * This is as opposed to returning the entire component (ignoring min, max + * and stride) and letting Ensight pick out the values actually used. + * + * returns: Z_OK if the reader will handle the + * min, max, and stride and return + * the cinched values only. + * + * Z_UNDEF or Z_ERR if will return entire component + * and rely on EnSight to cinch. + * + * Notes: + * Unless you can actually pull out the desired min, max, and stride + * without using a full component of memory, don't enable this feature. + *--------------------------------------------------------------------*/ +int +USERD_get_structured_reader_cinching( void ) + + + +/*-------------------------------------------------------------------- + * USERD_set_block_range_and_stride - + *-------------------------------------------------------------------- + * + * Sets the min, max, and step values in each of the i, j, and k, directions + * for the given part. + * + * (IN) part_number = The part number + * + * (1-based index of part table, namely: + * + * 1 ... Numparts_available. + * + * It is NOT the part_id that + * is loaded in + * USERD_get_gold_part_build_info) + * + * (IN) mini = min i plane desired (zero based) + * maxi = max i plane desired (zero based) + * stepi = i stride + * minj = min j plane desired (zero based) + * maxj = max j plane desired (zero based) + * stepj = j stride + * mink = min k plane desired (zero based) + * maxk = max k plane desired (zero based) + * stepk = k stride + * + * + * returns: Z_OK if no problems + * Z_ERR if an error + * + * Notes: + * * It will not be called unless USERD_get_structured_reader_cinching + * indicates that this reader does structured cinching by returning + * a Z_OK. + * + * * It will actually be called before each geom component and before + * each part variable - so if you are storing things locally, you should + * make this routine be able to quickly check whether anything needs + * updated or not. + * + * * If the stride (step) does not hit right on the max, the last element + * in each direction will be shortened appropriately. + * For example, if a block had 0 to 12 in the i direction, + * and the user specified min = 1 + * max = 8 + * step = 3 + * + * 0 1 2 3 4 5 6 7 8 9 10 11 12 + * | | | | | | | | | | | | | + * + * | | | | + * + * Namely, the coarser cell boundaries in this direction would be at 1, 4, +7, and 8 + * + *--------------------------------------------------------------------*/ +int +USERD_set_block_range_and_stride(int part_number, + int mini, int maxi, int stepi, + int minj, int maxj, int stepj, + int mink, int maxk, int stepk) + + + +---- end of document ---- diff --git a/applications/utilities/postProcessing/graphics/ensightFoamReader/README_USERD_2.08 b/applications/utilities/postProcessing/graphics/ensightFoamReader/README_USERD_2.08 new file mode 100644 index 0000000000..29e185d4d0 --- /dev/null +++ b/applications/utilities/postProcessing/graphics/ensightFoamReader/README_USERD_2.08 @@ -0,0 +1,4653 @@ +README_USERD_2.08 +================= +-------------------------------------- +EnSight User Defined Reader Capability ===> (API 2.08) +-------------------------------------- +A user defined reader capability is included in EnSight which can allow +otherwise unsupported structured or unstructured data to be read. The user +defined reader capability utilizes dynamic shared libraries composed of +routines defined in this document but produced by you, the user, (or some +third party). This capability is currently available for dec, ibm, hp, sgi, +sun, linux, alpha linux, and NT servers. + +You should refer to beginning of README_USERD_2.0 and/or README_1.0_to_2.0 +for a discussion of the differences between API 1.0 and API 2.*. + +***>> API 2.08 invloves a slight change to API 2.05 and later: +Namely, rotational (yaw,pitch,roll) values were added to the values +argument of USERD_rigidbody_values routine. + +***>> API 2.07 additional capabilities (beyond API 2.06): +Optional routine to allow userd defined readers to indicate their auto +distribute preference when used with SOS. This is used to set the auto +distribute flag default in the client. If the function does not exist, +then it defaults to 'use auto distribute'. If the function does exist and +indicates 'no auto distribute', then it's up to the UDR to decompose a +distributed data set. + USERD_prefer_auto_distribute +Optional routine to allow userd defined readers to indicate their +preference for the 'Set file...' button labels in the client's File->Open +dialog. If the function does not exist or it returns a null string for +an argument, then the default values are used. + USERD_set_filename_button_labels + +***>> API 2.06 additional capabilities (beyond API 2.05): +Routines to allow userd defined readers for structured data +to deal with min, max, and stride within the reader itself +instead of within EnSight. + USERD_get_structured_reader_cinching + USERD_set_block_range_and_stride + + +***>> API 2.05 additional capabilities (beyond API 2.04): +Routines to handle material species. + USERD_get_number_of_species + USERD_get_matsp_info + +Routines to handle variable extraction parameters after a read, and then +update the variables accordingly. Similar to the extra GUI capabilities +(which are processed before a read). (Can actually be added to pre-2.05 readers) + USERD_get_var_extract_gui_numbers + USERD_get_var_extract_gui_defaults + USERD_set_var_extract_gui_data + +Routines to obtain rigid body values from a reader. +(Routines were added - EnSight is now using for Nastran and STL readers + with Dynasty rigid body motion data file) + USERD_rigidbody_existence + USERD_rigidbody_values + +Routine that lets reader know when EnSight is getting the right side of a time +interval for variable interpolation between steps. Not generally needed for +most readers - however, may be needed for those that implement rigid body, and +wish to cache left and right timespan information for interpolation within the +reader itself. (Can actually be added to pre-2.05 readers) + USERD_set_right_side + + +***>> API 2.04 additional capabilities (beyond API 2.03): +Routines to handle failed elements. Basically +a.One routine to return a flag indicating the existence of + failed elements in at least one part in at least one + timestep in the model. +b.A second routine to return a matrix of flags indexed by part and + element type indicating which parts and element types have failed + elements at the current time step. +c.Finally a third routine to return an array of flags for a given + part and element type that is number of elements of that type long + indicating which elements have failed, and which have not failed. + + +***>> API 2.03 additional capabilities (beyond API 2.01): +1. Routines to handle materials +2. Routines to handle nsided and nfaced elements +3. Modified routine to handle structured ranges + + +**************************************************************************** +Note: Only the the Ensight Gold example reader, has been moved to + this 2.06 API level. And it is purely for an example - it does not + actually provide a benefit. +**************************************************************************** + + +The process for producing a user defined reader is: +--------------------------------------------------- +1. Write code for all pertinent routines in the library (Unless someone else + has done this for you). + + This is of course where the work is done by the user. The word + "pertinent" is used because depending on the nature of the data, some + of the routines in the library may be dummy routines. + + The source code for a dummy_gold library and for various other + working or sample libraries is copied from the installation CD during + installation. These will be located in directories under: + + $CEI_HOME/ensight76/user_defined_src/readers + + examples: + -------- + Basic dummy_gold routines provide skeleton for a new reader + $CEI_HOME/ensight76/user_defined_src/readers/dummy_gold + + Sample library which reads unstructured binary EnSight Gold data + $CEI_HOME/ensight76/user_defined_src/readers/ensight_gold + + You may find it useful to place your library source in this area as + well, but are not limited to this location. + + * ===> The descriptions of each library routine and the order that the + routines are called, which is provided in this file, along with + the example libraries, should make it possible for you to produce + code for your own data reader. + + +2. Produce the dynamic shared library. + + This is a compiling and loading process which varies according to + the type of machine you are on. In the user-defined-reader source + tree we have tried to isolate the machine dependent parts of the + build process using a set of files in the 'config' directory. In this + directory there is a configuration file for each platform on which + EnSight is supported. Before you can compile the installed readers + you should run the script called 'init' in the config directory. + + i.e. (for UNIX) + cd config + ./init sgi_6.5_n64 + cd .. + make + + If you are compiling for Windows NT, there are two options. If you + have the Cygwin GNU utilities installed, you can use GNU make as for + Unix. Otherwise, there is a script called makeall.cmd which will + build all of the readers using nmake. The Makefiles in each reader + directory will work using either make or nmake. + + i.e. (WIN32 Cygwin) (using nmake) + cd config cd config + sh init win32 cp win32 config + cd .. cd .. + mkdir lib + make makeall.cmd + + If you have platform-specific portions of code in your reader, the + build system defines a set of flags which can be used within + #ifdef ... #endif regions in your source, as shown in the table + below. + + Because the readers are now dynamically opened by EnSight, you may + have to include dependent libraries on your link-line to avoid having + unresolved symbols. If you are having problems with a reader, start + ensight as "ensight7 -readerdbg" and you will get feedback on any + problems encountered in loading a reader. If there are unresolved + symbols, you need to find the library which contains the missing + symbols and link it into your reader by adding it to the example + link commands below. + + If you choose to use a different build environment for your reader, + you should take care to use compatible compilation flags to ensure + compatibilty with the EnSight executables, most notably on the SGI + and HP-UX 11.0 platforms, which should use the following flags: + + sgi_6.2_o32: -mips2 + sgi_6.2_n64: -mips4 -64 + sgi_6.5_n32: -mips3 + sgi_6.5_n64: -mips4 -64 + hp_11.0_32: +DA2.0 + hp_11.0_64: +DA2.0W + + ______________________________________________________________________ + | MACHINE | OS flag | SHARED LIBRARY NAME PRODUCED | + | TYPE |------------------------------------------------------------| + | | LD COMMAND USED IN MAKEFILE | + ====================================================================== + ______________________________________________________________________ + | sgi | -DSGI | libuserd-X.so | + | |------------------------------------------------------------| + | | ld -shared -all -o libuserd-X.so libuserd-X.o | + ---------------------------------------------------------------------- + ______________________________________________________________________ + | hp | -DHP | libuserd-X.sl | + | |------------------------------------------------------------| + | | ld -b -o libuserd-X.sl libuserd-X.o | + ---------------------------------------------------------------------- + ______________________________________________________________________ + | sun | -DSUN | libuserd-X.so | + | |------------------------------------------------------------| + | | ld -G -o libuserd-X.so libuserd-X.o | + ---------------------------------------------------------------------- + ______________________________________________________________________ + | dec | -DDEC | libuserd-X.so | + | |------------------------------------------------------------| + | | ld -shared -all -o libuserd-X.so libuserd-X.o -lc | + ---------------------------------------------------------------------- + ______________________________________________________________________ + | linux | -DLINUX | libuserd-X.so | + | |------------------------------------------------------------| + | | ld -shared -o libuserd-X.so libuserd-X.o -lc | + ---------------------------------------------------------------------- + ______________________________________________________________________ + | alpha | -DALINUX | libuserd-X.so | + | linux |------------------------------------------------------------| + | | ld -shared -o libuserd-X.so libuserd-X.o -lc | + ---------------------------------------------------------------------- + ______________________________________________________________________ + | ibm | -DIBM | libuserd-X.so | + | |------------------------------------------------------------| + | | ld -G -o libuserd-X.so libuserd-X.o -bnoentry -bexpall -lc | + ---------------------------------------------------------------------- + + Once you have created your library, you should place it in a directory + of your choice or in the standard reader location: + + $CEI_HOME/ensight76/machines/$CEI_ARCH/lib_readers + + For example, if you created a reader for "mydata", you should create + the reader libuserd-mydata.so and place the file in your own reader + directory (see section 3 below) or in the standard location: + + $CEI_HOME/ensight76/machines/$CEI_ARCH/lib_readers/libuserd-mydata.so + + +3. By default EnSight will load all readers found in the directory: + + $CEI_HOME/ensight76/machines/$CEI_ARCH/lib_readers + + Files with names "libuserd-X.so" (where X is a name unique to the reader) + are assumed to be user-defined readers. + + There are two methods which can be used to supplement the default + behavior. + + (1) A feature which is useful for site-level or user-level configuration + is the optional environment variable $ENSIGHT7_READER. This + variable directs EnSight to load all readers in the specified reader + directory (you should probably specify a full path) before loading + the built-in readers. If the same reader exists in both directories + (as determined by the name returned by USERD_get_name_of_reader(), + NOT by the filename), the locally configured reader will take + precedence. + + (2) A useful feature for end-users is the use of the libuserd-devel + reader. EnSight will search for a reader named libuserd-devel.so + (.sl for HP or .dll for NT). This reader can exist anywhere in the + library path (see below) of the user. This is useful for an + individual actively developing a reader because the existence of a + libuserd-devel library will take precedence over any other library + which returns the same name from USERD_get_name_of_reader(). + + As an example, a site may install commonly used readers in a common + location, and users can set the ENSIGHT7_READER variable to access them: + + setenv ENSIGHT7_READER /usr/local/lib/e7readers + + A user working on a new reader may compile the reader and place it in + a directory specified by the library path: + + cp libuserd-myreader.so ~/lib/libuserd-devel.so + setenv ~/lib:$ + + The user is responsible for correctly configuring the library path + variable in order to make use of the libuserd-devel feature. The + library environment variables used are: + + Machine type Environment variable to set + ------------ --------------------------- + sgi LD_LIBRARY_PATH + dec LD_LIBRARY_PATH + sun LD_LIBRARY_PATH + linux LD_LIBRARY_PATH + alpha linux LD_LIBRARY_PATH + hp SHLIB_PATH + ibm LIBPATH + +As always, EnSight support is available if you need it. + +------------------------------- +Quick Index of Library Routines +------------------------------- + +Generally Needed for UNSTRUCTURED data +-------------------------------------- +USERD_get_part_coords part's node coordinates +USERD_get_part_node_ids part's node ids +USERD_get_part_elements_by_type part's element connectivites +USERD_get_part_element_ids_by_type part's element ids + + +Generally Needed for BLOCK data +-------------------------------------- +USERD_get_block_coords_by_component block coordinates +USERD_get_block_iblanking block iblanking values +USERD_get_ghosts_in_block_flag block ghost cell existence? +USERD_get_block_ghost_flags block ghost cell flags + + These routines, which formerly were only for unstructured data, will now + also be called for structured data if you specify that ids will be given + in the USERD_get_node_label_status and USERD_get_element_label_status rotuines + ------------------------------------------------------------------------------ + USERD_get_part_node_ids part's node ids + USERD_get_part_element_ids_by_type part's element ids + + +Generally needed for either or both kinds of data +------------------------------------------------- +USERD_get_name_of_reader name of reader for GUI +USERD_get_reader_release release string of reader +USERD_get_reader_version provide reader version number +USERD_get_reader_descrip provide GUI more description (optional) + +USERD_get_extra_gui_numbers Gets the number of toggles, pulldowns and fields +USERD_get_extra_gui_defaults Gets the default values for the GUI members +USERD_set_extra_gui_data Returns the answers provided by the user + +USERD_set_filenames filenames entered in GUI +USERD_set_server_number server which of how many + +USERD_get_number_of_timesets number of timesets +USERD_get_timeset_description description of timeset +USERD_get_geom_timeset_number timeset # to use for geom + +USERD_get_num_of_time_steps number of time steps +USERD_get_sol_times solution time values +USERD_set_time_set_and_step current timeset and time step + +USERD_get_changing_geometry_status changing geometry? +USERD_get_node_label_status node labels? +USERD_get_element_label_status element labels? +USERD_get_model_extents provide model bounding extents +USERD_get_number_of_files_in_dataset number of files in model +USERD_get_dataset_query_file_info info about each model file +USERD_get_descrip_lines file associated description lines +USERD_get_number_of_model_parts number of model parts +USERD_get_gold_part_build_info Gets the info needed for part building process +USERD_get_part_build_info part/block type/descrip etc. +USERD_get_maxsize_info part/block allocation maximums +USERD_get_ghosts_in_model_flag model contains ghost cells? +USERD_get_nsided_conn Gets the element connectivities for nsided + elements. (utilizes the number of nodes + per element obtained in + USERD_get_part_elements_by_type) +USERD_get_nfaced_nodes_per_face Gets the number of nodes per face for nfaced + elements (utilizes the number of faces + per element obtained in + USERD_get_part_elements_by_type) +USERD_get_nfaced_conn Gets the element connectivities for nfaced + elements (utilizes the number of nodes + per face obtained in + USERD_get_nfaced_nodes_per_face) + + +USERD_get_border_availability part border provided? +USERD_get_border_elements_by_type part border conn and parent info + +USERD_get_number_of_variables number of variables +USERD_get_gold_variable_info variable type/descrip etc. +USERD_get_var_by_component part or block variable values +USERD_get_constant_val constant variable's value +USERD_get_var_value_at_specific node's or element's variable value over time +USERD_stop_part_building cleanup after part build routine + +USERD_get_number_of_material_sets Gets the number of material sets +USERD_get_matf_set_info Gets the material set indices and names +USERD_get_number_of_materials Gets the number of materials +USERD_get_matf_var_info Gets the material indices and descriptions +USERD_size_matf_data Gets the length of either the + material ids list, + mixed-material ids list, or + mixed-material values list +USERD_load_matf_data Gets the material ids list, + mixed-material ids list, or + mixed-material values list + +USERD_bkup archive routine + +USERD_exit_routine cleanup upon exit routine + +USERD_get_uns_failed_params Gets thresholds/criteria for failure + +USERD_rigidbody_existence Returns whether rigid body transformation + data exists for the model. +USERD_rigidbody_values Returns the euler and location values for a + given part + +USERD_set_right_side Simply informs the reader when the time set + is for the right side of a time span during + variable interpolation between time steps. + +USERD_get_structured_reader_cinching Tells if the reader will do structured + cinching +USERD_set_block_range_and_stride Sets the min, max, and stride of a block + if doing structured cinching + + +------------------------- +Order Routines are called +------------------------- + +The various main operations are given basically in the order they will +be performed. Within each operation, the order the routines will be +called is given. + +1. Setting name in the gui, and specifying one or two input fields + + USERD_get_name_of_reader + USERD_get_reader_descrip (optional) + USERD_get_extra_gui_numbers (optional) + USERD_get_extra_gui_defaults (optional) + +2. Getting the reader version (also distinguishes between API's) + + USERD_get_reader_version + +3. Setting filenames and getting timeset and time info + + (optional if reader has + USERD_get_extra_gui_defaults routine) + USERD_get_structured_reader_cinching + USERD_set_server_number + USERD_set_extra_gui_data (optional) + USERD_set_filenames + USERD_get_number_of_timesets + USERD_get_geom_timeset_number + + for each timeset: + USERD_get_timeset_description + USERD_get_num_of_time_steps + USERD_get_sol_times + + USERD_set_time_set_and_step + +4. Gathering info for part builder + + USERD_set_time_set_and_step + USERD_get_changing_geometry_status + USERD_get_node_label_status + USERD_get_element_label_status + USERD_get_number_of_files_in_dataset + USERD_get_dataset_query_file_info + USERD_get_descrip_lines (for geometry) + USERD_get_number_of_model_parts + USERD_get_gold_part_build_info + USERD_get_ghosts_in_model_flag + USERD_get_maxsize_info + USERD_get_get_ghosts_in_block_flag (if any ghost cells in model) + USERD_get_model_extents OR (for model extents) + USERD_get_part_coords AND/OR + (if doing structured reader cinching + USERD_get_block_coords_by_component + +5. Gathering Variable info + + USERD_get_number_of_variables + USERD_get_gold_variable_info + +6. Part building (per part created) + + both unstructured and structured: + -------------------------------- + USERD_set_time_set_and_step + + if unstructured part: + -------------------- + USERD_get_part_element_ids_by_type + USERD_get_part_elements_by_type + + If any nsided elements: + + USERD_get_nsided_conn + + If any nfaced elements: + + USERD_get_nfaced_nodes_per_face + USERD_get_nfaced_conn + + USERD_get_part_coords + USERD_get_part_node_ids + + else if structured part: + ----------------------- + USERD_get_block_iblanking + (if doing structured reader cinching + USERD_get_block_coords_by_component + USERD_get_block_ghost_flags (If ghost cells in part) + USERD_get_part_node_ids (If node ids given) + USERD_get_part_element_ids_by_type (If element ids given) + + both again: + ---------- + USERD_get_border_availability (If border representation + USERD_get_border_elements_by_type is selected) + + USERD_stop_part_building (only once when part builder + dialog is closed) + +7. Loading Variables + + constants: + --------- + USERD_set_time_set_and_step + USERD_get_constant_val + + scalars/vectors/tensors: + ------------------------ + USERD_get_descrip_lines + USERD_set_time_set_and_step + (if doing structured reader cinching + USERD_get_var_by_component + +8. Changing geometry + + changing coords only (per part): + -------------------- + USERD_set_time_set_and_step + USERD_get_descrip_lines + USERD_get_part_coords + (if doing structured reader cinching + USERD_get_block_coords_by_component + + changing connectivity (per part): + --------------------- + USERD_set_time_set_and_step + USERD_get_descrip_lines + USERD_get_number_of_model_parts + USERD_get_gold_part_build_info + USERD_get_ghosts_in_model_flag + USERD_get_get_ghosts_in_block_flag (if any ghost cells in model) + USERD_get_model_extents OR + USERD_get_part_coords AND/OR + (if doing structured reader cinching + USERD_get_block_coords_by_component + USERD_get_part_element_ids_by_type + USERD_get_part_elements_by_type + USERD_get_part_coords + USERD_get_part_node_ids + USERD_get_block_iblanking + (if doing structured reader cinching + USERD_get_block_coords_by_component + USERD_get_block_ghost_flags (If ghost cells in part) + USERD_get_part_node_ids (If node ids given) + USERD_get_part_element_ids_by_type (If element ids given) + + USERD_get_border_availability (If border representation + USERD_get_border_elements_by_type is selected) + + +9. Node or Element queries over time + + USERD_get_var_value_at_specific + +10. To see if materials in the model + + USERD_get_number_of_material_sets + USERD_get_matf_set_info + + If any material sets in the model (calls these once per material set): + USERD_get_number_of_materials + USERD_get_matf_var_info + + For each elment type of each part containing material ids, calls: + USERD_size_matf_data + USERD_load_matf_data + + If there are any elements with mixed materials, when a domain or + interface is created, calls these again per part: + + USERD_size_matf_data + USERD_load_matf_data + +11. To modify the variable extraction parameters and have the variables + update accordingly. + + USERD_get_var_extract_gui_numbers + USERD_get_var_extract_gui_defaults + USERD_set_var_extract_gui_data + + + +----------------------- +Detailed Specifications +----------------------- + +Include files: +-------------- +The following header file is required in any file containing these library +routines. + + #include "global_extern.h" + +And it references: + + #include "global_extern_proto.h" + + + +******************************************************************************* +****************************** Special Note *********************************** +******************************************************************************* + +Make sure you use the proper define in the global_extern.h header file, namely: +#define USERD_API_204 + +Also, Make sure the api version in the USERD_get_reader_version routine is set +to "2.04" or larger. + +Make sure your reader has access to the global_extern_proto.h This is a new +file which is accessed from the new global_extern.h + +******************************************************************************* +******************************************************************************* + + +Basis of arrays: +--------------- +Unless explicitly stated otherwise, all arrays are zero based - in true C +fashion. + + +Global variables: +---------------- +You will generally need to have a few global variables which are shared by +the various library routines. The detailed specifications below have assumed +the following are available. (Their names describe their purpose, and they +will be used in helping describe the details of the routines below). + +static int Numparts_available = 0; +static int Num_unstructured_parts = 0; +static int Num_structured_blocks = 0; + +/* Note: Numparts_available = Num_unstructured_parts + Num_structured_blocks */ + +static int Num_timesets = 1; +static int Current_timeset = 1; +static int Geom_timeset_number = 1; + +static int Num_time_steps[Z_MAXSETS] = 1; +static int Current_time_step = 0; +static int Num_variables = 0; +static int Num_dataset_files = 0; + +static int Server_Number = 1; Which server of +static int Tot_Servers = 1; the total number of servers + + + +_________________________________________ +----------------------------------------- +Library Routines (in alphabetical order): +_________________________________________ +----------------------------------------- + +-------------------------------------------------------------------- +USERD_bkup + + Description: + ----------- + This routine is called during the EnSight archive process. You can + use it to save or restore info relating to your user defined reader. + + Specification: + ------------- + int USERD_bkup(FILE *archive_file, + int backup_type) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) archive_file = The archive file pointer + + (IN) backup_type = Z_SAVE_ARCHIVE for saving archive + Z_REST_ARCHIVE for restoring archive + + Notes: + ----- + * Since EnSight's archive file is saved in binary form, you should + also do any writing to it or reading from it in binary. + + * You should archive any variables, which will be needed for + future operations, that will not be read or computed again + before they will be needed. These are typically global + variables. + + * Make sure that the number of bytes that you write on a save and + the number of bytes that you read on a restore are identical!! + + * If any of the variables you save are allocated arrays, you must + do the allocations before restoring into them. + +-------------------------------------------------------------------- +USERD_exit_routine + + Description: + ----------- + This routine is called as EnSight is exiting. It can be used to clean + up anything needed - such as removing temporary files, etc. - or can simply + be a dummy. + + Specification: + ------------- + void USERD_exit_routine( void ) + + Arguments: + --------- + none + +-------------------------------------------------------------------- +USERD_get_block_coords_by_component + + Description: + ----------- + Get the coordinates of a given structured block, a component at a time. + + Specification: + ------------- + int USERD_get_block_coords_by_component(int block_number, + int which_component, + float *coord_array) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) block_number = The block part number + (1-based index of part table, namely: + + 1 ... Numparts_available. + + It is NOT the part_id that + is loaded in USERD_get_gold_part_build_info) + + (IN) which_component = Z_COMPX if x component wanted + = Z_COMPY if y component wanted + = Z_COMPZ if z component wanted + + (OUT) coord_array = 1D array containing x,y, or z + coordinate component of each node + + (Array will have been allocated + i*j*k for the block long) + + Notes: + ----- + * Not called unless Num_structured_blocks is > 0 + + * Will be based on Current_time_step + + + +-------------------------------------------------------------------- +USERD_get_block_iblanking + + Description: + ----------- + Get the iblanking value at each node of a block (if the block is + iblanked). + + Specification: + ------------- + int USERD_get_block_iblanking(int block_number, + int *iblank_array) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) block_number = The block part number + (1-based index of part table, namely: + + 1 ... Numparts_available. + + It is NOT the part_id that + is loaded in USERD_get_gold_part_build_info) + + (OUT) iblank_array = 1D array containing iblank value + for each node. + + (Array will have been allocated + i*j*k for the block long) + + possible values are: Z_EXT = exterior + Z_INT = interior + Z_BND = boundary + Z_INTBND = internal boundary + Z_SYM = symmetry plane + + Notes: + ----- + * Not called unless Num_structured_blocks is > 0 and you have + some iblanked blocks + + * Will be based on Current_time_step + + + +---------------------------------------------------------------------- +USERD_get_block_ghost_flags + + Description: + ----------- + Get the ghost_flags value at each element of a block containing ghost cells. + + Specification: + ------------- + int USERD_get_block_ghost_flags(int block_number, + int *ghost_flags) + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) block_number = The block number + (1-based index of part table, namely: + + 1 ... Numparts_available. + + It is NOT the part_id that + is loaded in USERD_get_gold_part_build_info) + + (OUT) ghost_flags = 1D array containing ghost flag value + for each block cell. + + (Array will have been allocated + (i-1)*(j-1)*(k-1) for the block long) + + possible values are: 0 = non-ghost cell (normal cell) + >0 = ghost cell + + Notes: + ----- + * This routine is new in the 2.01 API + + * This will be based on Current_time_step + + * Only called for structured "block" parts that have some ghost cells + as indicated by the USERD_get_ghost_in_block_flag. The model must + of course also have been indicated to have some ghost cells in the + USERD_get_ghost_in_model_flag routine. + + * It is sufficient to set the value to be 1 to flag as a ghost cell, + but the value can be any non-zero value, so you could use it to + indicate which block or which server (for Server-of-server use) the + cell is actually in. + + + +-------------------------------------------------------------------- +USERD_get_border_availability + + Description: + ----------- + Finds out if border elements are provided by the reader for the + desired part, or will need to be computed internally by EnSight. + + Specification: + ------------- + int USERD_get_border_availability(int part_number, + int number_of_elements[Z_MAXTYPE]) + + Returns: + ------- + Z_OK if border elements will be provided by the reader. + (number_of_elements array will be loaded and + USERD_get_border_elements_by_type will be called) + + Z_ERR if border elements are not available - thus EnSight must compute. + (USERD_get_border_elements_by_type will not be called) + + + Arguments: + --------- + (IN) part_number = The part number + (1-based index of part table, namely: + + 1 ... Numparts_available. + + It is NOT the part_id that + is loaded in USERD_get_gold_part_build_info) + + (OUT) number_of_elements = 2D array containing number of + each type of border element in + the part. + ------------ + Possible types are: + + Z_POINT = point + Z_BAR02 = 2-noded bar + Z_BAR03 = 3-noded bar + Z_TRI03 = 3-noded triangle + Z_TRI06 = 6-noded triangle + Z_QUA04 = 4-noded quadrilateral + Z_QUA08 = 8-noded quadrilateral + + Notes: + ----- + * Only called if border representation is used. + + * Will be based on Current_time_step + + + +-------------------------------------------------------------------- +USERD_get_border_elements_by_type + + Description: + ----------- + Provides border element connectivity and parent information. + + Specification: + ------------- + int USERD_get_border_elements_by_type(int part_number, + int element_type, + int **conn_array, + short *parent_element_type, + int *parent_element_num) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) part_number = The part number + (1-based index of part table, namely: + + 1 ... Numparts_available. + + It is NOT the part_id that + is loaded in USERD_get_gold_part_build_info) + + (IN) element_type = One of the following (See global_extern.h) + Z_POINT node point element + Z_BAR02 2 node bar + Z_BAR03 3 node bar + Z_TRI03 3 node triangle + Z_TRI06 6 node triangle + Z_QUA04 4 node quad + Z_QUA08 8 node quad + + (OUT) conn_array = 2D array containing connectivity + of each border element of the type. + + (Array will have been allocated + num_of_elements of the type by + connectivity length of the type) + + ex) If number_of_elements[Z_TRI03] = 25 + number_of_elements[Z_QUA04] = 100 + number_of_elements[Z_QUA08] = 30 + as obtained in: + USERD_get_border_availability + + Then the allocated dimensions available + for this routine will be: + conn_array[25][3] when called with Z_TRI03 + + conn_array[100][4] when called with Z_QUA04 + + conn_array[30][8] when called with Z_QUA08 + + (OUT) parent_element_type = 1D array containing element type of the + parent element (the one that the border + element is a face/edge of). + + (Array will have been allocated + num_of_elements of the type long) + + (OUT) parent_element_num = 1D array containing element number of the + parent element (the one that the border + element is a face/edge of). + + (Array will have been allocated + num_of_elements of the type long) + + + Notes: + ----- + * Not called unless USERD_get_border_availability returned Z_OK + + * Will be based on Current_time_step + + + +-------------------------------------------------------------------- +USERD_get_changing_geometry_status + + Description: + ----------- + Gets the changing geometry status for the model + + Specification: + ------------- + int USERD_get_changing_geometry_status( void ) + + Returns: + ------- + Z_STATIC if geometry does not change + Z_CHANGE_COORDS if changing coordinates only + Z_CHANGE_CONN if changing connectivity + + Arguments: + --------- + none + + Notes: + ----- + * EnSight does not support changing number of parts. But the + coords and/or the connectivity of the parts can change. Note that + a part is allowed to be empty (number of nodes and elements equal + to zero). + + +-------------------------------------------------------------------- +USERD_get_constant_val + + Description: + ----------- + Get the value of a constant at a time step + + Specification: + ------------- + float USERD_get_constant_value(int which_var, + int imag_data) + + Returns: + ------- + Value of the requested constant variable + + Arguments: + --------- + (IN) which_var = The variable number + + (IN) imag_data = TRUE if want imaginary data value. + FALSE if want real data value. + + Notes: + ----- + * Will be based on Current_time_step + + + +-------------------------------------------------------------------- +USERD_get_dataset_query_file_info + + Description: + ----------- + Get the information about files in the dataset. Used for the + dataset query option within EnSight. + + Specification: + ------------- + int USERD_get_dataset_query_file_info(Z_QFILES *qfiles) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (OUT) qfiles = Structure containing information about each file + of the dataset. The Z_QFILES structure is defined + in the global_extern.h file + + (The structure will have been allocated + Num_dataset_files long, with 10 description + lines per file). + + qfiles[].name = The name of the file + (Z_MAXFILENP is the dimensioned length + of the name) + + qfiles[].sizeb = The number of bytes in the file + (Typically obtained with a call to the + "stat" system routine) (Is a long) + + qfiles[].timemod = The time the file was last modified + (Z_MAXTIMLEN is the dimensioned length + of this string) + (Typically obtained with a call to the + "stat" system routine) + + qfiles[].num_d_lines = The number of description lines you + are providing from the file. Max = 10 + + qfiles[].f_desc[] = The description line(s) per file, + qfiles[].num_d_lines of them + (Z_MAXFILENP is the allocated length of + each line) + + Notes: + ----- + * If Num_dataset_files is 0, this routine will not be called. + (See USERD_get_number_of_files_in_dataset) + + +-------------------------------------------------------------------- +USERD_get_descrip_lines + + Description: + ----------- + Get two description lines associated with geometry per time step, + or one description line associated with a variable per time step. + + Specification: + ------------- + int USERD_get_descrip_lines(int which_type, + int which_var, + int imag_data, + char line1[Z_BUFL], + char line2[Z_BUFL]) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) which_type = Z_GEOM for geometry (2 lines) + = Z_VARI for variable (1 line) + + (IN) which_var = If it is a variable, which one. + Ignored if geometry type. + + (IN) imag_data = TRUE if want imaginary data file. + FALSE if want real data file. + + (OUT) line1 = The 1st geometry description line, + or the variable description line. + + (OUT) line2 = The 2nd geometry description line + Not used if variable type. + + Notes: + ----- + * Will be based on Current_time_step + + * These are the lines EnSight can echo to the screen in + annotation mode. + + + +-------------------------------------------------------------------- +USERD_get_element_label_status + + Description: + ----------- + Answers the question as to whether element labels will be provided. + + Specification: + ------------- + int USERD_get_element_label_status( void ) + + Returns: + ------- + TRUE if element labels will be provided + FALSE if element labels will NOT be provided + + Arguments: + --------- + none + + Notes: + ----- + * element lables are needed in order to do any element querying, or + element labeling on-screen within EnSight. + + * Prior to API 2.01: + ----------------- + For unstructured parts, you can read them from your file if + available, or can assign them, etc. They need to be unique + per part, and are often unique per model. + + API 1.0: + USERD_get_element_ids_for_part is used to obtain the ids, + on a part by part basis, if TRUE status is returned here. + + API 2.0: + USERD_get_part_element_ids_by_type is used to obtain the ids, + on a per part, per type basis, if TRUE status is returned here. + + For structured parts, EnSight will assign ids if you return a + status of TRUE here. You cannot assign them youself!! + + * Starting at API 2.01: + -------------------- + For both unstructured and structured parts, you can read them + from your file if available, or can assign them, etc. They need + to be unique per part, and are often unique per model (especially + if you are dealing with a decomposed dataset). + + USERD_get_part_element_ids_by_type is used to obtain the ids, + on an element type by part basis, if TRUE status is returned here. + + * Will call USERD_get_part_element_ids_by_type for each type of + of each part if this routine returns TRUE. +-------------------------------------------------------------------- +USERD_get_geom_timeset_number - + + Description: + ----------- + Gets the timeset number to be used for geometry + + Specification: + ------------- + int USERD_get_geom_timeset_number( void ) + + Returns: + ------- + Geom_timeset_number = The timeset number that will be used for geometry. + For example, if USERD_get_number_of timesets + returns 2, the valid timeset numbers would be + 1 or 2. + + Arguments: + --------- + none + + Notes: + ----- + * If your model is static, which you indicated by returning a zero + in USERD_get_number_of_timesets, you can return a zero here as well. + + + +-------------------------------------------------------------------- +USERD_get_gold_part_build_info + + Description: + ----------- + Gets the info needed for the part building process. + + Specification: + ------------- + int USERD_get_gold_part_build_info(int *part_id, + int *part_types, + char *part_description[Z_BUFL], + int *number_of_nodes, + int *number_of_elements[Z_MAXTYPE], + int *ijk_dimensions[9], + int *iblanking_options[6]) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (OUT) part_id = Array containing the external part + ids for each of the model parts. + + IMPORTANT: + Parts numbers must be >= 1, because + of the way they are used in the GUI + + ******************************************* + The ids provided here are the numbers by + which the parts will be referred to in the + GUI (if possible). They are basically + labels as far as you are concerned. + + Note: The part numbers you pass to routines + which receive a part_number or block_number + or which_part as an argument are the 1-based + table index of the parts! + + example: If Numparts_available = 3 + + Table index part_id + ----------- ------- + 1 13 + 2 57 + 3 125 + + ^ ^ + | | + | These are placed in: + | part_id[0] = 13 + | part_id[1] = 57 + | part_id[2] = 125 + | for GUI labeling purposes. + | + These implied table indices are the part_number, + block_number, or which_part numbers that you would + pass to routines like: + + USERD_get_part_coords(int part_number,... + USERD_get_part_node_ids(int part_number,... + USERD_get_part_elements_by_type(int part_number,... + USERD_get_part_element_ids_by_type(int part_number,... + USERD_get_block_coords_by_component(int block_number,... + USERD_get_block_iblanking(int block_number,... + USERD_get_block_ghost_flags(int block_number,... + USERD_get_ghosts_in_block_flag(int block_number) + USERD_get_border_availability(int part_number,... + USERD_get_border_elements_by_type(int part_number,... + USERD_get_var_by_component(int which_variable, + int which_part,... + USERD_get_var_value_at_specific(int which_var, + int which_node_or_elem, + int which_part,... + ******************************************** + + (Array will have been allocated + Numparts_available long) + + (OUT) part_types = Array containing one of the + following for each model part: + + Z_UNSTRUCTURED or + Z_STRUCTURED or + Z_IBLANKED + + (Array will have been allocated + Numparts_available long) + + (OUT) part_description = Array containing a description + for each of the model parts + + (Array will have been allocated + Numparts_available by Z_BUFL + long) + + (OUT) number_of_nodes = Number of unstructured nodes in the part + + (Array will have been allocated + Numparts_available long) + + (OUT) number_of_elements = 2D array containing number of + each type of element for each + unstructured model part. + ------------ + Possible types are: + + Z_POINT = point + Z_BAR02 = 2-noded bar + Z_BAR03 = 3-noded bar + Z_TRI03 = 3-noded triangle + Z_TRI06 = 6-noded triangle + Z_QUA04 = 4-noded quadrilateral + Z_QUA08 = 8-noded quadrilateral + Z_TET04 = 4-noded tetrahedron + Z_TET10 = 10-noded tetrahedron + Z_PYR05 = 5-noded pyramid + Z_PYR13 = 13-noded pyramid + Z_PEN06 = 6-noded pentahedron + Z_PEN15 = 15-noded pentahedron + Z_HEX08 = 8-noded hexahedron + Z_HEX20 = 20-noded hexahedron + + Z_G_POINT = ghost node point element + Z_G_BAR02 = 2 node ghost bar + Z_G_BAR03 = 3 node ghost bar + Z_G_TRI03 = 3 node ghost triangle + Z_G_TRI06 = 6 node ghost triangle + Z_G_QUA04 = 4 node ghost quad + Z_G_QUA08 = 8 node ghost quad + Z_G_TET04 = 4 node ghost tetrahedron + Z_G_TET10 = 10 node ghost tetrahedron + Z_G_PYR05 = 5 node ghost pyramid + Z_G_PYR13 = 13 node ghost pyramid + Z_G_PEN06 = 6 node ghost pentahedron + Z_G_PEN15 = 15 node ghost pentahedron + Z_G_HEX08 = 8 node ghost hexahedron + Z_G_HEX20 = 20 node ghost hexahedron + + (Ignored unless Z_UNSTRUCTURED type) + + (Array will have been allocated + Numparts_available by + Z_MAXTYPE long) + + (OUT) ijk_dimensions = 2D array containing ijk dimension info + for structured blocks + + For Z_UNSTRUCTURED - is ignored + + For Z_STRUCTURED or Z_IBLANKED + + Prior to version 2.03: + ---------------------- + (Array will have been allocated + Numparts_available by 3 long) + + ijk_dimensions[][0] = I dimension + ijk_dimensions[][1] = J dimension + ijk_dimensions[][2] = K dimension + + + Starting at version 2.03: + ------------------------ + (Array will have been allocated + Numparts_available by 9 long) + + There are two ways to do this: + ------------------------------ + 1. The simple one, without ranges. + + This is good for all structured models + that will NOT be used in EnSight's + Server of Servers + + Simply provide the ijk dimensions in the + first three slots and place a -1 in + the 4th slot. (The remaining slots will + be ignored). + + Thus, + ijk_dimensions[][0] = I dimension of block + ijk_dimensions[][1] = J dimension of block + ijk_dimensions[][2] = K dimension of block + ijk_dimensions[][3] = -1 + + (J planes) + 4 *-------*-------* + | | | ijk_dimension[0][0] = 3 + | | | ijk_dimension[0][1] = 4 + | | | ijk_dimension[0][2] = 1 + 3 *-------*-------* + | | | ijk_dimension[0][4] = -1 + | | | + | | | + 2 *-------*-------* + | | | + | | | + | | | + 1 *-------*-------* + 1 2 3 (I planes) + + + + 2. Using ranges. + + This one can be used anytime, but MUST + be used if EnSight's Server of Servers + is to be used! + + The first 3 slots contain the ijk dimension + of the complete block (of which this may be + a portion). The last 6 slots contain the + ijk min and max ranges within the complete. + + Thus, + ijk_dimensions[][0] = I dim of complete block + ijk_dimensions[][1] = J dim of complete block + ijk_dimensions[][2] = K dim of complete block + + ijk_dimensions[][3] = Imin of portion (1-based) + ijk_dimensions[][4] = Imax of portion (1-based) + ijk_dimensions[][5] = Jmin of portion (1-based) + ijk_dimensions[][6] = Jmax of portion (1-based) + ijk_dimensions[][7] = Kmin of portion (1-based) + ijk_dimensions[][8] = Kmax of portion (1-based) + + + example1: (Model has one part, a simple 2D block, + and want whole thing) + + (J planes) + 4 *-------*-------* + | | | ijk_dimension[0][0] = 3 + | | | ijk_dimension[0][1] = 4 + | | | ijk_dimension[0][2] = 1 + 3 *-------*-------* + | | | ijk_dimension[0][3] = 1 + | | | ijk_dimension[0][4] = 3 + | | | ijk_dimension[0][5] = 1 + 2 *-------*-------* ijk_dimension[0][6] = 4 + | | | ijk_dimension[0][7] = 1 + | | | ijk_dimension[0][8] = 1 + | | | + 1 *-------*-------* + 1 2 3 (I planes) + + + example2: (Want to have the block represented + in two portions - 2 parts) + + (J planes) top portion + 4 *-------*-------* + | | | ijk_dimension[0][0] = 3 + | | | ijk_dimension[0][1] = 4 + | | | ijk_dimension[0][2] = 1 + 3 *-------*-------* + . . . ijk_dimension[0][3] = 1 + . . . ijk_dimension[0][4] = 3 + . . . ijk_dimension[0][5] = 3 + 2 ................. ijk_dimension[0][6] = 4 + . . . ijk_dimension[0][7] = 1 + . . . ijk_dimension[0][8] = 1 + . . . + 1 ................. + 1 2 3 (I planes) + + + (J planes) bottom portion + 4 ................. + . . . ijk_dimension[1][0] = 3 + . . . ijk_dimension[2][1] = 4 + . . . ijk_dimension[3][2] = 1 + 3 *-------*-------* + | | | ijk_dimension[1][3] = 1 + | | | ijk_dimension[1][4] = 3 + | | | ijk_dimension[1][5] = 1 + 2 *-------*-------* ijk_dimension[1][6] = 3 + | | | ijk_dimension[1][7] = 1 + | | | ijk_dimension[1][8] = 1 + | | | + 1 *-------*-------* + 1 2 3 (I planes) + + + And note that if you were partioning this block for + EnSight's Server of Servers, you would only have one part, + instead of two. Each SOS server would return its appropriate + ranges in the last 6 slots. The first 3 slots would remain constant. + + + (OUT) iblanking_options = 2D array containing iblanking + options possible for each + structured model part. + ---------- + (Ignored unless Z_IBLANKED type) + + (Array will have been allocated + Numparts_available by 6 long) + + iblanking_options[][Z_EXT] = TRUE if external (outside) + [][Z_INT] = TRUE if internal (inside) + [][Z_BND] = TRUE if boundary + [][Z_INTBND] = TRUE if internal boundary + [][Z_SYM] = TRUE if symmetry surface + + + Notes: + ----- + * If you haven't built a table of pointers to the different parts, + you might want to do so here as you gather the needed info. + + * Will be based on Current_time_step + + +-------------------------------------------------------------------- +USERD_get_gold_variable_info + + Description: + ----------- + Get the variable descriptions, types and filenames + + Specification: + ------------- + int USERD_get_gold_variable_info(char **var_description, + char **var_filename, + int *var_type, + int *var_classify, + int *var_complex, + char **var_ifilename, + float *var_freq, + int *var_contran, + int *var_timeset) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (OUT) var_description = Variable descriptions + + (Array will have been allocated + Num_variables by Z_BUFL long) + + variable description restrictions: + ---------------------------------- + 1. Only first 19 characters used in EnSight. + 2. Leading and trailing whitespace will be removed by EnSight. + 3. Illegal characters will be replaced by underscores. + 4. Thay may not start with a numeric digit. + 4. No two variables may have the same description. + + + (OUT) var_filename = Variable real filenames + + (Array will have been allocated + Num_variables by Z_BUFL long) + + (OUT) var_type = Variable type + + (Array will have been allocated + Num_variables long) + + types are: Z_CONSTANT + Z_SCALAR + Z_VECTOR + Z_TENSOR + Z_TENSOR9 + + (OUT) var_classify = Variable classification + + (Array will have been allocated + Num_variables long) + + types are: Z_PER_NODE + Z_PER_ELEM + + (OUT) var_complex = TRUE if complex, FALSE otherwise + + (Array will have been allocated + Num_variables long) + + (OUT) var_ifilename = Variable imaginary filenames (if complex) + + (Array will have been allocated + Num_variables by Z_BUFL long) + + (OUT) var_freq = complex frequency (if complex) + + (Array will have been allocated + Num_variables long) + + (OUT) var_contran = TRUE if constant changes per time step + FALSE if constant truly same at all time steps + + (Array will have been allocated + Num_variables long) + + (OUT) var_timeset = Timeset the variable will use (1 based). + (For static models, set it to 1) + + (Array will have been allocated + Num_variables long) + + For example: If USERD_get_number_of_timesets + returns 2, the valid + timeset_number's would be 1 or 2 + + + Notes: + ----- + * The implied variable numbers apply, but be aware that the + arrays are zero based. + So for variable 1, will need to provide var_description[0] + var_filename[0] + var_type[0] + var_classify[0] + var_complex[0] + var_ifilename[0] + var_freq[0] + var_contran[0] + var_timeset[0] + + + for variable 2, will need to provide var_description[1] + var_filename[1] + var_type[1] + var_classify[1] + var_complex[1] + var_ifilename[1] + var_freq[1] + var_contran[1] + var_timeset[1] + etc. + + + + +-------------------------------------------------------------------- +USERD_get_ghosts_in_block_flag + + Description: + ----------- + Gets whether ghost cells present in block or not + + Specification: + ------------- + int USERD_get_ghosts_in_block_flag(int block_number) + + Returns: + ------- + TRUE if any ghost cells in this structured part + FALSE if no ghost cells in this structured part + + Arguments: + --------- + (IN) block_number = The block part number + (1-based index of part table, namely: + + 1 ... Numparts_available. + + It is NOT the part_id that + is loaded in USERD_get_gold_part_build_info) + + Notes: + ----- + * This routine is new in the 2.01 API + * This will be based on Current_time_step + + * Intended for structured parts only, value will be ignored for + unstructured parts + + + +-------------------------------------------------------------------- +USERD_get_ghosts_in_model_flag + + Description: + ----------- + Answers the question as to whether any ghost cells in the model. + + Specification: + ------------- + int USERD_get_ghosts_in_model_flag( void ) + + Returns: + ------- + TRUE if any ghost cells in the model + FALSE if no ghost cells in the model + + Arguments: + --------- + + Notes: + ----- + * This routine is new in the 2.01 API + +------------------------------------------------------------------------- +USERD_get_matf_set_info + + Description: + ----------- + Get the material set ids and names + + Specification: + ------------- + int USERD_get_matf_set_info(int *mat_set_ids, + char **mat_set_name) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (OUT) mat_set_ids = 1D material set ids array + + (Array will have been allocated + Num_material_sets long) + + (OUT) mat_set_name = 2D material set name array + + (Array will have been allocated + Num_material_sets by Z_BUFL long) + + Notes: + ----- + * Will not be called if Num_material_sets is zero + * See USERD_get_number_of_material_sets header for explanatory example + + +-------------------------------------------------------------------- +USERD_get_matf_var_info + + Description: + ----------- + Gets the material ids and descriptions for the material set + + Specification: + ------------- + int USERD_get_matf_var_info(int set_index, + int *mat_ids, + char **mat_desc) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) set_index = the material set index (zero based) + + (OUT) mat_ids[set_index] = 1D integer array containing the material + ids to associated with each material + + (Array will have been allocated + Num_materials[set_index] long) + + (OUT) mat_desc[set_index] = 2D char array containing the material + descriptions to associated with each material + + (Array will have been allocated + Num_materials[set_index] by Z_BUFL long) + + Notes: + ----- + * See USERD_get_number_of_material_sets header for explanatory example + * Will not be called if Num_material_sets is zero, or + Num_materials[set_index] is zero + + + + +-------------------------------------------------------------------- +USERD_get_maxsize_info + + Description: + ----------- + Gets maximum part sizes for efficient memory allocation. + + Transient models (especially those that increase in size) can cause + reallocations, at time step changes, to keep chewing up more and + more memory. The way to avoid this is to know what the maximum + size of such memory will be, and allocate for this maximum initially. + + Accordingly, if you choose to provide this information (it is optional), + EnSight will take advantage of it. + + + Specification: + ------------- + int USERD_get_maxsize_info(int *max_number_of_nodes, + int *max_number_of_elements[Z_MAXTYPE], + int *max_ijk_dimensions[3]) + + Returns: + ------- + Z_OK if supplying maximum data + Z_ERR if not supplying maximum data, or some error occurred + while trying to obtain it. + + Arguments: + --------- + (OUT) max_number_of_nodes = Maximum number of unstructured nodes + in the part (over all time). + + (Array will have been allocated + Numparts_available long) + + (OUT) max_number_of_elements = 2D array containing maximum number of + each type of element for each + unstructured model part (over all time). + ------------ + Possible types are: + + Z_POINT = point + Z_BAR02 = 2-noded bar + Z_BAR03 = 3-noded bar + Z_TRI03 = 3-noded triangle + Z_TRI06 = 6-noded triangle + Z_QUA04 = 4-noded quadrilateral + Z_QUA08 = 8-noded quadrilateral + Z_TET04 = 4-noded tetrahedron + Z_TET10 = 10-noded tetrahedron + Z_PYR05 = 5-noded pyramid + Z_PYR13 = 13-noded pyramid + Z_PEN06 = 6-noded pentahedron + Z_PEN15 = 15-noded pentahedron + Z_HEX08 = 8-noded hexahedron + Z_HEX20 = 20-noded hexahedron + + Z_G_POINT = ghost node point element + Z_G_BAR02 = 2 node ghost bar + Z_G_BAR03 = 3 node ghost bar + Z_G_TRI03 = 3 node ghost triangle + Z_G_TRI06 = 6 node ghost triangle + Z_G_QUA04 = 4 node ghost quad + Z_G_QUA08 = 8 node ghost quad + Z_G_TET04 = 4 node ghost tetrahedron + Z_G_TET10 = 10 node ghost tetrahedron + Z_G_PYR05 = 5 node ghost pyramid + Z_G_PYR13 = 13 node ghost pyramid + Z_G_PEN06 = 6 node ghost pentahedron + Z_G_PEN15 = 15 node ghost pentahedron + Z_G_HEX08 = 8 node ghost hexahedron + Z_G_HEX20 = 20 node ghost hexahedron + + (Ignored unless Z_UNSTRUCTURED type) + + (Array will have been allocated + Numparts_available by + Z_MAXTYPE long) + + (OUT) max_ijk_dimensions = 2D array containing maximum ijk dimensions + for each structured model part (over all time). + ---------- + (Ignored if Z_UNSTRUCTURED type) + + (Array will have been allocated + Numparts_available by 3 long) + + max_ijk_dimensions[][0] = maximum I dimension + max_ijk_dimensions[][1] = maximum J dimension + max_ijk_dimensions[][2] = maximum K dimension + + Notes: + ----- + * You need to have first called USERD_get_number_of_model_parts and + USERD_get_gold_part_build_info, so Numparts_available is known and + so EnSight will know what the type is (Z_UNSTRUCTURED, Z_STRUCTURED, + or Z_IBLANKED) of each part. + + * This will NOT be based on Current_time_step - it is to be the maximum + values over all time!! + + * This information is optional. If you return Z_ERR, Ensight will still + process things fine, reallocating as needed, etc. However, for + large transient models you will likely use considerably more memory + and take more processing time for the memory reallocations. So, if it + is possible to provide this information "up front", it is recommended + to do so. + + +-------------------------------------------------------------------- +USERD_get_model_extents + + Description: + ----------- + Gets the model bounding box extents. If this routine supplys them + EnSight will not have to spend time doing so. If this routine + returns Z_ERR, EnSight will have to take the time to touch all the + nodes and gather the extent info. + + Specification: + ------------- + int USERD_get_model_extents(float extents[6]) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful (whereupon EnSight will determine by reading + all coords of all parts) + + Arguments: + --------- + (OUT) extents[0] = min x + [1] = max x + [2] = min y + [3] = max y + [4] = min z + [5] = max z + + Notes: + ----- + * This will be based on Current_time_step + + +-------------------------------------------------------------------- +USERD_get_name_of_reader + + Description: + ----------- + Gets the name of your user defined reader. The user interface will + ask for this and include it in the available reader list. + + Specification: + ------------- + int USERD_get_name_of_reader(char reader_name[Z_MAX_USERD_NAME], + int *two_fields) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (OUT) reader_name = the name of the your reader or data format. + (max length is Z_MAX_USERD_NAME, which is 20) + + (OUT) two_fields = FALSE if only one data field is + required. + TRUE if two data fields required + + -1 if one field (Geom) required + and one field (Param) is optional + Param field can contain any text + for example a file name, modifiers, + etc. that can be used to modify the + reader's behavior. + + + Notes: + ----- + * Always called. Please be sure to provide a name for your custom + reader format. + +-------------------------------------------------------------------- +USERD_get_nfaced_conn + + Description: + ----------- + Gets the array containing the connectivity of nsided faces of nfaced elements + + Specification: + -------------int + int USERD_get_nfaced_conn(int part_number, + int *nfaced_conn_array) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) part_number = the part number + + (OUT) nfaced_conn_array = 1D array of nsided face connectivies of nfaced + elements + + (int array will have been allocated long enough to + hold all the nsided face connectivities. Which is + the sum of all the nodes per face values in the + nfaced_npf_array of USERD_get_nfaced_nodes_per_face) + + Notes: + ----- + * Will not be called unless there are some nfaced elements in the part + + * Providing nfaced information to Ensight: + + 1. In USERD_get_gold_part_build_info, provide the number of nfaced + polyhedral elements in the part. + + 2. In USERD_get_part_elements_by_type, provide (in the conn_array), + the number of faces per nfaced element. (as if connectivity + length of an nfaced element is one) + + 3. In this routine, provide the streamed number of nodes per face + for each of the faces of the nfaced elements. + + + Simple example: 11 10 12 + +--------+-----+ + 2 nfaced elements: /| |\ /| + (1 7-faced / | | \ / | + 1 5-sided) / | | +9 | + / | | /| | + /7 | 8 / | | + +-----------+/ | | | + | |5 | |4 | |6 + | +-----|--+--|--+ + | / | \ | / + | / | \|/3 + | / | + + | / | / + |/1 |2 / + +-----------+/ + + 1. In USERD_get_gold_part_build_info: + number_of_elements[Z_NFACED] = 2 + . + /|\ + | + 2. In USERD_get_part_elements_by_type: + length of conn_array will be: 2 x 1 + for element_type of Z_NFACED: + conn_array[0][0] = 7 (for the 7-faced element) + conn_array[1][0] = 5 (for the 5-faced element) + + == + Sum 12 <---------+ + | + 3. In USERD_get_faced_nodes_per_face: | + length of nfaced_npf_array will be: 12 + + nfaced_npf_array[0] = 5 (5-noded top face of 7-faced element) + nfaced_npf_array[1] = 5 (5-noded bot face of 7-faced element) + nfaced_npf_array[2] = 4 (4-noded front face of 7-faced element) + nfaced_npf_array[3] = 4 (4-noded left face of 7-faced element) + nfaced_npf_array[4] = 4 (4-noded back face of 7-faced element) + nfaced_npf_array[5] = 4 (4-noded right front face of 7-faced element) + nfaced_npf_array[6] = 4 (4-noded right back face of 7-faced element) + + nfaced_npf_array[7] = 3 (3-noded top face of 5-faced element) + nfaced_npf_array[8] = 3 (3-noded bot face of 5-faced element) + nfaced_npf_array[9] = 4 (4-noded back face of 5-faced element) + nfaced_npf_array[10] = 4 (4-noded right face of 5-faced element) + nfaced_npf_array[11] = 4 (4-noded left front face of 5-faced element) + + == + Sum 48 <-------------+ + | + 4. In this function: | + length of the nfaced_conn_array will be: 48 + + nsided_conn_array[0] = 7 (conn of 5-noded top face of 7-faced elem) + nsided_conn_array[1] = 8 + nsided_conn_array[2] = 9 + nsided_conn_array[3] = 10 + nsided_conn_array[4] = 11 + + nsided_conn_array[5] = 1 (conn of 5-noded bot face of 7-faced elem) + nsided_conn_array[6] = 5 + nsided_conn_array[7] = 4 + nsided_conn_array[8] = 3 + nsided_conn_array[9] = 2 + + nsided_conn_array[10] = 1 (conn of 4-noded front face of 7-faced elem) + nsided_conn_array[11] = 2 + nsided_conn_array[12] = 8 + nsided_conn_array[13] = 7 + + nsided_conn_array[14] = 5 (conn of 4-noded left face of 7-faced elem) + nsided_conn_array[15] = 1 + nsided_conn_array[16] = 7 + nsided_conn_array[17] = 11 + + nsided_conn_array[18] = 4 (conn of 4-noded back face of 7-faced elem) + nsided_conn_array[19] = 5 + nsided_conn_array[20] = 11 + nsided_conn_array[21] = 10 + + nsided_conn_array[22] = 2 (conn of 4-noded right front face of 7-faced) + nsided_conn_array[23] = 3 + nsided_conn_array[24] = 9 + nsided_conn_array[25] = 8 + + nsided_conn_array[26] = 3 (conn of 4-noded right back face of 7-faced) + nsided_conn_array[27] = 4 + nsided_conn_array[28] = 10 + nsided_conn_array[29] = 9 + + nsided_conn_array[30] = 9 (conn of 3-noded top face of 5-faced elem) + nsided_conn_array[32] = 12 + nsided_conn_array[32] = 10 + + nsided_conn_array[33] = 3 (conn of 3-noded bot face of 5-faced elem) + nsided_conn_array[34] = 4 + nsided_conn_array[35] = 6 + + nsided_conn_array[36] = 6 (conn of 4-noded back face of 5-faced elem) + nsided_conn_array[37] = 4 + nsided_conn_array[38] = 10 + nsided_conn_array[39] = 12 + + nsided_conn_array[40] = 3 (conn of 4-noded right face of 5-faced elem) + nsided_conn_array[41] = 6 + nsided_conn_array[42] = 12 + nsided_conn_array[43] = 9 + + nsided_conn_array[44] = 4 (conn of 4-noded left front face of 5-faced) + nsided_conn_array[45] = 3 + nsided_conn_array[46] = 9 + nsided_conn_array[47] = 10 + + + +-------------------------------------------------------------------- +USERD_get_nfaced_nodes_per_face - + + Description: + ----------- + Gets the array containing the number of nodes per face for each face + of the nfaced elements. + + Specification: + ------------- + int USERD_get_nfaced_nodes_per_face(int part_number, + int *nfaced_npf_array) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) part_number = the part number + + (OUT) nfaced_npf_array = 1D array of nodes per face for all faces of + nfaced elements + + (int array will have been allocated long enough + to hold all the nodes_per_face values. Which is + the sum of all the number of faces per element + values in the conn_array of + USERD_get_part_elements_by_type) + + Notes: + ----- + * Will not be called unless there are some nfaced elements in the + the part + + * Providing nfaced information to Ensight: + + 1. In USERD_get_gold_part_build_info, provide the number of nfaced + polyhedral elements in the part. + + 2. In USERD_get_part_elements_by_type, provide (in the conn_array), + the number of faces per nfaced element. (as if connectivity + length of an nfaced element is one) + + 3. In this routine, provide the streamed number of nodes per face + for each of the faces of the nfaced elements. + + + Simple example: 11 10 12 + +--------+-----+ + 2 nfaced elements: /| |\ /| + (1 7-faced / | | \ / | + 1 5-sided) / | | +9 | + / | | /| | + /7 | 8 / | | + +-----------+/ | | | + | |5 | |4 | |6 + | +-----|--+--|--+ + | / | \ | / + | / | \|/3 + | / | + + | / | / + |/1 |2 / + +-----------+/ + + 1. In USERD_get_gold_part_build_info: + number_of_elements[Z_NFACED] = 2 + . + /|\ + | + 2. In USERD_get_part_elements_by_type: + length of conn_array will be: 2 x 1 + for element_type of Z_NFACED: + conn_array[0][0] = 7 (for the 7-faced element) + conn_array[1][0] = 5 (for the 5-faced element) + + == + Sum 12 <---------+ + | + 3. In this routine: | + length of nfaced_npf_array will be: 12 + + nfaced_npf_array[0] = 5 (5-noded top face of 7-faced element) + nfaced_npf_array[1] = 5 (5-noded bot face of 7-faced element) + nfaced_npf_array[2] = 4 (4-noded front face of 7-faced element) + nfaced_npf_array[3] = 4 (4-noded left face of 7-faced element) + nfaced_npf_array[4] = 4 (4-noded back face of 7-faced element) + nfaced_npf_array[5] = 4 (4-noded right front face of 7-faced element) + nfaced_npf_array[6] = 4 (4-noded right back face of 7-faced element) + + nfaced_npf_array[7] = 3 (3-noded top face of 5-faced element) + nfaced_npf_array[8] = 3 (3-noded bot face of 5-faced element) + nfaced_npf_array[9] = 4 (4-noded back face of 5-faced element) + nfaced_npf_array[10] = 4 (4-noded right face of 5-faced element) + nfaced_npf_array[11] = 4 (4-noded left front face of 5-faced element) + + == + Sum 48 <-------------+ + | + 4. In USERD_get_nfaced_conn: | + length of the nfaced_conn_array will be: 48 + + nsided_conn_array[0] = 7 (conn of 5-noded top face of 7-faced elem) + nsided_conn_array[1] = 8 + nsided_conn_array[2] = 9 + nsided_conn_array[3] = 10 + nsided_conn_array[4] = 11 + + nsided_conn_array[5] = 1 (conn of 5-noded bot face of 7-faced elem) + nsided_conn_array[6] = 5 + nsided_conn_array[7] = 4 + nsided_conn_array[8] = 3 + nsided_conn_array[9] = 2 + + nsided_conn_array[10] = 1 (conn of 4-noded front face of 7-faced elem) + nsided_conn_array[11] = 2 + nsided_conn_array[12] = 8 + nsided_conn_array[13] = 7 + + nsided_conn_array[14] = 5 (conn of 4-noded left face of 7-faced elem) + nsided_conn_array[15] = 1 + nsided_conn_array[16] = 7 + nsided_conn_array[17] = 11 + + nsided_conn_array[18] = 4 (conn of 4-noded back face of 7-faced elem) + nsided_conn_array[19] = 5 + nsided_conn_array[20] = 11 + nsided_conn_array[21] = 10 + + nsided_conn_array[22] = 2 (conn of 4-noded right front face of 7-faced) + nsided_conn_array[23] = 3 + nsided_conn_array[24] = 9 + nsided_conn_array[25] = 8 + + nsided_conn_array[26] = 3 (conn of 4-noded right back face of 7-faced) + nsided_conn_array[27] = 4 + nsided_conn_array[28] = 10 + nsided_conn_array[29] = 9 + + nsided_conn_array[30] = 9 (conn of 3-noded top face of 5-faced elem) + nsided_conn_array[32] = 12 + nsided_conn_array[32] = 10 + + nsided_conn_array[33] = 3 (conn of 3-noded bot face of 5-faced elem) + nsided_conn_array[34] = 4 + nsided_conn_array[35] = 6 + + nsided_conn_array[36] = 6 (conn of 4-noded back face of 5-faced elem) + nsided_conn_array[37] = 4 + nsided_conn_array[38] = 10 + nsided_conn_array[39] = 12 + + nsided_conn_array[40] = 3 (conn of 4-noded right face of 5-faced elem) + nsided_conn_array[41] = 6 + nsided_conn_array[42] = 12 + nsided_conn_array[43] = 9 + + nsided_conn_array[44] = 4 (conn of 4-noded left front face of 5-faced) + nsided_conn_array[45] = 3 + nsided_conn_array[46] = 9 + nsided_conn_array[47] = 10 + + + + +-------------------------------------------------------------------- +USERD_get_node_label_status + + Description: + ----------- + Answers the question as to whether node labels will be provided. + + Specification: + ------------- + int USERD_get_node_label_status( void ) + + Returns: + ------- + TRUE if node labels will be provided + FALSE if node labels will NOT be provided + + Arguments: + --------- + none + + Notes: + ----- + * Node ids are needed in order to do any node querying, or node + labeling on-screen within EnSight. + + * Prior to API 2.01: + ----------------- + For unstructured parts, you can read them from your file if + available, or can assign them, etc. They need to be unique + per part, and are often unique per model. They must also be + positive numbers greater than zero. + + USERD_get_part_node_ids is used to obtain the ids, if the + status returned here is TRUE. + + (Unlike API 1.0, where the connectivity of elements had to be + according to the node ids - API 2.0's element connectivities + are not affected either way by the status here.) + + For structured parts, EnSight will assign ids if you return a + status of TRUE here. You cannot assign them yourself!! + + * Starting at API 2.01: + -------------------- + For both unstructured and structured parts, you can read them + from your file if available, or can assign them, etc. They need + to be unique per part, and are often unique per model. They must + also be positive numbers greater than zero. + + USERD_get_part_node_ids is used to obtain the ids, if the + status returned here is TRUE. + + * Will call USERD_get_part_node_ids for each part if this routine + returns TRUE. + +-------------------------------------------------------------------- +USERD_get_nsided_conn - + + Description: + ----------- + Gets the array containing the connectivity of nsided elements + + Specification: + ------------- + int USERD_get_nsided_conn(int part_number, + int *nsided_conn_array) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) part_number = the part number + + (OUT) nsided_conn_array = 1D array of nsided connectivies + + (int array will have been allocated long enough + to hold all the nsided connectivities. Which is + the sum of all the nodes_per_element values in + the conn_array of USERD_get_part_elements_by_type) + + + Notes: + ----- + * Will not be called unless there are some nsided elements in the the part. + + * Providing nsided information to Ensight: + + 1. In USERD_get_gold_part_build_info, provide the number of nsided + elements in the part. + + 2. In USERD_get_part_elements_by_type, provide (in the conn_array), + the number of nodes per nsided element. (as if connectivity + length of an nsided element is one) + + 3. In this routine, provide the streamed connectivities for each of the + nsided elements. + + + Simple example: 5 6 + +--------+ + 3 nsided elements: /| \ + (1 4-sided / | \ + 1 3-sided / | \ + 1 7-sided) / | \ 7 + /3 |4 + + +-----+ | + | | | + | | |8 + | | + + | | / + | | / + | | / + |1 |2 /9 + +-----+--------+ + + 1. In USERD_get_gold_part_build_info: + number_of_elements[Z_NSIDED] = 3 + . + /|\ + | + 2. In USERD_get_part_elements_by_type: + length of conn_array will be: 3 x 1 + + for element_type of Z_NSIDED: + conn_array[0][0] = 4 (for the 4-sided element) + conn_array[1][0] = 3 (for the 3-sided element) + conn_array[2][0] = 7 (for the 7-sided element) + + Sum === + 14 <---------+ + | + 3. In this routine: | + length of nsided_conn_array will be: 14 + + nsided_conn_array[0] = 1 (connectivity of 4-sided element) + nsided_conn_array[1] = 2 + nsided_conn_array[2] = 4 + nsided_conn_array[3] = 3 + + nsided_conn_array[4] = 3 (connectivity of 3-sided element) + nsided_conn_array[5] = 4 + nsided_conn_array[6] = 5 + + nsided_conn_array[7] = 2 (connectivity of 7-sided element) + nsided_conn_array[8] = 9 + nsided_conn_array[9] = 8 + nsided_conn_array[10] = 7 + nsided_conn_array[11] = 6 + nsided_conn_array[12] = 5 + nsided_conn_array[13] = 4 + + + + +-------------------------------------------------------------------- +USERD_get_num_of_time_steps + + Description: + ----------- + Gets the number of time steps of data available for desired timeset. + + Specification: + ------------- + int USERD_get_num_of_time_steps( int timeset_number ) + + Returns: + ------- + Number of time steps in timeset (>0 if okay, <=0 if problems). + + Arguments: + --------- + (IN) timeset number = the timeset number + + For example: If USERD_get_number_of_timesets + returns 2, the valid + timeset_number's would be 1 and 2 + + Notes: + ----- + * This should be >= 1 1 indicates a static model + >1 indicates a transient model + + * Num_time_steps[timeset_number] would be set here + + + +-------------------------------------------------------------------- +USERD_get_number_of_files_in_dataset + + Description: + ----------- + Get the total number of files in the dataset. Used for the + dataset query option within EnSight. + + Specification: + ------------- + int USERD_get_number_of_files_in_dataset( void ) + + Returns: + ------- + The total number of files in the dataset. + + Arguments: + --------- + none + + Notes: + ----- + * You can be as complete as you want about this. If you don't + care about the dataset query option, return a value of 0 + If you only want certain files, you can just include them. But, + you will need to supply the info in USERD_get_dataset_query_file_info + for each file you include here. + + * Num_dataset_files would be set here + + +-------------------------------------------------------------------- +USERD_get_number_of_material_sets - + + Description: + ----------- + Get the number of material sets in the model + + Specification: + ------------- + int USERD_get_number_of_material_sets( void ) + + + Returns: + ------- + Num_material_sets = number of material sets + (Zero would indicate that you have no materials + to deal with in the model) + + or + + -1 if an error condition + + Arguments: + --------- + none + + Notes: + ----- + * You may want to keep this as a global for use in other routines. + + ############################################################### + NOTE: For EnSight 7.6, only one material set is supported + within EnSight. + Thus the only valid returns here are: + 0 (no materials) + 1 (for the one material set allowed) + or -1 (if an error) + + If the casefile has more than this, this reader will + read them, but EnSight will issue an error message and + choke on them! + ############################################################### + + ================================================================ + A very simple explanatory example, to use as a reference for the + materials routines: + + Given a 2D mesh composed of 9 quad (Z_QUA04) elements, with two materials. + Most of the model is material 1, but the top left corner is material 9 - + basically as shown: + + + *--------*--------*--------* + | | / | | + | Mat 9 / | | + | | / | | + | |/ | | + | e7 / e8 | e9 | + | /| | | + | / | | | + | / | | | + *----/---*--------*--------* + | / | | | + | / | | | + | / | Mat 1 | + |/ | | | + | e4 | e5 | e6 | + | | | | + | | | | + | | | | + *--------*--------*--------* + | | | | + | | | | + | | | | + | | | | + | e1 | e2 | e3 | + | | | | + | | | | + | | | | + *--------*--------*--------* + + + Thus, in this routine, set: + Num_material_sets = 1 + + In USERD_get_matf_set_info, set: + mat_set_ids[0] = 1 + mat_set_name[0] = "Material Set 1" (or whatever name desired) + + In USERD_get_number_of_materials, input would be set_index = 0, and + would need to set: + Num_materials[0] = 2 + + For simplicity, the ids and descriptions that would be returned in + USERD_get_matf_var_info could be: + mat_ids[0] = 1 + mat_ids[1] = 9 + mat_desc[0] = "mat 1" (or whatever desired) + mat_desc[2] = "mat 9" + + The per element material ids list would need to be: + + material ids: + ------------- + ids_list[0] = 1 (material id 1, for elem e1) + ids_list[1] = 1 ( " e2) + ids_list[2] = 1 ( " e3) + ids_list[3] = -1 (negative of index into mixed-material id list, for elem e4) + ids_list[5] = 1 (material id 1, for elem e5) + ids_list[5] = 1 ( " e6) + ids_list[5] = -5 (negative of index into mixed-material id list, for elem e7) + ids_list[5] = -9 ( " e8) + ids_list[5] = 1 (material id 1, for elem e9) + + Finally we need the mixed material ids list and the mixed materials values list, + which would need to be: + + mixed-material ids: + ------------------- + ==> 1 ids_list[0] = 2 (the -1 in the material variable points here, + 2 indicates that two materials are present) + 2 ids_list[1] = 1 (1st material is 1) + 3 ids_list[2] = 9 (2nd material is 9) + 4 ids_list[3] = -1 (negative of index into mixed-material val_list) + ==> 5 ids_list[4] = 2 (the -5 in the material variable points here, + 2 indicates that two materials are present) + 6 ids_list[5] = 1 (1st material is 1) + 7 ids_list[6] = 9 (2nd material is 9) + 8 ids_list[7] = -3 (negative of index into mixed-material val_list) + ==> 9 ids_list[8] = 2 etc. + 10 ids_list[9] = 1 + 11 ids_list[10] = 9 + 12 ids_list[11] = -5 + + mixed-material values: + ---------------------- + ==> 1 val_list[0] = 0.875 (the -1 in the mixed-material ids_list points here, + and this is the value for material 1) + 2 val_list[1] = 0.125 (the value for material 9) + ==> 3 val_list[2] = 0.125 (the -3 in the mixed-materials ids_list points here) + 4 val_list[3] = 0.875 + ==> 5 val_list[4] = 0.875 (the -5 in the mixed-materials ids_list points here) + 6 val_list[5] = 0.125 + + So, USERD_size_matf_data would need to return + matf_size = 8, when called with set_id = 1 + part_id = 1 + wtyp = Z_QUA04 + mat_type = Z_MAT_INDEX + + matf_size = 12, when called with set_id = 1 + part_id = 1 + mat_type = Z_MIX_INDEX + + = 6, when called with set_id = 1 + part_id = 1 + mat_type = Z_MIX_VALUE + + And, USERD_load_matf_data would need to return: + the int array ids_list as shown above when called with: + set_id = 1 + part_id = 1 + wtyp = Z_QUA04 + mat_type = Z_MAT_INDEX (indicating id list). + + the int array ids_list as shown above when called with: + set_id = 1 + part_id = 1 + mat_type = Z_MIX_INDEX (indicating id list). + + the float array val_list as shown above when called with: + set_id = 1 + part_id = 1 + mat_type = Z_MIX_VALUE (indicating val list). + + +------------------------------------------------------------------------- +USERD_get_number_of_materials + + Description: + ----------- + Gets the number of materials in the material set + + Specification: + ------------- + int USERD_get_number_of_materials( int set_index ) + + Returns: + ------- + Num_materials[set_index] = Number of materials in the set + 0 indicates no materials information present + -1 indicates an error + Arguments: + --------- + (IN) set_index = the material set index (zero based) + + Notes: + ----- + * See USERD_get_number_of_material_sets header for explanatory example + * Will not be called if Num_material_sets is zero + * You may want to keep this as a global for use in other routines. + + + +-------------------------------------------------------------------- +USERD_get_number_of_model_parts + + Description: + ----------- + Gets the total number of unstructured and structured parts + in the model, for which you can supply information. + + Specification: + ------------- + int USERD_get_number_of_model_parts( void ) + + Returns: + ------- + Number of parts (>0 if okay, <=0 if problems). + + Arguments: + --------- + none + + Notes: + ----- + * If going to have to read down through the parts in order to + know how many, you may want to build a table of pointers to + the various parts, so you can easily get to particular parts in + later processes. If you can simply read the number of parts + at the head of the file, then you would probably not build the + table at this time. + + * This routine would set Numparts_available, which is equal to + Num_unstructured_parts + Num_structured_blocks. + + + +-------------------------------------------------------------------- +USERD_get_number_of_timesets + + Description: + ----------- + Gets the number of timesets used in the model. + + Specification: + ------------- + int USERD_get_number_of_timesets( void ) + + Returns: + ------- + Number of timesets in the model + + Arguments: + --------- + none + + Notes: + ----- + * Num_timesets would be set here + + * If you have a static model, both geometry and variables, you should + return a value of zero. + + * If you have a transient model, then you should return one or more. + + For example: + + Geometry Variables No. of timesets + --------- ------------------------------ --------------- + static static 0 + static transient, all using same timeset 1 + + transient transient, all using same timeset as geom 1 + + static transient, using 3 different timesets 3 + + transient transient, using 3 different timesets and + none of them the same as the + geometry timeset 4 + etc. + + NOTE: ALL GEOMETRY MUST USE THE SAME TIMESET!!! You will have to provide + the timeset number to use + for geometry in: + USERD_get_geom_timeset_number + + Variables can use the same timeset as the geometry, or can use + other timesets. More than one variable can use the same timeset. + + example: changing geometry at 5 steps, 0.0, 1.0, 2.0, 3.0, 4.0 + variable 1 provided at these same five steps + variable 2 provided at 3 steps, 0.5, 1.25, 3.33 + + This routine should return a value of 2, because only + two different timesets are needed. Timeset 1 would be for the + geometry and variable 1 (they both use it). Timeset 2 would + be for variable 2, which needs its own in this case. + + + + + +-------------------------------------------------------------------- +USERD_get_number_of_variables + + Description: + ----------- + Get the number of variables for which you will be providing info. + + Specification: + ------------- + int USERD_get_number_of_variables( void ) + + Returns: + ------- + Number of variables (includes constant, scalar, vector and tensor types) + (>=0 if okay, <0 if problem) + + Arguments: + --------- + none + + Notes: + ----- + ***************************************************************** + * Variable numbers, by which references will be made, are implied + here. If you say there are 3 variables, the variable numbers + will be 1, 2, and 3. + ***************************************************************** + + * Num_variables would be set here + + + +-------------------------------------------------------------------- +USERD_get_part_coords + + Description: + ----------- + Gets the coordinates for an unstructured part. + + Specification: + ------------- + int USERD_get_part_coords(int part_number, float **coord_array) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) part_number = The part number + (1-based index of part table, namely: + + 1 ... Numparts_available. + + It is NOT the part_id that + is loaded in USERD_get_gold_part_build_info) + + (OUT) coord_array = 2D float array which contains, + x,y,z coordinates of each node + in the part. + + (IMPORTANT: The second dimension of this aray is 1-based!!!) + + (Array will have been allocated + 3 by (number_of_nodes + 1) for the part + long - see USERD_get_gold_part_build_info) + + + ex) If number_of_nodes = 100 + as obtained in: + USERD_get_gold_part_build_info + + Then the allocated dimensions of the + pointer sent to this routine will be: + coord_array[3][101] + + Ignore the coord_array[0][0] + coord_array[1][0] + coord_array[2][0] locations and start + the node coordinates at: + coord_array[0][1] + coord_array[1][1] + coord_array[2][1] + + coord_array[0][2] + coord_array[1][2] + coord_array[2][2] + + etc. + + Notes: + ----- + * Not called unless Num_unstructured_parts is > 0 + + * Will be based on Current_time_step + + +-------------------------------------------------------------------- +USERD_get_part_element_ids_by_type + + Description: + ----------- + Gets the ids for the elements of a particular type for an unstructured + or structured part. + + Specification: + ------------- + int USERD_get_part_element_ids_by_type(int part_number, + int element_type, + int *elemid_array) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) part_number = The part number + (1-based index of part table, namely: + + 1 ... Numparts_available. + + It is NOT the part_id that + is loaded in USERD_get_gold_part_build_info) + + (IN) element_type = One of the following (See global_extern.h) + Z_POINT node point element + Z_BAR02 2 node bar + Z_BAR03 3 node bar + Z_TRI03 3 node triangle + Z_TRI06 6 node triangle + Z_QUA04 4 node quad + Z_QUA08 8 node quad + Z_TET04 4 node tetrahedron + Z_TET10 10 node tetrahedron + Z_PYR05 5 node pyramid + Z_PYR13 13 node pyramid + Z_PEN06 6 node pentahedron + Z_PEN15 15 node pentahedron + Z_HEX08 8 node hexahedron + Z_HEX20 20 node hexahedron + + Z_G_POINT ghost node point element + Z_G_BAR02 2 node ghost bar + Z_G_BAR03 3 node ghost bar + Z_G_TRI03 3 node ghost triangle + Z_G_TRI06 6 node ghost triangle + Z_G_QUA04 4 node ghost quad + Z_G_QUA08 8 node ghost quad + Z_G_TET04 4 node ghost tetrahedron + Z_G_TET10 10 node ghost tetrahedron + Z_G_PYR05 5 node ghost pyramid + Z_G_PYR13 13 node ghost pyramid + Z_G_PEN06 6 node ghost pentahedron + Z_G_PEN15 15 node ghost pentahedron + Z_G_HEX08 8 node ghost hexahedron + Z_G_HEX20 20 node ghost hexahedron + + (OUT) elemid_array = 1D array containing id of each + element of the type. + + (Array will have been allocated + number_of_elements of the type long) + + ex) If number_of_elements[Z_TRI03] = 25 + number_of_elements[Z_QUA04] = 100 + number_of_elements[Z_HEX08] = 30 + as obtained in: + USERD_get_gold_part_build_info + + Then the allocated dimensions available + for this routine will be: + conn_array[25] when called with Z_TRI03 + + conn_array[100] when called with Z_QUA04 + + conn_array[30] when called with Z_HEX08 + + Notes: + ----- + * Not called unless element label status is set to TRUE in + USERD_get_element_label_status + + * Will be based on Current_time_step + + + +-------------------------------------------------------------------- +USERD_get_part_elements_by_type + + Description: + ----------- + Gets the connectivities for the elements of a particular type in an + unstructured part + + Specification: + ------------- + int USERD_get_part_elements_by_type(int part_number, + int element_type, + int **conn_array) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) part_number = The part number + (1-based index of part table, namely: + + 1 ... Numparts_available. + + It is NOT the part_id that + is loaded in USERD_get_gold_part_build_info) + + (IN) element_type = One of the following (See global_extern.h) + Z_POINT node point element + Z_BAR02 2 node bar + Z_BAR03 3 node bar + Z_TRI03 3 node triangle + Z_TRI06 6 node triangle + Z_QUA04 4 node quad + Z_QUA08 8 node quad + Z_TET04 4 node tetrahedron + Z_TET10 10 node tetrahedron + Z_PYR05 5 node pyramid + Z_PYR13 13 node pyramid + Z_PEN06 6 node pentahedron + Z_PEN15 15 node pentahedron + Z_HEX08 8 node hexahedron + Z_HEX20 20 node hexahedron + + Z_G_POINT ghost node point element + Z_G_BAR02 2 node ghost bar + Z_G_BAR03 3 node ghost bar + Z_G_TRI03 3 node ghost triangle + Z_G_TRI06 6 node ghost triangle + Z_G_QUA04 4 node ghost quad + Z_G_QUA08 8 node ghost quad + Z_G_TET04 4 node ghost tetrahedron + Z_G_TET10 10 node ghost tetrahedron + Z_G_PYR05 5 node ghost pyramid + Z_G_PYR13 13 node ghost pyramid + Z_G_PEN06 6 node ghost pentahedron + Z_G_PEN15 15 node ghost pentahedron + Z_G_HEX08 8 node ghost hexahedron + Z_G_HEX20 20 node ghost hexahedron + + + (OUT) conn_array = 2D array containing connectivity + of each element of the type. + + (Array will have been allocated + num_of_elements of the type by + connectivity length of the type) + + ex) If number_of_elements[Z_TRI03] = 25 + number_of_elements[Z_QUA04] = 100 + number_of_elements[Z_HEX08] = 30 + as obtained in: + USERD_get_gold_part_build_info + + Then the allocated dimensions available + for this routine will be: + conn_array[25][3] when called with Z_TRI03 + + conn_array[100][4] when called with Z_QUA04 + + conn_array[30][8] when called with Z_HEX08 + + Notes: + ----- + * Not called unless Num_unstructured_parts is > 0 + + * Will be based on Current_time_step + + +-------------------------------------------------------------------- +USERD_get_part_node_ids + + Description: + ----------- + Gets the node ids of an unstructured or structured part. + + Specification: + ------------- + int USERD_get_part_node_ids(int part_number, int *nodeid_array) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) part_number = The part number + (1-based index of part table, namely: + + 1 ... Numparts_available. + + It is NOT the part_id that + is loaded in USERD_get_gold_part_build_info) + + (OUT) nodeid_array = 1D array containing node ids of + each node in the part. + + (IMPORTANT: This array is 1-based!!!) + + (Array will have been allocated + (number_of_nodes + 1) for the part long + see USERD_get_gold_part_build_info) + + ex) If number_of_nodes = 100 + as obtained in: + USERD_get_gold_part_build_info + + Then the allocated dimensions of the + pointer sent to this routine will be: + nodeid_array[101] + + Ignore the nodeid_array[0] location and start + the node ids at: + nodeid_array[1] + + nodeid_array[2] + + etc. + + Notes: + ----- + * Not called unless node label status is TRUE, as returned from + USERD_get_node_label_status + + * Will be based on Current_time_step + + * The ids are purely labels, used when displaying or querying node ids. + However, any node id < 0 will never be displayed + + +-------------------------------------------------------------------- +USERD_get_reader_descrip + + Description: + ----------- + Gets the description of the reader, so gui can give more info + + Specification: + ------------- + int USERD_get_reader_descrip(char descrip[Z_MAXFILENP]) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (OUT) descrip = the description of the reader (max length is MAXFILENP, + which is 255) + + Notes: + ----- + * OPTIONAL ROUTINE! You can have it or not. + + + +-------------------------------------------------------------------- +USERD_get_reader_version + + Description: + ----------- + Gets the version number of the user defined reader + + Specification: + ------------- + int USERD_get_reader_version(char version_number[Z_MAX_USERD_NAME]) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful (and will assume is version 1.0) + + Arguments: + --------- + (OUT) version_number = the version number of the reader + (max length is Z_MAX_USERD_NAME, which + is 20) + + Notes: + ----- + * This needs to be "2.000" or greater. Otherwise EnSight will assume + this reader is API 1.0 + + * should set it to "2.010" for this version of the API + + + + +-------------------------------------------------------------------- +USERD_get_sol_times + + Description: + ----------- + Get the solution times associated with each time step for + desired timeset. + + Specification: + ------------- + int USERD_get_sol_times(int timeset_number, + float *solution_times) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) timeset_number = the timeset number + + For example: If USERD_get_number_of_timesets + returns 2, the valid + timeset_number's would be 1 and 2 + + (OUT) solution_times = 1D array of solution times per time step + + (Array will have been allocated + Num_time_steps[timeset_number] long) + + Notes: + ----- + * The solution times must be non-negative and increasing. + + + +-------------------------------------------------------------------- +USERD_get_timeset_description - + + Description: + ----------- + Get the description to associate with the desired timeset. + + Specification: + ------------- + int USERD_get_timeset_description(int timeset_number, + char timeset_description[Z_BUFL]) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) timeset_number = the timeset number + + For example: If USERD_get_number_of_timesets + returns 2, the valid + timeset_number's would be 1 and 2 + + (OUT) timeset_description = timeset description string + + + Notes: + ----- + * A string of NULLs is valid for timeset_description + + + + +-------------------------------------------------------------------- +USERD_get_var_by_component + + Description: + ----------- + Gets the values of a variable component. Both unstructured and structured + parts use this routine. + + if Z_PER_NODE: + Get the component value at each node for a given variable in the part. + + or if Z_PER_ELEM: + Get the component value at each element of a specific part and type + for a given variable. + + Specification: + ------------- + int USERD_get_var_by_component(int which_variable, + int which_part, + int var_type, + int which_type, + int imag_data, + int component, + float *var_array) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + or: Z_UNDEF, in which case you need not load any values into var_array + + + Arguments: + --------- + (IN) which_variable = The variable number + + (IN) which_part Since EnSight Version 7.4 + ------------------------- + = The part number + + (1-based index of part table, namely: + + 1 ... Numparts_available. + + It is NOT the part_id that + is loaded in USERD_get_gold_part_build_info) + + Prior to EnSight Version 7.4 + ---------------------------- + = The part id This is the part_id label loaded + in USERD_get_gold_part_build_info. + It is NOT the part table index. + + (IN) var_type = Z_SCALAR + Z_VECTOR + Z_TENSOR (symmetric tensor) + Z_TENSOR9 (asymmetric tensor) + + (IN) which_type + + if Z_PER_NODE: Not used + + if Z_PER_ELEM: = The element type + Z_POINT node point element + Z_BAR02 2 node bar + Z_BAR03 3 node bar + Z_TRI03 3 node triangle + Z_TRI06 6 node triangle + Z_QUA04 4 node quad + Z_QUA08 8 node quad + Z_TET04 4 node tetrahedron + Z_TET10 10 node tetrahedron + Z_PYR05 5 node pyramid + Z_PYR13 13 node pyramid + Z_PEN06 6 node pentahedron + Z_PEN15 15 node pentahedron + Z_HEX08 8 node hexahedron + Z_HEX20 20 node hexahedron + + Z_G_POINT ghost node point element + Z_G_BAR02 2 node ghost bar + Z_G_BAR03 3 node ghost bar + Z_G_TRI03 3 node ghost triangle + Z_G_TRI06 6 node ghost triangle + Z_G_QUA04 4 node ghost quad + Z_G_QUA08 8 node ghost quad + Z_G_TET04 4 node ghost tetrahedron + Z_G_TET10 10 node ghost tetrahedron + Z_G_PYR05 5 node ghost pyramid + Z_G_PYR13 13 node ghost pyramid + Z_G_PEN06 6 node ghost pentahedron + Z_G_PEN15 15 node ghost pentahedron + Z_G_HEX08 8 node ghost hexahedron + Z_G_HEX20 20 node ghost hexahedron + + (IN) imag_data = TRUE if imag component + FALSE if real component + + (IN) component = The component: (0 if Z_SCALAR) + (0 - 2 if Z_VECTOR) + (0 - 5 if Z_TENSOR) + (0 - 8 if Z_TENSOR9) + + * 6 Symmetric Indicies, 0:5 * + * ---------------------------- * + * | 11 12 13 | | 0 3 4 | * + * | | | | * + * T = | 22 23 | = | 1 5 | * + * | | | | * + * | 33 | | 2 | * + + + * 9 General Indicies, 0:8 * + * ---------------------------- * + * | 11 12 13 | | 0 3 4 | * + * | | | | * + * T = | 21 22 23 | = | 6 1 5 | * + * | | | | * + * | 31 32 33 | | 7 8 2 | * + + (OUT) var_array + + ----------------------------------------------------------------------- + (IMPORTANT: this array is 1-based for both Z_PER_NODE and Z_PER_ELEM!!!) + ----------------------------------------------------------------------- + + if Z_PER_NODE: = 1D array containing variable component value + for each node. + + (Array will have been allocated + (number_of_nodes + 1) long) + + Info stored in this fashion: + var_array[0] = not used + var_array[1] = var component for node 1 of part + var_array[2] = var_component for node 2 of part + var_array[3] = var_component for node 3 of part + etc. + + if Z_PER_ELEM: = 1D array containing variable component + value for each element of a particular + part and type. + + (Array will have been allocated + (number_of_elements[which_part][which_type] + 1) + long. See USERD_get_gold_part_build_info) + + Info stored in this fashion: + var_array[1] = var component for elem 1 (of part and type) + var_array[2] = var component for elem 2 (of part and type) + var_array[3] = var component for elem 3 (of part and type) + etc. + + Notes: + ----- + * Not called unless Num_variables is > 0 + + * The per_node or per_elem classification must be obtainable from the + variable number (a var_classify array needs to be retained) + + * Will be based on Current_time_step + + * If the variable is not defined for this part, simply return with a + value of Z_UNDEF. EnSight will treat the variable as undefined for + this part. + + +-------------------------------------------------------------------- +USERD_get_var_value_at_specific + + Description: + ----------- + if Z_PER_NODE: + Get the value of a particular variable at a particular node in a + particular part at a particular time. + + or if Z_PER_ELEM: + Get the value of a particular variable at a particular element of + a particular type in a particular part at a particular time. + + + Specification: + ------------- + int USERD_get_var_value_at_specific(int which_var, + int which_node_or_elem, + int which_part, + int which_elem_type, + int time_step, + float values[3], + int imag_data) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) which_var = The variable number + + (IN) which_node_or_elem + + If Z_PER_NODE: + = The node number. This is not the id, but is + the index of the global node + list (1 based), or the block's + node list (1 based). + + Thus, coord_array[1] + coord_array[2] + coord_array[3] + . | + . |which_node_or_elem index + . ---- + + + If Z_PER_ELEM: + = The element number. This is not the id, but is + the element number index + of the number_of_element array + (see USERD_get_gold_part_build_info), + or the block's element list (1 based). + + Thus, for which_part: + conn_array[which_elem_type][0] + conn_array[which_elem_type][1] + conn_array[which_elem_type][2] + . | + . which_node_or_elem index + . ---- + + + (IN) which_part Since EnSight Version 7.4 + ------------------------- + = The part number + + (1-based index of part table, namely: + + 1 ... Numparts_available. + + It is NOT the part_id that + is loaded in USERD_get_gold_part_build_info) + + Prior to EnSight Version 7.4 + ---------------------------- + = The part id This is the part_id label loaded + in USERD_get_gold_part_build_info. + It is NOT the part table index. + + + (IN) which_elem_type + + If Z_PER_NODE, or block part: + = Not used + + If Z_PER_ELEM: + = The element type. This is the element type index + of the number_of_element array + (see USERD_get_gold_part_build_info) + + (IN) time_step = The time step + + (IN) imag_data = TRUE if want imaginary value. + FALSE if want real value. + + (OUT) values = scalar or vector component value(s) + values[0] = scalar or vector[0] + values[1] = vector[1] + values[2] = vector[2] + + + Notes: + ----- + * This routine is used in node querys over time (or element querys over + time for Z_PER_ELEM variables). If these operations are not critical + to you, this can be a dummy routine. + + * The per_node or per_elem classification must be obtainable from the + variable number (a var_classify array needs to be retained) + + * The time step given is for the proper variable timeset. + + +---------------------------------------------------------------------- +USERD_load_matf_data + + Description: + ----------- + Get the material id list, mixed-material id list, or + mixed-material values list for the given material set and part (and + element type if material id list) + + Specification: + ------------- + int USERD_load_matf_data( int set_index, + int part_id, + int wtyp, + int mat_type, + int *ids_list, + float *val_list) + + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) set_index = the material set index (zero based) + + (IN) part_id = the part number desired + + (IN) wtyp = the element type (used for Z_MAT_INDEX only) + + Z_POINT node point element + Z_BAR02 2 node bar + Z_BAR03 3 node bar + Z_TRI03 3 node triangle + Z_TRI06 6 node triangle + Z_QUA04 4 node quad + Z_QUA08 8 node quad + Z_TET04 4 node tetrahedron + Z_TET10 10 node tetrahedron + Z_PYR05 5 node pyramid + Z_PYR13 13 node pyramid + Z_PEN06 6 node pentahedron + Z_PEN15 15 node pentahedron + Z_HEX08 8 node hexahedron + Z_HEX20 20 node hexahedron + Z_NSIDED nsided polygon + Z_NFACED nfaced polyhedron + + Z_G_POINT ghost node point element + Z_G_BAR02 2 node ghost bar + Z_G_BAR03 3 node ghost bar + Z_G_TRI03 3 node ghost triangle + Z_G_TRI06 6 node ghost triangle + Z_G_QUA04 4 node ghost quad + Z_G_QUA08 8 node ghost quad + Z_G_TET04 4 node ghost tetrahedron + Z_G_TET10 10 node ghost tetrahedron + Z_G_PYR05 5 node ghost pyramid + Z_G_PYR13 13 node ghost pyramid + Z_G_PEN06 6 node ghost pentahedron + Z_G_PEN15 15 node ghost pentahedron + Z_G_HEX08 8 node ghost hexahedron + Z_G_HEX20 20 node ghost hexahedron + Z_G_NSIDED ghost nsided polygon + Z_G_NFACED ghost nfaced polyhedron + + (IN) mat_type = Z_MAT_INDEX for material ids list + Z_MIX_INDEX for mixed-material ids list + Z_MIX_VALUE for mixed-material values list + + (OUT) ids_list = If mat_type is Z_MAT_INDEX: + --------------------------- + 1D material id list + (Int array will have been allocated + the appropriate size, as returned in + USERD_size_matf_data for mat_type Z_MAT_INDEX) + + If mat_type is Z_MIX_INDEX: + --------------------------- + 1D mixed-material id list + (Int array will have been allocated + the appropriate size, as returned in + USERD_size_matf_data for mat_type Z_MIX_INDEX) + + (OUT) val_list = 1D mixed-materials values list + (only used if mat_type is Z_MIX_VALUE) + + (Float array will have been allocated + the appropriate size, as returned in + USERD_size_matf_data for mat_type Z_MIX_VALUE) + + Notes: + ----- + * See USERD_get_number_of_material_sets header for explanatory example + * Will not be called if Num_material_sets is zero, + or Num_materials[set_index] is zero, + or the appropriate size from USERD_size_matf_data is zero + + + +-------------------------------------------------------------------- +USERD_set_filenames + + Description: + ----------- + Receives the geometry and result filenames entered in the data + dialog. The user written code will have to store and use these + as needed. The user written code must manage its own files!! + + Specification: + ------------- + int USERD_set_filenames(char filename_1[], + char filename_2[], + char the_path[], + int swapbytes) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) filename_1 = the filename entered into the geometry + field of the data dialog. + + (IN) param_2 = The usage of this string depends on + 'two_fields' in USERD_get_name_of_reader. + + If two_fields is FALSE then it's empty. + + If two_fields is TRUE, this is the + manditory results file entered + into the result field of the data dialog. + + If two_fields is -1, then this contains + optional text (filenames, modifiers, etc.) + that can be parsed and used to modify + reader + + (IN) the_path = the path info from the data dialog. + Note: filename_1 and filename_2 have already + had the path prepended to them. This + is provided in case it is needed for + filenames contained in one of the files + + (IN) swapbytes = TRUE if should swap bytes when reading data. + = FALSE normally. + + Notes: + ----- + * Since you must manage everything from the input that is entered in + these data dialog fields, this is an important routine! + + * It may be that you will need to have an executive type file that contains + info and other filenames within it, like EnSight6's case file. + + +-------------------------------------------------------------------- +USERD_set_server_number + + Description: + ----------- + Receives the server number of how many total servers. + + Specification: + ------------- + int USERD_set_server_number(int cur_serv, + int tot_servs) + + Returns: + ------- + nothing + + Arguments: + --------- + (IN) cur_serv = the current server. + + (IN) tot_servs = the total number of servers. + + Notes: + ----- + * Only useful if your user defined reader is being used with EnSight's + Server-of-Server capability. And even then, it may or may not be + something that you can take advantage of. If your data is already + partitioned in some manner, such that you can access the proper + portions using this information. + + For all non-SOS uses, this will simply be 1 of 1 + + + +-------------------------------------------------------------------- +USERD_set_time_set_and_step + + Description: + ----------- + Set the current time step in the desired timeset. All functions that + need time, and that do not explicitly pass it in, will use the timeset + and step set by this routine, if needed. + + Specification: + ------------- + void USERD_set_time_set_and_step(int timeset_number, + int time_step) + + Returns: + ------- + nothing + + Arguments: + --------- + (IN) timeset_number = the timeset number (1 based). + + For example: If USERD_get_number_of_timesets + returns 2, the valid timeset_number's + would be 1 and 2. + + (IN) time_step = The current time step to set + + Notes: + ----- + * Current_time_step and Current_timeset would be set here + + +-------------------------------------------------------------------- +USERD_size_matf_data + + Description: + ----------- + Get the length of the material id list, mixed-material id list, or + mixed-material values list for the given material set and part (and + element type if material id list) + + Specification: + ------------- + int USERD_size_matf_data( int set_index, + int part_id, + int wtyp, + int mat_type, + int *matf_size) + + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (IN) set_index = the material set index (zero based) + + (IN) part_id = the part number desired + + (IN) wtyp = the element type (used for Z_MAT_INDEX only) + + Z_POINT node point element + Z_BAR02 2 node bar + Z_BAR03 3 node bar + Z_TRI03 3 node triangle + Z_TRI06 6 node triangle + Z_QUA04 4 node quad + Z_QUA08 8 node quad + Z_TET04 4 node tetrahedron + Z_TET10 10 node tetrahedron + Z_PYR05 5 node pyramid + Z_PYR13 13 node pyramid + Z_PEN06 6 node pentahedron + Z_PEN15 15 node pentahedron + Z_HEX08 8 node hexahedron + Z_HEX20 20 node hexahedron + Z_NSIDED nsided polygon + Z_NFACED nfaced polyhedron + + Z_G_POINT ghost node point element + Z_G_BAR02 2 node ghost bar + Z_G_BAR03 3 node ghost bar + Z_G_TRI03 3 node ghost triangle + Z_G_TRI06 6 node ghost triangle + Z_G_QUA04 4 node ghost quad + Z_G_QUA08 8 node ghost quad + Z_G_TET04 4 node ghost tetrahedron + Z_G_TET10 10 node ghost tetrahedron + Z_G_PYR05 5 node ghost pyramid + Z_G_PYR13 13 node ghost pyramid + Z_G_PEN06 6 node ghost pentahedron + Z_G_PEN15 15 node ghost pentahedron + Z_G_HEX08 8 node ghost hexahedron + Z_G_HEX20 20 node ghost hexahedron + Z_G_NSIDED ghost nsided polygon + Z_G_NFACED ghost nfaced polyhedron + + (IN) mat_type = Z_MAT_INDEX for material ids list + Z_MIX_INDEX for mixed-material ids list + Z_MIX_VALUE for mixed-material values list + + (OUT) matf_size = the length of the material id list, or + mixed-material id list, or + mixed-material values list + for the given material set and part number + (and element type if Z_MAT_INDEX) + + Notes: + ----- + * See USERD_get_number_of_material_sets header for explanatory example + * Will not be called if Num_material_sets is zero, or + Num_materials[set_index] is zero + + + + +-------------------------------------------------------------------- +USERD_stop_part_building + + Description: + ----------- + This routine called when the part building dialog is closed. It is + provided in case you desire to release memory, etc. that was only needed + during the part building process. + + Specification: + ------------- + void USERD_stop_part_building( void ) + + Returns: + ------- + nothing + + Arguments: + --------- + none + + Notes: + ----- + +-------------------------------------------------------------------- +USERD_rigidbody_existence + + Description: + ----------- + Gets the existence of rigid body values or not in the model + + Specification: + ------------- + int USERD_rigidbody_existence( void ) + + Returns: + ------- + Z_OK if rigid body values exist for the model + Z_UNDEF if no rigid body values exist + Z_ERR if an error + + Arguments: + --------- + none + + Notes: + ----- + * This will be based on Current_time_step + + +-------------------------------------------------------------------- +USERD_rigidbody_values + + Description: + ----------- + Gets the rigid body values for each part + + Specification: + ------------- + int USERD_rigidbody_values(int part_number, + float values[14]) + + Returns: + ------- + Z_OK if rigid body values exist for the model + Z_UNDEF if no rigid body values exist + Z_ERR if an error + + Arguments: + --------- + (IN) part_number = The part number + + (1-based index of part table, namely: + + 1 ... Numparts_available. + + It is NOT the part_id that + is loaded in USERD_get_gold_part_build_info) + + (OUT) values values[0] = IX (x location) + values[1] = IY (y location) + values[2] = IZ (z location) + values[3] = E0 (e0 euler value) + values[4] = E1 (e1 euler value) + values[5] = E2 (e2 euler value) + values[6] = E3 (e3 euler value) + + The next 3 are for an optional cg offset. If none is + needed or desired (namely the first 7 values above + contain all that is needed), then these should be + set to 0.0 + + values[7] = xoff (initial cg x offset) + values[8] = yoff (initial cg y offset) + values[9] = z0ff (initial cg z offset) + + The next 4 values are for and optional initial yaw, pitch, roll + operation. This is useful to get parts from one + standard layout to a different standard layout. + (example, flex body parts computed in an axis system + different than that of rigid body parts manipulation) + If not needed or desired, set these to 0.0 + + values[10] = rot_order (order the roations are applied + 0.0 = no rotations + 1.0 = xyz order + 2.0 = xzy order + 3.0 = yxz order + 4.0 = yzx order + 5.0 = zxy order + 6.0 = zyx order) + values[11] = xrot (initial x rotation - degrees) + values[12] = yrot (initial y rotation - degrees) + values[13] = zrot (initial z rotation - degrees) + + Notes: + ----- + * This will be based on Current_time_step + * It will not be called unless USERD_rigidbody_existence indicates + that there are some values in the model by returning Z_OK. + * Order that transformations will be applied is: + 1. The yaw,pitch,roll rotations, if present (values[11] through values[13] + in the order specified in rot_order, values[10]) + 2. The cg offsets, if present (values[7] through values[9]) + 3. The euler parameter rotations (values[3] through values[6]) + 4. The translations (values[0] through values[2]) + +-------------------------------------------------------------------- +USERD_set_right_side + + Description: + ----------- + Informs the reader that the time currently set is the right side of a time + span used for variable interpolation between time steps + + Specification: + ------------- + void USERD_set_right_side( void ) + + Returns: + ------- + + Arguments: + --------- + none + + Notes: + ----- + * Applies to Current_time_step + + + + + +------------------------------------------------------------------ + ENHANCED GUI ROUTINES + +-------------------------------------------------------------------- +USERD_get_extra_gui_numbers + + Description: + ----------- + The Enhanced GUI routines are added to allow + the user to customize a portion of the Data + Reader dialog to pass in options to their + user defined reader. + + Specification: + ------------- + void USERD__get_extra_gui_numbers(int *num_Toggles, + int *num_pulldowns, + int *num_fields) + + Returns: + ------- + + Arguments: + --------- + (OUT) num_Toggles = number of toggles that will be provided + + num_pulldowns = number of pulldowns that will be provided + + num_fields = number of fields that will be provided + + Notes: + ----- + There are three routines that work together: + USERD_get_extra_gui_numbers + USERD_get_extra_gui_defaults + USERD_set_extra_gui_data + + The existence of these routine indicates that + you wish to add customize entries to the + Data Reader dialog. + + If you don't want the extra GUI features, + simply delete these routines, or change their + names to something such as + USERD_DISABLED_get_extra_gui_defaults + + The presence of these routines + will ensure that EnSight will call them and + use their data to modify the extraction parameters set + with some or all of the following: + toggles, pulldown menu and fields. + + The user can then interact with the enhanced + GUI and then send their choices to + USERD_set_extra_gui_data + + Therefore if USERD_get_extra_gui_numbers + exists then the other two must exist. + + If none exist, then the GUI will be unchanged. + + Toggle data will return an integer + TRUE if checked + FALSE if unchecked + + Pulldown menu will return an integer representing + the menu item selected + + Field will return a string Z_LEN_GUI_FIELD_STR long. + + If all the enhanced GUI features are enabled it + might look something like this + + =================================================== + [] Title 1 [X] Title 3 + [X]Title 2 [X] Title 4 + + Pulldown Menu -> + Menu Choice 1 + Menu Choice 2 + Menu Choice 3 + + Data Field Title 1 ____________________________ + + Data Field Title 2 ____________________________ + ===================================================== + + This routine defines the numbers of toggles, pulldowns & fields + + The following are defined in the global_extern.h + Z_MAX_NUM_GUI_PULL_ITEMS max num GUI pulldowns + Z_LEN_GUI_PULL_STR max length of GUI pulldown string + Z_LEN_GUI_FIELD_STR max length of field string + Z_LEN_GUI_TITLE_STR max length of title string + + The library is loaded, this routine is + called, then the library is unloaded. + + Do not define globals in this routine + as when the library is unloaded, you'll + lose them. + + +-------------------------------------------------------------------- +USERD_get_extra_gui_defaults + + Description: + ----------- + This routine defines the Titles, status, + List choices, strings, etc that are fed + up to the GUI. + + Specification: + ------------- + int USERD_get_extra_gui_defaults(char **toggle_Title, + int *toggle_default_status, + char **pulldown_Title, + int *pulldown_number_in_list, + int *pulldown_default_selection, + char ***pulldown_item_strings, + char **field_Title, + char **field_user_string) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (OUT) toggle_Title = title for each toggle + array dimension is [num_toggles] by + [Z_LEN_GUI_TITLE_STR] long + + toggle_default_status = Setting for each toggle (TRUE or FALSE) + array dimension is [num_toggles] long + + pulldown_Title = title for each pulldown + array dimension is [num_pulldowns] by + [Z_LEN_GUI_TITLE_STR] long + + pulldown_number_in_list = number of items in each pulldown + array dimension is [num_pulldowns] long + + pulldown_default_selection = pulldown item selection for each pulldown + array dimension is [num_pulldowns] long + + pulldown_item_strings = pulldown item strings + array is [num_pulldowns] by + [Z_MAX_NUM_GUI_PULL_ITEMS] by + [Z_LEN_GUI_PULL_STR] long + + field_Title = title for each field + array dimension is [num_fields] by + [Z_LEN_GUI_TITLE_STR] long + + field_user_string = content of the field + array dimension is [num_fields] by + [Z_LEN_GUI_TITLE_STR] long + + + + Notes: + ----- + * The library is loaded, this routine is called, then the library is unloaded. + + * Do not define globals in this routine as when the library is unloaded, you'll + lose them. + + + +-------------------------------------------------------------------- +USERD_set_extra_gui_data + + Description: + ----------- + This routine sets the new values for the toggles, pulldowns, and fields. + + Specification: + ------------- + void USERD_set_extra_gui_data( + int *toggle, /* [num_toggle] */ + int *pulldown, /* [num_pulldown] */ + char **field_text /* [num_fields][Z_LEN_GUI_FIELD_STR]*/) + + Returns: + ------- + + Arguments: + --------- + (IN) toggle = setting for each toggle. TRUE or FALSE + array dimension is [num_toggles] long + + pulldown = item chosen in each pulldown. (0 based) + array dimension is [num_pulldowns] long + + field_text = content of the field + array dimension is [num_fields] by + [Z_LEN_GUI_TITLE_STR] long + + + Notes: + ----- + * This routine is called when the library is permanently + loaded to the EnSight session, so define your globals + in this and later routines. + + * It's up to you to change your reader behavior according to + user entries! + + + +-------------------------------------------------------------------- +USERD_get_var_extract_gui_numbers + + Description: + ----------- + The Var_Extract_GUI routines are added to allow + the user to customize a extraction parameters + for variables "after" the file has been read. + These things can be modified and the variables will + be update/refreshed according to the new parameters set + + Specification: + ------------- + void USERD_get_var_extract_gui_numbers(int *num_Toggles, + int *num_pulldowns, + int *num_fields) + + + Returns: + ------- + + Arguments: + --------- + (OUT) num_Toggles = number of toggles that will be provided + + num_pulldowns = number of pulldowns that will be provided + + num_fields = number of fields that will be provided + + Notes: + ----- + There are three routines that work together: + USERD_get_var_extract_gui_numbers + USERD_get_var_extract_gui_defaults (this one) + USERD_set_var_extract_gui_data + + The existence of these routine indicates that + you wish to have the Var Extract Parameters dialog. + + If you don't want the extra GUI features, + simply delete these routines, or change their + names to something such as + USERD_DISABLED_get_var_extract_gui_defaults + + The presence of these routines + will ensure that EnSight will call them and + use their data to modify the extraction parameters set + with some or all of the following: + toggles, pulldown menu and fields. + + The user can then interact with the enhanced + GUI and then send their choices to + USERD_set_extra_gui_data + + Therefore if USERD_get_var_extract_gui_numbers + exists then the other two must exist. + + If none exist, then the GUI will be unchanged. + + Toggle data will return an integer + TRUE if checked + FALSE if unchecked + + Pulldown menu will return an integer representing + the menu item selected + + Field will return a string Z_LEN_GUI_FIELD_STR long. + + If all the enhanced GUI features are enabled it + might look something like this + + =================================================== + [] Title 1 [X] Title 3 + [X]Title 2 [X] Title 4 + + Pulldown Menu -> + Menu Choice 1 + Menu Choice 2 + Menu Choice 3 + + Data Field Title 1 ____________________________ + + Data Field Title 2 ____________________________ + ===================================================== + + This routine defines the numbers of toggles, pulldowns & fields + + The following are defined in the global_extern.h + Z_MAX_NUM_GUI_PULL_ITEMS max num GUI pulldowns + Z_LEN_GUI_PULL_STR max length of GUI pulldown string + Z_LEN_GUI_FIELD_STR max length of field string + Z_LEN_GUI_TITLE_STR max length of title string + + The library is loaded, this routine is + called, then the library is unloaded. + + Do not define globals in this routine + as when the library is unloaded, you'll + lose them. + + +-------------------------------------------------------------------- +USERD_get_var_extract_gui_defaults + + Description: + ----------- + This routine defines the Titles, status, + List choices, strings, etc that are fed + up to the GUI. + + Specification: + ------------- + int USERD_get_var_extract_gui_defaults(char **toggle_Title, + int *toggle_default_status, + char **pulldown_Title, + int *pulldown_number_in_list, + int *pulldown_default_selection, + char ***pulldown_item_strings, + char **field_Title, + char **field_user_string) + + Returns: + ------- + Z_OK if successful + Z_ERR if not successful + + Arguments: + --------- + (OUT) toggle_Title = title for each toggle + array dimension is [num_toggles] by + [Z_LEN_GUI_TITLE_STR] long + + toggle_default_status = Setting for each toggle (TRUE or FALSE) + array dimension is [num_toggles] long + + pulldown_Title = title for each pulldown + array dimension is [num_pulldowns] by + [Z_LEN_GUI_TITLE_STR] long + + pulldown_number_in_list = number of items in each pulldown + array dimension is [num_pulldowns] long + + pulldown_default_selection = pulldown item selection for each pulldown + array dimension is [num_pulldowns] long + + pulldown_item_strings = pulldown item strings + array is [num_pulldowns] by + [Z_MAX_NUM_GUI_PULL_ITEMS] by + [Z_LEN_GUI_PULL_STR] long + + field_Title = title for each field + array dimension is [num_fields] by + [Z_LEN_GUI_TITLE_STR] long + + field_user_string = content of the field + array dimension is [num_fields] by + [Z_LEN_GUI_TITLE_STR] long + + + + Notes: + ----- + * The library is loaded, this routine is called, then the library is unloaded. + + * Do not define globals in this routine as when the library is unloaded, you'll + lose them. + + + +-------------------------------------------------------------------- +USERD_set_var_extract_gui_data + + Description: + ----------- + This routine sets the new values for the toggles, pulldowns, and fields. + + Specification: + ------------- + void USERD_set_var_extract_gui_data( + int *toggle, /* [num_toggle] */ + int *pulldown, /* [num_pulldown] */ + char **field_text /* [num_fields][Z_LEN_GUI_FIELD_STR]*/) + + Returns: + ------- + + Arguments: + --------- + (IN) toggle = setting for each toggle. TRUE or FALSE + array dimension is [num_toggles] long + + pulldown = item chosen in each pulldown. (0 based) + array dimension is [num_pulldowns] long + + field_text = content of the field + array dimension is [num_fields] by + [Z_LEN_GUI_TITLE_STR] long + + + Notes: + ----- + * This routine is called when the library is permanently + loaded to the EnSight session, so define your globals + in this and later routines. + + * It's up to you to change your reader behavior according to + user entries! + + + + + +----------------------------------------------------------------------------------- +/* ---------------------------------------------------------- + * New in EnSight 8 is the capability to remove (fail) elements + * based on variable threshold values. Basically the variable + * name, a couple of thresholds, a couple of values and a logic + * criteria are read in from this routine. Every element that + * satisfies the failure criteria is removed and not used in + * EnSight calculations. + * + * Example Failure criteria + * Let fail_var_name = "fail_flag" + * threshold_val1 = 0 + * threshold_operator1 = Z_EQUAL_TO + * logic_criteria2 not used + * threshold_val2 not used + * threshold_operator2 not used + * For each value of "fail_flag" at each element, + * if fail flag == threshold_val1 (0.0) then element fails + * Return (Z_ERR) if this is not used. + * Return (Z_OK) if failed element feature should be used + * + * threshold_operator1 & 2 can be one of the following + * Z_ELE_FAILED_NONE, - disables checking + * Z_ELE_FAILED_GREATER, - greater than + * Z_ELE_FAILED_LESS, - less than + * Z_ELE_FAILED_EQUAL, - equal + * Z_ELE_FAILED_NOT_EQUAL, - not equal + * Z_ELE_FAILED_MANY - not used + * + * logic_criteria2 + * Z_ELE_FAILED_LOGIC_NONE, + * Z_ELE_FAILED_LOGIC_AND, + * Z_ELE_FAILED_LOGIC_OR, + * Z_ELE_FAILED_LOGIC_MANY + * + * ---------------------------------------------------------- */ +int USERD_get_uns_failed_params( + char *fail_var_name, /* variable name to be used in failure + must be scalar, per elem */ + float *threshold_val1, /* number to compare for failure */ + float *threshold_val2, /* number to compare for failure */ + int *threshold_operator1, /* Z_GREATER_THAN, Z_LESS_THAN, + Z_EQUAL_TO */ + int *threshold_operator2, /* Z_GREATER_THAN, Z_LESS_THAN, + Z_EQUAL_TO */ + int *logic_criteria2 + + +/*-------------------------------------------------------------------- + * USERD_get_structured_reader_cinching - + *-------------------------------------------------------------------- + * + * Gets whether this reader will do structured cinching for block data + * This means that it will handle the min, max, and step values for a + * given block and return the coordinate components or variable components + * in their "cinched" state when partial extraction or striding is used. + * This is as opposed to returning the entire component (ignoring min, max + * and stride) and letting Ensight pick out the values actually used. + * + * returns: Z_OK if the reader will handle the + * min, max, and stride and return + * the cinched values only. + * + * Z_UNDEF or Z_ERR if will return entire component + * and rely on EnSight to cinch. + * + * Notes: + * Unless you can actually pull out the desired min, max, and stride + * without using a full component of memory, don't enable this feature. + *--------------------------------------------------------------------*/ +int +USERD_get_structured_reader_cinching( void ) + + + +/*-------------------------------------------------------------------- + * USERD_set_block_range_and_stride - + *-------------------------------------------------------------------- + * + * Sets the min, max, and step values in each of the i, j, and k, directions + * for the given part. + * + * (IN) part_number = The part number + * + * (1-based index of part table, namely: + * + * 1 ... Numparts_available. + * + * It is NOT the part_id that + * is loaded in + * USERD_get_gold_part_build_info) + * + * (IN) mini = min i plane desired (zero based) + * maxi = max i plane desired (zero based) + * stepi = i stride + * minj = min j plane desired (zero based) + * maxj = max j plane desired (zero based) + * stepj = j stride + * mink = min k plane desired (zero based) + * maxk = max k plane desired (zero based) + * stepk = k stride + * + * + * returns: Z_OK if no problems + * Z_ERR if an error + * + * Notes: + * * It will not be called unless USERD_get_structured_reader_cinching + * indicates that this reader does structured cinching by returning + * a Z_OK. + * + * * It will actually be called before each geom component and before + * each part variable - so if you are storing things locally, you should + * make this routine be able to quickly check whether anything needs + * updated or not. + * + * * If the stride (step) does not hit right on the max, the last element + * in each direction will be shortened appropriately. + * For example, if a block had 0 to 12 in the i direction, + * and the user specified min = 1 + * max = 8 + * step = 3 + * + * 0 1 2 3 4 5 6 7 8 9 10 11 12 + * | | | | | | | | | | | | | + * + * | | | | + * + * Namely, the coarser cell boundaries in this direction would be at 1, 4, +7, and 8 + * + *--------------------------------------------------------------------*/ +int +USERD_set_block_range_and_stride(int part_number, + int mini, int maxi, int stepi, + int minj, int maxj, int stepj, + int mink, int maxk, int stepk) + + + +---- end of document ---- diff --git a/applications/utilities/postProcessing/graphics/ensightFoamReader/README_USERD_IN_BUFFERS b/applications/utilities/postProcessing/graphics/ensightFoamReader/README_USERD_IN_BUFFERS new file mode 100644 index 0000000000..8b80e6a645 --- /dev/null +++ b/applications/utilities/postProcessing/graphics/ensightFoamReader/README_USERD_IN_BUFFERS @@ -0,0 +1,1447 @@ +README_USERD_IN_BUFFERS +======================== +Five optional routines for normal elements, + + USERD_get_part_coords_in_buffers | + USERD_get_part_node_ids_in_buffers | + USERD_get_part_elements_by_type_in_buffers |If any of these are implemented, + USERD_get_part_element_ids_by_type_in_buffers |all 5 of them must be implemented + USERD_get_var_by_component_in_buffers | + + + +one optional routine for nsided elements, + + USERD_get_nsided_conn_in_buffers + + + +and one optional routine for nfaced elements, + + USERD_get_nfaced_conn_in_buffers + + +can be added into any API 2.* reader to be used by the +Unstructured Auto Distribute capability in EnSight 8.2 and later. + +Unstructured Auto Distribute is a capability requiring Server of Servers (SOS) +that will partition an unstructured model for you automatically across a set of +servers. + +If you do not implement the routines listed above (and described below) in your +reader, EnSight can still perform this operation but will require much more memory on +each server to read in the data (somewhat like each server having to read the +whole model). You will however, get the execution advantage of having your model +partitioned across multiple servers. + +If you do implement these routines in your reader (in a proper manner), you +should be able to not only get the execution advantages, but also memory usage +on each server which is proportional to the subset that it is assigned to deal with. + + +Note that the optional routines are functionally quite similar +to the following functions. And thus their implementation should +not be too difficult to add to any existing reader that has already +implemented these: +------------------------------------------ +USERD_get_part_coords +USERD_get_part_node_ids +USERD_get_part_elements_by_type +USERD_get_part_element_ids_by_type +USERD_get_var_by_component + +USERD_get_nsided_conn + +USERD_get_nfaced_conn + + + +Routine Details: +================ + +/*-------------------------------------------------------------------- + * USERD_get_part_coords_in_buffers - + *-------------------------------------------------------------------- + * + * Get the coordinates for an unstructured part in buffers. + * + * (IN) part_number = The part number + * + * (1-based index of part table, namely: + * + * 1 ... Numparts_available. + * + * It is NOT the part_id that + * is loaded in USERD_get_gold_part_build_info) + * + * (IN) first = TRUE if first invocation of a buffered set. + * Will be FALSE for all subsequent invocations + * of the set. This is so you can open files, get to + * the correct starting spot, initialize, etc. + * + * (IN) n_beg = Zero based, first node index + * of the buffered set + * + * (IN) n_end = Zero based, last node index + * of the buffered set + * + * Thus, for first five nodes: + * n_beg = 0 + * n_end = 4 + * total_number = (n_end - n_beg) + 1 = (4 - 0) + 1 = 5 + * + * for second five nodes, would be: + * n_beg = 5 + * n_end = 9 + * total_number = (n_end - n_beg) + 1 = (9 - 5) + 1 = 5 + * + * for all nodes of a part, would be: + * n_beg = 0 + * n_end = num_nodes - 1 + * + * (IN) buffer_size = The size of the buffer. + * Namely: coord_array[3][buffer_size] + * + * (OUT) coord_array = 2D float buffer array which is set up to hold + * x,y,z coordinates of nodes. + * + * (IMPORTANT: the second dimension of of this array is 0-based!!!) + * + * (IMPORTANT: in the sister routine (USERD_get_part_coords) - which + * does not use buffers. This array is 1-based. So pay attention.) + * + * (Array will have been allocated + * 3 by buffer_size long + * + * Example, if we had a part with 645 nodes and the buffer size was set to 200 + * + * first invocation: + * first = TRUE Will be TRUE the first time! + * n_beg = 0 + * n_end = 644 + * buffer_size = 200 + * coord_array[3][200] fill with values for nodes 1 - 200 (zero-based) + * *num_returned = 200 set this + * return(0) return this (indicates more to do) + * + * second invocation: which occurs because we returned a 0 last time + * first = FALSE will now be FALSE + * n_beg = 0 + * n_end = 644 + * buffer_size = 200 + * coord_array[3][200] fill with values for nodes 201 - 400 (zero-based) + * *num_returned = 200 set this + * return(0) return this (indicates more to do) + * + * third invocation: which occurs because we returned a 0 last time + * first = FALSE will still be FALSE + * n_beg = 0 + * n_end = 644 + * buffer_size = 200 + * coord_array[3][200] fill with values for nodes 401 - 600 (zero-based) + * *num_returned = 200 set this + * return(0) return this (indicates more to do) + * + * fourth invocation: which occurs because we returned a 0 last time + * first = FALSE will still be FALSE + * n_beg = 0 + * n_end = 644 + * buffer_size = 200 + * coord_array[3][200] fill with values for nodes 601 - 645 (zero-based) + * *num_returned = 45 set this + * return(1) return this (indicates done!) + * + * (OUT) *num_returned = The number of nodes whose coordinates are returned + * in the buffer. This will normally be equal to + * buffer_size except for that last buffer - + * which could be less than a full buffer. + * + * returns 0 if got some, more to do + * 1 if got some, done + * -1 if an error + * + * Notes: + * * This will be based on Current_time_step + * + * * Not called unless number_of_nodes for the part > 0 + * + * * Again, make sure each buffer is zero based. For our example above: + * + * Invocation: + * 1 2 3 4 + * ------- ------- -------- ------- + * coord_array[0][0] x for node 1 node 201 node 401 node 601 + * coord_array[1][0] y for " " " " + * coord_array[2][0] z for " " " " + * + * coord_array[0][1] x for node 2 node 202 node 402 node 602 + * coord_array[1][1] y for " " " " + * coord_array[2][1] z for " " " " + * + * ... + * + * coord_array[0][199] x for node 200 node 400 node 600 node 645 + * coord_array[1][199] y for " " " " + * coord_array[2][199] z for " " " " + *--------------------------------------------------------------------*/ +int +USERD_get_part_coords_in_buffers(int part_number, + float **coord_array, + int first, + int n_beg, + int n_end, + int buffer_size, + int *num_returned) + + + + + +/*-------------------------------------------------------------------- + * USERD_get_part_node_ids_in_buffers - + *-------------------------------------------------------------------- + * + * Get the node ids for an unstructured part in buffers. + * + * (IN) part_number = The part number + * + * (1-based index of part table, namely: + * + * 1 ... Numparts_available. + * + * It is NOT the part_id that + * is loaded in USERD_get_gold_part_build_info) + * + * (IN) first = TRUE if first invocation of a buffered set. + * Will be FALSE for all subsequent invocations + * of the set. This is so you can open files, get to + * the correct starting spot, initialize, etc. + * + * (IN) n_beg = Zero based, first node index + * of the buffered set + * + * (IN) n_end = Zero based, last node index + * of the buffered set + * + * Thus, for first five nodes: + * n_beg = 0 + * n_end = 4 + * total_number = (n_end - n_beg) + 1 = (4 - 0) + 1 = 5 + * + * for second five nodes, would be: + * n_beg = 5 + * n_end = 9 + * total_number = (n_end - n_beg) + 1 = (9 - 5) + 1 = 5 + * + * for all nodes of a part, would be: + * n_beg = 0 + * n_end = num_nodes - 1 + * + * (IN) buffer_size = The size of the buffer. + * Namely: nodeid_array[buffer_size] + * + * (OUT) nodeid_array = 1D buffer array which is set up to hold + * node ids of nodes + * + * (IMPORTANT: this array is 0-based!!!) + * + * (IMPORTANT: in the sister routine (USERD_get_part_node_ids) - which + * does not use buffers. This array is 1-based. So pay attention.) + * + * (Array will have been allocated + * buffer_size long) + * + * Example, if we had a part with 645 nodes and the buffer size was set to 200 + * + * first invocation: + * first = TRUE Will be TRUE the first time! + * n_beg = 0 + * n_end = 644 + * buffer_size = 200 + * nodeid_array[200] fill with values for nodes 1 - 200 (zero-based) + * *num_returned = 200 set this + * return(0) return this (indicates more to do) + * + * second invocation: which occurs because we returned a 0 last time + * first = FALSE will now be FALSE + * n_beg = 0 + * n_end = 644 + * buffer_size = 200 + * nodeid_array[200] fill with values for nodes 201 - 400 (zero-based) + * *num_returned = 200 set this + * return(0) return this (indicates more to do) + * + * third invocation: which occurs because we returned a 0 last time + * first = FALSE will still be FALSE + * n_beg = 0 + * n_end = 644 + * buffer_size = 200 + * nodeid_array[200] fill with values for nodes 401 - 600 (zero-based) + * *num_returned = 200 set this + * return(0) return this (indicates more to do) + * + * fourth invocation: which occurs because we returned a 0 last time + * first = FALSE will still be FALSE + * n_beg = 0 + * n_end = 644 + * buffer_size = 200 + * nodeid_array[200] fill with values for nodes 601 - 645 (zero-based) + * *num_returned = 45 set this + * return(1) return this (indicates done!) + * + * + * (OUT) *num_returned = The number of nodes whose ids are returned + * in the buffer. This will normally be equal + * to buffer_size except for that last buffer + * - which could be less than a full buffer. + * + * returns 0 if got some, more to do + * 1 if got some, done + * -1 if an error + * + * Notes: + * * This will be based on Current_time_step + * + * * Not called unless number_of_nodes for the part > 0 + * + * * Again, make sure each buffer is zero based. For our example above: + * + * Invocation: + * 1 2 3 4 + * ------- ------- -------- ------- + * nodeid_array[0] id for node 1 node 201 node 401 node 601 + * + * nodeid_array[1] id for node 2 node 202 node 402 node 602 + * + * ... + * + * nodeid_array[199] id for node 200 node 400 node 600 node 645 + *--------------------------------------------------------------------*/ +int +USERD_get_part_node_ids_in_buffers(int part_number, + int *nodeid_array, + int first, + int n_beg, + int n_end, + int buffer_size, + int *num_returned) + + + + +/*-------------------------------------------------------------------- + * USERD_get_part_elements_by_type_in_buffers - + *-------------------------------------------------------------------- + * + * Gets the connectivities for the elements of a particular type + * in an unstructured part in buffers + * + * (IN) part_number = The part number + * + * (1-based index of part table, namely: + * + * 1 ... Numparts_available. + * + * It is NOT the part_id that + * is loaded in USERD_get_gold_part_build_info) + * + * (IN) element_type = One of the following (See global_extern.h) + * Z_POINT node point element + * Z_BAR02 2 node bar + * Z_BAR03 3 node bar + * Z_TRI03 3 node triangle + * Z_TRI06 6 node triangle + * Z_QUA04 4 node quad + * Z_QUA08 8 node quad + * Z_TET04 4 node tetrahedron + * Z_TET10 10 node tetrahedron + * Z_PYR05 5 node pyramid + * Z_PYR13 13 node pyramid + * Z_PEN06 6 node pentahedron + * Z_PEN15 15 node pentahedron + * Z_HEX08 8 node hexahedron + * Z_HEX20 20 node hexahedron + * + * Starting at API 2.01: + * ==================== + * Z_G_POINT ghost node point element + * Z_G_BAR02 2 node ghost bar + * Z_G_BAR03 3 node ghost bar + * Z_G_TRI03 3 node ghost triangle + * Z_G_TRI06 6 node ghost triangle + * Z_G_QUA04 4 node ghost quad + * Z_G_QUA08 8 node ghost quad + * Z_G_TET04 4 node ghost tetrahedron + * Z_G_TET10 10 node ghost tetrahedron + * Z_G_PYR05 5 node ghost pyramid + * Z_G_PYR13 13 node ghost pyramid + * Z_G_PEN06 6 node ghost pentahedron + * Z_G_PEN15 15 node ghost pentahedron + * Z_G_HEX08 8 node ghost hexahedron + * Z_G_HEX20 20 node ghost hexahedron + * Z_NSIDED n node ghost nsided polygon + * Z_NFACED n face ghost nfaced polyhedron + * + * Starting at API 2.02: + * ==================== + * Z_NSIDED n node nsided polygon + * Z_NFACED n face nfaced polyhedron + * Z_G_NSIDED n node ghost nsided polygon + * Z_G_NFACED n face ghost nfaced polyhedron + * + * (IN) first = TRUE if first invocation of a buffered set. + * Will be FALSE for all subsequent invocations + * of the set. This is so you can open files, get to + * the correct starting spot, initialize, etc. + * + * (IN) e_beg = Zero based, first element number + * of the buffered set + * + * (IN) e_end = Zero based, last element number + * of the buffered set + * + * Thus, for first five elements of a type: + * e_beg = 0 + * e_end = 4 + * total_number = (e_end - e_beg) + 1 = (4 - 0) + 1 = 5 + * + * for second five elements of a type, would be: + * e_beg = 5 + * e_end = 9 + * total_number = (e_end - e_beg) + 1 = (9 - 5) + 1 = 5 + * + * for all elements of the type of a part, would be: + * n_beg = 0 + * n_end = num_elements_of_type - 1 + * + * (IN) buffer_size = The size of the buffer. + * Namely: conn_array[buffer_size][element_size] + * + * (OUT) conn_array = 2D buffer array which is set up to hold + * connectivity of elements of the type. + * + * (Array will have been allocated + * buffer_size of + * the type by connectivity length + * of the type) + * + * ex) The allocated dimensions available + * for this routine will be: + * conn_array[buffer_size][3] when called with Z_TRI03 + * + * conn_array[buffer_size][4] when called with Z_QUA04 + * + * conn_array[buffer_size][8] when called with Z_HEX08 + * + * etc. + * + * * Example, (if 158 quad elements, and buffer size is 200) + * + * (get all 158 quad4s in one invocation) + * element_type = Z_QUA04 + * first = TRUE Will be TRUE the first time! + * e_beg = 0 (zero based, first element index) + * e_end = 157 (zero based, last element index) + * buffer_size = 200 + * conn_array[200][4] Use first 158 locations of the array + * *num_returned = 158 set this + * return(1) return this (indicates no more to do) + * + * * Example, (if 158 quad elements, and buffer size is 75) + * + * first invocation: + * element_type = Z_QUA04 + * first = TRUE Will be TRUE the first time! + * e_beg = 0 + * e_end = 157 + * buffer_size = 75 + * conn_array[75][4] load in conn for elements 1 - 75 + * *num_returned = 75 set this + * return(0) return this (indicates more to do) + * + * second invocation: + * element_type = Z_QUA04 + * first = TRUE Will be TRUE the first time! + * e_beg = 0 + * e_end = 157 + * buffer_size = 75 + * conn_array[75][4] load in conn for elements 76 - 150 + * *num_returned = 75 set this + * return(0) return this (indicates more to do) + * + * third invocation: + * element_type = Z_QUA04 + * first = TRUE Will be TRUE the first time! + * e_beg = 0 + * e_end = 157 + * buffer_size = 75 + * conn_array[75][4] load in conn for elements 151 - 158 + * *num_returned = 8 set this + * return(1) return this (indicates no more to do) + * + * + * (OUT) *num_returned = The number of elements whose connectivities + * are returned in the buffer. This will + * normally be equal to buffer_size except for + * that last buffer - which could be less than + * a full buffer. + * + * returns 0 if got some, more to do + * 1 if got some, done + * -1 if an error + * + * Notes: + * * This will be based on Current_time_step + * + * * Again, make sure each buffer is zero based. For our example using buffers above: + * + * Invocation: + * 1 2 3 + * ------- ------- -------- + * conn_array[0][0] node 1 in conn for quad 1 quad 76 quad 151 + * conn_array[0][1] node 2 in conn for quad 1 quad 76 quad 151 + * conn_array[0][2] node 3 in conn for quad 1 quad 76 quad 151 + * conn_array[0][3] node 4 in conn for quad 1 quad 76 quad 151 + * + * conn_array[1][0] node 1 in conn for quad 2 quad 77 quad 152 + * conn_array[1][1] node 2 in conn for quad 2 quad 77 quad 152 + * conn_array[1][2] node 3 in conn for quad 2 quad 77 quad 152 + * conn_array[1][3] node 4 in conn for quad 2 quad 77 quad 152 + * + * ... + * + * conn_array[74][0] node 1 in conn for quad 75 quad 150 quad 158 + * conn_array[74][1] node 2 in conn for quad 75 quad 150 quad 158 + * conn_array[74][2] node 3 in conn for quad 75 quad 150 quad 158 + * conn_array[74][3] node 4 in conn for quad 75 quad 150 quad 158 + *--------------------------------------------------------------------*/ +int +USERD_get_part_elements_by_type_in_buffers(int part_number, + int element_type, + int **conn_array, + int first, + int e_beg, + int e_end, + int buffer_size, + int *num_returned) + + + + + +/*-------------------------------------------------------------------- + * USERD_get_part_element_ids_by_type_in_buffers - + *-------------------------------------------------------------------- + * + * Gets the ids for the elements of a particular type + * in an unstructured part in buffers + * + * (IN) part_number = The part number + * + * (1-based index of part table, namely: + * + * 1 ... Numparts_available. + * + * It is NOT the part_id that + * is loaded in USERD_get_gold_part_build_info) + * + * (IN) element_type = One of the following (See global_extern.h) + * Z_POINT node point element + * Z_BAR02 2 node bar + * Z_BAR03 3 node bar + * Z_TRI03 3 node triangle + * Z_TRI06 6 node triangle + * Z_QUA04 4 node quad + * Z_QUA08 8 node quad + * Z_TET04 4 node tetrahedron + * Z_TET10 10 node tetrahedron + * Z_PYR05 5 node pyramid + * Z_PYR13 13 node pyramid + * Z_PEN06 6 node pentahedron + * Z_PEN15 15 node pentahedron + * Z_HEX08 8 node hexahedron + * Z_HEX20 20 node hexahedron + * + * Starting at API 2.01: + * ==================== + * Z_G_POINT ghost node point element + * Z_G_BAR02 2 node ghost bar + * Z_G_BAR03 3 node ghost bar + * Z_G_TRI03 3 node ghost triangle + * Z_G_TRI06 6 node ghost triangle + * Z_G_QUA04 4 node ghost quad + * Z_G_QUA08 8 node ghost quad + * Z_G_TET04 4 node ghost tetrahedron + * Z_G_TET10 10 node ghost tetrahedron + * Z_G_PYR05 5 node ghost pyramid + * Z_G_PYR13 13 node ghost pyramid + * Z_G_PEN06 6 node ghost pentahedron + * Z_G_PEN15 15 node ghost pentahedron + * Z_G_HEX08 8 node ghost hexahedron + * Z_G_HEX20 20 node ghost hexahedron + * Z_NSIDED n node ghost nsided polygon + * Z_NFACED n face ghost nfaced polyhedron + * + * Starting at API 2.02: + * ==================== + * Z_NSIDED n node nsided polygon + * Z_NFACED n face nfaced polyhedron + * Z_G_NSIDED n node ghost nsided polygon + * Z_G_NFACED n face ghost nfaced polyhedron + * + * (IN) first = TRUE if first invocation of a buffered set. + * Will be FALSE for all subsequent invocations + * of the set. This is so you can open files, get to + * the correct starting spot, initialize, etc. + * + * (IN) e_beg = Zero based, first element number + * of the buffered set + * + * (IN) e_end = Zero based, last element number + * of the buffered set + * + * Thus, for first five elements of a type: + * e_beg = 0 + * e_end = 4 + * total_number = (e_end - e_beg) + 1 = (4 - 0) + 1 = 5 + * + * for second five elements of a type, would be: + * e_beg = 5 + * e_end = 9 + * total_number = (e_end - e_beg) + 1 = (9 - 5) + 1 = 5 + * + * for all elements of the type of a part, would be: + * n_beg = 0 + * n_end = num_elements_of_type - 1 + * + * (IN) buffer_size = The size of the buffer. + * Namely: elemid_array[buffer_size] + * + * (OUT) elemid_array = 1D buffer array which is set up to hold ids + * of elements of the type. + * + * (Array will have been allocated + * buffer_size long) + * + * * Example, (if 158 quad elements, and buffer size is 200) + * + * (get all 158 quad4 ids in one invocation) + * element_type = Z_QUA04 + * first = TRUE Will be TRUE the first time! + * e_beg = 0 (zero based, first element index) + * e_end = 157 (zero based, last element index) + * buffer_size = 200 + * elemeid_array[200] Use first 158 locations of the array + * *num_returned = 158 set this + * return(1) return this (indicates no more to do) + * + * * Example, (if 158 quad elements, and buffer size is 75) + * + * first invocation: + * element_type = Z_QUA04 + * first = TRUE Will be TRUE the first time! + * e_beg = 0 + * e_end = 157 + * buffer_size = 75 + * elemid_array[75] load in ids for elements 1 - 75 + * *num_returned = 75 set this + * return(0) return this (indicates more to do) + * + * second invocation: + * element_type = Z_QUA04 + * first = TRUE Will be TRUE the first time! + * e_beg = 0 + * e_end = 157 + * buffer_size = 75 + * elemid_array[75] load in ids for elements 76 - 150 + * *num_returned = 75 set this + * return(0) return this (indicates more to do) + * + * third invocation: + * element_type = Z_QUA04 + * first = TRUE Will be TRUE the first time! + * e_beg = 0 + * e_end = 157 + * buffer_size = 75 + * elemid_array[75] load in ids for elements 151 - 158 + * *num_returned = 8 set this + * return(1) return this (indicates no more to do) + * + * + * (OUT) *num_returned = The number of elements whose ids are returned + * in the buffer. This will normally be equal + * to buffer_size except for that last buffer + * - which could be less than a full buffer. + * + * returns 0 if got some, more to do + * 1 if got some, done + * -1 if an error + * + * Notes: + * * This will be based on Current_time_step + * + * * Again, make sure each buffer is zero based. For our example using buffers above: + * + * Invocation: + * 1 2 3 + * ------- ------- -------- + * elemid_array[0] elem id for quad 1 quad 76 quad 151 + * + * elemid_array[1] elem id for quad 2 quad 77 quad 152 + * + * ... + * + * elemid_array[74] elem id for quad 75 quad 150 quad 158 + *--------------------------------------------------------------------*/ +int +USERD_get_part_element_ids_by_type_in_buffers(int part_number, + int element_type, + int *elemid_array, + int first, + int e_beg, + int e_end, + int buffer_size, + int *num_returned) + + + + + + +/*-------------------------------------------------------------------- + * USERD_get_var_by_component_in_buffers - used by unstructured parts + *-------------------------------------------------------------------- + * + * if Z_PER_NODE: + * Get the component value at each node for a given variable in the part + * in buffers. + * + * or if Z_PER_ELEM: + * Get the component value at each element of a specific part and type for + * a given variable in buffers. + * + * (IN) which_variable = The variable number + * + * (IN) which_part Since EnSight Version 7.4 + * ------------------------- + * = The part number + * + * (1-based index of part table, namely: + * + * 1 ... Numparts_available. + * + * It is NOT the part_id that + * is loaded in USERD_get_gold_part_build_info) + * + * Prior to EnSight Version 7.4 + * ---------------------------- + * = The part id This is the part_id label loaded + * in USERD_get_gold_part_build_inf\o. + * It is NOT the part table index. + * + * (IN) var_type = Z_SCALAR + * Z_VECTOR + * Z_TENSOR ( symmetric tensor) + * Z_TENSOR9 (asymmetric tensor) + * + * (IN) which_type + * + * if Z_PER_NODE: Not used + * + * if Z_PER_ELEM: = The element type + * Z_POINT node point element + * Z_BAR02 2 node bar + * Z_BAR03 3 node bar + * Z_TRI03 3 node triangle + * Z_TRI06 6 node triangle + * Z_QUA04 4 node quad + * Z_QUA08 8 node quad + * Z_TET04 4 node tetrahedron + * Z_TET10 10 node tetrahedron + * Z_PYR05 5 node pyramid + * Z_PYR13 13 node pyramid + * Z_PEN06 6 node pentahedron + * Z_PEN15 15 node pentahedron + * Z_HEX08 8 node hexahedron + * Z_HEX20 20 node hexahedron + * + * Starting at API 2.01: + * ==================== + * Z_G_POINT ghost node point element + * Z_G_BAR02 2 node ghost bar + * Z_G_BAR03 3 node ghost bar + * Z_G_TRI03 3 node ghost triangle + * Z_G_TRI06 6 node ghost triangle + * Z_G_QUA04 4 node ghost quad + * Z_G_QUA08 8 node ghost quad + * Z_G_TET04 4 node ghost tetrahedron + * Z_G_TET10 10 node ghost tetrahedron + * Z_G_PYR05 5 node ghost pyramid + * Z_G_PYR13 13 node ghost pyramid + * Z_G_PEN06 6 node ghost pentahedron + * Z_G_PEN15 15 node ghost pentahedron + * Z_G_HEX08 8 node ghost hexahedron + * Z_G_HEX20 20 node ghost hexahedron + * Starting at API 2.02: + * ==================== + * Z_NSIDED n node nsided polygon + * Z_NFACED n face nfaced polyhedron + * Z_G_NSIDED n node ghost nsided polygon + * Z_G_NFACED n face ghost nfaced polyhedron + * + * + * + * (IN) imag_data = TRUE if imag component + * FALSE if real component + * + * (IN) component = The component: (0 if Z_SCALAR) + * (0 - 2 if Z_VECTOR) + * (0 - 5 if Z_TENSOR) + * (0 - 8 if Z_TENSOR9) + * + * * 6 Symmetric Indicies, 0:5 * + * * ---------------------------- * + * * | 11 12 13 | | 0 3 4 | * + * * | | | | * + * * T = | 22 23 | = | 1 5 | * + * * | | | | * + * * | 33 | | 2 | * + * + * * 9 General Indicies, 0:8 * + * * ---------------------------- * + * * | 11 12 13 | | 0 1 2 | * + * * | | | | * + * * T = | 21 22 23 | = | 3 4 5 | * + * * | | | | * + * * | 31 32 33 | | 6 7 8 | * + * + * (IN) ne_beg + * if Z_PER_NODE: = Zero based, first node index of the buffered set + * if Z_PER_ELEM: = Zero based, first element index of the buffered set + * + * (IN) ne_end + * if Z_PER_NODE: = Zero based, last node index of the buffered set + * if Z_PER_ELEM: = Zero based, last element index of the buffered set + * + * Thus, for first five elements or nodes: + * e_beg = 0 + * e_end = 4 + * total_number = (e_end - e_beg) + 1 = (4 - 0) + 1 = 5 + * + * for second five elements or nodes, would be: + * e_beg = 5 + * e_end = 9 + * total_number = (e_end - e_beg) + 1 = (9 - 5) + 1 = 5 + * + * for all elements or nodes of a part, would be: + * n_beg = 0 + * n_end = num_elements_or_nodes - 1 + * + * (IN) first = TRUE if first invocation of a buffered set. + * Will be FALSE for all subsequent invocations + * of the set. This is so you can open files, get to + * the correct starting spot, initialize, etc. + * + * (IN) buffer_size = The size of the buffer. + * Namely: var_array[buffer_size] + * + * (IN) leftside = TRUE if current time is at a timestep or + * when getting the left side of a time + * span that encloses the current time. + * = FALSE when getting the right side of a time + * span that encloses the current time. + * + * Timeline: + * step1 step2 step3 + * |-------------|--------------|-------... requires no interpolation + * ^ get values at step2 (leftside = TRUE) + * current time (leftside = TRUE) + * + * + * Timeline: + * step1 step2 step3 + * |-------------|--------------|-------... requires interpolation + * ^ get values at step2 (leftside = TRUE) + * current time and get values at step3 (leftside = FALSE) + * + * Note that it would generally be easier for this routine if EnSight got all + * of the left side, then all of the right side, and then did its + * interpolation. But, in the spirit of doing things in buffers (to save + * memory) it gets a left side buffer (and the corresponding right side + * buffer and interpolates these), if needed, before going to the next + * buffer of the set. Thus, you need to be able to handle that situation. + * + * Note also that EnSight will have called the routine to change the current + * time step between the two invocations when interpolation is required. + * And Ensight does the interpolating. This variable is provided so + * that you can deal with two different files or pointers between the + * corresponding invocations for the two times + * + * (OUT) var_array + * + * ----------------------------------------------------------------------- + * (IMPORTANT: this array is 0-based for both Z_PER_NODE and Z_PER_ELEM!!! + * ----------------------------------------------------------------------- + * + * if Z_PER_NODE: = 1D buffer array set up to hold a variable + * component value for nodes. + * + * if Z_PER_ELEM: = 1D buffer array set up to hold a variable + * component value for elements. + * + * (Array will have been allocated + * buffer_size long) + * + * Info stored in this fashion: + * var_array[0] = var component for node or element 1 of part + * var_array[1] = var component for node or element 2 of part + * var_array[2] = var component for node or element 3 of part + * etc. + * + * * Example, (if 158 quad elements with a real Z_PER_ELEM scalar, + * current time is between steps, and buffer size is 75) + * + * first invocation: (for left side of time span) + * var_type = Z_SCALAR + * which_type = Z_PER_ELEM + * imag_data = FALSE + * component = 0 + * ne_beg = 0 + * ne_end = 157 + * first = TRUE Will be TRUE the first time! + * buffer_size = 75 + * leftside = TRUE <== + * var_array[75] load in scalar value for elements 1 - 75 + * *num_returned = 75 set this + * return(0) return this (indicates more to do) + * + * second invocation: (for right side of time span) + * var_type = Z_SCALAR + * which_type = Z_PER_ELEM + * imag_data = FALSE + * component = 0 + * ne_beg = 0 + * ne_end = 157 + * first = TRUE Note: Will still be TRUE (because is right side) + * buffer_size = 75 + * leftside = FALSE <== + * var_array[75] load in scalar value for elements 1 - 75 + * *num_returned = 75 set this + * return(0) return this (indicates more to do) + * + * ------------------------------- + * third invocation: (for left side of time span) + * var_type = Z_SCALAR + * which_type = Z_PER_ELEM + * imag_data = FALSE + * component = 0 + * ne_beg = 0 + * ne_end = 157 + * first = FALSE Will be FALSE now + * buffer_size = 75 + * leftside = TRUE <== + * var_array[75] load in scalar value for elements 76 - 150 + * *num_returned = 75 set this + * return(0) return this (indicates more to do) + * + * fourth invocation: (for right side of time span) + * var_type = Z_SCALAR + * which_type = Z_PER_ELEM + * imag_data = FALSE + * component = 0 + * ne_beg = 0 + * ne_end = 157 + * first = FALSE + * buffer_size = 75 + * leftside = FALSE <== + * var_array[75] load in scalar value for elements 76 - 150 + * *num_returned = 75 set this + * return(0) return this (indicates more to do) + * + *------------------------------------ + * fifth invocation: (for left side of time span) + * var_type = Z_SCALAR + * which_type = Z_PER_ELEM + * imag_data = FALSE + * component = 0 + * ne_beg = 0 + * ne_end = 157 + * first = FALSE Will still be FALSE + * buffer_size = 75 + * leftside = TRUE <== + * var_array[75] load in scalar value for elements 151 - 158 + * *num_returned = 8 set this + * return(1) return this (indicates no more to do) + * + * sixth invocation: (for right side of time span) + * var_type = Z_SCALAR + * which_type = Z_PER_ELEM + * imag_data = FALSE + * component = 0 + * ne_beg = 0 + * ne_end = 157 + * first = FALSE + * buffer_size = 75 + * leftside = FALSE <== + * var_array[75] load in scalar value for elements 151 - 158 + * *num_returned = 8 set this + * return(1) return this (indicates no more to do) + * + * + * (OUT) *num_returned = The number of nodes or elements whose variable + * values are returned in the buffer. This will + * normally be equal to buffer_size except for + * that last buffer - which could be less than + * a full buffer. + * + * returns 0 if got some, more to do + * 1 if got some, done + * -1 if an error + * + * Notes: + * * This will be based on Current_time_step + * + * * Again, make sure each buffer is zero based. For our example using buffers above: + * + * Invocation: + * ---------------- ------------------ ------------------- + * 1 2 3 4 5 6 + * ------- ------- -------- -------- --------- --------- + * var_array[0] scalar of quad 1L quad 1R quad 76L quad 76R quad 151L quad 151R + * + * var_array[1] scalar of quad 2L quad 2R quad 77L quad 77R quad 152L quad 152R + * + * ... + * + * var_array[74] scalar of quad 75L quad 75R quad 150L quad 150R quad 158L quad 158R + * + * Where: L indicates left time step + * R indicates right time step + *--------------------------------------------------------------------*/ +int +USERD_get_var_by_component_in_buffers(int which_variable, + int which_part, + int var_type, + int which_type, + int imag_data, + int component, + float *var_array, + int first, + int ne_beg, + int ne_end, + int buffer_size, + int leftside, + int *num_returned) + + + + +/*-------------------------------------------------------------------- + * USERD_get_nsided_conn_in_buffers - + *-------------------------------------------------------------------- + * + * Gets the two arrays containing the connectivity information + * of nsided elements in buffers + * + * (IN) part_number = The part number + * + * (1-based index of part table, namely: + * + * 1 ... Numparts_available. + * + * It is NOT the part_id that + * is loaded in USERD_get_gold_part_build_info) + * + * (IN) first = TRUE if first invocation of a buffered set. + * Will be FALSE for all subsequent invocations + * of the set. This is so you can open files, + * get to the correct starting spot, + * initialize, etc. + * + * (IN) e_beg = Zero based, first element number + * of the buffered set + * + * (IN) e_end = Zero based, last element number + * of the buffered set + * + * Thus, for first five elements of a type: + * e_beg = 0 + * e_end = 4 + * total_number = (e_end - e_beg) + 1 = (4 - 0) + 1 = 5 + * + * for second five elements of a type, would be: + * e_beg = 5 + * e_end = 9 + * total_number = (e_end - e_beg) + 1 = (9 - 5) + 1 = 5 + * + * for all elements of the type of a part, would be: + * n_beg = 0 + * n_end = num_elements_of_type - 1 + * + * (IN) buffer_size = The size of the num_nodes_per_elem_array buffer. + * Namely: num_nodes_per_elem_array[buffer_size] + * + * (OUT) num_nodes_per_elem_array = 1D buffer array of the number of nodes + * per nsided element. + * + * (OUT) nsided_conn_array = 1D buffer array of nsided connectivies + * + * (int array will have been allocated + * long enough to hold all the nsided + * connectivities in the buffered chunk) + * + * (OUT) *num_returned = The number of elements whose connectivities + * are returned in the buffer. This will + * normally be equal to buffer_size except for + * that last buffer - which could be less than + * a full buffer. + * + * Providing nsided information to Ensight: + * + * NOTE: for other nsided operations you need these first two, but we + * don't actually use them in this routine. + * + * 1. In USERD_get_gold_part_build_info, provide the number of nsided + * elements in the part. + * + * 2. In USERD_get_part_elements_by_type, provide (in the conn_array), + * the number of nodes per nsided element. (as if connectivity + * length of an nsided element is one) + * + * We do use the following: + * 3. In this routine, provide the corresponding num_nodes_per_element and + * streamed connectivities for each of the nsided elements in this + * buffered portion. + * + * + * Simple example: 5 6 + * +--------+ + * 3 nsided elements: /| \ + * (1 4-sided / | \ + * 1 3-sided / | \ + * 1 7-sided) / | \ 7 + * /3 |4 + + * +-----+ | + * | | | + * | | |8 + * | | + + * | | / + * | | / + * | | / + * |1 |2 /9 + * +-----+--------+ + * + * NOTE, don't really use these first two here (See USERD_get_nsided_conn) + * + * 1. In USERD_get_gold_part_build_info: + * number_of_elements[Z_NSIDED] = 3 + * . + * /|\ + * | + * 2. In USERD_get_part_elements_by_type: + * length of conn_array will be: 3 x 1 + * + * for element_type of Z_NSIDED: + * conn_array[0][0] = 4 (for the 4-sided element) + * conn_array[1][0] = 3 (for the 3-sided element) + * conn_array[2][0] = 7 (for the 7-sided element) + * + * Sum === + * 14 + * + * But for our example, lets assume that that our buffer is just 2 + * ================ + * 3. In this routine: + * + * first invocation: + * first = TRUE + * e_beg = 0 + * e_end = 2 + * buffer_size = 2 + * num_nodes_per_elem_array[2] load it: num_nodes_per_elem_array[0] = 4 + * num_nodes_per_elem_array[1] = 3 + * + * nsided_conn_array[at least 7] load it: nsided_conn_array[0] = 1 + * nsided_conn_array[1] = 2 + * nsided_conn_array[2] = 4 + * nsided_conn_array[3] = 3 + * + * nsided_conn_array[4] = 3 + * nsided_conn_array[5] = 4 + * nsided_conn_array[6] = 5 + * *num_returned = 2 + * return(0) return this (indicates more to do) + * + * second invocation: + * first = FALSE + * e_beg = 0 + * e_end = 2 + * buffer_size = 2 + * num_nodes_per_elem_array[2] load it: num_nodes_per_elem_array[0] = 7 + * + * nsided_conn_array[at least 7] load it: nsided_conn_array[0] = 2 + * nsided_conn_array[1] = 9 + * nsided_conn_array[2] = 8 + * nsided_conn_array[3] = 7 + * nsided_conn_array[4] = 6 + * nsided_conn_array[5] = 5 + * nsided_conn_array[6] = 4 + * *num_returned = 1 + * return(1) return this (indicates no more to do) + * + * returns 0 if got some, more to do + * 1 if got some, done + * -1 if an error + * + * Notes: + * * This will be based on Current_time_step + * + * * Will not be called unless there are some nsided elements in the + * the part + *--------------------------------------------------------------------*/ +int +USERD_get_nsided_conn_in_buffers(int part_number, + int *num_nodes_per_elem_array, + int *nsided_conn_array, + int first, + int e_beg, + int e_end, + int buffer_size, + int *num_returned) + + + + +/*-------------------------------------------------------------------- + * USERD_get_nfaced_conn_in_buffers - + *-------------------------------------------------------------------- + * + * Gets three arrays containing the number of faces per element, + * number of nodes per face, and connectivity per face of nfaced + * elements in buffers + * + * (IN) part_number = The part number + * + * (1-based index of part table, namely: + * + * 1 ... Numparts_available. + * + * It is NOT the part_id that + * is loaded in USERD_get_gold_part_build_info) + * + * (IN) first = TRUE if first invocation of a buffered set. + * Will be FALSE for all subsequent invocations + * of the set. This is so you can open files, + * get to the correct starting spot, + * initialize, etc. + * + * (IN) e_beg = Zero based, first element number + * of the buffered set + * + * (IN) e_end = Zero based, last element number + * of the buffered set + * + * Thus, for first five elements of a type: + * e_beg = 0 + * e_end = 4 + * total_number = (e_end - e_beg) + 1 = (4 - 0) + 1 = 5 + * + * for second five elements of a type, would be: + * e_beg = 5 + * e_end = 9 + * total_number = (e_end - e_beg) + 1 = (9 - 5) + 1 = 5 + * + * for all elements of the type of a part, would be: + * n_beg = 0 + * n_end = num_elements_of_type - 1 + * + * (IN) buffer_size = The size of the num_nodes_per_elem_array buffer. + * Namely: num_nodes_per_elem_array[buffer_size] + * + * (OUT) nfaced_fpe_array = 1D buffer array of the number of faces per nfaced + * element. + * + * (int array will have been allocated + * buffer_size long) + * + * (OUT) nfaced_npf_array = 1D buffer array of the number of nodes per face + * for nfaced elements. + * + * (int array will have been allocated long + * enough to hold a buffer's size of values) + * + * (OUT) nfaced_conn_array = 1D array of nsided face connectivies of + * nfaced elements + * + * (int array will have been allocated + * long enough to hold a buffer's worth of values) + * + * Providing nfaced information to Ensight: + * + * NOTE: for other nfaced operations you need these first two, but we + * don't actually use them in this routine. + * + * 1. In USERD_get_gold_part_build_info, provide the number of nfaced + * polyhedral elements in the part. + * + * 2. In USERD_get_part_elements_by_type, provide (in the conn_array), + * the number of faces per nfaced element. (as if connectivity + * length of an nfaced element is one) + * + * We do use the following: + * 3. In this routine, provide the corresponding number of faces per nfaced + * element, streamed number of nodes per face, and streamed face + * connectivities for each of the faces of the nfaced elements in the + * bufferred portion. + * + * + * Simple example: 11 10 12 + * +--------+-----+ + * 2 nfaced elements: /| |\ /| + * (1 7-faced / | | \ / | + * 1 5-sided) / | | +9 | + * / | | /| | + * /7 | 8 / | | + * +-----------+/ | | | + * | |5 | |4 | |6 + * | +-----|--+--|--+ + * | / | \ | / + * | / | \|/3 + * | / | + + * | / | / + * |/1 |2 / + * +-----------+/ + * + * Note, don't really use these first two here (See USERD_get_nfaced_conn) + * + * 1. In USERD_get_gold_part_build_info: + * number_of_elements[Z_NFACED] = 2 + * . + * /|\ + * | + * 2. In USERD_get_part_elements_by_type: + * length of conn_array will be: 2 x 1 + * for element_type of Z_NFACED: + * conn_array[0][0] = 7 (for the 7-faced element) + * conn_array[1][0] = 5 (for the 5-faced element) + * == + * Sum 12 + * + * + * But for our simple example, lets assume that that our buffer is just 1 + * so that we have multiple invocations. ================ + * + * 3. In this routine: + * + * first invocation: + * first = TRUE + * e_beg = 0 + * e_end = 1 + * buffer_size = 1 + * nfaced_fpe_array[1] load it: nfaced_fpe_array[0] = 7 + * + * nfaced_npf_array[at least 7] load it: nfaced_npf_array[0] = 5 + * nfaced_npf_array[1] = 5 + * nfaced_npf_array[2] = 4 + * nfaced_npf_array[3] = 4 + * nfaced_npf_array[4] = 4 + * nfaced_npf_array[5] = 4 + * nfaced_npf_array[6] = 4 + * + * nsided_conn_array[at least 30] load it: nsided_conn_array[0] = 7 + * nsided_conn_array[1] = 8 + * nsided_conn_array[2] = 9 + * nsided_conn_array[3] = 10 + * nsided_conn_array[4] = 11 + * + * nsided_conn_array[5] = 1 + * nsided_conn_array[6] = 5 + * nsided_conn_array[7] = 4 + * nsided_conn_array[8] = 3 + * nsided_conn_array[9] = 2 + * + * nsided_conn_array[10] = 1 + * nsided_conn_array[11] = 2 + * nsided_conn_array[12] = 8 + * nsided_conn_array[13] = 7 + * + * nsided_conn_array[14] = 5 + * nsided_conn_array[15] = 1 + * nsided_conn_array[16] = 7 + * nsided_conn_array[17] = 11 + * + * nsided_conn_array[18] = 4 + * nsided_conn_array[19] = 5 + * nsided_conn_array[20] = 11 + * nsided_conn_array[21] = 10 + * + * nsided_conn_array[22] = 2 + * nsided_conn_array[23] = 3 + * nsided_conn_array[24] = 9 + * nsided_conn_array[25] = 8 + * + * nsided_conn_array[26] = 3 + * nsided_conn_array[27] = 4 + * nsided_conn_array[28] = 10 + * nsided_conn_array[29] = 9 + * *num_returned = 1; + * return(0) + * + * second invocation: + * first = FALSE + * e_beg = 0 + * e_end = 1 + * buffer_size = 1 + * nfaced_fpe_array[1] load it: nfaced_fpe_array[0] = 5 + * + * nfaced_npf_array[at least 7] load it: nfaced_npf_array[0] = 3 + * nfaced_npf_array[1] = 3 + * nfaced_npf_array[2] = 4 + * nfaced_npf_array[3] = 4 + * nfaced_npf_array[4] = 4 + * + * nsided_conn_array[at least 18] load it: nsided_conn_array[0] = 9 + * nsided_conn_array[1] = 12 + * nsided_conn_array[2] = 10 + * + * nsided_conn_array[3] = 3 + * nsided_conn_array[4] = 4 + * nsided_conn_array[5] = 6 + * + * nsided_conn_array[6] = 6 + * nsided_conn_array[7] = 4 + * nsided_conn_array[8] = 10 + * nsided_conn_array[9] = 12 + * + * nsided_conn_array[10] = 3 + * nsided_conn_array[11] = 6 + * nsided_conn_array[12] = 12 + * nsided_conn_array[13] = 9 + * + * nsided_conn_array[14] = 4 + * nsided_conn_array[15] = 3 + * nsided_conn_array[16] = 9 + * nsided_conn_array[17] = 10 + * *num_returned = 1; + * return(1) + * + * returns 0 if got some, more to do + * 1 if got some, done + * -1 if an error + * + * Notes: + * * This will be based on Current_time_step + * + * * Will not be called unless there are some nfaced elements in the + * the part + *--------------------------------------------------------------------*/ +int +USERD_get_nfaced_conn_in_buffers(int part_number, + int *nfaced_fpe_array, + int *nfaced_npf_array, + int *nfaced_conn_array, + int first, + int e_beg, + int e_end, + int buffer_size, + int *num_returned) diff --git a/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_API.H b/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_API.H new file mode 100644 index 0000000000..0a76de2333 --- /dev/null +++ b/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_API.H @@ -0,0 +1,2 @@ +#define DO_READER +#define USERD_API_203 diff --git a/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_reader_release.H b/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_reader_release.H new file mode 100644 index 0000000000..3a75b16675 --- /dev/null +++ b/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_reader_release.H @@ -0,0 +1,18 @@ +int USERD_get_reader_release +( + char release_number[Z_MAX_USERD_NAME] +) +{ + +#ifdef ENSIGHTDEBUG + Info << "Entering: USERD_get_reader_release" << endl; +#endif + + strncpy(release_number, Foam::FOAMbuild, Z_MAX_USERD_NAME); + +#ifdef ENSIGHTDEBUG + Info << "Leaving: USERD_get_reader_release" << endl; +#endif + + return Z_OK; +} diff --git a/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_reader_version.H b/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_reader_version.H index 9debdb474e..7c8206664b 100644 --- a/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_reader_version.H +++ b/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_reader_version.H @@ -2,7 +2,7 @@ int USERD_get_reader_version ( char version_number[Z_MAX_USERD_NAME] ) -{ +{ #ifdef ENSIGHTDEBUG Info << "Entering: USERD_get_reader_version" << endl; @@ -13,6 +13,6 @@ int USERD_get_reader_version #ifdef ENSIGHTDEBUG Info << "Leaving: USERD_get_reader_version" << endl; #endif - + return Z_OK; } diff --git a/applications/utilities/postProcessing/graphics/ensightFoamReader/globalFoam.H b/applications/utilities/postProcessing/graphics/ensightFoamReader/globalFoam.H index 7c7f2b16d8..40fb28d949 100644 --- a/applications/utilities/postProcessing/graphics/ensightFoamReader/globalFoam.H +++ b/applications/utilities/postProcessing/graphics/ensightFoamReader/globalFoam.H @@ -7,7 +7,7 @@ static char readerName[] = "OpenFOAM"; static char meshName[] = "cells"; static char readerVersion[] = "2.03"; -// everything is one part in foam, except the spray +// everything is one part in OpenFOAM, except the spray static int Num_unstructured_parts = 1; static int Num_structured_parts = 0; static int Numparts_available = 1; diff --git a/applications/utilities/postProcessing/graphics/ensightFoamReader/global_extern.h b/applications/utilities/postProcessing/graphics/ensightFoamReader/global_extern.h index 4e33501129..07514c06aa 100644 --- a/applications/utilities/postProcessing/graphics/ensightFoamReader/global_extern.h +++ b/applications/utilities/postProcessing/graphics/ensightFoamReader/global_extern.h @@ -18,21 +18,27 @@ #ifndef GLOBAL_EXTERN_H #define GLOBAL_EXTERN_H +#ifdef __cplusplus +extern "C" { +#endif + /*-------------------------------- * Set the reader version define * (only one can be set at a time) *--------------------------------*/ +#if 0 +#define USERD_API_100 +#define USERD_API_200 +#define USERD_API_201 +#define USERD_API_202 #define USERD_API_203 - -/*---------------------------------------- - * Set this appropriately: - * DO_ENSIGHT if using for EnSight itself - * DO_READER if using in a reader - *----------------------------------------*/ -#if 1 -#define DO_READER -#else -#define DO_ENSIGHT +#define USERD_API_204 +#define USERD_API_205 +#define USERD_API_206 +#define USERD_API_207 +#define USERD_API_208 +#define USERD_API_209 +#define USERD_API_210 #endif /*---------------------------------------*/ @@ -73,6 +79,28 @@ #define Z_MAX_SETS (300) +#define Z_MX_MATERIALS (60) + +#define Z_MXVARIABLEDESC 20 /*Interface Variables Max Name.*/ + +/* Useful macros for handling IEEE floats */ +#define FLT_SGN_MASK 0x80000000U +#define FLT_EXP_MASK 0x7F800000U +#define FLT_MAN_MASK 0x007FFFFFU +#define FLT_EXP_BIAS 127 +#define FLT_EXP_SHIFT 23 + +#define FLT_IS_FINITE(v) \ + (((*((unsigned int*)&(v))) & FLT_EXP_MASK) != FLT_EXP_MASK) + +#define FLT_IS_NAN(v) \ + ((((*((unsigned int*)&(v))) & FLT_EXP_MASK) == FLT_EXP_MASK) && \ + ((((*((unsigned int*)&(v))) & FLT_MAN_MASK) != 0U) + +#define FLT_IS_INF(v) \ + ((((*((unsigned int*)&(v))) & FLT_EXP_MASK) == FLT_EXP_MASK) && \ + ((((*((unsigned int*)&(v))) & FLT_MAN_MASK) == 0U) + #ifndef GLOBALDEFS_H /*-----------------------------------*/ /* Unstructured coordinate structure */ @@ -80,6 +108,12 @@ typedef struct { float xyz[3]; }CRD; +/*-----------------------------------*/ +/* Unstructured double coordinate structure */ +/*-----------------------------------*/ +typedef struct { + double xyz[3]; +}DBLCRD; #endif /*----------------*/ @@ -95,6 +129,23 @@ enum z_var_type MAX_Z_VAR_TYPES }; +/*------------------- + * Vector Glyph enums + *-------------------*/ +enum vg_time { + VG_STATIC, + VG_TRANSIENT, + VG_UNDEF, + VG_NEAREST, + VG_INTERPOLATE +}; + +enum vg_type { + VG_FORCE, + VG_MOMENT +}; + + /*--------------- * Element Types *--------------- @@ -104,7 +155,7 @@ enum z_var_type * to_int_elem_type routines * in userd_read.c *----------------------------------------*/ -#if (defined USERD_API_100 || defined USERD_API_200) && defined DO_READER +#if (defined USERD_API_100 || defined USERD_API_200) enum z_elem_types { Z_POINT, /* 00: 1 node point element */ Z_BAR02, /* 01: 2 node bar */ @@ -124,7 +175,7 @@ enum z_elem_types { Z_MAXTYPE }; -#elif defined USERD_API_201 && defined DO_READER +#elif defined USERD_API_201 enum z_elem_types { Z_POINT, /* 00: 1 node point element */ Z_G_POINT, /* 01: 1 node point element (ghost call) */ @@ -265,17 +316,97 @@ enum z_material_file_index Z_MAT_INDEX, Z_MIX_INDEX, Z_MIX_VALUE, + Z_SPE_VALUE, Z_NUM_MAT_FILES }; +/*------------------------------------------- + * Material type enum + * + * (Must be comparable to matset_via_file_type + * in mat_defs.h of EnSight server) + *--------------------------------------------*/ +enum z_matset_via_file_type +{ + Z_MISET_VIA_SPARSE_MIX, /* Original method prior to 07Feb07:mel*/ + Z_MISET_VIA_ESCAL_VARS, /* Materials via element scalar variables*/ + Z_MISET_VIA_MAX_FTYPES +}; + + +/* --------------------------------------- + * Extra GUI size stuff + * _EGS + * This is the maximum number of + * Extra GUI items that you are + * allowed of each type. + * + * Don't change these values! + * ------------------------------------- */ +#define Z_MAX_NUM_GUI_PULL_ITEMS 20 /* max num GUI pulldowns */ +#define Z_LEN_GUI_PULL_STR 80 /* max length of GUI pulldown string */ +#define Z_LEN_GUI_FIELD_STR 256 /* max length of field string */ +#define Z_LEN_GUI_TITLE_STR 40 /* max length of title string */ + +/* --------------------------------------- + * Extra data function defines (for "target") + * + * Don't change these values! + * ------------------------------------- */ +#define DATA_TARGET_NONE 0 +#define DATA_TARGET_SERVER 1 +#define DATA_TARGET_SOS 2 +#define DATA_TARGET_CLIENT 3 +#define DATA_TARGET_PYTHON 0x10000000 +#define DATA_TARGET_CMDLANG 0x20000000 +#define DATA_TARGET_UNDEF_VAL 0x40000000 +#define DATA_TARGET_OTHER 0x00000000 +#define DATA_TARGET_MASK 0x0000000f + +/* --------------------------------------- + * Failed elemenet enums + * --------------------------------------- */ + +enum z_element_failure_criteria +{ + Z_ELE_FAILED_NONE, + Z_ELE_FAILED_GREATER, + Z_ELE_FAILED_LESS, + Z_ELE_FAILED_EQUAL, + Z_ELE_FAILED_NOT_EQUAL, + Z_ELE_FAILED_MANY +}; + + +enum z_element_failure_logic +{ + Z_ELE_FAILED_LOGIC_NONE, + Z_ELE_FAILED_LOGIC_AND, + Z_ELE_FAILED_LOGIC_OR, + Z_ELE_FAILED_LOGIC_MANY +}; /*---------------------------------------------------------- - * For readers, we need to include the prototype header file + * We include the prototype header file *----------------------------------------------------------*/ -#if defined DO_READER #include "global_extern_proto.h" -#endif +/* --------------------- + * export the file pointer if windows + * because windows can't open a file in the + * server and pass the FILE * pointer properly. + * --------------------- */ +#ifdef WIN32 +typedef struct _USERD_globals_struct { + char arch_filename[256]; + unsigned long arch_fileptr; +} _USERD_globals; +#endif + +#ifdef __cplusplus +} +#endif + /*--------------------------------------------------------------------*/ #endif /*GLOBAL_EXTERN_H*/ diff --git a/applications/utilities/postProcessing/graphics/ensightFoamReader/global_extern_proto.h b/applications/utilities/postProcessing/graphics/ensightFoamReader/global_extern_proto.h index 6a08f5a67f..e64a466230 100644 --- a/applications/utilities/postProcessing/graphics/ensightFoamReader/global_extern_proto.h +++ b/applications/utilities/postProcessing/graphics/ensightFoamReader/global_extern_proto.h @@ -21,6 +21,8 @@ #ifndef GLOBAL_EXTERN_PROTO_H #define GLOBAL_EXTERN_PROTO_H +#include + #ifdef WIN32 #define W32IMPORT __declspec( dllimport ) #define W32EXPORT __declspec( dllexport ) @@ -32,67 +34,260 @@ /*---------------------- * Same in All Versions *----------------------*/ -W32IMPORT int +W32EXPORT int USERD_get_number_of_model_parts( void ); -W32IMPORT int +W32EXPORT int USERD_get_block_coords_by_component(int block_number, int which_component, float *coord_array); -W32IMPORT int +W32EXPORT int USERD_get_block_iblanking(int block_number, int *iblank_array); -W32IMPORT int +W32EXPORT int USERD_get_block_scalar_values(int block_number, int which_scalar, float *scalar_array); -W32IMPORT int +W32EXPORT int USERD_get_block_vector_values_by_component(int block_number, int which_vector, int which_component, float *vector_array); -W32IMPORT int +W32EXPORT int USERD_get_name_of_reader(char reader_name[Z_MAX_USERD_NAME], int *two_fields); + +/* + * This mechanism is used to mark the fact that a given + * reader cannot be unloaded. We set this by default for + * C++ based readers as there are known issues with unloading + * a C++ DLL on certain platforms (Linux). + */ +W32EXPORT int +USERD_reader_unloadable(void); + +#ifdef __cplusplus +/* + * Define a macro that defines the cpp function as part of the + * USERD_get_name_of_reader declaration + */ +#ifndef NO_AUTO_UNLOADABLE_CODE + +#if defined(LINUX) || defined(SGI) + +#define USERD_get_name_of_reader \ + USERD_reader_unloadable(void) { return(0); } \ +int USERD_get_name_of_reader + +#endif + +#endif + +#endif -W32IMPORT int +W32EXPORT int USERD_get_reader_descrip(char descrip[Z_MAXFILENP]); -W32IMPORT int +W32EXPORT int USERD_set_filenames(char filename_1[], char filename_2[], char the_path[], int swapbytes); -W32IMPORT int +W32EXPORT int USERD_get_number_of_files_in_dataset( void ); -W32IMPORT int +W32EXPORT int USERD_get_dataset_query_file_info(Z_QFILES *qfiles); -W32IMPORT int +W32EXPORT int USERD_get_changing_geometry_status( void ); -W32IMPORT int +W32EXPORT int USERD_get_node_label_status( void ); -W32IMPORT int +W32EXPORT int USERD_get_element_label_status( void ); -W32IMPORT int +W32EXPORT int USERD_get_number_of_variables( void ); -W32IMPORT void +W32EXPORT void USERD_stop_part_building( void ); -W32IMPORT int +W32EXPORT int USERD_bkup(FILE *archive_file, int backup_type); +/* ----------------------------------- + * Optional routine allows getting data + * from the reader to modify server/client behavior + * ------------------------------------ */ +W32EXPORT int +USERD_get_extra_data(int *target, + int *nints, int *nflts, int *nchrs, + int *pints, float *pflts, char *pchrs); + +/* ---------------------------- + * Extra "Before" GUI stuff available for all versions of API + * Note: this API suite is entirely optional... + * --------------------------- */ +W32EXPORT void USERD_get_extra_gui_numbers( + int *num_Toggles, + int *num_pulldowns, + int *num_fields +); + +W32EXPORT int USERD_get_extra_gui_defaults( + char **toggle_Title, /* [num_toggles][Z_LEN_GUI_TITLE_STR] */ + int *toggle_default_status, /* [num_toggles] */ + char **pulldown_Title, /* [num_pulldowns][Z_LEN_GUI_TITLE_STR] */ + int *pulldown_number_in_list, /* [num_pulldowns] */ + int *pulldown_default_selection, /* [num_pulldowns] */ + char ***pulldown_item_strings, /* [num_pulldowns][Z_MAX_NUM_GUI_PULL_ITEMS][Z_LEN_GUI_PULL_STR] */ + char **field_Title, /* [num_fields][Z_LEN_GUI_TITLE_STR] */ + char **field_user_string /* [num_fields][Z_LEN_GUI_FIELD_STR] */ +); + +W32EXPORT void USERD_set_extra_gui_data( + int *toggle, /* [num_toggle] */ + int *pulldown, /* [num_pulldown] */ + char **field_text /* [num_fields][Z_LEN_GUI_FIELD_STR] */ +); + +/* ---------------------------- + * Extra "After" GUI stuff available for all versions of API + * Note: this API suite is entirely optional... + * --------------------------- */ +W32EXPORT void USERD_get_var_extract_gui_numbers( + int *num_Toggles, + int *num_pulldowns, + int *num_fields +); + +W32EXPORT int USERD_get_var_extract_gui_defaults( + char **toggle_Title, /* [num_toggles][Z_LEN_GUI_TITLE_STR] */ + int *toggle_default_status, /* [num_toggles] */ + char **pulldown_Title, /* [num_pulldowns][Z_LEN_GUI_TITLE_STR] */ + int *pulldown_number_in_list, /* [num_pulldowns] */ + int *pulldown_default_selection, /* [num_pulldowns] */ + char ***pulldown_item_strings, /* [num_pulldowns][Z_MAX_NUM_GUI_PULL_ITEMS][Z_LEN_GUI_PULL_STR] */ + char **field_Title, /* [num_fields][Z_LEN_GUI_TITLE_STR] */ + char **field_user_string /* [num_fields][Z_LEN_GUI_FIELD_STR] */ +); + +W32EXPORT void USERD_set_var_extract_gui_data( + int *toggle, /* [num_toggle] */ + int *pulldown, /* [num_pulldown] */ + char **field_text /* [num_fields][Z_LEN_GUI_FIELD_STR] */ ); + +/* -------------------- + * xy-query data routines + * -------------------- */ +W32EXPORT int USERD_get_num_xy_queries(void); + +W32EXPORT int USERD_get_xy_query_info( + int query_num, + char *query_name, + char *query_xtitle, + char *query_ytitle, + int *query_num_pairs); + +W32EXPORT int USERD_get_xy_query_data( + int query_num, + int num_vals, + float *x_vals, + float *y_vals); + + +/* This routine added so the reader can know if we are at the "right" side of + * an interval - namely, interpolation between steps is being done in EnSight + * (It can be in any version of EnSight) + *----------------------------------------------------------------------------*/ +W32EXPORT void +USERD_set_right_side( void ); + +/*--------------------------------------------- + * Routines that get the geometry in buffers, + * used for Unstructured Auto Distribute + * (Optional) + *---------------------------------------------*/ +W32EXPORT int +USERD_get_part_coords_in_buffers(int part_number, + float **coord_array, + int first, + int n_beg, + int n_end, + int buffer_size, + int *num_returned); + +W32EXPORT int +USERD_get_part_node_ids_in_buffers(int part_number, + int *nodeid_array, + int first, + int n_beg, + int n_end, + int buffer_size, + int *num_returned); + +W32EXPORT int +USERD_get_part_elements_by_type_in_buffers(int part_number, + int element_type, + int **conn_array, + int first, + int e_beg, + int e_end, + int buffer_size, + int *num_returned); + +W32EXPORT int +USERD_get_part_element_ids_by_type_in_buffers(int part_number, + int element_type, + int *elemid_array, + int first, + int e_beg, + int e_end, + int buffer_size, + int *num_returned); +W32EXPORT int +USERD_get_var_by_component_in_buffers(int which_variable, + int which_part, + int var_type, + int which_type, + int imag_data, + int component, + float *var_array, + int first, + int ne_beg, + int ne_end, + int buffer_size, + int leftside, + int *num_returned); + +W32EXPORT int +USERD_get_nsided_conn_in_buffers(int part_number, + int *num_nodes_per_elem_array, + int *nsided_conn_array, + int first, + int e_beg, + int e_end, + int buffer_size, + int *num_returned); + +W32EXPORT int +USERD_get_nfaced_conn_in_buffers(int part_number, + int *nfaced_fpe_arrray, + int *nfaced_npf_arrray, + int *nfaced_conn_array, + int first, + int e_beg, + int e_end, + int buffer_size, + int *num_returned); /*----------------------- @@ -100,30 +295,30 @@ USERD_bkup(FILE *archive_file, *-----------------------*/ #if defined USERD_API_100 -W32IMPORT int +W32EXPORT int USERD_get_number_of_global_nodes( void ); -W32IMPORT int +W32EXPORT int USERD_get_global_coords(CRD *coord_array); -W32IMPORT int +W32EXPORT int USERD_get_global_node_ids(int *nodeid_array); -W32IMPORT int +W32EXPORT int USERD_get_element_connectivities_for_part(int part_number, int **conn_array[Z_MAXTYPE]); -W32IMPORT int +W32EXPORT int USERD_get_element_ids_for_part(int part_number, int *elemid_array[Z_MAXTYPE]); -W32IMPORT int +W32EXPORT int USERD_get_vector_values(int which_vector, int which_part, int which_type, float *vector_array); -W32IMPORT int +W32EXPORT int USERD_get_part_build_info(int *part_id, int *part_types, char *part_descriptions[Z_BUFL], @@ -131,25 +326,25 @@ USERD_get_part_build_info(int *part_id, int *ijk_dimensions[3], int *iblanking_options[6]); -W32IMPORT int +W32EXPORT int USERD_get_scalar_values(int which_scalar, int which_part, int which_type, float *scalar_array); -W32IMPORT int +W32EXPORT int USERD_get_variable_info(char **var_description, char **var_filename, int *var_type, int *var_classify); -W32IMPORT int +W32EXPORT int USERD_get_description_lines(int which_type, int which_var, char line1[Z_BUFL], char line2[Z_BUFL]); -W32IMPORT int +W32EXPORT int USERD_get_variable_value_at_specific(int which_var, int which_node_or_elem, int which_part, @@ -157,15 +352,15 @@ USERD_get_variable_value_at_specific(int which_var, int time_step, float values[3]); -W32IMPORT float +W32EXPORT float USERD_get_constant_value(int which_var); -W32IMPORT int +W32EXPORT int USERD_get_solution_times(float *solution_times); -W32IMPORT void +W32EXPORT void USERD_set_time_step(int time_step); -W32IMPORT int +W32EXPORT int USERD_get_number_of_time_steps(void); #endif @@ -176,30 +371,30 @@ USERD_get_number_of_time_steps(void); *----------------------*/ #if !defined USERD_API_100 -W32IMPORT int +W32EXPORT int USERD_get_part_coords(int part_number, float **coord_array); -W32IMPORT int +W32EXPORT int USERD_get_part_node_ids(int part_number, int *nodeid_array); -W32IMPORT int +W32EXPORT int USERD_get_part_elements_by_type(int part_number, int element_type, int **conn_array); -W32IMPORT int +W32EXPORT int USERD_get_part_element_ids_by_type(int part_number, int element_type, int *elemid_array); -W32IMPORT int +W32EXPORT int USERD_get_reader_version(char version_number[Z_MAX_USERD_NAME]); -W32IMPORT int +W32EXPORT int USERD_get_reader_release(char version_number[Z_MAX_USERD_NAME]); -W32IMPORT int +W32EXPORT int USERD_get_var_by_component(int which_variable, int which_part, int var_type, @@ -208,15 +403,15 @@ USERD_get_var_by_component(int which_variable, int component, float *var_array); -W32IMPORT int +W32EXPORT int USERD_get_maxsize_info(int *max_number_of_nodes, int *max_number_of_elements[Z_MAXTYPE], int *max_ijk_dimensions[3]); -W32IMPORT void +W32EXPORT void USERD_exit_routine( void ); -W32IMPORT int +W32EXPORT int USERD_get_gold_variable_info(char **var_description, char **var_filename, int *var_type, @@ -226,17 +421,17 @@ USERD_get_gold_variable_info(char **var_description, float *var_freq, int *var_contran, int *var_timeset); -W32IMPORT int +W32EXPORT int USERD_get_model_extents( float extents[6] ); -W32IMPORT int +W32EXPORT int USERD_get_descrip_lines(int which_type, int which_var, int imag_data, char line1[Z_BUFL], char line2[Z_BUFL]); -W32IMPORT int +W32EXPORT int USERD_get_var_value_at_specific(int which_var, int which_node_or_elem, int which_part, @@ -245,40 +440,40 @@ USERD_get_var_value_at_specific(int which_var, float values[3], int imag_data); -W32IMPORT float +W32EXPORT float USERD_get_constant_val(int which_var, int imag_data); -W32IMPORT int +W32EXPORT int USERD_get_geom_timeset_number(void); -W32IMPORT int +W32EXPORT int USERD_get_number_of_timesets(void); -W32IMPORT int +W32EXPORT int USERD_get_timeset_description(int timeset_number, char timeset_description[Z_BUFL]); -W32IMPORT int +W32EXPORT int USERD_get_sol_times(int timeset_number, float *solution_times); -W32IMPORT void +W32EXPORT void USERD_set_time_set_and_step(int timeset_number, int time_step); -W32IMPORT int +W32EXPORT int USERD_get_num_of_time_steps(int timeset_number); -W32IMPORT int +W32EXPORT int USERD_get_border_availability(int part_number, int number_of_elements[Z_MAXTYPE]); -W32IMPORT int +W32EXPORT int USERD_get_border_elements_by_type(int part_number, int element_type, int **conn_array, short *parent_element_type, int *parent_element_num); -W32IMPORT void +W32EXPORT void USERD_set_server_number(int serv_num, int tot_servs); @@ -288,14 +483,14 @@ USERD_set_server_number(int serv_num, /*---------------------- * New For Version 2.010 *----------------------*/ -#if defined USERD_API_201 || defined USERD_API_202 || defined USERD_API_203 -W32IMPORT int +#if defined USERD_API_201 || defined USERD_API_202 || defined USERD_API_203 || defined USERD_API_204 || defined USERD_API_205 || defined USERD_API_206 || defined USERD_API_207 || defined USERD_API_208 || defined USERD_API_209 || defined USERD_API_210 +W32EXPORT int USERD_get_ghosts_in_model_flag( void ); -W32IMPORT int +W32EXPORT int USERD_get_ghosts_in_block_flag(int block_number); -W32IMPORT int +W32EXPORT int USERD_get_block_ghost_flags(int block_number, int *ghost_flags); #endif @@ -303,9 +498,9 @@ USERD_get_block_ghost_flags(int block_number, /*-------------------------- * Modified at Version 2.030 *--------------------------*/ -#if defined USERD_API_201 || defined USERD_API_202 +#if defined USERD_API_200 || defined USERD_API_201 || defined USERD_API_202 -W32IMPORT int +W32EXPORT int USERD_get_gold_part_build_info(int *part_id, int *part_types, char *part_descriptions[Z_BUFL], @@ -315,8 +510,8 @@ USERD_get_gold_part_build_info(int *part_id, int *iblanking_options[6]); #endif -#if defined USERD_API_203 -W32IMPORT int +#if defined USERD_API_203 || defined USERD_API_204 || defined USERD_API_205 || defined USERD_API_206 || defined USERD_API_207 || defined USERD_API_208 || defined USERD_API_209 || defined USERD_API_210 +W32EXPORT int USERD_get_gold_part_build_info(int *part_id, int *part_types, char *part_descriptions[Z_BUFL], @@ -330,30 +525,30 @@ USERD_get_gold_part_build_info(int *part_id, /*---------------------- * New For Version 2.030 *----------------------*/ -#if defined USERD_API_203 -W32IMPORT int +#if defined USERD_API_203 || defined USERD_API_204 || defined USERD_API_205 || defined USERD_API_206 || defined USERD_API_207 || defined USERD_API_208 || defined USERD_API_209 || defined USERD_API_210 +W32EXPORT int USERD_get_number_of_material_sets( void ); -W32IMPORT int +W32EXPORT int USERD_get_matf_set_info(int *mat_set_ids, char **mat_set_name); -W32IMPORT int +W32EXPORT int USERD_get_number_of_materials( int set_index ); -W32IMPORT int +W32EXPORT int USERD_get_matf_var_info(int set_index, int *mat_ids, char **mat_desc); -W32IMPORT int +W32EXPORT int USERD_size_matf_data(int set_index, int part_id, int wtyp, int mat_type, int *matf_size ); -W32IMPORT int +W32EXPORT int USERD_load_matf_data( int set_index, int part_id, int wtyp, @@ -361,22 +556,180 @@ USERD_load_matf_data( int set_index, int *ids_list, float *val_list ); -W32IMPORT int +W32EXPORT int USERD_get_nsided_conn( int part_number, int *nsided_conn_array ); -W32IMPORT int +W32EXPORT int USERD_get_nfaced_nodes_per_face( int part_number, int *nfaced_npf_array ); -W32IMPORT int +W32EXPORT int USERD_get_nfaced_conn( int part_number, int *nfaced_conn_array ); +#endif + +/*---------------------- + * New For Version 2.040 + *----------------------*/ +#if defined USERD_API_204 || defined USERD_API_205 || defined USERD_API_206 || defined USERD_API_207 || defined USERD_API_208 || defined USERD_API_209 || defined USERD_API_210 + +W32EXPORT int +USERD_get_uns_failed_params( + char *fail_var_name, /* variable name to be used in failure + must be scalar, per elem */ + float *threshold_val1, /* number to compare for failure */ + float *threshold_val2, /* number to compare for failure */ + int *threshold_operator1, /* Z_GREATER_THAN, Z_LESS_THAN, + Z_EQUAL_TO */ + int *threshold_operator2, /* Z_GREATER_THAN, Z_LESS_THAN, + Z_EQUAL_TO */ + int *logic_criteria2 + + ); #endif +/*---------------------- +** New For Version 2.050 +**----------------------*/ +#if defined USERD_API_205 || defined USERD_API_206 || defined USERD_API_207 || defined USERD_API_208 || defined USERD_API_209 || defined USERD_API_210 + +W32EXPORT int +USERD_get_number_of_species( int set_index ); + +W32EXPORT int +USERD_get_matsp_info(int set_index, + int *sp_ids, + char **sp_desc, + int *sppermatcnt, + int *sppermatlis); + +W32EXPORT int +USERD_rigidbody_existence( void ); + +#endif + +/*-------------------------------------------- + * New at 2.05, but modified for Version 2.080 + *-------------------------------------------- */ +#if defined USERD_API_205 || defined USERD_API_206 || defined USERD_API_207 +W32EXPORT int +USERD_rigidbody_values(int part_number, + float values[10]); +#endif + +#if defined USERD_API_208 || defined USERD_API_209 || defined USERD_API_210 +W32EXPORT int +USERD_rigidbody_values(int part_number, + float values[14]); +#endif + + + + +/*---------------------- +** New For Version 2.060 +**----------------------*/ +#if defined USERD_API_206 || defined USERD_API_207 || defined USERD_API_208 || defined USERD_API_209 || defined USERD_API_210 + +W32EXPORT int +USERD_get_structured_reader_cinching( void ); + +W32EXPORT int +USERD_set_block_range_and_stride(int file_pn, + int mini, int maxi, int stepi, + int minj, int maxj, int stepj, + int mink, int maxk, int stepk); +#endif +/*---------------------- +** New For Version 2.070 +**----------------------*/ +#if defined USERD_API_207 || defined USERD_API_208 || defined USERD_API_209 || defined USERD_API_210 + +/* non-optional functions go here */ + +#endif + +/* This is optional; defaults to 'Set file' and 'Set results' if not + * defined. If 'two_fields' is true, then both labels must have a + * non-NULL string otherwise the defaults will be used. + */ +W32EXPORT void +USERD_set_filename_button_labels(char filename_label_1[Z_MAX_USERD_NAME], + char filename_label_2[Z_MAX_USERD_NAME]); + +/* This is optional; defaults to TRUE if not defined. */ +W32EXPORT int +USERD_prefer_auto_distribute(void); + + + +/*---------------------- +** New For Version 2.090 +**----------------------*/ +#if defined USERD_API_209 || defined USERD_API_210 + +/* non-optional functions go here */ + +#endif + +/* These are optional */ +W32EXPORT int +USERD_get_vglyph_counts(int *num_vglyph_vectors, + int *num_vglyph_timelines); + +W32EXPORT int +USERD_get_vglyph_timeline_info(int vtl, + int *id, + int *numtimes, + int *before, + int *amidst, + int *after); + +W32EXPORT int +USERD_get_vglyph_timeline_times(int vtl, + float *times); + +W32EXPORT int +USERD_get_vglyph_vector_info(int vg, + int *id, + char *description, + int *type, + int *time_condition, + int *time_line, + int *part, + int *nidloc, + int *eidloc); + +W32EXPORT int +USERD_get_vglyph_vector_values(int vg, + float **values); + +W32EXPORT int +USERD_get_vglyph_vector_xyzloc(int vg, + float **xyzloc); + +/*---------------------- +** New For Version 2.100 +**----------------------*/ +#if defined USERD_API_210 + +W32EXPORT int +USERD_get_mat_scalars_desc(int set_index, + char **mesv_desc); +#endif + +/* These are optional */ +W32EXPORT int +USERD_get_matf_set_type(int set_index); + +/* special, optional functions */ +W32EXPORT void +USERD_reset_routine(void); + /*--------------------------------------------------------------------*/ #endif /*GLOBAL_EXTERN_PROTO_H*/ diff --git a/applications/utilities/postProcessing/graphics/ensightFoamReader/libuserd.C b/applications/utilities/postProcessing/graphics/ensightFoamReader/libuserd.C index 0a48995579..e65381a637 100644 --- a/applications/utilities/postProcessing/graphics/ensightFoamReader/libuserd.C +++ b/applications/utilities/postProcessing/graphics/ensightFoamReader/libuserd.C @@ -52,6 +52,7 @@ Description extern "C" { +#include "USERD_API.H" #include "global_extern.h" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -104,6 +105,7 @@ extern "C" #include "USERD_exit_routine.H" #include "USERD_get_model_extents.H" #include "USERD_get_reader_version.H" +#include "USERD_get_reader_release.H" #include "USERD_get_number_timesets.H" #include "USERD_get_timeset_description.H" #include "USERD_get_geom_timeset_number.H" @@ -130,7 +132,7 @@ extern "C" //********************************************************************** //====================================================================== -// STRUCTURED DATA STUFF - not used in foam +// STRUCTURED DATA STUFF - not used in OpenFOAM //====================================================================== //********************************************************************** From 5872f2a7e6b7e52342ad288a8bc9a9a642b3890f Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Thu, 6 Aug 2009 15:34:55 +0200 Subject: [PATCH 020/454] added test/ensightFoamReader with udr_checker.c from ensight80 - it looks okay to include: same copyrights as the other ensight headers --- .../test/ensightFoamReader/Make/files | 3 + .../test/ensightFoamReader/Make/options | 5 + applications/test/ensightFoamReader/README | 116 + .../ensightFoamReader/ensightFoamReaderTest | 92 + .../test/ensightFoamReader/global_extern.h | 1 + .../ensightFoamReader/global_extern_proto.h | 1 + .../test/ensightFoamReader/udr_checker-80.c | 5396 +++++++++++++++ .../test/ensightFoamReader/udr_checker-82.c | 5884 +++++++++++++++++ .../test/ensightFoamReader/udr_checker.c | 1 + 9 files changed, 11499 insertions(+) create mode 100644 applications/test/ensightFoamReader/Make/files create mode 100644 applications/test/ensightFoamReader/Make/options create mode 100644 applications/test/ensightFoamReader/README create mode 100755 applications/test/ensightFoamReader/ensightFoamReaderTest create mode 120000 applications/test/ensightFoamReader/global_extern.h create mode 120000 applications/test/ensightFoamReader/global_extern_proto.h create mode 100644 applications/test/ensightFoamReader/udr_checker-80.c create mode 100644 applications/test/ensightFoamReader/udr_checker-82.c create mode 120000 applications/test/ensightFoamReader/udr_checker.c diff --git a/applications/test/ensightFoamReader/Make/files b/applications/test/ensightFoamReader/Make/files new file mode 100644 index 0000000000..c8089bfc49 --- /dev/null +++ b/applications/test/ensightFoamReader/Make/files @@ -0,0 +1,3 @@ +udr_checker.c + +EXE = $(FOAM_USER_APPBIN)/ensightFoamReader-udr_checker diff --git a/applications/test/ensightFoamReader/Make/options b/applications/test/ensightFoamReader/Make/options new file mode 100644 index 0000000000..750aeb0d14 --- /dev/null +++ b/applications/test/ensightFoamReader/Make/options @@ -0,0 +1,5 @@ +EXE_INC = \ + -DUSERD_API_203 + +EXE_LIBS = \ + -luserd-foam diff --git a/applications/test/ensightFoamReader/README b/applications/test/ensightFoamReader/README new file mode 100644 index 0000000000..f12e6fd40f --- /dev/null +++ b/applications/test/ensightFoamReader/README @@ -0,0 +1,116 @@ +udr_checker +----------- + +udr_checker.c is a routine that can be used to debug EnSight User-defined +readers. It exists because of the difficulty of debugging dynamic shared +libraries when you don't have the source for the calling program (EnSight). + +If udr_checker.c is compiled and linked with your reader source code (including +access to any libraries needed, and the global_extern.h file), it will exercise +most options of you reader, giving feedback as it goes. The resulting +executable can be debugged using your favorite debugger. And if you have +memory/bounds checking software (such as purify), you can (and should) run it +with this executable to make sure that you are not overwriting things. Readers +that bash memory will cause problems when run with EnSight! + +You will note that the Makefile provided with the readers in the EnSight +distribution have a "checker" object. If you do a "make checker" instead of +just a "make", the "checker"executable will be produced. You may need to +modify these makefiles slightly if the locations of your reader files are +different than the normal. + + +-------------------------------------- +Once the "checker" executable exists, you can run the checker program by simply +invoking it: + +> checker + +And you will be prompted for the type of information that you provide in the +EnSight Data Reader dialog, namely: + +The path +filename_1 +[filename_2] Only if your reader uses two fields +swapbytes flag + Only if your reader implements extra GUI + one flag value per line + one field string per line + +There are certain command line options that you can use to control some aspects +of the checker program. One of the more useful is the ability to provide the +input just described in a file. This is done in this fashion: + +> checker -p + +And would be a simple ascii file with 3 [0r 4] lines: +line 1: the path +line 2: filename_1 +line 3: [filename_2] (if two_fields is TRUE) +line 3 or 4: 0 or 1, for swapbytes (0 is FALSE, 1 is TRUE) +remaining lines 0 or 1 for toggle disable enabled + one line for each toggle + 0 - num_pulldown_values for pulldown choice + one line for each pulldown + strings + one line for each field + +example playfile for an EnSight Gold reader casefile (entitled cube.play) +could look something like the following: (Note: two_fields is FALSE) +------------------- + +/usr/local/bin/data/ens +cube.case +0 + + +And you would invoke checker as: + +> checker -p check.play + +Another example playfile +with swapbytes 0, +two enabled toggles, +three pulldowns with the value 0 chosen +and a single field "sample field value" + +could look something like the following:: +---------------------- + +/mydirectory/subdir/ +myfile +0 +1 +1 +0 +0 +0 +sample field value + + +Other command line arguments are: +--------------------------------- +-server_number For checking server number routines. If you use this + option, you will be prompted for the total number of + servers and the current server number. These will then be + used in the calls to the server number routines. + +-gts # For specifying the geometry timestep to test. The default + is step 0. + The # is the (zero based) time step to read for geometry. + +-vts # For specifying the variable timestep to test. The default + is step 0. + The # is the (zero based) time step to read for variables. + + + +Testing optional routines using #defines +----------------------------------------- +For optional routines, such as the extra_gui, or var_extract_gui routines, you +must uncomment the proper #define in udr_checker.c + +Currently the ones available are: + +#define _EGS for extra gui routines +#define _VES for var extract gui routines diff --git a/applications/test/ensightFoamReader/ensightFoamReaderTest b/applications/test/ensightFoamReader/ensightFoamReaderTest new file mode 100755 index 0000000000..5dafa8dfaf --- /dev/null +++ b/applications/test/ensightFoamReader/ensightFoamReaderTest @@ -0,0 +1,92 @@ +#!/bin/sh +#------------------------------------------------------------------------------ +# ========= | +# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox +# \\ / O peration | +# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. +# \\/ M anipulation | +#------------------------------------------------------------------------------- +# License +# This file is part of OpenFOAM. +# +# OpenFOAM is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; either version 2 of the License, or (at your +# option) any later version. +# +# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License +# along with OpenFOAM; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# +# Script +# ensightFoamReaderTest +# +# Description +# start ensightFoamReader-udr_checker +# +#------------------------------------------------------------------------------ +usage() { + while [ "$#" -ge 1 ]; do echo "$1"; shift; done + cat</dev/null || usage "directory does not exist: '$2'" + shift 2 + ;; + *) + usage "unknown option/argument: '$*'" + ;; + esac +done + + +# check existence of essential files +for check in system/controlDict system/fvSchemes system/fvSolution +do + [ -s "$check" ] || usage "file does not exist: '$check'" +done + + +# export values that might be needed +export FOAM_CASE=$PWD +export FOAM_CASENAME=${PWD##*/} + +pathName=${PWD%/*} + +playFile=/tmp/ensightFoamReader.$$ +trap "rm -f $playFile 2>/dev/null; exit 0" EXIT TERM INT + +cat << PLAY_FILE > $playFile +$pathName +$FOAM_CASENAME +0 +PLAY_FILE + +echo "ensightFoamReader-udr_checker -p $playFile" + +ensightFoamReader-udr_checker -p $playFile + +#------------------------------------------------------------------------------ diff --git a/applications/test/ensightFoamReader/global_extern.h b/applications/test/ensightFoamReader/global_extern.h new file mode 120000 index 0000000000..09b4ffb70c --- /dev/null +++ b/applications/test/ensightFoamReader/global_extern.h @@ -0,0 +1 @@ +../../utilities/postProcessing/graphics/ensightFoamReader/global_extern.h \ No newline at end of file diff --git a/applications/test/ensightFoamReader/global_extern_proto.h b/applications/test/ensightFoamReader/global_extern_proto.h new file mode 120000 index 0000000000..7c23ba48d9 --- /dev/null +++ b/applications/test/ensightFoamReader/global_extern_proto.h @@ -0,0 +1 @@ +../../utilities/postProcessing/graphics/ensightFoamReader/global_extern_proto.h \ No newline at end of file diff --git a/applications/test/ensightFoamReader/udr_checker-80.c b/applications/test/ensightFoamReader/udr_checker-80.c new file mode 100644 index 0000000000..0cbbceba18 --- /dev/null +++ b/applications/test/ensightFoamReader/udr_checker-80.c @@ -0,0 +1,5396 @@ +/*---------------------------------- + * User Defined Reader - checker + *----------------------------------*/ + +/******************************************************************** + * + * **************************************** + * Copyright 2004 Computational Engineering International, Inc. + * All Rights Reserved. + * + * Restricted Rights Legend + * + * Use, duplication, or disclosure of this + * software and its documentation by the + * Government is subject to restrictions as + * set forth in subdivision [(b)(3)(ii)] of + * the Rights in Technical Data and Computer + * Software clause at 52.227-7013. + *******************************************************************/ + +/*---------------------------------------------------------------------- + * MAJOR ROUTINES ACCESS: (VERSION 2.00) Gold_Userd API + * + * Get the name of the reader + * ========================== + * USERD_get_name_of_reader + * USERD_get_extra_gui_numbers (optional) + * USERD_get_extra_gui_defaults (optional) + * + * Get the reader version + * ====================== + * USERD_get_reader_version + * + * Set the filenames, gather timeset and time info + * =============================================== + * USERD_set_extra_gui_data (optional) + * USERD_set_server_number + * USERD_set_filenames + * USERD_get_number_of_timesets + * USERD_get_geom_timeset_number + * + * for each timeset: + * USERD_get_timeset_description + * USERD_get_num_of_time_steps + * USERD_get_sol_times + * + * USERD_set_time_set_and_step + * + * + * Gather variable and time info + * ============================= + * USERD_get_number_of_variables + * USERD_get_gold_variable_info + * + * + * Get initial part building info + * ============================== + * USERD_set_time_set_and_step + * USERD_get_changing_geometry_status + * USERD_get_node_label_status + * USERD_get_element_label_status + * USERD_get_number_of_files_in_dataset + * USERD_get_dataset_query_file_info + * USERD_get_descrip_lines (geometry) + * USERD_get_number_of_model_parts + * USERD_get_gold_part_build_info + * USERD_get_ghosts_in_model_flag + * USERD_get_maxsize_info + * USERD_get_ghosts_in_block_flag (if any ghost cells in model) + * USERD_get_model_extents **OR** + * USERD_get_part_coords **AND/OR** + * USERD_get_block_coords_by_component + * + * + * + * Part Builder + * ============ + * + * both unstructured and structured + * -------------------------------- + * USERD_set_time_set_and_step + * + * if unstructured + * --------------- + * USERD_get_part_element_ids_by_type + * USERD_get_part_elements_by_type + * + * if any nsided elements: + * USERD_get_nsided_conn + * + * if any nfaced elements: + * USERD_get_nfaced_nodes_per_face + * USERD_get_nfaced_conn + * + * USERD_get_part_coords + * USERD_get_part_node_ids + * + * else if structured + * ------------------ + * USERD_get_block_iblanking + * USERD_get_block_coords_by_component + * USERD_get_block_ghost_flags + * USERD_get_part_node_ids (If node ids given) + * USERD_get_part_element_ids_by_type (If element ids given) + * + * both again + * ---------- + * USERD_get_border_availability (If border representation + * USERD_get_border_elements_by_type is selected) + * + * USERD_stop_part_building + * + * + * Changing geometry + * ================= + * + * changing coords only + * -------------------- + * USERD_set_time_set_and_step + * USERD_get_descrip_lines + * USERD_get_part_coords + * USERD_get_block_coords_by_component + * + * changing connectivity + * --------------------- + * USERD_set_time_set_and_step + * USERD_get_descrip_lines + * USERD_get_number_of_model_parts + * USERD_get_gold_part_build_info + * USERD_get_ghosts_in_model_flag + * USERD_get_ghosts_in_block_flag (If any ghost cells in model) + * USERD_get_model_extents **OR** + * USERD_get_part_coords **AND/OR** + * USERD_get_block_coords_by_component + * USERD_get_part_element_ids_by_type + * USERD_get_part_elements_by_type + * USERD_get_part_coords + * USERD_get_part_node_ids + * USERD_get_block_iblanking + * USERD_get_block_coords_by_component + * USERD_get_block_ghost_flags (If ghost cells in part) + * USERD_get_part_node_ids (If node ids given) + * USERD_get_part_element_ids_by_type (If element ids given) + * + * USERD_get_border_availability (If border representation + * USERD_get_border_elements_by_type is selected) + * + * + * Loading Variables + * ================== + * + * constants + * --------- + * USERD_set_time_set_and_step + * USERD_get_constant_val + * + * scalars/vectors/tensors + * ----------------------- + * USERD_get_description_lines + * USERD_set_time_set_and_step + * USERD_get_var_by_component + * + * + * Node or Element queries over time + * ================================= + * USERD_get_var_value_at_specific + * + * + * At 2.03, added: + * --------------- + * + * Materials + * ========= + * USERD_get_number_of_material_sets + * USERD_get_matf_set_info + * + * If any material sets in the model (calls once per material set) + * USERD_get_number_of_materials + * USERD_get_matf_var_info + * + * For each element type of each part containing material ids + * USERD_size_matf_data + * USERD_load_matf_data + * + * + * At 2.04, added: + * --------------- + * USERD_get_uns_failed_params - Sets params used in element failure + * + * + *----------------------------------------------------------------------*/ + +/*---------------------------------------------------------------------- + * MAJOR ROUTINES ACCESS: (Version 1.00) original API + * + * Get the name of the reader + * ========================== + * USERD_get_name_of_reader + * USERD_get_extra_gui_numbers (optional #define _EGS) + * USERD_get_extra_gui_defaults (optional #define _EGS) + * + * Set the filenames + * ================= + * USERD_set_extra_gui_data (optional #define _EGS) + * USERD_set_filenames + * USERD_get_number_of_time_steps + * USERD_get_solution_times + * USERD_set_time_step + * + * + * Gather variable and time info + * ============================= + * USERD_get_number_of_variables + * USERD_get_variable_info + * + * + * Get initial part building info + * ============================== + * USERD_set_time_step + * USERD_get_changing_geometry_status + * USERD_get_node_label_status + * USERD_get_element_label_status + * USERD_get_number_of_files_in_dataset + * USERD_get_dataset_query_file_info + * USERD_get_description_lines (geometry) + * USERD_get_number_of_model_parts + * USERD_get_part_build_info + * USERD_get_number_global_nodes + * USERD_get_global_coords + * USERD_get_block_coords_by_component + * + * Failure Info + * ============ + * USERD_get_uns_failed_params + * + * + * Part Builder + * ============ + * USERD_set_time_step + * USERD_get_global_coords + * USERD_get_global_node_ids + * USERD_get_element_connectivities_for_part + * USERD_get_element_ids_for_part + * USERD_get_block_iblanking + * USERD_get_block_coords_by_component + * + * USERD_stop_part_building + * + * + * Changing geometry + * ================= + * + * changing coords only + * -------------------- + * USERD_set_time_step + * USERD_get_global_coords + * USERD_get_block_coords_by_component + * + * changing connectivity + * --------------------- + * USERD_set_time_step + * USERD_get_number_of_model_parts + * USERD_get_part_build_info + * USERD_get_number_global_nodes + * USERD_get_global_coords + * USERD_get_global_node_ids + * USERD_get_element_connectivities_for_part + * USERD_get_element_ids_for_part + * USERD_get_block_iblanking + * USERD_get_block_coords_by_component + * + * Loading Variables + * ================= + * + * constants: + * ---------- + * USERD_set_time_step + * USERD_get_constant_value + * + * scalars: + * -------- + * USERD_get_description_lines + * USERD_set_time_step + * USERD_get_scalar_values + * USERD_get_block_scalar_values + * + * vectors: + * -------- + * USERD_get_description_lines + * USERD_set_time_step + * USERD_get_vector_values + * USERD_get_block_vector_values_by_component + * + * + * Node or Element queries over time + * ================================= + * USERD_get_variable_value_at_specific + * + *----------------------------------------------------------------------*/ +#include +#include +#ifndef WIN32 +#include +#endif +#include +#include +#include +#ifndef CONVEX +#include +#endif +#include + +#include "global_extern.h" + +/* ----------------------------------------------- + * If you wish to test out the Extra GUI stuff + * you need to uncomment this section + * + * #define _EGS + * + * ----------------------------------------------- */ + +#if (!defined USERD_API_100) +#define GT_USERD_API_100 +#endif + +#if (!defined USERD_API_100 && !defined USERD_API_200) +#define GT_USERD_API_200 +#endif + +#if (!defined USERD_API_100 && !defined USERD_API_200 && !defined USERD_API_201 && !defined USERD_API_202) +#define GT_USERD_API_202 +#endif + +#if (!defined USERD_API_100 && !defined USERD_API_200 && !defined USERD_API_201 && !defined USERD_API_202 && !defined USERD_API_203) +#define GT_USERD_API_203 +#endif + + +#define EOS '\0' + +typedef struct { + int id; /* part_id */ + char desc[Z_BUFL]; /* description given in the file */ + int type; /* Z_UNSTRUCTURED, Z_STRUCTURED, Z_IBLANKED */ + int ne[Z_MAXTYPE]; /* Number of elements per type (Z_UNSTRUCTURED) */ + /* or ne[0] = I dimension (Z_STRUCTURED) */ + /* ne[1] = J dimension */ + /* ne[2] = K dimension */ + int nn; /* Num of unstructured nodes (All_Local only) */ + int ghosts; /* TRUE if ghost cells, FALSE otherwise */ +}BUILDINFO; + +typedef struct { + char description[Z_BUFL]; /* description */ + char filename[Z_BUFL]; /* real filename */ + char ifilename[Z_BUFL]; /* imaginary filename */ + int type; + int classify; + int complex; + float freq; + int contran; + int timeset; +}VARINFO; + + +typedef struct { + char name[12]; /* Z_POINT, Z_G_POINT, Z_BAR02, ... */ + int con_len; /* Number of nodes per element */ +}EINFO; + + +/* Global variables + *-----------------*/ +int Geom_status; +int Node_labels; +int Element_labels; +int Ghosts_in_model; +int Num_parts; +int Num_vars; +int Num_materials_sets; +BUILDINFO *Pbuild; +VARINFO *Varinfo; +char Version_number[Z_MAX_USERD_NAME]; +int Num_time_sets; +int Num_time_steps; + +/* ------------------ + * Extra GUI stuff + * ------------------ */ +int Num_toggles = 0; +int Num_pulldowns = 0; +int Num_fields = 0; +char **Toggle_title; +int *Toggle_default_status; +char **Pulldown_title; +int *Pulldown_number_in_list; +int *Pulldown_default_selection; +char ***Pulldown_item_strings; +char **Field_title; +char **Field_user_string; +int *Toggle_choice; /* user choice */ +int *Pulldown_choice; /* user choice */ + +/* --------------------------- + * Failed elements (API 2.04) + * --------------------------- */ +int Any_uns_failed_model_elems = FALSE; + + +#if (defined USERD_API_100 || defined USERD_API_200) +EINFO Elem_info[Z_MAXTYPE] = {"Z_POINT",1, + "Z_BAR02",2, + "Z_BAR03",3, + "Z_TRI03",3, + "Z_TRI06",6, + "Z_QUA04",4, + "Z_QUA08",8, + "Z_TET04",4, + "Z_TET10",10, + "Z_PYR05",5, + "Z_PYR13",13, + "Z_PEN06",6, + "Z_PEN15",15, + "Z_HEX08",8, + "Z_HEX20",20}; +#elif defined USERD_API_201 +EINFO Elem_info[Z_MAXTYPE] = {"Z_POINT", 1, + "Z_G_POINT",1, + "Z_BAR02", 2, + "Z_G_BAR02",2, + "Z_BAR03", 3, + "Z_G_BAR03",3, + "Z_TRI03", 3, + "Z_G_TRI03",3, + "Z_TRI06", 6, + "Z_G_TRI06",6, + "Z_QUA04", 4, + "Z_G_QUA04",4, + "Z_QUA08", 8, + "Z_G_QUA08",8, + "Z_TET04", 4, + "Z_G_TET04",4, + "Z_TET10", 10, + "Z_G_TET10",10, + "Z_PYR05", 5, + "Z_G_PYR05",5, + "Z_PYR13", 13, + "Z_G_PYR13",13, + "Z_PEN06", 6, + "Z_G_PEN06",6, + "Z_PEN15", 15, + "Z_G_PEN15",15, + "Z_HEX08", 8, + "Z_G_HEX08",8, + "Z_HEX20", 20, + "Z_G_HEX20",20}; +#else +EINFO Elem_info[Z_MAXTYPE] = {"Z_POINT", 1, + "Z_G_POINT",1, + "Z_BAR02", 2, + "Z_G_BAR02",2, + "Z_BAR03", 3, + "Z_G_BAR03",3, + "Z_TRI03", 3, + "Z_G_TRI03",3, + "Z_TRI06", 6, + "Z_G_TRI06",6, + "Z_QUA04", 4, + "Z_G_QUA04",4, + "Z_QUA08", 8, + "Z_G_QUA08",8, + "Z_TET04", 4, + "Z_G_TET04",4, + "Z_TET10", 10, + "Z_G_TET10",10, + "Z_PYR05", 5, + "Z_G_PYR05",5, + "Z_PYR13", 13, + "Z_G_PYR13",13, + "Z_PEN06", 6, + "Z_G_PEN06",6, + "Z_PEN15", 15, + "Z_G_PEN15",15, + "Z_HEX08", 8, + "Z_G_HEX08",8, + "Z_HEX20", 20, + "Z_G_HEX20",20, + "Z_NSIDED", 1, /* Not yet implemented */ + "Z_G_NSIDED",1, /* Not yet implemented */ + "Z_NFACED", 1, /* Not yet implemented */ + "Z_G_NFACED",1}; /* Not yet implemented */ +#endif + + +/* Prototypes + *-----------*/ +static int load_fail_defaults(void); +static int prelim_info(int *two_fields, int *any_extra_gui); +static int get_input(int set_server_number, + int use_playfile, + char playfile[Z_MAXFILENP], + int two_fields, + int any_extra_gui, + int *swapbytes); +static int time_info( void ); +static int part_build_info(int geom_time_step); +static int variable_info( void ); + +#if (defined GT_USERD_API_100) +static int gold_part_builder(int geom_time_step); +static int gold_var_loader(int var_time_step); +#else +static int part_builder(int geom_time_step); +static int var_loader(int var_time_step); +#endif + +#if (defined GT_USERD_API_100) +static int materials_info( void ); +static int gold_materials_loader(int geom_time_step); +#endif + +static int entity_querys(int var_time_step); +static int exercise_bkup( void ); +static void usage( void ); + + +/*============= + * Main Routine + *=============*/ +#ifdef WIN32 +int main(int argc, char *argv[]) +#else +int main(int argc, char *argv[]) +#endif +{ + /* Command line option variables + *------------------------------*/ + int set_server_number = FALSE; + int use_playfile = FALSE; + char playfile[Z_MAXFILENP]; + FILE *fplay; + int geom_time_step = 0; + int var_time_step = 0; + + /* Other local variables + *----------------------*/ + int i, j; + int err; + int two_fields; + int any_extra_gui = FALSE; + int swapbytes; + int indx; + + /*---------------------------- + * Command argument processing + *----------------------------*/ + fprintf(stderr,"\n"); + fprintf(stderr,"\n"); + fprintf(stderr,"********************************************\n"); + fprintf(stderr,"* EnSight User Defined Reader Debug Tool *\n"); + fprintf(stderr,"********************************************\n"); + fprintf(stderr,"\n"); + + indx = 1; + while(indx < argc) { + + if(!strcmp("-h",argv[indx])) { + usage(); + } + else if(!strcmp("-help",argv[indx])) { + usage(); + } + + /* if you want to test the server number routines + * + * Use: + * > checker -server_number + * + * You will then be prompted for the current and total + * number of servers + *-----------------------------------------------*/ + else if(!strcmp("-server_number",argv[indx])) { + set_server_number = TRUE; + } + + + /* if you want to use a "playfile" instead of being prompted + * for the data loader information + * + * Use: + * > checker -p + * + * This playfile should have 3 [or 4] lines: + * line 1: the path + * line 2: filename_1 + * line 3: [filename_2] (if two_fields is TRUE) + * line 4: 0 or 1, for swapytes (0 is FALSE, 1 is TRUE) + * + * example (two_fields is FALSE, so only 3 lines): + * + * /usr/scratch/stealth/bjn/dat/sp_gold/binary + * simple.case + * 1 + * + *------------------------------------------------------*/ + else if(!strcmp("-p",argv[indx])) { + indx++; + if((indx < argc) && (argv[indx][0] != '-')) { + use_playfile = TRUE; + memset(playfile,EOS,Z_MAXFILENP); + strcpy(playfile,argv[indx]); + } + else { + usage(); + } + } + + /* if you want to specify the geometry timestep to test (default is step 0) + * + * Use: + * > checker -gts # + * + * Where # is the step number (zero based) + *-------------------------------------------------------------------------*/ + else if(!strcmp("-gts",argv[indx])) { + indx++; + if((indx < argc) && (argv[indx][0] != '-')) { + geom_time_step = atoi(argv[indx]); + } + else { + usage(); + } + } + + /* if you want to specify the variable timestep to test (default is step 0) + * (will use this step for the appropriate timeset of each variable) + * + * Use: + * > checker -vts # + * + * Where # is the step number (zero based) + *-------------------------------------------------------------------------*/ + else if(!strcmp("-vts",argv[indx])) { + indx++; + if((indx < argc) && (argv[indx][0] != '-')) { + var_time_step = atoi(argv[indx]); + } + else { + usage(); + } + } + else { + usage(); + } + + indx++; + } + + + /*------------------------------------------------------------- + * + * Now start exercising EnSight + * + *--------------------------------------------------------------*/ + + /*----------------- + * Preliminary info + *-----------------*/ + err = prelim_info(&two_fields,&any_extra_gui); + if(err == Z_ERR) { + fprintf(stderr,"Stopping because of error in prelim_info\n"); + exit(1); + } + + + /*------------------ + * User input needed + *------------------*/ + err = get_input(set_server_number, + use_playfile, + playfile, + two_fields, + any_extra_gui, + &swapbytes); + if(err == Z_ERR) { + fprintf(stderr,"Stopping because of error in get_input\n"); + exit(1); + } + + + /*---------- + * Time info + *----------*/ + err = time_info(); + if(err == Z_ERR) { + fprintf(stderr,"Stopping because of error in time_info\n"); + exit(1); + } + + + /*---------------- + * Part build info + *----------------*/ + err = part_build_info(geom_time_step); + if(err == Z_ERR) { + fprintf(stderr,"Stopping because of error in part_build_info\n"); + exit(1); + } + + + /*------------------ + * Get Variable Info + *------------------*/ + err = variable_info(); + if(err == Z_ERR) { + fprintf(stderr,"Stopping because of error in variable_info\n"); + exit(1); + } + + +#if (defined GT_USERD_API_202) + /*------------------- + * Get Materials Info + *-------------------*/ + err = materials_info(); + if(err == Z_ERR) { + fprintf(stderr,"Stopping because of error in materials_info\n"); + exit(1); + } +#endif + +#if (defined GT_USERD_API_203) + if (Z_ERR == load_fail_defaults()) { + fprintf(stderr,"Stopping due to error in failed element flag routine\n"); + exit(1); + } +#endif + + /*------------------------ + * Act like building parts + *------------------------*/ + if(Num_parts > 0) { + +#if (defined GT_USERD_API_100) + err = gold_part_builder(geom_time_step); +#else + err = part_builder(geom_time_step); +#endif + if(err == Z_ERR) { + fprintf(stderr,"Stopping because of error in part_builder\n"); + exit(1); + } + else { + USERD_stop_part_building(); + } + } + + + /*--------------------------- + * Act like loading variables + *---------------------------*/ + if(Num_vars > 0) { + +#if (defined GT_USERD_API_100) + err = gold_var_loader(var_time_step); +#else + err = var_loader(var_time_step); +#endif + if(err == Z_ERR) { + fprintf(stderr,"Stopping because of error in var_loader\n"); + exit(1); + } + } + +#if (defined GT_USERD_API_202) + /*--------------------------- + * Act like loading materials + *---------------------------*/ + if(Num_materials_sets > 0) { + err = gold_materials_loader(geom_time_step); + if(err == Z_ERR) { + fprintf(stderr,"Stopping because of error in materials_loader\n"); + exit(1); + } + } +#endif + + + + /*---------------------------------------------------- + * See if can do node and/or element queries over time + *----------------------------------------------------*/ + if(Num_parts > 0 && + Num_vars > 0) { + err = entity_querys(var_time_step); + if(err == Z_ERR) { + fprintf(stderr,"Stopping because of error in entity_querys\n"); + exit(1); + } + } + + /*---------------------------------------- + * Call the bkup file once in save mode, + * then again in restore mode - so someone + * could debug if desired + *----------------------------------------*/ + err = exercise_bkup(); + if(err == Z_ERR) { + fprintf(stderr,"Stopping due to error in saving and/or restoring archive\n"); + exit(1); + } + + /*------------- + * Exit Routine + *-------------*/ + fprintf(stderr,"\n----------------- exiting ---------------\n"); + +#if (defined GT_USERD_API_100) + USERD_exit_routine(); +#endif + + fprintf(stderr,"\n\n"); +} + +/*-------------- + * Usage routine + *--------------*/ +static void +usage( void ) +{ + fprintf(stderr,"------------------------------------------------------------\n"); + fprintf(stderr,"USAGE: checker [-p pfile] [-server_number] [-gts #] [-vts #]\n"); + fprintf(stderr,"------------------------------------------------------------\n"); + fprintf(stderr," -h, -help Prints out this USAGE text.\n"); + fprintf(stderr," -gts # Specify the geometry times step to use.)\n"); + fprintf(stderr," -p pfile Plays the checker playfile (pfile).\n"); + fprintf(stderr," -server_number Cause servers numbers to be prompted for.\n"); + fprintf(stderr," -vts # Specify the variable times step to use.)\n"); + fprintf(stderr,"\n"); + exit(1); +} + + + + +/*------------ + * prelim_info + *------------*/ +static int +prelim_info(int *two_fields, int *any_extra_gui) +{ + int err; + char reader_name[Z_MAX_USERD_NAME]; + char release_number[Z_MAX_USERD_NAME]; + char description[Z_MAXFILENP]; + int i,j; + + *any_extra_gui = FALSE; + + /* Get the reader name + *--------------------*/ + err = USERD_get_name_of_reader(reader_name,two_fields); + if(err == Z_OK) { + fprintf(stderr," Name of reader: %s\n",reader_name); + if(*two_fields==1) { + fprintf(stderr," two_fields: TRUE\n"); + } + else if(*two_fields==0){ + fprintf(stderr," two_fields: FALSE\n"); + } + else if(*two_fields < 0) { + fprintf(stderr," two_fields: -1 (optional string) \n"); + } + } + else { + fprintf(stderr,"Error: Could not get name of reader\n"); + return(Z_ERR); + } + + /* Get the Extra GUI stuff (optional) + * ---------------------------------------------------------- */ +#ifdef _EGS + + /* Get the Extra GUI numbers of toggles, pulldowns, & fields + * ---------------------------------------------------------- */ + + USERD_get_extra_gui_numbers( &Num_toggles, + &Num_pulldowns, + &Num_fields ); + + if ( Num_toggles > 0 || Num_pulldowns > 0 || Num_fields > 0 ) { + + + *any_extra_gui = TRUE; + + if (Num_toggles>0) { + Toggle_title = (char **) calloc(Num_toggles,sizeof(char*)); + if (Toggle_title == (char **)NULL) return(Z_ERR); + for (i=0; i 0) { + Pulldown_title = (char **) calloc( Num_pulldowns , sizeof(char*) ); + if (Pulldown_title == (char **)NULL) return(Z_ERR); + + Pulldown_item_strings = (char ***) calloc( Num_pulldowns , sizeof(char**) ); + if (Pulldown_item_strings == (char ***)NULL) return(Z_ERR); + + for (i=0; i 0) { + Field_title = (char **) calloc(Num_fields,sizeof(char*)); + Field_user_string = (char **) calloc(Num_fields,sizeof(char*)); + if (Field_title == (char **) NULL) return(Z_ERR); + for (i=0; i 0) { + fprintf(stderr,"Error: timeset numbers must be 1 or greater\n"); + fprintf(stderr," (unless Num_time_sets is zero also)\n"); + } + + + /* For each timeset + *-----------------*/ + for(ts=1; ts<=Num_time_sets; ++ts) { + + fprintf(stderr," Timeset %d:\n",ts); + + /* Get the timeset descriptions + *-----------------------------*/ + err = USERD_get_timeset_description(ts,ts_desc); + if(err == Z_ERR) { + fprintf(stderr,"Error: getting timeset description\n"); + return(Z_ERR); + } + else { + fprintf(stderr," description: %s\n",ts_desc); + } + + /* Get the number of time steps + *-----------------------------*/ + Num_time_steps = USERD_get_num_of_time_steps(ts); + fprintf(stderr," number of time steps: %d\n",Num_time_steps); + if(Num_time_steps < 1) { + fprintf(stderr," Error: Number of time steps returned: %d\n",Num_time_steps); + fprintf(stderr," (Must be >0 to be okay)\n"); + return(Z_ERR); + } + + + /* Get the solution times + *-----------------------*/ + if(Num_time_steps > 0) { + sol_times = (float *) calloc(Num_time_steps,sizeof(float)); + if(sol_times == (float *)NULL) { + fprintf(stderr,"Error: allocating for solution times\n"); + return(Z_ERR); + } + else { + err = USERD_get_sol_times(ts,sol_times); + if(err == Z_ERR) { + fprintf(stderr,"Error: getting solution times\n"); + return(Z_ERR); + } + else { + for(i=0; i0 to be okay)\n"); + return(Z_ERR); + } + + + /* Get the solution times + *-----------------------*/ + if(Num_time_steps > 0) { + sol_times = (float *) calloc(Num_time_steps,sizeof(float)); + if(sol_times == (float *)NULL) { + fprintf(stderr,"Error: allocating for solution times\n"); + return(Z_ERR); + } + else { + err = USERD_get_solution_times(sol_times); + if(err == Z_ERR) { + fprintf(stderr,"Error: getting solution times\n"); + return(Z_ERR); + } + else { + for(i=0; i 0) { + + qfiles = (Z_QFILES *) calloc(num_dataset_files,sizeof(Z_QFILES)); + if(qfiles == (Z_QFILES *)NULL) { + fprintf(stderr,"Error: allocating for dataset query files\n"); + return(Z_ERR); + } + else { + + for(i=0; i 0) { + fprintf(stderr," Number of parts: %d\n",Num_parts); + } + else { + fprintf(stderr," Problems getting number of parts\n"); + return(Z_ERR); + } + + + + /* Get the gold part build info + *-----------------------------*/ + Pbuild = (BUILDINFO *) calloc(Num_parts,sizeof(BUILDINFO)); + if(Pbuild == (BUILDINFO *)NULL) { + fprintf(stderr," Problems allocating for Pbuild structure\n"); + return(Z_ERR); + } + + + part_ids = (int *) calloc(Num_parts,sizeof(int)); + if(part_ids == (int *)NULL) { + fprintf(stderr," Problems allocating for part ids\n"); + return(Z_ERR); + } + + part_types = (int *) calloc(Num_parts,sizeof(int)); + if(part_types == (int *)NULL) { + fprintf(stderr," Problems allocating for part types\n"); + return(Z_ERR); + } + + part_descriptions = (char **) calloc(Num_parts,sizeof(char *)); + if(part_descriptions == (char **)NULL) { + fprintf(stderr," Problems allocating for part descriptions\n"); + return(Z_ERR); + } + else { + for(i=0; i 0) { + fprintf(stderr," # %s elements: %d\n", + Elem_info[j].name,num_elems[i][j]); + Pbuild[i].ne[j] = num_elems[i][j]; + } + } + + if(part_types[i] != Z_UNSTRUCTURED) { + + /* For this checker, we will place the following in the + * Pbuild[].ne[] structure: + * + * Note this is can be used for block size whether ranges or not + * ------------------------------------------------------------- + * Pbuild[].ne[0] = i dim of current block (to the range selected) + * Pbuild[].ne[1] = j dim of current block (to the range selected) + * Pbuild[].ne[2] = k dim of current block (to the range selected) + * + * Thus if ranges: + * --------------- + * Pbuild[].ne[3] = i min range (-1 indicates no ranges) + * Pbuild[].ne[4] = i max range + * Pbuild[].ne[5] = i min range + * Pbuild[].ne[6] = i max range + * Pbuild[].ne[7] = i min range + * Pbuild[].ne[8] = i max range + * + * Pbuild[].ne[9] = i dim of total block (if ranges) + * Pbuild[].ne[10] = j dim of total block (if ranges) + * Pbuild[].ne[11] = k dim of total block (if ranges) + * + * What comes back from the api is: + * -------------------------------- + * before 2.03 (no ranges) + * ----------------------- + * ijk_dimensions[][0] = i dim of block + * ijk_dimensions[][1] = j dim of block + * ijk_dimensions[][2] = k dim of block + * + * at 2.03 (if no ranges) + * ------- + * ijk_dimensions[][0] = i dim of block + * ijk_dimensions[][1] = j dim of block + * ijk_dimensions[][2] = k dim of block + * ijk_dimensions[][3] = -1 + * + * at 2.03 (if ranges) + * ------- + * ijk_dimensions[][0] = i dim of total block + * ijk_dimensions[][1] = j dim of total block + * ijk_dimensions[][2] = k dim of total block + * ijk_dimensions[][3] = i min range + * ijk_dimensions[][4] = i max range + * ijk_dimensions[][5] = j min range + * ijk_dimensions[][6] = j max range + * ijk_dimensions[][7] = k min range + * ijk_dimensions[][8] = k max range + *--------------------------------------------------------------*/ + +#if (defined GT_USERD_API_202) + if(ijk_dimensions[i][3] == -1) { + fprintf(stderr," ijk_dimensions: %d %d %d\n", + ijk_dimensions[i][0], + ijk_dimensions[i][1], + ijk_dimensions[i][2]); + Pbuild[i].ne[0] = ijk_dimensions[i][0]; + Pbuild[i].ne[1] = ijk_dimensions[i][1]; + Pbuild[i].ne[2] = ijk_dimensions[i][2]; + Pbuild[i].ne[3] = ijk_dimensions[i][3]; + } + else { + + /* If empty part + *--------------*/ + if(ijk_dimensions[i][0] == 0 && + ijk_dimensions[i][1] == 0 && + ijk_dimensions[i][2] == 0) { + fprintf(stderr," ijk_dimensions: %d %d %d\n", + ijk_dimensions[i][0], + ijk_dimensions[i][1], + ijk_dimensions[i][2]); + Pbuild[i].ne[0] = ijk_dimensions[i][0]; + Pbuild[i].ne[1] = ijk_dimensions[i][1]; + Pbuild[i].ne[2] = ijk_dimensions[i][2]; + Pbuild[i].ne[3] = -1; + } + + /* range part + *-----------*/ + else { + Pbuild[i].ne[0] = ijk_dimensions[i][4] - ijk_dimensions[i][3] + 1; + Pbuild[i].ne[1] = ijk_dimensions[i][6] - ijk_dimensions[i][5] + 1; + Pbuild[i].ne[2] = ijk_dimensions[i][8] - ijk_dimensions[i][7] + 1; + + Pbuild[i].ne[3] = ijk_dimensions[i][3]; + Pbuild[i].ne[4] = ijk_dimensions[i][4]; + Pbuild[i].ne[5] = ijk_dimensions[i][5]; + Pbuild[i].ne[6] = ijk_dimensions[i][6]; + Pbuild[i].ne[7] = ijk_dimensions[i][7]; + Pbuild[i].ne[8] = ijk_dimensions[i][8]; + + Pbuild[i].ne[9] = ijk_dimensions[i][0]; + Pbuild[i].ne[10] = ijk_dimensions[i][1]; + Pbuild[i].ne[11] = ijk_dimensions[i][2]; + + fprintf(stderr," Part has ranges:\n"); + fprintf(stderr," ijk dimensions of total block: %d %d %d\n", + Pbuild[i].ne[9], + Pbuild[i].ne[10], + Pbuild[i].ne[11]); + fprintf(stderr," i range: %d to %d\n", + Pbuild[i].ne[3], + Pbuild[i].ne[4]); + fprintf(stderr," j range: %d to %d\n", + Pbuild[i].ne[5], + Pbuild[i].ne[6]); + fprintf(stderr," k range: %d to %d\n", + Pbuild[i].ne[7], + Pbuild[i].ne[8]); + fprintf(stderr," ijk dimensions of range portion: %d %d %d\n", + Pbuild[i].ne[0], + Pbuild[i].ne[1], + Pbuild[i].ne[2]); + } + } +#else + fprintf(stderr," ijk_dimensions: %d %d %d\n", + ijk_dimensions[i][0], + ijk_dimensions[i][1], + ijk_dimensions[i][2]); + Pbuild[i].ne[0] = ijk_dimensions[i][0]; + Pbuild[i].ne[1] = ijk_dimensions[i][1]; + Pbuild[i].ne[2] = ijk_dimensions[i][2]; + Pbuild[i].ne[3] = -1; +#endif + if(part_types[i] == Z_IBLANKED) { + fprintf(stderr," Ibanking options on:\n"); + if(iblanking_options[i][Z_EXT]) { + fprintf(stderr," Z_EXT\n"); + } + if(iblanking_options[i][Z_INT]) { + fprintf(stderr," Z_INT\n"); + } + if(iblanking_options[i][Z_BND]) { + fprintf(stderr," Z_BND\n"); + } + if(iblanking_options[i][Z_INTBND]) { + fprintf(stderr," Z_INTBND\n"); + } + if(iblanking_options[i][Z_SYM]) { + fprintf(stderr," Z_SYM\n"); + } + } + } + } + } + + +#if (defined GT_USERD_API_200) + + /* Get ghosts in model flag + *-------------------------*/ + Ghosts_in_model = USERD_get_ghosts_in_model_flag(); + if(Ghosts_in_model) { + fprintf(stderr," Ghosts in Model: TRUE\n"); + } + else { + fprintf(stderr," Ghosts in Model: FALSE\n"); + } + + /* Get ghosts in block flag - if needed + *-------------------------------------*/ + for(i=1; i<=Num_parts; ++i) { + if(part_types[i-1] != Z_UNSTRUCTURED && Ghosts_in_model) { + ghosts_in_block = USERD_get_ghosts_in_block_flag(i); + Pbuild[i-1].ghosts = ghosts_in_block; + if(ghosts_in_block) { + fprintf(stderr," Ghosts in block part %d: TRUE\n",i); + } + else { + fprintf(stderr," Ghosts in block part %d: FALSE\n",i); + } + } + } + +#endif + + +#if (defined GT_USERD_API_100) + + /* Get maxsize info + *-----------------*/ + max_num_nodes = (int *) calloc(Num_parts,sizeof(int)); + if(max_num_nodes == (int *)NULL) { + fprintf(stderr," Problems allocating for part max num of nodes\n"); + return(Z_ERR); + } + + max_num_elems = (int **) calloc(Num_parts,sizeof(int *)); + if(max_num_elems == (int **)NULL) { + fprintf(stderr," Problems allocating for part max num of elements\n"); + return(Z_ERR); + } + else { + for(i=0; i 0) { + fprintf(stderr," max # %s elems: %d\n", + Elem_info[j].name,max_num_elems[i][j]); + } + } + + if(part_types[i] != Z_UNSTRUCTURED) { + fprintf(stderr," max_ijk_dimensions: %d %d %d\n", + max_ijk_dimensions[i][0], + max_ijk_dimensions[i][1], + max_ijk_dimensions[i][2]); + } + } + } + + /* Get model extents - if given + *-----------------------------*/ + err = USERD_get_model_extents(extents); + if(err == Z_ERR) { + fprintf(stderr," No extents given\n"); + } + else { + fprintf(stderr," Min x: %g\n",extents[0]); + fprintf(stderr," Max x: %g\n",extents[1]); + fprintf(stderr," Min y: %g\n",extents[2]); + fprintf(stderr," Max y: %g\n",extents[3]); + fprintf(stderr," Min z: %g\n",extents[4]); + fprintf(stderr," Max z: %g\n",extents[5]); + } + +#endif + + /* Free the allocated memory + *--------------------------*/ + free(part_ids); + free(part_types); + free(number_of_nodes); + + for(i=0; i 0) { + /* Get the timeset used for the geometry + *--------------------------------------*/ + geom_timeset = USERD_get_geom_timeset_number(); + + /* Get the number of time steps for this timeset + *----------------------------------------------*/ + Num_time_steps = USERD_get_num_of_time_steps(geom_timeset); + if(Num_time_steps < 1) { + fprintf(stderr," Error: Number of time steps returned: %d\n",Num_time_steps); + fprintf(stderr," (Must be >0 to be okay)\n"); + return(Z_ERR); + } + if(geom_time_step > (Num_time_steps - 1)) { + geom_time_step = Num_time_steps - 1; + } + + /* Set the timeset and step - to first step by default, but + * can set it at others using -gts command argument + *---------------------------------------------------------*/ + USERD_set_time_set_and_step(geom_timeset,geom_time_step); + + fprintf(stderr," Using timeset: %d (step range is %d through %d)\n", + geom_timeset,0,Num_time_steps-1); + fprintf(stderr," Using time step: %d\n",geom_time_step); + } + + for(p=0; p 0) { + + pdata = (int *)calloc(ne*Elem_info[et].con_len,sizeof(int)); + if(pdata == (int *) NULL) { + fprintf(stderr,"Error: allocating conns array\n"); + return(Z_ERR); + } + else { + conns = (int **) calloc(ne,sizeof(int *)); + if(conns == (int **) NULL) { + fprintf(stderr,"Error: allocating conns array\n"); + return(Z_ERR); + } + for(i=0; i 0) { + fprintf(stderr," %s Element %d of %d:\n",Elem_info[et].name,i+1,ne); + if(Element_labels) { + fprintf(stderr," id: %d\n",elemids[i]); + } + fprintf(stderr," connectivity:"); + + for(j=nsid_len-conns[i][0]; j Pbuild[p].nn ) { + fprintf(stderr,"\n****************************\n"); + fprintf(stderr,"Connectivity value out of bounds: \n"); + fprintf(stderr,"Either less than zero or greater than \n"); + fprintf(stderr," number of nodes in part!! \n"); + fprintf(stderr,"i = %d j = %d conns[i][j] = %d \n",i,j,conns[i][j]); + fprintf(stderr,"****************************\n"); + } + } + /* ---------- uncomment to print out connectivity values ---------- */ +/* fprintf(stderr,"\n"); */ + } +#endif + /* Last element of the type + *-------------------------*/ + i = ne - 1; + if(i > 0) { + fprintf(stderr," %s Element %d of %d:\n",Elem_info[et].name,i+1,ne); + if(Element_labels) { + fprintf(stderr," id: %d\n",elemids[i]); + } + fprintf(stderr," connectivity:"); + for(j=0; j 0) { + + coords = (float **) calloc(3,sizeof(float *)); + if(coords == (float **) NULL) { + fprintf(stderr,"Error: allocating coords array\n"); + return(Z_ERR); + } + else { + for(i=0; i<3; ++i) { + coords[i] = (float *) calloc((nn+1),sizeof(float)); + if(coords[i] == (float *) NULL) { + fprintf(stderr,"Error: allocating coords array\n"); + return(Z_ERR); + } + } + } + + if(Node_labels) { + nodeids = (int *) calloc((nn+1),sizeof(int)); + if(nodeids == (int *) NULL) { + fprintf(stderr,"Error: allocating nodeids array\n"); + return(Z_ERR); + } + } + + + err = USERD_get_part_coords(pn,coords); + if(err == Z_ERR) { + fprintf(stderr,"Error: getting unstructured coords\n"); + return(Z_ERR); + } + + if(Node_labels) { + err = USERD_get_part_node_ids(pn,nodeids); + if(err == Z_ERR) { + fprintf(stderr,"Error: getting nodeids\n"); + return(Z_ERR); + } + } + + /* Echo "some" info + *-----------------*/ + + /* First node + *-----------*/ + i = 1; + fprintf(stderr," Node %d of %d:\n",i,nn); + if(Node_labels) { + fprintf(stderr," id: %d\n",nodeids[i]); + } + fprintf(stderr," x y z coordinates: %g %g %g\n", + coords[0][i], coords[1][i], coords[2][i]); + mm[0] = mm[1] = coords[0][i]; + mm[2] = mm[3] = coords[1][i]; + mm[4] = mm[5] = coords[2][i]; + + + /* Last node + *----------*/ + i = nn; + if(i > 1) { + fprintf(stderr," Node %d of %d:\n",i,nn); + if(Node_labels) { + fprintf(stderr," id: %d\n",nodeids[i]); + } + fprintf(stderr," x y z coordinates: %g %g %g\n", + coords[0][i], coords[1][i], coords[2][i]); + } + + /* Min and max coordinate values + *------------------------------*/ + for(i=2; i<=nn; ++i) { + if(coords[0][i] < mm[0]) { + mm[0] = coords[0][i]; + } + if(coords[0][i] > mm[1]) { + mm[1] = coords[0][i]; + } + if(coords[1][i] < mm[2]) { + mm[2] = coords[1][i]; + } + if(coords[1][i] > mm[3]) { + mm[3] = coords[1][i]; + } + if(coords[2][i] < mm[4]) { + mm[4] = coords[2][i]; + } + if(coords[2][i] > mm[5]) { + mm[5] = coords[2][i]; + } + } + + fprintf(stderr," Coordinate ranges:\n"); + fprintf(stderr," min x: %g\n",mm[0]); + fprintf(stderr," max x: %g\n",mm[1]); + fprintf(stderr," min y: %g\n",mm[2]); + fprintf(stderr," max y: %g\n",mm[3]); + fprintf(stderr," min z: %g\n",mm[4]); + fprintf(stderr," max z: %g\n",mm[5]); + + + /* Free the allocated memory + *--------------------------*/ + for(i=0; i<3; ++i) { + free(coords[i]); + } + free(coords); + if(Node_labels) { + free(nodeids); + } + } + } + + + /*--------------------- + * For structured parts + *---------------------*/ + else { + + empty_part = FALSE; + if(Pbuild[p].ne[0] == 0 && + Pbuild[p].ne[1] == 0 && + Pbuild[p].ne[2] == 0) { + empty_part = TRUE; + } + + if(!empty_part) { + + /* Get the block coords + *---------------------*/ + for(comp=0; comp<3; ++comp) { + if(Pbuild[p].ne[comp] < 1) { + bdim[comp] = 1; + } + else { + bdim[comp] = Pbuild[p].ne[comp]; + } + } + nn = bdim[0] * bdim[1] * bdim[2]; + + bd1 = bdim[0]-1; + if(bd1 < 1) { + bd1 = 1; + } + bd2 = bdim[1]-1; + if(bd2 < 1) { + bd2 = 1; + } + bd3 = bdim[2]-1; + if(bd3 < 1) { + bd3 = 1; + } + ne = bd1 * bd2 * bd3; + + /* Determine cell type + *--------------------*/ + num_dims = 3; + for(i=0; i<3; ++i) { + if(bdim[i] == 1) { + --num_dims; + } + } + if(num_dims == 3) { + cell_type = Z_HEX08; + } + else if(num_dims == 2) { + cell_type = Z_QUA04; + } + else { + cell_type = Z_BAR02; + } + + coords = (float **) calloc(num_dims,sizeof(float *)); + if(coords == (float **) NULL) { + fprintf(stderr,"Error: allocating coords array\n"); + return(Z_ERR); + } + else { + for(i=0; i 0) { + i = 0; + fprintf(stderr," Node %d of %d:\n",i+1,nn); + +#if (defined GT_USERD_API_200) + + if(Node_labels) { + fprintf(stderr," id: %d\n",nodeids[i]); + } +#endif + if(num_dims == 3) { + fprintf(stderr," x y z coordinates: %g %g %g\n", + coords[0][i], coords[1][i], coords[2][i]); + mm[0] = mm[1] = coords[0][i]; + mm[2] = mm[3] = coords[1][i]; + mm[4] = mm[5] = coords[2][i]; + } + else if(num_dims == 2) { + fprintf(stderr," x y coordinates: %g %g\n", + coords[0][i], coords[1][i]); + mm[0] = mm[1] = coords[0][i]; + mm[2] = mm[3] = coords[1][i]; + } + else { + fprintf(stderr," x coordinates: %g\n", + coords[0][i]); + mm[0] = mm[1] = coords[0][i]; + } + + + /* Last node + *----------*/ + i = nn-1; + if(i > 1) { + fprintf(stderr," Node %d of %d:\n",i+1,nn); + +#if (defined GT_USERD_API_200) + if(Node_labels) { + fprintf(stderr," id: %d\n",nodeids[i]); + } +#endif + if(num_dims == 3) { + fprintf(stderr," x y z coordinates: %g %g %g\n", + coords[0][i], coords[1][i], coords[2][i]); + } + else if(num_dims == 2) { + fprintf(stderr," x y coordinates: %g %g\n", + coords[0][i], coords[1][i]); + } + else { + fprintf(stderr," x coordinates: %g\n", + coords[0][i]); + } + } + } + + /* Min and max coordinate values + *------------------------------*/ + for(i=1; i mm[1]) { + mm[1] = coords[0][i]; + } + if(num_dims > 1) { + if(coords[1][i] < mm[2]) { + mm[2] = coords[1][i]; + } + if(coords[1][i] > mm[3]) { + mm[3] = coords[1][i]; + } + } + if(num_dims > 2) { + if(coords[2][i] < mm[4]) { + mm[4] = coords[2][i]; + } + if(coords[2][i] > mm[5]) { + mm[5] = coords[2][i]; + } + } + } + + fprintf(stderr," Coordinate ranges:\n"); + fprintf(stderr," min x: %g\n",mm[0]); + fprintf(stderr," max x: %g\n",mm[1]); + if(num_dims > 1) { + fprintf(stderr," min y: %g\n",mm[2]); + fprintf(stderr," max y: %g\n",mm[3]); + } + if(num_dims > 2) { + fprintf(stderr," min z: %g\n",mm[4]); + fprintf(stderr," max z: %g\n",mm[5]); + } + + /* Free the allocated memory - so far + *-----------------------------------*/ + for(i=0; i 0) { + ++num_ghosts; + } + } + + fprintf(stderr," Block Ghost flag breakdown:\n"); + fprintf(stderr," %d ghost cells out of %d total cells\n", + num_ghosts,ne); + + free(ghost_flag); + } + + /* Get the element ids - if any + *-----------------------------*/ + if(Element_labels) { + + elemids = (int *) calloc(ne,sizeof(int)); + if(elemids == (int *) NULL) { + fprintf(stderr,"Error: allocating elemids array\n"); + return(Z_ERR); + } + + + et = cell_type; + err = USERD_get_part_element_ids_by_type(pn,et,elemids); + if(err == Z_ERR) { + fprintf(stderr,"Error: getting element ids\n"); + return(Z_ERR); + } + + /* First element of the type + *--------------------------*/ + i = 0; + fprintf(stderr," %s Element %d of %d:\n",Elem_info[et].name,i+1,ne); + fprintf(stderr," id: %d\n",elemids[i]); + + /* Last element of the type + *-------------------------*/ + i = ne - 1; + if(i > 0) { + fprintf(stderr," %s Element %d of %d:\n",Elem_info[et].name,i+1,ne); + fprintf(stderr," id: %d\n",elemids[i]); + } + + free(elemids); + } +#endif + } + else { + fprintf(stderr," Empty structured part\n"); + } + } + + /* Get border availability + *------------------------*/ + err = USERD_get_border_availability(pn,num_elems); + if(err == Z_OK) { + + /* Get border elements - if any + *-----------------------------*/ + for(et=0; et 0) { + + conns = (int **) calloc(ne,sizeof(int *)); + if(conns == (int **) NULL) { + fprintf(stderr,"Error: allocating border conns array\n"); + return(Z_ERR); + } + else { + for(i=0; i 0) { + fprintf(stderr," %s border element %d of %d:\n", + Elem_info[et].name,i+1,ne); + fprintf(stderr," Parent type: %s\n", + Elem_info[parent_type[i]].name); + fprintf(stderr," Parent num: %d\n",parent_num[i]); + fprintf(stderr," connectivity:"); + for(j=0; j 0) { + fprintf(stderr,"\n"); + } + if(Varinfo[v].classify == Z_PER_NODE) { + fprintf(stderr," Z_PER_NODE Variable %d:\n",vn); + } + else { + fprintf(stderr," Z_PER_ELEM Variable %d:\n",vn); + } + + + if(Num_time_sets > 0) { + /* Get the timeset used for the variable + *---------------------------------------*/ + var_timeset = Varinfo[v].timeset; + + /* Get the number of time steps for this timeset + *----------------------------------------------*/ + Num_time_steps = USERD_get_num_of_time_steps(var_timeset); + if(Num_time_steps < 1) { + fprintf(stderr," Error: Number of time steps returned: %d\n", + Num_time_steps); + fprintf(stderr," (Must be >0 to be okay)\n"); + return(Z_ERR); + } + if(var_time_step > (Num_time_steps - 1)) { + var_time_step = Num_time_steps - 1; + } + + /* Set the timeset and step - to first step by default, but + * can set it at others using -vts command argument + *---------------------------------------------------------*/ + USERD_set_time_set_and_step(var_timeset,var_time_step); + + fprintf(stderr," Using timeset: %d (step range is %d through %d)\n", + var_timeset,0,Num_time_steps-1); + fprintf(stderr," Using time step: %d\n",var_time_step); + } + + + /* Constants + *----------*/ + if(Varinfo[v].type == Z_CONSTANT) { + + constant_val = USERD_get_constant_val(vn,FALSE); + fprintf(stderr," Constant (%s):\n",Varinfo[v].description); + fprintf(stderr," value: %g\n",constant_val); + + if(Varinfo[v].complex) { + constant_val = USERD_get_constant_val(vn,TRUE); + fprintf(stderr," value (imag): %g\n",constant_val); + } + } + + /* Scalars, Vectors, Tensors + *--------------------------*/ + else { + + /* Get the var description line + *-----------------------------*/ + err = USERD_get_descrip_lines(Z_VARI,vn,FALSE,line1,line2); + if(err == Z_OK) { + fprintf(stderr," Desc line: %s\n",line1); + } + else { + fprintf(stderr,"Error: getting var description line\n"); + return(Z_ERR); + } + + if(Varinfo[v].complex) { + err = USERD_get_descrip_lines(Z_VARI,vn,TRUE,line1,line2); + if(err == Z_OK) { + fprintf(stderr," Desc line (imag): %s\n",line1); + } + else { + fprintf(stderr,"Error: getting var description line (imag)\n"); + return(Z_ERR); + } + } + + + /* Get the values by component + *-----------------------------*/ + if(Varinfo[v].type == Z_SCALAR) { + num_comps = 1; + } + else if(Varinfo[v].type == Z_VECTOR) { + num_comps = 3; + } + else if(Varinfo[v].type == Z_TENSOR) { + num_comps = 6; + } + else if(Varinfo[v].type == Z_TENSOR9) { + num_comps = 9; + } + + + /* Per_Node + *---------*/ + if(Varinfo[v].classify == Z_PER_NODE) { + + for(p=0; p 0) { + values = (float *) calloc((nsize+1),sizeof(float)); + if(values == (float *) NULL) { + fprintf(stderr,"Error: alocating variable values\n"); + return(Z_ERR); + } + + for(comp=0; comp maxv) { + maxv = values[i]; + } + } + + fprintf(stderr," For component %d: \n",comp); + fprintf(stderr," node %10d value: %g\n",1,values[1]); + fprintf(stderr," node %10d value: %g\n",nsize,values[nsize]); + fprintf(stderr," min value: %g\n",minv); + fprintf(stderr," max value: %g\n",maxv); + + if(Varinfo[v].complex) { + err = USERD_get_var_by_component(vn, + pn, + Varinfo[v].type, + 0, + FALSE, + comp, + values); + if(err == Z_UNDEF) { + fprintf(stderr," Variable not defined on this part\n"); + } + + /* For the component, show 1st node, last node, min, max values + *-------------------------------------------------------------*/ + minv = maxv = values[1]; + for(i=2; i<=nsize; ++i) { + if(values[i] < minv) { + minv = values[i]; + } + if(values[i] > maxv) { + maxv = values[i]; + } + } + + fprintf(stderr," For component %d (imag): \n",comp); + fprintf(stderr," node %10d value: %g\n",1,values[1]); + fprintf(stderr," node %10d value: %g\n",nsize,values[nsize]); + fprintf(stderr," min value: %g\n",minv); + fprintf(stderr," max value: %g\n",maxv); + } + } + free(values); + } + } + } + + /* Per_Elem + *---------*/ + else { + for(p=0; p 0) { + + fprintf(stderr," For part %d, with %d elems of type %s:\n", + pn,nsize,Elem_info[et].name); + + + values = (float *) calloc((nsize+1),sizeof(float)); + if(values == (float *) NULL) { + fprintf(stderr,"Error: alocating variable values\n"); + return(Z_ERR); + } + + for(comp=0; comp maxv) { + maxv = values[i]; + } + } + + fprintf(stderr," For component %d: \n",comp); + fprintf(stderr," elem %10d value: %g\n",1,values[1]); + fprintf(stderr," elem %10d value: %g\n",nsize,values[nsize]); + fprintf(stderr," min value: %g\n",minv); + fprintf(stderr," max value: %g\n",maxv); + + if(Varinfo[v].complex) { + err = USERD_get_var_by_component(vn, + pn, + Varinfo[v].type, + et, + FALSE, + comp, + values); + if(err == Z_UNDEF) { + fprintf(stderr," Variable not defined on this part\n"); + } + + /* For the component, show 1st elem, last elem, min, max values + *-------------------------------------------------------------*/ + minv = maxv = values[1]; + for(i=2; i<=nsize; ++i) { + if(values[i] < minv) { + minv = values[i]; + } + if(values[i] > maxv) { + maxv = values[i]; + } + } + + fprintf(stderr," For component %d (imag): \n",comp); + fprintf(stderr," elem %10d value: %g\n",1,values[1]); + fprintf(stderr," elem %10d value: %g\n",nsize,values[nsize]); + fprintf(stderr," min value: %g\n",minv); + fprintf(stderr," max value: %g\n",maxv); + + } + } + free(values); + } + } + } + } + } + } + + return(Z_OK); +} + +#else + +/*------------- + * part_builder + *-------------*/ +static int +part_builder(int geom_time_step) +{ + int i, j; + int err; + int p, pn; + int et, ne; + int *elemids[Z_MAXTYPE]; + int **conns[Z_MAXTYPE]; + int nn; + int comp; + int bdim[3]; + int ib[5]; + int num_dims; + int cell_type; + float mm[6]; + float **coords; + int *nodeids; + int *iblanking; + CRD *crds; + int bd1,bd2,bd3; + + + fprintf(stderr,"\n------------- part_builder --------------\n"); + + + if(Num_time_steps > 1) { + if(geom_time_step > (Num_time_steps - 1)) { + geom_time_step = Num_time_steps - 1; + } + + /* Set the time step - to first step by default, but + * can set it at others using -gts command argument + *---------------------------------------------------*/ + USERD_set_time_step(geom_time_step); + + fprintf(stderr," Using time step: %d (where range is %d through %d\n", + geom_time_step,0,Num_time_steps-1); + } + + + /* Get the global coords + *----------------------*/ + nn = USERD_get_number_of_global_nodes(); + + if(nn > 0) { + + crds = (CRD *) calloc(nn,sizeof(CRD)); + if(crds == (CRD *) NULL) { + fprintf(stderr,"Error: allocating crds array\n"); + return(Z_ERR); + } + + if(Node_labels) { + nodeids = (int *) calloc(nn,sizeof(int)); + if(nodeids == (int *) NULL) { + fprintf(stderr,"Error: allocating nodeids array\n"); + return(Z_ERR); + } + } + + + err = USERD_get_global_coords(crds); + if(err == Z_ERR) { + fprintf(stderr,"Error: getting unstructured coords\n"); + return(Z_ERR); + } + + if(Node_labels) { + err = USERD_get_global_node_ids(nodeids); + if(err == Z_ERR) { + fprintf(stderr,"Error: getting nodeids\n"); + return(Z_ERR); + } + } + + /* Echo "some" info + *-----------------*/ + + /* First node + *-----------*/ + i = 0; + fprintf(stderr," Node %d of %d:\n",i+1,nn); + if(Node_labels) { + fprintf(stderr," id: %d\n",nodeids[i]); + } + fprintf(stderr," x y z coordinates: %g %g %g\n", + crds[i].xyz[0], crds[i].xyz[1], crds[i].xyz[2]); + mm[0] = mm[1] = crds[i].xyz[0]; + mm[2] = mm[3] = crds[i].xyz[1]; + mm[4] = mm[5] = crds[i].xyz[2]; + + + /* Last node + *----------*/ + i = nn-1; + if(i > 0) { + fprintf(stderr," Node %d of %d:\n",i+1,nn); + if(Node_labels) { + fprintf(stderr," id: %d\n",nodeids[i]); + } + fprintf(stderr," x y z coordinates: %g %g %g\n", + crds[i].xyz[0], crds[i].xyz[1], crds[i].xyz[2]); + } + + /* Min and max coordinate values + *------------------------------*/ + for(i=1; i mm[1]) { + mm[1] = crds[i].xyz[0]; + } + if(crds[i].xyz[1] < mm[2]) { + mm[2] = crds[i].xyz[1]; + } + if(crds[i].xyz[1] > mm[3]) { + mm[3] = crds[i].xyz[1]; + } + if(crds[i].xyz[2] < mm[4]) { + mm[4] = crds[i].xyz[2]; + } + if(crds[i].xyz[2] > mm[5]) { + mm[5] = crds[i].xyz[2]; + } + } + + fprintf(stderr," Global coordinate ranges:\n"); + fprintf(stderr," min x: %g\n",mm[0]); + fprintf(stderr," max x: %g\n",mm[1]); + fprintf(stderr," min y: %g\n",mm[2]); + fprintf(stderr," max y: %g\n",mm[3]); + fprintf(stderr," min z: %g\n",mm[4]); + fprintf(stderr," max z: %g\n",mm[5]); + + + /* Free the allocated memory + *--------------------------*/ + free(crds); + if(Node_labels) { + free(nodeids); + } + } + + + + for(p=0; p 0) { + + conns[et] = (int **) calloc(ne,sizeof(int *)); + if(conns[et] == (int **) NULL) { + fprintf(stderr,"Error: allocating conns array\n"); + return(Z_ERR); + } + else { + for(i=0; i 0) { + + /* First element of the type + *--------------------------*/ + i = 0; + fprintf(stderr," %s Element %d of %d:\n",Elem_info[et].name,i+1,ne); + if(Element_labels) { + fprintf(stderr," id: %d\n",elemids[et][i]); + } + fprintf(stderr," connectivity:"); + for(j=0; j 0) { + fprintf(stderr," %s Element %d of %d:\n",Elem_info[et].name,i+1,ne); + if(Element_labels) { + fprintf(stderr," id: %d\n",elemids[et][i]); + } + fprintf(stderr," connectivity:"); + for(j=0; j 0) { + for(i=0; i 0) { + i = 0; + fprintf(stderr," Node %d of %d:\n",i+1,nn); + + if(num_dims == 3) { + fprintf(stderr," x y z coordinates: %g %g %g\n", + coords[0][i], coords[1][i], coords[2][i]); + mm[0] = mm[1] = coords[0][i]; + mm[2] = mm[3] = coords[1][i]; + mm[4] = mm[5] = coords[2][i]; + } + else if(num_dims == 2) { + fprintf(stderr," x y coordinates: %g %g\n", + coords[0][i], coords[1][i]); + mm[0] = mm[1] = coords[0][i]; + mm[2] = mm[3] = coords[1][i]; + } + else { + fprintf(stderr," x coordinates: %g\n", + coords[0][i]); + mm[0] = mm[1] = coords[0][i]; + } + + + /* Last node + *----------*/ + i = nn-1; + if(i > 1) { + fprintf(stderr," Node %d of %d:\n",i+1,nn); + + if(num_dims == 3) { + fprintf(stderr," x y z coordinates: %g %g %g\n", + coords[0][i], coords[1][i], coords[2][i]); + } + else if(num_dims == 2) { + fprintf(stderr," x y coordinates: %g %g\n", + coords[0][i], coords[1][i]); + } + else { + fprintf(stderr," x coordinates: %g\n", + coords[0][i]); + } + } + } + + /* Min and max coordinate values + *------------------------------*/ + for(i=2; i<=nn; ++i) { + if(coords[0][i] < mm[0]) { + mm[0] = coords[0][i]; + } + if(coords[0][i] > mm[1]) { + mm[1] = coords[0][i]; + } + if(num_dims > 1) { + if(coords[1][i] < mm[2]) { + mm[2] = coords[1][i]; + } + if(coords[1][i] > mm[3]) { + mm[3] = coords[1][i]; + } + } + if(num_dims > 2) { + if(coords[2][i] < mm[4]) { + mm[4] = coords[2][i]; + } + if(coords[2][i] > mm[5]) { + mm[5] = coords[2][i]; + } + } + } + + fprintf(stderr," Coordinate ranges:\n"); + fprintf(stderr," min x: %g\n",mm[0]); + fprintf(stderr," max x: %g\n",mm[1]); + if(num_dims > 1) { + fprintf(stderr," min y: %g\n",mm[2]); + fprintf(stderr," max y: %g\n",mm[3]); + } + if(num_dims > 2) { + fprintf(stderr," min z: %g\n",mm[4]); + fprintf(stderr," max z: %g\n",mm[5]); + } + + /* Free the allocated memory - so far + *-----------------------------------*/ + for(i=0; i 1 && v == 0) { + if(var_time_step > (Num_time_steps - 1)) { + var_time_step = Num_time_steps - 1; + } + + /* Set the time step - to first step by default, but + * can set it at others using -vts command argument + *---------------------------------------------------------*/ + USERD_set_time_step(var_time_step); + + fprintf(stderr," Using time step: %d (where range is %d through %d)\n\n", + var_time_step,0,Num_time_steps-1); + } + + for(v=0; v 0) { + fprintf(stderr,"\n"); + } + if(Varinfo[v].classify == Z_PER_NODE) { + fprintf(stderr," Z_PER_NODE Variable %d:\n",vn); + } + else { + fprintf(stderr," Z_PER_ELEM Variable %d:\n",vn); + } + + /* Constants + *----------*/ + if(Varinfo[v].type == Z_CONSTANT) { + + constant_val = USERD_get_constant_value(vn); + fprintf(stderr," Constant (%s):\n",Varinfo[v].description); + fprintf(stderr," value: %g\n",constant_val); + } + + + /* Scalars, Vectors, Tensors + *--------------------------*/ + else { + + /* Get the var description line + *-----------------------------*/ + err = USERD_get_description_lines(Z_VARI,vn,line1,line2); + if(err == Z_OK) { + fprintf(stderr," Desc line: %s\n",line1); + } + else { + fprintf(stderr,"Error: getting var description line\n"); + return(Z_ERR); + } + + + /* Get the values by component + *-----------------------------*/ + if(Varinfo[v].type == Z_SCALAR) { + num_comps = 1; + } + else if(Varinfo[v].type == Z_VECTOR) { + num_comps = 3; + } + else if(Varinfo[v].type == Z_TENSOR) { + num_comps = 6; + } + else if(Varinfo[v].type == Z_TENSOR9) { + num_comps = 9; + } + + + /* Per_Node + *---------*/ + if(Varinfo[v].classify == Z_PER_NODE) { + + for(p=0; p 0) { + values = (float *) calloc((num_comps * nsize),sizeof(float)); + if(values == (float *) NULL) { + fprintf(stderr,"Error: alocating variable values\n"); + return(Z_ERR); + } + + if(num_comps == 1) { + + if(Pbuild[p].type == Z_UNSTRUCTURED) { + err = USERD_get_scalar_values(vn, + pn, + 0, + values); + if(err == Z_ERR) { + fprintf(stderr,"Error: getting scalar values\n"); + return(Z_ERR); + } + } + else { + err = USERD_get_block_scalar_values(pn, + vn, + values); + if(err == Z_ERR) { + fprintf(stderr,"Error: getting block scalar values\n"); + return(Z_ERR); + } + } + + /* For the component, show 1st node, last node, min, max values + *-------------------------------------------------------------*/ + minv[0] = maxv[0] = values[0]; + for(i=0; i maxv[0]) { + maxv[0] = values[i]; + } + } + + fprintf(stderr," node %10d value: %g\n",1,values[0]); + fprintf(stderr," node %10d value: %g\n",nsize,values[nsize-1]); + fprintf(stderr," min value: %g\n",minv[0]); + fprintf(stderr," max value: %g\n",maxv[0]); + + } + + else if(num_comps == 3) { + + if(Pbuild[p].type == Z_UNSTRUCTURED) { + err = USERD_get_vector_values(vn, + pn, + 0, + values); + if(err == Z_ERR) { + fprintf(stderr,"Error: getting vector values\n"); + return(Z_ERR); + } + } + else { + + tvalues = (float *) calloc(nsize,sizeof(float)); + if(tvalues == (float *) NULL) { + fprintf(stderr,"Error: alocating tvalues array\n"); + return(Z_ERR); + } + + for(i=0; i<3; ++i) { + err = USERD_get_block_vector_values_by_component(pn, + vn, + i, + tvalues); + if(err == Z_ERR) { + fprintf(stderr,"Error: getting vector values\n"); + return(Z_ERR); + } + for(j=0; j maxv[k]) { + maxv[k] = values[j+k]; + } + } + } + + fprintf(stderr," node %10d values: %g %g %g\n",1, + values[0],values[1],values[2]); + fprintf(stderr," node %10d values: %g %g %g\n",nsize, + values[3*nsize-3],values[3*nsize-2],values[3*nsize-1]); + fprintf(stderr," min values: %g %g %g\n", + minv[0],minv[1],minv[2]); + fprintf(stderr," max values: %g %g %g\n", + maxv[0],maxv[1],maxv[2]); + + } + free(values); + } + } + } + + /* Per_Elem + *---------*/ + else { + for(p=0; p 0) { + + fprintf(stderr," For part %d, with %d elems of type %s:\n", + pn,nsize,Elem_info[et].name); + + values = (float *) calloc((num_comps * nsize),sizeof(float)); + if(values == (float *) NULL) { + fprintf(stderr,"Error: alocating variable values\n"); + return(Z_ERR); + } + + if(num_comps == 1) { + if(Pbuild[p].type == Z_UNSTRUCTURED) { + err = USERD_get_scalar_values(vn, + pn, + et, + values); + if(err == Z_ERR) { + fprintf(stderr,"Error: getting scalar values\n"); + return(Z_ERR); + } + } + else { + err = USERD_get_block_scalar_values(pn, + vn, + values); + if(err == Z_ERR) { + fprintf(stderr,"Error: getting block scalar values\n"); + return(Z_ERR); + } + } + + /* For the component, show 1st node, last node, min, max values + *-------------------------------------------------------------*/ + minv[0] = maxv[0] = values[0]; + for(i=1; i maxv[0]) { + maxv[0] = values[i]; + } + } + + fprintf(stderr," elem %10d value: %g\n",1,values[0]); + fprintf(stderr," elem %10d value: %g\n",nsize,values[nsize-1]); + fprintf(stderr," min value: %g\n",minv[0]); + fprintf(stderr," max value: %g\n",maxv[0]); + + } + + else if(num_comps == 3) { + + if(Pbuild[p].type == Z_UNSTRUCTURED) { + err = USERD_get_vector_values(vn, + pn, + et, + values); + if(err == Z_ERR) { + fprintf(stderr,"Error: getting vector values\n"); + return(Z_ERR); + } + } + else { + + tvalues = (float *) calloc(nsize,sizeof(float)); + if(tvalues == (float *) NULL) { + fprintf(stderr,"Error: alocating tvalues array\n"); + return(Z_ERR); + } + + for(i=0; i<3; ++i) { + err = USERD_get_block_vector_values_by_component(pn, + vn, + i, + tvalues); + if(err == Z_ERR) { + fprintf(stderr,"Error: getting vector values\n"); + return(Z_ERR); + } + for(j=0; j maxv[k]) { + maxv[k] = values[j+k]; + } + } + } + + fprintf(stderr," elem %10d values: %g %g %g\n",1, + values[0],values[1],values[2]); + fprintf(stderr," elem %10d values: %g %g %g\n",nsize, + values[3*nsize-3],values[3*nsize-2],values[3*nsize-1]); + fprintf(stderr," min values: %g %g %g\n", + minv[0],minv[1],minv[2]); + fprintf(stderr," max values: %g %g %g\n", + maxv[0],maxv[1],maxv[2]); + + } + free(values); + } + } + } + } + } + } + + return(Z_OK); +} + +#endif + + +#if (defined GT_USERD_API_202) + + +/*--------------- + * materials_info + *---------------*/ +static int +materials_info( void ) +{ + int i,j; + int err; + int *num_materials; + int *msids; + char **msname; + int *mids; + char **mdesc; + + + fprintf(stderr,"\n------------ materials_info --------------\n"); + + /* Get the number of variables + *----------------------------*/ + Num_materials_sets = USERD_get_number_of_material_sets(); + if(Num_materials_sets < 0) { + fprintf(stderr,"Error: getting the number of material sets\n"); + return(Z_ERR); + } + else { + if(Num_materials_sets == 0) { + fprintf(stderr," No materials sets in the model\n"); + return (Z_OK); + } + else if(Num_materials_sets > 1) { + fprintf(stderr," Number of materials sets: %d\n",Num_materials_sets); + fprintf(stderr," Currently, EnSight 7.6 only supports 1 material set\n"); + return(Z_ERR); + } + else { + fprintf(stderr," Number of materials sets: %d\n",Num_materials_sets); + } + } + + /* Get the material set index list and names + *------------------------------------------*/ + msids = (int *) calloc(Num_materials_sets,sizeof(int)); + if(msids == (int *)NULL) { + fprintf(stderr," Problems allocating for material set ids\n"); + return(Z_ERR); + } + + num_materials = (int *) calloc(Num_materials_sets,sizeof(int)); + if(num_materials == (int *)NULL) { + fprintf(stderr," Problems allocating for material set num materials\n"); + return(Z_ERR); + } + + msname = (char **) calloc(Num_materials_sets,sizeof(char *)); + if(msname == (char **)NULL) { + fprintf(stderr," Problems allocating for material set names\n"); + return(Z_ERR); + } + else { + for(i=0; i 0) { + /* Get the timeset used for the geometry + *--------------------------------------*/ + geom_timeset = USERD_get_geom_timeset_number(); + + /* Get the number of time steps for this timeset + *----------------------------------------------*/ + Num_time_steps = USERD_get_num_of_time_steps(geom_timeset); + if(Num_time_steps < 1) { + fprintf(stderr," Error: Num time steps returned: %d\n",Num_time_steps); + fprintf(stderr," (Must be >0 to be okay)\n"); + return(Z_ERR); + } + if(geom_time_step > (Num_time_steps - 1)) { + geom_time_step = Num_time_steps - 1; + } + + /* Set the timeset and step - to first step by default, but + * can set it at others using -gts command argument + *---------------------------------------------------------*/ + USERD_set_time_set_and_step(geom_timeset,geom_time_step); + + fprintf(stderr," Using timeset: %d (step range is %d through %d)\n", + geom_timeset,0,Num_time_steps-1); + fprintf(stderr," Using time step: %d\n",geom_time_step); + } + + for(ms=0; ms 0) { + + /* Get the material ids, if any + *-----------------------------*/ + err = USERD_size_matf_data(ms, + pn, + et, + Z_MAT_INDEX, + &matf_size); + if(err == Z_OK && matf_size > 0) { + + + /* Go get the material ids + *------------------------*/ + ivals = (int *) calloc(matf_size,sizeof(int)); + if(ivals == (int *)NULL) { + fprintf(stderr," Problems allocating for material ids\n"); + return(Z_ERR); + } + err = USERD_load_matf_data(ms, + pn, + et, + Z_MAT_INDEX, + ivals, + fvals); + if(err == Z_OK) { + if(matf_size < 20) { + fprintf(stderr," Printing all mat ids for %s elements\n", + Elem_info[et].name); + do_num = matf_size; + } + else { + fprintf(stderr," Printing first 20 mat ids for %s elements\n", + Elem_info[et].name); + do_num = 20; + } + + /* See if any mixed materials + *---------------------------*/ + mixed_present = FALSE; + for(k=0; k 0 && + matfv_size > 0) { + + /* Go get the material ids + *------------------------*/ + ivals = (int *) calloc(matf_size,sizeof(int)); + if(ivals == (int *)NULL) { + fprintf(stderr," Problems allocating for mixed material ids\n"); + return(Z_ERR); + } + fvals = (float *) calloc(matfv_size,sizeof(float)); + if(fvals == (float *)NULL) { + fprintf(stderr," Problems allocating for mixed material values\n"); + return(Z_ERR); + } + + err1 = USERD_load_matf_data(ms, + pn, + et, + Z_MIX_INDEX, + ivals, + fvals); + + err2 = USERD_load_matf_data(ms, + pn, + et, + Z_MIX_VALUE, + ivals, + fvals); + if(err1 == Z_OK && + err2 == Z_OK) { + if(matf_size < 20) { + fprintf(stderr," Printing all mixed mat ids for %s elements\n", + Elem_info[et].name); + do_num = matf_size; + } + else { + fprintf(stderr," Printing first 20 mixed mat ids for %s elements\n", + Elem_info[et].name); + do_num = 20; + } + for(k=0; k 1) { + /* Get the number of time steps for this timeset + *----------------------------------------------*/ + if(var_time_step > (Num_time_steps - 1)) { + var_time_step = Num_time_steps - 1; + } + + /* Set the time step - to first step by default, but + * can set it at others using -vts command argument + *---------------------------------------------------------*/ + USERD_set_time_step(var_time_step); + + fprintf(stderr," Using time step: %d (where range is %d through %d)\n\n", + var_time_step,0,Num_time_steps-1); + } +#endif + + for(v=0; v 0) { + /* Get the timeset used for the variable + *---------------------------------------*/ + var_timeset = Varinfo[v].timeset; + + /* Get the number of time steps for this timeset + *----------------------------------------------*/ + Num_time_steps = USERD_get_num_of_time_steps(var_timeset); + if(Num_time_steps < 1) { + fprintf(stderr," Error: Number of time steps returned: %d\n", + Num_time_steps); + fprintf(stderr," (Must be >0 to be okay)\n"); + return(Z_ERR); + } + if(var_time_step > (Num_time_steps - 1)) { + var_time_step = Num_time_steps - 1; + } + + /* Set the timeset and step - to first step by default, but + * can set it at others using -vts command argument + *---------------------------------------------------------*/ + USERD_set_time_set_and_step(var_timeset,var_time_step); + + fprintf(stderr," Using timeset: %d (step range is %d through %d)\n", + var_timeset,0,Num_time_steps-1); + fprintf(stderr," Using time step: %d\n",var_time_step); + } +#endif + + + /* Get the var description line + *-----------------------------*/ +#if (defined GT_USERD_API_100) + err = USERD_get_descrip_lines(Z_VARI,vn,FALSE,line1,line2); + if(err == Z_OK) { + fprintf(stderr," Desc line: %s\n",line1); + } + else { + fprintf(stderr,"Error: getting var description line\n"); + return(Z_ERR); + } + + if(Varinfo[v].complex) { + err = USERD_get_descrip_lines(Z_VARI,vn,TRUE,line1,line2); + if(err == Z_OK) { + fprintf(stderr," Desc line (imag): %s\n",line1); + } + else { + fprintf(stderr,"Error: getting var description line (imag)\n"); + return(Z_ERR); + } + } +#else + + err = USERD_get_description_lines(Z_VARI,vn,line1,line2); + if(err == Z_OK) { + fprintf(stderr," Desc line: %s\n",line1); + } + else { + fprintf(stderr,"Error: getting var description line\n"); + return(Z_ERR); + } + +#endif + + /* Get the values by component + *-----------------------------*/ + if(Varinfo[v].type == Z_SCALAR) { + num_comps = 1; + } + else if(Varinfo[v].type == Z_VECTOR) { + num_comps = 3; + } + + /* Per_Node + *---------*/ + if(Varinfo[v].classify == Z_PER_NODE) { + + for(p=0; p 0) { + + fprintf(stderr," For part %d, using node %d:\n",pn,nsize); + +#if (defined GT_USERD_API_100) + err = USERD_get_var_value_at_specific(vn, + nsize, + pn, + 0, + var_time_step, + qvals, + FALSE); +#else + err = USERD_get_variable_value_at_specific(vn, + nsize, + pn, + 0, + var_time_step, + qvals); +#endif + if(err == Z_NOT_IMPLEMENTED) { + fprintf(stderr," Node and element queries not implemented\n"); + return(Z_OK); + } + else if(err == Z_ERR) { + fprintf(stderr," Could not get value\n"); + } + else { + + /* For the component, show 1st node, last node, min, max values + *-------------------------------------------------------------*/ + if(Varinfo[v].type == Z_SCALAR) { + fprintf(stderr," Scalar value is: %g\n",qvals[0]); + } + else { + fprintf(stderr," Vector values are: %g %g %g\n", + qvals[0],qvals[1],qvals[2]); + } + +#if (defined GT_USERD_API_100) + if(Varinfo[v].complex) { + + err = USERD_get_var_value_at_specific(vn, + nsize, + pn, + 0, + var_time_step, + qvals, + TRUE); + + if(err == Z_ERR) { + fprintf(stderr," Could not get imag value\n"); + } + else { + + /* For the component, show 1st node, last node, min, max values + *-------------------------------------------------------------*/ + if(Varinfo[v].type == Z_SCALAR) { + fprintf(stderr," Scalar value (imag) is: %g\n",qvals[0]); + } + else { + fprintf(stderr," Vector values (imag) are: %g %g %g\n", + qvals[0],qvals[1],qvals[2]); + } + } + } +#endif + + } + } + } + } + + /* Per_Elem + *---------*/ + else { + for(p=0; p 0) { + + + fprintf(stderr," For part %d, using elem %d of type %s:\n", + pn,nsize,Elem_info[et].name); + + +#if (defined GT_USERD_API_100) + err = USERD_get_var_value_at_specific(vn, + nsize, + pn, + et, + var_time_step, + qvals, + FALSE); +#else + err = USERD_get_variable_value_at_specific(vn, + nsize, + pn, + et, + var_time_step, + qvals); +#endif + + if(err == Z_NOT_IMPLEMENTED) { + fprintf(stderr," Node and element queries not implemented\n"); + return(Z_OK); + } + else if(err == Z_ERR) { + fprintf(stderr," Could not get value\n"); + } + else { + if(Varinfo[v].type == Z_SCALAR) { + fprintf(stderr," Scalar value is: %g\n",qvals[0]); + } + else { + fprintf(stderr," Vector values are: %g %g %g\n", + qvals[0],qvals[1],qvals[2]); + } + +#if (defined GT_USERD_API_100) + if(Varinfo[v].complex) { + + err = USERD_get_var_value_at_specific(vn, + nsize, + pn, + et, + var_time_step, + qvals, + TRUE); + if(err == Z_ERR) { + fprintf(stderr," Could not get imag value\n"); + } + else { + if(Varinfo[v].type == Z_SCALAR) { + fprintf(stderr," Scalar value (imag) is: %g\n",qvals[0]); + } + else { + fprintf(stderr," Vector values (imag) are: %g %g %g\n", + qvals[0],qvals[1],qvals[2]); + } + } + } +#endif + } + } + } + } + } + } + } + + return(Z_OK); +} + + +/*-------------- + * exercise_bkup + *--------------*/ +static int +exercise_bkup( void ) +{ + int err; + FILE *arcfile; + + fprintf(stderr,"\n------------ exercise_archive -----------\n"); + + arcfile = fopen("test.arc","wb"); + if(arcfile == (FILE *)NULL) { + fprintf(stderr,"Error: opening test archive file\n"); + return(Z_ERR); + } + err = USERD_bkup(arcfile,Z_SAVE_ARCHIVE); + if(err == Z_ERR) { + fprintf(stderr,"Error: saving to test archive file\n"); + return(Z_ERR); + } + fclose(arcfile); + + arcfile = fopen("test.arc","rb"); + err = USERD_bkup(arcfile,Z_REST_ARCHIVE); + if(err == Z_ERR) { + fprintf(stderr,"Error: restoring from test archive file\n"); + return(Z_ERR); + } + + fprintf(stderr," Archive test completed\n"); + + fclose(arcfile); + + return(Z_OK); +} + +/* ------------------------------------------------------- + * threshold_operator1 & 2 can be one of the following + * Z_ELE_FAILED_NONE, - disables checking + * Z_ELE_FAILED_GREATER, - greater than + * Z_ELE_FAILED_LESS, - less than + * Z_ELE_FAILED_EQUAL, - equal + * Z_ELE_FAILED_NOT_EQUAL, - not equal + * Z_ELE_FAILED_MANY - not used + * + * logic_criteria2 + * Z_ELE_FAILED_LOGIC_NONE, + * Z_ELE_FAILED_LOGIC_AND, + * Z_ELE_FAILED_LOGIC_OR, + * Z_ELE_FAILED_LOGIC_MANY + * + * ------------------------------------------------------ */ +int load_fail_defaults(void) +{ + int check_for_failed = FALSE; + int cri1 = 0; /* Criteria1 ELE_FAILED_GREATER, etc */ + int cri2 = 0; + int logic_cri2 = 0; /* Logic for criteria 2 ELE_FAILED_LOGIC_NONE, AND, etc */ + float val1 = 0.0; /* failure threshold 1 */ + float val2= 0.0; /* failure threshold 2 */ + char failed_var_name[Z_MXVARIABLEDESC]={EOS}; + + check_for_failed = USERD_get_uns_failed_params( failed_var_name, + &val1, &val2, &cri1, &cri2, + &logic_cri2 ); + if (check_for_failed == TRUE) { + fprintf(stderr,"Failed element criteria info \n"); + fprintf(stderr,"Variable name = %s\n",failed_var_name); + fprintf(stderr,"Criteria 1 = %d\n",cri1); + fprintf(stderr,"Criteria 2 = %d\n",cri1); + fprintf(stderr,"Logic criteria = %d\n",logic_cri2); + fprintf(stderr,"Value 1 = %f\n",val1); + fprintf(stderr,"Value 2 = %f\n",val2); + } else { + fprintf(stderr,"No Failed elements\n"); + } + return(Z_OK); +} + + +/* End of File */ diff --git a/applications/test/ensightFoamReader/udr_checker-82.c b/applications/test/ensightFoamReader/udr_checker-82.c new file mode 100644 index 0000000000..8e0c572db6 --- /dev/null +++ b/applications/test/ensightFoamReader/udr_checker-82.c @@ -0,0 +1,5884 @@ +/*---------------------------------- + * User Defined Reader - checker + *----------------------------------*/ + +/******************************************************************** + * + * **************************************** + * Copyright 2004 Computational Engineering International, Inc. + * All Rights Reserved. + * + * Restricted Rights Legend + * + * Use, duplication, or disclosure of this + * software and its documentation by the + * Government is subject to restrictions as + * set forth in subdivision [(b)(3)(ii)] of + * the Rights in Technical Data and Computer + * Software clause at 52.227-7013. + *******************************************************************/ + +/*---------------------------------------------------------------------- + * MAJOR ROUTINES ACCESS: (VERSION 2.00) Gold_Userd API + * + * Get the name of the reader + * ========================== + * USERD_get_name_of_reader + * USERD_get_extra_gui_numbers (optional) + * USERD_get_extra_gui_defaults (optional) + * + * Get the reader version + * ====================== + * USERD_get_reader_version + * + * Set the filenames, gather timeset and time info + * =============================================== + * USERD_set_extra_gui_data (optional) + * USERD_set_server_number + * USERD_set_filenames + * USERD_get_number_of_timesets + * USERD_get_geom_timeset_number + * + * for each timeset: + * USERD_get_timeset_description + * USERD_get_num_of_time_steps + * USERD_get_sol_times + * + * USERD_set_time_set_and_step + * + * + * Gather variable and time info + * ============================= + * USERD_get_number_of_variables + * USERD_get_gold_variable_info + * + * + * Get initial part building info + * ============================== + * USERD_set_time_set_and_step + * USERD_get_changing_geometry_status + * USERD_get_node_label_status + * USERD_get_element_label_status + * USERD_get_number_of_files_in_dataset + * USERD_get_dataset_query_file_info + * USERD_get_descrip_lines (geometry) + * USERD_get_number_of_model_parts + * USERD_get_gold_part_build_info + * USERD_get_ghosts_in_model_flag + * USERD_get_maxsize_info + * USERD_get_ghosts_in_block_flag (if any ghost cells in model) + * USERD_get_model_extents **OR** + * USERD_get_part_coords **AND/OR** + * USERD_get_block_coords_by_component + * + * + * + * Part Builder + * ============ + * + * both unstructured and structured + * -------------------------------- + * USERD_set_time_set_and_step + * + * if unstructured + * --------------- + * USERD_get_part_element_ids_by_type + * USERD_get_part_elements_by_type + * + * if any nsided elements: + * USERD_get_nsided_conn + * + * if any nfaced elements: + * USERD_get_nfaced_nodes_per_face + * USERD_get_nfaced_conn + * + * USERD_get_part_coords + * USERD_get_part_node_ids + * + * else if structured + * ------------------ + * USERD_get_block_iblanking + * USERD_get_block_coords_by_component + * USERD_get_block_ghost_flags + * USERD_get_part_node_ids (If node ids given) + * USERD_get_part_element_ids_by_type (If element ids given) + * + * both again + * ---------- + * USERD_get_border_availability (If border representation + * USERD_get_border_elements_by_type is selected) + * + * USERD_stop_part_building + * + * + * Changing geometry + * ================= + * + * changing coords only + * -------------------- + * USERD_set_time_set_and_step + * USERD_get_descrip_lines + * USERD_get_part_coords + * USERD_get_block_coords_by_component + * + * changing connectivity + * --------------------- + * USERD_set_time_set_and_step + * USERD_get_descrip_lines + * USERD_get_number_of_model_parts + * USERD_get_gold_part_build_info + * USERD_get_ghosts_in_model_flag + * USERD_get_ghosts_in_block_flag (If any ghost cells in model) + * USERD_get_model_extents **OR** + * USERD_get_part_coords **AND/OR** + * USERD_get_block_coords_by_component + * USERD_get_part_element_ids_by_type + * USERD_get_part_elements_by_type + * USERD_get_part_coords + * USERD_get_part_node_ids + * USERD_get_block_iblanking + * USERD_get_block_coords_by_component + * USERD_get_block_ghost_flags (If ghost cells in part) + * USERD_get_part_node_ids (If node ids given) + * USERD_get_part_element_ids_by_type (If element ids given) + * + * USERD_get_border_availability (If border representation + * USERD_get_border_elements_by_type is selected) + * + * + * Loading Variables + * ================== + * + * constants + * --------- + * USERD_set_time_set_and_step + * USERD_get_constant_val + * + * scalars/vectors/tensors + * ----------------------- + * USERD_get_description_lines + * USERD_set_time_set_and_step + * USERD_get_var_by_component + * + * + * Node or Element queries over time + * ================================= + * USERD_get_var_value_at_specific + * + * + * At 2.03, added: + * --------------- + * + * Materials + * ========= + * USERD_get_number_of_material_sets + * USERD_get_matf_set_info + * + * If any material sets in the model (calls once per material set) + * USERD_get_number_of_materials + * USERD_get_matf_var_info + * + * For each element type of each part containing material ids + * USERD_size_matf_data + * USERD_load_matf_data + * + * + * At 2.04, added: + * --------------- + * USERD_get_uns_failed_params - Sets params used in element failure + * + * + *----------------------------------------------------------------------*/ + +/*---------------------------------------------------------------------- + * MAJOR ROUTINES ACCESS: (Version 1.00) original API + * + * Get the name of the reader + * ========================== + * USERD_get_name_of_reader + * USERD_get_extra_gui_numbers (optional -extra_gui on command line) + * USERD_get_extra_gui_defaults (optional -extra_gui on command line) + * + * Set the filenames + * ================= + * USERD_set_extra_gui_data (optional -extra_gui on command line) + * USERD_set_filenames + * USERD_get_number_of_time_steps + * USERD_get_solution_times + * USERD_set_time_step + * + * + * Gather variable and time info + * ============================= + * USERD_get_number_of_variables + * USERD_get_variable_info + * + * + * Get initial part building info + * ============================== + * USERD_set_time_step + * USERD_get_changing_geometry_status + * USERD_get_node_label_status + * USERD_get_element_label_status + * USERD_get_number_of_files_in_dataset + * USERD_get_dataset_query_file_info + * USERD_get_description_lines (geometry) + * USERD_get_number_of_model_parts + * USERD_get_part_build_info + * USERD_get_number_global_nodes + * USERD_get_global_coords + * USERD_get_block_coords_by_component + * + * Failure Info + * ============ + * USERD_get_uns_failed_params + * + * + * Part Builder + * ============ + * USERD_set_time_step + * USERD_get_global_coords + * USERD_get_global_node_ids + * USERD_get_element_connectivities_for_part + * USERD_get_element_ids_for_part + * USERD_get_block_iblanking + * USERD_get_block_coords_by_component + * + * USERD_stop_part_building + * + * + * Changing geometry + * ================= + * + * changing coords only + * -------------------- + * USERD_set_time_step + * USERD_get_global_coords + * USERD_get_block_coords_by_component + * + * changing connectivity + * --------------------- + * USERD_set_time_step + * USERD_get_number_of_model_parts + * USERD_get_part_build_info + * USERD_get_number_global_nodes + * USERD_get_global_coords + * USERD_get_global_node_ids + * USERD_get_element_connectivities_for_part + * USERD_get_element_ids_for_part + * USERD_get_block_iblanking + * USERD_get_block_coords_by_component + * + * Loading Variables + * ================= + * + * constants: + * ---------- + * USERD_set_time_step + * USERD_get_constant_value + * + * scalars: + * -------- + * USERD_get_description_lines + * USERD_set_time_step + * USERD_get_scalar_values + * USERD_get_block_scalar_values + * + * vectors: + * -------- + * USERD_get_description_lines + * USERD_set_time_step + * USERD_get_vector_values + * USERD_get_block_vector_values_by_component + * + * + * Node or Element queries over time + * ================================= + * USERD_get_variable_value_at_specific + * + *----------------------------------------------------------------------*/ +#include +#include +#ifndef WIN32 +#include +#endif +#include +#include +#include +#ifndef CONVEX +#include +#endif +#include + +#include "global_extern.h" + +/* ----------------------------------------------- + * If you wish to test out various optional routines + * you must uncomment the proper #define below + * + * #define _EGS is for extra_gui routines + * #define _VES is for var_extract_gui routines + *---------------------------------------------------*/ +/* #define _EGS */ +/* #define _VES */ + + +#if (defined USERD_API_209) +#define GT_USERD_API_100 +#define GT_USERD_API_200 +#define GT_USERD_API_201 +#define GT_USERD_API_202 +#define GT_USERD_API_203 +#define GT_USERD_API_204 +#define GT_USERD_API_205 +#define GT_USERD_API_206 +#define GT_USERD_API_207 +#define GT_USERD_API_208 + +#elif (defined USERD_API_208) +#define GT_USERD_API_100 +#define GT_USERD_API_200 +#define GT_USERD_API_201 +#define GT_USERD_API_202 +#define GT_USERD_API_203 +#define GT_USERD_API_204 +#define GT_USERD_API_205 +#define GT_USERD_API_206 +#define GT_USERD_API_207 + +#elif (defined USERD_API_207) +#define GT_USERD_API_100 +#define GT_USERD_API_200 +#define GT_USERD_API_201 +#define GT_USERD_API_202 +#define GT_USERD_API_203 +#define GT_USERD_API_204 +#define GT_USERD_API_205 +#define GT_USERD_API_206 + +#elif (defined USERD_API_206) +#define GT_USERD_API_100 +#define GT_USERD_API_200 +#define GT_USERD_API_201 +#define GT_USERD_API_202 +#define GT_USERD_API_203 +#define GT_USERD_API_204 +#define GT_USERD_API_205 + +#elif (defined USERD_API_205) +#define GT_USERD_API_100 +#define GT_USERD_API_200 +#define GT_USERD_API_201 +#define GT_USERD_API_202 +#define GT_USERD_API_203 +#define GT_USERD_API_204 + +#elif (defined USERD_API_204) +#define GT_USERD_API_100 +#define GT_USERD_API_200 +#define GT_USERD_API_201 +#define GT_USERD_API_202 +#define GT_USERD_API_203 + +#elif (defined USERD_API_203) +#define GT_USERD_API_100 +#define GT_USERD_API_200 +#define GT_USERD_API_201 +#define GT_USERD_API_202 + +#elif (defined USERD_API_202) +#define GT_USERD_API_100 +#define GT_USERD_API_200 +#define GT_USERD_API_201 + +#elif (defined USERD_API_201) +#define GT_USERD_API_100 +#define GT_USERD_API_200 + +#elif (defined USERD_API_200) +#define GT_USERD_API_100 +#endif + + +#define EOS '\0' + +typedef struct { + int id; /* part_id */ + char desc[Z_BUFL]; /* description given in the file */ + int type; /* Z_UNSTRUCTURED, Z_STRUCTURED, Z_IBLANKED */ + int ne[Z_MAXTYPE]; /* Number of elements per type (Z_UNSTRUCTURED) */ + /* or ne[0] = I dimension (Z_STRUCTURED) */ + /* ne[1] = J dimension */ + /* ne[2] = K dimension */ + int nn; /* Num of unstructured nodes (All_Local only) */ + int ghosts; /* TRUE if ghost cells, FALSE otherwise */ +}BUILDINFO; + +typedef struct { + char description[Z_BUFL]; /* description */ + char filename[Z_BUFL]; /* real filename */ + char ifilename[Z_BUFL]; /* imaginary filename */ + int type; + int classify; + int complex; + float freq; + int contran; + int timeset; +}VARINFO; + + +typedef struct { + char name[12]; /* Z_POINT, Z_G_POINT, Z_BAR02, ... */ + int con_len; /* Number of nodes per element */ +}EINFO; + + +/* Global variables + *-----------------*/ +int Geom_status; +int Node_labels; +int Element_labels; +int Ghosts_in_model; +int Num_parts; +int Num_vars; +int Num_materials_sets; +BUILDINFO *Pbuild; +VARINFO *Varinfo; +char Version_number[Z_MAX_USERD_NAME]; +int Num_time_sets; +int Num_time_steps; + +/* ------------------ + * Extra GUI stuff + * ------------------ */ +int Num_toggles = 0; +int Num_pulldowns = 0; +int Num_fields = 0; +char **Toggle_title; +int *Toggle_default_status; +char **Pulldown_title; +int *Pulldown_number_in_list; +int *Pulldown_default_selection; +char ***Pulldown_item_strings; +char **Field_title; +char **Field_user_string; +int *Toggle_choice; /* user choice */ +int *Pulldown_choice; /* user choice */ + +/* ------------------ + * Var Extract stuff + * ------------------ */ +int Num_ve_toggles = 0; +int Num_ve_pulldowns = 0; +int Num_ve_fields = 0; +char **Toggle_ve_title; +int *Toggle_ve_default_status; +char **Pulldown_ve_title; +int *Pulldown_ve_number_in_list; +int *Pulldown_ve_default_selection; +char ***Pulldown_ve_item_strings; +char **Field_ve_title; +char **Field_ve_user_string; +int *Toggle_ve_choice; /* user choice */ +int *Pulldown_ve_choice; /* user choice */ + +/* --------------------------- + * Failed elements (API 2.04) + * --------------------------- */ +int Any_uns_failed_model_elems = FALSE; + +/* --------------------------- + * Rigidbody (API 2.05) + * --------------------------- */ +int Any_Rigid_Body_Present = FALSE; + +/* --------------------------- + * Structured Reader Cinching (API 2.06) + * --------------------------- */ +int Doing_Structured_Cinching = FALSE; + + + +#if (defined USERD_API_100 || defined USERD_API_200) +EINFO Elem_info[Z_MAXTYPE] = {"Z_POINT",1, + "Z_BAR02",2, + "Z_BAR03",3, + "Z_TRI03",3, + "Z_TRI06",6, + "Z_QUA04",4, + "Z_QUA08",8, + "Z_TET04",4, + "Z_TET10",10, + "Z_PYR05",5, + "Z_PYR13",13, + "Z_PEN06",6, + "Z_PEN15",15, + "Z_HEX08",8, + "Z_HEX20",20}; +#elif defined USERD_API_201 +EINFO Elem_info[Z_MAXTYPE] = {"Z_POINT", 1, + "Z_G_POINT",1, + "Z_BAR02", 2, + "Z_G_BAR02",2, + "Z_BAR03", 3, + "Z_G_BAR03",3, + "Z_TRI03", 3, + "Z_G_TRI03",3, + "Z_TRI06", 6, + "Z_G_TRI06",6, + "Z_QUA04", 4, + "Z_G_QUA04",4, + "Z_QUA08", 8, + "Z_G_QUA08",8, + "Z_TET04", 4, + "Z_G_TET04",4, + "Z_TET10", 10, + "Z_G_TET10",10, + "Z_PYR05", 5, + "Z_G_PYR05",5, + "Z_PYR13", 13, + "Z_G_PYR13",13, + "Z_PEN06", 6, + "Z_G_PEN06",6, + "Z_PEN15", 15, + "Z_G_PEN15",15, + "Z_HEX08", 8, + "Z_G_HEX08",8, + "Z_HEX20", 20, + "Z_G_HEX20",20}; +#else +EINFO Elem_info[Z_MAXTYPE] = {"Z_POINT", 1, + "Z_G_POINT",1, + "Z_BAR02", 2, + "Z_G_BAR02",2, + "Z_BAR03", 3, + "Z_G_BAR03",3, + "Z_TRI03", 3, + "Z_G_TRI03",3, + "Z_TRI06", 6, + "Z_G_TRI06",6, + "Z_QUA04", 4, + "Z_G_QUA04",4, + "Z_QUA08", 8, + "Z_G_QUA08",8, + "Z_TET04", 4, + "Z_G_TET04",4, + "Z_TET10", 10, + "Z_G_TET10",10, + "Z_PYR05", 5, + "Z_G_PYR05",5, + "Z_PYR13", 13, + "Z_G_PYR13",13, + "Z_PEN06", 6, + "Z_G_PEN06",6, + "Z_PEN15", 15, + "Z_G_PEN15",15, + "Z_HEX08", 8, + "Z_G_HEX08",8, + "Z_HEX20", 20, + "Z_G_HEX20",20, + "Z_NSIDED", 1, /* Not yet implemented */ + "Z_G_NSIDED",1, /* Not yet implemented */ + "Z_NFACED", 1, /* Not yet implemented */ + "Z_G_NFACED",1}; /* Not yet implemented */ +#endif + + +/* Prototypes + *-----------*/ +static int load_fail_defaults(void); +static int prelim_info(int *two_fields, + int *any_extra_gui, + int *any_var_extract); +static int get_input(int set_server_number, + int use_playfile, + char playfile[Z_MAXFILENP], + int two_fields, + int any_extra_gui, + int any_var_extract, + int *swapbytes); +static int time_info( void ); +static int part_build_info(int geom_time_step); +static int variable_info( void ); + +#if (defined GT_USERD_API_100) +static int gold_part_builder(int geom_time_step); +static int gold_var_loader(int var_time_step); +#else +static int part_builder(int geom_time_step); +static int var_loader(int var_time_step); +#endif + +#if (defined GT_USERD_API_100) +static int materials_info( void ); +static int gold_materials_loader(int geom_time_step); +#endif + +static int entity_querys(int var_time_step); +static int exercise_bkup( void ); +static void usage( void ); + + +/*============= + * Main Routine + *=============*/ +#ifdef WIN32 +int main(int argc, char *argv[]) +#else +int main(int argc, char *argv[]) +#endif +{ + /* Command line option variables + *------------------------------*/ + int set_server_number = FALSE; + int use_playfile = FALSE; + char playfile[Z_MAXFILENP]; + FILE *fplay; + int geom_time_step = 0; + int var_time_step = 0; + + /* Other local variables + *----------------------*/ + int i, j; + int err; + int two_fields; + int any_extra_gui = FALSE; + int any_var_extract = FALSE; + int swapbytes; + int indx; + + /*---------------------------- + * Command argument processing + *----------------------------*/ + fprintf(stderr,"\n"); + fprintf(stderr,"\n"); + fprintf(stderr,"********************************************\n"); + fprintf(stderr,"* EnSight User Defined Reader Debug Tool *\n"); + fprintf(stderr,"********************************************\n"); + fprintf(stderr,"\n"); + + indx = 1; + while(indx < argc) { + + if(!strcmp("-h",argv[indx])) { + usage(); + } + else if(!strcmp("-help",argv[indx])) { + usage(); + } + + /* if you want to test the server number routines + * + * Use: + * > checker -server_number + * + * You will then be prompted for the current and total + * number of servers + *-----------------------------------------------*/ + else if(!strcmp("-server_number",argv[indx])) { + set_server_number = TRUE; + } + + /* if you want to use a "playfile" instead of being prompted + * for the data loader information + * + * Use: + * > checker -p + * + * This playfile should have 3 [or 4] lines: + * line 1: the path + * line 2: filename_1 + * line 3: [filename_2] (if two_fields is TRUE) + * line 4: 0 or 1, for swapytes (0 is FALSE, 1 is TRUE) + * + * example (two_fields is FALSE, so only 3 lines): + * + * /usr/scratch/stealth/bjn/dat/sp_gold/binary + * simple.case + * 1 + * + *------------------------------------------------------*/ + else if(!strcmp("-p",argv[indx])) { + indx++; + if((indx < argc) && (argv[indx][0] != '-')) { + use_playfile = TRUE; + memset(playfile,EOS,Z_MAXFILENP); + strcpy(playfile,argv[indx]); + } + else { + usage(); + } + } + + /* if you want to specify the geometry timestep to test (default is step 0) + * + * Use: + * > checker -gts # + * + * Where # is the step number (zero based) + *-------------------------------------------------------------------------*/ + else if(!strcmp("-gts",argv[indx])) { + indx++; + if((indx < argc) && (argv[indx][0] != '-')) { + geom_time_step = atoi(argv[indx]); + } + else { + usage(); + } + } + + /* if you want to specify the variable timestep to test (default is step 0) + * (will use this step for the appropriate timeset of each variable) + * + * Use: + * > checker -vts # + * + * Where # is the step number (zero based) + *-------------------------------------------------------------------------*/ + else if(!strcmp("-vts",argv[indx])) { + indx++; + if((indx < argc) && (argv[indx][0] != '-')) { + var_time_step = atoi(argv[indx]); + } + else { + usage(); + } + } + else { + usage(); + } + + indx++; + } + + + /*------------------------------------------------------------- + * + * Now start exercising EnSight + * + *--------------------------------------------------------------*/ + + /*----------------- + * Preliminary info + *-----------------*/ + err = prelim_info(&two_fields,&any_extra_gui,&any_var_extract); + if(err == Z_ERR) { + fprintf(stderr,"Stopping because of error in prelim_info\n"); + exit(1); + } + + + /*------------------ + * User input needed + *------------------*/ + err = get_input(set_server_number, + use_playfile, + playfile, + two_fields, + any_extra_gui, + any_var_extract, + &swapbytes); + if(err == Z_ERR) { + fprintf(stderr,"Stopping because of error in get_input\n"); + exit(1); + } + + + /*---------- + * Time info + *----------*/ + err = time_info(); + if(err == Z_ERR) { + fprintf(stderr,"Stopping because of error in time_info\n"); + exit(1); + } + + + /*---------------- + * Part build info + *----------------*/ + err = part_build_info(geom_time_step); + if(err == Z_ERR) { + fprintf(stderr,"Stopping because of error in part_build_info\n"); + exit(1); + } + + + /*------------------ + * Get Variable Info + *------------------*/ + err = variable_info(); + if(err == Z_ERR) { + fprintf(stderr,"Stopping because of error in variable_info\n"); + exit(1); + } + + +#if (defined GT_USERD_API_202) + /*------------------- + * Get Materials Info + *-------------------*/ + err = materials_info(); + if(err == Z_ERR) { + fprintf(stderr,"Stopping because of error in materials_info\n"); + exit(1); + } +#endif + +#if (defined GT_USERD_API_203) + if (Z_ERR == load_fail_defaults()) { + fprintf(stderr,"Stopping due to error in failed element flag routine\n"); + exit(1); + } +#endif + +#if (defined GT_USERD_API_204) + + /*----------------------------------------------- + * Mel needs to do these species routines yet!!! + *----------------------------------------------*/ + /* USERD_get_matsp_info + USERD_get_number_of_species */ + + + /* See if any rigid body in model + *-------------------------------*/ + fprintf(stderr,"\n------------- rigid body existence -------------\n"); + if(USERD_rigidbody_existence() == Z_OK) { + fprintf(stderr," Rigid Body values exist in the model\n"); + Any_Rigid_Body_Present = TRUE; + } + else { + fprintf(stderr," N0 Rigid Body values exist in the model\n"); + } + +#endif + + +#if (defined GT_USERD_API_205) + + /* See if doing structured cinching + *---------------------------------*/ + fprintf(stderr,"\n------------- structured reader cinching existence -------------\n"); + if(USERD_get_structured_reader_cinching() == Z_OK) { + fprintf(stderr," Doing structured reader cinching\n"); + fprintf(stderr," for each of the i,j,k directions,\n"); + fprintf(stderr," will send in min and max unchanged, but\n"); + fprintf(stderr," will send in stride as 2\n"); + Doing_Structured_Cinching = TRUE; + } + else { + fprintf(stderr," NOT doing structured reader cinching\n"); + } +#endif + +#if (defined GT_USERD_API_206) + + /* Probably won't do either of these - trivial + *--------------------------------------------*/ + /* USERD_prefer_auto_distribute */ + /* USERD_set_filename_button_labels */ +#endif + + +#if (defined GT_USERD_API_207) + + /* If we choose to do these, Bruce should implement them + *------------------------------------------------------*/ + /* All the _buffer routines! */ + + /* If we choose to do these, Bill should implement them + *-----------------------------------------------------*/ + /* USERD_get_num_xy_queries + USERD_get_xy_query_data + USERD_get_xy_query_info */ + +#endif + +#if (defined GT_USERD_API_208) + + /* If we choose to do these, Bruce should implement them + *------------------------------------------------------*/ + /* VGLYPH routines */ +#endif + + /*------------------------ + * Act like building parts + *------------------------*/ + if(Num_parts > 0) { + +#if (defined GT_USERD_API_100) + err = gold_part_builder(geom_time_step); +#else + err = part_builder(geom_time_step); +#endif + if(err == Z_ERR) { + fprintf(stderr,"Stopping because of error in part_builder\n"); + exit(1); + } + else { + USERD_stop_part_building(); + } + } + + + /*--------------------------- + * Act like loading variables + *---------------------------*/ + if(Num_vars > 0) { + +#if (defined GT_USERD_API_100) + err = gold_var_loader(var_time_step); +#else + err = var_loader(var_time_step); +#endif + if(err == Z_ERR) { + fprintf(stderr,"Stopping because of error in var_loader\n"); + exit(1); + } + } + +#if (defined GT_USERD_API_202) + /*--------------------------- + * Act like loading materials + *---------------------------*/ + if(Num_materials_sets > 0) { + err = gold_materials_loader(geom_time_step); + if(err == Z_ERR) { + fprintf(stderr,"Stopping because of error in materials_loader\n"); + exit(1); + } + } +#endif + + + + /*---------------------------------------------------- + * See if can do node and/or element queries over time + *----------------------------------------------------*/ + if(Num_parts > 0 && + Num_vars > 0) { + err = entity_querys(var_time_step); + if(err == Z_ERR) { + fprintf(stderr,"Stopping because of error in entity_querys\n"); + exit(1); + } + } + + /*---------------------------------------- + * Call the bkup file once in save mode, + * then again in restore mode - so someone + * could debug if desired + *----------------------------------------*/ + err = exercise_bkup(); + if(err == Z_ERR) { + fprintf(stderr,"Stopping due to error in saving and/or restoring archive\n"); + exit(1); + } + + /*------------- + * Exit Routine + *-------------*/ + fprintf(stderr,"\n----------------- exiting ---------------\n"); + +#if (defined GT_USERD_API_100) + USERD_exit_routine(); +#endif + + fprintf(stderr,"\n\n"); + + return(0); +} + +/*-------------- + * Usage routine + *--------------*/ +static void +usage( void ) +{ + fprintf(stderr,"------------------------------------------------------------\n"); + fprintf(stderr,"USAGE: checker [-p pfile] [-server_number] [-gts #] [-vts #]\n"); + fprintf(stderr,"------------------------------------------------------------\n"); + fprintf(stderr," -h, -help Prints out this USAGE text.\n"); + fprintf(stderr," -gts # Specify the geometry time step to use.)\n"); + fprintf(stderr," -p pfile Plays the checker playfile (pfile).\n"); + fprintf(stderr," -server_number Cause servers numbers to be prompted for.\n"); + fprintf(stderr," -vts # Specify the variable time step to use.)\n"); + fprintf(stderr,"\n"); + exit(1); +} + + + + +/*------------ + * prelim_info + *------------*/ +static int +prelim_info(int *two_fields, int *any_extra_gui, int *any_var_extract) +{ + int err; + char reader_name[Z_MAX_USERD_NAME]; + char release_number[Z_MAX_USERD_NAME]; + char description[Z_MAXFILENP]; + int i,j; + + *any_extra_gui = FALSE; + *any_var_extract = FALSE; + + /* Get the reader name + *--------------------*/ + err = USERD_get_name_of_reader(reader_name,two_fields); + if(err == Z_OK) { + fprintf(stderr," Name of reader: %s\n",reader_name); + if(*two_fields==1) { + fprintf(stderr," two_fields: TRUE\n"); + } + else if(*two_fields==0){ + fprintf(stderr," two_fields: FALSE\n"); + } + else if(*two_fields < 0) { + fprintf(stderr," two_fields: -1 (optional string) \n"); + } + } + else { + fprintf(stderr,"Error: Could not get name of reader\n"); + return(Z_ERR); + } + + /* Get the Extra GUI stuff (optional) + * ---------------------------------------------------------- */ +#ifdef _EGS + + /* Get the Extra GUI numbers of toggles, pulldowns, & fields + * ---------------------------------------------------------- */ + + USERD_get_extra_gui_numbers( &Num_toggles, + &Num_pulldowns, + &Num_fields ); + + if ( Num_toggles > 0 || Num_pulldowns > 0 || Num_fields > 0 ) { + + *any_extra_gui = TRUE; + + if (Num_toggles>0) { + Toggle_title = (char **) calloc(Num_toggles,sizeof(char*)); + if (Toggle_title == (char **)NULL) return(Z_ERR); + for (i=0; i 0) { + Pulldown_title = (char **) calloc( Num_pulldowns , sizeof(char*) ); + if (Pulldown_title == (char **)NULL) return(Z_ERR); + + Pulldown_item_strings = (char ***) calloc( Num_pulldowns , sizeof(char**) ); + if (Pulldown_item_strings == (char ***)NULL) return(Z_ERR); + + for (i=0; i 0) { + Field_title = (char **) calloc(Num_fields,sizeof(char*)); + Field_user_string = (char **) calloc(Num_fields,sizeof(char*)); + if (Field_title == (char **) NULL) return(Z_ERR); + for (i=0; i 0 || Num_ve_pulldowns > 0 || Num_ve_fields > 0 ) { + + *any_var_extract = TRUE; + + if (Num_ve_toggles > 0) { + Toggle_ve_title = (char **) calloc(Num_ve_toggles,sizeof(char*)); + if (Toggle_ve_title == (char **)NULL) return(Z_ERR); + for (i=0; i 0) { + Pulldown_ve_title = (char **) calloc( Num_ve_pulldowns , sizeof(char*) ); + if (Pulldown_ve_title == (char **)NULL) return(Z_ERR); + + Pulldown_ve_item_strings = (char ***) calloc( Num_ve_pulldowns , sizeof(char**) ); + if (Pulldown_ve_item_strings == (char ***)NULL) return(Z_ERR); + + for (i=0; i 0) { + Field_ve_title = (char **) calloc(Num_ve_fields,sizeof(char*)); + Field_ve_user_string = (char **) calloc(Num_ve_fields,sizeof(char*)); + if (Field_ve_title == (char **) NULL) return(Z_ERR); + for (i=0; i 0) { + fprintf(stderr,"Error: timeset numbers must be 1 or greater\n"); + fprintf(stderr," (unless Num_time_sets is zero also)\n"); + } + + + /* For each timeset + *-----------------*/ + for(ts=1; ts<=Num_time_sets; ++ts) { + + fprintf(stderr," Timeset %d:\n",ts); + + /* Get the timeset descriptions + *-----------------------------*/ + err = USERD_get_timeset_description(ts,ts_desc); + if(err == Z_ERR) { + fprintf(stderr,"Error: getting timeset description\n"); + return(Z_ERR); + } + else { + fprintf(stderr," description: %s\n",ts_desc); + } + + /* Get the number of time steps + *-----------------------------*/ + Num_time_steps = USERD_get_num_of_time_steps(ts); + fprintf(stderr," number of time steps: %d\n",Num_time_steps); + if(Num_time_steps < 1) { + fprintf(stderr," Error: Number of time steps returned: %d\n",Num_time_steps); + fprintf(stderr," (Must be >0 to be okay)\n"); + return(Z_ERR); + } + + + /* Get the solution times + *-----------------------*/ + if(Num_time_steps > 0) { + sol_times = (float *) calloc(Num_time_steps,sizeof(float)); + if(sol_times == (float *)NULL) { + fprintf(stderr,"Error: allocating for solution times\n"); + return(Z_ERR); + } + else { + err = USERD_get_sol_times(ts,sol_times); + if(err == Z_ERR) { + fprintf(stderr,"Error: getting solution times\n"); + return(Z_ERR); + } + else { + for(i=0; i0 to be okay)\n"); + return(Z_ERR); + } + + + /* Get the solution times + *-----------------------*/ + if(Num_time_steps > 0) { + sol_times = (float *) calloc(Num_time_steps,sizeof(float)); + if(sol_times == (float *)NULL) { + fprintf(stderr,"Error: allocating for solution times\n"); + return(Z_ERR); + } + else { + err = USERD_get_solution_times(sol_times); + if(err == Z_ERR) { + fprintf(stderr,"Error: getting solution times\n"); + return(Z_ERR); + } + else { + for(i=0; i0 to be okay)\n"); + return(Z_ERR); + } + if(geom_time_step > (Num_time_steps - 1)) { + geom_time_step = Num_time_steps - 1; + } + + /* Set the timeset and step - to first step + *-----------------------------------------*/ + USERD_set_time_set_and_step(geom_time_set,geom_time_step); + +#else + + /* Set the time step - to first step + *----------------------------------*/ + USERD_set_time_step(geom_time_step); + +#endif + + /* Get the changing geometry status + *---------------------------------*/ + Geom_status = USERD_get_changing_geometry_status(); + if(Geom_status == Z_STATIC) { + fprintf(stderr," Geom changing status: Z_STATIC\n"); + } + else if(Geom_status == Z_CHANGE_COORDS) { + fprintf(stderr," Geom changing status: Z_CHANGE_COORDS\n"); + } + else if(Geom_status == Z_CHANGE_CONN) { + fprintf(stderr," Geom changing status: Z_CHANGE_CONN\n"); + } + else { + fprintf(stderr," Invalid Geom changing status!!\n"); + } + + + /* Get the node label status + *--------------------------*/ + Node_labels = USERD_get_node_label_status(); + if(Node_labels) { + fprintf(stderr," Node labels will be provided\n"); + } + else { + fprintf(stderr," Node labels will NOT be provided\n"); + } + + /* Get the element label status + *-----------------------------*/ + Element_labels = USERD_get_element_label_status(); + if(Element_labels) { + fprintf(stderr," Element labels will be provided\n"); + } + else { + fprintf(stderr," Element labels will NOT be provided\n"); + } + + fprintf(stderr,"\n"); + + /* Get the number of files in the dataset + *---------------------------------------*/ + num_dataset_files = USERD_get_number_of_files_in_dataset(); + fprintf(stderr," Number of files in dataset: %d\n",num_dataset_files); + + + /* Get the dataset query file info + *--------------------------------*/ + if(num_dataset_files > 0) { + + qfiles = (Z_QFILES *) calloc(num_dataset_files,sizeof(Z_QFILES)); + if(qfiles == (Z_QFILES *)NULL) { + fprintf(stderr,"Error: allocating for dataset query files\n"); + return(Z_ERR); + } + else { + + for(i=0; i 0) { + fprintf(stderr," Number of parts: %d\n",Num_parts); + } + else { + fprintf(stderr," Problems getting number of parts\n"); + return(Z_ERR); + } + + + + /* Get the gold part build info + *-----------------------------*/ + Pbuild = (BUILDINFO *) calloc(Num_parts,sizeof(BUILDINFO)); + if(Pbuild == (BUILDINFO *)NULL) { + fprintf(stderr," Problems allocating for Pbuild structure\n"); + return(Z_ERR); + } + + + part_ids = (int *) calloc(Num_parts,sizeof(int)); + if(part_ids == (int *)NULL) { + fprintf(stderr," Problems allocating for part ids\n"); + return(Z_ERR); + } + + part_types = (int *) calloc(Num_parts,sizeof(int)); + if(part_types == (int *)NULL) { + fprintf(stderr," Problems allocating for part types\n"); + return(Z_ERR); + } + + part_descriptions = (char **) calloc(Num_parts,sizeof(char *)); + if(part_descriptions == (char **)NULL) { + fprintf(stderr," Problems allocating for part descriptions\n"); + return(Z_ERR); + } + else { + for(i=0; i 0) { + fprintf(stderr," # %s elements: %d\n", + Elem_info[j].name,num_elems[i][j]); + Pbuild[i].ne[j] = num_elems[i][j]; + } + } + + if(part_types[i] != Z_UNSTRUCTURED) { + + /* For this checker, we will place the following in the + * Pbuild[].ne[] structure: + * + * Note this can be used for block size whether ranges or not + * ------------------------------------------------------------- + * Pbuild[].ne[0] = i dim of current block (to the range selected) + * Pbuild[].ne[1] = j dim of current block (to the range selected) + * Pbuild[].ne[2] = k dim of current block (to the range selected) + * + * Thus if ranges: + * --------------- + * Pbuild[].ne[3] = i min range (-1 indicates no ranges) + * Pbuild[].ne[4] = i max range + * Pbuild[].ne[5] = i min range + * Pbuild[].ne[6] = i max range + * Pbuild[].ne[7] = i min range + * Pbuild[].ne[8] = i max range + * + * Pbuild[].ne[9] = i dim of total block (if ranges) + * Pbuild[].ne[10] = j dim of total block (if ranges) + * Pbuild[].ne[11] = k dim of total block (if ranges) + * + * What comes back from the api is: + * -------------------------------- + * before 2.03 (no ranges) + * ----------------------- + * ijk_dimensions[][0] = i dim of block + * ijk_dimensions[][1] = j dim of block + * ijk_dimensions[][2] = k dim of block + * + * at 2.03 (if no ranges) + * ------- + * ijk_dimensions[][0] = i dim of block + * ijk_dimensions[][1] = j dim of block + * ijk_dimensions[][2] = k dim of block + * ijk_dimensions[][3] = -1 + * + * at 2.03 (if ranges) + * ------- + * ijk_dimensions[][0] = i dim of total block + * ijk_dimensions[][1] = j dim of total block + * ijk_dimensions[][2] = k dim of total block + * ijk_dimensions[][3] = i min range + * ijk_dimensions[][4] = i max range + * ijk_dimensions[][5] = j min range + * ijk_dimensions[][6] = j max range + * ijk_dimensions[][7] = k min range + * ijk_dimensions[][8] = k max range + *--------------------------------------------------------------*/ + +#if (defined GT_USERD_API_202) + if(ijk_dimensions[i][3] == -1) { + fprintf(stderr," ijk_dimensions: %d %d %d\n", + ijk_dimensions[i][0], + ijk_dimensions[i][1], + ijk_dimensions[i][2]); + Pbuild[i].ne[0] = ijk_dimensions[i][0]; + Pbuild[i].ne[1] = ijk_dimensions[i][1]; + Pbuild[i].ne[2] = ijk_dimensions[i][2]; + Pbuild[i].ne[3] = ijk_dimensions[i][3]; + } + else { + + /* If empty part + *--------------*/ + if(ijk_dimensions[i][0] == 0 && + ijk_dimensions[i][1] == 0 && + ijk_dimensions[i][2] == 0) { + fprintf(stderr," ijk_dimensions: %d %d %d\n", + ijk_dimensions[i][0], + ijk_dimensions[i][1], + ijk_dimensions[i][2]); + Pbuild[i].ne[0] = ijk_dimensions[i][0]; + Pbuild[i].ne[1] = ijk_dimensions[i][1]; + Pbuild[i].ne[2] = ijk_dimensions[i][2]; + Pbuild[i].ne[3] = -1; + } + + /* range part + *-----------*/ + else { + Pbuild[i].ne[0] = ijk_dimensions[i][4] - ijk_dimensions[i][3] + 1; + Pbuild[i].ne[1] = ijk_dimensions[i][6] - ijk_dimensions[i][5] + 1; + Pbuild[i].ne[2] = ijk_dimensions[i][8] - ijk_dimensions[i][7] + 1; + + Pbuild[i].ne[3] = ijk_dimensions[i][3]; + Pbuild[i].ne[4] = ijk_dimensions[i][4]; + Pbuild[i].ne[5] = ijk_dimensions[i][5]; + Pbuild[i].ne[6] = ijk_dimensions[i][6]; + Pbuild[i].ne[7] = ijk_dimensions[i][7]; + Pbuild[i].ne[8] = ijk_dimensions[i][8]; + + Pbuild[i].ne[9] = ijk_dimensions[i][0]; + Pbuild[i].ne[10] = ijk_dimensions[i][1]; + Pbuild[i].ne[11] = ijk_dimensions[i][2]; + + fprintf(stderr," Part has ranges:\n"); + fprintf(stderr," ijk dimensions of total block: %d %d %d\n", + Pbuild[i].ne[9], + Pbuild[i].ne[10], + Pbuild[i].ne[11]); + fprintf(stderr," i range: %d to %d\n", + Pbuild[i].ne[3], + Pbuild[i].ne[4]); + fprintf(stderr," j range: %d to %d\n", + Pbuild[i].ne[5], + Pbuild[i].ne[6]); + fprintf(stderr," k range: %d to %d\n", + Pbuild[i].ne[7], + Pbuild[i].ne[8]); + fprintf(stderr," ijk dimensions of range portion: %d %d %d\n", + Pbuild[i].ne[0], + Pbuild[i].ne[1], + Pbuild[i].ne[2]); + } + } +#else + fprintf(stderr," ijk_dimensions: %d %d %d\n", + ijk_dimensions[i][0], + ijk_dimensions[i][1], + ijk_dimensions[i][2]); + Pbuild[i].ne[0] = ijk_dimensions[i][0]; + Pbuild[i].ne[1] = ijk_dimensions[i][1]; + Pbuild[i].ne[2] = ijk_dimensions[i][2]; + Pbuild[i].ne[3] = -1; +#endif + if(part_types[i] == Z_IBLANKED) { + fprintf(stderr," Ibanking options on:\n"); + if(iblanking_options[i][Z_EXT]) { + fprintf(stderr," Z_EXT\n"); + } + if(iblanking_options[i][Z_INT]) { + fprintf(stderr," Z_INT\n"); + } + if(iblanking_options[i][Z_BND]) { + fprintf(stderr," Z_BND\n"); + } + if(iblanking_options[i][Z_INTBND]) { + fprintf(stderr," Z_INTBND\n"); + } + if(iblanking_options[i][Z_SYM]) { + fprintf(stderr," Z_SYM\n"); + } + } + } + } + } + + +#if (defined GT_USERD_API_200) + + /* Get ghosts in model flag + *-------------------------*/ + Ghosts_in_model = USERD_get_ghosts_in_model_flag(); + if(Ghosts_in_model) { + fprintf(stderr," Ghosts in Model: TRUE\n"); + } + else { + fprintf(stderr," Ghosts in Model: FALSE\n"); + } + + /* Get ghosts in block flag - if needed + *-------------------------------------*/ + for(i=1; i<=Num_parts; ++i) { + if(part_types[i-1] != Z_UNSTRUCTURED && Ghosts_in_model) { + ghosts_in_block = USERD_get_ghosts_in_block_flag(i); + Pbuild[i-1].ghosts = ghosts_in_block; + if(ghosts_in_block) { + fprintf(stderr," Ghosts in block part %d: TRUE\n",i); + } + else { + fprintf(stderr," Ghosts in block part %d: FALSE\n",i); + } + } + } + +#endif + + +#if (defined GT_USERD_API_100) + + /* Get maxsize info + *-----------------*/ + max_num_nodes = (int *) calloc(Num_parts,sizeof(int)); + if(max_num_nodes == (int *)NULL) { + fprintf(stderr," Problems allocating for part max num of nodes\n"); + return(Z_ERR); + } + + max_num_elems = (int **) calloc(Num_parts,sizeof(int *)); + if(max_num_elems == (int **)NULL) { + fprintf(stderr," Problems allocating for part max num of elements\n"); + return(Z_ERR); + } + else { + for(i=0; i 0) { + fprintf(stderr," max # %s elems: %d\n", + Elem_info[j].name,max_num_elems[i][j]); + } + } + + if(part_types[i] != Z_UNSTRUCTURED) { + fprintf(stderr," max_ijk_dimensions: %d %d %d\n", + max_ijk_dimensions[i][0], + max_ijk_dimensions[i][1], + max_ijk_dimensions[i][2]); + } + } + } + + /* Get model extents - if given + *-----------------------------*/ + err = USERD_get_model_extents(extents); + if(err == Z_ERR) { + fprintf(stderr," No extents given\n"); + } + else { + fprintf(stderr," Min x: %g\n",extents[0]); + fprintf(stderr," Max x: %g\n",extents[1]); + fprintf(stderr," Min y: %g\n",extents[2]); + fprintf(stderr," Max y: %g\n",extents[3]); + fprintf(stderr," Min z: %g\n",extents[4]); + fprintf(stderr," Max z: %g\n",extents[5]); + } + +#endif + + /* Free the allocated memory + *--------------------------*/ + free(part_ids); + free(part_types); + free(number_of_nodes); + + for(i=0; i 0) { + /* Get the timeset used for the geometry + *--------------------------------------*/ + geom_timeset = USERD_get_geom_timeset_number(); + + /* Get the number of time steps for this timeset + *----------------------------------------------*/ + Num_time_steps = USERD_get_num_of_time_steps(geom_timeset); + if(Num_time_steps < 1) { + fprintf(stderr," Error: Number of time steps returned: %d\n",Num_time_steps); + fprintf(stderr," (Must be >0 to be okay)\n"); + return(Z_ERR); + } + if(geom_time_step > (Num_time_steps - 1)) { + geom_time_step = Num_time_steps - 1; + } + + /* Set the timeset and step - to first step by default, but + * can set it at others using -gts command argument + *---------------------------------------------------------*/ + USERD_set_time_set_and_step(geom_timeset,geom_time_step); + + fprintf(stderr," Using timeset: %d (step range is %d through %d)\n", + geom_timeset,0,Num_time_steps-1); + fprintf(stderr," Using time step: %d\n",geom_time_step); + } + + for(p=0; p 0) { + + pdata = (int *)calloc(ne*Elem_info[et].con_len,sizeof(int)); + if(pdata == (int *) NULL) { + fprintf(stderr,"Error: allocating conns array\n"); + return(Z_ERR); + } + else { + conns = (int **) calloc(ne,sizeof(int *)); + if(conns == (int **) NULL) { + fprintf(stderr,"Error: allocating conns array\n"); + return(Z_ERR); + } + for(i=0; i 0) { + fprintf(stderr," %s Element %d of %d:\n",Elem_info[et].name,i+1,ne); + if(Element_labels) { + fprintf(stderr," id: %d\n",elemids[i]); + } + fprintf(stderr," connectivity:"); + + for(j=nsid_len-conns[i][0]; j Pbuild[p].nn ) { + fprintf(stderr,"\n****************************\n"); + fprintf(stderr,"Connectivity value out of bounds: \n"); + fprintf(stderr,"Either less than zero or greater than \n"); + fprintf(stderr," number of nodes in part!! \n"); + fprintf(stderr,"i = %d j = %d conns[i][j] = %d \n",i,j,conns[i][j]); + fprintf(stderr,"****************************\n"); + } + } + /* ---------- uncomment to print out connectivity values ---------- */ +/* fprintf(stderr,"\n"); */ + } +#endif + /* Last element of the type + *-------------------------*/ + i = ne - 1; + if(i > 0) { + fprintf(stderr," %s Element %d of %d:\n",Elem_info[et].name,i+1,ne); + if(Element_labels) { + fprintf(stderr," id: %d\n",elemids[i]); + } + fprintf(stderr," connectivity:"); + for(j=0; j 0) { + + coords = (float **) calloc(3,sizeof(float *)); + if(coords == (float **) NULL) { + fprintf(stderr,"Error: allocating coords array\n"); + return(Z_ERR); + } + else { + for(i=0; i<3; ++i) { + coords[i] = (float *) calloc((nn+1),sizeof(float)); + if(coords[i] == (float *) NULL) { + fprintf(stderr,"Error: allocating coords array\n"); + return(Z_ERR); + } + } + } + + if(Node_labels) { + nodeids = (int *) calloc((nn+1),sizeof(int)); + if(nodeids == (int *) NULL) { + fprintf(stderr,"Error: allocating nodeids array\n"); + return(Z_ERR); + } + } + + + err = USERD_get_part_coords(pn,coords); + if(err == Z_ERR) { + fprintf(stderr,"Error: getting unstructured coords\n"); + return(Z_ERR); + } + + if(Node_labels) { + err = USERD_get_part_node_ids(pn,nodeids); + if(err == Z_ERR) { + fprintf(stderr,"Error: getting nodeids\n"); + return(Z_ERR); + } + } + + /* Echo "some" info + *-----------------*/ + + /* First node + *-----------*/ + i = 1; + fprintf(stderr," Node %d of %d:\n",i,nn); + if(Node_labels) { + fprintf(stderr," id: %d\n",nodeids[i]); + } + fprintf(stderr," x y z coordinates: %g %g %g\n", + coords[0][i], coords[1][i], coords[2][i]); + mm[0] = mm[1] = coords[0][i]; + mm[2] = mm[3] = coords[1][i]; + mm[4] = mm[5] = coords[2][i]; + + + /* Last node + *----------*/ + i = nn; + if(i > 1) { + fprintf(stderr," Node %d of %d:\n",i,nn); + if(Node_labels) { + fprintf(stderr," id: %d\n",nodeids[i]); + } + fprintf(stderr," x y z coordinates: %g %g %g\n", + coords[0][i], coords[1][i], coords[2][i]); + } + + /* Min and max coordinate values + *------------------------------*/ + for(i=2; i<=nn; ++i) { + if(coords[0][i] < mm[0]) { + mm[0] = coords[0][i]; + } + if(coords[0][i] > mm[1]) { + mm[1] = coords[0][i]; + } + if(coords[1][i] < mm[2]) { + mm[2] = coords[1][i]; + } + if(coords[1][i] > mm[3]) { + mm[3] = coords[1][i]; + } + if(coords[2][i] < mm[4]) { + mm[4] = coords[2][i]; + } + if(coords[2][i] > mm[5]) { + mm[5] = coords[2][i]; + } + } + + fprintf(stderr," Coordinate ranges:\n"); + fprintf(stderr," min x: %g\n",mm[0]); + fprintf(stderr," max x: %g\n",mm[1]); + fprintf(stderr," min y: %g\n",mm[2]); + fprintf(stderr," max y: %g\n",mm[3]); + fprintf(stderr," min z: %g\n",mm[4]); + fprintf(stderr," max z: %g\n",mm[5]); + + + /* Free the allocated memory + *--------------------------*/ + for(i=0; i<3; ++i) { + free(coords[i]); + } + free(coords); + if(Node_labels) { + free(nodeids); + } + } + } + + + /*--------------------- + * For structured parts + *---------------------*/ + else { + + empty_part = FALSE; + if(Pbuild[p].ne[0] == 0 && + Pbuild[p].ne[1] == 0 && + Pbuild[p].ne[2] == 0) { + empty_part = TRUE; + } + + if(!empty_part) { + + /* Get the block coords + *---------------------*/ + for(comp=0; comp<3; ++comp) { + if(Pbuild[p].ne[comp] < 1) { + bdim[comp] = 1; + } + else { + + if(Doing_Structured_Cinching) { + bdim[comp] = Pbuild[p].ne[comp]; + + /* even */ + if((bdim[comp] % 2) == 0) { + bdim[comp] = (bdim[comp]/2) + 1; + } + /* odd */ + else { + bdim[comp] = ((bdim[comp]-1)/2) + 1; + } + } + + else { + bdim[comp] = Pbuild[p].ne[comp]; + } + } + } + + nn = bdim[0] * bdim[1] * bdim[2]; + + bd1 = bdim[0]-1; + if(bd1 < 1) { + bd1 = 1; + } + bd2 = bdim[1]-1; + if(bd2 < 1) { + bd2 = 1; + } + bd3 = bdim[2]-1; + if(bd3 < 1) { + bd3 = 1; + } + ne = bd1 * bd2 * bd3; + + /* Determine cell type + *--------------------*/ + num_dims = 3; + for(i=0; i<3; ++i) { + if(bdim[i] == 1) { + --num_dims; + } + } + if(num_dims == 3) { + cell_type = Z_HEX08; + } + else if(num_dims == 2) { + cell_type = Z_QUA04; + } + else { + cell_type = Z_BAR02; + } + + coords = (float **) calloc(num_dims,sizeof(float *)); + if(coords == (float **) NULL) { + fprintf(stderr,"Error: allocating coords array\n"); + return(Z_ERR); + } + else { + for(i=0; i 0) { + i = 0; + fprintf(stderr," Node %d of %d:\n",i+1,nn); + +#if (defined GT_USERD_API_200) + + if(Node_labels) { + fprintf(stderr," id: %d\n",nodeids[i]); + } +#endif + if(num_dims == 3) { + fprintf(stderr," x y z coordinates: %g %g %g\n", + coords[0][i], coords[1][i], coords[2][i]); + mm[0] = mm[1] = coords[0][i]; + mm[2] = mm[3] = coords[1][i]; + mm[4] = mm[5] = coords[2][i]; + } + else if(num_dims == 2) { + fprintf(stderr," x y coordinates: %g %g\n", + coords[0][i], coords[1][i]); + mm[0] = mm[1] = coords[0][i]; + mm[2] = mm[3] = coords[1][i]; + } + else { + fprintf(stderr," x coordinates: %g\n", + coords[0][i]); + mm[0] = mm[1] = coords[0][i]; + } + + + /* Last node + *----------*/ + i = nn-1; + if(i > 1) { + fprintf(stderr," Node %d of %d:\n",i+1,nn); + +#if (defined GT_USERD_API_200) + if(Node_labels) { + fprintf(stderr," id: %d\n",nodeids[i]); + } +#endif + if(num_dims == 3) { + fprintf(stderr," x y z coordinates: %g %g %g\n", + coords[0][i], coords[1][i], coords[2][i]); + } + else if(num_dims == 2) { + fprintf(stderr," x y coordinates: %g %g\n", + coords[0][i], coords[1][i]); + } + else { + fprintf(stderr," x coordinates: %g\n", + coords[0][i]); + } + } + } + + /* Min and max coordinate values + *------------------------------*/ + for(i=1; i mm[1]) { + mm[1] = coords[0][i]; + } + if(num_dims > 1) { + if(coords[1][i] < mm[2]) { + mm[2] = coords[1][i]; + } + if(coords[1][i] > mm[3]) { + mm[3] = coords[1][i]; + } + } + if(num_dims > 2) { + if(coords[2][i] < mm[4]) { + mm[4] = coords[2][i]; + } + if(coords[2][i] > mm[5]) { + mm[5] = coords[2][i]; + } + } + } + + fprintf(stderr," Coordinate ranges:\n"); + fprintf(stderr," min x: %g\n",mm[0]); + fprintf(stderr," max x: %g\n",mm[1]); + if(num_dims > 1) { + fprintf(stderr," min y: %g\n",mm[2]); + fprintf(stderr," max y: %g\n",mm[3]); + } + if(num_dims > 2) { + fprintf(stderr," min z: %g\n",mm[4]); + fprintf(stderr," max z: %g\n",mm[5]); + } + + /* Free the allocated memory - so far + *-----------------------------------*/ + for(i=0; i 0) { + ++num_ghosts; + } + } + + fprintf(stderr," Block Ghost flag breakdown:\n"); + fprintf(stderr," %d ghost cells out of %d total cells\n", + num_ghosts,ne); + + free(ghost_flag); + } + + /* Get the element ids - if any + *-----------------------------*/ + if(Element_labels) { + + elemids = (int *) calloc(ne,sizeof(int)); + if(elemids == (int *) NULL) { + fprintf(stderr,"Error: allocating elemids array\n"); + return(Z_ERR); + } + + + et = cell_type; + err = USERD_get_part_element_ids_by_type(pn,et,elemids); + if(err == Z_ERR) { + fprintf(stderr,"Error: getting element ids\n"); + return(Z_ERR); + } + + /* First element of the type + *--------------------------*/ + i = 0; + fprintf(stderr," %s Element %d of %d:\n",Elem_info[et].name,i+1,ne); + fprintf(stderr," id: %d\n",elemids[i]); + + /* Last element of the type + *-------------------------*/ + i = ne - 1; + if(i > 0) { + fprintf(stderr," %s Element %d of %d:\n",Elem_info[et].name,i+1,ne); + fprintf(stderr," id: %d\n",elemids[i]); + } + + free(elemids); + } +#endif + } + else { + fprintf(stderr," Empty structured part\n"); + } + } + + /* Get border availability + *------------------------*/ + err = USERD_get_border_availability(pn,num_elems); + if(err == Z_OK) { + + /* Get border elements - if any + *-----------------------------*/ + for(et=0; et 0) { + + conns = (int **) calloc(ne,sizeof(int *)); + if(conns == (int **) NULL) { + fprintf(stderr,"Error: allocating border conns array\n"); + return(Z_ERR); + } + else { + for(i=0; i 0) { + fprintf(stderr," %s border element %d of %d:\n", + Elem_info[et].name,i+1,ne); + fprintf(stderr," Parent type: %s\n", + Elem_info[parent_type[i]].name); + fprintf(stderr," Parent num: %d\n",parent_num[i]); + fprintf(stderr," connectivity:"); + for(j=0; j 0) { + fprintf(stderr,"\n"); + } + if(Varinfo[v].classify == Z_PER_NODE) { + fprintf(stderr," Z_PER_NODE Variable %d:\n",vn); + } + else { + fprintf(stderr," Z_PER_ELEM Variable %d:\n",vn); + } + + + if(Num_time_sets > 0) { + /* Get the timeset used for the variable + *---------------------------------------*/ + var_timeset = Varinfo[v].timeset; + + /* Get the number of time steps for this timeset + *----------------------------------------------*/ + Num_time_steps = USERD_get_num_of_time_steps(var_timeset); + if(Num_time_steps < 1) { + fprintf(stderr," Error: Number of time steps returned: %d\n", + Num_time_steps); + fprintf(stderr," (Must be >0 to be okay)\n"); + return(Z_ERR); + } + if(var_time_step > (Num_time_steps - 1)) { + var_time_step = Num_time_steps - 1; + } + + /* Set the timeset and step - to first step by default, but + * can set it at others using -vts command argument + *---------------------------------------------------------*/ + USERD_set_time_set_and_step(var_timeset,var_time_step); + + fprintf(stderr," Using timeset: %d (step range is %d through %d)\n", + var_timeset,0,Num_time_steps-1); + fprintf(stderr," Using time step: %d\n",var_time_step); + } + + + /* Constants + *----------*/ + if(Varinfo[v].type == Z_CONSTANT) { + + constant_val = USERD_get_constant_val(vn,FALSE); + fprintf(stderr," Constant (%s):\n",Varinfo[v].description); + fprintf(stderr," value: %g\n",constant_val); + + if(Varinfo[v].complex) { + constant_val = USERD_get_constant_val(vn,TRUE); + fprintf(stderr," value (imag): %g\n",constant_val); + } + } + + /* Scalars, Vectors, Tensors + *--------------------------*/ + else { + + /* Get the var description line + *-----------------------------*/ + err = USERD_get_descrip_lines(Z_VARI,vn,FALSE,line1,line2); + if(err == Z_OK) { + fprintf(stderr," Desc line: %s\n",line1); + } + else { + fprintf(stderr,"Error: getting var description line\n"); + return(Z_ERR); + } + + if(Varinfo[v].complex) { + err = USERD_get_descrip_lines(Z_VARI,vn,TRUE,line1,line2); + if(err == Z_OK) { + fprintf(stderr," Desc line (imag): %s\n",line1); + } + else { + fprintf(stderr,"Error: getting var description line (imag)\n"); + return(Z_ERR); + } + } + + + /* Get the values by component + *-----------------------------*/ + if(Varinfo[v].type == Z_SCALAR) { + num_comps = 1; + } + else if(Varinfo[v].type == Z_VECTOR) { + num_comps = 3; + } + else if(Varinfo[v].type == Z_TENSOR) { + num_comps = 6; + } + else if(Varinfo[v].type == Z_TENSOR9) { + num_comps = 9; + } + + + /* Per_Node + *---------*/ + if(Varinfo[v].classify == Z_PER_NODE) { + + for(p=0; p 0) { + values = (float *) calloc((nsize+1),sizeof(float)); + if(values == (float *) NULL) { + fprintf(stderr,"Error: alocating variable values\n"); + return(Z_ERR); + } + + for(comp=0; comp maxv) { + maxv = values[i]; + } + } + + fprintf(stderr," For component %d: \n",comp); + fprintf(stderr," node %10d value: %g\n",1,values[1]); + fprintf(stderr," node %10d value: %g\n",nsize,values[nsize]); + fprintf(stderr," min value: %g\n",minv); + fprintf(stderr," max value: %g\n",maxv); + + if(Varinfo[v].complex) { + err = USERD_get_var_by_component(vn, + pn, + Varinfo[v].type, + 0, + FALSE, + comp, + values); + if(err == Z_UNDEF) { + fprintf(stderr," Variable not defined on this part\n"); + } + + /* For the component, show 1st node, last node, min, max values + *-------------------------------------------------------------*/ + minv = maxv = values[1]; + for(i=2; i<=nsize; ++i) { + if(values[i] < minv) { + minv = values[i]; + } + if(values[i] > maxv) { + maxv = values[i]; + } + } + + fprintf(stderr," For component %d (imag): \n",comp); + fprintf(stderr," node %10d value: %g\n",1,values[1]); + fprintf(stderr," node %10d value: %g\n",nsize,values[nsize]); + fprintf(stderr," min value: %g\n",minv); + fprintf(stderr," max value: %g\n",maxv); + } + } + free(values); + } + } + } + + /* Per_Elem + *---------*/ + else { + for(p=0; p 0) { + + fprintf(stderr," For part %d, with %d elems of type %s:\n", + pn,nsize,Elem_info[et].name); + + + values = (float *) calloc((nsize+1),sizeof(float)); + if(values == (float *) NULL) { + fprintf(stderr,"Error: alocating variable values\n"); + return(Z_ERR); + } + + for(comp=0; comp maxv) { + maxv = values[i]; + } + } + + fprintf(stderr," For component %d: \n",comp); + fprintf(stderr," elem %10d value: %g\n",1,values[1]); + fprintf(stderr," elem %10d value: %g\n",nsize,values[nsize]); + fprintf(stderr," min value: %g\n",minv); + fprintf(stderr," max value: %g\n",maxv); + + if(Varinfo[v].complex) { + err = USERD_get_var_by_component(vn, + pn, + Varinfo[v].type, + et, + FALSE, + comp, + values); + if(err == Z_UNDEF) { + fprintf(stderr," Variable not defined on this part\n"); + } + + /* For the component, show 1st elem, last elem, min, max values + *-------------------------------------------------------------*/ + minv = maxv = values[1]; + for(i=2; i<=nsize; ++i) { + if(values[i] < minv) { + minv = values[i]; + } + if(values[i] > maxv) { + maxv = values[i]; + } + } + + fprintf(stderr," For component %d (imag): \n",comp); + fprintf(stderr," elem %10d value: %g\n",1,values[1]); + fprintf(stderr," elem %10d value: %g\n",nsize,values[nsize]); + fprintf(stderr," min value: %g\n",minv); + fprintf(stderr," max value: %g\n",maxv); + + } + } + free(values); + } + } + } + } + } + } + + return(Z_OK); +} + +#else + +/*------------- + * part_builder + *-------------*/ +static int +part_builder(int geom_time_step) +{ + int i, j; + int err; + int p, pn; + int et, ne; + int *elemids[Z_MAXTYPE]; + int **conns[Z_MAXTYPE]; + int nn; + int comp; + int bdim[3]; + int ib[5]; + int num_dims; + int cell_type; + float mm[6]; + float **coords; + int *nodeids; + int *iblanking; + CRD *crds; + int bd1,bd2,bd3; + + + fprintf(stderr,"\n------------- part_builder --------------\n"); + + + if(Num_time_steps > 1) { + if(geom_time_step > (Num_time_steps - 1)) { + geom_time_step = Num_time_steps - 1; + } + + /* Set the time step - to first step by default, but + * can set it at others using -gts command argument + *---------------------------------------------------*/ + USERD_set_time_step(geom_time_step); + + fprintf(stderr," Using time step: %d (where range is %d through %d\n", + geom_time_step,0,Num_time_steps-1); + } + + + /* Get the global coords + *----------------------*/ + nn = USERD_get_number_of_global_nodes(); + + if(nn > 0) { + + crds = (CRD *) calloc(nn,sizeof(CRD)); + if(crds == (CRD *) NULL) { + fprintf(stderr,"Error: allocating crds array\n"); + return(Z_ERR); + } + + if(Node_labels) { + nodeids = (int *) calloc(nn,sizeof(int)); + if(nodeids == (int *) NULL) { + fprintf(stderr,"Error: allocating nodeids array\n"); + return(Z_ERR); + } + } + + + err = USERD_get_global_coords(crds); + if(err == Z_ERR) { + fprintf(stderr,"Error: getting unstructured coords\n"); + return(Z_ERR); + } + + if(Node_labels) { + err = USERD_get_global_node_ids(nodeids); + if(err == Z_ERR) { + fprintf(stderr,"Error: getting nodeids\n"); + return(Z_ERR); + } + } + + /* Echo "some" info + *-----------------*/ + + /* First node + *-----------*/ + i = 0; + fprintf(stderr," Node %d of %d:\n",i+1,nn); + if(Node_labels) { + fprintf(stderr," id: %d\n",nodeids[i]); + } + fprintf(stderr," x y z coordinates: %g %g %g\n", + crds[i].xyz[0], crds[i].xyz[1], crds[i].xyz[2]); + mm[0] = mm[1] = crds[i].xyz[0]; + mm[2] = mm[3] = crds[i].xyz[1]; + mm[4] = mm[5] = crds[i].xyz[2]; + + + /* Last node + *----------*/ + i = nn-1; + if(i > 0) { + fprintf(stderr," Node %d of %d:\n",i+1,nn); + if(Node_labels) { + fprintf(stderr," id: %d\n",nodeids[i]); + } + fprintf(stderr," x y z coordinates: %g %g %g\n", + crds[i].xyz[0], crds[i].xyz[1], crds[i].xyz[2]); + } + + /* Min and max coordinate values + *------------------------------*/ + for(i=1; i mm[1]) { + mm[1] = crds[i].xyz[0]; + } + if(crds[i].xyz[1] < mm[2]) { + mm[2] = crds[i].xyz[1]; + } + if(crds[i].xyz[1] > mm[3]) { + mm[3] = crds[i].xyz[1]; + } + if(crds[i].xyz[2] < mm[4]) { + mm[4] = crds[i].xyz[2]; + } + if(crds[i].xyz[2] > mm[5]) { + mm[5] = crds[i].xyz[2]; + } + } + + fprintf(stderr," Global coordinate ranges:\n"); + fprintf(stderr," min x: %g\n",mm[0]); + fprintf(stderr," max x: %g\n",mm[1]); + fprintf(stderr," min y: %g\n",mm[2]); + fprintf(stderr," max y: %g\n",mm[3]); + fprintf(stderr," min z: %g\n",mm[4]); + fprintf(stderr," max z: %g\n",mm[5]); + + + /* Free the allocated memory + *--------------------------*/ + free(crds); + if(Node_labels) { + free(nodeids); + } + } + + + + for(p=0; p 0) { + + conns[et] = (int **) calloc(ne,sizeof(int *)); + if(conns[et] == (int **) NULL) { + fprintf(stderr,"Error: allocating conns array\n"); + return(Z_ERR); + } + else { + for(i=0; i 0) { + + /* First element of the type + *--------------------------*/ + i = 0; + fprintf(stderr," %s Element %d of %d:\n",Elem_info[et].name,i+1,ne); + if(Element_labels) { + fprintf(stderr," id: %d\n",elemids[et][i]); + } + fprintf(stderr," connectivity:"); + for(j=0; j 0) { + fprintf(stderr," %s Element %d of %d:\n",Elem_info[et].name,i+1,ne); + if(Element_labels) { + fprintf(stderr," id: %d\n",elemids[et][i]); + } + fprintf(stderr," connectivity:"); + for(j=0; j 0) { + for(i=0; i 0) { + i = 0; + fprintf(stderr," Node %d of %d:\n",i+1,nn); + + if(num_dims == 3) { + fprintf(stderr," x y z coordinates: %g %g %g\n", + coords[0][i], coords[1][i], coords[2][i]); + mm[0] = mm[1] = coords[0][i]; + mm[2] = mm[3] = coords[1][i]; + mm[4] = mm[5] = coords[2][i]; + } + else if(num_dims == 2) { + fprintf(stderr," x y coordinates: %g %g\n", + coords[0][i], coords[1][i]); + mm[0] = mm[1] = coords[0][i]; + mm[2] = mm[3] = coords[1][i]; + } + else { + fprintf(stderr," x coordinates: %g\n", + coords[0][i]); + mm[0] = mm[1] = coords[0][i]; + } + + + /* Last node + *----------*/ + i = nn-1; + if(i > 1) { + fprintf(stderr," Node %d of %d:\n",i+1,nn); + + if(num_dims == 3) { + fprintf(stderr," x y z coordinates: %g %g %g\n", + coords[0][i], coords[1][i], coords[2][i]); + } + else if(num_dims == 2) { + fprintf(stderr," x y coordinates: %g %g\n", + coords[0][i], coords[1][i]); + } + else { + fprintf(stderr," x coordinates: %g\n", + coords[0][i]); + } + } + } + + /* Min and max coordinate values + *------------------------------*/ + for(i=2; i<=nn; ++i) { + if(coords[0][i] < mm[0]) { + mm[0] = coords[0][i]; + } + if(coords[0][i] > mm[1]) { + mm[1] = coords[0][i]; + } + if(num_dims > 1) { + if(coords[1][i] < mm[2]) { + mm[2] = coords[1][i]; + } + if(coords[1][i] > mm[3]) { + mm[3] = coords[1][i]; + } + } + if(num_dims > 2) { + if(coords[2][i] < mm[4]) { + mm[4] = coords[2][i]; + } + if(coords[2][i] > mm[5]) { + mm[5] = coords[2][i]; + } + } + } + + fprintf(stderr," Coordinate ranges:\n"); + fprintf(stderr," min x: %g\n",mm[0]); + fprintf(stderr," max x: %g\n",mm[1]); + if(num_dims > 1) { + fprintf(stderr," min y: %g\n",mm[2]); + fprintf(stderr," max y: %g\n",mm[3]); + } + if(num_dims > 2) { + fprintf(stderr," min z: %g\n",mm[4]); + fprintf(stderr," max z: %g\n",mm[5]); + } + + /* Free the allocated memory - so far + *-----------------------------------*/ + for(i=0; i 1 && v == 0) { + if(var_time_step > (Num_time_steps - 1)) { + var_time_step = Num_time_steps - 1; + } + + /* Set the time step - to first step by default, but + * can set it at others using -vts command argument + *---------------------------------------------------------*/ + USERD_set_time_step(var_time_step); + + fprintf(stderr," Using time step: %d (where range is %d through %d)\n\n", + var_time_step,0,Num_time_steps-1); + } + + for(v=0; v 0) { + fprintf(stderr,"\n"); + } + if(Varinfo[v].classify == Z_PER_NODE) { + fprintf(stderr," Z_PER_NODE Variable %d:\n",vn); + } + else { + fprintf(stderr," Z_PER_ELEM Variable %d:\n",vn); + } + + /* Constants + *----------*/ + if(Varinfo[v].type == Z_CONSTANT) { + + constant_val = USERD_get_constant_value(vn); + fprintf(stderr," Constant (%s):\n",Varinfo[v].description); + fprintf(stderr," value: %g\n",constant_val); + } + + + /* Scalars, Vectors, Tensors + *--------------------------*/ + else { + + /* Get the var description line + *-----------------------------*/ + err = USERD_get_description_lines(Z_VARI,vn,line1,line2); + if(err == Z_OK) { + fprintf(stderr," Desc line: %s\n",line1); + } + else { + fprintf(stderr,"Error: getting var description line\n"); + return(Z_ERR); + } + + + /* Get the values by component + *-----------------------------*/ + if(Varinfo[v].type == Z_SCALAR) { + num_comps = 1; + } + else if(Varinfo[v].type == Z_VECTOR) { + num_comps = 3; + } + else if(Varinfo[v].type == Z_TENSOR) { + num_comps = 6; + } + else if(Varinfo[v].type == Z_TENSOR9) { + num_comps = 9; + } + + + /* Per_Node + *---------*/ + if(Varinfo[v].classify == Z_PER_NODE) { + + for(p=0; p 0) { + values = (float *) calloc((num_comps * nsize),sizeof(float)); + if(values == (float *) NULL) { + fprintf(stderr,"Error: alocating variable values\n"); + return(Z_ERR); + } + + if(num_comps == 1) { + + if(Pbuild[p].type == Z_UNSTRUCTURED) { + err = USERD_get_scalar_values(vn, + pn, + 0, + values); + if(err == Z_ERR) { + fprintf(stderr,"Error: getting scalar values\n"); + return(Z_ERR); + } + } + else { + err = USERD_get_block_scalar_values(pn, + vn, + values); + if(err == Z_ERR) { + fprintf(stderr,"Error: getting block scalar values\n"); + return(Z_ERR); + } + } + + /* For the component, show 1st node, last node, min, max values + *-------------------------------------------------------------*/ + minv[0] = maxv[0] = values[0]; + for(i=0; i maxv[0]) { + maxv[0] = values[i]; + } + } + + fprintf(stderr," node %10d value: %g\n",1,values[0]); + fprintf(stderr," node %10d value: %g\n",nsize,values[nsize-1]); + fprintf(stderr," min value: %g\n",minv[0]); + fprintf(stderr," max value: %g\n",maxv[0]); + + } + + else if(num_comps == 3) { + + if(Pbuild[p].type == Z_UNSTRUCTURED) { + err = USERD_get_vector_values(vn, + pn, + 0, + values); + if(err == Z_ERR) { + fprintf(stderr,"Error: getting vector values\n"); + return(Z_ERR); + } + } + else { + + tvalues = (float *) calloc(nsize,sizeof(float)); + if(tvalues == (float *) NULL) { + fprintf(stderr,"Error: alocating tvalues array\n"); + return(Z_ERR); + } + + for(i=0; i<3; ++i) { + err = USERD_get_block_vector_values_by_component(pn, + vn, + i, + tvalues); + if(err == Z_ERR) { + fprintf(stderr,"Error: getting vector values\n"); + return(Z_ERR); + } + for(j=0; j maxv[k]) { + maxv[k] = values[j+k]; + } + } + } + + fprintf(stderr," node %10d values: %g %g %g\n",1, + values[0],values[1],values[2]); + fprintf(stderr," node %10d values: %g %g %g\n",nsize, + values[3*nsize-3],values[3*nsize-2],values[3*nsize-1]); + fprintf(stderr," min values: %g %g %g\n", + minv[0],minv[1],minv[2]); + fprintf(stderr," max values: %g %g %g\n", + maxv[0],maxv[1],maxv[2]); + + } + free(values); + } + } + } + + /* Per_Elem + *---------*/ + else { + for(p=0; p 0) { + + fprintf(stderr," For part %d, with %d elems of type %s:\n", + pn,nsize,Elem_info[et].name); + + values = (float *) calloc((num_comps * nsize),sizeof(float)); + if(values == (float *) NULL) { + fprintf(stderr,"Error: alocating variable values\n"); + return(Z_ERR); + } + + if(num_comps == 1) { + if(Pbuild[p].type == Z_UNSTRUCTURED) { + err = USERD_get_scalar_values(vn, + pn, + et, + values); + if(err == Z_ERR) { + fprintf(stderr,"Error: getting scalar values\n"); + return(Z_ERR); + } + } + else { + err = USERD_get_block_scalar_values(pn, + vn, + values); + if(err == Z_ERR) { + fprintf(stderr,"Error: getting block scalar values\n"); + return(Z_ERR); + } + } + + /* For the component, show 1st node, last node, min, max values + *-------------------------------------------------------------*/ + minv[0] = maxv[0] = values[0]; + for(i=1; i maxv[0]) { + maxv[0] = values[i]; + } + } + + fprintf(stderr," elem %10d value: %g\n",1,values[0]); + fprintf(stderr," elem %10d value: %g\n",nsize,values[nsize-1]); + fprintf(stderr," min value: %g\n",minv[0]); + fprintf(stderr," max value: %g\n",maxv[0]); + + } + + else if(num_comps == 3) { + + if(Pbuild[p].type == Z_UNSTRUCTURED) { + err = USERD_get_vector_values(vn, + pn, + et, + values); + if(err == Z_ERR) { + fprintf(stderr,"Error: getting vector values\n"); + return(Z_ERR); + } + } + else { + + tvalues = (float *) calloc(nsize,sizeof(float)); + if(tvalues == (float *) NULL) { + fprintf(stderr,"Error: alocating tvalues array\n"); + return(Z_ERR); + } + + for(i=0; i<3; ++i) { + err = USERD_get_block_vector_values_by_component(pn, + vn, + i, + tvalues); + if(err == Z_ERR) { + fprintf(stderr,"Error: getting vector values\n"); + return(Z_ERR); + } + for(j=0; j maxv[k]) { + maxv[k] = values[j+k]; + } + } + } + + fprintf(stderr," elem %10d values: %g %g %g\n",1, + values[0],values[1],values[2]); + fprintf(stderr," elem %10d values: %g %g %g\n",nsize, + values[3*nsize-3],values[3*nsize-2],values[3*nsize-1]); + fprintf(stderr," min values: %g %g %g\n", + minv[0],minv[1],minv[2]); + fprintf(stderr," max values: %g %g %g\n", + maxv[0],maxv[1],maxv[2]); + + } + free(values); + } + } + } + } + } + } + + return(Z_OK); +} + +#endif + + +#if (defined GT_USERD_API_202) + + +/*--------------- + * materials_info + *---------------*/ +static int +materials_info( void ) +{ + int i,j; + int err; + int *num_materials; + int *msids; + char **msname; + int *mids; + char **mdesc; + + + fprintf(stderr,"\n------------- materials info --------------\n"); + + /* Get the number of variables + *----------------------------*/ + Num_materials_sets = USERD_get_number_of_material_sets(); + if(Num_materials_sets < 0) { + fprintf(stderr,"Error: getting the number of material sets\n"); + return(Z_ERR); + } + else { + if(Num_materials_sets == 0) { + fprintf(stderr," No materials sets in the model\n"); + return (Z_OK); + } + else if(Num_materials_sets > 1) { + fprintf(stderr," Number of materials sets: %d\n",Num_materials_sets); + fprintf(stderr," Currently, EnSight 7.6 only supports 1 material set\n"); + return(Z_ERR); + } + else { + fprintf(stderr," Number of materials sets: %d\n",Num_materials_sets); + } + } + + /* Get the material set index list and names + *------------------------------------------*/ + msids = (int *) calloc(Num_materials_sets,sizeof(int)); + if(msids == (int *)NULL) { + fprintf(stderr," Problems allocating for material set ids\n"); + return(Z_ERR); + } + + num_materials = (int *) calloc(Num_materials_sets,sizeof(int)); + if(num_materials == (int *)NULL) { + fprintf(stderr," Problems allocating for material set num materials\n"); + return(Z_ERR); + } + + msname = (char **) calloc(Num_materials_sets,sizeof(char *)); + if(msname == (char **)NULL) { + fprintf(stderr," Problems allocating for material set names\n"); + return(Z_ERR); + } + else { + for(i=0; i 0) { + /* Get the timeset used for the geometry + *--------------------------------------*/ + geom_timeset = USERD_get_geom_timeset_number(); + + /* Get the number of time steps for this timeset + *----------------------------------------------*/ + Num_time_steps = USERD_get_num_of_time_steps(geom_timeset); + if(Num_time_steps < 1) { + fprintf(stderr," Error: Num time steps returned: %d\n",Num_time_steps); + fprintf(stderr," (Must be >0 to be okay)\n"); + return(Z_ERR); + } + if(geom_time_step > (Num_time_steps - 1)) { + geom_time_step = Num_time_steps - 1; + } + + /* Set the timeset and step - to first step by default, but + * can set it at others using -gts command argument + *---------------------------------------------------------*/ + USERD_set_time_set_and_step(geom_timeset,geom_time_step); + + fprintf(stderr," Using timeset: %d (step range is %d through %d)\n", + geom_timeset,0,Num_time_steps-1); + fprintf(stderr," Using time step: %d\n",geom_time_step); + } + + for(ms=0; ms 0) { + + /* Get the material ids, if any + *-----------------------------*/ + err = USERD_size_matf_data(ms, + pn, + et, + Z_MAT_INDEX, + &matf_size); + if(err == Z_OK && matf_size > 0) { + + + /* Go get the material ids + *------------------------*/ + ivals = (int *) calloc(matf_size,sizeof(int)); + if(ivals == (int *)NULL) { + fprintf(stderr," Problems allocating for material ids\n"); + return(Z_ERR); + } + err = USERD_load_matf_data(ms, + pn, + et, + Z_MAT_INDEX, + ivals, + fvals); + if(err == Z_OK) { + if(matf_size < 20) { + fprintf(stderr," Printing all mat ids for %s elements\n", + Elem_info[et].name); + do_num = matf_size; + } + else { + fprintf(stderr," Printing first 20 mat ids for %s elements\n", + Elem_info[et].name); + do_num = 20; + } + + /* See if any mixed materials + *---------------------------*/ + mixed_present = FALSE; + for(k=0; k 0 && + matfv_size > 0) { + + /* Go get the material ids + *------------------------*/ + ivals = (int *) calloc(matf_size,sizeof(int)); + if(ivals == (int *)NULL) { + fprintf(stderr," Problems allocating for mixed material ids\n"); + return(Z_ERR); + } + fvals = (float *) calloc(matfv_size,sizeof(float)); + if(fvals == (float *)NULL) { + fprintf(stderr," Problems allocating for mixed material values\n"); + return(Z_ERR); + } + + err1 = USERD_load_matf_data(ms, + pn, + et, + Z_MIX_INDEX, + ivals, + fvals); + + err2 = USERD_load_matf_data(ms, + pn, + et, + Z_MIX_VALUE, + ivals, + fvals); + if(err1 == Z_OK && + err2 == Z_OK) { + if(matf_size < 20) { + fprintf(stderr," Printing all mixed mat ids for %s elements\n", + Elem_info[et].name); + do_num = matf_size; + } + else { + fprintf(stderr," Printing first 20 mixed mat ids for %s elements\n", + Elem_info[et].name); + do_num = 20; + } + for(k=0; k 1) { + /* Get the number of time steps for this timeset + *----------------------------------------------*/ + if(var_time_step > (Num_time_steps - 1)) { + var_time_step = Num_time_steps - 1; + } + + /* Set the time step - to first step by default, but + * can set it at others using -vts command argument + *---------------------------------------------------------*/ + USERD_set_time_step(var_time_step); + + fprintf(stderr," Using time step: %d (where range is %d through %d)\n\n", + var_time_step,0,Num_time_steps-1); + } +#endif + + for(v=0; v 0) { + /* Get the timeset used for the variable + *---------------------------------------*/ + var_timeset = Varinfo[v].timeset; + + /* Get the number of time steps for this timeset + *----------------------------------------------*/ + Num_time_steps = USERD_get_num_of_time_steps(var_timeset); + if(Num_time_steps < 1) { + fprintf(stderr," Error: Number of time steps returned: %d\n", + Num_time_steps); + fprintf(stderr," (Must be >0 to be okay)\n"); + return(Z_ERR); + } + if(var_time_step > (Num_time_steps - 1)) { + var_time_step = Num_time_steps - 1; + } + + /* Set the timeset and step - to first step by default, but + * can set it at others using -vts command argument + *---------------------------------------------------------*/ + USERD_set_time_set_and_step(var_timeset,var_time_step); + + fprintf(stderr," Using timeset: %d (step range is %d through %d)\n", + var_timeset,0,Num_time_steps-1); + fprintf(stderr," Using time step: %d\n",var_time_step); + } +#endif + + + /* Get the var description line + *-----------------------------*/ +#if (defined GT_USERD_API_100) + err = USERD_get_descrip_lines(Z_VARI,vn,FALSE,line1,line2); + if(err == Z_OK) { + fprintf(stderr," Desc line: %s\n",line1); + } + else { + fprintf(stderr,"Error: getting var description line\n"); + return(Z_ERR); + } + + if(Varinfo[v].complex) { + err = USERD_get_descrip_lines(Z_VARI,vn,TRUE,line1,line2); + if(err == Z_OK) { + fprintf(stderr," Desc line (imag): %s\n",line1); + } + else { + fprintf(stderr,"Error: getting var description line (imag)\n"); + return(Z_ERR); + } + } +#else + + err = USERD_get_description_lines(Z_VARI,vn,line1,line2); + if(err == Z_OK) { + fprintf(stderr," Desc line: %s\n",line1); + } + else { + fprintf(stderr,"Error: getting var description line\n"); + return(Z_ERR); + } + +#endif + + /* Get the values by component + *-----------------------------*/ + if(Varinfo[v].type == Z_SCALAR) { + num_comps = 1; + } + else if(Varinfo[v].type == Z_VECTOR) { + num_comps = 3; + } + + /* Per_Node + *---------*/ + if(Varinfo[v].classify == Z_PER_NODE) { + + for(p=0; p 0) { + + fprintf(stderr," For part %d, using node %d:\n",pn,nsize); + +#if (defined GT_USERD_API_100) + err = USERD_get_var_value_at_specific(vn, + nsize, + pn, + 0, + var_time_step, + qvals, + FALSE); +#else + err = USERD_get_variable_value_at_specific(vn, + nsize, + pn, + 0, + var_time_step, + qvals); +#endif + if(err == Z_NOT_IMPLEMENTED) { + fprintf(stderr," Node and element queries not implemented\n"); + return(Z_OK); + } + else if(err == Z_ERR) { + fprintf(stderr," Could not get value\n"); + } + else { + + /* For the component, show 1st node, last node, min, max values + *-------------------------------------------------------------*/ + if(Varinfo[v].type == Z_SCALAR) { + fprintf(stderr," Scalar value is: %g\n",qvals[0]); + } + else { + fprintf(stderr," Vector values are: %g %g %g\n", + qvals[0],qvals[1],qvals[2]); + } + +#if (defined GT_USERD_API_100) + if(Varinfo[v].complex) { + + err = USERD_get_var_value_at_specific(vn, + nsize, + pn, + 0, + var_time_step, + qvals, + TRUE); + + if(err == Z_ERR) { + fprintf(stderr," Could not get imag value\n"); + } + else { + + /* For the component, show 1st node, last node, min, max values + *-------------------------------------------------------------*/ + if(Varinfo[v].type == Z_SCALAR) { + fprintf(stderr," Scalar value (imag) is: %g\n",qvals[0]); + } + else { + fprintf(stderr," Vector values (imag) are: %g %g %g\n", + qvals[0],qvals[1],qvals[2]); + } + } + } +#endif + + } + } + } + } + + /* Per_Elem + *---------*/ + else { + for(p=0; p 0) { + + + fprintf(stderr," For part %d, using elem %d of type %s:\n", + pn,nsize,Elem_info[et].name); + + +#if (defined GT_USERD_API_100) + err = USERD_get_var_value_at_specific(vn, + nsize, + pn, + et, + var_time_step, + qvals, + FALSE); +#else + err = USERD_get_variable_value_at_specific(vn, + nsize, + pn, + et, + var_time_step, + qvals); +#endif + + if(err == Z_NOT_IMPLEMENTED) { + fprintf(stderr," Node and element queries not implemented\n"); + return(Z_OK); + } + else if(err == Z_ERR) { + fprintf(stderr," Could not get value\n"); + } + else { + if(Varinfo[v].type == Z_SCALAR) { + fprintf(stderr," Scalar value is: %g\n",qvals[0]); + } + else { + fprintf(stderr," Vector values are: %g %g %g\n", + qvals[0],qvals[1],qvals[2]); + } + +#if (defined GT_USERD_API_100) + if(Varinfo[v].complex) { + + err = USERD_get_var_value_at_specific(vn, + nsize, + pn, + et, + var_time_step, + qvals, + TRUE); + if(err == Z_ERR) { + fprintf(stderr," Could not get imag value\n"); + } + else { + if(Varinfo[v].type == Z_SCALAR) { + fprintf(stderr," Scalar value (imag) is: %g\n",qvals[0]); + } + else { + fprintf(stderr," Vector values (imag) are: %g %g %g\n", + qvals[0],qvals[1],qvals[2]); + } + } + } +#endif + } + } + } + } + } + } + } + + return(Z_OK); +} + + +/*-------------- + * exercise_bkup + *--------------*/ +static int +exercise_bkup( void ) +{ + int err; + FILE *arcfile; + + fprintf(stderr,"\n------------ exercise_archive -----------\n"); + + arcfile = fopen("test.arc","wb"); + if(arcfile == (FILE *)NULL) { + fprintf(stderr,"Error: opening test archive file\n"); + return(Z_ERR); + } + err = USERD_bkup(arcfile,Z_SAVE_ARCHIVE); + if(err == Z_ERR) { + fprintf(stderr,"Error: saving to test archive file\n"); + return(Z_ERR); + } + fclose(arcfile); + + arcfile = fopen("test.arc","rb"); + err = USERD_bkup(arcfile,Z_REST_ARCHIVE); + if(err == Z_ERR) { + fprintf(stderr,"Error: restoring from test archive file\n"); + return(Z_ERR); + } + + fprintf(stderr," Archive test completed\n"); + + fclose(arcfile); + + return(Z_OK); +} + +/* ------------------------------------------------------- + * threshold_operator1 & 2 can be one of the following + * Z_ELE_FAILED_NONE, - disables checking + * Z_ELE_FAILED_GREATER, - greater than + * Z_ELE_FAILED_LESS, - less than + * Z_ELE_FAILED_EQUAL, - equal + * Z_ELE_FAILED_NOT_EQUAL, - not equal + * Z_ELE_FAILED_MANY - not used + * + * logic_criteria2 + * Z_ELE_FAILED_LOGIC_NONE, + * Z_ELE_FAILED_LOGIC_AND, + * Z_ELE_FAILED_LOGIC_OR, + * Z_ELE_FAILED_LOGIC_MANY + * + * ------------------------------------------------------ */ +int load_fail_defaults(void) +{ + int check_for_failed = FALSE; + int cri1 = 0; /* Criteria1 ELE_FAILED_GREATER, etc */ + int cri2 = 0; + int logic_cri2 = 0; /* Logic for criteria 2 ELE_FAILED_LOGIC_NONE, AND, etc */ + float val1 = 0.0; /* failure threshold 1 */ + float val2= 0.0; /* failure threshold 2 */ + char failed_var_name[Z_MXVARIABLEDESC]={EOS}; + + check_for_failed = USERD_get_uns_failed_params( failed_var_name, + &val1, &val2, &cri1, &cri2, + &logic_cri2 ); + fprintf(stderr,"\n------------- failed element info -------------\n"); + if (check_for_failed == TRUE) { + fprintf(stderr," Failed element criteria info \n"); + fprintf(stderr," Variable name = %s\n",failed_var_name); + fprintf(stderr," Criteria 1 = %d\n",cri1); + fprintf(stderr," Criteria 2 = %d\n",cri1); + fprintf(stderr," Logic criteria = %d\n",logic_cri2); + fprintf(stderr," Value 1 = %f\n",val1); + fprintf(stderr," Value 2 = %f\n",val2); + } else { + fprintf(stderr," No Failed elements\n"); + } + return(Z_OK); +} + + +/* End of File */ diff --git a/applications/test/ensightFoamReader/udr_checker.c b/applications/test/ensightFoamReader/udr_checker.c new file mode 120000 index 0000000000..2e9390c310 --- /dev/null +++ b/applications/test/ensightFoamReader/udr_checker.c @@ -0,0 +1 @@ +udr_checker-80.c \ No newline at end of file From 85f11fa7ccee75df61de41d27ac45cda1b07c9fb Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 6 Aug 2009 17:43:39 +0100 Subject: [PATCH 021/454] added sortedToc() --- applications/test/HashTable/hashTableTest.C | 1 + .../containers/HashTables/HashTable/HashTable.C | 11 ++++++++++- .../containers/HashTables/HashTable/HashTable.H | 3 +++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/applications/test/HashTable/hashTableTest.C b/applications/test/HashTable/hashTableTest.C index 25338a2bb7..7e03a36f7d 100644 --- a/applications/test/HashTable/hashTableTest.C +++ b/applications/test/HashTable/hashTableTest.C @@ -56,6 +56,7 @@ int main() table1.erase("abs"); Info<< "\ntable1 toc: " << table1.toc() << endl; + Info<< "\ntable1 sortedToc: " << table1.sortedToc() << endl; table1.printInfo(Info) << "table1 [" << table1.size() << "] " << endl; forAllIter(HASHTABLE_CLASS, table1, iter) diff --git a/src/OpenFOAM/containers/HashTables/HashTable/HashTable.C b/src/OpenFOAM/containers/HashTables/HashTable/HashTable.C index c2034a69ea..10bcadc761 100644 --- a/src/OpenFOAM/containers/HashTables/HashTable/HashTable.C +++ b/src/OpenFOAM/containers/HashTables/HashTable/HashTable.C @@ -231,7 +231,6 @@ Foam::HashTable::find } -// Return the table of contents template Foam::List Foam::HashTable::toc() const { @@ -247,6 +246,16 @@ Foam::List Foam::HashTable::toc() const } +template +Foam::List Foam::HashTable::sortedToc() const +{ + List sortedList = this->toc(); + sort(sortedList); + + return sortedList; +} + + template bool Foam::HashTable::set ( diff --git a/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H b/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H index 3871db3a50..666b93ebec 100644 --- a/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H +++ b/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H @@ -198,6 +198,9 @@ public: //- Return the table of contents List toc() const; + //- Return the table of contents as a sorted list + List sortedToc() const; + //- Print information Ostream& printInfo(Ostream&) const; From 31c76da40f58d2c44acb748b28d3f98e3abe6d2e Mon Sep 17 00:00:00 2001 From: henry Date: Thu, 6 Aug 2009 18:01:28 +0100 Subject: [PATCH 022/454] Changed the runtime-selection tables to output a sorted toc. --- .../PDRModels/dragModels/PDRDragModel/newPDRDragModel.C | 2 +- .../PDRFoam/XiModels/XiEqModels/XiEqModel/newXiEqModel.C | 2 +- .../PDRFoam/XiModels/XiGModels/XiGModel/newXiGModel.C | 2 +- .../combustion/PDRFoam/XiModels/XiModel/newXiModel.C | 2 +- .../newPhaseChangeTwoPhaseMixture.C | 2 +- .../interfacialModels/dragModels/dragModel/newDragModel.C | 2 +- .../conductivityModel/newConductivityModel.C | 2 +- .../frictionalStressModel/newFrictionalStressModel.C | 2 +- .../granularPressureModel/newGranularPressureModel.C | 2 +- .../radialModel/radialModel/newRadialModel.C | 2 +- .../viscosityModel/viscosityModel/newViscosityModel.C | 2 +- .../mesh/generation/blockMesh/curvedEdges/curvedEdge.C | 2 +- .../extrudeModel/extrudeModel/newExtrudeModel.C | 2 +- src/ODE/ODESolvers/ODESolver/newODESolver.C | 2 +- src/OpenFOAM/db/IOstreams/token/token.C | 2 +- .../db/functionObjects/functionObject/functionObject.C | 2 +- .../pointPatchFields/pointPatchField/newPointPatchField.C | 6 +++--- src/OpenFOAM/graph/graph.C | 2 +- .../lduMatrix/lduMatrix/lduMatrixPreconditioner.C | 4 ++-- .../matrices/lduMatrix/lduMatrix/lduMatrixSmoother.C | 4 ++-- .../matrices/lduMatrix/lduMatrix/lduMatrixSolver.C | 4 ++-- .../GAMGAgglomeration/GAMGAgglomeration.C | 4 ++-- .../GAMGInterfaceField/newGAMGInterfaceField.C | 2 +- .../GAMG/interfaces/GAMGInterface/newGAMGInterface.C | 2 +- .../pointPatches/facePointPatch/newFacePointPatch.C | 2 +- .../meshes/polyMesh/polyPatches/polyPatch/newPolyPatch.C | 4 ++-- src/OpenFOAM/meshes/polyMesh/zones/cellZone/newCellZone.C | 2 +- src/OpenFOAM/meshes/polyMesh/zones/faceZone/newFaceZone.C | 2 +- .../meshes/polyMesh/zones/pointZone/newPointZone.C | 2 +- src/conversion/ensight/part/ensightPart.C | 2 +- .../decompositionMethod/decompositionMethod.C | 4 ++-- src/dynamicFvMesh/dynamicFvMesh/newDynamicFvMesh.C | 2 +- .../solidBodyMotionFunction/newSolidBodyMotionFunction.C | 2 +- src/dynamicMesh/meshCut/cellLooper/cellLooper.C | 2 +- src/dynamicMesh/motionSolver/motionSolver.C | 2 +- .../polyTopoChange/polyMeshModifier/newPolyMeshModifier.C | 2 +- src/engine/engineMesh/engineMesh/newEngineMesh.C | 2 +- .../cfdTools/general/SRF/SRFModel/SRFModel/newSRFModel.C | 2 +- .../fields/fvPatchFields/fvPatchField/newFvPatchField.C | 6 +++--- .../fvsPatchFields/fvsPatchField/newFvsPatchField.C | 6 +++--- .../convectionSchemes/convectionScheme/convectionScheme.C | 8 ++++---- .../finiteVolume/d2dt2Schemes/d2dt2Scheme/d2dt2Scheme.C | 4 ++-- .../finiteVolume/ddtSchemes/ddtScheme/ddtScheme.C | 4 ++-- .../finiteVolume/divSchemes/divScheme/divScheme.C | 4 ++-- .../finiteVolume/gradSchemes/gradScheme/gradScheme.C | 4 ++-- .../laplacianSchemes/laplacianScheme/laplacianScheme.C | 4 ++-- .../snGradSchemes/snGradScheme/snGradScheme.C | 4 ++-- src/finiteVolume/fvMesh/fvPatches/fvPatch/newFvPatch.C | 2 +- .../interpolation/interpolation/newInterpolation.C | 2 +- .../limitedSurfaceInterpolationScheme.C | 8 ++++---- .../multivariateSurfaceInterpolationScheme.C | 2 +- .../surfaceInterpolationScheme.C | 8 ++++---- .../motionDiffusivity/motionDiffusivity.C | 2 +- .../dieselSpray/injector/injectorType/injectorType.C | 2 +- .../atomizationModel/newAtomizationModel.C | 2 +- .../breakupModel/breakupModel/newBreakupModel.C | 2 +- .../collisionModel/collisionModel/newCollisionModel.C | 2 +- .../dispersionModel/dispersionModel/newDispersionModel.C | 2 +- .../spraySubModels/dragModel/dragModel/newDragModel.C | 2 +- .../evaporationModel/newEvaporationModel.C | 2 +- .../heatTransferModel/newHeatTransferModel.C | 2 +- .../injectorModel/injectorModel/newInjectorModel.C | 2 +- .../spraySubModels/wallModel/wallModel/newWallModel.C | 2 +- .../BinaryCollisionModel/NewBinaryCollisionModel.C | 2 +- .../InflowBoundaryModel/NewInflowBoundaryModel.C | 2 +- .../WallInteractionModel/NewWallInteractionModel.C | 2 +- .../IntegrationScheme/newIntegrationScheme.C | 2 +- .../submodels/IO/DataEntry/DataEntry/NewDataEntry.C | 2 +- .../DispersionModel/DispersionModel/NewDispersionModel.C | 2 +- .../Kinematic/DragModel/DragModel/NewDragModel.C | 2 +- .../InjectionModel/InjectionModel/NewInjectionModel.C | 2 +- .../PatchInteractionModel/NewPatchInteractionModel.C | 2 +- .../PostProcessingModel/NewPostProcessingModel.C | 2 +- .../CompositionModel/NewCompositionModel.C | 2 +- .../PhaseChangeModel/NewPhaseChangeModel.C | 2 +- .../DevolatilisationModel/NewDevolatilisationModel.C | 2 +- .../SurfaceReactionModel/NewSurfaceReactionModel.C | 2 +- .../HeatTransferModel/NewHeatTransferModel.C | 2 +- .../basic/newEnergyScalingFunction.C | 2 +- .../potential/pairPotential/basic/newPairPotential.C | 2 +- .../potential/tetherPotential/basic/newTetherPotential.C | 2 +- .../coordinateRotation/coordinateRotation.C | 2 +- src/meshTools/coordinateSystems/coordinateSystemNew.C | 4 ++-- src/meshTools/searchableSurface/searchableSurface.C | 2 +- src/meshTools/sets/topoSetSource/topoSetSource.C | 4 ++-- src/meshTools/sets/topoSets/topoSet.C | 4 ++-- .../foamCalcFunctions/calcType/newCalcType.C | 2 +- src/sampling/sampledSet/sampledSet/sampledSet.C | 2 +- src/sampling/sampledSet/writers/writer.C | 2 +- .../sampledSurface/sampledSurface/sampledSurface.C | 2 +- src/sampling/sampledSurface/writers/surfaceWriter.C | 2 +- .../newBarotropicCompressibilityModel.C | 2 +- .../basic/psiThermo/basicPsiThermo/newBasicPsiThermo.C | 2 +- .../basic/rhoThermo/basicRhoThermo/newBasicRhoThermo.C | 2 +- .../psiChemistryModel/newPsiChemistryModel.C | 4 ++-- .../rhoChemistryModel/newRhoChemistryModel.C | 4 ++-- .../chemistrySolver/chemistrySolver/newChemistrySolver.C | 2 +- .../laminarFlameSpeed/newLaminarFlameSpeed.C | 2 +- src/thermophysicalModels/liquids/liquid/liquid.C | 4 ++-- src/thermophysicalModels/pdfs/pdf/newPdf.C | 2 +- .../radiationModel/radiationModel/newRadiationModel.C | 2 +- .../absorptionEmissionModel/newAbsorptionEmissionModel.C | 2 +- .../submodels/scatterModel/scatterModel/newScatterModel.C | 2 +- .../chemistryReaders/chemistryReader/chemistryReader.C | 2 +- .../hCombustionThermo/newhCombustionThermo.C | 6 +++--- .../hhuCombustionThermo/newhhuCombustionThermo.C | 2 +- .../reactionThermo/hReactionThermo/newhReactionThermo.C | 6 +++--- src/thermophysicalModels/solids/solid/newSolid.C | 4 ++-- .../specie/reaction/Reactions/Reaction/Reaction.C | 4 ++-- .../thermophysicalFunction/thermophysicalFunction.C | 2 +- .../viscosityModels/viscosityModel/newViscosityModel.C | 2 +- src/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.C | 2 +- src/turbulenceModels/LES/LESfilters/LESfilter/LESfilter.C | 2 +- src/turbulenceModels/compressible/LES/LESModel/LESModel.C | 2 +- src/turbulenceModels/compressible/RAS/RASModel/RASModel.C | 2 +- .../compressible/turbulenceModel/turbulenceModel.C | 2 +- .../incompressible/LES/LESModel/LESModel.C | 2 +- .../incompressible/RAS/RASModel/RASModel.C | 2 +- .../incompressible/turbulenceModel/turbulenceModel.C | 2 +- 119 files changed, 158 insertions(+), 158 deletions(-) diff --git a/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/newPDRDragModel.C b/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/newPDRDragModel.C index 29a92e19f8..d8fd2dd5e3 100644 --- a/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/newPDRDragModel.C +++ b/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/newPDRDragModel.C @@ -52,7 +52,7 @@ Foam::autoPtr Foam::PDRDragModel::New ) << "Unknown PDRDragModel type " << PDRDragModelTypeName << endl << endl << "Valid PDRDragModels are : " << endl - << dictionaryConstructorTablePtr_->toc() + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/newXiEqModel.C b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/newXiEqModel.C index 43515c6bae..f0bc471c91 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/newXiEqModel.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/newXiEqModel.C @@ -56,7 +56,7 @@ Foam::autoPtr Foam::XiEqModel::New ) << "Unknown XiEqModel type " << XiEqModelTypeName << endl << endl << "Valid XiEqModels are : " << endl - << dictionaryConstructorTablePtr_->toc() + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/newXiGModel.C b/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/newXiGModel.C index 780bc8418d..81f5cca253 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/newXiGModel.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/newXiGModel.C @@ -56,7 +56,7 @@ Foam::autoPtr Foam::XiGModel::New ) << "Unknown XiGModel type " << XiGModelTypeName << endl << endl << "Valid XiGModels are : " << endl - << dictionaryConstructorTablePtr_->toc() + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiModel/newXiModel.C b/applications/solvers/combustion/PDRFoam/XiModels/XiModel/newXiModel.C index fd1e25de9b..2dc8dac138 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiModel/newXiModel.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiModel/newXiModel.C @@ -54,7 +54,7 @@ Foam::autoPtr Foam::XiModel::New ) << "Unknown XiModel type " << XiModelTypeName << endl << endl << "Valid XiModels are : " << endl - << dictionaryConstructorTablePtr_->toc() + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/newPhaseChangeTwoPhaseMixture.C b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/newPhaseChangeTwoPhaseMixture.C index 3def1c64fc..227f76c4c7 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/newPhaseChangeTwoPhaseMixture.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/newPhaseChangeTwoPhaseMixture.C @@ -70,7 +70,7 @@ Foam::phaseChangeTwoPhaseMixture::New ) << "Unknown phaseChangeTwoPhaseMixture type " << phaseChangeTwoPhaseMixtureTypeName << endl << endl << "Valid phaseChangeTwoPhaseMixtures are : " << endl - << componentsConstructorTablePtr_->toc() + << componentsConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C index 68bb43a385..582fa4cdd3 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C @@ -57,7 +57,7 @@ Foam::autoPtr Foam::dragModel::New << dragModelType << ", constructor not in hash table" << endl << endl << " Valid dragModel types are : " << endl; - Info << dictionaryConstructorTablePtr_->toc() << abort(FatalError); + Info << dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); } return cstrIter()(interfaceDict, alpha, phasea, phaseb); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/conductivityModel/newConductivityModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/conductivityModel/newConductivityModel.C index 0ea5d053b9..e5d27350b3 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/conductivityModel/newConductivityModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/conductivityModel/newConductivityModel.C @@ -49,7 +49,7 @@ Foam::autoPtr Foam::conductivityModel::New << conductivityModelType << ", constructor not in hash table" << endl << endl << " Valid conductivityModelType types are :" << endl; - Info<< dictionaryConstructorTablePtr_->toc() << abort(FatalError); + Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); } return autoPtr(cstrIter()(dict)); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C index 96315e8c20..fed001e0c0 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C @@ -49,7 +49,7 @@ Foam::autoPtr Foam::frictionalStressModel::New << frictionalStressModelType << ", constructor not in hash table" << endl << endl << " Valid frictionalStressModelType types are :" << endl; - Info<< dictionaryConstructorTablePtr_->toc() << abort(FatalError); + Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); } return autoPtr(cstrIter()(dict)); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/granularPressureModel/granularPressureModel/newGranularPressureModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/granularPressureModel/granularPressureModel/newGranularPressureModel.C index 0df3d38613..cda9814b46 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/granularPressureModel/granularPressureModel/newGranularPressureModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/granularPressureModel/granularPressureModel/newGranularPressureModel.C @@ -49,7 +49,7 @@ Foam::autoPtr Foam::granularPressureModel::New << granularPressureModelType << ", constructor not in hash table" << endl << endl << " Valid granularPressureModelType types are :" << endl; - Info<< dictionaryConstructorTablePtr_->toc() << abort(FatalError); + Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); } return autoPtr(cstrIter()(dict)); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/radialModel/radialModel/newRadialModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/radialModel/radialModel/newRadialModel.C index 9e107809bf..fc6b2ed5d9 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/radialModel/radialModel/newRadialModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/radialModel/radialModel/newRadialModel.C @@ -49,7 +49,7 @@ Foam::autoPtr Foam::radialModel::New << radialModelType << ", constructor not in hash table" << endl << endl << " Valid radialModelType types are :" << endl; - Info<< dictionaryConstructorTablePtr_->toc() << abort(FatalError); + Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); } return autoPtr(cstrIter()(dict)); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/viscosityModel/newViscosityModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/viscosityModel/newViscosityModel.C index 508673a5d3..5de17ec189 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/viscosityModel/newViscosityModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/viscosityModel/newViscosityModel.C @@ -50,7 +50,7 @@ Foam::kineticTheoryModels::viscosityModel::New << viscosityModelType << ", constructor not in hash table" << endl << endl << " Valid viscosityModelType types are :" << endl; - Info<< dictionaryConstructorTablePtr_->toc() << abort(FatalError); + Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); } return autoPtr(cstrIter()(dict)); diff --git a/applications/utilities/mesh/generation/blockMesh/curvedEdges/curvedEdge.C b/applications/utilities/mesh/generation/blockMesh/curvedEdges/curvedEdge.C index 6a2d41a83e..9329c33f6d 100644 --- a/applications/utilities/mesh/generation/blockMesh/curvedEdges/curvedEdge.C +++ b/applications/utilities/mesh/generation/blockMesh/curvedEdges/curvedEdge.C @@ -107,7 +107,7 @@ autoPtr curvedEdge::New(const pointField& points, Istream& is) FatalErrorIn("curvedEdge::New(const pointField&, Istream&)") << "Unknown curvedEdge type " << curvedEdgeType << endl << endl << "Valid curvedEdge types are" << endl - << IstreamConstructorTablePtr_->toc() + << IstreamConstructorTablePtr_->sortedToc() << abort(FatalError); } diff --git a/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/extrudeModel/newExtrudeModel.C b/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/extrudeModel/newExtrudeModel.C index 967481cff9..e511ef9082 100644 --- a/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/extrudeModel/newExtrudeModel.C +++ b/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/extrudeModel/newExtrudeModel.C @@ -47,7 +47,7 @@ Foam::autoPtr Foam::extrudeModel::New << extrudeModelType << ", constructor not in hash table" << nl << nl << " Valid extrudeModel types are :" << nl - << dictionaryConstructorTablePtr_->toc() << nl + << dictionaryConstructorTablePtr_->sortedToc() << nl << exit(FatalError); } diff --git a/src/ODE/ODESolvers/ODESolver/newODESolver.C b/src/ODE/ODESolvers/ODESolver/newODESolver.C index f10bf0bbd1..9f3472ce0c 100644 --- a/src/ODE/ODESolvers/ODESolver/newODESolver.C +++ b/src/ODE/ODESolvers/ODESolver/newODESolver.C @@ -47,7 +47,7 @@ Foam::autoPtr Foam::ODESolver::New ) << "Unknown ODESolver type " << ODESolverTypeName << endl << endl << "Valid ODESolvers are : " << endl - << ODEConstructorTablePtr_->toc() + << ODEConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/OpenFOAM/db/IOstreams/token/token.C b/src/OpenFOAM/db/IOstreams/token/token.C index f74dbd7381..271ec286a7 100644 --- a/src/OpenFOAM/db/IOstreams/token/token.C +++ b/src/OpenFOAM/db/IOstreams/token/token.C @@ -67,7 +67,7 @@ Foam::autoPtr Foam::token::compound::New FatalErrorIn("token::compound::New(const word&, Istream&)") << "Unknown compound type " << compoundType << nl << nl << "Valid compound types:" << endl - << IstreamConstructorTablePtr_->toc() + << IstreamConstructorTablePtr_->sortedToc() << abort(FatalError); } diff --git a/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C index 3157cea04b..b07f5d790d 100644 --- a/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C +++ b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C @@ -89,7 +89,7 @@ Foam::autoPtr Foam::functionObject::New ) << "Unknown function type " << functionType << nl << nl << "Valid functions are : " << nl - << dictionaryConstructorTablePtr_->toc() << endl + << dictionaryConstructorTablePtr_->sortedToc() << endl << exit(FatalError); } diff --git a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/newPointPatchField.C b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/newPointPatchField.C index 0669f0e796..8efa87c3ec 100644 --- a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/newPointPatchField.C +++ b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/newPointPatchField.C @@ -55,7 +55,7 @@ Foam::autoPtr > Foam::pointPatchField::New << patchFieldType << endl << endl << "Valid patchField types are :" << endl - << pointPatchConstructorTablePtr_->toc() + << pointPatchConstructorTablePtr_->sortedToc() << exit(FatalError); } @@ -111,7 +111,7 @@ Foam::autoPtr > Foam::pointPatchField::New ) << "Unknown patchField type " << patchFieldType << " for patch type " << p.type() << endl << endl << "Valid patchField types are :" << endl - << dictionaryConstructorTablePtr_->toc() + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalIOError); } } @@ -182,7 +182,7 @@ Foam::autoPtr > Foam::pointPatchField::New ) << "unknown patchTypefield type " << ptf.type() << endl << endl << "Valid patchField types are :" << endl - << patchMapperConstructorTablePtr_->toc() + << patchMapperConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/OpenFOAM/graph/graph.C b/src/OpenFOAM/graph/graph.C index adb9371333..ed9fde5817 100644 --- a/src/OpenFOAM/graph/graph.C +++ b/src/OpenFOAM/graph/graph.C @@ -168,7 +168,7 @@ autoPtr graph::writer::New(const word& graphFormat) ) << "Unknown graph format " << graphFormat << endl << endl << "Valid graph formats are : " << endl - << wordConstructorTablePtr_->toc() + << wordConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixPreconditioner.C b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixPreconditioner.C index c85cf074be..aa97913cf0 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixPreconditioner.C +++ b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixPreconditioner.C @@ -97,7 +97,7 @@ Foam::lduMatrix::preconditioner::New ) << "Unknown symmetric matrix preconditioner " << name << nl << nl << "Valid symmetric matrix preconditioners :" << endl - << symMatrixConstructorTablePtr_->toc() + << symMatrixConstructorTablePtr_->sortedToc() << exit(FatalIOError); } @@ -125,7 +125,7 @@ Foam::lduMatrix::preconditioner::New ) << "Unknown asymmetric matrix preconditioner " << name << nl << nl << "Valid asymmetric matrix preconditioners :" << endl - << asymMatrixConstructorTablePtr_->toc() + << asymMatrixConstructorTablePtr_->sortedToc() << exit(FatalIOError); } diff --git a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSmoother.C b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSmoother.C index 4ce5381fb1..6f4b38d147 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSmoother.C +++ b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSmoother.C @@ -98,7 +98,7 @@ Foam::autoPtr Foam::lduMatrix::smoother::New ) << "Unknown symmetric matrix smoother " << name << nl << nl << "Valid symmetric matrix smoothers are :" << endl - << symMatrixConstructorTablePtr_->toc() + << symMatrixConstructorTablePtr_->sortedToc() << exit(FatalIOError); } @@ -127,7 +127,7 @@ Foam::autoPtr Foam::lduMatrix::smoother::New ) << "Unknown asymmetric matrix smoother " << name << nl << nl << "Valid asymmetric matrix smoothers are :" << endl - << asymMatrixConstructorTablePtr_->toc() + << asymMatrixConstructorTablePtr_->sortedToc() << exit(FatalIOError); } diff --git a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C index cb17295a3e..0114c0f08a 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C +++ b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C @@ -77,7 +77,7 @@ Foam::autoPtr Foam::lduMatrix::solver::New "lduMatrix::solver::New", solverControls ) << "Unknown symmetric matrix solver " << name << nl << nl << "Valid symmetric matrix solvers are :" << endl - << symMatrixConstructorTablePtr_->toc() + << symMatrixConstructorTablePtr_->sortedToc() << exit(FatalIOError); } @@ -106,7 +106,7 @@ Foam::autoPtr Foam::lduMatrix::solver::New "lduMatrix::solver::New", solverControls ) << "Unknown asymmetric matrix solver " << name << nl << nl << "Valid asymmetric matrix solvers are :" << endl - << asymMatrixConstructorTablePtr_->toc() + << asymMatrixConstructorTablePtr_->sortedToc() << exit(FatalIOError); } diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C index 633b8e2f37..47e1d4dbd3 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C @@ -124,9 +124,9 @@ const Foam::GAMGAgglomeration& Foam::GAMGAgglomeration::New ) << "Unknown GAMGAgglomeration type " << agglomeratorType << ".\n" << "Valid algebraic GAMGAgglomeration types are :" - << lduMatrixConstructorTablePtr_->toc() << endl + << lduMatrixConstructorTablePtr_->sortedToc() << endl << "Valid algebraic GAMGAgglomeration types are :" - << lduMeshConstructorTablePtr_->toc() + << lduMeshConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/GAMGInterfaceField/newGAMGInterfaceField.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/GAMGInterfaceField/newGAMGInterfaceField.C index 61251878c1..a083dcae54 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/GAMGInterfaceField/newGAMGInterfaceField.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/GAMGInterfaceField/newGAMGInterfaceField.C @@ -48,7 +48,7 @@ Foam::autoPtr Foam::GAMGInterfaceField::New "const lduInterfaceField& fineInterface)" ) << "Unknown GAMGInterfaceField type " << coupleType << ".\n" << "Valid GAMGInterfaceField types are :" - << lduInterfaceConstructorTablePtr_->toc() + << lduInterfaceConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/GAMGInterface/newGAMGInterface.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/GAMGInterface/newGAMGInterface.C index 196a91f0c4..7cb1ecf147 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/GAMGInterface/newGAMGInterface.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/GAMGInterface/newGAMGInterface.C @@ -52,7 +52,7 @@ Foam::autoPtr Foam::GAMGInterface::New "const labelField& neighbourRestrictAddressing)" ) << "Unknown GAMGInterface type " << coupleType << ".\n" << "Valid GAMGInterface types are :" - << lduInterfaceConstructorTablePtr_->toc() + << lduInterfaceConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/OpenFOAM/meshes/pointMesh/pointPatches/facePointPatch/newFacePointPatch.C b/src/OpenFOAM/meshes/pointMesh/pointPatches/facePointPatch/newFacePointPatch.C index 4e870225e6..4146954746 100644 --- a/src/OpenFOAM/meshes/pointMesh/pointPatches/facePointPatch/newFacePointPatch.C +++ b/src/OpenFOAM/meshes/pointMesh/pointPatches/facePointPatch/newFacePointPatch.C @@ -60,7 +60,7 @@ autoPtr facePointPatch::New << patch.type() << endl << endl << "Valid facePointPatch types are :" << endl - << polyPatchConstructorTablePtr_->toc() + << polyPatchConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/newPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/newPolyPatch.C index f456fc8404..deceda1eef 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/newPolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/newPolyPatch.C @@ -59,7 +59,7 @@ Foam::autoPtr Foam::polyPatch::New ) << "Unknown polyPatch type " << patchType << " for patch " << name << endl << endl << "Valid polyPatch types are :" << endl - << wordConstructorTablePtr_->toc() + << wordConstructorTablePtr_->sortedToc() << exit(FatalError); } @@ -107,7 +107,7 @@ Foam::autoPtr Foam::polyPatch::New << " for patch " << name << endl << endl << "Valid polyPatch types are :" << endl - << dictionaryConstructorTablePtr_->toc() + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalIOError); } } diff --git a/src/OpenFOAM/meshes/polyMesh/zones/cellZone/newCellZone.C b/src/OpenFOAM/meshes/polyMesh/zones/cellZone/newCellZone.C index e715812150..1905c9beda 100644 --- a/src/OpenFOAM/meshes/polyMesh/zones/cellZone/newCellZone.C +++ b/src/OpenFOAM/meshes/polyMesh/zones/cellZone/newCellZone.C @@ -62,7 +62,7 @@ Foam::autoPtr Foam::cellZone::New dict ) << "Unknown cellZone type " << zoneType << endl << endl << "Valid cellZone types are :" << endl - << dictionaryConstructorTablePtr_->toc() + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalIOError); } diff --git a/src/OpenFOAM/meshes/polyMesh/zones/faceZone/newFaceZone.C b/src/OpenFOAM/meshes/polyMesh/zones/faceZone/newFaceZone.C index 5e77ee7778..91506f5ce8 100644 --- a/src/OpenFOAM/meshes/polyMesh/zones/faceZone/newFaceZone.C +++ b/src/OpenFOAM/meshes/polyMesh/zones/faceZone/newFaceZone.C @@ -62,7 +62,7 @@ Foam::autoPtr Foam::faceZone::New dict ) << "Unknown faceZone type " << zoneType << endl << endl << "Valid faceZone types are :" << endl - << dictionaryConstructorTablePtr_->toc() + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalIOError); } diff --git a/src/OpenFOAM/meshes/polyMesh/zones/pointZone/newPointZone.C b/src/OpenFOAM/meshes/polyMesh/zones/pointZone/newPointZone.C index afdc80e322..015bdea318 100644 --- a/src/OpenFOAM/meshes/polyMesh/zones/pointZone/newPointZone.C +++ b/src/OpenFOAM/meshes/polyMesh/zones/pointZone/newPointZone.C @@ -62,7 +62,7 @@ Foam::autoPtr Foam::pointZone::New dict ) << "Unknown pointZone type " << zoneType << endl << endl << "Valid pointZone types are :" << endl - << dictionaryConstructorTablePtr_->toc() + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalIOError); } diff --git a/src/conversion/ensight/part/ensightPart.C b/src/conversion/ensight/part/ensightPart.C index c02f6c9896..a8b4e50308 100644 --- a/src/conversion/ensight/part/ensightPart.C +++ b/src/conversion/ensight/part/ensightPart.C @@ -142,7 +142,7 @@ Foam::autoPtr Foam::ensightPart::New(Istream& is) is ) << "unknown ensightPart type " << partType << endl << endl << "Valid ensightPart types are :" << endl - << istreamConstructorTablePtr_->toc() + << istreamConstructorTablePtr_->sortedToc() << exit(FatalIOError); } diff --git a/src/decompositionMethods/decompositionMethods/decompositionMethod/decompositionMethod.C b/src/decompositionMethods/decompositionMethods/decompositionMethod/decompositionMethod.C index b526f391ef..01b1a56d03 100644 --- a/src/decompositionMethods/decompositionMethods/decompositionMethod/decompositionMethod.C +++ b/src/decompositionMethods/decompositionMethods/decompositionMethod/decompositionMethod.C @@ -64,7 +64,7 @@ Foam::autoPtr Foam::decompositionMethod::New ) << "Unknown decompositionMethod " << decompositionMethodTypeName << endl << endl << "Valid decompositionMethods are : " << endl - << dictionaryConstructorTablePtr_->toc() + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } @@ -96,7 +96,7 @@ Foam::autoPtr Foam::decompositionMethod::New ) << "Unknown decompositionMethod " << decompositionMethodTypeName << endl << endl << "Valid decompositionMethods are : " << endl - << dictionaryMeshConstructorTablePtr_->toc() + << dictionaryMeshConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/dynamicFvMesh/dynamicFvMesh/newDynamicFvMesh.C b/src/dynamicFvMesh/dynamicFvMesh/newDynamicFvMesh.C index ca300e4d36..5dfe589ec3 100644 --- a/src/dynamicFvMesh/dynamicFvMesh/newDynamicFvMesh.C +++ b/src/dynamicFvMesh/dynamicFvMesh/newDynamicFvMesh.C @@ -79,7 +79,7 @@ Foam::autoPtr Foam::dynamicFvMesh::New(const IOobject& io) ) << "Unknown dynamicFvMesh type " << dynamicFvMeshTypeName << endl << endl << "Valid dynamicFvMesh types are :" << endl - << IOobjectConstructorTablePtr_->toc() + << IOobjectConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/solidBodyMotionFunction/newSolidBodyMotionFunction.C b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/solidBodyMotionFunction/newSolidBodyMotionFunction.C index 11e6e656b3..8c9fcbc522 100644 --- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/solidBodyMotionFunction/newSolidBodyMotionFunction.C +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/solidBodyMotionFunction/newSolidBodyMotionFunction.C @@ -55,7 +55,7 @@ Foam::autoPtr Foam::solidBodyMotionFunction::New ) << "Unknown solidBodyMotionFunction type " << solidBodyMotionFunctionTypeName << endl << endl << "Valid solidBodyMotionFunctions are : " << endl - << dictionaryConstructorTablePtr_->toc() + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/dynamicMesh/meshCut/cellLooper/cellLooper.C b/src/dynamicMesh/meshCut/cellLooper/cellLooper.C index d7cd195837..83fb08bc5c 100644 --- a/src/dynamicMesh/meshCut/cellLooper/cellLooper.C +++ b/src/dynamicMesh/meshCut/cellLooper/cellLooper.C @@ -62,7 +62,7 @@ autoPtr cellLooper::New ) << "Unknown set type " << type << endl << endl << "Valid cellLooper types : " << endl - << wordConstructorTablePtr_->toc() + << wordConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/dynamicMesh/motionSolver/motionSolver.C b/src/dynamicMesh/motionSolver/motionSolver.C index a7a8883371..5966679feb 100644 --- a/src/dynamicMesh/motionSolver/motionSolver.C +++ b/src/dynamicMesh/motionSolver/motionSolver.C @@ -107,7 +107,7 @@ Foam::autoPtr Foam::motionSolver::New(const polyMesh& mesh) ) << "Unknown solver type " << solverTypeName << endl << endl << "Valid solver types are: " << endl - << dictionaryConstructorTablePtr_->toc() + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/dynamicMesh/polyTopoChange/polyMeshModifier/newPolyMeshModifier.C b/src/dynamicMesh/polyTopoChange/polyMeshModifier/newPolyMeshModifier.C index 00547da73b..ca2d7b6826 100644 --- a/src/dynamicMesh/polyTopoChange/polyMeshModifier/newPolyMeshModifier.C +++ b/src/dynamicMesh/polyTopoChange/polyMeshModifier/newPolyMeshModifier.C @@ -64,7 +64,7 @@ autoPtr polyMeshModifier::New dict ) << "Unknown polyMeshModifier type " << patchType << endl << endl << "Valid polyMeshModifier types are :" << endl - << dictionaryConstructorTablePtr_->toc() + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalIOError); } diff --git a/src/engine/engineMesh/engineMesh/newEngineMesh.C b/src/engine/engineMesh/engineMesh/newEngineMesh.C index bf2a6033df..158db3073e 100644 --- a/src/engine/engineMesh/engineMesh/newEngineMesh.C +++ b/src/engine/engineMesh/engineMesh/newEngineMesh.C @@ -69,7 +69,7 @@ Foam::autoPtr Foam::engineMesh::New ) << "Unknown engineMesh type " << engineMeshTypeName << endl << endl << "Valid engineMesh types are :" << endl - << IOobjectConstructorTablePtr_->toc() + << IOobjectConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/newSRFModel.C b/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/newSRFModel.C index ff94172db0..cc4400daba 100644 --- a/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/newSRFModel.C +++ b/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/newSRFModel.C @@ -76,7 +76,7 @@ autoPtr SRFModel::New ) << "Unknown SRFModel type " << SRFModelTypeName << nl << nl << "Valid SRFModel types are :" << nl - << dictionaryConstructorTablePtr_->toc() + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/finiteVolume/fields/fvPatchFields/fvPatchField/newFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/fvPatchField/newFvPatchField.C index 59fc3b3633..3ef0d0e427 100644 --- a/src/finiteVolume/fields/fvPatchFields/fvPatchField/newFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/fvPatchField/newFvPatchField.C @@ -54,7 +54,7 @@ Foam::tmp > Foam::fvPatchField::New ) << "Unknown patchTypefield type " << patchFieldType << endl << endl << "Valid patchField types are :" << endl - << patchConstructorTablePtr_->toc() + << patchConstructorTablePtr_->sortedToc() << exit(FatalError); } @@ -111,7 +111,7 @@ Foam::tmp > Foam::fvPatchField::New ) << "Unknown patchField type " << patchFieldType << " for patch type " << p.type() << endl << endl << "Valid patchField types are :" << endl - << dictionaryConstructorTablePtr_->toc() + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalIOError); } } @@ -178,7 +178,7 @@ Foam::tmp > Foam::fvPatchField::New "const fvPatchFieldMapper&)" ) << "unknown patchTypefield type " << ptf.type() << endl << endl << "Valid patchField types are :" << endl - << patchMapperConstructorTablePtr_->toc() + << patchMapperConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/newFvsPatchField.C b/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/newFvsPatchField.C index 38abb38d8c..d8427a3445 100644 --- a/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/newFvsPatchField.C +++ b/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/newFvsPatchField.C @@ -59,7 +59,7 @@ tmp > fvsPatchField::New ) << "Unknown patchTypefield type " << patchFieldType << endl << endl << "Valid patchField types are :" << endl - << patchConstructorTablePtr_->toc() + << patchConstructorTablePtr_->sortedToc() << exit(FatalError); } @@ -115,7 +115,7 @@ tmp > fvsPatchField::New ) << "Unknown patchField type " << patchFieldType << " for patch type " << p.type() << endl << endl << "Valid patchField types are :" << endl - << dictionaryConstructorTablePtr_->toc() + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalIOError); } } @@ -183,7 +183,7 @@ tmp > fvsPatchField::New "const fvPatchFieldMapper&)" ) << "unknown patchTypefield type " << ptf.type() << endl << endl << "Valid patchField types are :" << endl - << patchMapperConstructorTablePtr_->toc() + << patchMapperConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/finiteVolume/finiteVolume/convectionSchemes/convectionScheme/convectionScheme.C b/src/finiteVolume/finiteVolume/convectionSchemes/convectionScheme/convectionScheme.C index 1a8947cd8c..ce5c19d791 100644 --- a/src/finiteVolume/finiteVolume/convectionSchemes/convectionScheme/convectionScheme.C +++ b/src/finiteVolume/finiteVolume/convectionSchemes/convectionScheme/convectionScheme.C @@ -79,7 +79,7 @@ tmp > convectionScheme::New schemeData ) << "Convection scheme not specified" << endl << endl << "Valid convection schemes are :" << endl - << IstreamConstructorTablePtr_->toc() + << IstreamConstructorTablePtr_->sortedToc() << exit(FatalIOError); } @@ -97,7 +97,7 @@ tmp > convectionScheme::New schemeData ) << "unknown convection scheme " << schemeName << endl << endl << "Valid convection schemes are :" << endl - << IstreamConstructorTablePtr_->toc() + << IstreamConstructorTablePtr_->sortedToc() << exit(FatalIOError); } @@ -136,7 +136,7 @@ tmp > convectionScheme::New schemeData ) << "Convection scheme not specified" << endl << endl << "Valid convection schemes are :" << endl - << MultivariateConstructorTablePtr_->toc() + << MultivariateConstructorTablePtr_->sortedToc() << exit(FatalIOError); } @@ -156,7 +156,7 @@ tmp > convectionScheme::New schemeData ) << "unknown convection scheme " << schemeName << endl << endl << "Valid convection schemes are :" << endl - << MultivariateConstructorTablePtr_->toc() + << MultivariateConstructorTablePtr_->sortedToc() << exit(FatalIOError); } diff --git a/src/finiteVolume/finiteVolume/d2dt2Schemes/d2dt2Scheme/d2dt2Scheme.C b/src/finiteVolume/finiteVolume/d2dt2Schemes/d2dt2Scheme/d2dt2Scheme.C index 9783d2694d..0018817c68 100644 --- a/src/finiteVolume/finiteVolume/d2dt2Schemes/d2dt2Scheme/d2dt2Scheme.C +++ b/src/finiteVolume/finiteVolume/d2dt2Schemes/d2dt2Scheme/d2dt2Scheme.C @@ -64,7 +64,7 @@ tmp > d2dt2Scheme::New schemeData ) << "D2dt2 scheme not specified" << endl << endl << "Valid d2dt2 schemes are :" << endl - << IstreamConstructorTablePtr_->toc() + << IstreamConstructorTablePtr_->sortedToc() << exit(FatalIOError); } @@ -81,7 +81,7 @@ tmp > d2dt2Scheme::New schemeData ) << "unknown d2dt2 scheme " << schemeName << endl << endl << "Valid d2dt2 schemes are :" << endl - << IstreamConstructorTablePtr_->toc() + << IstreamConstructorTablePtr_->sortedToc() << exit(FatalIOError); } diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.C b/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.C index 854060453f..80d47fe830 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.C @@ -62,7 +62,7 @@ tmp > ddtScheme::New schemeData ) << "Ddt scheme not specified" << endl << endl << "Valid ddt schemes are :" << endl - << IstreamConstructorTablePtr_->toc() + << IstreamConstructorTablePtr_->sortedToc() << exit(FatalIOError); } @@ -79,7 +79,7 @@ tmp > ddtScheme::New schemeData ) << "unknown ddt scheme " << schemeName << endl << endl << "Valid ddt schemes are :" << endl - << IstreamConstructorTablePtr_->toc() + << IstreamConstructorTablePtr_->sortedToc() << exit(FatalIOError); } diff --git a/src/finiteVolume/finiteVolume/divSchemes/divScheme/divScheme.C b/src/finiteVolume/finiteVolume/divSchemes/divScheme/divScheme.C index e40cece4d4..8d283b9fc8 100644 --- a/src/finiteVolume/finiteVolume/divSchemes/divScheme/divScheme.C +++ b/src/finiteVolume/finiteVolume/divSchemes/divScheme/divScheme.C @@ -65,7 +65,7 @@ tmp > divScheme::New schemeData ) << "Div scheme not specified" << endl << endl << "Valid div schemes are :" << endl - << IstreamConstructorTablePtr_->toc() + << IstreamConstructorTablePtr_->sortedToc() << exit(FatalIOError); } @@ -82,7 +82,7 @@ tmp > divScheme::New schemeData ) << "unknown div scheme " << schemeName << endl << endl << "Valid div schemes are :" << endl - << IstreamConstructorTablePtr_->toc() + << IstreamConstructorTablePtr_->sortedToc() << exit(FatalIOError); } diff --git a/src/finiteVolume/finiteVolume/gradSchemes/gradScheme/gradScheme.C b/src/finiteVolume/finiteVolume/gradSchemes/gradScheme/gradScheme.C index ae5c3afce1..6d7cc56560 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/gradScheme/gradScheme.C +++ b/src/finiteVolume/finiteVolume/gradSchemes/gradScheme/gradScheme.C @@ -64,7 +64,7 @@ tmp > gradScheme::New schemeData ) << "Grad scheme not specified" << endl << endl << "Valid grad schemes are :" << endl - << IstreamConstructorTablePtr_->toc() + << IstreamConstructorTablePtr_->sortedToc() << exit(FatalIOError); } @@ -81,7 +81,7 @@ tmp > gradScheme::New schemeData ) << "unknown grad scheme " << schemeName << endl << endl << "Valid grad schemes are :" << endl - << IstreamConstructorTablePtr_->toc() + << IstreamConstructorTablePtr_->sortedToc() << exit(FatalIOError); } diff --git a/src/finiteVolume/finiteVolume/laplacianSchemes/laplacianScheme/laplacianScheme.C b/src/finiteVolume/finiteVolume/laplacianSchemes/laplacianScheme/laplacianScheme.C index a0b04008e2..eb14f253ad 100644 --- a/src/finiteVolume/finiteVolume/laplacianSchemes/laplacianScheme/laplacianScheme.C +++ b/src/finiteVolume/finiteVolume/laplacianSchemes/laplacianScheme/laplacianScheme.C @@ -63,7 +63,7 @@ tmp > laplacianScheme::New schemeData ) << "Laplacian scheme not specified" << endl << endl << "Valid laplacian schemes are :" << endl - << IstreamConstructorTablePtr_->toc() + << IstreamConstructorTablePtr_->sortedToc() << exit(FatalIOError); } @@ -80,7 +80,7 @@ tmp > laplacianScheme::New schemeData ) << "unknown laplacian scheme " << schemeName << endl << endl << "Valid laplacian schemes are :" << endl - << IstreamConstructorTablePtr_->toc() + << IstreamConstructorTablePtr_->sortedToc() << exit(FatalIOError); } diff --git a/src/finiteVolume/finiteVolume/snGradSchemes/snGradScheme/snGradScheme.C b/src/finiteVolume/finiteVolume/snGradSchemes/snGradScheme/snGradScheme.C index 54f5ff5460..5fee351987 100644 --- a/src/finiteVolume/finiteVolume/snGradSchemes/snGradScheme/snGradScheme.C +++ b/src/finiteVolume/finiteVolume/snGradSchemes/snGradScheme/snGradScheme.C @@ -65,7 +65,7 @@ tmp > snGradScheme::New ) << "Discretisation scheme not specified" << endl << endl << "Valid schemes are :" << endl - << MeshConstructorTablePtr_->toc() + << MeshConstructorTablePtr_->sortedToc() << exit(FatalIOError); } @@ -83,7 +83,7 @@ tmp > snGradScheme::New ) << "Unknown discretisation scheme " << schemeName << endl << endl << "Valid schemes are :" << endl - << MeshConstructorTablePtr_->toc() + << MeshConstructorTablePtr_->sortedToc() << exit(FatalIOError); } diff --git a/src/finiteVolume/fvMesh/fvPatches/fvPatch/newFvPatch.C b/src/finiteVolume/fvMesh/fvPatches/fvPatch/newFvPatch.C index 8ae0c3b0d9..62c55633de 100644 --- a/src/finiteVolume/fvMesh/fvPatches/fvPatch/newFvPatch.C +++ b/src/finiteVolume/fvMesh/fvPatches/fvPatch/newFvPatch.C @@ -50,7 +50,7 @@ Foam::autoPtr Foam::fvPatch::New FatalErrorIn("fvPatch::New(const polyPatch&, const fvBoundaryMesh&)") << "Unknown fvPatch type " << patch.type() << ".\n" << "Valid fvPatch types are :" - << polyPatchConstructorTablePtr_->toc() + << polyPatchConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/finiteVolume/interpolation/interpolation/interpolation/newInterpolation.C b/src/finiteVolume/interpolation/interpolation/interpolation/newInterpolation.C index 377815ea9a..cf6827a10f 100644 --- a/src/finiteVolume/interpolation/interpolation/interpolation/newInterpolation.C +++ b/src/finiteVolume/interpolation/interpolation/interpolation/newInterpolation.C @@ -50,7 +50,7 @@ Foam::interpolation::New ) << "Unknown interpolation type " << interpolationType << " for field " << psi.name() << nl << nl << "Valid interpolation types : " << endl - << dictionaryConstructorTablePtr_->toc() + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/limitedSurfaceInterpolationScheme/limitedSurfaceInterpolationScheme.C b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/limitedSurfaceInterpolationScheme/limitedSurfaceInterpolationScheme.C index 77b18ab806..2d5b9dfcb9 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/limitedSurfaceInterpolationScheme/limitedSurfaceInterpolationScheme.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/limitedSurfaceInterpolationScheme/limitedSurfaceInterpolationScheme.C @@ -62,7 +62,7 @@ limitedSurfaceInterpolationScheme::New ) << "Discretisation scheme not specified" << endl << endl << "Valid schemes are :" << endl - << MeshConstructorTablePtr_->toc() + << MeshConstructorTablePtr_->sortedToc() << exit(FatalIOError); } @@ -81,7 +81,7 @@ limitedSurfaceInterpolationScheme::New ) << "Unknown discretisation scheme " << schemeName << endl << endl << "Valid schemes are :" << endl - << MeshConstructorTablePtr_->toc() + << MeshConstructorTablePtr_->sortedToc() << exit(FatalIOError); } @@ -117,7 +117,7 @@ limitedSurfaceInterpolationScheme::New ) << "Discretisation scheme not specified" << endl << endl << "Valid schemes are :" << endl - << MeshConstructorTablePtr_->toc() + << MeshConstructorTablePtr_->sortedToc() << exit(FatalIOError); } @@ -136,7 +136,7 @@ limitedSurfaceInterpolationScheme::New ) << "Unknown discretisation scheme " << schemeName << endl << endl << "Valid schemes are :" << endl - << MeshFluxConstructorTablePtr_->toc() + << MeshFluxConstructorTablePtr_->sortedToc() << exit(FatalIOError); } diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/multivariateSchemes/multivariateSurfaceInterpolationScheme/multivariateSurfaceInterpolationScheme.C b/src/finiteVolume/interpolation/surfaceInterpolation/multivariateSchemes/multivariateSurfaceInterpolationScheme/multivariateSurfaceInterpolationScheme.C index 5efc36af2f..a920dcb204 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/multivariateSchemes/multivariateSurfaceInterpolationScheme/multivariateSurfaceInterpolationScheme.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/multivariateSchemes/multivariateSurfaceInterpolationScheme/multivariateSurfaceInterpolationScheme.C @@ -92,7 +92,7 @@ multivariateSurfaceInterpolationScheme::New schemeData ) << "unknown discretisation scheme " << schemeName << endl << endl << "Valid schemes are :" << endl - << IstreamConstructorTablePtr_->toc() + << IstreamConstructorTablePtr_->sortedToc() << exit(FatalIOError); } diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolationScheme/surfaceInterpolationScheme.C b/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolationScheme/surfaceInterpolationScheme.C index 4702ccb5aa..9c43eeb48d 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolationScheme/surfaceInterpolationScheme.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolationScheme/surfaceInterpolationScheme.C @@ -56,7 +56,7 @@ tmp > surfaceInterpolationScheme::New ) << "Discretisation scheme not specified" << endl << endl << "Valid schemes are :" << endl - << MeshConstructorTablePtr_->toc() + << MeshConstructorTablePtr_->sortedToc() << exit(FatalIOError); } @@ -83,7 +83,7 @@ tmp > surfaceInterpolationScheme::New ) << "Unknown discretisation scheme " << schemeName << endl << endl << "Valid schemes are :" << endl - << MeshConstructorTablePtr_->toc() + << MeshConstructorTablePtr_->sortedToc() << exit(FatalIOError); } @@ -110,7 +110,7 @@ tmp > surfaceInterpolationScheme::New ) << "Discretisation scheme not specified" << endl << endl << "Valid schemes are :" << endl - << MeshConstructorTablePtr_->toc() + << MeshConstructorTablePtr_->sortedToc() << exit(FatalIOError); } @@ -138,7 +138,7 @@ tmp > surfaceInterpolationScheme::New ) << "Unknown discretisation scheme " << schemeName << endl << endl << "Valid schemes are :" << endl - << MeshFluxConstructorTablePtr_->toc() + << MeshFluxConstructorTablePtr_->sortedToc() << exit(FatalIOError); } diff --git a/src/fvMotionSolver/motionDiffusivity/motionDiffusivity/motionDiffusivity.C b/src/fvMotionSolver/motionDiffusivity/motionDiffusivity/motionDiffusivity.C index b794db4a43..50936f456a 100644 --- a/src/fvMotionSolver/motionDiffusivity/motionDiffusivity/motionDiffusivity.C +++ b/src/fvMotionSolver/motionDiffusivity/motionDiffusivity/motionDiffusivity.C @@ -68,7 +68,7 @@ Foam::autoPtr Foam::motionDiffusivity::New ) << "Unknown diffusion type " << diffTypeName << endl << endl << "Valid diffusion types are :" << endl - << IstreamConstructorTablePtr_->toc() + << IstreamConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/lagrangian/dieselSpray/injector/injectorType/injectorType.C b/src/lagrangian/dieselSpray/injector/injectorType/injectorType.C index 511679af37..8607b8eab1 100644 --- a/src/lagrangian/dieselSpray/injector/injectorType/injectorType.C +++ b/src/lagrangian/dieselSpray/injector/injectorType/injectorType.C @@ -74,7 +74,7 @@ Foam::autoPtr Foam::injectorType::New << injectorTypeName << ", constructor not in hash table" << endl << endl << " Valid injector types are :" << endl; - Info<< dictionaryConstructorTablePtr_->toc() << abort(FatalError); + Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); } return autoPtr(cstrIter()(t, dict)); diff --git a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/atomizationModel/newAtomizationModel.C b/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/atomizationModel/newAtomizationModel.C index 7a5cfdffe1..8d2d8ca99f 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/atomizationModel/newAtomizationModel.C +++ b/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/atomizationModel/newAtomizationModel.C @@ -61,7 +61,7 @@ autoPtr atomizationModel::New << atomizationModelType << ", constructor not in hash table" << endl << endl << " Valid atomizationModel types are :" << endl; - Info<< dictionaryConstructorTablePtr_->toc() << abort(FatalError); + Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); } return autoPtr(cstrIter()(dict, sm)); diff --git a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/breakupModel/newBreakupModel.C b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/breakupModel/newBreakupModel.C index 69f3c5fcf4..d0889443eb 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/breakupModel/newBreakupModel.C +++ b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/breakupModel/newBreakupModel.C @@ -62,7 +62,7 @@ autoPtr breakupModel::New << breakupModelType << ", constructor not in hash table" << endl << endl << " Valid breakupModel types are :" << endl; - Info<< dictionaryConstructorTablePtr_->toc() << abort(FatalError); + Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); } return autoPtr(cstrIter()(dict, sm)); diff --git a/src/lagrangian/dieselSpray/spraySubModels/collisionModel/collisionModel/newCollisionModel.C b/src/lagrangian/dieselSpray/spraySubModels/collisionModel/collisionModel/newCollisionModel.C index 8f60f6dc4d..942ebafe8d 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/collisionModel/collisionModel/newCollisionModel.C +++ b/src/lagrangian/dieselSpray/spraySubModels/collisionModel/collisionModel/newCollisionModel.C @@ -67,7 +67,7 @@ autoPtr collisionModel::New << ", constructor not in hash table" << endl << endl << " Valid collisionModel types are :" << endl; - Info<< dictionaryConstructorTablePtr_->toc() + Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); } diff --git a/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/dispersionModel/newDispersionModel.C b/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/dispersionModel/newDispersionModel.C index cf03049155..50d6cbce8a 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/dispersionModel/newDispersionModel.C +++ b/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/dispersionModel/newDispersionModel.C @@ -62,7 +62,7 @@ autoPtr dispersionModel::New << dispersionModelType << ", constructor not in hash table" << endl << endl << " Valid dispersionModel types are :" << endl; - Info<< dictionaryConstructorTablePtr_->toc() << abort(FatalError); + Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); } return autoPtr(cstrIter()(dict, sm)); diff --git a/src/lagrangian/dieselSpray/spraySubModels/dragModel/dragModel/newDragModel.C b/src/lagrangian/dieselSpray/spraySubModels/dragModel/dragModel/newDragModel.C index 7424851d62..6fed754f95 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/dragModel/dragModel/newDragModel.C +++ b/src/lagrangian/dieselSpray/spraySubModels/dragModel/dragModel/newDragModel.C @@ -60,7 +60,7 @@ autoPtr dragModel::New << dragModelType << ", constructor not in hash table" << endl << endl << " Valid dragModel types are :" << endl; - Info<< dictionaryConstructorTablePtr_->toc() << abort(FatalError); + Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); } return autoPtr(cstrIter()(dict)); diff --git a/src/lagrangian/dieselSpray/spraySubModels/evaporationModel/evaporationModel/newEvaporationModel.C b/src/lagrangian/dieselSpray/spraySubModels/evaporationModel/evaporationModel/newEvaporationModel.C index ff94baf830..2d400a09d4 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/evaporationModel/evaporationModel/newEvaporationModel.C +++ b/src/lagrangian/dieselSpray/spraySubModels/evaporationModel/evaporationModel/newEvaporationModel.C @@ -62,7 +62,7 @@ autoPtr evaporationModel::New << evaporationModelType << ", constructor not in hash table" << endl << endl << " Valid evaporationModel types are :" << endl; - Info<< dictionaryConstructorTablePtr_->toc() << abort(FatalError); + Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); } return autoPtr(cstrIter()(dict)); diff --git a/src/lagrangian/dieselSpray/spraySubModels/heatTransferModel/heatTransferModel/newHeatTransferModel.C b/src/lagrangian/dieselSpray/spraySubModels/heatTransferModel/heatTransferModel/newHeatTransferModel.C index 4be6465c6d..308fbfa697 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/heatTransferModel/heatTransferModel/newHeatTransferModel.C +++ b/src/lagrangian/dieselSpray/spraySubModels/heatTransferModel/heatTransferModel/newHeatTransferModel.C @@ -60,7 +60,7 @@ autoPtr heatTransferModel::New << heatTransferModelType << ", constructor not in hash table" << endl << endl << " Valid heatTransferModel types are :" << endl; - Info<< dictionaryConstructorTablePtr_->toc() << abort(FatalError); + Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); } return autoPtr(cstrIter()(dict)); diff --git a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/injectorModel/newInjectorModel.C b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/injectorModel/newInjectorModel.C index 59940886c7..41758a8259 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/injectorModel/newInjectorModel.C +++ b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/injectorModel/newInjectorModel.C @@ -61,7 +61,7 @@ autoPtr injectorModel::New << injectorModelType << ", constructor not in hash table" << endl << endl << " Valid injectorModel types are :" << endl; - Info<< dictionaryConstructorTablePtr_->toc() << abort(FatalError); + Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); } return autoPtr(cstrIter()(dict, sm)); diff --git a/src/lagrangian/dieselSpray/spraySubModels/wallModel/wallModel/newWallModel.C b/src/lagrangian/dieselSpray/spraySubModels/wallModel/wallModel/newWallModel.C index c4648bc90a..3274533b1d 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/wallModel/wallModel/newWallModel.C +++ b/src/lagrangian/dieselSpray/spraySubModels/wallModel/wallModel/newWallModel.C @@ -61,7 +61,7 @@ autoPtr wallModel::New << wallModelType << ", constructor not in hash table" << endl << endl << " Valid wallModel types are :" << endl; - Info<< dictionaryConstructorTablePtr_->toc() << abort(FatalError); + Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); } return autoPtr(cstrIter()(dict, U, sm)); diff --git a/src/lagrangian/dsmc/submodels/BinaryCollisionModel/BinaryCollisionModel/NewBinaryCollisionModel.C b/src/lagrangian/dsmc/submodels/BinaryCollisionModel/BinaryCollisionModel/NewBinaryCollisionModel.C index 12c74f6697..e122b66eaa 100644 --- a/src/lagrangian/dsmc/submodels/BinaryCollisionModel/BinaryCollisionModel/NewBinaryCollisionModel.C +++ b/src/lagrangian/dsmc/submodels/BinaryCollisionModel/BinaryCollisionModel/NewBinaryCollisionModel.C @@ -56,7 +56,7 @@ Foam::BinaryCollisionModel::New << BinaryCollisionModelType << ", constructor not in hash table" << nl << nl << " Valid BinaryCollisionModel types are:" << nl - << dictionaryConstructorTablePtr_->toc() << exit(FatalError); + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } return autoPtr > diff --git a/src/lagrangian/dsmc/submodels/InflowBoundaryModel/InflowBoundaryModel/NewInflowBoundaryModel.C b/src/lagrangian/dsmc/submodels/InflowBoundaryModel/InflowBoundaryModel/NewInflowBoundaryModel.C index bc1005bdaf..b94f08898b 100644 --- a/src/lagrangian/dsmc/submodels/InflowBoundaryModel/InflowBoundaryModel/NewInflowBoundaryModel.C +++ b/src/lagrangian/dsmc/submodels/InflowBoundaryModel/InflowBoundaryModel/NewInflowBoundaryModel.C @@ -53,7 +53,7 @@ Foam::InflowBoundaryModel::New << InflowBoundaryModelType << ", constructor not in hash table" << nl << nl << " Valid InflowBoundaryModel types are:" << nl - << dictionaryConstructorTablePtr_->toc() << exit(FatalError); + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } return autoPtr >(cstrIter()(dict, owner)); diff --git a/src/lagrangian/dsmc/submodels/WallInteractionModel/WallInteractionModel/NewWallInteractionModel.C b/src/lagrangian/dsmc/submodels/WallInteractionModel/WallInteractionModel/NewWallInteractionModel.C index 97197cd669..6320812427 100644 --- a/src/lagrangian/dsmc/submodels/WallInteractionModel/WallInteractionModel/NewWallInteractionModel.C +++ b/src/lagrangian/dsmc/submodels/WallInteractionModel/WallInteractionModel/NewWallInteractionModel.C @@ -55,7 +55,7 @@ Foam::WallInteractionModel::New << WallInteractionModelType << ", constructor not in hash table" << nl << nl << " Valid WallInteractionModel types are:" << nl - << dictionaryConstructorTablePtr_->toc() << exit(FatalError); + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } return autoPtr >(cstrIter()(dict, owner)); diff --git a/src/lagrangian/intermediate/IntegrationScheme/IntegrationScheme/newIntegrationScheme.C b/src/lagrangian/intermediate/IntegrationScheme/IntegrationScheme/newIntegrationScheme.C index db73158615..83cbd33d8a 100644 --- a/src/lagrangian/intermediate/IntegrationScheme/IntegrationScheme/newIntegrationScheme.C +++ b/src/lagrangian/intermediate/IntegrationScheme/IntegrationScheme/newIntegrationScheme.C @@ -55,7 +55,7 @@ Foam::IntegrationScheme::New ) << "Unknown IntegrationScheme type " << IntegrationSchemeTypeName << nl << nl << "Valid IntegrationScheme types are:" << nl - << dictionaryConstructorTablePtr_->toc() << nl + << dictionaryConstructorTablePtr_->sortedToc() << nl << exit(FatalError); } diff --git a/src/lagrangian/intermediate/submodels/IO/DataEntry/DataEntry/NewDataEntry.C b/src/lagrangian/intermediate/submodels/IO/DataEntry/DataEntry/NewDataEntry.C index 3bed47c540..f55fcb1190 100644 --- a/src/lagrangian/intermediate/submodels/IO/DataEntry/DataEntry/NewDataEntry.C +++ b/src/lagrangian/intermediate/submodels/IO/DataEntry/DataEntry/NewDataEntry.C @@ -48,7 +48,7 @@ Foam::autoPtr > Foam::DataEntry::New << "Unknown DataEntry type " << DataEntryType << " for DataEntry " << entryName << ". Constructor not in hash table" << nl << nl << " Valid DataEntry types are:" << nl - << dictionaryConstructorTablePtr_->toc() << nl + << dictionaryConstructorTablePtr_->sortedToc() << nl << exit(FatalError); } diff --git a/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/DispersionModel/NewDispersionModel.C b/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/DispersionModel/NewDispersionModel.C index 09717b8e86..35c748949b 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/DispersionModel/NewDispersionModel.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/DispersionModel/NewDispersionModel.C @@ -58,7 +58,7 @@ Foam::DispersionModel::New << DispersionModelType << ", constructor not in hash table" << nl << nl << " Valid DispersionModel types are:" << nl - << dictionaryConstructorTablePtr_->toc() << exit(FatalError); + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } return autoPtr >(cstrIter()(dict, owner)); diff --git a/src/lagrangian/intermediate/submodels/Kinematic/DragModel/DragModel/NewDragModel.C b/src/lagrangian/intermediate/submodels/Kinematic/DragModel/DragModel/NewDragModel.C index 6e1e80d3cd..2202079b8c 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/DragModel/DragModel/NewDragModel.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/DragModel/DragModel/NewDragModel.C @@ -55,7 +55,7 @@ Foam::autoPtr > Foam::DragModel::New << DragModelType << ", constructor not in hash table" << nl << nl << " Valid DragModel types are:" << nl - << dictionaryConstructorTablePtr_->toc() + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/NewInjectionModel.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/NewInjectionModel.C index c0926272c6..3f6464ac0f 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/NewInjectionModel.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/NewInjectionModel.C @@ -56,7 +56,7 @@ Foam::InjectionModel::New << InjectionModelType << ", constructor not in hash table" << nl << nl << " Valid InjectionModel types are:" << nl - << dictionaryConstructorTablePtr_->toc() << exit(FatalError); + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } return autoPtr >(cstrIter()(dict, owner)); diff --git a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/NewPatchInteractionModel.C b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/NewPatchInteractionModel.C index 83740bb684..20887aa230 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/NewPatchInteractionModel.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/NewPatchInteractionModel.C @@ -57,7 +57,7 @@ Foam::PatchInteractionModel::New << PatchInteractionModelType << ", constructor not in hash table" << nl << nl << " Valid PatchInteractionModel types are:" << nl - << dictionaryConstructorTablePtr_->toc() << exit(FatalError); + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } return autoPtr >(cstrIter()(dict, owner)); diff --git a/src/lagrangian/intermediate/submodels/Kinematic/PostProcessingModel/PostProcessingModel/NewPostProcessingModel.C b/src/lagrangian/intermediate/submodels/Kinematic/PostProcessingModel/PostProcessingModel/NewPostProcessingModel.C index 29c096b677..563ceebec2 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/PostProcessingModel/PostProcessingModel/NewPostProcessingModel.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/PostProcessingModel/PostProcessingModel/NewPostProcessingModel.C @@ -56,7 +56,7 @@ Foam::PostProcessingModel::New << PostProcessingModelType << ", constructor not in hash table" << nl << nl << " Valid PostProcessingModel types are:" << nl - << dictionaryConstructorTablePtr_->toc() << exit(FatalError); + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } return autoPtr >(cstrIter()(dict, owner)); diff --git a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/NewCompositionModel.C b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/NewCompositionModel.C index 81d338176c..1c9b9a11db 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/NewCompositionModel.C +++ b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/NewCompositionModel.C @@ -56,7 +56,7 @@ Foam::CompositionModel::New << CompositionModelType << ", constructor not in hash table" << nl << nl << " Valid CompositionModel types are:" << nl - << dictionaryConstructorTablePtr_->toc() << nl + << dictionaryConstructorTablePtr_->sortedToc() << nl << exit(FatalError); } diff --git a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/PhaseChangeModel/NewPhaseChangeModel.C b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/PhaseChangeModel/NewPhaseChangeModel.C index 3b317c5b05..264b4b1226 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/PhaseChangeModel/NewPhaseChangeModel.C +++ b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/PhaseChangeModel/NewPhaseChangeModel.C @@ -56,7 +56,7 @@ Foam::PhaseChangeModel::New << PhaseChangeModelType << ", constructor not in hash table" << nl << nl << " Valid PhaseChangeModel types are:" << nl - << dictionaryConstructorTablePtr_->toc() << exit(FatalError); + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } return autoPtr >(cstrIter()(dict, owner)); diff --git a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/NewDevolatilisationModel.C b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/NewDevolatilisationModel.C index cac0375b28..471fee8aab 100644 --- a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/NewDevolatilisationModel.C +++ b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/NewDevolatilisationModel.C @@ -57,7 +57,7 @@ Foam::DevolatilisationModel::New << DevolatilisationModelType << ", constructor not in hash table" << nl << nl << " Valid DevolatilisationModel types are:" << nl - << dictionaryConstructorTablePtr_->toc() << exit(FatalError); + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } return autoPtr >(cstrIter()(dict, owner)); diff --git a/src/lagrangian/intermediate/submodels/ReactingMultiphase/SurfaceReactionModel/SurfaceReactionModel/NewSurfaceReactionModel.C b/src/lagrangian/intermediate/submodels/ReactingMultiphase/SurfaceReactionModel/SurfaceReactionModel/NewSurfaceReactionModel.C index 348bfa8a8c..807891d08e 100644 --- a/src/lagrangian/intermediate/submodels/ReactingMultiphase/SurfaceReactionModel/SurfaceReactionModel/NewSurfaceReactionModel.C +++ b/src/lagrangian/intermediate/submodels/ReactingMultiphase/SurfaceReactionModel/SurfaceReactionModel/NewSurfaceReactionModel.C @@ -57,7 +57,7 @@ Foam::SurfaceReactionModel::New << SurfaceReactionModelType << ", constructor not in hash table" << nl << nl << " Valid SurfaceReactionModel types are:" << nl - << dictionaryConstructorTablePtr_->toc() << exit(FatalError); + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } return autoPtr >(cstrIter()(dict, owner)); diff --git a/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/NewHeatTransferModel.C b/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/NewHeatTransferModel.C index d5d4748c4d..235c9ae18c 100644 --- a/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/NewHeatTransferModel.C +++ b/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/NewHeatTransferModel.C @@ -56,7 +56,7 @@ Foam::HeatTransferModel::New << HeatTransferModelType << ", constructor not in hash table" << nl << nl << " Valid HeatTransferModel types are:" << nl - << dictionaryConstructorTablePtr_->toc() << exit(FatalError); + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } return autoPtr >(cstrIter()(dict, owner)); diff --git a/src/lagrangian/molecularDynamics/potential/energyScalingFunction/basic/newEnergyScalingFunction.C b/src/lagrangian/molecularDynamics/potential/energyScalingFunction/basic/newEnergyScalingFunction.C index ccbdb8c92e..a7cb8455db 100644 --- a/src/lagrangian/molecularDynamics/potential/energyScalingFunction/basic/newEnergyScalingFunction.C +++ b/src/lagrangian/molecularDynamics/potential/energyScalingFunction/basic/newEnergyScalingFunction.C @@ -60,7 +60,7 @@ autoPtr energyScalingFunction::New ) << "Unknown energyScalingFunction type " << energyScalingFunctionTypeName << nl << nl << "Valid energyScalingFunctions are: " << nl - << dictionaryConstructorTablePtr_->toc() + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/lagrangian/molecularDynamics/potential/pairPotential/basic/newPairPotential.C b/src/lagrangian/molecularDynamics/potential/pairPotential/basic/newPairPotential.C index 2986a0e539..6123079583 100644 --- a/src/lagrangian/molecularDynamics/potential/pairPotential/basic/newPairPotential.C +++ b/src/lagrangian/molecularDynamics/potential/pairPotential/basic/newPairPotential.C @@ -56,7 +56,7 @@ autoPtr pairPotential::New ) << "Unknown pairPotential type " << pairPotentialTypeName << nl << nl << "Valid pairPotentials are: " << nl - << dictionaryConstructorTablePtr_->toc() + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/lagrangian/molecularDynamics/potential/tetherPotential/basic/newTetherPotential.C b/src/lagrangian/molecularDynamics/potential/tetherPotential/basic/newTetherPotential.C index 85c8a70359..a5b3ad6092 100644 --- a/src/lagrangian/molecularDynamics/potential/tetherPotential/basic/newTetherPotential.C +++ b/src/lagrangian/molecularDynamics/potential/tetherPotential/basic/newTetherPotential.C @@ -60,7 +60,7 @@ autoPtr tetherPotential::New ) << "Unknown tetherPotential type " << tetherPotentialTypeName << nl << nl << "Valid tetherPotentials are: " << nl - << dictionaryConstructorTablePtr_->toc() + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/meshTools/coordinateSystems/coordinateRotation/coordinateRotation.C b/src/meshTools/coordinateSystems/coordinateRotation/coordinateRotation.C index f3c95afc91..c0138e86e8 100644 --- a/src/meshTools/coordinateSystems/coordinateRotation/coordinateRotation.C +++ b/src/meshTools/coordinateSystems/coordinateRotation/coordinateRotation.C @@ -163,7 +163,7 @@ Foam::autoPtr Foam::coordinateRotation::New ) << "Unknown coordinateRotation type " << rotType << nl << nl << "Valid coordinateRotation types are :" << nl << "[default: axes " << typeName_() << "]" - << dictionaryConstructorTablePtr_->toc() + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalIOError); } diff --git a/src/meshTools/coordinateSystems/coordinateSystemNew.C b/src/meshTools/coordinateSystems/coordinateSystemNew.C index 9a6ec2a0b4..0c0752eded 100644 --- a/src/meshTools/coordinateSystems/coordinateSystemNew.C +++ b/src/meshTools/coordinateSystems/coordinateSystemNew.C @@ -66,7 +66,7 @@ Foam::autoPtr Foam::coordinateSystem::New ) << "Unknown coordinateSystem type " << coordType << nl << nl << "Valid coordinateSystem types are :" << nl << "[default: " << typeName_() << "]" - << dictionaryConstructorTablePtr_->toc() + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalIOError); } @@ -102,7 +102,7 @@ Foam::autoPtr Foam::coordinateSystem::New "constructing coordinateSystem" ) << "Unknown coordinateSystem type " << coordType << nl << nl << "Valid coordinateSystem types are :" << nl - << origRotationConstructorTablePtr_->toc() + << origRotationConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/meshTools/searchableSurface/searchableSurface.C b/src/meshTools/searchableSurface/searchableSurface.C index 5ec2338844..ad687a1134 100644 --- a/src/meshTools/searchableSurface/searchableSurface.C +++ b/src/meshTools/searchableSurface/searchableSurface.C @@ -57,7 +57,7 @@ autoPtr searchableSurface::New ) << "Unknown searchableSurface type " << searchableSurfaceType << endl << endl << "Valid searchableSurface types : " << endl - << dictConstructorTablePtr_->toc() + << dictConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/meshTools/sets/topoSetSource/topoSetSource.C b/src/meshTools/sets/topoSetSource/topoSetSource.C index 199c47203e..63aff6fc83 100644 --- a/src/meshTools/sets/topoSetSource/topoSetSource.C +++ b/src/meshTools/sets/topoSetSource/topoSetSource.C @@ -60,7 +60,7 @@ autoPtr topoSetSource::New ) << "Unknown topoSetSource type " << topoSetSourceType << endl << endl << "Valid topoSetSource types : " << endl - << wordConstructorTablePtr_->toc() + << wordConstructorTablePtr_->sortedToc() << exit(FatalError); } @@ -89,7 +89,7 @@ autoPtr topoSetSource::New ) << "Unknown topoSetSource type " << topoSetSourceType << endl << endl << "Valid topoSetSource types : " << endl - << istreamConstructorTablePtr_->toc() + << istreamConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/meshTools/sets/topoSets/topoSet.C b/src/meshTools/sets/topoSets/topoSet.C index 152193313e..32f8d1ff98 100644 --- a/src/meshTools/sets/topoSets/topoSet.C +++ b/src/meshTools/sets/topoSets/topoSet.C @@ -64,7 +64,7 @@ autoPtr topoSet::New ) << "Unknown set type " << setType << endl << endl << "Valid set types : " << endl - << wordConstructorTablePtr_->toc() + << wordConstructorTablePtr_->sortedToc() << exit(FatalError); } @@ -95,7 +95,7 @@ autoPtr topoSet::New ) << "Unknown set type " << setType << endl << endl << "Valid set types : " << endl - << sizeConstructorTablePtr_->toc() + << sizeConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/postProcessing/foamCalcFunctions/calcType/newCalcType.C b/src/postProcessing/foamCalcFunctions/calcType/newCalcType.C index 0c58abc5b0..d5d8e4de10 100644 --- a/src/postProcessing/foamCalcFunctions/calcType/newCalcType.C +++ b/src/postProcessing/foamCalcFunctions/calcType/newCalcType.C @@ -44,7 +44,7 @@ Foam::autoPtr Foam::calcType::New << " unknown calcType type " << calcTypeName << ", constructor not in hash table" << nl << nl << " Valid calcType selections are: " << nl - << dictionaryConstructorTablePtr_->toc() << nl + << dictionaryConstructorTablePtr_->sortedToc() << nl << abort(FatalError); } diff --git a/src/sampling/sampledSet/sampledSet/sampledSet.C b/src/sampling/sampledSet/sampledSet/sampledSet.C index 7b6f08206f..8b1dbaa335 100644 --- a/src/sampling/sampledSet/sampledSet/sampledSet.C +++ b/src/sampling/sampledSet/sampledSet/sampledSet.C @@ -430,7 +430,7 @@ Foam::autoPtr Foam::sampledSet::New ) << "Unknown sample type " << sampleType << endl << endl << "Valid sample types : " << endl - << wordConstructorTablePtr_->toc() + << wordConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/sampling/sampledSet/writers/writer.C b/src/sampling/sampledSet/writers/writer.C index 3a116b564e..b16966d3a1 100644 --- a/src/sampling/sampledSet/writers/writer.C +++ b/src/sampling/sampledSet/writers/writer.C @@ -49,7 +49,7 @@ Foam::autoPtr > Foam::writer::New ) << "Unknown write type " << writeType << endl << endl << "Valid write types : " << endl - << wordConstructorTablePtr_->toc() + << wordConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/sampling/sampledSurface/sampledSurface/sampledSurface.C b/src/sampling/sampledSurface/sampledSurface/sampledSurface.C index 5cbe630486..4f372a49b5 100644 --- a/src/sampling/sampledSurface/sampledSurface/sampledSurface.C +++ b/src/sampling/sampledSurface/sampledSurface/sampledSurface.C @@ -141,7 +141,7 @@ Foam::sampledSurface::New ) << "Unknown sample type " << sampleType << endl << endl << "Valid sample types : " << endl - << wordConstructorTablePtr_->toc() + << wordConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/sampling/sampledSurface/writers/surfaceWriter.C b/src/sampling/sampledSurface/writers/surfaceWriter.C index 99e19b96dd..a78ecbd21f 100644 --- a/src/sampling/sampledSurface/writers/surfaceWriter.C +++ b/src/sampling/sampledSurface/writers/surfaceWriter.C @@ -77,7 +77,7 @@ Foam::surfaceWriter::New(const word& writeType) "surfaceWriter::New(const word&)" ) << "Unknown write type \"" << writeType << "\"\n\n" << "Valid write types : " - << wordConstructorTablePtr_->toc() << nl + << wordConstructorTablePtr_->sortedToc() << nl << "Valid proxy types : " << MeshedSurfaceProxy::writeTypes() << endl << exit(FatalError); diff --git a/src/thermophysicalModels/barotropicCompressibilityModel/barotropicCompressibilityModel/newBarotropicCompressibilityModel.C b/src/thermophysicalModels/barotropicCompressibilityModel/barotropicCompressibilityModel/newBarotropicCompressibilityModel.C index 3ebc3c6532..77f6592775 100644 --- a/src/thermophysicalModels/barotropicCompressibilityModel/barotropicCompressibilityModel/newBarotropicCompressibilityModel.C +++ b/src/thermophysicalModels/barotropicCompressibilityModel/barotropicCompressibilityModel/newBarotropicCompressibilityModel.C @@ -55,7 +55,7 @@ Foam::barotropicCompressibilityModel::New ) << "Unknown barotropicCompressibilityModel type " << bcModelTypeName << endl << endl << "Valid barotropicCompressibilityModels are : " << endl - << dictionaryConstructorTablePtr_->toc() + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/thermophysicalModels/basic/psiThermo/basicPsiThermo/newBasicPsiThermo.C b/src/thermophysicalModels/basic/psiThermo/basicPsiThermo/newBasicPsiThermo.C index 3f9c43a0f9..038ac2e843 100644 --- a/src/thermophysicalModels/basic/psiThermo/basicPsiThermo/newBasicPsiThermo.C +++ b/src/thermophysicalModels/basic/psiThermo/basicPsiThermo/newBasicPsiThermo.C @@ -64,7 +64,7 @@ Foam::autoPtr Foam::basicPsiThermo::New FatalErrorIn("basicPsiThermo::New(const fvMesh&)") << "Unknown basicPsiThermo type " << thermoTypeName << nl << nl << "Valid basicPsiThermo types are:" << nl - << fvMeshConstructorTablePtr_->toc() << nl + << fvMeshConstructorTablePtr_->sortedToc() << nl << exit(FatalError); } diff --git a/src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/newBasicRhoThermo.C b/src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/newBasicRhoThermo.C index 9a7ec5ac86..46eeed365c 100644 --- a/src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/newBasicRhoThermo.C +++ b/src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/newBasicRhoThermo.C @@ -67,7 +67,7 @@ Foam::autoPtr Foam::basicRhoThermo::New FatalErrorIn("basicRhoThermo::New(const fvMesh&)") << "Unknown basicRhoThermo type " << thermoTypeName << nl << nl << "Valid basicRhoThermo types are:" << nl - << fvMeshConstructorTablePtr_->toc() << nl + << fvMeshConstructorTablePtr_->sortedToc() << nl << exit(FatalError); } diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/newPsiChemistryModel.C b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/newPsiChemistryModel.C index 6a5606d0e7..a7f6ed9a50 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/newPsiChemistryModel.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/newPsiChemistryModel.C @@ -86,11 +86,11 @@ Foam::autoPtr Foam::psiChemistryModel::New FatalErrorIn("psiChemistryModelBase::New(const mesh&)") << "Unknown psiChemistryModel type " << psiChemistryModelType << nl << nl << "Valid psiChemistryModel types are:" << nl - << fvMeshConstructorTablePtr_->toc() << nl << exit(FatalError); + << fvMeshConstructorTablePtr_->sortedToc() << nl << exit(FatalError); } else { - wordList models = fvMeshConstructorTablePtr_->toc(); + wordList models = fvMeshConstructorTablePtr_->sortedToc(); forAll(models, i) { models[i] = models[i].replace(typeName + ',', ""); diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/newRhoChemistryModel.C b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/newRhoChemistryModel.C index c59a607f87..0fdad4e0a0 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/newRhoChemistryModel.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/newRhoChemistryModel.C @@ -86,11 +86,11 @@ Foam::autoPtr Foam::rhoChemistryModel::New FatalErrorIn("rhoChemistryModelBase::New(const mesh&)") << "Unknown rhoChemistryModel type " << rhoChemistryModelType << nl << nl << "Valid rhoChemistryModel types are:" << nl - << fvMeshConstructorTablePtr_->toc() << nl << exit(FatalError); + << fvMeshConstructorTablePtr_->sortedToc() << nl << exit(FatalError); } else { - wordList models = fvMeshConstructorTablePtr_->toc(); + wordList models = fvMeshConstructorTablePtr_->sortedToc(); forAll(models, i) { models[i] = models[i].replace(typeName + ',', ""); diff --git a/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/newChemistrySolver.C b/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/newChemistrySolver.C index b0baa00fbe..e8f4b74495 100644 --- a/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/newChemistrySolver.C +++ b/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/newChemistrySolver.C @@ -49,7 +49,7 @@ Foam::chemistrySolver::New if (cstrIter == dictionaryConstructorTablePtr_->end()) { - wordList models = dictionaryConstructorTablePtr_->toc(); + wordList models = dictionaryConstructorTablePtr_->sortedToc(); forAll(models, i) { models[i] = models[i].replace diff --git a/src/thermophysicalModels/laminarFlameSpeed/laminarFlameSpeed/newLaminarFlameSpeed.C b/src/thermophysicalModels/laminarFlameSpeed/laminarFlameSpeed/newLaminarFlameSpeed.C index 685f1d7e4f..e44f40c4c9 100644 --- a/src/thermophysicalModels/laminarFlameSpeed/laminarFlameSpeed/newLaminarFlameSpeed.C +++ b/src/thermophysicalModels/laminarFlameSpeed/laminarFlameSpeed/newLaminarFlameSpeed.C @@ -66,7 +66,7 @@ Foam::autoPtr Foam::laminarFlameSpeed::New ) << "Unknown laminarFlameSpeed type " << laminarFlameSpeedType << endl << endl << "Valid laminarFlameSpeed types are :" << endl - << dictionaryConstructorTablePtr_->toc() + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalIOError); } diff --git a/src/thermophysicalModels/liquids/liquid/liquid.C b/src/thermophysicalModels/liquids/liquid/liquid.C index c2b5f8b3fa..542a215ff0 100644 --- a/src/thermophysicalModels/liquids/liquid/liquid.C +++ b/src/thermophysicalModels/liquids/liquid/liquid.C @@ -64,7 +64,7 @@ Foam::autoPtr Foam::liquid::New(Istream& is) << "Unknown liquid type " << liquidType << nl << nl << "Valid liquid types are:" << nl - << ConstructorTablePtr_->toc() + << ConstructorTablePtr_->sortedToc() << abort(FatalError); } @@ -81,7 +81,7 @@ Foam::autoPtr Foam::liquid::New(Istream& is) << "Unknown liquid type " << liquidType << endl << endl << "Valid liquid types are:" << nl - << IstreamConstructorTablePtr_->toc() + << IstreamConstructorTablePtr_->sortedToc() << abort(FatalError); } diff --git a/src/thermophysicalModels/pdfs/pdf/newPdf.C b/src/thermophysicalModels/pdfs/pdf/newPdf.C index ce13e261fb..5a3b077d21 100644 --- a/src/thermophysicalModels/pdfs/pdf/newPdf.C +++ b/src/thermophysicalModels/pdfs/pdf/newPdf.C @@ -46,7 +46,7 @@ Foam::autoPtr Foam::pdf::New FatalErrorIn("pdf::New(const dictionary&, Random&)") << "unknown pdf type " << pdfType << nl << nl << "Valid pdf types are:" << nl - << dictionaryConstructorTablePtr_->toc() + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/thermophysicalModels/radiation/radiationModel/radiationModel/newRadiationModel.C b/src/thermophysicalModels/radiation/radiationModel/radiationModel/newRadiationModel.C index c7840d9433..a5c27adac8 100644 --- a/src/thermophysicalModels/radiation/radiationModel/radiationModel/newRadiationModel.C +++ b/src/thermophysicalModels/radiation/radiationModel/radiationModel/newRadiationModel.C @@ -76,7 +76,7 @@ autoPtr radiationModel::New ) << "Unknown radiationModel type " << radiationModelTypeName << nl << nl << "Valid radiationModel types are:" << nl - << dictionaryConstructorTablePtr_->toc() + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/absorptionEmissionModel/newAbsorptionEmissionModel.C b/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/absorptionEmissionModel/newAbsorptionEmissionModel.C index d1628fd8d4..3ce41d3750 100644 --- a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/absorptionEmissionModel/newAbsorptionEmissionModel.C +++ b/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/absorptionEmissionModel/newAbsorptionEmissionModel.C @@ -53,7 +53,7 @@ Foam::radiation::absorptionEmissionModel::New << absorptionEmissionModelType << ", constructor not in hash table" << nl << nl << " Valid absorptionEmissionModel types are :" << nl - << dictionaryConstructorTablePtr_->toc() << exit(FatalError); + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } return autoPtr(cstrIter()(dict, mesh)); diff --git a/src/thermophysicalModels/radiation/submodels/scatterModel/scatterModel/newScatterModel.C b/src/thermophysicalModels/radiation/submodels/scatterModel/scatterModel/newScatterModel.C index e1f545758a..82b451ae20 100644 --- a/src/thermophysicalModels/radiation/submodels/scatterModel/scatterModel/newScatterModel.C +++ b/src/thermophysicalModels/radiation/submodels/scatterModel/scatterModel/newScatterModel.C @@ -51,7 +51,7 @@ Foam::autoPtr Foam::radiation::scatterModel::New << scatterModelType << ", constructor not in hash table" << nl << nl << " Valid scatterModel types are :" << nl - << dictionaryConstructorTablePtr_->toc() + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.C b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.C index e178bd0338..931706484b 100644 --- a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.C +++ b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.C @@ -55,7 +55,7 @@ Foam::chemistryReader::New ) << "Unknown chemistryReader type " << chemistryReaderTypeName << nl << nl << "Valid chemistryReaders are: " << nl - << dictionaryConstructorTablePtr_->toc() + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/thermophysicalModels/reactionThermo/combustionThermo/hCombustionThermo/newhCombustionThermo.C b/src/thermophysicalModels/reactionThermo/combustionThermo/hCombustionThermo/newhCombustionThermo.C index 788a298d0d..b36172963c 100644 --- a/src/thermophysicalModels/reactionThermo/combustionThermo/hCombustionThermo/newhCombustionThermo.C +++ b/src/thermophysicalModels/reactionThermo/combustionThermo/hCombustionThermo/newhCombustionThermo.C @@ -67,7 +67,7 @@ Foam::autoPtr Foam::hCombustionThermo::New << "Unknown hCombustionThermo type " << hCombustionThermoTypeName << nl << nl << "Valid hCombustionThermo types are:" << nl - << fvMeshConstructorTablePtr_->toc() << nl + << fvMeshConstructorTablePtr_->sortedToc() << nl << exit(FatalError); } @@ -103,7 +103,7 @@ Foam::autoPtr Foam::hCombustionThermo::NewType if (hCombustionThermoTypeName.find(thermoType) == string::npos) { - wordList allModels = fvMeshConstructorTablePtr_->toc(); + wordList allModels = fvMeshConstructorTablePtr_->sortedToc(); DynamicList validModels; forAll(allModels, i) { @@ -140,7 +140,7 @@ Foam::autoPtr Foam::hCombustionThermo::NewType << "Unknown hCombustionThermo type " << hCombustionThermoTypeName << nl << nl << "Valid hCombustionThermo types are:" << nl - << fvMeshConstructorTablePtr_->toc() << nl + << fvMeshConstructorTablePtr_->sortedToc() << nl << exit(FatalError); } diff --git a/src/thermophysicalModels/reactionThermo/combustionThermo/hhuCombustionThermo/newhhuCombustionThermo.C b/src/thermophysicalModels/reactionThermo/combustionThermo/hhuCombustionThermo/newhhuCombustionThermo.C index 2e21f2d9c5..4945cc8815 100644 --- a/src/thermophysicalModels/reactionThermo/combustionThermo/hhuCombustionThermo/newhhuCombustionThermo.C +++ b/src/thermophysicalModels/reactionThermo/combustionThermo/hhuCombustionThermo/newhhuCombustionThermo.C @@ -69,7 +69,7 @@ autoPtr hhuCombustionThermo::New(const fvMesh& mesh) << "Unknown hhuCombustionThermo type " << hhuCombustionThermoTypeName << endl << endl << "Valid hhuCombustionThermo types are :" << endl - << fvMeshConstructorTablePtr_->toc() + << fvMeshConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/newhReactionThermo.C b/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/newhReactionThermo.C index 688b37b6d2..ad0c92f04f 100644 --- a/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/newhReactionThermo.C +++ b/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/newhReactionThermo.C @@ -67,7 +67,7 @@ Foam::autoPtr Foam::hReactionThermo::New << "Unknown hReactionThermo type " << hReactionThermoTypeName << nl << nl << "Valid hReactionThermo types are:" << nl - << fvMeshConstructorTablePtr_->toc() << nl + << fvMeshConstructorTablePtr_->sortedToc() << nl << exit(FatalError); } @@ -103,7 +103,7 @@ Foam::autoPtr Foam::hReactionThermo::NewType if (hReactionThermoTypeName.find(thermoType) == string::npos) { - wordList allModels = fvMeshConstructorTablePtr_->toc(); + wordList allModels = fvMeshConstructorTablePtr_->sortedToc(); DynamicList validModels; forAll(allModels, i) { @@ -140,7 +140,7 @@ Foam::autoPtr Foam::hReactionThermo::NewType << "Unknown hReactionThermo type " << hReactionThermoTypeName << nl << nl << "Valid hReactionThermo types are:" << nl - << fvMeshConstructorTablePtr_->toc() << nl + << fvMeshConstructorTablePtr_->sortedToc() << nl << exit(FatalError); } diff --git a/src/thermophysicalModels/solids/solid/newSolid.C b/src/thermophysicalModels/solids/solid/newSolid.C index 445a98a00d..63cf5c22af 100644 --- a/src/thermophysicalModels/solids/solid/newSolid.C +++ b/src/thermophysicalModels/solids/solid/newSolid.C @@ -51,7 +51,7 @@ Foam::autoPtr Foam::solid::New(Istream& is) FatalErrorIn("solid::New(Istream&)") << "Unknown solid type " << solidType << nl << nl << "Valid solid types are:" << endl - << ConstructorTablePtr_->toc() + << ConstructorTablePtr_->sortedToc() << exit(FatalError); } @@ -67,7 +67,7 @@ Foam::autoPtr Foam::solid::New(Istream& is) FatalErrorIn("solid::New(Istream&)") << "Unknown solid type " << solidType << nl << nl << "Valid solid types are:" << endl - << IstreamConstructorTablePtr_->toc() + << IstreamConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.C b/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.C index f0ebd1c61a..ad5c2e1185 100644 --- a/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.C +++ b/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.C @@ -228,7 +228,7 @@ autoPtr > Reaction::New is ) << "Reaction type not specified" << endl << endl << "Valid Reaction types are :" << endl - << IstreamConstructorTablePtr_->toc() + << IstreamConstructorTablePtr_->sortedToc() << exit(FatalIOError); } @@ -246,7 +246,7 @@ autoPtr > Reaction::New is ) << "Unknown reaction type " << reactionTypeName << endl << endl << "Valid reaction types are :" << endl - << IstreamConstructorTablePtr_->toc() + << IstreamConstructorTablePtr_->sortedToc() << exit(FatalIOError); } diff --git a/src/thermophysicalModels/thermophysicalFunctions/thermophysicalFunction/thermophysicalFunction.C b/src/thermophysicalModels/thermophysicalFunctions/thermophysicalFunction/thermophysicalFunction.C index 7eda81bb2b..7cf74b659e 100644 --- a/src/thermophysicalModels/thermophysicalFunctions/thermophysicalFunction/thermophysicalFunction.C +++ b/src/thermophysicalModels/thermophysicalFunctions/thermophysicalFunction/thermophysicalFunction.C @@ -62,7 +62,7 @@ autoPtr thermophysicalFunction::New(Istream& is) << thermophysicalFunctionType << endl << endl << "Valid thermophysicalFunction types are :" << endl - << IstreamConstructorTablePtr_->toc() + << IstreamConstructorTablePtr_->sortedToc() << abort(FatalError); } diff --git a/src/transportModels/incompressible/viscosityModels/viscosityModel/newViscosityModel.C b/src/transportModels/incompressible/viscosityModels/viscosityModel/newViscosityModel.C index fd7aa5183d..aeba455a8d 100644 --- a/src/transportModels/incompressible/viscosityModels/viscosityModel/newViscosityModel.C +++ b/src/transportModels/incompressible/viscosityModels/viscosityModel/newViscosityModel.C @@ -60,7 +60,7 @@ autoPtr viscosityModel::New ) << "Unknown viscosityModel type " << viscosityModelTypeName << endl << endl << "Valid viscosityModels are : " << endl - << dictionaryConstructorTablePtr_->toc() + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.C b/src/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.C index 5f4283859a..54a73b1243 100644 --- a/src/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.C +++ b/src/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.C @@ -80,7 +80,7 @@ autoPtr LESdelta::New "LESdelta::New(const fvMesh&, const dictionary&)" ) << "Unknown LESdelta type " << deltaType << endl << endl << "Valid LESdelta types are :" << endl - << dictionaryConstructorTablePtr_->toc() + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/turbulenceModels/LES/LESfilters/LESfilter/LESfilter.C b/src/turbulenceModels/LES/LESfilters/LESfilter/LESfilter.C index e77e00f189..ba60f21e4c 100644 --- a/src/turbulenceModels/LES/LESfilters/LESfilter/LESfilter.C +++ b/src/turbulenceModels/LES/LESfilters/LESfilter/LESfilter.C @@ -59,7 +59,7 @@ autoPtr LESfilter::New "LESfilter::New(const fvMesh&, const dictionary&)" ) << "Unknown LESfilter type " << filterType << endl << endl << "Valid LESfilter types are :" << endl - << dictionaryConstructorTablePtr_->toc() + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/turbulenceModels/compressible/LES/LESModel/LESModel.C b/src/turbulenceModels/compressible/LES/LESModel/LESModel.C index dd166f2693..c32cb077d8 100644 --- a/src/turbulenceModels/compressible/LES/LESModel/LESModel.C +++ b/src/turbulenceModels/compressible/LES/LESModel/LESModel.C @@ -136,7 +136,7 @@ autoPtr LESModel::New ) << "Unknown LESModel type " << modelName << endl << endl << "Valid LESModel types are :" << endl - << dictionaryConstructorTablePtr_->toc() + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/turbulenceModels/compressible/RAS/RASModel/RASModel.C b/src/turbulenceModels/compressible/RAS/RASModel/RASModel.C index b390bca5e5..1d4054fb04 100644 --- a/src/turbulenceModels/compressible/RAS/RASModel/RASModel.C +++ b/src/turbulenceModels/compressible/RAS/RASModel/RASModel.C @@ -141,7 +141,7 @@ autoPtr RASModel::New ) << "Unknown RASModel type " << modelName << endl << endl << "Valid RASModel types are :" << endl - << dictionaryConstructorTablePtr_->toc() + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/turbulenceModels/compressible/turbulenceModel/turbulenceModel.C b/src/turbulenceModels/compressible/turbulenceModel/turbulenceModel.C index 15cce81cc1..8c544ddef9 100644 --- a/src/turbulenceModels/compressible/turbulenceModel/turbulenceModel.C +++ b/src/turbulenceModels/compressible/turbulenceModel/turbulenceModel.C @@ -106,7 +106,7 @@ autoPtr turbulenceModel::New ) << "Unknown turbulenceModel type " << modelName << endl << endl << "Valid turbulenceModel types are :" << endl - << turbulenceModelConstructorTablePtr_->toc() + << turbulenceModelConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/turbulenceModels/incompressible/LES/LESModel/LESModel.C b/src/turbulenceModels/incompressible/LES/LESModel/LESModel.C index 3458e03c6b..76c2ef0ba4 100644 --- a/src/turbulenceModels/incompressible/LES/LESModel/LESModel.C +++ b/src/turbulenceModels/incompressible/LES/LESModel/LESModel.C @@ -133,7 +133,7 @@ autoPtr LESModel::New ) << "Unknown LESModel type " << modelName << endl << endl << "Valid LESModel types are :" << endl - << dictionaryConstructorTablePtr_->toc() + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.C b/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.C index d3366d8206..c2546e659e 100644 --- a/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.C +++ b/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.C @@ -138,7 +138,7 @@ autoPtr RASModel::New ) << "Unknown RASModel type " << modelName << endl << endl << "Valid RASModel types are :" << endl - << dictionaryConstructorTablePtr_->toc() + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/turbulenceModels/incompressible/turbulenceModel/turbulenceModel.C b/src/turbulenceModels/incompressible/turbulenceModel/turbulenceModel.C index cdbb61fa70..2cc9c9462a 100644 --- a/src/turbulenceModels/incompressible/turbulenceModel/turbulenceModel.C +++ b/src/turbulenceModels/incompressible/turbulenceModel/turbulenceModel.C @@ -102,7 +102,7 @@ autoPtr turbulenceModel::New ) << "Unknown turbulenceModel type " << modelName << endl << endl << "Valid turbulenceModel types are :" << endl - << turbulenceModelConstructorTablePtr_->toc() + << turbulenceModelConstructorTablePtr_->sortedToc() << exit(FatalError); } From a7c5d31c3eb927b80b74f4aaf4fa3a5efca02e31 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 6 Aug 2009 19:24:22 +0100 Subject: [PATCH 023/454] typo --- src/dynamicMesh/meshCut/directions/directions.H | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dynamicMesh/meshCut/directions/directions.H b/src/dynamicMesh/meshCut/directions/directions.H index 11b06f1f44..9debd4b210 100644 --- a/src/dynamicMesh/meshCut/directions/directions.H +++ b/src/dynamicMesh/meshCut/directions/directions.H @@ -74,7 +74,7 @@ public: { TAN1, TAN2, - NORMAL, + NORMAL }; private: From dc999ad07ef585ecedd9468847e45f03d1499a58 Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 7 Aug 2009 11:27:48 +0100 Subject: [PATCH 024/454] fvMesh xfer constructor change --- .../mesh/conversion/Optional/ccm26ToFoam/ccm26ToFoam.C | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/applications/utilities/mesh/conversion/Optional/ccm26ToFoam/ccm26ToFoam.C b/applications/utilities/mesh/conversion/Optional/ccm26ToFoam/ccm26ToFoam.C index 47ec7f9137..f4bf559009 100644 --- a/applications/utilities/mesh/conversion/Optional/ccm26ToFoam/ccm26ToFoam.C +++ b/applications/utilities/mesh/conversion/Optional/ccm26ToFoam/ccm26ToFoam.C @@ -908,10 +908,10 @@ int main(int argc, char *argv[]) runTime.constant(), runTime ), - foamPoints, - foamFaces, - foamOwner, - foamNeighbour + xferMove(foamPoints), + xferMove(foamFaces), + xferCopy(foamOwner), + xferMove(foamNeighbour) ); // Create patches. Use patch types to determine what Foam types to generate. From 1dd11b0f79ba3685d234ebc968d687c21f4ca52b Mon Sep 17 00:00:00 2001 From: andy Date: Fri, 7 Aug 2009 14:56:10 +0100 Subject: [PATCH 025/454] avoid potential div0's --- .../mutURoughWallFunctionFvPatchScalarField.C | 9 ++++----- .../mutUSpaldingWallFunctionFvPatchScalarField.C | 13 ++++++------- .../nutURoughWallFunctionFvPatchScalarField.C | 2 +- .../nutUSpaldingWallFunctionFvPatchScalarField.C | 14 +++++++------- 4 files changed, 18 insertions(+), 20 deletions(-) diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutURoughWallFunction/mutURoughWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutURoughWallFunction/mutURoughWallFunctionFvPatchScalarField.C index 7bc772eead..c848c2b413 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutURoughWallFunction/mutURoughWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutURoughWallFunction/mutURoughWallFunctionFvPatchScalarField.C @@ -70,8 +70,7 @@ tmp mutURoughWallFunctionFvPatchScalarField::calcYPlus // of the wall will depend on yPlus forAll(yPlus, facei) { - const scalar magUpara = magUp[facei]; - const scalar Re = rho[facei]*magUpara*y[facei]/muw[facei]; + const scalar Re = rho[facei]*magUp[facei]*y[facei]/muw[facei]; const scalar kappaRe = kappa_*Re; scalar yp = yPlusLam_; @@ -142,8 +141,7 @@ tmp mutURoughWallFunctionFvPatchScalarField::calcYPlus // Smooth Walls forAll(yPlus, facei) { - const scalar magUpara = magUp[facei]; - const scalar Re = rho[facei]*magUpara*y[facei]/muw[facei]; + const scalar Re = rho[facei]*magUp[facei]*y[facei]/muw[facei]; const scalar kappaRe = kappa_*Re; scalar yp = yPlusLam_; @@ -193,7 +191,8 @@ tmp mutURoughWallFunctionFvPatchScalarField::calcMut() const { if (yPlus[facei] > yPlusLam_) { - const scalar Re = rho[facei]*magUp[facei]*y[facei]/muw[facei]; + const scalar Re = + rho[facei]*magUp[facei]*y[facei]/muw[facei] + ROOTVSMALL; mutw[facei] = muw[facei]*(sqr(yPlus[facei])/Re - 1); } } diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUSpaldingWallFunction/mutUSpaldingWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUSpaldingWallFunction/mutUSpaldingWallFunctionFvPatchScalarField.C index 0fcfe72c4c..0c63d7c8a0 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUSpaldingWallFunction/mutUSpaldingWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUSpaldingWallFunction/mutUSpaldingWallFunctionFvPatchScalarField.C @@ -66,10 +66,9 @@ tmp mutUSpaldingWallFunctionFvPatchScalarField::calcUTau forAll(mutw, faceI) { - scalar magUpara = magUp[faceI]; - scalar ut = - sqrt((mutw[faceI] + muw[faceI])*magGradU[faceI]/rhow[faceI]); + sqrt((mutw[faceI] + muw[faceI])*magGradU[faceI]/rhow[faceI]) + + ROOTVSMALL; if (ut > VSMALL) { @@ -78,17 +77,17 @@ tmp mutUSpaldingWallFunctionFvPatchScalarField::calcUTau do { - scalar kUu = min(kappa_*magUpara/ut, 50); + scalar kUu = min(kappa_*magUp[faceI]/ut, 50); scalar fkUu = exp(kUu) - 1 - kUu*(1 + 0.5*kUu); scalar f = - ut*y[faceI]/(muw[faceI]/rhow[faceI]) - + magUpara/ut + + magUp[faceI]/ut + 1/E_*(fkUu - 1.0/6.0*kUu*sqr(kUu)); scalar df = y[faceI]/(muw[faceI]/rhow[faceI]) - + magUpara/sqr(ut) + + magUp[faceI]/sqr(ut) + 1/E_*kUu*fkUu/ut; scalar uTauNew = ut + f/df; @@ -111,7 +110,7 @@ tmp mutUSpaldingWallFunctionFvPatchScalarField::calcMut() const const RASModel& rasModel = db().lookupObject("RASProperties"); const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; - const scalarField magGradU = mag(Uw.snGrad()); + const scalarField magGradU = mag(Uw.snGrad()) + ROOTVSMALL; const scalarField& rhow = rasModel.rho().boundaryField()[patchI]; const scalarField& muw = rasModel.mu().boundaryField()[patchI]; diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C index a85c647467..c202ac479c 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C @@ -63,7 +63,7 @@ tmp nutURoughWallFunctionFvPatchScalarField::calcNut() const { if (yPlus[facei] > yPlusLam_) { - const scalar Re = magUp[facei]*y[facei]/nuw[facei]; + const scalar Re = magUp[facei]*y[facei]/nuw[facei] + ROOTVSMALL; nutw[facei] = nuw[facei]*(sqr(yPlus[facei])/Re - 1); } } diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.C index f24001bc6e..4adf3227ab 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.C @@ -47,7 +47,7 @@ tmp nutUSpaldingWallFunctionFvPatchScalarField::calcNut() const const RASModel& rasModel = db().lookupObject("RASProperties"); const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; - const scalarField magGradU = mag(Uw.snGrad()); + const scalarField magGradU = mag(Uw.snGrad()) + ROOTVSMALL; const scalarField& nuw = rasModel.nu().boundaryField()[patchI]; return max(scalar(0), sqr(calcUTau(magGradU))/magGradU - nuw); @@ -74,9 +74,8 @@ tmp nutUSpaldingWallFunctionFvPatchScalarField::calcUTau forAll(uTau, facei) { - scalar magUpara = magUp[facei]; - - scalar ut = sqrt((nutw[facei] + nuw[facei])*magGradU[facei]); + scalar ut = + sqrt((nutw[facei] + nuw[facei])*magGradU[facei]) + ROOTVSMALL; if (ut > VSMALL) { @@ -85,17 +84,17 @@ tmp nutUSpaldingWallFunctionFvPatchScalarField::calcUTau do { - scalar kUu = min(kappa_*magUpara/ut, 50); + scalar kUu = min(kappa_*magUp[facei]/ut, 50); scalar fkUu = exp(kUu) - 1 - kUu*(1 + 0.5*kUu); scalar f = - ut*y[facei]/nuw[facei] - + magUpara/ut + + magUp[facei]/ut + 1/E_*(fkUu - 1.0/6.0*kUu*sqr(kUu)); scalar df = y[facei]/nuw[facei] - + magUpara/sqr(ut) + + magUp[facei]/sqr(ut) + 1/E_*kUu*fkUu/ut; scalar uTauNew = ut + f/df; @@ -103,6 +102,7 @@ tmp nutUSpaldingWallFunctionFvPatchScalarField::calcUTau ut = uTauNew; } while (ut > VSMALL && err > 0.01 && ++iter < 10); + uTau[facei] = max(0.0, ut); } } From 1d8294b5b0901e1998207d53b6d668843b389061 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Fri, 7 Aug 2009 17:06:49 +0200 Subject: [PATCH 026/454] added draft of foamCheckPwd --- bin/foamCheckPwd | 98 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100755 bin/foamCheckPwd diff --git a/bin/foamCheckPwd b/bin/foamCheckPwd new file mode 100755 index 0000000000..1da6f1a84d --- /dev/null +++ b/bin/foamCheckPwd @@ -0,0 +1,98 @@ +#!/bin/sh +#------------------------------------------------------------------------------ +# ========= | +# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox +# \\ / O peration | +# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. +# \\/ M anipulation | +#------------------------------------------------------------------------------- +# License +# This file is part of OpenFOAM. +# +# OpenFOAM is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; either version 2 of the License, or (at your +# option) any later version. +# +# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License +# along with OpenFOAM; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# +# Script +# foamCheckPwd +# +# Description +# Check that the current working directory is equal to a particular +# target directory, resolving the absolute path as required +# +#------------------------------------------------------------------------------- +unset quietOpt + +usage() { + [ "$quietOpt" = true ] && exit 1 + exec 1>&2 + while [ "$#" -ge 1 ]; do echo "$1"; shift; done + cat</dev/null && /bin/pwd) + +# okay +[ "$thisDir" = "$dirName" ] && exit 0 + +# some other error +exit 1 + +#------------------------------------------------------------------------------ From bdbdd25bac8e7c68a7b01273eb207c854ef803fa Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Fri, 7 Aug 2009 20:24:11 +0200 Subject: [PATCH 027/454] Allwmake and {applications,src}/Allwmake use wmake/wmakeCheckPwd - solves problems that can occur when checking $PWD and links are involved --- Allwmake | 5 ++--- applications/Allwmake | 5 ++--- src/Allwmake | 5 ++--- bin/foamCheckPwd => wmake/wmakeCheckPwd | 15 ++++++++++----- 4 files changed, 16 insertions(+), 14 deletions(-) rename bin/foamCheckPwd => wmake/wmakeCheckPwd (88%) diff --git a/Allwmake b/Allwmake index 2e570c89a5..36d7658f19 100755 --- a/Allwmake +++ b/Allwmake @@ -1,13 +1,12 @@ #!/bin/sh cd ${0%/*} || exit 1 # run from this directory -if [ "$PWD" != "$WM_PROJECT_DIR" ] -then +wmakeCheckPwd "$WM_PROJECT_DIR" || { echo "Error: Current directory is not \$WM_PROJECT_DIR" echo " The environment variables are inconsistent with the installation." echo " Check the OpenFOAM entries in your dot-files and source them." exit 1 -fi +} # wmake is required for subsequent targets ( cd wmake/src && make ) diff --git a/applications/Allwmake b/applications/Allwmake index ddb5b116fc..48e66941d3 100755 --- a/applications/Allwmake +++ b/applications/Allwmake @@ -1,13 +1,12 @@ #!/bin/sh cd ${0%/*} || exit 1 # run from this directory -if [ "$PWD" != "$WM_PROJECT_DIR/applications" ] -then +wmakeCheckPwd "$WM_PROJECT_DIR/applications" || { echo "Error: Current directory is not \$WM_PROJECT_DIR/applications" echo " The environment variables are inconsistent with the installation." echo " Check the OpenFOAM entries in your dot-files and source them." exit 1 -fi +} set -x diff --git a/src/Allwmake b/src/Allwmake index 1fcbb76d33..ebef2d8d0d 100755 --- a/src/Allwmake +++ b/src/Allwmake @@ -1,13 +1,12 @@ #!/bin/sh cd ${0%/*} || exit 1 # run from this directory -if [ "$PWD" != "$WM_PROJECT_DIR/src" ] -then +wmakeCheckPwd "$WM_PROJECT_DIR/src" || { echo "Error: Current directory is not \$WM_PROJECT_DIR/src" echo " The environment variables are inconsistent with the installation." echo " Check the OpenFOAM entries in your dot-files and source them." exit 1 -fi +} set -x diff --git a/bin/foamCheckPwd b/wmake/wmakeCheckPwd similarity index 88% rename from bin/foamCheckPwd rename to wmake/wmakeCheckPwd index 1da6f1a84d..48266543fa 100755 --- a/bin/foamCheckPwd +++ b/wmake/wmakeCheckPwd @@ -24,7 +24,7 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # # Script -# foamCheckPwd +# wmakeCheckPwd # # Description # Check that the current working directory is equal to a particular @@ -80,19 +80,24 @@ done dirName="$1" -# trival checks first +# trivial checks first [ "$PWD" = "$dirName" ] && exit 0 -[ -d "$dirName" ] || exit 1 + +[ -d "$dirName" ] || { + [ "$quietOpt" = true ] || echo "Error: Directory does not exist $dirName" + exit 1 +} # use /bin/pwd to get the absolute path (could be linked) thisDir=$(/bin/pwd) -dirName=$(cd $dirName 2>/dev/null && /bin/pwd) +target=$(cd $dirName 2>/dev/null && /bin/pwd) # okay -[ "$thisDir" = "$dirName" ] && exit 0 +[ "$thisDir" = "$target" ] && exit 0 # some other error +[ "$quietOpt" = true ] || echo "Error: Current directory is not $dirName" exit 1 #------------------------------------------------------------------------------ From 77b2fecc7f7bb358007b621141aa50d5b0f6ea31 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Sun, 9 Aug 2009 09:58:00 +0200 Subject: [PATCH 028/454] check for empty word/expression in keyType and wordRe IO --- src/OpenFOAM/primitives/Scalar/Scalar.C | 2 +- src/OpenFOAM/primitives/bools/Switch/SwitchIO.C | 2 +- src/OpenFOAM/primitives/ints/int/intIO.C | 2 +- src/OpenFOAM/primitives/ints/long/longIO.C | 2 +- src/OpenFOAM/primitives/ints/uint/uintIO.C | 2 +- src/OpenFOAM/primitives/ints/ulong/ulongIO.C | 2 +- src/OpenFOAM/primitives/strings/keyType/keyTypeIO.C | 12 +++++++++++- src/OpenFOAM/primitives/strings/string/stringIO.C | 2 +- src/OpenFOAM/primitives/strings/word/wordIO.C | 5 +++-- src/OpenFOAM/primitives/strings/wordRe/wordReIO.C | 12 +++++++++++- 10 files changed, 32 insertions(+), 11 deletions(-) diff --git a/src/OpenFOAM/primitives/Scalar/Scalar.C b/src/OpenFOAM/primitives/Scalar/Scalar.C index cdd94c7b15..4445a52767 100644 --- a/src/OpenFOAM/primitives/Scalar/Scalar.C +++ b/src/OpenFOAM/primitives/Scalar/Scalar.C @@ -84,7 +84,7 @@ Istream& operator>>(Istream& is, Scalar& s) { is.setBad(); FatalIOErrorIn("operator>>(Istream&, Scalar&)", is) - << "wrong token type - expected Scalar found " << t.info() + << "wrong token type - expected Scalar, found " << t.info() << exit(FatalIOError); return is; diff --git a/src/OpenFOAM/primitives/bools/Switch/SwitchIO.C b/src/OpenFOAM/primitives/bools/Switch/SwitchIO.C index d1c43ee858..81757e8952 100644 --- a/src/OpenFOAM/primitives/bools/Switch/SwitchIO.C +++ b/src/OpenFOAM/primitives/bools/Switch/SwitchIO.C @@ -74,7 +74,7 @@ Foam::Istream& Foam::operator>>(Istream& is, Switch& s) { is.setBad(); FatalIOErrorIn("operator>>(Istream&, bool/Switch&)", is) - << "wrong token type - expected bool found " << t + << "wrong token type - expected bool, found " << t << exit(FatalIOError); return is; diff --git a/src/OpenFOAM/primitives/ints/int/intIO.C b/src/OpenFOAM/primitives/ints/int/intIO.C index b7a70228c0..17f4d1a1f6 100644 --- a/src/OpenFOAM/primitives/ints/int/intIO.C +++ b/src/OpenFOAM/primitives/ints/int/intIO.C @@ -67,7 +67,7 @@ Foam::Istream& Foam::operator>>(Istream& is, int& i) { is.setBad(); FatalIOErrorIn("operator>>(Istream&, int&)", is) - << "wrong token type - expected int found " << t.info() + << "wrong token type - expected int, found " << t.info() << exit(FatalIOError); return is; diff --git a/src/OpenFOAM/primitives/ints/long/longIO.C b/src/OpenFOAM/primitives/ints/long/longIO.C index 2b7320164d..7ea56d0e2e 100644 --- a/src/OpenFOAM/primitives/ints/long/longIO.C +++ b/src/OpenFOAM/primitives/ints/long/longIO.C @@ -65,7 +65,7 @@ Foam::Istream& Foam::operator>>(Istream& is, long& l) { is.setBad(); FatalIOErrorIn("operator>>(Istream&, long&)", is) - << "wrong token type - expected long found " << t.info() + << "wrong token type - expected long, found " << t.info() << exit(FatalIOError); return is; diff --git a/src/OpenFOAM/primitives/ints/uint/uintIO.C b/src/OpenFOAM/primitives/ints/uint/uintIO.C index 1d24188c91..7388266f4f 100644 --- a/src/OpenFOAM/primitives/ints/uint/uintIO.C +++ b/src/OpenFOAM/primitives/ints/uint/uintIO.C @@ -66,7 +66,7 @@ Foam::Istream& Foam::operator>>(Istream& is, unsigned int& i) { is.setBad(); FatalIOErrorIn("operator>>(Istream&, unsigned int&)", is) - << "wrong token type - expected unsigned int found " << t.info() + << "wrong token type - expected unsigned int, found " << t.info() << exit(FatalIOError); return is; diff --git a/src/OpenFOAM/primitives/ints/ulong/ulongIO.C b/src/OpenFOAM/primitives/ints/ulong/ulongIO.C index 58d6900e11..63db00c1a1 100644 --- a/src/OpenFOAM/primitives/ints/ulong/ulongIO.C +++ b/src/OpenFOAM/primitives/ints/ulong/ulongIO.C @@ -63,7 +63,7 @@ Foam::Istream& Foam::operator>>(Istream& is, unsigned long& val) { is.setBad(); FatalIOErrorIn("operator>>(Istream&, unsigned long&)", is) - << "wrong token type - expected unsigned long found " << t.info() + << "wrong token type - expected unsigned long, found " << t.info() << exit(FatalIOError); return is; diff --git a/src/OpenFOAM/primitives/strings/keyType/keyTypeIO.C b/src/OpenFOAM/primitives/strings/keyType/keyTypeIO.C index 72859abfc8..0e2f1d1133 100644 --- a/src/OpenFOAM/primitives/strings/keyType/keyTypeIO.C +++ b/src/OpenFOAM/primitives/strings/keyType/keyTypeIO.C @@ -58,12 +58,22 @@ Foam::Istream& Foam::operator>>(Istream& is, keyType& w) { // Assign from string. Sets regular expression. w = t.stringToken(); + + // flag empty strings as an error + if (w.empty()) + { + is.setBad(); + FatalIOErrorIn("operator>>(Istream&, keyType&)", is) + << "empty word/expression " + << exit(FatalIOError); + return is; + } } else { is.setBad(); FatalIOErrorIn("operator>>(Istream&, keyType&)", is) - << "wrong token type - expected word or string found " + << "wrong token type - expected word or string, found " << t.info() << exit(FatalIOError); diff --git a/src/OpenFOAM/primitives/strings/string/stringIO.C b/src/OpenFOAM/primitives/strings/string/stringIO.C index 89694173ae..6cb4791b4a 100644 --- a/src/OpenFOAM/primitives/strings/string/stringIO.C +++ b/src/OpenFOAM/primitives/strings/string/stringIO.C @@ -55,7 +55,7 @@ Foam::Istream& Foam::operator>>(Istream& is, string& s) { is.setBad(); FatalIOErrorIn("operator>>(Istream&, string&)", is) - << "wrong token type - expected string found " << t.info() + << "wrong token type - expected string, found " << t.info() << exit(FatalIOError); return is; diff --git a/src/OpenFOAM/primitives/strings/word/wordIO.C b/src/OpenFOAM/primitives/strings/word/wordIO.C index 093a282846..20a2a216d1 100644 --- a/src/OpenFOAM/primitives/strings/word/wordIO.C +++ b/src/OpenFOAM/primitives/strings/word/wordIO.C @@ -65,7 +65,8 @@ Foam::Istream& Foam::operator>>(Istream& is, word& w) { is.setBad(); FatalIOErrorIn("operator>>(Istream&, word&)", is) - << "wrong token type - expected word found non-word characters " + << "wrong token type - expected word, found " + "non-word characters " << t.info() << exit(FatalIOError); return is; @@ -75,7 +76,7 @@ Foam::Istream& Foam::operator>>(Istream& is, word& w) { is.setBad(); FatalIOErrorIn("operator>>(Istream&, word&)", is) - << "wrong token type - expected word found " + << "wrong token type - expected word, found " << t.info() << exit(FatalIOError); diff --git a/src/OpenFOAM/primitives/strings/wordRe/wordReIO.C b/src/OpenFOAM/primitives/strings/wordRe/wordReIO.C index dab1542b27..c849b4237d 100644 --- a/src/OpenFOAM/primitives/strings/wordRe/wordReIO.C +++ b/src/OpenFOAM/primitives/strings/wordRe/wordReIO.C @@ -57,12 +57,22 @@ Foam::Istream& Foam::operator>>(Istream& is, wordRe& w) { // Auto-tests for regular expression w = t.stringToken(); + + // flag empty strings as an error + if (w.empty()) + { + is.setBad(); + FatalIOErrorIn("operator>>(Istream&, wordRe&)", is) + << "empty word/expression " + << exit(FatalIOError); + return is; + } } else { is.setBad(); FatalIOErrorIn("operator>>(Istream&, wordRe&)", is) - << "wrong token type - expected word or string found " + << "wrong token type - expected word or string, found " << t.info() << exit(FatalIOError); From e905f9b03f9705388dfea9df961f5dfabb7902a9 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Sun, 9 Aug 2009 12:43:45 +0200 Subject: [PATCH 029/454] tokenizing Scalar is more stringent - require a digit somewhere. This traps '.' or '.+E' type of sequences instead of returning them as 0 - avoid buffer overruns on really long sequences - should we be considering strtod() as an alternative to atof() and checking the errno? The same might be true for using strtoul() or strtol() instead of atol() --- src/OpenFOAM/db/IOstreams/Sstreams/ISstream.C | 75 ++++++++++++------- 1 file changed, 47 insertions(+), 28 deletions(-) diff --git a/src/OpenFOAM/db/IOstreams/Sstreams/ISstream.C b/src/OpenFOAM/db/IOstreams/Sstreams/ISstream.C index 482abb8bf3..a05a5e72c4 100644 --- a/src/OpenFOAM/db/IOstreams/Sstreams/ISstream.C +++ b/src/OpenFOAM/db/IOstreams/Sstreams/ISstream.C @@ -102,7 +102,7 @@ char Foam::ISstream::nextValid() Foam::Istream& Foam::ISstream::read(token& t) { - static char numberBuffer[100]; + static char charBuffer[128]; // Return the put back token if it exists if (Istream::getBack(t)) @@ -113,7 +113,7 @@ Foam::Istream& Foam::ISstream::read(token& t) // Assume that the streams supplied are in working order. // Lines are counted by '\n' - // Get next 'valid character': i.e. proceed through any white space + // Get next 'valid character': i.e. proceed through any whitespace // and/or comments until a semantically valid character is hit upon. char c = nextValid(); @@ -144,7 +144,7 @@ Foam::Istream& Foam::ISstream::read(token& t) case token::COMMA : case token::ASSIGN : case token::ADD : - // case token::SUBTRACT : // Handled later as the posible start of a number + // case token::SUBTRACT : // Handled later as the possible start of a number case token::MULTIPLY : case token::DIVIDE : { @@ -152,6 +152,7 @@ Foam::Istream& Foam::ISstream::read(token& t) return *this; } + // Strings: enclosed by double quotes. case token::BEGIN_STRING : { @@ -170,21 +171,24 @@ Foam::Istream& Foam::ISstream::read(token& t) return *this; } + // Numbers: do not distinguish at this point between Types. + // + // we ideally wish to match the equivalent of this regular expression + // + // /^[-+]?([0-9]+\.?[0-9]*|\.[0-9]+)([Ee][-+]?[0-9]+)?$/ + // case '-' : case '.' : case '0' : case '1' : case '2' : case '3' : case '4' : case '5' : case '6' : case '7' : case '8' : case '9' : { - bool isScalar = false; + // has a floating point or digit + bool isScalar = (c == '.'); + bool hasDigit = isdigit(c); - if (c == '.') - { - isScalar = true; - } - - int i=0; - numberBuffer[i++] = c; + unsigned int nChar = 0; + charBuffer[nChar++] = c; while ( @@ -199,14 +203,23 @@ Foam::Istream& Foam::ISstream::read(token& t) ) ) { - numberBuffer[i++] = c; + charBuffer[nChar++] = c; + if (nChar >= sizeof(charBuffer)) + { + nChar--; + break; + } - if (!isdigit(c)) + if (isdigit(c)) + { + hasDigit = true; + } + else { isScalar = true; } } - numberBuffer[i] = '\0'; + charBuffer[nChar] = '\0'; setState(is_.rdstate()); @@ -214,26 +227,31 @@ Foam::Istream& Foam::ISstream::read(token& t) { is_.putback(c); - if (i == 1 && numberBuffer[0] == '-') + if (hasDigit) { - t = token::punctuationToken(token::SUBTRACT); + if (!isScalar) + { + long lt = atol(charBuffer); + t = label(lt); + + // return as a scalar if doesn't fit in a label + isScalar = (t.labelToken() != lt); + } + + if (isScalar) + { + t = scalar(atof(charBuffer)); + } } - else if (isScalar) + else if (nChar == 1 && charBuffer[0] == '-') { - t = scalar(atof(numberBuffer)); + // a single '-' is punctuation + t = token::punctuationToken(token::SUBTRACT); } else { - long lt = atol(numberBuffer); - t = label(lt); - - // If the integer is too large to be represented as a label - // return it as a scalar - if (t.labelToken() != lt) - { - isScalar = true; - t = scalar(atof(numberBuffer)); - } + // some really bad sequence - eg, ".+E" + t.setBad(); } } else @@ -244,6 +262,7 @@ Foam::Istream& Foam::ISstream::read(token& t) return *this; } + // Should be a word (which can be a single character) default: { From 9407443e69a440d5ca10a81b56215c04862b604e Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Sun, 9 Aug 2009 15:43:49 +0200 Subject: [PATCH 030/454] improvments to tokenizing Scalar - for alphanumeric sequences (optionally with [-+.]) that don't look like a float or int -> return as a word This means that '0patch' now looks like a (not