mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' into lagrangianDev
This commit is contained in:
@ -32,7 +32,5 @@ if (dieselSpray.twoD())
|
|||||||
gasMass0 *= 2.0*mathematicalConstant::pi/dieselSpray.angleOfWedge();
|
gasMass0 *= 2.0*mathematicalConstant::pi/dieselSpray.angleOfWedge();
|
||||||
}
|
}
|
||||||
|
|
||||||
reduce(gasMass0, sumOp<scalar>());
|
|
||||||
|
|
||||||
gasMass0 -=
|
gasMass0 -=
|
||||||
dieselSpray.injectedMass(runTime.value()) - dieselSpray.liquidMass();
|
dieselSpray.injectedMass(runTime.value()) - dieselSpray.liquidMass();
|
||||||
|
|||||||
@ -23,8 +23,6 @@
|
|||||||
gasMass *= 2.0*mathematicalConstant::pi/dieselSpray.angleOfWedge();
|
gasMass *= 2.0*mathematicalConstant::pi/dieselSpray.angleOfWedge();
|
||||||
}
|
}
|
||||||
|
|
||||||
reduce(gasMass, sumOp<scalar>());
|
|
||||||
|
|
||||||
scalar addedMass = gasMass - gasMass0;
|
scalar addedMass = gasMass - gasMass0;
|
||||||
|
|
||||||
Info<< "Added gas mass................. | " << 1e6*addedMass << " mg"
|
Info<< "Added gas mass................. | " << 1e6*addedMass << " mg"
|
||||||
|
|||||||
3
applications/solvers/discreteMethods/dsmc/dsmcFoam/Make/files
Executable file
3
applications/solvers/discreteMethods/dsmc/dsmcFoam/Make/files
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
dsmcFoam.C
|
||||||
|
|
||||||
|
EXE = $(FOAM_APPBIN)/dsmcFoam
|
||||||
12
applications/solvers/discreteMethods/dsmc/dsmcFoam/Make/options
Executable file
12
applications/solvers/discreteMethods/dsmc/dsmcFoam/Make/options
Executable file
@ -0,0 +1,12 @@
|
|||||||
|
EXE_INC = \
|
||||||
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
|
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||||
|
-I$(LIB_SRC)/lagrangian/dsmc/lnInclude \
|
||||||
|
-I$(LIB_SRC)/meshTools/lnInclude
|
||||||
|
|
||||||
|
EXE_LIBS = \
|
||||||
|
-lmeshTools \
|
||||||
|
-lfiniteVolume \
|
||||||
|
-llagrangian \
|
||||||
|
-ldsmc
|
||||||
|
|
||||||
@ -0,0 +1,162 @@
|
|||||||
|
|
||||||
|
Info<< nl << "Reading field boundaryT" << endl;
|
||||||
|
volScalarField boundaryT
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"boundaryT",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
mesh
|
||||||
|
);
|
||||||
|
|
||||||
|
Info<< nl << "Reading field boundaryU" << endl;
|
||||||
|
volVectorField boundaryU
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"boundaryU",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
mesh
|
||||||
|
);
|
||||||
|
|
||||||
|
Info<< nl << "Reading field rhoN (number density)" << endl;
|
||||||
|
volScalarField rhoN
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"rhoN",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
mesh
|
||||||
|
);
|
||||||
|
|
||||||
|
Info<< nl << "Reading field rhoM (mass density)" << endl;
|
||||||
|
volScalarField rhoM
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"rhoM",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
mesh
|
||||||
|
);
|
||||||
|
|
||||||
|
Info<< nl << "Reading field rhoNdsmc (dsmc particle density)" << endl;
|
||||||
|
volScalarField dsmcRhoN
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"dsmcRhoN",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
mesh
|
||||||
|
);
|
||||||
|
|
||||||
|
Info<< nl << "Reading field momentum (momentum density)" << endl;
|
||||||
|
volVectorField momentum
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"momentum",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
mesh
|
||||||
|
);
|
||||||
|
|
||||||
|
Info<< nl << "Reading field linearKE (linear kinetic energy density)"
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
volScalarField linearKE
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"linearKE",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
mesh
|
||||||
|
);
|
||||||
|
|
||||||
|
Info<< nl << "Reading field internalE (internal energy density)" << endl;
|
||||||
|
volScalarField internalE
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"internalE",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
mesh
|
||||||
|
);
|
||||||
|
|
||||||
|
Info<< nl << "Reading field iDof (internal degree of freedom density)"
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
volScalarField iDof
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"iDof",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
mesh
|
||||||
|
);
|
||||||
|
|
||||||
|
Info<< nl << "Reading field q (surface heat transfer)" << endl;
|
||||||
|
volScalarField q
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"q",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
mesh
|
||||||
|
);
|
||||||
|
|
||||||
|
Info<< nl << "Reading field fD (surface force density)" << endl;
|
||||||
|
volVectorField fD
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"fD",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
mesh
|
||||||
|
);
|
||||||
|
|
||||||
|
Info<< nl << "Constructing dsmcCloud " << endl;
|
||||||
|
|
||||||
|
dsmcCloud dsmc("dsmc", boundaryT, boundaryU);
|
||||||
105
applications/solvers/discreteMethods/dsmc/dsmcFoam/dsmcFoam.C
Normal file
105
applications/solvers/discreteMethods/dsmc/dsmcFoam/dsmcFoam.C
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by the
|
||||||
|
Free Software Foundation; either version 2 of the License, or (at your
|
||||||
|
option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||||
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
Application
|
||||||
|
dsmcFoam
|
||||||
|
|
||||||
|
Description
|
||||||
|
Direct Simulation Monte Carlo Solver for 3D, transient, multi-species flows
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "fvCFD.H"
|
||||||
|
#include "dsmcCloud.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
#include "setRootCase.H"
|
||||||
|
#include "createTime.H"
|
||||||
|
#include "createMesh.H"
|
||||||
|
#include "createFields.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Info<< "\nStarting time loop\n" << endl;
|
||||||
|
|
||||||
|
while (runTime.run())
|
||||||
|
{
|
||||||
|
runTime++;
|
||||||
|
|
||||||
|
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||||
|
|
||||||
|
// Carry out dsmcCloud timestep
|
||||||
|
|
||||||
|
dsmc.evolve();
|
||||||
|
|
||||||
|
// Retrieve flow field data from dsmcCloud
|
||||||
|
|
||||||
|
rhoN = dsmc.rhoN();
|
||||||
|
rhoN.correctBoundaryConditions();
|
||||||
|
|
||||||
|
rhoM = dsmc.rhoM();
|
||||||
|
rhoM.correctBoundaryConditions();
|
||||||
|
|
||||||
|
dsmcRhoN = dsmc.dsmcRhoN();
|
||||||
|
dsmcRhoN.correctBoundaryConditions();
|
||||||
|
|
||||||
|
momentum = dsmc.momentum();
|
||||||
|
momentum.correctBoundaryConditions();
|
||||||
|
|
||||||
|
linearKE = dsmc.linearKE();
|
||||||
|
linearKE.correctBoundaryConditions();
|
||||||
|
|
||||||
|
internalE = dsmc.internalE();
|
||||||
|
internalE.correctBoundaryConditions();
|
||||||
|
|
||||||
|
iDof = dsmc.iDof();
|
||||||
|
iDof.correctBoundaryConditions();
|
||||||
|
|
||||||
|
// Retrieve surface field data from dsmcCloud
|
||||||
|
|
||||||
|
q = dsmc.q();
|
||||||
|
|
||||||
|
fD = dsmc.fD();
|
||||||
|
|
||||||
|
// Print status of dsmcCloud
|
||||||
|
|
||||||
|
dsmc.info();
|
||||||
|
|
||||||
|
runTime.write();
|
||||||
|
|
||||||
|
Info<< nl << "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||||
|
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||||
|
<< nl << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
Info<< "End\n" << endl;
|
||||||
|
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -1,7 +1,6 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
|
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
|
||||||
-I../XiFoam \
|
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
|
|||||||
@ -70,11 +70,12 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
#include "UEqn.H"
|
#include "UEqn.H"
|
||||||
|
|
||||||
|
#include "hEqn.H"
|
||||||
|
|
||||||
// --- PISO loop
|
// --- PISO loop
|
||||||
|
|
||||||
for (int corr=0; corr<nCorr; corr++)
|
for (int corr=0; corr<nCorr; corr++)
|
||||||
{
|
{
|
||||||
#include "hEqn.H"
|
|
||||||
#include "pEqn.H"
|
#include "pEqn.H"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -53,12 +53,15 @@
|
|||||||
);
|
);
|
||||||
|
|
||||||
Info<< "Creating field DpDt\n" << endl;
|
Info<< "Creating field DpDt\n" << endl;
|
||||||
volScalarField DpDt =
|
volScalarField DpDt
|
||||||
fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
|
(
|
||||||
|
"DpDt",
|
||||||
|
fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p)
|
||||||
|
);
|
||||||
|
|
||||||
Info<< "Calculating field g.h\n" << endl;
|
Info<< "Calculating field g.h\n" << endl;
|
||||||
volScalarField gh("gh", g & mesh.C());
|
volScalarField gh("gh", g & mesh.C());
|
||||||
surfaceScalarField ghf("gh", g & mesh.Cf());
|
surfaceScalarField ghf("ghf", g & mesh.Cf());
|
||||||
|
|
||||||
dimensionedScalar pRef("pRef", p.dimensions(), thermo->lookup("pRef"));
|
dimensionedScalar pRef("pRef", p.dimensions(), thermo->lookup("pRef"));
|
||||||
|
|
||||||
|
|||||||
@ -53,7 +53,7 @@
|
|||||||
|
|
||||||
Info<< "Calculating field g.h\n" << endl;
|
Info<< "Calculating field g.h\n" << endl;
|
||||||
volScalarField gh("gh", g & mesh.C());
|
volScalarField gh("gh", g & mesh.C());
|
||||||
surfaceScalarField ghf("gh", g & mesh.Cf());
|
surfaceScalarField ghf("ghf", g & mesh.Cf());
|
||||||
|
|
||||||
dimensionedScalar pRef("pRef", p.dimensions(), thermo->lookup("pRef"));
|
dimensionedScalar pRef("pRef", p.dimensions(), thermo->lookup("pRef"));
|
||||||
|
|
||||||
|
|||||||
@ -59,7 +59,8 @@
|
|||||||
|
|
||||||
rho = thermo->rho();
|
rho = thermo->rho();
|
||||||
rho.relax();
|
rho.relax();
|
||||||
Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value() << endl;
|
Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value()
|
||||||
|
<< endl;
|
||||||
|
|
||||||
pd == p - (rho*gh + pRef);
|
pd == p - (rho*gh + pRef);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -103,8 +103,8 @@ public:
|
|||||||
const dictionary&
|
const dictionary&
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Construct by mapping given solidWallMixedTemperatureCoupledFvPatchScalarField
|
//- Construct by mapping given
|
||||||
// onto a new patch
|
// solidWallMixedTemperatureCoupledFvPatchScalarField onto a new patch
|
||||||
solidWallMixedTemperatureCoupledFvPatchScalarField
|
solidWallMixedTemperatureCoupledFvPatchScalarField
|
||||||
(
|
(
|
||||||
const solidWallMixedTemperatureCoupledFvPatchScalarField&,
|
const solidWallMixedTemperatureCoupledFvPatchScalarField&,
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
volScalarField& rho = rhoFluid[i];
|
volScalarField& rho = rhoFluid[i];
|
||||||
volScalarField& K = KFluid[i];
|
volScalarField& K = KFluid[i];
|
||||||
volVectorField& U = UFluid[i];
|
volVectorField& U = UFluid[i];
|
||||||
surfaceScalarField phi = phiFluid[i];
|
surfaceScalarField& phi = phiFluid[i];
|
||||||
compressible::turbulenceModel& turb = turbulence[i];
|
compressible::turbulenceModel& turb = turbulence[i];
|
||||||
volScalarField& DpDt = DpDtFluid[i];
|
volScalarField& DpDt = DpDtFluid[i];
|
||||||
const volScalarField& gh = ghFluid[i];
|
const volScalarField& gh = ghFluid[i];
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
Info<< "Reading field p\n" << endl;
|
Info<< "Reading field p\n" << endl;
|
||||||
volScalarField p
|
volScalarField p
|
||||||
(
|
(
|
||||||
@ -33,7 +32,7 @@
|
|||||||
|
|
||||||
label pRefCell = 0;
|
label pRefCell = 0;
|
||||||
scalar pRefValue = 0.0;
|
scalar pRefValue = 0.0;
|
||||||
setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue);
|
setRefCell(p, mesh.solutionDict().subDict("PIMPLE"), pRefCell, pRefValue);
|
||||||
|
|
||||||
singlePhaseTransportModel laminarTransport(U, phi);
|
singlePhaseTransportModel laminarTransport(U, phi);
|
||||||
|
|
||||||
|
|||||||
@ -23,7 +23,7 @@ License
|
|||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
Application
|
Application
|
||||||
turbDyMFoam
|
pimpleDyMFoam.C
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Transient solver for incompressible, flow of Newtonian fluids
|
Transient solver for incompressible, flow of Newtonian fluids
|
||||||
@ -47,7 +47,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
# include "createDynamicFvMesh.H"
|
# include "createDynamicFvMesh.H"
|
||||||
# include "readPISOControls.H"
|
# include "readPIMPLEControls.H"
|
||||||
# include "initContinuityErrs.H"
|
# include "initContinuityErrs.H"
|
||||||
# include "createFields.H"
|
# include "createFields.H"
|
||||||
# include "readTimeControls.H"
|
# include "readTimeControls.H"
|
||||||
|
|||||||
@ -1,14 +1,14 @@
|
|||||||
# include "readTimeControls.H"
|
# include "readTimeControls.H"
|
||||||
# include "readPISOControls.H"
|
# include "readPIMPLEControls.H"
|
||||||
|
|
||||||
bool correctPhi = false;
|
bool correctPhi = false;
|
||||||
if (piso.found("correctPhi"))
|
if (pimple.found("correctPhi"))
|
||||||
{
|
{
|
||||||
correctPhi = Switch(piso.lookup("correctPhi"));
|
correctPhi = Switch(pimple.lookup("correctPhi"));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool checkMeshCourantNo = false;
|
bool checkMeshCourantNo = false;
|
||||||
if (piso.found("checkMeshCourantNo"))
|
if (pimple.found("checkMeshCourantNo"))
|
||||||
{
|
{
|
||||||
checkMeshCourantNo = Switch(piso.lookup("checkMeshCourantNo"));
|
checkMeshCourantNo = Switch(pimple.lookup("checkMeshCourantNo"));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -85,7 +85,7 @@
|
|||||||
|
|
||||||
Info<< "Calculating field g.h\n" << endl;
|
Info<< "Calculating field g.h\n" << endl;
|
||||||
volScalarField gh("gh", g & mesh.C());
|
volScalarField gh("gh", g & mesh.C());
|
||||||
surfaceScalarField ghf("gh", g & mesh.Cf());
|
surfaceScalarField ghf("ghf", g & mesh.Cf());
|
||||||
|
|
||||||
|
|
||||||
volScalarField p
|
volScalarField p
|
||||||
|
|||||||
@ -47,7 +47,7 @@
|
|||||||
|
|
||||||
Info<< "Calculating field g.h\n" << endl;
|
Info<< "Calculating field g.h\n" << endl;
|
||||||
volScalarField gh("gh", g & mesh.C());
|
volScalarField gh("gh", g & mesh.C());
|
||||||
surfaceScalarField ghf("gh", g & mesh.Cf());
|
surfaceScalarField ghf("ghf", g & mesh.Cf());
|
||||||
|
|
||||||
|
|
||||||
volScalarField p
|
volScalarField p
|
||||||
|
|||||||
@ -339,4 +339,4 @@
|
|||||||
);
|
);
|
||||||
|
|
||||||
Info<< "Calculating field (g.h)f\n" << endl;
|
Info<< "Calculating field (g.h)f\n" << endl;
|
||||||
surfaceScalarField ghf = surfaceScalarField("gh", g & mesh.Cf());
|
surfaceScalarField ghf = surfaceScalarField("ghf", g & mesh.Cf());
|
||||||
|
|||||||
@ -43,24 +43,33 @@ using namespace Foam;
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
List<vector> list(IStringStream("1 ((0 1 2))")());
|
List<vector> list1(IStringStream("1 ((0 1 2))")());
|
||||||
Info<< list << endl;
|
Info<< "list1: " << list1 << endl;
|
||||||
|
|
||||||
List<vector> list2(IStringStream("((0 1 2) (3 4 5) (3 4 5))")());
|
List<vector> list2(IStringStream("((0 1 2) (3 4 5) (6 7 8))")());
|
||||||
Info<< list2 << endl;
|
Info<< "list2: " << list2 << endl;
|
||||||
|
|
||||||
|
list1.append(list2);
|
||||||
|
Info<< "list1.append(list2): " << list1 << endl;
|
||||||
|
|
||||||
Info<< findIndex(list2, vector(3, 4, 5)) << endl;
|
Info<< findIndex(list2, vector(3, 4, 5)) << endl;
|
||||||
|
|
||||||
list2.setSize(10, vector(1, 2, 3));
|
list2.setSize(10, vector(1, 2, 3));
|
||||||
Info<< list2 << endl;
|
Info<< "list2: " << list2 << endl;
|
||||||
|
|
||||||
List<vector> list3(list2.xfer());
|
List<vector> list3(list2.xfer());
|
||||||
Info<< "Transferred via the xfer() method" << endl;
|
Info<< "Transferred via the xfer() method" << endl;
|
||||||
Info<< list2 << nl
|
Info<< "list2: " << list2 << nl
|
||||||
<< list3 << endl;
|
<< "list3: " << list3 << endl;
|
||||||
|
|
||||||
|
|
||||||
|
// Subset
|
||||||
|
const labelList map(IStringStream("2 (0 2)")());
|
||||||
|
List<vector> subList3(list3, map);
|
||||||
|
Info<< "Elements " << map << " out of " << list3
|
||||||
|
<< " => " << subList3 << endl;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
3
applications/test/UIndirectListTest/Make/files
Normal file
3
applications/test/UIndirectListTest/Make/files
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
UIndirectListTest.C
|
||||||
|
|
||||||
|
EXE = $(FOAM_USER_APPBIN)/UIndirectListTest
|
||||||
0
applications/test/UIndirectListTest/Make/options
Normal file
0
applications/test/UIndirectListTest/Make/options
Normal file
99
applications/test/UIndirectListTest/UIndirectListTest.C
Normal file
99
applications/test/UIndirectListTest/UIndirectListTest.C
Normal file
@ -0,0 +1,99 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / 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 "UIndirectList.H"
|
||||||
|
#include "IOstreams.H"
|
||||||
|
#include "ListOps.H"
|
||||||
|
#include "OFstream.H"
|
||||||
|
|
||||||
|
using namespace Foam;
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
// Main program:
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
List<double> completeList(10);
|
||||||
|
|
||||||
|
forAll(completeList, i)
|
||||||
|
{
|
||||||
|
completeList[i] = 0.1*i;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<label> addresses(5);
|
||||||
|
addresses[0] = 1;
|
||||||
|
addresses[1] = 0;
|
||||||
|
addresses[2] = 7;
|
||||||
|
addresses[3] = 8;
|
||||||
|
addresses[4] = 5;
|
||||||
|
|
||||||
|
UIndirectList<double> idl(completeList, addresses);
|
||||||
|
|
||||||
|
Info<< idl << "\n";
|
||||||
|
|
||||||
|
idl[1] = -666;
|
||||||
|
|
||||||
|
Info<< "idl[1] changed:" << idl << endl;
|
||||||
|
|
||||||
|
idl = -999;
|
||||||
|
|
||||||
|
Info<< "idl changed:" << idl << endl;
|
||||||
|
|
||||||
|
UIndirectList<double> idl2(idl);
|
||||||
|
|
||||||
|
Info<< "idl2: " << idl2 << endl;
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
List<double> ident(idl.size());
|
||||||
|
|
||||||
|
forAll(ident, i)
|
||||||
|
{
|
||||||
|
ident[i] = ident.size() - i;
|
||||||
|
}
|
||||||
|
idl = ident;
|
||||||
|
}
|
||||||
|
|
||||||
|
Info<< "idl assigned from UList:" << idl << endl;
|
||||||
|
|
||||||
|
List<double> realList = UIndirectList<double>(completeList, addresses);
|
||||||
|
|
||||||
|
Info<< "realList:" << realList << endl;
|
||||||
|
|
||||||
|
List<double> realList2(UIndirectList<double>(completeList, addresses));
|
||||||
|
|
||||||
|
Info<< "realList2:" << realList2 << endl;
|
||||||
|
|
||||||
|
|
||||||
|
Info << "\nEnd\n" << endl;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -70,6 +70,28 @@ int main(int argc, char *argv[])
|
|||||||
string test2("~OpenFOAM/controlDict");
|
string test2("~OpenFOAM/controlDict");
|
||||||
Info<< test2 << " => " << test2.expand() << endl;
|
Info<< test2 << " => " << test2.expand() << endl;
|
||||||
|
|
||||||
|
// replace controlDict with "newName"
|
||||||
|
{
|
||||||
|
string::size_type i = test2.rfind('/');
|
||||||
|
|
||||||
|
if (i == string::npos)
|
||||||
|
{
|
||||||
|
test2 = "newName";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// this uses the std::string::replace
|
||||||
|
test2.replace(i+1, string::npos, "newName");
|
||||||
|
}
|
||||||
|
Info<< "after replace: " << test2 << endl;
|
||||||
|
|
||||||
|
// do another replace
|
||||||
|
// this uses the Foam::string::replace
|
||||||
|
test2.replace("OpenFOAM", "openfoam");
|
||||||
|
|
||||||
|
Info<< "after replace: " << test2 << endl;
|
||||||
|
}
|
||||||
|
|
||||||
string s;
|
string s;
|
||||||
Sin.getLine(s);
|
Sin.getLine(s);
|
||||||
|
|
||||||
@ -78,8 +100,7 @@ int main(int argc, char *argv[])
|
|||||||
cout<< "output string with " << s2.length() << " characters\n";
|
cout<< "output string with " << s2.length() << " characters\n";
|
||||||
cout<< "ostream<< >" << s2 << "<\n";
|
cout<< "ostream<< >" << s2 << "<\n";
|
||||||
Info<< "Ostream<< >" << s2 << "<\n";
|
Info<< "Ostream<< >" << s2 << "<\n";
|
||||||
Info<< "hash:" << unsigned(string::hash()(s2)) << endl;
|
Info<< "hash:" << hex << string::hash()(s2) << endl;
|
||||||
|
|
||||||
|
|
||||||
Info << "End\n" << endl;
|
Info << "End\n" << endl;
|
||||||
|
|
||||||
|
|||||||
@ -68,8 +68,7 @@ int main(int argc, char *argv[])
|
|||||||
mesh
|
mesh
|
||||||
);
|
);
|
||||||
|
|
||||||
pointMesh pMesh(mesh);
|
const volPointInterpolation& pInterp = volPointInterpolation::New(mesh);
|
||||||
volPointInterpolation pInterp(mesh, pMesh);
|
|
||||||
|
|
||||||
pointScalarField pp(pInterp.interpolate(p));
|
pointScalarField pp(pInterp.interpolate(p));
|
||||||
pp.write();
|
pp.write();
|
||||||
|
|||||||
@ -39,24 +39,17 @@ Description
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
timeSelector::addOptions();
|
||||||
|
|
||||||
# include "addTimeOptions.H"
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
|
|
||||||
Info<< "\nEstimating error in scalar transport equation\n" << endl;
|
|
||||||
|
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
|
|
||||||
// Get times list
|
instantList timeDirs = timeSelector::select0(runTime, args);
|
||||||
instantList Times = runTime.times();
|
|
||||||
|
|
||||||
# include "checkTimeOptions.H"
|
|
||||||
|
|
||||||
runTime.setTime(Times[startTime], startTime);
|
|
||||||
|
|
||||||
# include "createMesh.H"
|
# include "createMesh.H"
|
||||||
|
|
||||||
Info<< "Reading transportProperties\n" << endl;
|
Info<< "\nEstimating error in scalar transport equation\n"
|
||||||
|
<< "Reading transportProperties\n" << endl;
|
||||||
|
|
||||||
IOdictionary transportProperties
|
IOdictionary transportProperties
|
||||||
(
|
(
|
||||||
@ -79,9 +72,9 @@ int main(int argc, char *argv[])
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
for (label i=startTime; i<endTime; i++)
|
forAll(timeDirs, timeI)
|
||||||
{
|
{
|
||||||
runTime.setTime(Times[i], i);
|
runTime.setTime(timeDirs[timeI], timeI);
|
||||||
|
|
||||||
Info<< "Time = " << runTime.timeName() << endl;
|
Info<< "Time = " << runTime.timeName() << endl;
|
||||||
|
|
||||||
|
|||||||
@ -38,25 +38,17 @@ Description
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
timeSelector::addOptions();
|
||||||
|
|
||||||
# include "addTimeOptions.H"
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
|
|
||||||
Info<< "\nEstimating error in the incompressible momentum equation\n"
|
|
||||||
<< endl;
|
|
||||||
|
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
|
|
||||||
// Get times list
|
instantList timeDirs = timeSelector::select0(runTime, args);
|
||||||
instantList Times = runTime.times();
|
|
||||||
|
|
||||||
# include "checkTimeOptions.H"
|
|
||||||
|
|
||||||
runTime.setTime(Times[startTime], startTime);
|
|
||||||
|
|
||||||
# include "createMesh.H"
|
# include "createMesh.H"
|
||||||
|
|
||||||
Info<< "Reading transportProperties\n" << endl;
|
Info<< "\nEstimating error in the incompressible momentum equation\n"
|
||||||
|
<< "Reading transportProperties\n" << endl;
|
||||||
|
|
||||||
IOdictionary transportProperties
|
IOdictionary transportProperties
|
||||||
(
|
(
|
||||||
@ -75,9 +67,9 @@ int main(int argc, char *argv[])
|
|||||||
transportProperties.lookup("nu")
|
transportProperties.lookup("nu")
|
||||||
);
|
);
|
||||||
|
|
||||||
for (label i=startTime; i<endTime; i++)
|
forAll(timeDirs, timeI)
|
||||||
{
|
{
|
||||||
runTime.setTime(Times[i], i);
|
runTime.setTime(timeDirs[timeI], timeI);
|
||||||
|
|
||||||
Info<< "Time = " << runTime.timeName() << endl;
|
Info<< "Time = " << runTime.timeName() << endl;
|
||||||
|
|
||||||
|
|||||||
@ -39,25 +39,17 @@ Description
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
timeSelector::addOptions();
|
||||||
|
|
||||||
# include "addTimeOptions.H"
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
|
|
||||||
Info<< "\nEstimating error in the incompressible momentum equation\n"
|
|
||||||
<< endl;
|
|
||||||
|
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
|
|
||||||
// Get times list
|
instantList timeDirs = timeSelector::select0(runTime, args);
|
||||||
instantList Times = runTime.times();
|
|
||||||
|
|
||||||
# include "checkTimeOptions.H"
|
|
||||||
|
|
||||||
runTime.setTime(Times[startTime], startTime);
|
|
||||||
|
|
||||||
# include "createMesh.H"
|
# include "createMesh.H"
|
||||||
|
|
||||||
Info<< "Reading transportProperties\n" << endl;
|
Info<< "\nEstimating error in the incompressible momentum equation\n"
|
||||||
|
<< "Reading transportProperties\n" << endl;
|
||||||
|
|
||||||
IOdictionary transportProperties
|
IOdictionary transportProperties
|
||||||
(
|
(
|
||||||
@ -76,9 +68,9 @@ int main(int argc, char *argv[])
|
|||||||
transportProperties.lookup("nu")
|
transportProperties.lookup("nu")
|
||||||
);
|
);
|
||||||
|
|
||||||
for (label i=startTime; i<endTime; i++)
|
forAll(timeDirs, timeI)
|
||||||
{
|
{
|
||||||
runTime.setTime(Times[i], i);
|
runTime.setTime(timeDirs[timeI], timeI);
|
||||||
|
|
||||||
Info<< "Time = " << runTime.timeName() << endl;
|
Info<< "Time = " << runTime.timeName() << endl;
|
||||||
|
|
||||||
|
|||||||
@ -40,24 +40,17 @@ Description
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
timeSelector::addOptions();
|
||||||
|
|
||||||
# include "addTimeOptions.H"
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
|
|
||||||
Info<< "\nEstimating error in scalar transport equation\n" << endl;
|
|
||||||
|
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
|
|
||||||
// Get times list
|
instantList timeDirs = timeSelector::select0(runTime, args);
|
||||||
instantList Times = runTime.times();
|
|
||||||
|
|
||||||
# include "checkTimeOptions.H"
|
|
||||||
|
|
||||||
runTime.setTime(Times[startTime], startTime);
|
|
||||||
|
|
||||||
# include "createMesh.H"
|
# include "createMesh.H"
|
||||||
|
|
||||||
Info<< "Reading transportProperties\n" << endl;
|
Info<< "\nEstimating error in scalar transport equation\n"
|
||||||
|
<< "Reading transportProperties\n" << endl;
|
||||||
|
|
||||||
IOdictionary transportProperties
|
IOdictionary transportProperties
|
||||||
(
|
(
|
||||||
@ -80,9 +73,9 @@ int main(int argc, char *argv[])
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
for (label i=startTime; i<endTime; i++)
|
forAll(timeDirs, timeI)
|
||||||
{
|
{
|
||||||
runTime.setTime(Times[i], i);
|
runTime.setTime(timeDirs[timeI], timeI);
|
||||||
|
|
||||||
Info<< "Time = " << runTime.timeName() << endl;
|
Info<< "Time = " << runTime.timeName() << endl;
|
||||||
|
|
||||||
|
|||||||
@ -177,7 +177,7 @@ label mergePatchFaces
|
|||||||
List<faceList> allFaceSetsFaces(allFaceSets.size());
|
List<faceList> allFaceSetsFaces(allFaceSets.size());
|
||||||
forAll(allFaceSets, setI)
|
forAll(allFaceSets, setI)
|
||||||
{
|
{
|
||||||
allFaceSetsFaces[setI] = IndirectList<face>
|
allFaceSetsFaces[setI] = UIndirectList<face>
|
||||||
(
|
(
|
||||||
mesh.faces(),
|
mesh.faces(),
|
||||||
allFaceSets[setI]
|
allFaceSets[setI]
|
||||||
|
|||||||
@ -182,6 +182,7 @@ int main(int argc, char *argv[])
|
|||||||
if (overwrite)
|
if (overwrite)
|
||||||
{
|
{
|
||||||
mesh.setInstance(oldInstance);
|
mesh.setInstance(oldInstance);
|
||||||
|
meshCutter.setInstance(oldInstance);
|
||||||
}
|
}
|
||||||
Info<< "Writing mesh to " << runTime.timeName() << endl;
|
Info<< "Writing mesh to " << runTime.timeName() << endl;
|
||||||
|
|
||||||
|
|||||||
@ -61,6 +61,7 @@ See Also
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "argList.H"
|
#include "argList.H"
|
||||||
|
#include "timeSelector.H"
|
||||||
#include "Time.H"
|
#include "Time.H"
|
||||||
#include "polyMesh.H"
|
#include "polyMesh.H"
|
||||||
#include "STARCDMeshWriter.H"
|
#include "STARCDMeshWriter.H"
|
||||||
@ -73,20 +74,17 @@ using namespace Foam;
|
|||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
argList::noParallel();
|
argList::noParallel();
|
||||||
|
timeSelector::addOptions();
|
||||||
|
|
||||||
argList::validOptions.insert("scale", "scale");
|
argList::validOptions.insert("scale", "scale");
|
||||||
argList::validOptions.insert("noBnd", "");
|
argList::validOptions.insert("noBnd", "");
|
||||||
argList::validOptions.insert("tri", "");
|
argList::validOptions.insert("tri", "");
|
||||||
argList::validOptions.insert("surface", "");
|
argList::validOptions.insert("surface", "");
|
||||||
|
|
||||||
# include "addTimeOptions.H"
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
// Get times list
|
|
||||||
instantList Times = runTime.times();
|
|
||||||
|
|
||||||
// set startTime and endTime depending on -time and -latestTime options
|
instantList timeDirs = timeSelector::select0(runTime, args);
|
||||||
# include "checkTimeOptions.H"
|
|
||||||
runTime.setTime(Times[startTime], startTime);
|
|
||||||
|
|
||||||
bool surfaceOnly = false;
|
bool surfaceOnly = false;
|
||||||
if (args.options().found("surface") or args.options().found("tri"))
|
if (args.options().found("surface") or args.options().found("tri"))
|
||||||
@ -118,17 +116,16 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
# include "createPolyMesh.H"
|
# include "createPolyMesh.H"
|
||||||
|
|
||||||
// bool firstCheck = true;
|
|
||||||
|
|
||||||
for (label timeI = startTime; timeI < endTime; ++timeI)
|
forAll(timeDirs, timeI)
|
||||||
{
|
{
|
||||||
runTime.setTime(Times[timeI], timeI);
|
runTime.setTime(timeDirs[timeI], timeI);
|
||||||
|
|
||||||
# include "getTimeIndex.H"
|
# include "getTimeIndex.H"
|
||||||
|
|
||||||
polyMesh::readUpdateState state = mesh.readUpdate();
|
polyMesh::readUpdateState state = mesh.readUpdate();
|
||||||
|
|
||||||
if (timeI == startTime || state != polyMesh::UNCHANGED)
|
if (!timeI || state != polyMesh::UNCHANGED)
|
||||||
{
|
{
|
||||||
meshWriters::STARCD writer(mesh, scaleFactor);
|
meshWriters::STARCD writer(mesh, scaleFactor);
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
meshDualiser.C
|
meshDualiser.C
|
||||||
makePolyDualMesh.C
|
polyDualMeshApp.C
|
||||||
|
|
||||||
EXE = $(FOAM_APPBIN)/polyDualMesh
|
EXE = $(FOAM_APPBIN)/polyDualMesh
|
||||||
|
|||||||
@ -76,7 +76,7 @@ void Foam::meshDualiser::checkPolyTopoChange(const polyTopoChange& meshMod)
|
|||||||
"meshDualiser::checkPolyTopoChange(const polyTopoChange&)"
|
"meshDualiser::checkPolyTopoChange(const polyTopoChange&)"
|
||||||
) << "duplicate verts:" << newToOld[newI]
|
) << "duplicate verts:" << newToOld[newI]
|
||||||
<< " coords:"
|
<< " coords:"
|
||||||
<< IndirectList<point>(points, newToOld[newI])()
|
<< UIndirectList<point>(points, newToOld[newI])()
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -226,10 +226,7 @@ Foam::label Foam::meshDualiser::addInternalFace
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
pointField facePoints
|
pointField facePoints(meshMod.points(), newFace);
|
||||||
(
|
|
||||||
IndirectList<point>(meshMod.points(), newFace)()
|
|
||||||
);
|
|
||||||
|
|
||||||
labelList oldToNew;
|
labelList oldToNew;
|
||||||
pointField newPoints;
|
pointField newPoints;
|
||||||
@ -289,7 +286,7 @@ Foam::label Foam::meshDualiser::addInternalFace
|
|||||||
//n /= mag(n);
|
//n /= mag(n);
|
||||||
//Pout<< "Generated internal dualFace:" << dualFaceI
|
//Pout<< "Generated internal dualFace:" << dualFaceI
|
||||||
// << " verts:" << newFace
|
// << " verts:" << newFace
|
||||||
// << " points:" << IndirectList<point>(meshMod.points(), newFace)()
|
// << " points:" << UIndirectList<point>(meshMod.points(), newFace)()
|
||||||
// << " n:" << n
|
// << " n:" << n
|
||||||
// << " between dualowner:" << dualCell0
|
// << " between dualowner:" << dualCell0
|
||||||
// << " dualneigbour:" << dualCell1
|
// << " dualneigbour:" << dualCell1
|
||||||
@ -316,7 +313,7 @@ Foam::label Foam::meshDualiser::addInternalFace
|
|||||||
//n /= mag(n);
|
//n /= mag(n);
|
||||||
//Pout<< "Generated internal dualFace:" << dualFaceI
|
//Pout<< "Generated internal dualFace:" << dualFaceI
|
||||||
// << " verts:" << newFace
|
// << " verts:" << newFace
|
||||||
// << " points:" << IndirectList<point>(meshMod.points(), newFace)()
|
// << " points:" << UIndirectList<point>(meshMod.points(), newFace)()
|
||||||
// << " n:" << n
|
// << " n:" << n
|
||||||
// << " between dualowner:" << dualCell1
|
// << " between dualowner:" << dualCell1
|
||||||
// << " dualneigbour:" << dualCell0
|
// << " dualneigbour:" << dualCell0
|
||||||
@ -373,7 +370,7 @@ Foam::label Foam::meshDualiser::addBoundaryFace
|
|||||||
//n /= mag(n);
|
//n /= mag(n);
|
||||||
//Pout<< "Generated boundary dualFace:" << dualFaceI
|
//Pout<< "Generated boundary dualFace:" << dualFaceI
|
||||||
// << " verts:" << newFace
|
// << " verts:" << newFace
|
||||||
// << " points:" << IndirectList<point>(meshMod.points(), newFace)()
|
// << " points:" << UIndirectList<point>(meshMod.points(), newFace)()
|
||||||
// << " n:" << n
|
// << " n:" << n
|
||||||
// << " on dualowner:" << dualCellI
|
// << " on dualowner:" << dualCellI
|
||||||
// << endl;
|
// << endl;
|
||||||
@ -568,7 +565,7 @@ void Foam::meshDualiser::createFaceFromInternalFace
|
|||||||
|
|
||||||
//Pout<< "createFaceFromInternalFace : At face:" << faceI
|
//Pout<< "createFaceFromInternalFace : At face:" << faceI
|
||||||
// << " verts:" << f
|
// << " verts:" << f
|
||||||
// << " points:" << IndirectList<point>(mesh_.points(), f)()
|
// << " points:" << UIndirectList<point>(mesh_.points(), f)()
|
||||||
// << " started walking at edge:" << fEdges[fp]
|
// << " started walking at edge:" << fEdges[fp]
|
||||||
// << " verts:" << mesh_.edges()[fEdges[fp]]
|
// << " verts:" << mesh_.edges()[fEdges[fp]]
|
||||||
// << endl;
|
// << endl;
|
||||||
@ -617,7 +614,7 @@ void Foam::meshDualiser::createFaceFromInternalFace
|
|||||||
{
|
{
|
||||||
FatalErrorIn("createFacesFromInternalFace(..)")
|
FatalErrorIn("createFacesFromInternalFace(..)")
|
||||||
<< "face:" << faceI << " verts:" << f
|
<< "face:" << faceI << " verts:" << f
|
||||||
<< " points:" << IndirectList<point>(mesh_.points(), f)()
|
<< " points:" << UIndirectList<point>(mesh_.points(), f)()
|
||||||
<< " no feature edge between " << f[fp]
|
<< " no feature edge between " << f[fp]
|
||||||
<< " and " << f[nextFp] << " although have different"
|
<< " and " << f[nextFp] << " although have different"
|
||||||
<< " dual cells." << endl
|
<< " dual cells." << endl
|
||||||
|
|||||||
@ -348,8 +348,10 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
|
|
||||||
// Get times list
|
// Get times list
|
||||||
instantList Times = runTime.times();
|
instantList Times = runTime.times();
|
||||||
|
|
||||||
# include "checkTimeOptions.H"
|
# include "checkTimeOptions.H"
|
||||||
runTime.setTime(Times[startTime], startTime);
|
runTime.setTime(Times[startTime], startTime);
|
||||||
|
|
||||||
@ -37,6 +37,7 @@ Description
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "argList.H"
|
#include "argList.H"
|
||||||
|
#include "timeSelector.H"
|
||||||
#include "Time.H"
|
#include "Time.H"
|
||||||
#include "polyMesh.H"
|
#include "polyMesh.H"
|
||||||
#include "OFstream.H"
|
#include "OFstream.H"
|
||||||
@ -336,14 +337,15 @@ void writePointCells
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
timeSelector::addOptions();
|
||||||
argList::validOptions.insert("patchFaces", "");
|
argList::validOptions.insert("patchFaces", "");
|
||||||
argList::validOptions.insert("cell", "cellI");
|
argList::validOptions.insert("cell", "cellI");
|
||||||
argList::validOptions.insert("face", "faceI");
|
argList::validOptions.insert("face", "faceI");
|
||||||
argList::validOptions.insert("point", "pointI");
|
argList::validOptions.insert("point", "pointI");
|
||||||
argList::validOptions.insert("cellSet", "setName");
|
argList::validOptions.insert("cellSet", "setName");
|
||||||
argList::validOptions.insert("faceSet", "setName");
|
argList::validOptions.insert("faceSet", "setName");
|
||||||
|
# include "addRegionOption.H"
|
||||||
|
|
||||||
# include "addTimeOptions.H"
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
runTime.functionObjects().off();
|
runTime.functionObjects().off();
|
||||||
@ -361,31 +363,23 @@ int main(int argc, char *argv[])
|
|||||||
<< "(for points, faces, cells) is consistent with"
|
<< "(for points, faces, cells) is consistent with"
|
||||||
<< " Foam numbering (starting from 0)." << endl << endl;
|
<< " Foam numbering (starting from 0)." << endl << endl;
|
||||||
|
|
||||||
// Get times list
|
instantList timeDirs = timeSelector::select0(runTime, args);
|
||||||
instantList Times = runTime.times();
|
|
||||||
|
|
||||||
# include "checkTimeOptions.H"
|
# include "createNamedPolyMesh.H"
|
||||||
|
|
||||||
runTime.setTime(Times[startTime], startTime);
|
forAll(timeDirs, timeI)
|
||||||
|
|
||||||
# include "createPolyMesh.H"
|
|
||||||
|
|
||||||
bool firstCheck = true;
|
|
||||||
|
|
||||||
for (label i=startTime; i<endTime; i++)
|
|
||||||
{
|
{
|
||||||
runTime.setTime(Times[i], i);
|
runTime.setTime(timeDirs[timeI], timeI);
|
||||||
|
|
||||||
Info<< "Time = " << runTime.timeName() << endl;
|
Info<< "Time = " << runTime.timeName() << endl;
|
||||||
|
|
||||||
polyMesh::readUpdateState state = mesh.readUpdate();
|
polyMesh::readUpdateState state = mesh.readUpdate();
|
||||||
|
|
||||||
if (firstCheck || state != polyMesh::UNCHANGED)
|
if (!timeI || state != polyMesh::UNCHANGED)
|
||||||
{
|
{
|
||||||
if (patchFaces)
|
if (patchFaces)
|
||||||
{
|
{
|
||||||
writePatchFaces(mesh, runTime.timeName());
|
writePatchFaces(mesh, runTime.timeName());
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (doCell)
|
else if (doCell)
|
||||||
{
|
{
|
||||||
@ -487,9 +481,7 @@ int main(int argc, char *argv[])
|
|||||||
Info << "No mesh." << endl;
|
Info << "No mesh." << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
firstCheck = false;
|
Info << nl << endl;
|
||||||
|
|
||||||
Info << endl << endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -30,8 +30,7 @@ Description
|
|||||||
|
|
||||||
#include "arcEdge.H"
|
#include "arcEdge.H"
|
||||||
#include "mathematicalConstants.H"
|
#include "mathematicalConstants.H"
|
||||||
|
#include "addToRunTimeSelectionTable.H"
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -40,8 +39,7 @@ namespace Foam
|
|||||||
defineTypeNameAndDebug(arcEdge, 0);
|
defineTypeNameAndDebug(arcEdge, 0);
|
||||||
|
|
||||||
// Add the curvedEdge constructor functions to the hash tables
|
// Add the curvedEdge constructor functions to the hash tables
|
||||||
curvedEdge::addIstreamConstructorToTable<arcEdge>
|
addToRunTimeSelectionTable(curvedEdge, arcEdge, Istream);
|
||||||
addArcEdgeIstreamConstructorToTable_;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -41,26 +41,7 @@ namespace Foam
|
|||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
defineTypeNameAndDebug(curvedEdge, 0);
|
defineTypeNameAndDebug(curvedEdge, 0);
|
||||||
|
defineRunTimeSelectionTable(curvedEdge, Istream);
|
||||||
// Define the constructor function hash tables
|
|
||||||
HashTable<curvedEdge::IstreamConstructorPtr_>*
|
|
||||||
curvedEdge::IstreamConstructorTablePtr_;
|
|
||||||
|
|
||||||
|
|
||||||
// Hash table Constructor called from the table add functions.
|
|
||||||
|
|
||||||
void curvedEdge::constructTables()
|
|
||||||
{
|
|
||||||
static bool constructed = false;
|
|
||||||
|
|
||||||
if (!constructed)
|
|
||||||
{
|
|
||||||
curvedEdge::IstreamConstructorTablePtr_
|
|
||||||
= new HashTable<curvedEdge::IstreamConstructorPtr_>;
|
|
||||||
|
|
||||||
constructed = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
@ -117,10 +98,11 @@ autoPtr<curvedEdge> curvedEdge::New(const pointField& points, Istream& is)
|
|||||||
|
|
||||||
word curvedEdgeType(is);
|
word curvedEdgeType(is);
|
||||||
|
|
||||||
HashTable<IstreamConstructorPtr_>::iterator curvedEdgeConstructorIter =
|
IstreamConstructorTable::iterator cstrIter =
|
||||||
IstreamConstructorTablePtr_->find(curvedEdgeType);
|
IstreamConstructorTablePtr_
|
||||||
|
->find(curvedEdgeType);
|
||||||
|
|
||||||
if (curvedEdgeConstructorIter == IstreamConstructorTablePtr_->end())
|
if (cstrIter == IstreamConstructorTablePtr_->end())
|
||||||
{
|
{
|
||||||
FatalErrorIn("curvedEdge::New(const pointField&, Istream&)")
|
FatalErrorIn("curvedEdge::New(const pointField&, Istream&)")
|
||||||
<< "Unknown curvedEdge type " << curvedEdgeType << endl << endl
|
<< "Unknown curvedEdge type " << curvedEdgeType << endl << endl
|
||||||
@ -129,7 +111,7 @@ autoPtr<curvedEdge> curvedEdge::New(const pointField& points, Istream& is)
|
|||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
return autoPtr<curvedEdge>(curvedEdgeConstructorIter()(points, is));
|
return autoPtr<curvedEdge>(cstrIter()(points, is));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -177,7 +159,6 @@ Ostream& operator<<(Ostream& os, const curvedEdge& p)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
} // End namespace Foam
|
} // End namespace Foam
|
||||||
|
|||||||
@ -63,51 +63,23 @@ protected:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Constructor Hash tables
|
//- Runtime type information
|
||||||
|
TypeName("curvedEdge");
|
||||||
//- Construct from Istream function pointer type
|
|
||||||
typedef autoPtr<curvedEdge> (*IstreamConstructorPtr_)
|
|
||||||
(const pointField&, Istream&);
|
|
||||||
|
|
||||||
//- Construct from Istream function pointer table pointer
|
|
||||||
static HashTable<IstreamConstructorPtr_>*
|
|
||||||
IstreamConstructorTablePtr_;
|
|
||||||
|
|
||||||
|
|
||||||
// Hash table constructor classes and functions
|
// Declare run-time constructor selection tables
|
||||||
|
|
||||||
//- Hash table Constructor.
|
declareRunTimeSelectionTable
|
||||||
// Must be called from the table add functions below.
|
(
|
||||||
static void constructTables();
|
autoPtr,
|
||||||
|
curvedEdge,
|
||||||
|
Istream,
|
||||||
//- Class to add constructor from Istream to Hash table
|
|
||||||
template<class curvedEdgeType>
|
|
||||||
class addIstreamConstructorToTable
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
static autoPtr<curvedEdge> New
|
|
||||||
(
|
(
|
||||||
const pointField& points,
|
const pointField& points,
|
||||||
Istream& is
|
Istream& is
|
||||||
)
|
),
|
||||||
{
|
(points, is)
|
||||||
return autoPtr<curvedEdge>(new curvedEdgeType(points, is));
|
);
|
||||||
}
|
|
||||||
|
|
||||||
addIstreamConstructorToTable()
|
|
||||||
{
|
|
||||||
curvedEdge::constructTables();
|
|
||||||
|
|
||||||
curvedEdge::IstreamConstructorTablePtr_
|
|
||||||
->insert(curvedEdgeType::typeName, New);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("curvedEdge");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|||||||
@ -26,6 +26,7 @@ License
|
|||||||
|
|
||||||
#include "polySplineEdge.H"
|
#include "polySplineEdge.H"
|
||||||
#include "BSpline.H"
|
#include "BSpline.H"
|
||||||
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -34,8 +35,7 @@ namespace Foam
|
|||||||
defineTypeNameAndDebug(polySplineEdge, 0);
|
defineTypeNameAndDebug(polySplineEdge, 0);
|
||||||
|
|
||||||
// Add the curvedEdge constructor functions to the hash tables
|
// Add the curvedEdge constructor functions to the hash tables
|
||||||
curvedEdge::addIstreamConstructorToTable<polySplineEdge>
|
addToRunTimeSelectionTable(curvedEdge, polySplineEdge, Istream);
|
||||||
addPolySplineEdgeIstreamConstructorToTable_;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -27,9 +27,8 @@ Description
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "error.H"
|
|
||||||
|
|
||||||
#include "simpleSplineEdge.H"
|
#include "simpleSplineEdge.H"
|
||||||
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -39,10 +38,8 @@ namespace Foam
|
|||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
defineTypeNameAndDebug(simpleSplineEdge, 0);
|
defineTypeNameAndDebug(simpleSplineEdge, 0);
|
||||||
|
addToRunTimeSelectionTable(curvedEdge, simpleSplineEdge, Istream);
|
||||||
|
|
||||||
// Add the curvedEdge constructor functions to the hash tables
|
|
||||||
curvedEdge::addIstreamConstructorToTable<simpleSplineEdge>
|
|
||||||
addSimpleSplineEdgeIstreamConstructorToTable_;
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -55,16 +55,15 @@ int main(int argc, char *argv[])
|
|||||||
#include "setRoots.H"
|
#include "setRoots.H"
|
||||||
#include "createTimeExtruded.H"
|
#include "createTimeExtruded.H"
|
||||||
|
|
||||||
|
if (args.options().found("sourceCase") == args.options().found("surface"))
|
||||||
if (args.options().found("sourceRoot") == args.options().found("surface"))
|
|
||||||
{
|
{
|
||||||
FatalErrorIn(args.executable())
|
FatalErrorIn(args.executable())
|
||||||
<< "Need to specify either -sourceRoot/Case/Patch or -surface"
|
<< "Specify either -sourceCase and -sourcePatch"
|
||||||
<< " option to specify the source of the patch to extrude"
|
" or -surface options\n"
|
||||||
|
" to specify the source of the patch to extrude"
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
autoPtr<extrudedMesh> meshPtr(NULL);
|
autoPtr<extrudedMesh> meshPtr(NULL);
|
||||||
|
|
||||||
autoPtr<extrudeModel> model
|
autoPtr<extrudeModel> model
|
||||||
@ -84,21 +83,22 @@ int main(int argc, char *argv[])
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (args.options().found("sourceRoot"))
|
if (args.options().found("sourceCase"))
|
||||||
{
|
{
|
||||||
fileName rootDirSource(args.options()["sourceRoot"]);
|
fileName sourceCasePath(args.options()["sourceCase"]);
|
||||||
fileName caseDirSource(args.options()["sourceCase"]);
|
fileName sourceRootDir = sourceCasePath.path();
|
||||||
fileName patchName(args.options()["sourcePatch"]);
|
fileName sourceCaseDir = sourceCasePath.name();
|
||||||
|
word patchName(args.options()["sourcePatch"]);
|
||||||
|
|
||||||
Info<< "Extruding patch " << patchName
|
Info<< "Extruding patch " << patchName
|
||||||
<< " on mesh " << rootDirSource << ' ' << caseDirSource << nl
|
<< " on mesh " << sourceCasePath << nl
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
Time runTime
|
Time runTime
|
||||||
(
|
(
|
||||||
Time::controlDictName,
|
Time::controlDictName,
|
||||||
rootDirSource,
|
sourceRootDir,
|
||||||
caseDirSource
|
sourceCaseDir
|
||||||
);
|
);
|
||||||
#include "createPolyMesh.H"
|
#include "createPolyMesh.H"
|
||||||
|
|
||||||
@ -180,7 +180,7 @@ int main(int argc, char *argv[])
|
|||||||
const vector span = bb.span();
|
const vector span = bb.span();
|
||||||
const scalar mergeDim = 1E-4 * bb.minDim();
|
const scalar mergeDim = 1E-4 * bb.minDim();
|
||||||
|
|
||||||
Pout<< "Mesh bounding box:" << bb << nl
|
Info<< "Mesh bounding box:" << bb << nl
|
||||||
<< " with span:" << span << nl
|
<< " with span:" << span << nl
|
||||||
<< "Merge distance :" << mergeDim << nl
|
<< "Merge distance :" << mergeDim << nl
|
||||||
<< endl;
|
<< endl;
|
||||||
@ -201,7 +201,7 @@ int main(int argc, char *argv[])
|
|||||||
// ~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~
|
||||||
|
|
||||||
{
|
{
|
||||||
Pout<< "Collapsing edges < " << mergeDim << " ..." << nl << endl;
|
Info<< "Collapsing edges < " << mergeDim << " ..." << nl << endl;
|
||||||
|
|
||||||
// Edge collapsing engine
|
// Edge collapsing engine
|
||||||
edgeCollapser collapser(mesh);
|
edgeCollapser collapser(mesh);
|
||||||
@ -217,7 +217,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (d < mergeDim)
|
if (d < mergeDim)
|
||||||
{
|
{
|
||||||
Pout<< "Merging edge " << e << " since length " << d
|
Info<< "Merging edge " << e << " since length " << d
|
||||||
<< " << " << mergeDim << nl;
|
<< " << " << mergeDim << nl;
|
||||||
|
|
||||||
// Collapse edge to e[0]
|
// Collapse edge to e[0]
|
||||||
@ -252,7 +252,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (args.options().found("mergeFaces"))
|
if (args.options().found("mergeFaces"))
|
||||||
{
|
{
|
||||||
Pout<< "Assuming full 360 degree axisymmetric case;"
|
Info<< "Assuming full 360 degree axisymmetric case;"
|
||||||
<< " stitching faces on patches "
|
<< " stitching faces on patches "
|
||||||
<< patches[origPatchID].name() << " and "
|
<< patches[origPatchID].name() << " and "
|
||||||
<< patches[otherPatchID].name() << " together ..." << nl << endl;
|
<< patches[otherPatchID].name() << " together ..." << nl << endl;
|
||||||
|
|||||||
@ -48,7 +48,7 @@ wedge::wedge(const dictionary& dict)
|
|||||||
:
|
:
|
||||||
extrudeModel(typeName, dict),
|
extrudeModel(typeName, dict),
|
||||||
axisPt_(coeffDict_.lookup("axisPt")),
|
axisPt_(coeffDict_.lookup("axisPt")),
|
||||||
axisNormal_(coeffDict_.lookup("axisNormal")),
|
axis_(coeffDict_.lookup("axis")),
|
||||||
angle_
|
angle_
|
||||||
(
|
(
|
||||||
readScalar(coeffDict_.lookup("angle"))
|
readScalar(coeffDict_.lookup("angle"))
|
||||||
@ -96,7 +96,7 @@ point wedge::operator()
|
|||||||
// of surface point and surface normal.
|
// of surface point and surface normal.
|
||||||
point d = surfacePoint - axisPt_;
|
point d = surfacePoint - axisPt_;
|
||||||
|
|
||||||
d -= (axisNormal_ & d)*axisNormal_;
|
d -= (axis_ & d)*axis_;
|
||||||
|
|
||||||
scalar dMag = mag(d);
|
scalar dMag = mag(d);
|
||||||
|
|
||||||
@ -107,7 +107,7 @@ point wedge::operator()
|
|||||||
|
|
||||||
if (dMag > VSMALL)
|
if (dMag > VSMALL)
|
||||||
{
|
{
|
||||||
vector n = (d/dMag) ^ axisNormal_;
|
vector n = (d/dMag) ^ axis_;
|
||||||
|
|
||||||
rotatedPoint +=
|
rotatedPoint +=
|
||||||
+ cos(sliceAngle)*d
|
+ cos(sliceAngle)*d
|
||||||
@ -124,4 +124,3 @@ point wedge::operator()
|
|||||||
} // End namespace Foam
|
} // End namespace Foam
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|
||||||
|
|||||||
@ -60,13 +60,13 @@ class wedge
|
|||||||
{
|
{
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
//- point on axis
|
//- Point on axis
|
||||||
const point axisPt_;
|
const point axisPt_;
|
||||||
|
|
||||||
//- normalized direction of axis
|
//- Normalized direction of axis
|
||||||
const vector axisNormal_;
|
const vector axis_;
|
||||||
|
|
||||||
//- overall angle (radians)
|
//- Overall angle (radians)
|
||||||
const scalar angle_;
|
const scalar angle_;
|
||||||
|
|
||||||
|
|
||||||
@ -80,6 +80,7 @@ public:
|
|||||||
//- Construct from components
|
//- Construct from components
|
||||||
wedge(const dictionary& dict);
|
wedge(const dictionary& dict);
|
||||||
|
|
||||||
|
|
||||||
//- Destrcuctor
|
//- Destrcuctor
|
||||||
~wedge();
|
~wedge();
|
||||||
|
|
||||||
|
|||||||
@ -24,7 +24,7 @@ nLayers 1;
|
|||||||
wedgeCoeffs
|
wedgeCoeffs
|
||||||
{
|
{
|
||||||
axisPt (0 0 0);
|
axisPt (0 0 0);
|
||||||
axisNormal (0 -1 0);
|
axis (0 -1 0);
|
||||||
angle 2.0;
|
angle 2.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -47,4 +47,3 @@ sigmaRadialCoeffs
|
|||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
argList::validArgs.clear();
|
argList::validArgs.clear();
|
||||||
argList::noParallel();
|
argList::noParallel();
|
||||||
|
|
||||||
argList::validOptions.insert("sourceRoot", "source root");
|
|
||||||
argList::validOptions.insert("sourceCase", "source case");
|
argList::validOptions.insert("sourceCase", "source case");
|
||||||
argList::validOptions.insert("sourcePatch", "source patch");
|
argList::validOptions.insert("sourcePatch", "source patch");
|
||||||
|
|
||||||
@ -15,4 +14,3 @@
|
|||||||
{
|
{
|
||||||
FatalError.exit();
|
FatalError.exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
/* -g -DFULLDEBUG -O0 */ \
|
/* -g -DFULLDEBUG -O0 */ \
|
||||||
-I$(LIB_SRC)/decompositionAgglomeration/decompositionMethods/lnInclude \
|
-I$(LIB_SRC)/decompositionMethods/decompositionMethods/lnInclude \
|
||||||
-I$(LIB_SRC)/autoMesh/lnInclude \
|
-I$(LIB_SRC)/autoMesh/lnInclude \
|
||||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
-I$(LIB_SRC)/triSurface/lnInclude \
|
-I$(LIB_SRC)/triSurface/lnInclude \
|
||||||
@ -9,7 +9,6 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-L$(FOAM_MPI_LIBBIN) -lparMetisDecompositionMethod \
|
|
||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
-ldecompositionMethods \
|
-ldecompositionMethods \
|
||||||
-lmeshTools \
|
-lmeshTools \
|
||||||
|
|||||||
@ -274,6 +274,14 @@ addLayersControls
|
|||||||
|
|
||||||
// Create buffer region for new layer terminations
|
// Create buffer region for new layer terminations
|
||||||
nBufferCellsNoExtrude 0;
|
nBufferCellsNoExtrude 0;
|
||||||
|
|
||||||
|
|
||||||
|
// Overall max number of layer addition iterations
|
||||||
|
nLayerIter 50;
|
||||||
|
|
||||||
|
// Max number of iterations after which relaxed meshQuality controls
|
||||||
|
// get used.
|
||||||
|
nRelaxedIter 20;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -335,6 +343,16 @@ meshQualityControls
|
|||||||
nSmoothScale 4;
|
nSmoothScale 4;
|
||||||
//- amount to scale back displacement at error points
|
//- amount to scale back displacement at error points
|
||||||
errorReduction 0.75;
|
errorReduction 0.75;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Optional : some meshing phases allow usage of relaxed rules.
|
||||||
|
// See e.g. addLayersControls::nRelaxedIter.
|
||||||
|
relaxed
|
||||||
|
{
|
||||||
|
//- Maximum non-orthogonality allowed. Set to 180 to disable.
|
||||||
|
maxNonOrtho 75;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -31,7 +31,9 @@ Description
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "argList.H"
|
#include "argList.H"
|
||||||
|
#include "timeSelector.H"
|
||||||
#include "Time.H"
|
#include "Time.H"
|
||||||
|
|
||||||
#include "polyMesh.H"
|
#include "polyMesh.H"
|
||||||
#include "globalMeshData.H"
|
#include "globalMeshData.H"
|
||||||
|
|
||||||
@ -45,48 +47,34 @@ using namespace Foam;
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
timeSelector::addOptions(false); // no constant
|
||||||
# include "addRegionOption.H"
|
# include "addRegionOption.H"
|
||||||
|
|
||||||
# include "addTimeOptionsNoConstant.H"
|
|
||||||
|
|
||||||
argList::validOptions.insert("noTopology", "");
|
argList::validOptions.insert("noTopology", "");
|
||||||
argList::validOptions.insert("allGeometry", "");
|
argList::validOptions.insert("allGeometry", "");
|
||||||
argList::validOptions.insert("allTopology", "");
|
argList::validOptions.insert("allTopology", "");
|
||||||
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
|
# include "createTime.H"
|
||||||
|
instantList timeDirs = timeSelector::select0(runTime, args);
|
||||||
|
# include "createNamedPolyMesh.H"
|
||||||
|
|
||||||
const bool noTopology = args.options().found("noTopology");
|
const bool noTopology = args.options().found("noTopology");
|
||||||
const bool allGeometry = args.options().found("allGeometry");
|
const bool allGeometry = args.options().found("allGeometry");
|
||||||
const bool allTopology = args.options().found("allTopology");
|
const bool allTopology = args.options().found("allTopology");
|
||||||
|
|
||||||
# include "createTime.H"
|
forAll(timeDirs, timeI)
|
||||||
|
|
||||||
// Get times list
|
|
||||||
instantList Times = runTime.times();
|
|
||||||
|
|
||||||
# include "checkTimeOptionsNoConstant.H"
|
|
||||||
|
|
||||||
runTime.setTime(Times[startTime], startTime);
|
|
||||||
|
|
||||||
# include "createNamedPolyMesh.H"
|
|
||||||
|
|
||||||
bool firstCheck = true;
|
|
||||||
|
|
||||||
for (label i=startTime; i<endTime; i++)
|
|
||||||
{
|
{
|
||||||
runTime.setTime(Times[i], i);
|
runTime.setTime(timeDirs[timeI], timeI);
|
||||||
|
|
||||||
polyMesh::readUpdateState state = mesh.readUpdate();
|
polyMesh::readUpdateState state = mesh.readUpdate();
|
||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
firstCheck
|
!timeI
|
||||||
|| state == polyMesh::TOPO_CHANGE
|
|| state == polyMesh::TOPO_CHANGE
|
||||||
|| state == polyMesh::TOPO_PATCH_CHANGE
|
|| state == polyMesh::TOPO_PATCH_CHANGE
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
firstCheck = false;
|
|
||||||
|
|
||||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||||
|
|
||||||
// Clear mesh before checking
|
// Clear mesh before checking
|
||||||
@ -110,32 +98,30 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (noFailedChecks == 0)
|
if (noFailedChecks == 0)
|
||||||
{
|
{
|
||||||
Info<< "\nMesh OK."
|
Info<< "\nMesh OK.\n" << endl;
|
||||||
<< nl << endl;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Info<< "\nFailed " << noFailedChecks << " mesh checks."
|
Info<< "\nFailed " << noFailedChecks << " mesh checks.\n"
|
||||||
<< nl << endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (state == polyMesh::POINTS_MOVED)
|
else if (state == polyMesh::POINTS_MOVED)
|
||||||
{
|
{
|
||||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||||
|
|
||||||
label noFailedChecks = checkGeometry(mesh, allGeometry);
|
label nFailedChecks = checkGeometry(mesh, allGeometry);
|
||||||
|
|
||||||
reduce(noFailedChecks, sumOp<label>());
|
reduce(nFailedChecks, sumOp<label>());
|
||||||
|
|
||||||
if (noFailedChecks == 0)
|
if (nFailedChecks)
|
||||||
{
|
{
|
||||||
Info << "\nMesh OK."
|
Info<< "\nFailed " << nFailedChecks << " mesh checks.\n"
|
||||||
<< nl << endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Info<< "\nFailed " << noFailedChecks << " mesh checks."
|
Info << "\nMesh OK.\n" << endl;
|
||||||
<< nl << endl;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -54,6 +54,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
argList::validArgs.append("set");
|
argList::validArgs.append("set");
|
||||||
argList::validArgs.append("patch");
|
argList::validArgs.append("patch");
|
||||||
|
argList::validOptions.insert("additionalPatches", "(patch2 .. patchN)");
|
||||||
argList::validOptions.insert("overwrite", "");
|
argList::validOptions.insert("overwrite", "");
|
||||||
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
@ -67,25 +68,61 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
// Faces to baffle
|
// Faces to baffle
|
||||||
word setName(args.additionalArgs()[0]);
|
word setName(args.additionalArgs()[0]);
|
||||||
Pout<< "Reading faceSet from " << setName << nl << endl;
|
Info<< "Reading faceSet from " << setName << nl << endl;
|
||||||
faceSet facesToSplit(mesh, setName);
|
faceSet facesToSplit(mesh, setName);
|
||||||
Pout<< "Read " << facesToSplit.size() << " faces from " << setName
|
// Make sure set is synchronised across couples
|
||||||
<< nl << endl;
|
facesToSplit.sync(mesh);
|
||||||
|
Info<< "Read " << returnReduce(facesToSplit.size(), sumOp<label>())
|
||||||
|
<< " faces from " << setName << nl << endl;
|
||||||
|
|
||||||
|
|
||||||
|
// Patches to put baffles into
|
||||||
|
labelList newPatches(1);
|
||||||
|
|
||||||
// Patch to put them into
|
|
||||||
word patchName(args.additionalArgs()[1]);
|
word patchName(args.additionalArgs()[1]);
|
||||||
label wantedPatchI = patches.findPatchID(patchName);
|
newPatches[0] = patches.findPatchID(patchName);
|
||||||
|
Info<< "Using patch " << patchName
|
||||||
|
<< " at index " << newPatches[0] << endl;
|
||||||
|
|
||||||
Pout<< "Using patch " << patchName << " at index " << wantedPatchI << endl;
|
if (newPatches[0] == -1)
|
||||||
|
|
||||||
if (wantedPatchI == -1)
|
|
||||||
{
|
{
|
||||||
FatalErrorIn(args.executable())
|
FatalErrorIn(args.executable())
|
||||||
<< "Cannot find patch " << patchName << exit(FatalError);
|
<< "Cannot find patch " << patchName << endl
|
||||||
|
<< "Valid patches are " << patches.names() << exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Additional patches
|
||||||
|
if (args.options().found("additionalPatches"))
|
||||||
|
{
|
||||||
|
const wordList patchNames
|
||||||
|
(
|
||||||
|
IStringStream(args.options()["additionalPatches"])()
|
||||||
|
);
|
||||||
|
|
||||||
|
forAll(patchNames, i)
|
||||||
|
{
|
||||||
|
label patchI = patches.findPatchID(patchNames[i]);
|
||||||
|
Info<< "Using additional patch " << patchNames[i]
|
||||||
|
<< " at index " << patchI << endl;
|
||||||
|
|
||||||
|
if (patchI == -1)
|
||||||
|
{
|
||||||
|
FatalErrorIn(args.executable())
|
||||||
|
<< "Cannot find patch " << patchNames[i] << endl
|
||||||
|
<< "Valid patches are " << patches.names()
|
||||||
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
newPatches.append(patchI);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool overwrite = args.options().found("overwrite");
|
bool overwrite = args.options().found("overwrite");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Read objects in time directory
|
// Read objects in time directory
|
||||||
IOobjectList objects(mesh, runTime.timeName());
|
IOobjectList objects(mesh, runTime.timeName());
|
||||||
|
|
||||||
@ -128,55 +165,20 @@ int main(int argc, char *argv[])
|
|||||||
polyTopoChange meshMod(mesh);
|
polyTopoChange meshMod(mesh);
|
||||||
|
|
||||||
|
|
||||||
// Creating baffles:
|
// Do the actual changes
|
||||||
// - coupled boundary faces : become the patch specified
|
// Note order in which faces are modified/added is so they end up correctly
|
||||||
// - non-coupled ,, : illegal
|
// for cyclic patches (original faces first and then reversed faces)
|
||||||
// - internal faces : converted into boundary faces.
|
// since otherwise it will have trouble matching baffles.
|
||||||
|
|
||||||
labelList newPatch(mesh.nFaces(), -1);
|
|
||||||
|
|
||||||
forAllConstIter(faceSet, facesToSplit, iter)
|
|
||||||
{
|
|
||||||
label faceI = iter.key();
|
|
||||||
|
|
||||||
label patchI = patches.whichPatch(faceI);
|
|
||||||
|
|
||||||
if (patchI == -1)
|
|
||||||
{
|
|
||||||
newPatch[faceI] = wantedPatchI;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (patches[patchI].coupled())
|
|
||||||
{
|
|
||||||
if (patchI != wantedPatchI)
|
|
||||||
{
|
|
||||||
newPatch[faceI] = wantedPatchI;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
FatalErrorIn(args.executable())
|
|
||||||
<< "Can only create baffles from internal faces"
|
|
||||||
<< " or coupled boundary faces." << endl
|
|
||||||
<< "Face " << faceI << " is a boundary face on patch "
|
|
||||||
<< patches[patchI].name() << exit(FatalError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// If one side of a coupled boundary is marked for baffling, make sure to
|
|
||||||
// also do the other side.
|
|
||||||
|
|
||||||
syncTools::syncFaceList(mesh, newPatch, maxEqOp<label>(), false);
|
|
||||||
|
|
||||||
|
|
||||||
label nBaffled = 0;
|
label nBaffled = 0;
|
||||||
|
|
||||||
forAll(newPatch, faceI)
|
forAll(newPatches, i)
|
||||||
{
|
{
|
||||||
if (newPatch[faceI] != -1)
|
label newPatchI = newPatches[i];
|
||||||
|
|
||||||
|
for (label faceI = 0; faceI < mesh.nInternalFaces(); faceI++)
|
||||||
|
{
|
||||||
|
if (facesToSplit.found(faceI))
|
||||||
{
|
{
|
||||||
const face& f = mesh.faces()[faceI];
|
const face& f = mesh.faces()[faceI];
|
||||||
label zoneID = faceZones.whichZone(faceI);
|
label zoneID = faceZones.whichZone(faceI);
|
||||||
@ -187,6 +189,9 @@ int main(int argc, char *argv[])
|
|||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
|
zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (i == 0)
|
||||||
|
{
|
||||||
|
// First usage of face. Modify.
|
||||||
meshMod.setAction
|
meshMod.setAction
|
||||||
(
|
(
|
||||||
polyModifyFace
|
polyModifyFace
|
||||||
@ -196,27 +201,28 @@ int main(int argc, char *argv[])
|
|||||||
mesh.faceOwner()[faceI], // owner
|
mesh.faceOwner()[faceI], // owner
|
||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
newPatch[faceI], // patch for face
|
newPatchI, // patch for face
|
||||||
false, // remove from zone
|
false, // remove from zone
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
zoneFlip // face flip in zone
|
zoneFlip // face flip in zone
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
}
|
||||||
if (mesh.isInternalFace(faceI))
|
else
|
||||||
{
|
{
|
||||||
|
// Second or more usage of face. Add.
|
||||||
meshMod.setAction
|
meshMod.setAction
|
||||||
(
|
(
|
||||||
polyAddFace
|
polyAddFace
|
||||||
(
|
(
|
||||||
f.reverseFace(), // modified face
|
f, // modified face
|
||||||
mesh.faceNeighbour()[faceI],// owner
|
mesh.faceOwner()[faceI], // owner
|
||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
-1, // masterPointID
|
-1, // master point
|
||||||
-1, // masterEdgeID
|
-1, // master edge
|
||||||
faceI, // masterFaceID,
|
faceI, // master face
|
||||||
false, // face flip
|
false, // face flip
|
||||||
newPatch[faceI], // patch for face
|
newPatchI, // patch for face
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
zoneFlip // face flip in zone
|
zoneFlip // face flip in zone
|
||||||
)
|
)
|
||||||
@ -227,8 +233,118 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add the reversed face.
|
||||||
|
for (label faceI = 0; faceI < mesh.nInternalFaces(); faceI++)
|
||||||
|
{
|
||||||
|
if (facesToSplit.found(faceI))
|
||||||
|
{
|
||||||
|
const face& f = mesh.faces()[faceI];
|
||||||
|
label zoneID = faceZones.whichZone(faceI);
|
||||||
|
bool zoneFlip = false;
|
||||||
|
if (zoneID >= 0)
|
||||||
|
{
|
||||||
|
const faceZone& fZone = faceZones[zoneID];
|
||||||
|
zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
|
||||||
|
}
|
||||||
|
label nei = mesh.faceNeighbour()[faceI];
|
||||||
|
|
||||||
Pout<< "Converted locally " << nBaffled
|
meshMod.setAction
|
||||||
|
(
|
||||||
|
polyAddFace
|
||||||
|
(
|
||||||
|
f.reverseFace(), // modified face
|
||||||
|
nei, // owner
|
||||||
|
-1, // neighbour
|
||||||
|
-1, // masterPointID
|
||||||
|
-1, // masterEdgeID
|
||||||
|
faceI, // masterFaceID,
|
||||||
|
true, // face flip
|
||||||
|
newPatchI, // patch for face
|
||||||
|
zoneID, // zone for face
|
||||||
|
zoneFlip // face flip in zone
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
nBaffled++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Modify any boundary faces
|
||||||
|
forAll(patches, patchI)
|
||||||
|
{
|
||||||
|
const polyPatch& pp = patches[patchI];
|
||||||
|
|
||||||
|
if (patches[newPatchI].coupled() && pp.coupled())
|
||||||
|
{
|
||||||
|
// Do not allow coupled faces to be moved to different coupled
|
||||||
|
// patches.
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
forAll(pp, i)
|
||||||
|
{
|
||||||
|
label faceI = pp.start()+i;
|
||||||
|
|
||||||
|
if (facesToSplit.found(faceI))
|
||||||
|
{
|
||||||
|
const face& f = mesh.faces()[faceI];
|
||||||
|
label zoneID = faceZones.whichZone(faceI);
|
||||||
|
bool zoneFlip = false;
|
||||||
|
if (zoneID >= 0)
|
||||||
|
{
|
||||||
|
const faceZone& fZone = faceZones[zoneID];
|
||||||
|
zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (i == 0)
|
||||||
|
{
|
||||||
|
// First usage of face. Modify.
|
||||||
|
meshMod.setAction
|
||||||
|
(
|
||||||
|
polyModifyFace
|
||||||
|
(
|
||||||
|
f, // modified face
|
||||||
|
faceI, // label of face
|
||||||
|
mesh.faceOwner()[faceI],// owner
|
||||||
|
-1, // neighbour
|
||||||
|
false, // face flip
|
||||||
|
newPatchI, // patch for face
|
||||||
|
false, // remove from zone
|
||||||
|
zoneID, // zone for face
|
||||||
|
zoneFlip // face flip in zone
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Second or more usage of face. Add.
|
||||||
|
meshMod.setAction
|
||||||
|
(
|
||||||
|
polyAddFace
|
||||||
|
(
|
||||||
|
f, // modified face
|
||||||
|
mesh.faceOwner()[faceI],// owner
|
||||||
|
-1, // neighbour
|
||||||
|
-1, // master point
|
||||||
|
-1, // master edge
|
||||||
|
faceI, // master face
|
||||||
|
false, // face flip
|
||||||
|
newPatchI, // patch for face
|
||||||
|
zoneID, // zone for face
|
||||||
|
zoneFlip // face flip in zone
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
nBaffled++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Info<< "Converted " << returnReduce(nBaffled, sumOp<label>())
|
||||||
<< " faces into boundary faces on patch " << patchName << nl << endl;
|
<< " faces into boundary faces on patch " << patchName << nl << endl;
|
||||||
|
|
||||||
if (!overwrite)
|
if (!overwrite)
|
||||||
@ -252,7 +368,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
mesh.setInstance(oldInstance);
|
mesh.setInstance(oldInstance);
|
||||||
}
|
}
|
||||||
Pout<< "Writing mesh to " << runTime.timeName() << endl;
|
Info<< "Writing mesh to " << runTime.timeName() << endl;
|
||||||
|
|
||||||
mesh.write();
|
mesh.write();
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
-I$(LIB_SRC)/decompositionAgglomeration/decompositionMethods/lnInclude
|
-I$(LIB_SRC)/decompositionMethods/decompositionMethods/lnInclude
|
||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-lmeshTools \
|
-lmeshTools \
|
||||||
|
|||||||
@ -31,6 +31,7 @@ Description
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "argList.H"
|
#include "argList.H"
|
||||||
|
#include "timeSelector.H"
|
||||||
#include "Time.H"
|
#include "Time.H"
|
||||||
#include "fvMesh.H"
|
#include "fvMesh.H"
|
||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
@ -66,7 +67,8 @@ void RotateFields
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
# include "addTimeOptions.H"
|
timeSelector::addOptions();
|
||||||
|
|
||||||
argList::validArgs.append("n1");
|
argList::validArgs.append("n1");
|
||||||
argList::validArgs.append("n2");
|
argList::validArgs.append("n2");
|
||||||
|
|
||||||
@ -105,19 +107,15 @@ int main(int argc, char *argv[])
|
|||||||
points.write();
|
points.write();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get times list
|
|
||||||
instantList Times = runTime.times();
|
|
||||||
|
|
||||||
// set startTime and endTime depending on -time and -latestTime options
|
instantList timeDirs = timeSelector::select0(runTime, args);
|
||||||
# include "checkTimeOptions.H"
|
|
||||||
|
|
||||||
runTime.setTime(Times[startTime], startTime);
|
|
||||||
|
|
||||||
# include "createMesh.H"
|
# include "createMesh.H"
|
||||||
|
|
||||||
for (label i=startTime; i<endTime; i++)
|
|
||||||
|
forAll(timeDirs, timeI)
|
||||||
{
|
{
|
||||||
runTime.setTime(Times[i], i);
|
runTime.setTime(timeDirs[timeI], timeI);
|
||||||
|
|
||||||
Info<< "Time = " << runTime.timeName() << endl;
|
Info<< "Time = " << runTime.timeName() << endl;
|
||||||
|
|
||||||
|
|||||||
@ -70,7 +70,7 @@ void writePointSet
|
|||||||
|
|
||||||
labelList pointLabels(set.toc());
|
labelList pointLabels(set.toc());
|
||||||
|
|
||||||
pointField setPoints(IndirectList<point>(mesh.points(), pointLabels)());
|
pointField setPoints(mesh.points(), pointLabels);
|
||||||
|
|
||||||
// Write points
|
// Write points
|
||||||
|
|
||||||
|
|||||||
@ -48,6 +48,7 @@ Description
|
|||||||
#include "OFstream.H"
|
#include "OFstream.H"
|
||||||
#include "IFstream.H"
|
#include "IFstream.H"
|
||||||
#include "IOobjectList.H"
|
#include "IOobjectList.H"
|
||||||
|
#include "SortableList.H"
|
||||||
|
|
||||||
using namespace Foam;
|
using namespace Foam;
|
||||||
|
|
||||||
@ -107,6 +108,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
// Not in memory. Load it.
|
// Not in memory. Load it.
|
||||||
pointSet set(*iter());
|
pointSet set(*iter());
|
||||||
|
SortableList<label> pointLabels(set.toc());
|
||||||
|
|
||||||
label zoneID = mesh.pointZones().findZoneID(set.name());
|
label zoneID = mesh.pointZones().findZoneID(set.name());
|
||||||
if (zoneID == -1)
|
if (zoneID == -1)
|
||||||
@ -120,7 +122,7 @@ int main(int argc, char *argv[])
|
|||||||
new pointZone
|
new pointZone
|
||||||
(
|
(
|
||||||
set.name(), //name
|
set.name(), //name
|
||||||
set.toc(), //addressing
|
pointLabels, //addressing
|
||||||
sz, //index
|
sz, //index
|
||||||
mesh.pointZones() //pointZoneMesh
|
mesh.pointZones() //pointZoneMesh
|
||||||
)
|
)
|
||||||
@ -131,7 +133,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
Info<< "Overwriting contents of existing pointZone " << zoneID
|
Info<< "Overwriting contents of existing pointZone " << zoneID
|
||||||
<< " with that of set " << set.name() << "." << endl;
|
<< " with that of set " << set.name() << "." << endl;
|
||||||
mesh.pointZones()[zoneID] = set.toc();
|
mesh.pointZones()[zoneID] = pointLabels;
|
||||||
mesh.pointZones().writeOpt() = IOobject::AUTO_WRITE;
|
mesh.pointZones().writeOpt() = IOobject::AUTO_WRITE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -150,6 +152,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
// Not in memory. Load it.
|
// Not in memory. Load it.
|
||||||
cellSet set(*iter());
|
cellSet set(*iter());
|
||||||
|
SortableList<label> cellLabels(set.toc());
|
||||||
|
|
||||||
label zoneID = mesh.cellZones().findZoneID(set.name());
|
label zoneID = mesh.cellZones().findZoneID(set.name());
|
||||||
if (zoneID == -1)
|
if (zoneID == -1)
|
||||||
@ -163,7 +166,7 @@ int main(int argc, char *argv[])
|
|||||||
new cellZone
|
new cellZone
|
||||||
(
|
(
|
||||||
set.name(), //name
|
set.name(), //name
|
||||||
set.toc(), //addressing
|
cellLabels, //addressing
|
||||||
sz, //index
|
sz, //index
|
||||||
mesh.cellZones() //pointZoneMesh
|
mesh.cellZones() //pointZoneMesh
|
||||||
)
|
)
|
||||||
@ -174,7 +177,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
Info<< "Overwriting contents of existing cellZone " << zoneID
|
Info<< "Overwriting contents of existing cellZone " << zoneID
|
||||||
<< " with that of set " << set.name() << "." << endl;
|
<< " with that of set " << set.name() << "." << endl;
|
||||||
mesh.cellZones()[zoneID] = set.toc();
|
mesh.cellZones()[zoneID] = cellLabels;
|
||||||
mesh.cellZones().writeOpt() = IOobject::AUTO_WRITE;
|
mesh.cellZones().writeOpt() = IOobject::AUTO_WRITE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -193,6 +196,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
// Not in memory. Load it.
|
// Not in memory. Load it.
|
||||||
faceSet set(*iter());
|
faceSet set(*iter());
|
||||||
|
SortableList<label> faceLabels(set.toc());
|
||||||
|
|
||||||
DynamicList<label> addressing(set.size());
|
DynamicList<label> addressing(set.size());
|
||||||
DynamicList<bool> flipMap(set.size());
|
DynamicList<bool> flipMap(set.size());
|
||||||
@ -214,9 +218,9 @@ int main(int argc, char *argv[])
|
|||||||
// Load corresponding cells
|
// Load corresponding cells
|
||||||
cellSet cells(mesh, setName);
|
cellSet cells(mesh, setName);
|
||||||
|
|
||||||
forAllConstIter(faceSet, set, iter)
|
forAll(faceLabels, i)
|
||||||
{
|
{
|
||||||
label faceI = iter.key();
|
label faceI = faceLabels[i];
|
||||||
|
|
||||||
bool flip = false;
|
bool flip = false;
|
||||||
|
|
||||||
@ -273,9 +277,10 @@ int main(int argc, char *argv[])
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// No flip map.
|
// No flip map.
|
||||||
forAllConstIter(faceSet, set, iter)
|
forAll(faceLabels, i)
|
||||||
{
|
{
|
||||||
addressing.append(iter.key());
|
label faceI = faceLabels[i];
|
||||||
|
addressing.append(faceI);
|
||||||
flipMap.append(false);
|
flipMap.append(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,14 +22,11 @@ License
|
|||||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
Description
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "regionSide.H"
|
#include "regionSide.H"
|
||||||
#include "meshTools.H"
|
#include "meshTools.H"
|
||||||
#include "primitiveMesh.H"
|
#include "primitiveMesh.H"
|
||||||
#include "IndirectList.H"
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
@ -113,7 +110,7 @@ Foam::label Foam::regionSide::otherEdge
|
|||||||
) << "Cannot find other edge on face " << faceI << " that uses point "
|
) << "Cannot find other edge on face " << faceI << " that uses point "
|
||||||
<< pointI << " but not point " << freePointI << endl
|
<< pointI << " but not point " << freePointI << endl
|
||||||
<< "Edges on face:" << fEdges
|
<< "Edges on face:" << fEdges
|
||||||
<< " verts:" << IndirectList<edge>(mesh.edges(), fEdges)()
|
<< " verts:" << UIndirectList<edge>(mesh.edges(), fEdges)()
|
||||||
<< " Vertices on face:"
|
<< " Vertices on face:"
|
||||||
<< mesh.faces()[faceI]
|
<< mesh.faces()[faceI]
|
||||||
<< " Vertices on original edge:" << e << abort(FatalError);
|
<< " Vertices on original edge:" << e << abort(FatalError);
|
||||||
|
|||||||
@ -50,15 +50,12 @@ Description
|
|||||||
#include "attachDetach.H"
|
#include "attachDetach.H"
|
||||||
#include "attachPolyTopoChanger.H"
|
#include "attachPolyTopoChanger.H"
|
||||||
#include "regionSide.H"
|
#include "regionSide.H"
|
||||||
|
#include "primitiveFacePatch.H"
|
||||||
|
|
||||||
using namespace Foam;
|
using namespace Foam;
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// Calculation engine for set of faces in a mesh
|
|
||||||
typedef PrimitivePatch<face, List, const pointField&> facePatch;
|
|
||||||
|
|
||||||
|
|
||||||
// Find edge between points v0 and v1.
|
// Find edge between points v0 and v1.
|
||||||
label findEdge(const primitiveMesh& mesh, const label v0, const label v1)
|
label findEdge(const primitiveMesh& mesh, const label v0, const label v1)
|
||||||
{
|
{
|
||||||
@ -163,10 +160,16 @@ int main(int argc, char *argv[])
|
|||||||
// set of edges on side of this region. Use PrimitivePatch to find these.
|
// set of edges on side of this region. Use PrimitivePatch to find these.
|
||||||
//
|
//
|
||||||
|
|
||||||
IndirectList<face> zoneFaces(mesh.faces(), faces);
|
|
||||||
|
|
||||||
// Addressing on faces only in mesh vertices.
|
// Addressing on faces only in mesh vertices.
|
||||||
facePatch fPatch(zoneFaces(), mesh.points());
|
primitiveFacePatch fPatch
|
||||||
|
(
|
||||||
|
UIndirectList<face>
|
||||||
|
(
|
||||||
|
mesh.faces(),
|
||||||
|
faces
|
||||||
|
),
|
||||||
|
mesh.points()
|
||||||
|
);
|
||||||
|
|
||||||
const labelList& meshPoints = fPatch.meshPoints();
|
const labelList& meshPoints = fPatch.meshPoints();
|
||||||
|
|
||||||
|
|||||||
@ -57,6 +57,7 @@ Description
|
|||||||
#include "EdgeMap.H"
|
#include "EdgeMap.H"
|
||||||
#include "syncTools.H"
|
#include "syncTools.H"
|
||||||
#include "ReadFields.H"
|
#include "ReadFields.H"
|
||||||
|
#include "directMappedWallPolyPatch.H"
|
||||||
|
|
||||||
using namespace Foam;
|
using namespace Foam;
|
||||||
|
|
||||||
@ -1022,13 +1023,13 @@ EdgeMap<label> addRegionPatches
|
|||||||
(
|
(
|
||||||
mesh,
|
mesh,
|
||||||
regionNames[e[0]] + "_to_" + regionNames[e[1]],
|
regionNames[e[0]] + "_to_" + regionNames[e[1]],
|
||||||
polyPatch::typeName
|
directMappedWallPolyPatch::typeName
|
||||||
);
|
);
|
||||||
addPatch
|
addPatch
|
||||||
(
|
(
|
||||||
mesh,
|
mesh,
|
||||||
regionNames[e[1]] + "_to_" + regionNames[e[0]],
|
regionNames[e[1]] + "_to_" + regionNames[e[0]],
|
||||||
polyPatch::typeName
|
directMappedWallPolyPatch::typeName
|
||||||
);
|
);
|
||||||
|
|
||||||
Info<< "For interface between region " << e[0]
|
Info<< "For interface between region " << e[0]
|
||||||
@ -1100,7 +1101,6 @@ EdgeMap<label> addRegionPatches
|
|||||||
//}
|
//}
|
||||||
|
|
||||||
|
|
||||||
//XXXXXXXXX
|
|
||||||
// Find region that covers most of cell zone
|
// Find region that covers most of cell zone
|
||||||
label findCorrespondingRegion
|
label findCorrespondingRegion
|
||||||
(
|
(
|
||||||
@ -1152,7 +1152,6 @@ label findCorrespondingRegion
|
|||||||
|
|
||||||
return regionI;
|
return regionI;
|
||||||
}
|
}
|
||||||
//XXXXXXXXX
|
|
||||||
|
|
||||||
|
|
||||||
//// Checks if cellZone has corresponding cellRegion.
|
//// Checks if cellZone has corresponding cellRegion.
|
||||||
|
|||||||
@ -60,7 +60,6 @@ Description
|
|||||||
#include "polyTopoChanger.H"
|
#include "polyTopoChanger.H"
|
||||||
#include "mapPolyMesh.H"
|
#include "mapPolyMesh.H"
|
||||||
#include "ListOps.H"
|
#include "ListOps.H"
|
||||||
#include "IndirectList.H"
|
|
||||||
#include "slidingInterface.H"
|
#include "slidingInterface.H"
|
||||||
#include "perfectInterface.H"
|
#include "perfectInterface.H"
|
||||||
#include "IOobjectList.H"
|
#include "IOobjectList.H"
|
||||||
|
|||||||
@ -35,14 +35,22 @@ Description
|
|||||||
-rotate (vector vector)
|
-rotate (vector vector)
|
||||||
Rotates the points from the first vector to the second,
|
Rotates the points from the first vector to the second,
|
||||||
|
|
||||||
|
or -yawPitchRoll (yawdegrees pitchdegrees rolldegrees)
|
||||||
|
or -rollPitchYaw (rolldegrees pitchdegrees yawdegrees)
|
||||||
|
|
||||||
-scale vector
|
-scale vector
|
||||||
Scales the points by the given vector.
|
Scales the points by the given vector.
|
||||||
|
|
||||||
The any or all of the three options may be specified and are processed
|
The any or all of the three options may be specified and are processed
|
||||||
in the above order.
|
in the above order.
|
||||||
|
|
||||||
With -rotateFields (in combination with -rotate) it will also
|
With -rotateFields (in combination with -rotate/yawPitchRoll/rollPitchYaw)
|
||||||
read & transform vector & tensor fields.
|
it will also read & transform vector & tensor fields.
|
||||||
|
|
||||||
|
Note:
|
||||||
|
yaw (rotation about z)
|
||||||
|
pitch (rotation about y)
|
||||||
|
roll (rotation about x)
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
@ -58,6 +66,7 @@ Description
|
|||||||
#include "IStringStream.H"
|
#include "IStringStream.H"
|
||||||
|
|
||||||
using namespace Foam;
|
using namespace Foam;
|
||||||
|
using namespace Foam::mathematicalConstant;
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -131,6 +140,8 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
argList::validOptions.insert("translate", "vector");
|
argList::validOptions.insert("translate", "vector");
|
||||||
argList::validOptions.insert("rotate", "(vector vector)");
|
argList::validOptions.insert("rotate", "(vector vector)");
|
||||||
|
argList::validOptions.insert("rollPitchYaw", "(roll pitch yaw)");
|
||||||
|
argList::validOptions.insert("yawPitchRoll", "(yaw pitch roll)");
|
||||||
argList::validOptions.insert("rotateFields", "");
|
argList::validOptions.insert("rotateFields", "");
|
||||||
argList::validOptions.insert("scale", "vector");
|
argList::validOptions.insert("scale", "vector");
|
||||||
|
|
||||||
@ -185,6 +196,58 @@ int main(int argc, char *argv[])
|
|||||||
rotateFields(runTime, T);
|
rotateFields(runTime, T);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (args.options().found("rollPitchYaw"))
|
||||||
|
{
|
||||||
|
vector v(IStringStream(args.options()["rollPitchYaw"])());
|
||||||
|
|
||||||
|
Info<< "Rotating points by" << nl
|
||||||
|
<< " roll " << v.x() << nl
|
||||||
|
<< " pitch " << v.y() << nl
|
||||||
|
<< " yaw " << v.z() << endl;
|
||||||
|
|
||||||
|
|
||||||
|
// Convert to radians
|
||||||
|
v *= pi/180.0;
|
||||||
|
|
||||||
|
quaternion R(v.x(), v.y(), v.z());
|
||||||
|
|
||||||
|
Info<< "Rotating points by quaternion " << R << endl;
|
||||||
|
points = transform(R, points);
|
||||||
|
|
||||||
|
if (args.options().found("rotateFields"))
|
||||||
|
{
|
||||||
|
rotateFields(runTime, R.R());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (args.options().found("yawPitchRoll"))
|
||||||
|
{
|
||||||
|
vector v(IStringStream(args.options()["yawPitchRoll"])());
|
||||||
|
|
||||||
|
Info<< "Rotating points by" << nl
|
||||||
|
<< " yaw " << v.x() << nl
|
||||||
|
<< " pitch " << v.y() << nl
|
||||||
|
<< " roll " << v.z() << endl;
|
||||||
|
|
||||||
|
|
||||||
|
// Convert to radians
|
||||||
|
v *= pi/180.0;
|
||||||
|
|
||||||
|
scalar yaw = v.x();
|
||||||
|
scalar pitch = v.y();
|
||||||
|
scalar roll = v.z();
|
||||||
|
|
||||||
|
quaternion R = quaternion(vector(0, 0, 1), yaw);
|
||||||
|
R *= quaternion(vector(0, 1, 0), pitch);
|
||||||
|
R *= quaternion(vector(1, 0, 0), roll);
|
||||||
|
|
||||||
|
Info<< "Rotating points by quaternion " << R << endl;
|
||||||
|
points = transform(R, points);
|
||||||
|
|
||||||
|
if (args.options().found("rotateFields"))
|
||||||
|
{
|
||||||
|
rotateFields(runTime, R.R());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (args.options().found("scale"))
|
if (args.options().found("scale"))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -29,6 +29,9 @@ Description
|
|||||||
|
|
||||||
#include "argList.H"
|
#include "argList.H"
|
||||||
#include "dictionary.H"
|
#include "dictionary.H"
|
||||||
|
#include "IFstream.H"
|
||||||
|
#include "IOobject.H"
|
||||||
|
#include "HashSet.H"
|
||||||
|
|
||||||
using namespace Foam;
|
using namespace Foam;
|
||||||
|
|
||||||
@ -38,18 +41,108 @@ using namespace Foam;
|
|||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
argList::noParallel();
|
argList::noParallel();
|
||||||
|
argList::validOptions.insert("new", "");
|
||||||
|
argList::validOptions.insert("old", "");
|
||||||
|
|
||||||
wordList ds(debug::debugSwitches().toc());
|
Foam::argList args(argc, argv);
|
||||||
sort(ds);
|
|
||||||
Info<< "debug switches: " << ds << endl;
|
wordList currDebug(debug::debugSwitches().toc());
|
||||||
|
wordList currInfo(debug::infoSwitches().toc());
|
||||||
|
wordList currOpt(debug::optimisationSwitches().toc());
|
||||||
|
|
||||||
|
if (args.options().found("old") || args.options().found("new"))
|
||||||
|
{
|
||||||
|
dictionary controlDict(IFstream(findEtcFile("controlDict", true))());
|
||||||
|
|
||||||
|
wordHashSet oldDebug
|
||||||
|
(
|
||||||
|
controlDict.subDict("DebugSwitches").toc()
|
||||||
|
);
|
||||||
|
|
||||||
|
wordHashSet oldInfo
|
||||||
|
(
|
||||||
|
controlDict.subDict("InfoSwitches").toc()
|
||||||
|
);
|
||||||
|
|
||||||
|
wordHashSet oldOpt
|
||||||
|
(
|
||||||
|
controlDict.subDict("OptimisationSwitches").toc()
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
wordHashSet hashset;
|
||||||
|
wordList listing;
|
||||||
|
|
||||||
|
|
||||||
|
// list old switches - but this can't work since the (old) inserted
|
||||||
|
// switches are in both sets
|
||||||
|
// Workaround:
|
||||||
|
// 1. run without any options (get complete list)
|
||||||
|
// 2. comment out DebugSwitches, run again with -new to find new ones
|
||||||
|
// and do a diff
|
||||||
|
if (args.options().found("old"))
|
||||||
|
{
|
||||||
|
IOobject::writeDivider(Info);
|
||||||
|
|
||||||
|
hashset = oldDebug;
|
||||||
|
hashset -= currDebug;
|
||||||
|
listing = hashset.toc();
|
||||||
|
sort(listing);
|
||||||
|
Info<< "old DebugSwitches: " << listing << endl;
|
||||||
|
|
||||||
|
hashset = oldInfo;
|
||||||
|
hashset -= currInfo;
|
||||||
|
listing = hashset.toc();
|
||||||
|
sort(listing);
|
||||||
|
Info<< "old InfoSwitches: " << listing << endl;
|
||||||
|
|
||||||
|
hashset = oldOpt;
|
||||||
|
hashset -= currOpt;
|
||||||
|
listing = hashset.toc();
|
||||||
|
sort(listing);
|
||||||
|
Info<< "old OptimisationSwitches: " << listing << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
// list new switches
|
||||||
|
if (args.options().found("new"))
|
||||||
|
{
|
||||||
|
IOobject::writeDivider(Info);
|
||||||
|
|
||||||
|
hashset = currDebug;
|
||||||
|
hashset -= oldDebug;
|
||||||
|
|
||||||
|
listing = hashset.toc();
|
||||||
|
sort(listing);
|
||||||
|
Info<< "new DebugSwitches: " << listing << endl;
|
||||||
|
|
||||||
|
hashset = currInfo;
|
||||||
|
hashset -= oldInfo;
|
||||||
|
listing = hashset.toc();
|
||||||
|
sort(listing);
|
||||||
|
Info<< "new InfoSwitches: " << listing << endl;
|
||||||
|
|
||||||
|
hashset = currOpt;
|
||||||
|
hashset -= oldOpt;
|
||||||
|
listing = hashset.toc();
|
||||||
|
sort(listing);
|
||||||
|
Info<< "new OptimisationSwitches: " << listing << endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
IOobject::writeDivider(Info);
|
||||||
|
|
||||||
|
sort(currDebug);
|
||||||
|
Info<< "DebugSwitches: " << currDebug << endl;
|
||||||
|
|
||||||
|
sort(currInfo);
|
||||||
|
Info<< "InfoSwitches: " << currInfo << endl;
|
||||||
|
|
||||||
|
sort(currOpt);
|
||||||
|
Info<< "OptimisationSwitches: " << currOpt << endl;
|
||||||
|
}
|
||||||
|
|
||||||
wordList is(debug::infoSwitches().toc());
|
|
||||||
sort(is);
|
|
||||||
Info<< "info switches: " << is << endl;
|
|
||||||
|
|
||||||
wordList os(debug::optimisationSwitches().toc());
|
|
||||||
sort(os);
|
|
||||||
Info<< "optimisation switches: " << os << endl;
|
|
||||||
|
|
||||||
Info<< "done" << endl;
|
Info<< "done" << endl;
|
||||||
|
|
||||||
|
|||||||
@ -40,25 +40,19 @@ Description
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
timeSelector::addOptions();
|
||||||
|
|
||||||
# include "addTimeOptions.H"
|
|
||||||
# include "addRegionOption.H"
|
# include "addRegionOption.H"
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
|
|
||||||
// Get times list
|
instantList timeDirs = timeSelector::select0(runTime, args);
|
||||||
instantList Times = runTime.times();
|
|
||||||
|
|
||||||
// set startTime and endTime depending on -time and -latestTime options
|
|
||||||
# include "checkTimeOptions.H"
|
|
||||||
|
|
||||||
runTime.setTime(Times[startTime], startTime);
|
|
||||||
|
|
||||||
# include "createNamedMesh.H"
|
# include "createNamedMesh.H"
|
||||||
|
|
||||||
for (label i=startTime; i<endTime; i++)
|
forAll(timeDirs, timeI)
|
||||||
{
|
{
|
||||||
runTime.setTime(Times[i], i);
|
runTime.setTime(timeDirs[timeI], timeI);
|
||||||
|
|
||||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
-I$(LIB_SRC)/decompositionAgglomeration/decompositionMethods/lnInclude \
|
-I$(LIB_SRC)/decompositionMethods/decompositionMethods/lnInclude \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/meshTools/lnInclude
|
-I$(LIB_SRC)/meshTools/lnInclude
|
||||||
|
|||||||
@ -37,6 +37,9 @@ Usage
|
|||||||
Write the cell distribution as a labelList for use with 'manual'
|
Write the cell distribution as a labelList for use with 'manual'
|
||||||
decomposition method and as a volScalarField for post-processing.
|
decomposition method and as a volScalarField for post-processing.
|
||||||
|
|
||||||
|
@param -region regionName \n
|
||||||
|
Decompose named region. Does not check for existence of processor*.
|
||||||
|
|
||||||
@param -copyUniform \n
|
@param -copyUniform \n
|
||||||
Copy any @a uniform directories too.
|
Copy any @a uniform directories too.
|
||||||
|
|
||||||
@ -83,6 +86,7 @@ Usage
|
|||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
argList::noParallel();
|
argList::noParallel();
|
||||||
|
# include "addRegionOption.H"
|
||||||
argList::validOptions.insert("cellDist", "");
|
argList::validOptions.insert("cellDist", "");
|
||||||
argList::validOptions.insert("copyUniform", "");
|
argList::validOptions.insert("copyUniform", "");
|
||||||
argList::validOptions.insert("fields", "");
|
argList::validOptions.insert("fields", "");
|
||||||
@ -92,6 +96,17 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
|
|
||||||
|
word regionName = fvMesh::defaultRegion;
|
||||||
|
word regionDir = word::null;
|
||||||
|
|
||||||
|
if (args.options().found("region"))
|
||||||
|
{
|
||||||
|
regionName = args.options()["region"];
|
||||||
|
regionDir = regionName;
|
||||||
|
Info<< "Decomposing mesh " << regionName << nl << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool writeCellDist(args.options().found("cellDist"));
|
bool writeCellDist(args.options().found("cellDist"));
|
||||||
bool copyUniform(args.options().found("copyUniform"));
|
bool copyUniform(args.options().found("copyUniform"));
|
||||||
bool decomposeFieldsOnly(args.options().found("fields"));
|
bool decomposeFieldsOnly(args.options().found("fields"));
|
||||||
@ -105,7 +120,17 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
// determine the existing processor count directly
|
// determine the existing processor count directly
|
||||||
label nProcs = 0;
|
label nProcs = 0;
|
||||||
while (isDir(runTime.path()/(word("processor") + name(nProcs))))
|
while
|
||||||
|
(
|
||||||
|
isDir
|
||||||
|
(
|
||||||
|
runTime.path()
|
||||||
|
/(word("processor") + name(nProcs))
|
||||||
|
/runTime.constant()
|
||||||
|
/regionDir
|
||||||
|
/polyMesh::meshSubDir
|
||||||
|
)
|
||||||
|
)
|
||||||
{
|
{
|
||||||
++nProcs;
|
++nProcs;
|
||||||
}
|
}
|
||||||
@ -119,6 +144,7 @@ int main(int argc, char *argv[])
|
|||||||
(
|
(
|
||||||
"decomposeParDict",
|
"decomposeParDict",
|
||||||
runTime.time().system(),
|
runTime.time().system(),
|
||||||
|
regionDir, // use region if non-standard
|
||||||
runTime,
|
runTime,
|
||||||
IOobject::MUST_READ,
|
IOobject::MUST_READ,
|
||||||
IOobject::NO_WRITE,
|
IOobject::NO_WRITE,
|
||||||
@ -196,7 +222,7 @@ int main(int argc, char *argv[])
|
|||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
domainDecomposition::defaultRegion,
|
regionName,
|
||||||
runTime.timeName(),
|
runTime.timeName(),
|
||||||
runTime
|
runTime
|
||||||
)
|
)
|
||||||
@ -219,7 +245,7 @@ int main(int argc, char *argv[])
|
|||||||
(
|
(
|
||||||
runTime.path()
|
runTime.path()
|
||||||
/ mesh.facesInstance()
|
/ mesh.facesInstance()
|
||||||
/ polyMesh::defaultRegion
|
/ regionName
|
||||||
/ "cellDecomposition"
|
/ "cellDecomposition"
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -312,7 +338,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
fileNameList cloudDirs
|
fileNameList cloudDirs
|
||||||
(
|
(
|
||||||
readDir(runTime.timePath()/"lagrangian", fileName::DIRECTORY)
|
readDir(runTime.timePath()/cloud::prefix, fileName::DIRECTORY)
|
||||||
);
|
);
|
||||||
|
|
||||||
// Particles
|
// Particles
|
||||||
@ -344,7 +370,7 @@ int main(int argc, char *argv[])
|
|||||||
(
|
(
|
||||||
mesh,
|
mesh,
|
||||||
runTime.timeName(),
|
runTime.timeName(),
|
||||||
"lagrangian"/cloudDirs[i]
|
cloud::prefix/cloudDirs[i]
|
||||||
);
|
);
|
||||||
|
|
||||||
IOobject* positionsPtr = sprayObjs.lookup("positions");
|
IOobject* positionsPtr = sprayObjs.lookup("positions");
|
||||||
@ -383,7 +409,12 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
label i = 0;
|
label i = 0;
|
||||||
|
|
||||||
forAllIter(Cloud<indexedParticle>, lagrangianPositions[cloudI], iter)
|
forAllIter
|
||||||
|
(
|
||||||
|
Cloud<indexedParticle>,
|
||||||
|
lagrangianPositions[cloudI],
|
||||||
|
iter
|
||||||
|
)
|
||||||
{
|
{
|
||||||
iter().index() = i++;
|
iter().index() = i++;
|
||||||
|
|
||||||
@ -405,7 +436,8 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (!cellParticles[cloudI][celli])
|
if (!cellParticles[cloudI][celli])
|
||||||
{
|
{
|
||||||
cellParticles[cloudI][celli] = new SLList<indexedParticle*>();
|
cellParticles[cloudI][celli] = new SLList<indexedParticle*>
|
||||||
|
();
|
||||||
}
|
}
|
||||||
|
|
||||||
cellParticles[cloudI][celli]->append(&iter());
|
cellParticles[cloudI][celli]->append(&iter());
|
||||||
@ -418,7 +450,7 @@ int main(int argc, char *argv[])
|
|||||||
(
|
(
|
||||||
mesh,
|
mesh,
|
||||||
runTime.timeName(),
|
runTime.timeName(),
|
||||||
"lagrangian"/cloudDirs[cloudI]
|
cloud::prefix/cloudDirs[cloudI]
|
||||||
);
|
);
|
||||||
|
|
||||||
lagrangianFieldDecomposer::readFields
|
lagrangianFieldDecomposer::readFields
|
||||||
@ -513,7 +545,7 @@ int main(int argc, char *argv[])
|
|||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
fvMesh::defaultRegion,
|
regionName,
|
||||||
processorDb.timeName(),
|
processorDb.timeName(),
|
||||||
processorDb
|
processorDb
|
||||||
)
|
)
|
||||||
|
|||||||
@ -19,11 +19,12 @@ FoamFile
|
|||||||
|
|
||||||
numberOfSubdomains 4;
|
numberOfSubdomains 4;
|
||||||
|
|
||||||
// preservePatches (inlet);
|
//- Keep owner and neighbour on same processor for faces in zones:
|
||||||
// preserveFaceZones (heater solid1 solid3);
|
// preserveFaceZones (heater solid1 solid3);
|
||||||
|
|
||||||
method simple;
|
method scotch;
|
||||||
// method hierarchical;
|
// method hierarchical;
|
||||||
|
// method simple;
|
||||||
// method metis;
|
// method metis;
|
||||||
// method manual;
|
// method manual;
|
||||||
|
|
||||||
@ -53,6 +54,9 @@ metisCoeffs
|
|||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
scotchCoeffs
|
||||||
|
{}
|
||||||
|
|
||||||
manualCoeffs
|
manualCoeffs
|
||||||
{
|
{
|
||||||
dataFile "decompositionData";
|
dataFile "decompositionData";
|
||||||
|
|||||||
@ -45,35 +45,6 @@ void domainDecomposition::distributeCells()
|
|||||||
|
|
||||||
labelHashSet sameProcFaces;
|
labelHashSet sameProcFaces;
|
||||||
|
|
||||||
if (decompositionDict_.found("preservePatches"))
|
|
||||||
{
|
|
||||||
wordList pNames(decompositionDict_.lookup("preservePatches"));
|
|
||||||
|
|
||||||
Info<< "Keeping owner and neighbour of faces in patches " << pNames
|
|
||||||
<< " on same processor" << endl;
|
|
||||||
|
|
||||||
const polyBoundaryMesh& patches = boundaryMesh();
|
|
||||||
|
|
||||||
forAll(pNames, i)
|
|
||||||
{
|
|
||||||
label patchI = patches.findPatchID(pNames[i]);
|
|
||||||
|
|
||||||
if (patchI == -1)
|
|
||||||
{
|
|
||||||
FatalErrorIn("domainDecomposition::distributeCells()")
|
|
||||||
<< "Unknown preservePatch " << pNames[i]
|
|
||||||
<< endl << "Valid patches are " << patches.names()
|
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
const polyPatch& pp = patches[patchI];
|
|
||||||
|
|
||||||
forAll(pp, i)
|
|
||||||
{
|
|
||||||
sameProcFaces.insert(pp.start() + i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (decompositionDict_.found("preserveFaceZones"))
|
if (decompositionDict_.found("preserveFaceZones"))
|
||||||
{
|
{
|
||||||
wordList zNames(decompositionDict_.lookup("preserveFaceZones"));
|
wordList zNames(decompositionDict_.lookup("preserveFaceZones"));
|
||||||
@ -104,14 +75,6 @@ void domainDecomposition::distributeCells()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sameProcFaces.size())
|
|
||||||
{
|
|
||||||
Info<< "Selected " << sameProcFaces.size()
|
|
||||||
<< " faces whose owner and neighbour cell should be kept on the"
|
|
||||||
<< " same processor" << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Construct decomposition method and either do decomposition on
|
// Construct decomposition method and either do decomposition on
|
||||||
// cell centres or on agglomeration
|
// cell centres or on agglomeration
|
||||||
@ -129,6 +92,10 @@ void domainDecomposition::distributeCells()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Info<< "Selected " << sameProcFaces.size()
|
||||||
|
<< " faces whose owner and neighbour cell should be kept on the"
|
||||||
|
<< " same processor" << endl;
|
||||||
|
|
||||||
// Faces where owner and neighbour are not 'connected' (= all except
|
// Faces where owner and neighbour are not 'connected' (= all except
|
||||||
// sameProcFaces)
|
// sameProcFaces)
|
||||||
boolList blockedFace(nFaces(), true);
|
boolList blockedFace(nFaces(), true);
|
||||||
|
|||||||
@ -268,7 +268,7 @@ bool domainDecomposition::writeDecomposition()
|
|||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
polyMesh::defaultRegion,
|
this->polyMesh::name(), // region name of undecomposed mesh
|
||||||
"constant",
|
"constant",
|
||||||
processorDb
|
processorDb
|
||||||
),
|
),
|
||||||
|
|||||||
@ -88,7 +88,7 @@ tmp<IOField<Type> > lagrangianFieldDecomposer::decomposeField
|
|||||||
(
|
(
|
||||||
field.name(),
|
field.name(),
|
||||||
procMesh_.time().timeName(),
|
procMesh_.time().timeName(),
|
||||||
"lagrangian"/cloudName,
|
cloud::prefix/cloudName,
|
||||||
procMesh_,
|
procMesh_,
|
||||||
IOobject::NO_READ,
|
IOobject::NO_READ,
|
||||||
IOobject::NO_WRITE
|
IOobject::NO_WRITE
|
||||||
|
|||||||
@ -200,12 +200,6 @@ void Foam::processorMeshes::reconstructPoints(fvMesh& mesh)
|
|||||||
// Read the field for all the processors
|
// Read the field for all the processors
|
||||||
PtrList<pointIOField> procsPoints(meshes_.size());
|
PtrList<pointIOField> procsPoints(meshes_.size());
|
||||||
|
|
||||||
fileName regionPrefix = "";
|
|
||||||
if (meshName_ != fvMesh::defaultRegion)
|
|
||||||
{
|
|
||||||
regionPrefix = meshName_;
|
|
||||||
}
|
|
||||||
|
|
||||||
forAll (meshes_, procI)
|
forAll (meshes_, procI)
|
||||||
{
|
{
|
||||||
procsPoints.set
|
procsPoints.set
|
||||||
@ -217,7 +211,7 @@ void Foam::processorMeshes::reconstructPoints(fvMesh& mesh)
|
|||||||
(
|
(
|
||||||
"points",
|
"points",
|
||||||
meshes_[procI].time().timeName(),
|
meshes_[procI].time().timeName(),
|
||||||
regionPrefix/polyMesh::meshSubDir,
|
polyMesh::meshSubDir,
|
||||||
meshes_[procI],
|
meshes_[procI],
|
||||||
IOobject::MUST_READ,
|
IOobject::MUST_READ,
|
||||||
IOobject::NO_WRITE
|
IOobject::NO_WRITE
|
||||||
|
|||||||
@ -36,6 +36,7 @@ SourceFiles
|
|||||||
#ifndef reconstructLagrangian_H
|
#ifndef reconstructLagrangian_H
|
||||||
#define reconstructLagrangian_H
|
#define reconstructLagrangian_H
|
||||||
|
|
||||||
|
#include "cloud.H"
|
||||||
#include "polyMesh.H"
|
#include "polyMesh.H"
|
||||||
#include "IOobjectList.H"
|
#include "IOobjectList.H"
|
||||||
#include "fvMesh.H"
|
#include "fvMesh.H"
|
||||||
|
|||||||
@ -47,7 +47,7 @@ Foam::tmp<Foam::IOField<Type> > Foam::reconstructLagrangianField
|
|||||||
(
|
(
|
||||||
fieldName,
|
fieldName,
|
||||||
mesh.time().timeName(),
|
mesh.time().timeName(),
|
||||||
"lagrangian"/cloudName,
|
cloud::prefix/cloudName,
|
||||||
mesh,
|
mesh,
|
||||||
IOobject::NO_READ,
|
IOobject::NO_READ,
|
||||||
IOobject::NO_WRITE
|
IOobject::NO_WRITE
|
||||||
@ -64,7 +64,7 @@ Foam::tmp<Foam::IOField<Type> > Foam::reconstructLagrangianField
|
|||||||
(
|
(
|
||||||
fieldName,
|
fieldName,
|
||||||
meshes[i].time().timeName(),
|
meshes[i].time().timeName(),
|
||||||
"lagrangian"/cloudName,
|
cloud::prefix/cloudName,
|
||||||
meshes[i],
|
meshes[i],
|
||||||
IOobject::MUST_READ,
|
IOobject::MUST_READ,
|
||||||
IOobject::NO_WRITE
|
IOobject::NO_WRITE
|
||||||
|
|||||||
@ -51,6 +51,7 @@ int main(int argc, char *argv[])
|
|||||||
argList::noParallel();
|
argList::noParallel();
|
||||||
# include "addRegionOption.H"
|
# include "addRegionOption.H"
|
||||||
argList::validOptions.insert("fields", "\"(list of fields)\"");
|
argList::validOptions.insert("fields", "\"(list of fields)\"");
|
||||||
|
argList::validOptions.insert("noLagrangian", "");
|
||||||
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
@ -61,6 +62,8 @@ int main(int argc, char *argv[])
|
|||||||
IStringStream(args.options()["fields"])() >> selectedFields;
|
IStringStream(args.options()["fields"])() >> selectedFields;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool noLagrangian = args.options().found("noLagrangian");
|
||||||
|
|
||||||
// determine the processor count directly
|
// determine the processor count directly
|
||||||
label nProcs = 0;
|
label nProcs = 0;
|
||||||
while (isDir(args.path()/(word("processor") + name(nProcs))))
|
while (isDir(args.path()/(word("processor") + name(nProcs))))
|
||||||
@ -113,6 +116,13 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
regionPrefix = regionName;
|
regionPrefix = regionName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set all times on processor meshes equal to reconstructed mesh
|
||||||
|
forAll (databases, procI)
|
||||||
|
{
|
||||||
|
databases[procI].setTime(runTime.timeName(), runTime.timeIndex());
|
||||||
|
}
|
||||||
|
|
||||||
// Read all meshes and addressing to reconstructed mesh
|
// Read all meshes and addressing to reconstructed mesh
|
||||||
processorMeshes procMeshes(databases, regionName);
|
processorMeshes procMeshes(databases, regionName);
|
||||||
|
|
||||||
@ -269,6 +279,8 @@ int main(int argc, char *argv[])
|
|||||||
// the first processor that has them. They are in pass2 only used
|
// the first processor that has them. They are in pass2 only used
|
||||||
// for name and type (scalar, vector etc).
|
// for name and type (scalar, vector etc).
|
||||||
|
|
||||||
|
if (!noLagrangian)
|
||||||
|
{
|
||||||
HashTable<IOobjectList> cloudObjects;
|
HashTable<IOobjectList> cloudObjects;
|
||||||
|
|
||||||
forAll (databases, procI)
|
forAll (databases, procI)
|
||||||
@ -277,25 +289,25 @@ int main(int argc, char *argv[])
|
|||||||
(
|
(
|
||||||
readDir
|
readDir
|
||||||
(
|
(
|
||||||
databases[procI].timePath()/regionPrefix/"lagrangian",
|
databases[procI].timePath()/regionPrefix/cloud::prefix,
|
||||||
fileName::DIRECTORY
|
fileName::DIRECTORY
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
forAll (cloudDirs, i)
|
forAll (cloudDirs, i)
|
||||||
{
|
{
|
||||||
// Check if we already have cloud objects for this cloudname.
|
// Check if we already have cloud objects for this cloudname
|
||||||
HashTable<IOobjectList>::const_iterator iter =
|
HashTable<IOobjectList>::const_iterator iter =
|
||||||
cloudObjects.find(cloudDirs[i]);
|
cloudObjects.find(cloudDirs[i]);
|
||||||
|
|
||||||
if (iter == cloudObjects.end())
|
if (iter == cloudObjects.end())
|
||||||
{
|
{
|
||||||
// Do local scan for valid cloud objects.
|
// Do local scan for valid cloud objects
|
||||||
IOobjectList sprayObjs
|
IOobjectList sprayObjs
|
||||||
(
|
(
|
||||||
procMeshes.meshes()[procI],
|
procMeshes.meshes()[procI],
|
||||||
databases[procI].timeName(),
|
databases[procI].timeName(),
|
||||||
"lagrangian"/cloudDirs[i]
|
cloud::prefix/cloudDirs[i]
|
||||||
);
|
);
|
||||||
|
|
||||||
IOobject* positionsPtr = sprayObjs.lookup("positions");
|
IOobject* positionsPtr = sprayObjs.lookup("positions");
|
||||||
@ -378,9 +390,10 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
Info << "No lagrangian fields" << nl << endl;
|
Info << "No lagrangian fields" << nl << endl;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// If there are any "uniform" directories copy them from
|
// If there are any "uniform" directories copy them from
|
||||||
// the master processor.
|
// the master processor
|
||||||
|
|
||||||
fileName uniformDir0 = databases[0].timePath()/"uniform";
|
fileName uniformDir0 = databases[0].timePath()/"uniform";
|
||||||
if (isDir(uniformDir0))
|
if (isDir(uniformDir0))
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
-I$(LIB_SRC)/decompositionAgglomeration/decompositionMethods/lnInclude \
|
-I$(LIB_SRC)/decompositionMethods/decompositionMethods/lnInclude \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
-I$(LIB_SRC)/dynamicMesh/lnInclude
|
-I$(LIB_SRC)/dynamicMesh/lnInclude
|
||||||
|
|||||||
@ -38,26 +38,22 @@ Description
|
|||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
argList::noParallel();
|
argList::noParallel();
|
||||||
# include "addTimeOptions.H"
|
timeSelector::addOptions(false); // no constant
|
||||||
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
|
|
||||||
instantList Times = runTime.times();
|
instantList timeDirs = timeSelector::select0(runTime, args);
|
||||||
|
|
||||||
// set startTime and endTime depending on -time and -latestTime options
|
|
||||||
# include "checkTimeOptionsNoConstant.H"
|
|
||||||
|
|
||||||
runTime.setTime(Times[startTime], startTime);
|
|
||||||
|
|
||||||
# include "createMesh.H"
|
# include "createMesh.H"
|
||||||
|
|
||||||
// make a directory called proInterface in the case
|
// make a directory called proInterface in the case
|
||||||
mkDir(runTime.rootPath()/runTime.caseName()/"fluentInterface");
|
mkDir(runTime.rootPath()/runTime.caseName()/"fluentInterface");
|
||||||
|
|
||||||
for (label timeI = startTime; timeI < endTime; timeI++)
|
forAll(timeDirs, timeI)
|
||||||
{
|
{
|
||||||
runTime.setTime(Times[timeI], timeI);
|
runTime.setTime(timeDirs[timeI], timeI);
|
||||||
|
|
||||||
Info<< "Time = " << runTime.timeName() << endl;
|
Info<< "Time = " << runTime.timeName() << endl;
|
||||||
|
|
||||||
if (mesh.readUpdate())
|
if (mesh.readUpdate())
|
||||||
|
|||||||
@ -35,6 +35,7 @@ SourceFiles
|
|||||||
#ifndef ensightCloudField_H
|
#ifndef ensightCloudField_H
|
||||||
#define ensightCloudField_H
|
#define ensightCloudField_H
|
||||||
|
|
||||||
|
#include "Cloud.H"
|
||||||
#include "IOobject.H"
|
#include "IOobject.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|||||||
@ -211,7 +211,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
fileNameList cloudDirs = readDir
|
fileNameList cloudDirs = readDir
|
||||||
(
|
(
|
||||||
runTime.timePath()/regionPrefix/"lagrangian",
|
runTime.timePath()/regionPrefix/cloud::prefix,
|
||||||
fileName::DIRECTORY
|
fileName::DIRECTORY
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -221,7 +221,7 @@ int main(int argc, char *argv[])
|
|||||||
(
|
(
|
||||||
mesh,
|
mesh,
|
||||||
runTime.timeName(),
|
runTime.timeName(),
|
||||||
"lagrangian"/cloudDirs[cloudI]
|
cloud::prefix/cloudDirs[cloudI]
|
||||||
);
|
);
|
||||||
|
|
||||||
IOobject* positionsPtr = cloudObjs.lookup("positions");
|
IOobject* positionsPtr = cloudObjs.lookup("positions");
|
||||||
@ -266,7 +266,7 @@ int main(int argc, char *argv[])
|
|||||||
(
|
(
|
||||||
mesh,
|
mesh,
|
||||||
runTime.timeName(),
|
runTime.timeName(),
|
||||||
"lagrangian"/cloudIter.key()
|
cloud::prefix/cloudIter.key()
|
||||||
);
|
);
|
||||||
|
|
||||||
forAllConstIter(IOobjectList, cloudObjs, fieldIter)
|
forAllConstIter(IOobjectList, cloudObjs, fieldIter)
|
||||||
@ -426,7 +426,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
fileNameList currentCloudDirs = readDir
|
fileNameList currentCloudDirs = readDir
|
||||||
(
|
(
|
||||||
runTime.timePath()/regionPrefix/"lagrangian",
|
runTime.timePath()/regionPrefix/cloud::prefix,
|
||||||
fileName::DIRECTORY
|
fileName::DIRECTORY
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -449,7 +449,7 @@ int main(int argc, char *argv[])
|
|||||||
(
|
(
|
||||||
fieldName,
|
fieldName,
|
||||||
mesh.time().timeName(),
|
mesh.time().timeName(),
|
||||||
"lagrangian"/cloudName,
|
cloud::prefix/cloudName,
|
||||||
mesh,
|
mesh,
|
||||||
IOobject::MUST_READ
|
IOobject::MUST_READ
|
||||||
);
|
);
|
||||||
|
|||||||
@ -42,7 +42,7 @@ forAllConstIter(HashTable<HashTable<word> >, cloudFields, cloudIter)
|
|||||||
|
|
||||||
caseFile
|
caseFile
|
||||||
<< setw(16) << "measured: 2"
|
<< setw(16) << "measured: 2"
|
||||||
<< fileName(dataMask/"lagrangian"/cloudName/"positions").c_str()
|
<< fileName(dataMask/cloud::prefix/cloudName/"positions").c_str()
|
||||||
<< nl;
|
<< nl;
|
||||||
}
|
}
|
||||||
caseFile
|
caseFile
|
||||||
@ -122,7 +122,7 @@ forAllConstIter(HashTable<HashTable<word> >, cloudFields, cloudIter)
|
|||||||
ensightType,
|
ensightType,
|
||||||
fieldName,
|
fieldName,
|
||||||
dataMask,
|
dataMask,
|
||||||
"lagrangian"/cloudName,
|
cloud::prefix/cloudName,
|
||||||
cloudNo,
|
cloudNo,
|
||||||
2
|
2
|
||||||
);
|
);
|
||||||
|
|||||||
@ -27,7 +27,6 @@ License
|
|||||||
#include "ensightOutputFunctions.H"
|
#include "ensightOutputFunctions.H"
|
||||||
|
|
||||||
#include "passiveParticle.H"
|
#include "passiveParticle.H"
|
||||||
#include "Cloud.H"
|
|
||||||
#include "IOField.H"
|
#include "IOField.H"
|
||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
#include "surfaceFields.H"
|
#include "surfaceFields.H"
|
||||||
@ -101,7 +100,7 @@ void ensightParticlePositions
|
|||||||
{
|
{
|
||||||
Cloud<passiveParticle> parcels(mesh, cloudName, false);
|
Cloud<passiveParticle> parcels(mesh, cloudName, false);
|
||||||
|
|
||||||
fileName cloudDir = subDir/"lagrangian"/cloudName;
|
fileName cloudDir = subDir/cloud::prefix/cloudName;
|
||||||
fileName postFileName = cloudDir/"positions";
|
fileName postFileName = cloudDir/"positions";
|
||||||
|
|
||||||
// the ITER/lagrangian subdirectory must exist
|
// the ITER/lagrangian subdirectory must exist
|
||||||
@ -165,7 +164,7 @@ void ensightLagrangianField
|
|||||||
{
|
{
|
||||||
Info<< " " << fieldObject.name() << flush;
|
Info<< " " << fieldObject.name() << flush;
|
||||||
|
|
||||||
fileName cloudDir = subDir/"lagrangian"/cloudName;
|
fileName cloudDir = subDir/cloud::prefix/cloudName;
|
||||||
fileName postFileName = cloudDir/fieldObject.name();
|
fileName postFileName = cloudDir/fieldObject.name();
|
||||||
|
|
||||||
string title =
|
string title =
|
||||||
|
|||||||
@ -23,9 +23,7 @@ License
|
|||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
Description
|
Description
|
||||||
|
Miscellaneous collection of functions and template related to Ensight data
|
||||||
miscellaneous collection of functions and template related
|
|
||||||
to Ensight data
|
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
ensightOutputFunctions.C
|
ensightOutputFunctions.C
|
||||||
@ -36,6 +34,7 @@ SourceFiles
|
|||||||
#define ensightOutputFunctions_H
|
#define ensightOutputFunctions_H
|
||||||
|
|
||||||
#include "ensightFile.H"
|
#include "ensightFile.H"
|
||||||
|
#include "Cloud.H"
|
||||||
#include "polyMesh.H"
|
#include "polyMesh.H"
|
||||||
#include "IOobject.H"
|
#include "IOobject.H"
|
||||||
|
|
||||||
|
|||||||
@ -36,7 +36,7 @@ if (timeDirs.size() > 1)
|
|||||||
runTime.path()
|
runTime.path()
|
||||||
/ timeDirs[timeDirs.size() - 1].name()
|
/ timeDirs[timeDirs.size() - 1].name()
|
||||||
/ regionPrefix
|
/ regionPrefix
|
||||||
/ "lagrangian",
|
/ cloud::prefix,
|
||||||
fileName::DIRECTORY
|
fileName::DIRECTORY
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -55,7 +55,7 @@ if (timeDirs.size() > 1)
|
|||||||
(
|
(
|
||||||
mesh,
|
mesh,
|
||||||
timeDirs[timeDirs.size() - 1].name(),
|
timeDirs[timeDirs.size() - 1].name(),
|
||||||
"lagrangian"/cloudName
|
cloud::prefix/cloudName
|
||||||
);
|
);
|
||||||
|
|
||||||
bool hasPositions = false;
|
bool hasPositions = false;
|
||||||
|
|||||||
@ -324,7 +324,14 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
const word& cloudName = cloudIter.key();
|
const word& cloudName = cloudIter.key();
|
||||||
|
|
||||||
if (!isDir(runTime.timePath()/regionPrefix/"lagrangian"/cloudName))
|
if
|
||||||
|
(
|
||||||
|
!isDir
|
||||||
|
(
|
||||||
|
runTime.timePath()/regionPrefix/
|
||||||
|
cloud::prefix/cloudName
|
||||||
|
)
|
||||||
|
)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -333,7 +340,7 @@ int main(int argc, char *argv[])
|
|||||||
(
|
(
|
||||||
mesh,
|
mesh,
|
||||||
runTime.timeName(),
|
runTime.timeName(),
|
||||||
"lagrangian"/cloudName
|
cloud::prefix/cloudName
|
||||||
);
|
);
|
||||||
|
|
||||||
// check that the positions field is present for this time
|
// check that the positions field is present for this time
|
||||||
@ -365,7 +372,8 @@ int main(int argc, char *argv[])
|
|||||||
if (!fieldObject)
|
if (!fieldObject)
|
||||||
{
|
{
|
||||||
Info<< "missing "
|
Info<< "missing "
|
||||||
<< runTime.timeName()/"lagrangian"/cloudName/fieldName
|
<< runTime.timeName()/cloud::prefix/cloudName
|
||||||
|
/ fieldName
|
||||||
<< endl;
|
<< endl;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,7 +21,7 @@ List<IOField<vector>* > sprayVectorFieldPtrs
|
|||||||
(
|
(
|
||||||
sprayScalarNames[fieldI],
|
sprayScalarNames[fieldI],
|
||||||
runTime.timeName(),
|
runTime.timeName(),
|
||||||
"lagrangian",
|
cloud::prefix,
|
||||||
mesh,
|
mesh,
|
||||||
IOobject::MUST_READ,
|
IOobject::MUST_READ,
|
||||||
IOobject::NO_WRITE
|
IOobject::NO_WRITE
|
||||||
@ -53,7 +53,7 @@ List<IOField<vector>* > sprayVectorFieldPtrs
|
|||||||
(
|
(
|
||||||
sprayVectorNames[fieldI],
|
sprayVectorNames[fieldI],
|
||||||
runTime.timeName(),
|
runTime.timeName(),
|
||||||
"lagrangian",
|
cloud::prefix,
|
||||||
mesh,
|
mesh,
|
||||||
IOobject::MUST_READ,
|
IOobject::MUST_READ,
|
||||||
IOobject::NO_WRITE
|
IOobject::NO_WRITE
|
||||||
|
|||||||
@ -42,7 +42,7 @@ forAll(Times, timeI)
|
|||||||
|
|
||||||
|
|
||||||
// Same for spray
|
// Same for spray
|
||||||
IOobjectList sprayObjects(mesh, runTime.timeName(), "lagrangian");
|
IOobjectList sprayObjects(mesh, runTime.timeName(), cloud::prefix);
|
||||||
{
|
{
|
||||||
wordList fieldNames(sprayObjects.names(scalarIOField::typeName));
|
wordList fieldNames(sprayObjects.names(scalarIOField::typeName));
|
||||||
forAll(fieldNames, fieldI)
|
forAll(fieldNames, fieldI)
|
||||||
|
|||||||
@ -49,7 +49,7 @@ int main(int argc, char *argv[])
|
|||||||
"volScalarField",
|
"volScalarField",
|
||||||
"volVectorField",
|
"volVectorField",
|
||||||
"surfaceScalarField",
|
"surfaceScalarField",
|
||||||
"lagrangian"
|
cloud::prefix
|
||||||
};
|
};
|
||||||
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
|
|||||||
@ -60,13 +60,13 @@ for(label i=0; i < nTypes; i++)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( fieldTypes[i] == "lagrangian")
|
if (fieldTypes[i] == cloud::prefix)
|
||||||
{
|
{
|
||||||
IOobject lagrangianHeader
|
IOobject lagrangianHeader
|
||||||
(
|
(
|
||||||
"positions",
|
"positions",
|
||||||
runTime.timeName(),
|
runTime.timeName(),
|
||||||
"lagrangian",
|
cloud::prefix,
|
||||||
mesh,
|
mesh,
|
||||||
IOobject::NO_READ
|
IOobject::NO_READ
|
||||||
);
|
);
|
||||||
@ -75,7 +75,7 @@ for(label i=0; i < nTypes; i++)
|
|||||||
{
|
{
|
||||||
Cloud<passiveParticle> particles(mesh);
|
Cloud<passiveParticle> particles(mesh);
|
||||||
|
|
||||||
IOobjectList objects(mesh, runTime.timeName(), "lagrangian");
|
IOobjectList objects(mesh, runTime.timeName(), cloud::prefix);
|
||||||
|
|
||||||
wordList lagrangianScalarNames = objects.names("scalarField");
|
wordList lagrangianScalarNames = objects.names("scalarField");
|
||||||
wordList lagrangianVectorNames = objects.names("vectorField");
|
wordList lagrangianVectorNames = objects.names("vectorField");
|
||||||
|
|||||||
@ -42,7 +42,7 @@ forAll(lagrangianScalarNames, i)
|
|||||||
(
|
(
|
||||||
name,
|
name,
|
||||||
runTime.timeName(),
|
runTime.timeName(),
|
||||||
"lagrangian",
|
cloud::prefix,
|
||||||
mesh,
|
mesh,
|
||||||
IOobject::MUST_READ,
|
IOobject::MUST_READ,
|
||||||
IOobject::NO_WRITE
|
IOobject::NO_WRITE
|
||||||
@ -73,7 +73,7 @@ forAll(lagrangianVectorNames, i)
|
|||||||
(
|
(
|
||||||
name,
|
name,
|
||||||
runTime.timeName(),
|
runTime.timeName(),
|
||||||
"lagrangian",
|
cloud::prefix,
|
||||||
mesh,
|
mesh,
|
||||||
IOobject::MUST_READ,
|
IOobject::MUST_READ,
|
||||||
IOobject::NO_WRITE
|
IOobject::NO_WRITE
|
||||||
|
|||||||
@ -40,7 +40,7 @@ forAll(lagrangianScalarNames, i)
|
|||||||
(
|
(
|
||||||
name,
|
name,
|
||||||
runTime.timeName(),
|
runTime.timeName(),
|
||||||
"lagrangian",
|
cloud::prefix,
|
||||||
mesh,
|
mesh,
|
||||||
IOobject::MUST_READ,
|
IOobject::MUST_READ,
|
||||||
IOobject::NO_WRITE
|
IOobject::NO_WRITE
|
||||||
|
|||||||
@ -225,8 +225,10 @@ labelList getSelectedPatches
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
# include "addTimeOptions.H"
|
timeSelector::addOptions();
|
||||||
|
|
||||||
# include "addRegionOption.H"
|
# include "addRegionOption.H"
|
||||||
|
|
||||||
argList::validOptions.insert("fields", "fields");
|
argList::validOptions.insert("fields", "fields");
|
||||||
argList::validOptions.insert("cellSet", "cellSet name");
|
argList::validOptions.insert("cellSet", "cellSet name");
|
||||||
argList::validOptions.insert("faceSet", "faceSet name");
|
argList::validOptions.insert("faceSet", "faceSet name");
|
||||||
@ -244,7 +246,6 @@ int main(int argc, char *argv[])
|
|||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
|
|
||||||
|
|
||||||
bool doWriteInternal = !args.options().found("noInternal");
|
bool doWriteInternal = !args.options().found("noInternal");
|
||||||
bool doFaceZones = !args.options().found("noFaceZones");
|
bool doFaceZones = !args.options().found("noFaceZones");
|
||||||
bool doLinks = !args.options().found("noLinks");
|
bool doLinks = !args.options().found("noLinks");
|
||||||
@ -312,14 +313,8 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
instantList Times = runTime.times();
|
instantList timeDirs = timeSelector::select0(runTime, args);
|
||||||
|
|
||||||
// set startTime and endTime depending on -time and -latestTime options
|
|
||||||
# include "checkTimeOptions.H"
|
|
||||||
|
|
||||||
runTime.setTime(Times[startTime], startTime);
|
|
||||||
|
|
||||||
// Current mesh.
|
|
||||||
# include "createNamedMesh.H"
|
# include "createNamedMesh.H"
|
||||||
|
|
||||||
// VTK/ directory in the case
|
// VTK/ directory in the case
|
||||||
@ -359,11 +354,11 @@ int main(int argc, char *argv[])
|
|||||||
// mesh wrapper; does subsetting and decomposition
|
// mesh wrapper; does subsetting and decomposition
|
||||||
vtkMesh vMesh(mesh, cellSetName);
|
vtkMesh vMesh(mesh, cellSetName);
|
||||||
|
|
||||||
for (label timeI = startTime; timeI < endTime; timeI++)
|
forAll(timeDirs, timeI)
|
||||||
{
|
{
|
||||||
runTime.setTime(Times[timeI], timeI);
|
runTime.setTime(timeDirs[timeI], timeI);
|
||||||
|
|
||||||
Info<< "Time " << Times[timeI].name() << endl;
|
Info<< "Time: " << runTime.timeName() << endl;
|
||||||
|
|
||||||
// Check for new polyMesh/ and update mesh, fvMeshSubset and cell
|
// Check for new polyMesh/ and update mesh, fvMeshSubset and cell
|
||||||
// decomposition.
|
// decomposition.
|
||||||
@ -914,7 +909,7 @@ int main(int argc, char *argv[])
|
|||||||
(
|
(
|
||||||
readDir
|
readDir
|
||||||
(
|
(
|
||||||
runTime.timePath()/regionPrefix/"lagrangian",
|
runTime.timePath()/regionPrefix/cloud::prefix,
|
||||||
fileName::DIRECTORY
|
fileName::DIRECTORY
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@ -925,18 +920,18 @@ int main(int argc, char *argv[])
|
|||||||
(
|
(
|
||||||
mesh,
|
mesh,
|
||||||
runTime.timeName(),
|
runTime.timeName(),
|
||||||
"lagrangian"/cloudDirs[i]
|
cloud::prefix/cloudDirs[i]
|
||||||
);
|
);
|
||||||
|
|
||||||
IOobject* positionsPtr = sprayObjs.lookup("positions");
|
IOobject* positionsPtr = sprayObjs.lookup("positions");
|
||||||
|
|
||||||
if (positionsPtr)
|
if (positionsPtr)
|
||||||
{
|
{
|
||||||
mkDir(fvPath/"lagrangian"/cloudDirs[i]);
|
mkDir(fvPath/cloud::prefix/cloudDirs[i]);
|
||||||
|
|
||||||
fileName lagrFileName
|
fileName lagrFileName
|
||||||
(
|
(
|
||||||
fvPath/"lagrangian"/cloudDirs[i]/cloudDirs[i]
|
fvPath/cloud::prefix/cloudDirs[i]/cloudDirs[i]
|
||||||
+ "_" + name(timeI) + ".vtk"
|
+ "_" + name(timeI) + ".vtk"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -39,6 +39,7 @@ SourceFiles
|
|||||||
|
|
||||||
#include "globalPointPatch.H"
|
#include "globalPointPatch.H"
|
||||||
#include "OFstream.H"
|
#include "OFstream.H"
|
||||||
|
#include "Cloud.H"
|
||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
#include "pointFields.H"
|
#include "pointFields.H"
|
||||||
#include "vtkMesh.H"
|
#include "vtkMesh.H"
|
||||||
|
|||||||
@ -41,7 +41,7 @@ void Foam::lagrangianWriter::writeIOField(const wordList& objects)
|
|||||||
(
|
(
|
||||||
object,
|
object,
|
||||||
vMesh_.mesh().time().timeName(),
|
vMesh_.mesh().time().timeName(),
|
||||||
"lagrangian"/cloudName_,
|
cloud::prefix/cloudName_,
|
||||||
vMesh_.mesh(),
|
vMesh_.mesh(),
|
||||||
IOobject::MUST_READ,
|
IOobject::MUST_READ,
|
||||||
IOobject::NO_WRITE,
|
IOobject::NO_WRITE,
|
||||||
|
|||||||
@ -22,8 +22,6 @@ License
|
|||||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
Description
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "writePointSet.H"
|
#include "writePointSet.H"
|
||||||
@ -76,7 +74,7 @@ void writePointSet
|
|||||||
|
|
||||||
writeFuns::insert
|
writeFuns::insert
|
||||||
(
|
(
|
||||||
IndirectList<point>(vMesh.mesh().points(), set.toc())(),
|
UIndirectList<point>(vMesh.mesh().points(), set.toc())(),
|
||||||
ptField
|
ptField
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -50,14 +50,15 @@ vtkPV3FoamReader::vtkPV3FoamReader()
|
|||||||
|
|
||||||
output0_ = NULL;
|
output0_ = NULL;
|
||||||
|
|
||||||
|
#ifdef VTKPV3FOAM_DUALPORT
|
||||||
// Add second output for the Lagrangian
|
// Add second output for the Lagrangian
|
||||||
this->SetNumberOfOutputPorts(2);
|
this->SetNumberOfOutputPorts(2);
|
||||||
vtkMultiBlockDataSet *lagrangian;
|
vtkMultiBlockDataSet *lagrangian = vtkMultiBlockDataSet::New();
|
||||||
lagrangian = vtkMultiBlockDataSet::New();
|
|
||||||
lagrangian->ReleaseData();
|
lagrangian->ReleaseData();
|
||||||
|
|
||||||
this->GetExecutive()->SetOutputData(1, lagrangian);
|
this->GetExecutive()->SetOutputData(1, lagrangian);
|
||||||
lagrangian->Delete();
|
lagrangian->Delete();
|
||||||
|
#endif
|
||||||
|
|
||||||
TimeStepRange[0] = 0;
|
TimeStepRange[0] = 0;
|
||||||
TimeStepRange[1] = 0;
|
TimeStepRange[1] = 0;
|
||||||
@ -204,9 +205,9 @@ int vtkPV3FoamReader::RequestInformation
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
double timeRange[2];
|
|
||||||
if (nTimeSteps)
|
if (nTimeSteps)
|
||||||
{
|
{
|
||||||
|
double timeRange[2];
|
||||||
timeRange[0] = timeSteps[0];
|
timeRange[0] = timeSteps[0];
|
||||||
timeRange[1] = timeSteps[nTimeSteps-1];
|
timeRange[1] = timeSteps[nTimeSteps-1];
|
||||||
|
|
||||||
@ -273,46 +274,53 @@ int vtkPV3FoamReader::RequestData
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// take port0 as the lead for other outputs
|
// Get the requested time step.
|
||||||
vtkInformation *outInfo = outputVector->GetInformationObject(0);
|
// We only support requests for a single time step
|
||||||
|
|
||||||
|
int nRequestTime = 0;
|
||||||
|
double requestTime[nInfo];
|
||||||
|
|
||||||
|
// taking port0 as the lead for other outputs would be nice, but fails when
|
||||||
|
// a filter is added - we need to check everything
|
||||||
|
// but since PREVIOUS_UPDATE_TIME_STEPS() is protected, relay the logic
|
||||||
|
// to the vtkPV3Foam::setTime() method
|
||||||
|
for (int infoI = 0; infoI < nInfo; ++infoI)
|
||||||
|
{
|
||||||
|
vtkInformation *outInfo = outputVector->GetInformationObject(infoI);
|
||||||
|
|
||||||
|
if
|
||||||
|
(
|
||||||
|
outInfo->Has
|
||||||
|
(
|
||||||
|
vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEPS()
|
||||||
|
)
|
||||||
|
&& outInfo->Length
|
||||||
|
(
|
||||||
|
vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEPS()
|
||||||
|
) >= 1
|
||||||
|
)
|
||||||
|
{
|
||||||
|
requestTime[nRequestTime++] = outInfo->Get
|
||||||
|
(
|
||||||
|
vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEPS()
|
||||||
|
)[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nRequestTime)
|
||||||
|
{
|
||||||
|
foamData_->setTime(nRequestTime, requestTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
vtkMultiBlockDataSet* output = vtkMultiBlockDataSet::SafeDownCast
|
vtkMultiBlockDataSet* output = vtkMultiBlockDataSet::SafeDownCast
|
||||||
(
|
(
|
||||||
outInfo->Get
|
outputVector->GetInformationObject(0)->Get
|
||||||
(
|
(
|
||||||
vtkMultiBlockDataSet::DATA_OBJECT()
|
vtkMultiBlockDataSet::DATA_OBJECT()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
vtkMultiBlockDataSet* lagrangianOutput = vtkMultiBlockDataSet::SafeDownCast
|
|
||||||
(
|
|
||||||
outputVector->GetInformationObject(1)->Get
|
|
||||||
(
|
|
||||||
vtkMultiBlockDataSet::DATA_OBJECT()
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
if (outInfo->Has(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEPS()))
|
|
||||||
{
|
|
||||||
// Get the requested time step.
|
|
||||||
// We only support requests for a single time step
|
|
||||||
int nRequestedTimeSteps = outInfo->Length
|
|
||||||
(
|
|
||||||
vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEPS()
|
|
||||||
);
|
|
||||||
if (nRequestedTimeSteps >= 1)
|
|
||||||
{
|
|
||||||
double *requestedTimeSteps = outInfo->Get
|
|
||||||
(
|
|
||||||
vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEPS()
|
|
||||||
);
|
|
||||||
|
|
||||||
foamData_->setTime(requestedTimeSteps[0]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Foam::vtkPV3Foam::debug)
|
if (Foam::vtkPV3Foam::debug)
|
||||||
{
|
{
|
||||||
cout<< "update output with "
|
cout<< "update output with "
|
||||||
@ -361,7 +369,21 @@ int vtkPV3FoamReader::RequestData
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
foamData_->Update(output, lagrangianOutput);
|
#ifdef VTKPV3FOAM_DUALPORT
|
||||||
|
foamData_->Update
|
||||||
|
(
|
||||||
|
output,
|
||||||
|
vtkMultiBlockDataSet::SafeDownCast
|
||||||
|
(
|
||||||
|
outputVector->GetInformationObject(1)->Get
|
||||||
|
(
|
||||||
|
vtkMultiBlockDataSet::DATA_OBJECT()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
);
|
||||||
|
#else
|
||||||
|
foamData_->Update(output, output);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (ShowPatchNames)
|
if (ShowPatchNames)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -90,12 +90,21 @@ void Foam::vtkPV3Foam::reduceMemory()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
int Foam::vtkPV3Foam::setTime(const double& requestedTime)
|
int Foam::vtkPV3Foam::setTime(int nRequest, const double requestTimes[])
|
||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<beg> Foam::vtkPV3Foam::setTime(" << requestedTime << ")"
|
Info<< "<beg> Foam::vtkPV3Foam::setTime(";
|
||||||
<< endl;
|
for (int requestI = 0; requestI < nRequest; ++requestI)
|
||||||
|
{
|
||||||
|
if (requestI)
|
||||||
|
{
|
||||||
|
Info<< ", ";
|
||||||
|
}
|
||||||
|
|
||||||
|
Info<< requestTimes[requestI];
|
||||||
|
}
|
||||||
|
Info << ") - previousIndex = " << timeIndex_ << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
Time& runTime = dbPtr_();
|
Time& runTime = dbPtr_();
|
||||||
@ -103,12 +112,26 @@ int Foam::vtkPV3Foam::setTime(const double& requestedTime)
|
|||||||
// Get times list
|
// Get times list
|
||||||
instantList Times = runTime.times();
|
instantList Times = runTime.times();
|
||||||
|
|
||||||
int nearestIndex = Time::findClosestTimeIndex(Times, requestedTime);
|
int nearestIndex = timeIndex_;
|
||||||
|
|
||||||
|
for (int requestI = 0; requestI < nRequest; ++requestI)
|
||||||
|
{
|
||||||
|
int index = Time::findClosestTimeIndex(Times, requestTimes[requestI]);
|
||||||
|
|
||||||
|
if (index >= 0 && index != timeIndex_)
|
||||||
|
{
|
||||||
|
nearestIndex = index;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (nearestIndex < 0)
|
if (nearestIndex < 0)
|
||||||
{
|
{
|
||||||
nearestIndex = 0;
|
nearestIndex = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// see what has changed
|
// see what has changed
|
||||||
if (timeIndex_ != nearestIndex)
|
if (timeIndex_ != nearestIndex)
|
||||||
{
|
{
|
||||||
@ -138,10 +161,11 @@ int Foam::vtkPV3Foam::setTime(const double& requestedTime)
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<end> Foam::vtkPV3Foam::setTime() - selected time "
|
Info<< "<end> Foam::vtkPV3Foam::setTime() - selectedTime="
|
||||||
<< Times[nearestIndex].name() << " index=" << nearestIndex
|
<< Times[nearestIndex].name() << " index=" << timeIndex_
|
||||||
<< " meshChanged=" << meshChanged_
|
<< "/" << Times.size()
|
||||||
<< " fieldsChanged=" << fieldsChanged_ << endl;
|
<< " meshChanged=" << Switch(meshChanged_)
|
||||||
|
<< " fieldsChanged=" << Switch(fieldsChanged_) << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
return nearestIndex;
|
return nearestIndex;
|
||||||
@ -441,7 +465,6 @@ void Foam::vtkPV3Foam::Update
|
|||||||
cout<< "<beg> Foam::vtkPV3Foam::Update - output with "
|
cout<< "<beg> Foam::vtkPV3Foam::Update - output with "
|
||||||
<< output->GetNumberOfBlocks() << " and "
|
<< output->GetNumberOfBlocks() << " and "
|
||||||
<< lagrangianOutput->GetNumberOfBlocks() << " blocks\n";
|
<< lagrangianOutput->GetNumberOfBlocks() << " blocks\n";
|
||||||
|
|
||||||
output->Print(cout);
|
output->Print(cout);
|
||||||
lagrangianOutput->Print(cout);
|
lagrangianOutput->Print(cout);
|
||||||
printMemory();
|
printMemory();
|
||||||
@ -480,8 +503,10 @@ void Foam::vtkPV3Foam::Update
|
|||||||
reader_->UpdateProgress(0.7);
|
reader_->UpdateProgress(0.7);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef VTKPV3FOAM_DUALPORT
|
||||||
// restart port1 at block=0
|
// restart port1 at block=0
|
||||||
blockNo = 0;
|
blockNo = 0;
|
||||||
|
#endif
|
||||||
convertMeshLagrangian(lagrangianOutput, blockNo);
|
convertMeshLagrangian(lagrangianOutput, blockNo);
|
||||||
|
|
||||||
reader_->UpdateProgress(0.8);
|
reader_->UpdateProgress(0.8);
|
||||||
|
|||||||
@ -58,6 +58,11 @@ SourceFiles
|
|||||||
#ifndef vtkPV3Foam_H
|
#ifndef vtkPV3Foam_H
|
||||||
#define vtkPV3Foam_H
|
#define vtkPV3Foam_H
|
||||||
|
|
||||||
|
// do not include legacy strstream headers
|
||||||
|
#ifndef VTK_EXCLUDE_STRSTREAM_HEADERS
|
||||||
|
# define VTK_EXCLUDE_STRSTREAM_HEADERS
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "className.H"
|
#include "className.H"
|
||||||
#include "fileName.H"
|
#include "fileName.H"
|
||||||
#include "stringList.H"
|
#include "stringList.H"
|
||||||
@ -66,6 +71,8 @@ SourceFiles
|
|||||||
#include "PrimitivePatchInterpolation.H"
|
#include "PrimitivePatchInterpolation.H"
|
||||||
#include "volPointInterpolation.H"
|
#include "volPointInterpolation.H"
|
||||||
|
|
||||||
|
#undef VTKPV3FOAM_DUALPORT
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Forward Declarations * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Forward Declarations * * * * * * * * * * * * * //
|
||||||
|
|
||||||
class vtkDataArraySelection;
|
class vtkDataArraySelection;
|
||||||
@ -128,6 +135,7 @@ class vtkPV3Foam
|
|||||||
return block_;
|
return block_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//- Assign block number, return previous value
|
||||||
int block(int blockNo)
|
int block(int blockNo)
|
||||||
{
|
{
|
||||||
int prev = block_;
|
int prev = block_;
|
||||||
@ -713,9 +721,11 @@ public:
|
|||||||
//- Remove patch names from the display
|
//- Remove patch names from the display
|
||||||
void removePatchNames(vtkRenderer* renderer);
|
void removePatchNames(vtkRenderer* renderer);
|
||||||
|
|
||||||
//- set the runTime to the requested time, returns the timeIndex
|
//- set the runTime to the first plausible request time,
|
||||||
// sets to "constant" on error and returns -1
|
// returns the timeIndex
|
||||||
int setTime(const double& requestedTime);
|
// sets to "constant" on error
|
||||||
|
int setTime(int count, const double requestTimes[]);
|
||||||
|
|
||||||
|
|
||||||
//- The current time index
|
//- The current time index
|
||||||
int timeIndex() const
|
int timeIndex() const
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user