mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' into dsmc
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@ -50,8 +50,8 @@ doc/[Dd]oxygen/html
|
||||
doc/[Dd]oxygen/latex
|
||||
doc/[Dd]oxygen/man
|
||||
|
||||
# Other HTML files e.g. ReleaseNotes-?.?.html
|
||||
*.html
|
||||
# generated files in the main directory (e.g. ReleaseNotes-?.?.html)
|
||||
/*.html
|
||||
|
||||
# source packages - anywhere
|
||||
*.tar.bz2
|
||||
|
||||
9
Allwmake
9
Allwmake
@ -1,13 +1,12 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # run from this directory
|
||||
|
||||
if [ "$PWD" != "$WM_PROJECT_DIR" ]
|
||||
then
|
||||
echo "Error: Current directory in not \$WM_PROJECT_DIR"
|
||||
echo " The environment variable are not consistent with the installation."
|
||||
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 )
|
||||
|
||||
@ -1,13 +1,12 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # run from this directory
|
||||
|
||||
if [ "$PWD" != "$WM_PROJECT_DIR/applications" ]
|
||||
then
|
||||
echo "Error: Current directory in not \$WM_PROJECT_DIR/applications"
|
||||
echo " The environment variable are not consistent with the installation."
|
||||
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
|
||||
|
||||
|
||||
@ -52,7 +52,7 @@ Foam::autoPtr<Foam::PDRDragModel> Foam::PDRDragModel::New
|
||||
) << "Unknown PDRDragModel type "
|
||||
<< PDRDragModelTypeName << endl << endl
|
||||
<< "Valid PDRDragModels are : " << endl
|
||||
<< dictionaryConstructorTablePtr_->toc()
|
||||
<< dictionaryConstructorTablePtr_->sortedToc()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
|
||||
@ -56,7 +56,7 @@ Foam::autoPtr<Foam::XiEqModel> Foam::XiEqModel::New
|
||||
) << "Unknown XiEqModel type "
|
||||
<< XiEqModelTypeName << endl << endl
|
||||
<< "Valid XiEqModels are : " << endl
|
||||
<< dictionaryConstructorTablePtr_->toc()
|
||||
<< dictionaryConstructorTablePtr_->sortedToc()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
|
||||
@ -56,7 +56,7 @@ Foam::autoPtr<Foam::XiGModel> Foam::XiGModel::New
|
||||
) << "Unknown XiGModel type "
|
||||
<< XiGModelTypeName << endl << endl
|
||||
<< "Valid XiGModels are : " << endl
|
||||
<< dictionaryConstructorTablePtr_->toc()
|
||||
<< dictionaryConstructorTablePtr_->sortedToc()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
|
||||
@ -54,7 +54,7 @@ Foam::autoPtr<Foam::XiModel> Foam::XiModel::New
|
||||
) << "Unknown XiModel type "
|
||||
<< XiModelTypeName << endl << endl
|
||||
<< "Valid XiModels are : " << endl
|
||||
<< dictionaryConstructorTablePtr_->toc()
|
||||
<< dictionaryConstructorTablePtr_->sortedToc()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
|
||||
@ -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<scalarField> 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<const fvMesh>
|
||||
(
|
||||
nbrMesh
|
||||
|
||||
@ -26,8 +26,8 @@ Application
|
||||
boundaryFoam
|
||||
|
||||
Description
|
||||
Steady-state solver for 1D turbulent flow, typically to generate boundary
|
||||
layer conditions at an inlet, for use in a simulation.
|
||||
Steady-state solver for incompressible, 1D turbulent flow, typically to
|
||||
generate boundary layer conditions at an inlet, for use in a simulation.
|
||||
|
||||
Boundary layer code to calculate the U, k and epsilon distributions.
|
||||
Used to create inlet boundary conditions for experimental comparisons
|
||||
@ -42,7 +42,6 @@ Description
|
||||
#include "wallFvPatch.H"
|
||||
#include "makeGraph.H"
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
@ -52,6 +51,7 @@ int main(int argc, char *argv[])
|
||||
#include "createTime.H"
|
||||
#include "createMesh.H"
|
||||
#include "createFields.H"
|
||||
#include "interrogateWallPatches.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -74,66 +74,24 @@ int main(int argc, char *argv[])
|
||||
UEqn.solve();
|
||||
|
||||
|
||||
// Correct driving force for a constant mass flow rate
|
||||
|
||||
// Correct driving force for a constant volume flow rate
|
||||
dimensionedVector UbarStar = flowMask & U.weightedAverage(mesh.V());
|
||||
|
||||
U += (Ubar - UbarStar);
|
||||
gradP += (Ubar - UbarStar)/(1.0/UEqn.A())().weightedAverage(mesh.V());
|
||||
|
||||
label id = y.size() - 1;
|
||||
|
||||
scalar wallShearStress =
|
||||
flowDirection & turbulence->R()()[id] & wallNormal;
|
||||
|
||||
scalar yplusWall
|
||||
// = ::sqrt(mag(wallShearStress))*y[id]/laminarTransport.nu()()[id];
|
||||
= ::sqrt(mag(wallShearStress))*y[id]/turbulence->nuEff()()[id];
|
||||
|
||||
Info<< "Uncorrected Ubar = " << (flowDirection & UbarStar.value())<< tab
|
||||
<< "pressure gradient = " << (flowDirection & gradP.value()) << tab
|
||||
<< "min y+ = " << yplusWall << endl;
|
||||
|
||||
|
||||
turbulence->correct();
|
||||
|
||||
Info<< "Uncorrected Ubar = " << (flowDirection & UbarStar.value())
|
||||
<< ", pressure gradient = " << (flowDirection & gradP.value())
|
||||
<< endl;
|
||||
|
||||
#include "evaluateNearWall.H"
|
||||
|
||||
if (runTime.outputTime())
|
||||
{
|
||||
volSymmTensorField R
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"R",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
turbulence->R()
|
||||
);
|
||||
|
||||
runTime.write();
|
||||
|
||||
const word& gFormat = runTime.graphFormat();
|
||||
|
||||
makeGraph(y, flowDirection & U, "Uf", gFormat);
|
||||
|
||||
makeGraph(y, laminarTransport.nu(), gFormat);
|
||||
|
||||
makeGraph(y, turbulence->k(), gFormat);
|
||||
makeGraph(y, turbulence->epsilon(), gFormat);
|
||||
|
||||
//makeGraph(y, flowDirection & R & flowDirection, "Rff", gFormat);
|
||||
//makeGraph(y, wallNormal & R & wallNormal, "Rww", gFormat);
|
||||
//makeGraph(y, flowDirection & R & wallNormal, "Rfw", gFormat);
|
||||
|
||||
//makeGraph(y, sqrt(R.component(tensor::XX)), "u", gFormat);
|
||||
//makeGraph(y, sqrt(R.component(tensor::YY)), "v", gFormat);
|
||||
//makeGraph(y, sqrt(R.component(tensor::ZZ)), "w", gFormat);
|
||||
makeGraph(y, R.component(tensor::XY), "uv", gFormat);
|
||||
|
||||
makeGraph(y, mag(fvc::grad(U)), "gammaDot", gFormat);
|
||||
#include "makeGraphs.H"
|
||||
}
|
||||
|
||||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||
|
||||
@ -49,74 +49,14 @@
|
||||
)
|
||||
);
|
||||
|
||||
dimensionedVector Ubar
|
||||
(
|
||||
transportProperties.lookup("Ubar")
|
||||
);
|
||||
dimensionedVector Ubar(transportProperties.lookup("Ubar"));
|
||||
|
||||
vector flowDirection = (Ubar/mag(Ubar)).value();
|
||||
tensor flowMask = sqr(flowDirection);
|
||||
|
||||
|
||||
// Search for wall patches faces and store normals
|
||||
|
||||
scalar nWallFaces(0);
|
||||
vector wallNormal(vector::zero);
|
||||
|
||||
const fvPatchList& patches = mesh.boundary();
|
||||
|
||||
forAll(patches, patchi)
|
||||
{
|
||||
const fvPatch& currPatch = patches[patchi];
|
||||
|
||||
if (isType<wallFvPatch>(currPatch))
|
||||
{
|
||||
forAll(currPatch, facei)
|
||||
{
|
||||
nWallFaces++;
|
||||
|
||||
if (nWallFaces == 1)
|
||||
{
|
||||
wallNormal =
|
||||
- mesh.Sf().boundaryField()[patchi][facei]
|
||||
/mesh.magSf().boundaryField()[patchi][facei];
|
||||
}
|
||||
else if (nWallFaces == 2)
|
||||
{
|
||||
vector wallNormal2 =
|
||||
mesh.Sf().boundaryField()[patchi][facei]
|
||||
/mesh.magSf().boundaryField()[patchi][facei];
|
||||
|
||||
//- Check that wall faces are parallel
|
||||
if
|
||||
(
|
||||
mag(wallNormal & wallNormal2) > 1.01
|
||||
||mag(wallNormal & wallNormal2) < 0.99
|
||||
)
|
||||
{
|
||||
Info<< "boundaryFoam: wall faces are not parallel"
|
||||
<< endl
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< "boundaryFoam: number of wall faces > 2"
|
||||
<< endl
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//- create position array for graph generation
|
||||
scalarField y = wallNormal & mesh.C().internalField();
|
||||
|
||||
|
||||
dimensionedVector gradP
|
||||
(
|
||||
"gradP",
|
||||
dimensionSet(0, 1, -2, 0, 0),
|
||||
vector(0, 0, 0)
|
||||
vector::zero
|
||||
);
|
||||
|
||||
@ -0,0 +1,34 @@
|
||||
{
|
||||
// Evaluate near-wall behaviour
|
||||
|
||||
scalar nu = turbulence->nu().boundaryField()[patchId][faceId];
|
||||
scalar nut = turbulence->nut()().boundaryField()[patchId][faceId];
|
||||
symmTensor R = turbulence->devReff()().boundaryField()[patchId][faceId];
|
||||
scalar epsilon = turbulence->epsilon()()[cellId];
|
||||
// scalar omega = turbulence->omega()()[cellId];
|
||||
scalar k = turbulence->k()()[cellId];
|
||||
scalar magUp = mag(U[cellId] - U.boundaryField()[patchId][faceId]);
|
||||
|
||||
scalar tauw = flowDirection & R & wallNormal;
|
||||
|
||||
scalar uTau = ::sqrt(mag(tauw));
|
||||
|
||||
scalar yPlus = uTau*y[cellId]/(nu + ROOTVSMALL);
|
||||
|
||||
scalar uPlus = magUp/(uTau + ROOTVSMALL);
|
||||
|
||||
scalar nutPlus = nut/nu;
|
||||
|
||||
scalar kPlus = k/(sqr(uTau) + ROOTVSMALL);
|
||||
|
||||
scalar epsilonPlus = epsilon*nu/(pow4(uTau) + ROOTVSMALL);
|
||||
|
||||
// scalar omegaPlus = omega*nu/(sqr(uTau) + ROOTVSMALL);
|
||||
|
||||
scalar Rey = magUp*y[cellId]/nu;
|
||||
|
||||
Info<< "Rey = " << Rey << ", uTau = " << uTau << ", nut+ = " << nutPlus
|
||||
<< ", y+ = " << yPlus << ", u+ = " << uPlus
|
||||
<< ", k+ = " << kPlus << ", epsilon+ = " << epsilonPlus
|
||||
<< endl;
|
||||
}
|
||||
@ -0,0 +1,74 @@
|
||||
// Search for wall patches faces and store normals
|
||||
|
||||
label faceId(-1);
|
||||
label patchId(-1);
|
||||
label nWallFaces(0);
|
||||
vector wallNormal(vector::zero);
|
||||
|
||||
const fvPatchList& patches = mesh.boundary();
|
||||
|
||||
forAll(patches, patchi)
|
||||
{
|
||||
const fvPatch& currPatch = patches[patchi];
|
||||
|
||||
if (isType<wallFvPatch>(currPatch))
|
||||
{
|
||||
const vectorField nf = currPatch.nf();
|
||||
|
||||
forAll(nf, facei)
|
||||
{
|
||||
nWallFaces++;
|
||||
|
||||
if (nWallFaces == 1)
|
||||
{
|
||||
wallNormal = -nf[facei];
|
||||
faceId = facei;
|
||||
patchId = patchi;
|
||||
}
|
||||
else if (nWallFaces == 2)
|
||||
{
|
||||
const vector wallNormal2 = -nf[facei];
|
||||
|
||||
//- Check that wall faces are parallel
|
||||
if
|
||||
(
|
||||
mag(wallNormal & wallNormal2) > 1.01
|
||||
|| mag(wallNormal & wallNormal2) < 0.99
|
||||
)
|
||||
{
|
||||
FatalErrorIn(args.executable())
|
||||
<< "wall faces are not parallel for patches "
|
||||
<< patches[patchId].name() << " and "
|
||||
<< currPatch.name() << nl
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorIn(args.executable()) << "number of wall faces > 2"
|
||||
<< nl << exit(FatalError);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (nWallFaces == 0)
|
||||
{
|
||||
FatalErrorIn(args.executable()) << "No wall patches identified"
|
||||
<< exit(FatalError);
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< "Generating wall data for patch: " << patches[patchId].name() << endl;
|
||||
}
|
||||
|
||||
// store local id of near-walll cell to process
|
||||
label cellId = patches[patchId].faceCells()[faceId];
|
||||
|
||||
// create position array for graph generation
|
||||
scalarField y =
|
||||
wallNormal
|
||||
& (mesh.C().internalField() - mesh.C().boundaryField()[patchId][faceId]);
|
||||
|
||||
Info<< " Height to first cell centre y0 = " << y[cellId] << endl;
|
||||
|
||||
@ -0,0 +1,33 @@
|
||||
volSymmTensorField R
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"R",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
turbulence->R()
|
||||
);
|
||||
|
||||
runTime.write();
|
||||
|
||||
const word& gFormat = runTime.graphFormat();
|
||||
|
||||
makeGraph(y, flowDirection & U, "Uf", gFormat);
|
||||
|
||||
makeGraph(y, turbulence->nu(), gFormat);
|
||||
makeGraph(y, turbulence->k(), gFormat);
|
||||
makeGraph(y, turbulence->epsilon(), gFormat);
|
||||
|
||||
makeGraph(y, flowDirection & R & flowDirection, "Rff", gFormat);
|
||||
makeGraph(y, wallNormal & R & wallNormal, "Rww", gFormat);
|
||||
makeGraph(y, flowDirection & R & wallNormal, "Rfw", gFormat);
|
||||
|
||||
makeGraph(y, sqrt(mag(R.component(tensor::XX))), "u", gFormat);
|
||||
makeGraph(y, sqrt(mag(R.component(tensor::YY))), "v", gFormat);
|
||||
makeGraph(y, sqrt(mag(R.component(tensor::ZZ))), "w", gFormat);
|
||||
makeGraph(y, R.component(tensor::XY), "uv", gFormat);
|
||||
|
||||
makeGraph(y, mag(fvc::grad(U)), "gammaDot", gFormat);
|
||||
@ -9,6 +9,7 @@ EXE_INC = \
|
||||
|
||||
EXE_LIBS = \
|
||||
-ldynamicFvMesh \
|
||||
-ltopoChangerFvMesh \
|
||||
-ldynamicMesh \
|
||||
-lmeshTools \
|
||||
-lincompressibleTransportModels \
|
||||
|
||||
@ -14,4 +14,3 @@
|
||||
).initialResidual();
|
||||
|
||||
maxResidual = max(eqnResidual, maxResidual);
|
||||
|
||||
|
||||
@ -82,7 +82,7 @@
|
||||
(
|
||||
"kappa",
|
||||
wallFunctionDict,
|
||||
0.4187
|
||||
0.41
|
||||
)
|
||||
);
|
||||
|
||||
@ -92,7 +92,7 @@
|
||||
(
|
||||
"E",
|
||||
wallFunctionDict,
|
||||
9.0
|
||||
9.8
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@ -16,5 +16,6 @@ EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-ldynamicMesh \
|
||||
-lmeshTools \
|
||||
-ldynamicFvMesh
|
||||
-ldynamicFvMesh \
|
||||
-ltopoChangerFvMesh
|
||||
|
||||
|
||||
@ -17,4 +17,5 @@ EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-ldynamicMesh \
|
||||
-lmeshTools \
|
||||
-ldynamicFvMesh
|
||||
-ldynamicFvMesh \
|
||||
-ltopoChangerFvMesh
|
||||
|
||||
@ -70,7 +70,7 @@ Foam::phaseChangeTwoPhaseMixture::New
|
||||
) << "Unknown phaseChangeTwoPhaseMixture type "
|
||||
<< phaseChangeTwoPhaseMixtureTypeName << endl << endl
|
||||
<< "Valid phaseChangeTwoPhaseMixtures are : " << endl
|
||||
<< componentsConstructorTablePtr_->toc()
|
||||
<< componentsConstructorTablePtr_->sortedToc()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
|
||||
@ -56,20 +56,11 @@
|
||||
);
|
||||
|
||||
|
||||
dimensionedScalar rhoc
|
||||
(
|
||||
transportProperties.lookup("rhoc")
|
||||
);
|
||||
dimensionedScalar rhoc(transportProperties.lookup("rhoc"));
|
||||
|
||||
dimensionedScalar rhod
|
||||
(
|
||||
transportProperties.lookup("rhod")
|
||||
);
|
||||
dimensionedScalar rhod(transportProperties.lookup("rhod"));
|
||||
|
||||
dimensionedScalar muc
|
||||
(
|
||||
transportProperties.lookup("muc")
|
||||
);
|
||||
dimensionedScalar muc(transportProperties.lookup("muc"));
|
||||
|
||||
dimensionedScalar plasticViscosityCoeff
|
||||
(
|
||||
@ -96,10 +87,7 @@
|
||||
transportProperties.lookup("yieldStressOffset")
|
||||
);
|
||||
|
||||
Switch BinghamPlastic
|
||||
(
|
||||
transportProperties.lookup("BinghamPlastic")
|
||||
);
|
||||
Switch BinghamPlastic(transportProperties.lookup("BinghamPlastic"));
|
||||
|
||||
volScalarField rho
|
||||
(
|
||||
@ -147,8 +135,8 @@
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
muc +
|
||||
plasticViscosity
|
||||
muc
|
||||
+ plasticViscosity
|
||||
(
|
||||
plasticViscosityCoeff,
|
||||
plasticViscosityExponent,
|
||||
@ -176,10 +164,7 @@
|
||||
|
||||
Info<< "Selecting Drift-Flux model " << endl;
|
||||
|
||||
word VdjModel
|
||||
(
|
||||
transportProperties.lookup("VdjModel")
|
||||
);
|
||||
word VdjModel(transportProperties.lookup("VdjModel"));
|
||||
|
||||
Info<< tab << VdjModel << " selected\n" << endl;
|
||||
|
||||
@ -188,26 +173,13 @@
|
||||
transportProperties.subDict(VdjModel + "Coeffs")
|
||||
);
|
||||
|
||||
dimensionedVector V0
|
||||
(
|
||||
VdjModelCoeffs.lookup("V0")
|
||||
);
|
||||
dimensionedVector V0(VdjModelCoeffs.lookup("V0"));
|
||||
|
||||
dimensionedScalar a
|
||||
(
|
||||
VdjModelCoeffs.lookup("a")
|
||||
);
|
||||
dimensionedScalar a(VdjModelCoeffs.lookup("a"));
|
||||
|
||||
dimensionedScalar a1
|
||||
(
|
||||
VdjModelCoeffs.lookup("a1")
|
||||
);
|
||||
|
||||
dimensionedScalar alphaMin
|
||||
(
|
||||
VdjModelCoeffs.lookup("alphaMin")
|
||||
);
|
||||
dimensionedScalar a1(VdjModelCoeffs.lookup("a1"));
|
||||
|
||||
dimensionedScalar alphaMin(VdjModelCoeffs.lookup("alphaMin"));
|
||||
|
||||
|
||||
IOdictionary RASProperties
|
||||
@ -223,15 +195,9 @@
|
||||
);
|
||||
|
||||
|
||||
Switch turbulence
|
||||
(
|
||||
RASProperties.lookup("turbulence")
|
||||
);
|
||||
Switch turbulence(RASProperties.lookup("turbulence"));
|
||||
|
||||
dictionary kEpsilonDict
|
||||
(
|
||||
RASProperties.subDictPtr("kEpsilonCoeffs")
|
||||
);
|
||||
dictionary kEpsilonDict(RASProperties.subDictPtr("kEpsilonCoeffs"));
|
||||
|
||||
dimensionedScalar Cmu
|
||||
(
|
||||
@ -273,30 +239,27 @@
|
||||
)
|
||||
);
|
||||
|
||||
dimensionedScalar alphak
|
||||
dimensionedScalar sigmak
|
||||
(
|
||||
dimensionedScalar::lookupOrAddToDict
|
||||
(
|
||||
"alphaEps",
|
||||
"sigmak",
|
||||
kEpsilonDict,
|
||||
1.0
|
||||
)
|
||||
);
|
||||
|
||||
dimensionedScalar alphaEps
|
||||
dimensionedScalar sigmaEps
|
||||
(
|
||||
dimensionedScalar::lookupOrAddToDict
|
||||
(
|
||||
"alphaEps",
|
||||
"sigmaEps",
|
||||
kEpsilonDict,
|
||||
0.76923
|
||||
1.3
|
||||
)
|
||||
);
|
||||
|
||||
dictionary wallFunctionDict
|
||||
(
|
||||
RASProperties.subDictPtr("wallFunctionCoeffs")
|
||||
);
|
||||
dictionary wallFunctionDict(RASProperties.subDictPtr("wallFunctionCoeffs"));
|
||||
|
||||
dimensionedScalar kappa
|
||||
(
|
||||
@ -304,7 +267,7 @@
|
||||
(
|
||||
"kappa",
|
||||
wallFunctionDict,
|
||||
0.4187
|
||||
0.41
|
||||
)
|
||||
);
|
||||
|
||||
@ -314,7 +277,7 @@
|
||||
(
|
||||
"E",
|
||||
wallFunctionDict,
|
||||
9.0
|
||||
9.8
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
if(turbulence)
|
||||
if (turbulence)
|
||||
{
|
||||
if (mesh.changing())
|
||||
{
|
||||
@ -15,9 +15,9 @@ if(turbulence)
|
||||
tgradU.clear();
|
||||
|
||||
volScalarField Gcoef =
|
||||
alphak*Cmu*k*(g & fvc::grad(rho))/(epsilon + epsilon0);
|
||||
Cmu*k/sigmak*(g & fvc::grad(rho))/(epsilon + epsilon0);
|
||||
|
||||
# include "wallFunctions.H"
|
||||
#include "wallFunctions.H"
|
||||
|
||||
// Dissipation equation
|
||||
fvScalarMatrix epsEqn
|
||||
@ -26,7 +26,7 @@ if(turbulence)
|
||||
+ fvm::div(phi, epsilon)
|
||||
- fvm::laplacian
|
||||
(
|
||||
alphaEps*mut + mul, epsilon,
|
||||
mut/sigmaEps + mul, epsilon,
|
||||
"laplacian(DepsilonEff,epsilon)"
|
||||
)
|
||||
==
|
||||
@ -35,7 +35,7 @@ if(turbulence)
|
||||
- fvm::Sp(C2*rho*epsilon/k, epsilon)
|
||||
);
|
||||
|
||||
# include "wallDissipation.H"
|
||||
#include "wallDissipation.H"
|
||||
|
||||
epsEqn.relax();
|
||||
epsEqn.solve();
|
||||
@ -51,7 +51,7 @@ if(turbulence)
|
||||
+ fvm::div(phi, k)
|
||||
- fvm::laplacian
|
||||
(
|
||||
alphak*mut + mul, k,
|
||||
mut/sigmak + mul, k,
|
||||
"laplacian(DkEff,k)"
|
||||
)
|
||||
==
|
||||
@ -66,7 +66,7 @@ if(turbulence)
|
||||
//- Re-calculate viscosity
|
||||
mut = rho*Cmu*sqr(k)/(epsilon + epsilon0);
|
||||
|
||||
# include "wallViscosity.H"
|
||||
#include "wallViscosity.H"
|
||||
}
|
||||
|
||||
mu = mut + mul;
|
||||
|
||||
@ -12,6 +12,7 @@
|
||||
- fvm::laplacian(muEff, U)
|
||||
- (fvc::grad(U) & fvc::grad(muEff))
|
||||
//- fvc::div(muEff*(fvc::interpolate(dev(fvc::grad(U))) & mesh.Sf()))
|
||||
//- fvc::div(rho*turbulence->nuEff()*dev(fvc::grad(U)().T()))
|
||||
);
|
||||
|
||||
if (oCorr == nOuterCorr-1)
|
||||
|
||||
@ -57,7 +57,7 @@ Foam::autoPtr<Foam::dragModel> 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);
|
||||
|
||||
@ -49,7 +49,7 @@ Foam::autoPtr<Foam::conductivityModel> 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<conductivityModel>(cstrIter()(dict));
|
||||
|
||||
@ -49,7 +49,7 @@ Foam::autoPtr<Foam::frictionalStressModel> 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<frictionalStressModel>(cstrIter()(dict));
|
||||
|
||||
@ -49,7 +49,7 @@ Foam::autoPtr<Foam::granularPressureModel> 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<granularPressureModel>(cstrIter()(dict));
|
||||
|
||||
@ -49,7 +49,7 @@ Foam::autoPtr<Foam::radialModel> 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<radialModel>(cstrIter()(dict));
|
||||
|
||||
@ -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<viscosityModel>(cstrIter()(dict));
|
||||
|
||||
@ -1,47 +0,0 @@
|
||||
#include "Xstream.H"
|
||||
#include "GLstream.H"
|
||||
#include "PSstream.H"
|
||||
#include "shapes2D.H"
|
||||
#include "IStringStream.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
int main()
|
||||
{
|
||||
colour mauve("mauve", 1, 0, 1);
|
||||
|
||||
lineStyle solid("Solid", 2.0, 2.0, IStringStream("1(1.0)")());
|
||||
lineStyle broken("Broken", 2.0, 10.0, IStringStream("4(1 1 4 1)")());
|
||||
|
||||
|
||||
//Xstream wind
|
||||
GLstream wind
|
||||
//PSstream wind
|
||||
(
|
||||
"GsTest",
|
||||
primary("Black"),
|
||||
primary("White"),
|
||||
0.5, 0.5, 0.5, 0.5, 500, 500
|
||||
);
|
||||
|
||||
do
|
||||
{
|
||||
wind << rectangle2D(point2D(0.0, 0.0), point2D(100.0, 100.0));
|
||||
|
||||
wind.setColour(mauve);
|
||||
wind.setLineStyle(solid);
|
||||
|
||||
wind << line2D(point2D(0.0, 0.0), point2D(0.0, 200.0));
|
||||
wind << line2D(point2D(0.0, 200.0), point2D(200.0, 200.0));
|
||||
|
||||
//wind.setLineStyle(broken);
|
||||
|
||||
wind << line2D(point2D(200.0, 200.0), point2D(200.0, 0.0));
|
||||
wind << line2D(point2D(200.0, 0.0), point2D(0.0, 0.0));
|
||||
|
||||
wind << string2D(point2D(200.0, 0.0), "Hi there");
|
||||
|
||||
} while (wind.waitForEvent());
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -1,3 +0,0 @@
|
||||
GsTest.C
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/GsTest
|
||||
@ -1,2 +0,0 @@
|
||||
EXE_INC = -I$(LIB_SRC)/Gstream/lnInclude
|
||||
EXE_LIBS = -lGstream -lGL $(XLIBS)
|
||||
@ -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<double>, table1, iter)
|
||||
|
||||
@ -43,6 +43,10 @@ int main(int argc, char *argv[])
|
||||
completeList[i] = 0.1*i;
|
||||
}
|
||||
|
||||
Info<< "raw : " << completeList << nl
|
||||
<< endl;
|
||||
|
||||
|
||||
List<label> addresses(5);
|
||||
addresses[0] = 1;
|
||||
addresses[1] = 0;
|
||||
@ -52,14 +56,23 @@ int main(int argc, char *argv[])
|
||||
|
||||
IndirectList<double> idl(completeList, addresses);
|
||||
|
||||
forAll(idl, i)
|
||||
{
|
||||
Info<< idl[i] << token::SPACE;
|
||||
}
|
||||
Info<< "addr: " << idl.addressing() << nl
|
||||
<< "list: " << idl() << nl
|
||||
<< endl;
|
||||
|
||||
Info<< endl;
|
||||
addresses[4] = 1;
|
||||
addresses[3] = 0;
|
||||
addresses[2] = 7;
|
||||
addresses[1] = 8;
|
||||
addresses[0] = 5;
|
||||
|
||||
Info << "\nEnd\n" << endl;
|
||||
idl.resetAddressing(addresses.xfer());
|
||||
|
||||
Info<< "addr: " << idl.addressing() << nl
|
||||
<< "list: " << idl() << nl
|
||||
<< endl;
|
||||
|
||||
Info << "End\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
3
applications/test/ensightFoamReader/Make/files
Normal file
3
applications/test/ensightFoamReader/Make/files
Normal file
@ -0,0 +1,3 @@
|
||||
udr_checker.c
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/ensightFoamReader-udr_checker
|
||||
5
applications/test/ensightFoamReader/Make/options
Normal file
5
applications/test/ensightFoamReader/Make/options
Normal file
@ -0,0 +1,5 @@
|
||||
EXE_INC = \
|
||||
-DUSERD_API_203
|
||||
|
||||
EXE_LIBS = \
|
||||
-luserd-foam
|
||||
116
applications/test/ensightFoamReader/README
Normal file
116
applications/test/ensightFoamReader/README
Normal file
@ -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
|
||||
<toggle flags> Only if your reader implements extra GUI
|
||||
<pulldown flags> one flag value per line
|
||||
<field contents> 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 <playfile>
|
||||
|
||||
And <playfile> 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
|
||||
92
applications/test/ensightFoamReader/ensightFoamReaderTest
Executable file
92
applications/test/ensightFoamReader/ensightFoamReaderTest
Executable file
@ -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<<USAGE
|
||||
|
||||
usage: ${0##*/} [OPTION]
|
||||
options:
|
||||
-case dir specify alternative case directory
|
||||
|
||||
* start ensightFoamReader-udr_checker
|
||||
|
||||
USAGE
|
||||
exit 1
|
||||
}
|
||||
|
||||
# parse options
|
||||
while [ "$#" -gt 0 ]
|
||||
do
|
||||
case "$1" in
|
||||
-h | -help)
|
||||
usage
|
||||
;;
|
||||
-case)
|
||||
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
|
||||
cd "$2" 2>/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
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
1
applications/test/ensightFoamReader/global_extern.h
Symbolic link
1
applications/test/ensightFoamReader/global_extern.h
Symbolic link
@ -0,0 +1 @@
|
||||
../../utilities/postProcessing/graphics/ensightFoamReader/global_extern.h
|
||||
1
applications/test/ensightFoamReader/global_extern_proto.h
Symbolic link
1
applications/test/ensightFoamReader/global_extern_proto.h
Symbolic link
@ -0,0 +1 @@
|
||||
../../utilities/postProcessing/graphics/ensightFoamReader/global_extern_proto.h
|
||||
5396
applications/test/ensightFoamReader/udr_checker-80.c
Normal file
5396
applications/test/ensightFoamReader/udr_checker-80.c
Normal file
File diff suppressed because it is too large
Load Diff
5884
applications/test/ensightFoamReader/udr_checker-82.c
Normal file
5884
applications/test/ensightFoamReader/udr_checker-82.c
Normal file
File diff suppressed because it is too large
Load Diff
1
applications/test/ensightFoamReader/udr_checker.c
Symbolic link
1
applications/test/ensightFoamReader/udr_checker.c
Symbolic link
@ -0,0 +1 @@
|
||||
udr_checker-80.c
|
||||
@ -34,7 +34,7 @@ Description
|
||||
#include "fvMesh.H"
|
||||
#include "volFields.H"
|
||||
#include "Time.H"
|
||||
#include "mapDistribute.H"
|
||||
//#include "mapDistribute.H"
|
||||
#include "OFstream.H"
|
||||
#include "meshTools.H"
|
||||
//#include "FECCellToFaceStencil.H"
|
||||
|
||||
@ -1,229 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Description
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "IStringStream.H"
|
||||
|
||||
#include "myBoundBox.H"
|
||||
#include "myBoundBoxList.H"
|
||||
#include "octree.H"
|
||||
#include "octreeData.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// Main program:
|
||||
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
argList::validOptions.insert("x1", "X1");
|
||||
argList::validOptions.insert("y1", "Y1");
|
||||
argList::validOptions.insert("z1", "Z1");
|
||||
|
||||
argList::validOptions.insert("x2", "X2");
|
||||
argList::validOptions.insert("y2", "Y2");
|
||||
argList::validOptions.insert("z2", "Z2");
|
||||
|
||||
# include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
# include "createMesh.H"
|
||||
|
||||
// Calculate BB of all cells
|
||||
|
||||
|
||||
myBoundBoxList allBb(mesh.nCells());
|
||||
|
||||
const pointField& allPoints = mesh.points();
|
||||
|
||||
vectorField bbMin(mesh.nCells());
|
||||
bbMin = vector(GREAT, GREAT, GREAT);
|
||||
vectorField bbMax(mesh.nCells());
|
||||
bbMax = vector(-GREAT, -GREAT, -GREAT);
|
||||
|
||||
const labelListList& pCells = mesh.pointCells();
|
||||
|
||||
forAll(pCells, pointi)
|
||||
{
|
||||
const point& vertCoord = allPoints[pointi];
|
||||
|
||||
const labelList& cells = pCells[pointi];
|
||||
|
||||
forAll(cells, celli)
|
||||
{
|
||||
label cellNum = cells[celli];
|
||||
|
||||
bbMin[cellNum].x() = min(bbMin[cellNum].x(), vertCoord.x());
|
||||
bbMin[cellNum].y() = min(bbMin[cellNum].y(), vertCoord.y());
|
||||
bbMin[cellNum].z() = min(bbMin[cellNum].z(), vertCoord.z());
|
||||
|
||||
bbMax[cellNum].x() = max(bbMax[cellNum].x(), vertCoord.x());
|
||||
bbMax[cellNum].y() = max(bbMax[cellNum].y(), vertCoord.y());
|
||||
bbMax[cellNum].z() = max(bbMax[cellNum].z(), vertCoord.z());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
forAll(allBb, celli)
|
||||
{
|
||||
allBb[celli] = myBoundBox(bbMin[celli], bbMax[celli]);
|
||||
}
|
||||
|
||||
|
||||
myBoundBox meshBb(allPoints);
|
||||
|
||||
scalar typDim = meshBb.minDim()/111;
|
||||
|
||||
myBoundBox shiftedBb
|
||||
(
|
||||
meshBb.min(),
|
||||
point
|
||||
(
|
||||
meshBb.max().x() + typDim,
|
||||
meshBb.max().y() + typDim,
|
||||
meshBb.max().z() + typDim
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
Info<< "Mesh" << endl;
|
||||
Info<< " bounding box :" << shiftedBb << endl;
|
||||
Info<< " typical dimension:" << shiftedBb.typDim() << endl;
|
||||
|
||||
|
||||
/*
|
||||
* Now we have allBb and shiftedBb
|
||||
*/
|
||||
|
||||
|
||||
|
||||
// Construct table of subset of cells
|
||||
|
||||
labelList cellIndices(10);
|
||||
|
||||
cellIndices[0] = 1433;
|
||||
cellIndices[1] = 1434;
|
||||
cellIndices[2] = 1435;
|
||||
cellIndices[3] = 1436;
|
||||
cellIndices[4] = 1437;
|
||||
cellIndices[5] = 1438;
|
||||
cellIndices[6] = 1439;
|
||||
cellIndices[7] = 1440;
|
||||
cellIndices[8] = 1441;
|
||||
cellIndices[9] = 1442;
|
||||
|
||||
// Get the corresponding bounding boxes
|
||||
|
||||
forAll(cellIndices, i)
|
||||
{
|
||||
allBb[i] = allBb[cellIndices[i]];
|
||||
}
|
||||
allBb.setSize(cellIndices.size());
|
||||
|
||||
|
||||
|
||||
// Wrap indices and mesh information into helper object
|
||||
octreeData shapes(mesh, cellIndices);
|
||||
|
||||
octree oc
|
||||
(
|
||||
shiftedBb, // overall bounding box
|
||||
shapes, // all information needed to do checks on cells
|
||||
allBb, // bounding boxes of cells
|
||||
10.0 // maximum ratio of cubes v.s. cells
|
||||
);
|
||||
|
||||
// scalar x1(readScalar(IStringStream(args.options()["x1"])()));
|
||||
// scalar y1(readScalar(IStringStream(args.options()["y1"])()));
|
||||
// scalar z1(readScalar(IStringStream(args.options()["z1"])()));
|
||||
|
||||
// scalar x2(readScalar(IStringStream(args.options()["x2"])()));
|
||||
// scalar y2(readScalar(IStringStream(args.options()["y2"])()));
|
||||
// scalar z2(readScalar(IStringStream(args.options()["z2"])()));
|
||||
|
||||
|
||||
|
||||
label nFound = 0;
|
||||
|
||||
scalar x = -5.0;
|
||||
for(int i = 0; i < 100; i++)
|
||||
{
|
||||
scalar y = -7.0;
|
||||
for(int j = 0; j < 10; j++)
|
||||
{
|
||||
scalar z = -12.0;
|
||||
for (int k = 0; k < 10; k++)
|
||||
{
|
||||
point sample(x, y, z);
|
||||
|
||||
label index = oc.find(sample);
|
||||
|
||||
// Convert index into shapes back into cellindex.
|
||||
label cell;
|
||||
if (index != -1)
|
||||
{
|
||||
cell = cellIndices[index];
|
||||
}
|
||||
else
|
||||
{
|
||||
cell = -1;
|
||||
}
|
||||
Info<< "Point:" << sample
|
||||
<< " is in cell " << cell << "(octree) "
|
||||
<< mesh.findCell(sample) << "(linear)"
|
||||
<< endl;
|
||||
|
||||
z += 1.2;
|
||||
}
|
||||
y += 0.9;
|
||||
}
|
||||
x += 0.1;
|
||||
}
|
||||
|
||||
|
||||
Info<< "nFound=" << nFound << endl;
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
|
||||
Info<< "Statistics:" << endl
|
||||
<< " nCells :" << allBb.size() << endl
|
||||
<< " nNodes :" << oc.nNodes() << endl
|
||||
<< " nLeaves :" << oc.nLeaves() << endl
|
||||
<< " nEntries :" << oc.nEntries() << endl
|
||||
<< " Cells per leaf :"
|
||||
<< oc.nEntries()/oc.nLeaves()
|
||||
<< endl
|
||||
<< " Every cell in :"
|
||||
<< oc.nEntries()/allBb.size() << " cubes"
|
||||
<< endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
3
applications/test/fvSolutionCombine/Make/files
Normal file
3
applications/test/fvSolutionCombine/Make/files
Normal file
@ -0,0 +1,3 @@
|
||||
fvSolutionCombine.C
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/fvSolutionCombine
|
||||
5
applications/test/fvSolutionCombine/Make/options
Normal file
5
applications/test/fvSolutionCombine/Make/options
Normal file
@ -0,0 +1,5 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume
|
||||
229
applications/test/fvSolutionCombine/fvSolutionCombine.C
Normal file
229
applications/test/fvSolutionCombine/fvSolutionCombine.C
Normal file
@ -0,0 +1,229 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Application
|
||||
fvSolutionCombine
|
||||
|
||||
Description
|
||||
Simple utility for combining fvSolution solution entries.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "argList.H"
|
||||
#include "Time.H"
|
||||
#include "wordRe.H"
|
||||
#include "OSspecific.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
// check for identical dictionary content, regardless of the order
|
||||
bool checkDictionaryContent(const dictionary& dict1, const dictionary& dict2)
|
||||
{
|
||||
// trivial cases first
|
||||
if (&dict1 == &dict2)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if (dict1.size() != dict2.size())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
forAllConstIter(dictionary, dict1, iter1)
|
||||
{
|
||||
const entry* entryPtr = dict2.lookupEntryPtr
|
||||
(
|
||||
iter1().keyword(),
|
||||
false,
|
||||
false
|
||||
);
|
||||
|
||||
if (!entryPtr)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
const entry& entry1 = iter1();
|
||||
const entry& entry2 = *entryPtr;
|
||||
|
||||
bool ok = false;
|
||||
if (entry1.isDict())
|
||||
{
|
||||
if (entry2.isDict())
|
||||
{
|
||||
ok = checkDictionaryContent(entry1.dict(), entry2.dict());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ok = (entry1 == entry2);
|
||||
}
|
||||
|
||||
|
||||
if (!ok)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// Main program:
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
argList::noParallel();
|
||||
argList::validOptions.insert("rewrite", "");
|
||||
argList::validOptions.insert("show", "");
|
||||
argList args(argc, argv);
|
||||
|
||||
Time runTime(args.rootPath(), args.caseName());
|
||||
|
||||
const word dictName("fvSolution");
|
||||
|
||||
bool optRewrite = args.optionFound("rewrite");
|
||||
bool optShow = args.optionFound("show");
|
||||
|
||||
IOdictionary solutionDict
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
dictName,
|
||||
"system",
|
||||
runTime,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
)
|
||||
);
|
||||
|
||||
if (!solutionDict.found("solvers"))
|
||||
{
|
||||
Info<<"no solvers entry found in : " << dictName << endl;
|
||||
return 2;
|
||||
}
|
||||
|
||||
if (optRewrite && solutionDict.instance() != "system")
|
||||
{
|
||||
Info<<"instance is not 'system' "
|
||||
"- disabling rewrite for this file" << nl;
|
||||
optRewrite = false;
|
||||
}
|
||||
|
||||
dictionary& solverDict = solutionDict.subDict("solvers");
|
||||
|
||||
wordList names = solverDict.toc();
|
||||
wordList oldNames = names;
|
||||
|
||||
bool changed = false;
|
||||
for (label orig = 0; orig < names.size()-1; ++orig)
|
||||
{
|
||||
// skip patterns or entries that have already been done
|
||||
if (names[orig].empty() || wordRe::isPattern(names[orig]))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
const dictionary& dict1 = solverDict.subDict(names[orig]);
|
||||
|
||||
for (label check = orig+1; check < names.size(); ++check)
|
||||
{
|
||||
// skip patterns or entries that have already been done
|
||||
if (names[check].empty() || wordRe::isPattern(names[check]))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
const dictionary& dict2 = solverDict.subDict(names[check]);
|
||||
|
||||
// check for identical content
|
||||
if (checkDictionaryContent(dict1, dict2))
|
||||
{
|
||||
names[orig] += "|" + names[check];
|
||||
names[check].clear();
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (changed)
|
||||
{
|
||||
forAll(names, nameI)
|
||||
{
|
||||
if (names[nameI].empty())
|
||||
{
|
||||
solverDict.remove(oldNames[nameI]);
|
||||
Info<<" #remove " << oldNames[nameI];
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< " " << oldNames[nameI];
|
||||
|
||||
if (names[nameI] != oldNames[nameI])
|
||||
{
|
||||
// make "(abc|def)" pattern
|
||||
keyType renamed( "(" + names[nameI] + ")", true);
|
||||
|
||||
solverDict.changeKeyword(oldNames[nameI], renamed);
|
||||
|
||||
Info<< " -> " << renamed;
|
||||
}
|
||||
}
|
||||
Info<< endl;
|
||||
}
|
||||
|
||||
if (optRewrite)
|
||||
{
|
||||
mvBak(solutionDict.objectPath(), "orig");
|
||||
Info<< "Backup to .orig" << nl
|
||||
<< "Writing " << solutionDict.objectPath() << nl << endl;
|
||||
|
||||
solutionDict.regIOobject::write();
|
||||
}
|
||||
else if (optShow)
|
||||
{
|
||||
IOobject::writeDivider(Info);
|
||||
solutionDict.dictionary::write(Info, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< "\nFile not rewritten" << endl;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< "no changes" << endl;
|
||||
}
|
||||
|
||||
Info<< "Done\n" << endl;
|
||||
|
||||
return changed ? 0 : 1;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -23,19 +23,23 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Application
|
||||
icoFoam
|
||||
parallelTest
|
||||
|
||||
Description
|
||||
Incompressible laminar CFD code.
|
||||
Test for various parallel routines.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "List.H"
|
||||
#include "mapDistribute.H"
|
||||
#include "argList.H"
|
||||
#include "Time.H"
|
||||
#include "IPstream.H"
|
||||
#include "OPstream.H"
|
||||
#include "vector.H"
|
||||
#include "IOstreams.H"
|
||||
#include "Random.H"
|
||||
#include "Tuple2.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
@ -47,6 +51,99 @@ int main(int argc, char *argv[])
|
||||
# include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
|
||||
|
||||
// Test mapDistribute
|
||||
// ~~~~~~~~~~~~~~~~~~
|
||||
|
||||
if (false)
|
||||
{
|
||||
Random rndGen(43544*Pstream::myProcNo());
|
||||
|
||||
// Generate random data.
|
||||
List<Tuple2<label, List<scalar> > > complexData(100);
|
||||
forAll(complexData, i)
|
||||
{
|
||||
complexData[i].first() = rndGen.integer(0, Pstream::nProcs()-1);
|
||||
complexData[i].second().setSize(3);
|
||||
complexData[i].second()[0] = 1;
|
||||
complexData[i].second()[1] = 2;
|
||||
complexData[i].second()[2] = 3;
|
||||
}
|
||||
|
||||
// Send all ones to processor indicated by .first()
|
||||
|
||||
|
||||
// Count how many to send
|
||||
labelList nSend(Pstream::nProcs(), 0);
|
||||
forAll(complexData, i)
|
||||
{
|
||||
label procI = complexData[i].first();
|
||||
nSend[procI]++;
|
||||
}
|
||||
|
||||
// Sync how many to send
|
||||
labelListList allNTrans(Pstream::nProcs());
|
||||
allNTrans[Pstream::myProcNo()] = nSend;
|
||||
combineReduce(allNTrans, mapDistribute::listEq());
|
||||
|
||||
// Collect items to be sent
|
||||
labelListList sendMap(Pstream::nProcs());
|
||||
forAll(sendMap, procI)
|
||||
{
|
||||
sendMap[procI].setSize(nSend[procI]);
|
||||
}
|
||||
nSend = 0;
|
||||
forAll(complexData, i)
|
||||
{
|
||||
label procI = complexData[i].first();
|
||||
sendMap[procI][nSend[procI]++] = i;
|
||||
}
|
||||
|
||||
// Collect items to be received
|
||||
labelListList recvMap(Pstream::nProcs());
|
||||
forAll(recvMap, procI)
|
||||
{
|
||||
recvMap[procI].setSize(allNTrans[procI][Pstream::myProcNo()]);
|
||||
}
|
||||
|
||||
label constructSize = 0;
|
||||
// Construct with my own elements first
|
||||
forAll(recvMap[Pstream::myProcNo()], i)
|
||||
{
|
||||
recvMap[Pstream::myProcNo()][i] = constructSize++;
|
||||
}
|
||||
// Construct from other processors
|
||||
forAll(recvMap, procI)
|
||||
{
|
||||
if (procI != Pstream::myProcNo())
|
||||
{
|
||||
forAll(recvMap[procI], i)
|
||||
{
|
||||
recvMap[procI][i] = constructSize++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Construct distribute map (destructively)
|
||||
mapDistribute map(constructSize, sendMap.xfer(), recvMap.xfer());
|
||||
|
||||
// Distribute complexData
|
||||
mapDistribute::distribute
|
||||
(
|
||||
Pstream::nonBlocking,
|
||||
List<labelPair>(),
|
||||
map.constructSize(),
|
||||
map.subMap(),
|
||||
map.constructMap(),
|
||||
complexData
|
||||
);
|
||||
|
||||
Pout<< "complexData:" << complexData << endl;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Perr<< "\nStarting transfers\n" << endl;
|
||||
@ -60,13 +157,13 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
Perr<< "slave sending to master "
|
||||
<< Pstream::masterNo() << endl;
|
||||
OPstream toMaster(Pstream::masterNo());
|
||||
OPstream toMaster(Pstream::blocking, Pstream::masterNo());
|
||||
toMaster << data;
|
||||
}
|
||||
|
||||
Perr<< "slave receiving from master "
|
||||
<< Pstream::masterNo() << endl;
|
||||
IPstream fromMaster(Pstream::masterNo());
|
||||
IPstream fromMaster(Pstream::blocking, Pstream::masterNo());
|
||||
fromMaster >> data;
|
||||
|
||||
Perr<< data << endl;
|
||||
@ -81,7 +178,7 @@ int main(int argc, char *argv[])
|
||||
)
|
||||
{
|
||||
Perr << "master receiving from slave " << slave << endl;
|
||||
IPstream fromSlave(slave);
|
||||
IPstream fromSlave(Pstream::blocking, slave);
|
||||
fromSlave >> data;
|
||||
|
||||
Perr<< data << endl;
|
||||
@ -95,7 +192,7 @@ int main(int argc, char *argv[])
|
||||
)
|
||||
{
|
||||
Perr << "master sending to slave " << slave << endl;
|
||||
OPstream toSlave(slave);
|
||||
OPstream toSlave(Pstream::blocking, slave);
|
||||
toSlave << data;
|
||||
}
|
||||
}
|
||||
|
||||
4
applications/test/passiveParticle/Make/files
Normal file
4
applications/test/passiveParticle/Make/files
Normal file
@ -0,0 +1,4 @@
|
||||
|
||||
passiveParticleTest.C
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/passiveParticleTest
|
||||
8
applications/test/passiveParticle/Make/options
Normal file
8
applications/test/passiveParticle/Make/options
Normal file
@ -0,0 +1,8 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools \
|
||||
-llagrangian
|
||||
105
applications/test/passiveParticle/passiveParticleTest.C
Normal file
105
applications/test/passiveParticle/passiveParticleTest.C
Normal file
@ -0,0 +1,105 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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
|
||||
|
||||
Application
|
||||
testPassiveParticle
|
||||
|
||||
Description
|
||||
Test cloud of passive particles.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "passiveParticleCloud.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
argList::validArgs.append("cloudName");
|
||||
#include "setRootCase.H"
|
||||
#include "createTime.H"
|
||||
#include "createMesh.H"
|
||||
runTime.functionObjects().off();
|
||||
|
||||
const word cloudName(args.additionalArgs()[0]);
|
||||
|
||||
{
|
||||
// Start with empty cloud
|
||||
passiveParticleCloud particles
|
||||
(
|
||||
mesh,
|
||||
cloudName,
|
||||
IDLList<passiveParticle>()
|
||||
);
|
||||
Pout<< "Starting particles:" << particles.size() << endl;
|
||||
|
||||
Pout<< "Adding a particle." << endl;
|
||||
particles.addParticle(new passiveParticle(particles, vector::zero, -1));
|
||||
|
||||
forAllConstIter(passiveParticleCloud, particles, iter)
|
||||
{
|
||||
Pout<< " " << iter().position() << " cell:" << iter().cell()
|
||||
<< " origProc:" << iter().origProc()
|
||||
<< " origId:" << iter().origId()
|
||||
<< endl;
|
||||
}
|
||||
|
||||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||
<< nl << endl;
|
||||
|
||||
runTime++;
|
||||
Pout<< "Writing particles to time " << runTime.timeName() << endl;
|
||||
particles.write();
|
||||
}
|
||||
|
||||
{
|
||||
Pout<< "Rereading particles from time " << runTime.timeName()
|
||||
<< endl;
|
||||
passiveParticleCloud particles(mesh, cloudName);
|
||||
Pout<< "Reread particles:" << particles.size() << endl;
|
||||
|
||||
forAllConstIter(passiveParticleCloud, particles, iter)
|
||||
{
|
||||
Pout<< " " << iter().position() << " cell:" << iter().cell()
|
||||
<< " origProc:" << iter().origProc()
|
||||
<< " origId:" << iter().origId()
|
||||
<< endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||
<< nl << endl;
|
||||
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
3
applications/test/tokenizeTest/Make/files
Normal file
3
applications/test/tokenizeTest/Make/files
Normal file
@ -0,0 +1,3 @@
|
||||
tokenizeTest.C
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/tokenizeTest
|
||||
7
applications/test/tokenizeTest/Make/options
Normal file
7
applications/test/tokenizeTest/Make/options
Normal file
@ -0,0 +1,7 @@
|
||||
/*
|
||||
check for consistent behaviour with non-optimized code
|
||||
*/
|
||||
|
||||
EXE_INC = \
|
||||
-DFULLDEBUG -g -O0
|
||||
|
||||
123
applications/test/tokenizeTest/tokenizeTest.C
Normal file
123
applications/test/tokenizeTest/tokenizeTest.C
Normal file
@ -0,0 +1,123 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Application
|
||||
|
||||
Description
|
||||
Test the tokenizing of various things
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "argList.H"
|
||||
#include "IOobject.H"
|
||||
#include "IOstreams.H"
|
||||
#include "IFstream.H"
|
||||
#include "IStringStream.H"
|
||||
#include "cpuTime.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// Main program:
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
argList::noParallel();
|
||||
argList::validArgs.insert("string .. stringN");
|
||||
argList::validOptions.insert("file", "name");
|
||||
argList::validOptions.insert("repeat", "count");
|
||||
|
||||
argList args(argc, argv, false, true);
|
||||
|
||||
label repeat = 1;
|
||||
args.optionReadIfPresent<label>("repeat", repeat);
|
||||
|
||||
cpuTime timer;
|
||||
|
||||
for (label count = 0; count < repeat; ++count)
|
||||
{
|
||||
forAll(args.additionalArgs(), argI)
|
||||
{
|
||||
const string& rawArg = args.additionalArgs()[argI];
|
||||
if (count == 0)
|
||||
{
|
||||
Info<< "input string: " << rawArg << nl;
|
||||
}
|
||||
|
||||
IStringStream is(rawArg);
|
||||
|
||||
while (is.good())
|
||||
{
|
||||
token tok(is);
|
||||
if (count == 0)
|
||||
{
|
||||
Info<< "token: " << tok.info() << endl;
|
||||
}
|
||||
}
|
||||
|
||||
if (count == 0)
|
||||
{
|
||||
Info<< nl;
|
||||
IOobject::writeDivider(Info);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Info<< "tokenized args " << repeat << " times in "
|
||||
<< timer.cpuTimeIncrement() << " s\n\n";
|
||||
|
||||
if (args.optionFound("file"))
|
||||
{
|
||||
for (label count = 0; count < repeat; ++count)
|
||||
{
|
||||
IFstream is(args.option("file"));
|
||||
|
||||
if (count == 0)
|
||||
{
|
||||
Info<< "tokenizing file: " << args.option("file") << nl;
|
||||
}
|
||||
|
||||
while (is.good())
|
||||
{
|
||||
token tok(is);
|
||||
if (count == 0)
|
||||
{
|
||||
Info<< "token: " << tok.info() << endl;
|
||||
}
|
||||
}
|
||||
|
||||
if (count == 0)
|
||||
{
|
||||
Info<< nl;
|
||||
IOobject::writeDivider(Info);
|
||||
}
|
||||
}
|
||||
|
||||
Info<< "tokenized file " << repeat << " times in "
|
||||
<< timer.cpuTimeIncrement() << " s\n\n";
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -7,4 +7,5 @@ EXE_INC = \
|
||||
EXE_LIBS = \
|
||||
-ldynamicMesh \
|
||||
-lmeshTools \
|
||||
-lfiniteVolume
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields
|
||||
|
||||
@ -6,4 +6,5 @@ EXE_INC = \
|
||||
EXE_LIBS = \
|
||||
-lmeshTools \
|
||||
-ldynamicMesh \
|
||||
-lfiniteVolume
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields
|
||||
|
||||
@ -908,10 +908,10 @@ int main(int argc, char *argv[])
|
||||
runTime.constant(),
|
||||
runTime
|
||||
),
|
||||
foamPoints,
|
||||
foamFaces,
|
||||
foamOwner,
|
||||
foamNeighbour
|
||||
xferMove<pointField>(foamPoints),
|
||||
xferMove<faceList>(foamFaces),
|
||||
xferCopy<labelList>(foamOwner),
|
||||
xferMove<labelList>(foamNeighbour)
|
||||
);
|
||||
|
||||
// Create patches. Use patch types to determine what Foam types to generate.
|
||||
|
||||
@ -5,5 +5,6 @@ EXE_INC = \
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields \
|
||||
-ldynamicMesh \
|
||||
-lmeshTools
|
||||
|
||||
@ -30,7 +30,7 @@ License
|
||||
|
||||
Foam::labelList Foam::blockMesh::createMergeList()
|
||||
{
|
||||
Info<< nl << "Creating merge list " << flush;
|
||||
Info<< nl << "Creating merge list" << flush;
|
||||
|
||||
labelList MergeList(nPoints_, -1);
|
||||
|
||||
|
||||
@ -107,7 +107,7 @@ autoPtr<curvedEdge> 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);
|
||||
}
|
||||
|
||||
|
||||
@ -47,7 +47,7 @@ Foam::autoPtr<Foam::extrudeModel> Foam::extrudeModel::New
|
||||
<< extrudeModelType
|
||||
<< ", constructor not in hash table" << nl << nl
|
||||
<< " Valid extrudeModel types are :" << nl
|
||||
<< dictionaryConstructorTablePtr_->toc() << nl
|
||||
<< dictionaryConstructorTablePtr_->sortedToc() << nl
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -6,4 +6,5 @@ EXE_INC = \
|
||||
EXE_LIBS = \
|
||||
-ldynamicMesh \
|
||||
-lmeshTools \
|
||||
-lfiniteVolume
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields
|
||||
|
||||
@ -53,18 +53,18 @@ patches
|
||||
name sidePatches;
|
||||
|
||||
// Type of new patch
|
||||
dictionary
|
||||
{
|
||||
dictionary
|
||||
{
|
||||
type cyclic;
|
||||
|
||||
// Optional: explicitly set transformation tensor.
|
||||
// Optional: explicitly set transformation tensor.
|
||||
// Used when matching and synchronising points.
|
||||
//transform translational;
|
||||
//separationVector (-2289 0 0);
|
||||
transform rotational;
|
||||
rotationAxis (1 0 0);
|
||||
transform rotational;
|
||||
rotationAxis (1 0 0);
|
||||
rotationCentre (0 0 0);
|
||||
}
|
||||
}
|
||||
|
||||
// How to construct: either from 'patches' or 'set'
|
||||
constructFrom patches;
|
||||
@ -80,10 +80,10 @@ patches
|
||||
name bottom;
|
||||
|
||||
// Type of new patch
|
||||
dictionary
|
||||
{
|
||||
dictionary
|
||||
{
|
||||
type wall;
|
||||
}
|
||||
}
|
||||
|
||||
constructFrom set;
|
||||
|
||||
|
||||
@ -5,5 +5,6 @@ EXE_INC = \
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields \
|
||||
-lmeshTools \
|
||||
-ldynamicMesh
|
||||
|
||||
@ -8,4 +8,5 @@ EXE_LIBS = \
|
||||
-lmeshTools \
|
||||
-ldynamicMesh \
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields \
|
||||
-ldecompositionMethods
|
||||
|
||||
@ -5,5 +5,6 @@ EXE_INC = \
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields \
|
||||
-ldynamicMesh \
|
||||
-lmeshTools
|
||||
|
||||
@ -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
|
||||
|
||||
@ -105,6 +105,8 @@ int main(int argc, char *argv[])
|
||||
|
||||
Foam::argList::validOptions.insert("overwrite", "");
|
||||
|
||||
Foam::argList::validOptions.insert("toleranceDict", "file with tolerances");
|
||||
|
||||
# include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
runTime.functionObjects().off();
|
||||
@ -168,6 +170,22 @@ int main(int argc, char *argv[])
|
||||
<< "If this is not the case use the -partial option" << nl << endl;
|
||||
}
|
||||
|
||||
// set up the tolerances for the sliding mesh
|
||||
dictionary slidingTolerances;
|
||||
if (args.options().found("toleranceDict"))
|
||||
{
|
||||
IOdictionary toleranceFile(
|
||||
IOobject(
|
||||
args.options()["toleranceDict"],
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
);
|
||||
slidingTolerances += toleranceFile;
|
||||
}
|
||||
|
||||
// Check for non-empty master and slave patches
|
||||
checkPatch(mesh.boundaryMesh(), masterPatchName);
|
||||
checkPatch(mesh.boundaryMesh(), slavePatchName);
|
||||
@ -320,6 +338,11 @@ int main(int argc, char *argv[])
|
||||
true // couple/decouple mode
|
||||
)
|
||||
);
|
||||
static_cast<slidingInterface&>(stitcher[0]).setTolerances
|
||||
(
|
||||
slidingTolerances,
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -2,4 +2,5 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields
|
||||
|
||||
@ -33,6 +33,7 @@ Description
|
||||
|
||||
#include "argList.H"
|
||||
#include "IFstream.H"
|
||||
#include "IOobject.H"
|
||||
#include "dictionary.H"
|
||||
|
||||
using namespace Foam;
|
||||
@ -42,13 +43,19 @@ using namespace Foam;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
argList::noBanner();
|
||||
argList::noParallel();
|
||||
argList::validArgs.clear();
|
||||
argList::validArgs.append("inputDict");
|
||||
argList args(argc, argv);
|
||||
|
||||
IFstream dictStream(args.additionalArgs()[0]);
|
||||
dictionary inputDict(dictStream);
|
||||
Info<< inputDict << endl;
|
||||
const string& dictName = args.additionalArgs()[0];
|
||||
|
||||
Info<<"//\n// expansion of dictionary " << dictName << "\n//\n";
|
||||
|
||||
dictionary(IFstream(dictName)()).write(Info, false);
|
||||
|
||||
IOobject::writeDivider(Info);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -6,5 +6,5 @@ EXE_INC = \
|
||||
EXE_LIBS = \
|
||||
-lmeshTools \
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields \
|
||||
-llagrangian
|
||||
|
||||
|
||||
@ -2,4 +2,5 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields
|
||||
|
||||
@ -6,6 +6,7 @@ EXE_INC = \
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields \
|
||||
-ldecompositionMethods \
|
||||
-llagrangian \
|
||||
-lmeshTools
|
||||
|
||||
@ -4,5 +4,6 @@ EXE_INC = \
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields \
|
||||
-llagrangian \
|
||||
-lmeshTools
|
||||
|
||||
@ -2,4 +2,5 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields
|
||||
|
||||
@ -1,65 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Description
|
||||
writeFluentFields
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "error.H"
|
||||
|
||||
#include "writeFluentFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
#define volTypeField volScalarField
|
||||
#define TypeField scalarField
|
||||
#define nTypeComponents 1
|
||||
|
||||
#include "writeFluentTypeField.C"
|
||||
|
||||
#undef nTypeComponents
|
||||
#undef TypeField
|
||||
#undef volTypeField
|
||||
|
||||
|
||||
#define volTypeField volVectorField
|
||||
#define TypeField vectorField
|
||||
#define nTypeComponents 3
|
||||
|
||||
#include "writeFluentTypeField.C"
|
||||
|
||||
#undef nTypeComponents
|
||||
#undef TypeField
|
||||
#undef volTypeField
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -4,4 +4,5 @@ EXE_INC = \
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields \
|
||||
-lfoamCalcFunctions
|
||||
|
||||
@ -12,6 +12,7 @@ EXE_INC = \
|
||||
|
||||
LIB_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields \
|
||||
-llagrangian \
|
||||
-lmeshTools \
|
||||
$(GLIBS)
|
||||
|
||||
@ -5,4 +5,5 @@ EXE_INC = \
|
||||
|
||||
LIB_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields \
|
||||
$(GLIBS)
|
||||
|
||||
@ -7,5 +7,6 @@ EXE_INC = \
|
||||
LIB_LIBS = \
|
||||
-lOpenFOAM \
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields \
|
||||
-llagrangian \
|
||||
$(PROJECT_LIBS)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,2 @@
|
||||
#define DO_READER
|
||||
#define USERD_API_203
|
||||
@ -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;
|
||||
}
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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*/
|
||||
|
||||
|
||||
@ -21,6 +21,8 @@
|
||||
#ifndef GLOBAL_EXTERN_PROTO_H
|
||||
#define GLOBAL_EXTERN_PROTO_H
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#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*/
|
||||
|
||||
|
||||
@ -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
|
||||
//======================================================================
|
||||
//**********************************************************************
|
||||
|
||||
|
||||
@ -99,4 +99,5 @@ EXE_INC = \
|
||||
EXE_LIBS = \
|
||||
$(FV_LIBS) \
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields \
|
||||
-lmeshTools
|
||||
|
||||
@ -4,4 +4,5 @@ EXE_INC = \
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields \
|
||||
-llagrangian
|
||||
|
||||
@ -15,4 +15,5 @@ EXE_LIBS = \
|
||||
-lspecie \
|
||||
-lcompressibleRASModels \
|
||||
-lcompressibleLESModels \
|
||||
-lfiniteVolume
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields
|
||||
|
||||
@ -6,4 +6,5 @@ EXE_INC = \
|
||||
EXE_LIBS = \
|
||||
-lmeshTools \
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields \
|
||||
-lsampling
|
||||
|
||||
@ -2,4 +2,5 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields
|
||||
|
||||
@ -2,4 +2,5 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields
|
||||
|
||||
@ -2,4 +2,5 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user