Merge remote branch 'opencfd/master' into olesenm

This commit is contained in:
Mark Olesen
2011-04-12 12:54:35 +02:00
438 changed files with 50710 additions and 2004 deletions

View File

@ -240,11 +240,14 @@
+ =snappyHexMesh=:
+ extrude across multi-processor boundaries
+ preserve faceZones during layering
+ combining patch faces after snapping
+ *Warning*:
- minMedianAxisAngle angle fixed w.r.t. 17x. Set to
90 to get same behaviour as 130 in 17x.
- nGrow did not work in 17x. Set to 0
to get same behaviour as 130 in 17x.
- nSolveIter reinstated to smooth internal mesh. Set to 0
to get same behaviour at 17x.
- new minTetQuality setting (see tracking). Disable for 17x
compatibility.
* Post-processing
@ -309,3 +312,8 @@
* Other
+ compilable with =clang=
In your prefs.sh set the WM_COMPILER to Clang
+ dlclose error: upon exit of e.g. paraFoam you can get the error
Inconsistency detected by ld.so: dl-close.c: 731: _dl_close: Assertion
`map->l_init_called' failed!
This seems to happen with a mix of system libraries and a thirdParty
compiler.

View File

@ -47,4 +47,10 @@
label pRefCell = 0;
scalar pRefValue = 0.0;
setRefCell(p, mesh.solutionDict().subDict("SIMPLE"), pRefCell, pRefValue);
setRefCell
(
p,
potentialFlow,
pRefCell,
pRefValue
);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -42,8 +42,8 @@ int main(int argc, char *argv[])
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "readControls.H"
#include "createFields.H"
#include "readSIMPLEControls.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -0,0 +1,6 @@
const dictionary& potentialFlow =
mesh.solutionDict().subDict("potentialFlow");
const int nNonOrthCorr =
potentialFlow.lookupOrDefault<int>("nNonOrthogonalCorrectors", 0);

View File

@ -19,7 +19,7 @@
pimple.lookupOrDefault<scalar>("maxDeltaT", GREAT)
);
volScalarField rDeltaT0 = rDeltaT;
volScalarField rDeltaT0("rDeltaT0", rDeltaT);
// Set the reciprocal time-step from the local Courant number
rDeltaT.dimensionedInternalField() = max

View File

@ -3,7 +3,7 @@
tmp<fvVectorMatrix> UEqn
(
//pZones.ddt(rho, U)
fvc::ddt(rho, U)
fvm::ddt(rho, U)
+ fvm::div(phi, U)
+ turbulence->divDevRhoReff(U)
);

View File

@ -49,7 +49,7 @@
piso.lookupOrDefault<scalar>("maxDeltaT", GREAT)
);
volScalarField rDeltaT0 = rDeltaT;
volScalarField rDeltaT0("rDeltaT0", rDeltaT);
// Set the reciprocal time-step from the local Courant number
rDeltaT.dimensionedInternalField() = max
@ -64,7 +64,7 @@
// Further limit the reciprocal time-step
// in the vicinity of the interface
volScalarField alpha1Bar = fvc::average(alpha1);
volScalarField alpha1Bar(fvc::average(alpha1));
rDeltaT.dimensionedInternalField() = max
(

View File

@ -11,7 +11,7 @@
fvVectorMatrix UEqn
(
//pZones.ddt(rho, U)
fvc::ddt(rho, U)
fvm::ddt(rho, U)
+ fvm::div(rhoPhi, U)
- fvm::laplacian(muEff, U)
- (fvc::grad(U) & fvc::grad(muEff))

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -2,7 +2,7 @@
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -268,7 +268,7 @@ label selectOutsideCells
// Find cell containing point. Linear search.
label cellI = queryMesh.findCell(outsidePts[outsidePtI], -1, false);
if (cellType[cellI] == MESH)
if (cellI != -1 && cellType[cellI] == MESH)
{
Info<< "Marking cell " << cellI << " containing outside point "
<< outsidePts[outsidePtI] << " with type " << cellType[cellI]
@ -388,7 +388,8 @@ int main(int argc, char *argv[])
{
const point& outsidePoint = outsidePts[outsideI];
if (queryMesh.findCell(outsidePoint, -1, false) == -1)
label cellI = queryMesh.findCell(outsidePoint, -1, false);
if (returnReduce(cellI, maxOp<label>()) == -1)
{
FatalErrorIn(args.executable())
<< "outsidePoint " << outsidePoint

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -86,7 +86,6 @@ void starMesh::readPoints(const scalar scaleFactor)
if (pointsFile.good())
{
label pointLabel;
scalar x, y, z;
maxLabel = -1;
while (pointsFile)
@ -97,9 +96,9 @@ void starMesh::readPoints(const scalar scaleFactor)
maxLabel = max(maxLabel, pointLabel);
x = readVtxCmpt(pointsFile);
y = readVtxCmpt(pointsFile);
z = readVtxCmpt(pointsFile);
readVtxCmpt(pointsFile);
readVtxCmpt(pointsFile);
readVtxCmpt(pointsFile);
readToNl(pointsFile);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -44,6 +44,7 @@ Description
#include "meshTools.H"
#include "cellSet.H"
#include "faceSet.H"
#include "SubField.H"
using namespace Foam;

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -37,6 +37,7 @@ Description
#include "autoLayerDriver.H"
#include "searchableSurfaces.H"
#include "refinementSurfaces.H"
#include "refinementFeatures.H"
#include "shellSurfaces.H"
#include "decompositionMethod.H"
#include "fvMeshDistribute.H"
@ -250,6 +251,20 @@ int main(int argc, char *argv[])
<< mesh.time().cpuTimeIncrement() << " s" << nl << endl;
// Read feature meshes
// ~~~~~~~~~~~~~~~~~~~
Info<< "Reading features." << endl;
refinementFeatures features
(
mesh,
refineDict.lookup("features")
);
Info<< "Read features in = "
<< mesh.time().cpuTimeIncrement() << " s" << nl << endl;
// Refinement engine
// ~~~~~~~~~~~~~~~~~
@ -265,6 +280,7 @@ int main(int argc, char *argv[])
mergeDist, // tolerance used in sorting coordinates
overwrite, // overwrite mesh files?
surfaces, // for surface intersection refinement
features, // for feature edges/point based refinement
shells // for volume (inside/outside) refinement
);
Info<< "Calculated surface intersections in = "
@ -429,13 +445,19 @@ int main(int argc, char *argv[])
// Snap parameters
snapParameters snapParams(snapDict);
// Temporary hack to get access to resolveFeatureAngle
scalar curvature;
{
refinementParameters refineParams(refineDict);
curvature = refineParams.curvature();
}
if (!overwrite)
{
const_cast<Time&>(mesh.time())++;
}
snapDriver.doSnap(snapDict, motionDict, snapParams);
snapDriver.doSnap(snapDict, motionDict, curvature, snapParams);
writeMesh
(

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.7.1 |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
@ -217,10 +217,10 @@ snapControls
// to surface
nSmoothPatch 3;
//- Relative distance for points to be attracted by surface feature point
// or edge. True distance is this factor times local
// maximum edge length.
tolerance 4.0;
//- Maximum relative distance for points to be attracted by surface.
// True distance is this factor times local maximum edge length.
// Note: changed(corrected) w.r.t 17x! (17x used 2* tolerance)
tolerance 2.0;
//- Number of mesh displacement relaxation iterations.
nSolveIter 30;

View File

@ -179,7 +179,7 @@ Foam::label Foam::checkTopology
if (nTwoCells > 0)
{
Info<< " <<Writing " << nTwoCells
<< " cells with with single non-boundary face to set "
<< " cells with with two non-boundary faces to set "
<< twoCells.name()
<< endl;
twoCells.instance() = mesh.pointsInstance();

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -44,6 +44,7 @@ Description
#include "labelIOList.H"
#include "wedgePolyPatch.H"
#include "plane.H"
#include "SubField.H"
using namespace Foam;

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -33,7 +33,6 @@ EXE_LIBS = \
-linterfaceProperties \
-lIOFunctionObjects \
-ljobControl \
-lkineticTheoryModel \
-llagrangian \
-llagrangianIntermediate \
-llaminarFlameSpeedModels \

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -148,6 +148,11 @@ int main(int argc, char *argv[])
# include "setRootCase.H"
# include "createTime.H"
// Make sure we do not use the master-only reading since we read
// fields (different per processor) as dictionaries.
regIOobject::fileModificationChecking = regIOobject::timeStamp;
fileName meshDir = polyMesh::meshSubDir;
fileName regionPrefix = "";
word regionName = polyMesh::defaultRegion;

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -183,12 +183,14 @@ int main(int argc, char *argv[])
);
timeSelector::addOptions(true, false);
# include "addRegionOption.H"
# include "setRootCase.H"
# include "createTime.H"
instantList timeDirs = timeSelector::select0(runTime, args);
# include "createMesh.H"
# include "createNamedMesh.H"
// Initialize name mapping table
FieldviewNames.insert("alpha", "aalpha");
@ -260,10 +262,23 @@ int main(int argc, char *argv[])
// make a directory called FieldView in the case
fileName fvPath(runTime.path()/"Fieldview");
if (regionName != polyMesh::defaultRegion)
{
fvPath = fvPath/regionName;
}
if (isDir(fvPath))
{
if (regionName != polyMesh::defaultRegion)
{
Info<< "Keeping old FieldView files in " << fvPath << nl << endl;
}
else
{
Info<< "Deleting old FieldView files in " << fvPath << nl << endl;
rmDir(fvPath);
}
}
mkDir(fvPath);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -383,16 +383,12 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
forAll(quadFcs, quadI)
{
label thisCellI;
if (substituteCell)
{
thisCellI = cellI;
substituteCell = false;
}
else
{
thisCellI = mesh.nCells() + addCellI;
superCells[addCellI++] = cellI;
}
@ -430,16 +426,12 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
forAll(triFcs, triI)
{
label thisCellI;
if (substituteCell)
{
thisCellI = cellI;
substituteCell = false;
}
else
{
thisCellI = mesh.nCells() + addCellI;
superCells[addCellI++] = cellI;
}

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -2,7 +2,7 @@
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.7.1 |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
@ -150,29 +150,29 @@ surfaces
interpolate true;
}
movingWall_constant
walls_constant
{
type patch;
patchName movingWall;
patches ( ".*Wall.*" );
// Optional: whether to leave as faces (=default) or triangulate
// triangulate false;
}
movingWall_interpolated
walls_interpolated
{
type patch;
patchName movingWall;
patches ( ".*Wall.*" );
interpolate true;
// Optional: whether to leave as faces (=default) or triangulate
// triangulate false;
}
movingNearWall_interpolated
nearWalls_interpolated
{
// Sample cell values off patch. Does not need to be the near-wall
// cell, can be arbitrarily far away.
type patchInternalField;
patchName movingWall;
patches ( ".*Wall.*" );
distance 0.0001;
interpolate true;
// Optional: whether to leave as faces (=default) or triangulate

View File

@ -305,6 +305,11 @@ int main(int argc, char *argv[])
instance = args.options()["instance"];
}
// Make sure we do not use the master-only reading since we read
// fields (different per processor) as dictionaries.
regIOobject::fileModificationChecking = regIOobject::timeStamp;
// Get the replacement rules from a dictionary
IOdictionary dict
(

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -405,6 +405,12 @@ int main(int argc, char *argv[])
# include "setRootCase.H"
# include "createTime.H"
// Make sure we do not use the master-only reading since we read
// fields (different per processor) as dictionaries.
regIOobject::fileModificationChecking = regIOobject::timeStamp;
instantList timeDirs = timeSelector::select0(runTime, args);
const bool isTestRun = args.optionFound("test");

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -40,6 +40,7 @@ Description
#include "treeBoundBox.H"
#include "meshTools.H"
#include "OFstream.H"
#include "unitConversion.H"
using namespace Foam;
@ -90,6 +91,55 @@ void deleteBox
}
// Unmark non-manifold edges if individual triangles are not features
void unmarkBaffles
(
const triSurface& surf,
const scalar includedAngle,
List<surfaceFeatures::edgeStatus>& edgeStat
)
{
scalar minCos = Foam::cos(degToRad(180.0 - includedAngle));
const labelListList& edgeFaces = surf.edgeFaces();
forAll(edgeFaces, edgeI)
{
const labelList& eFaces = edgeFaces[edgeI];
if (eFaces.size() > 2)
{
label i0 = eFaces[0];
//const labelledTri& f0 = surf[i0];
const vector& n0 = surf.faceNormals()[i0];
//Pout<< "edge:" << edgeI << " n0:" << n0 << endl;
bool same = true;
for (label i = 1; i < eFaces.size(); i++)
{
//const labelledTri& f = surf[i];
const vector& n = surf.faceNormals()[eFaces[i]];
//Pout<< " mag(n&n0): " << mag(n&n0) << endl;
if (mag(n&n0) < minCos)
{
same = false;
break;
}
}
if (same)
{
edgeStat[edgeI] = surfaceFeatures::NONE;
}
}
}
}
// Main program:
int main(int argc, char *argv[])
@ -138,6 +188,11 @@ int main(int argc, char *argv[])
"((x0 y0 z0)(x1 y1 z1))",
"remove edges within specified bounding box"
);
argList::addBoolOption
(
"writeObj",
"write extendedFeatureEdgeMesh obj files"
);
# include "setRootCase.H"
# include "createTime.H"
@ -145,6 +200,7 @@ int main(int argc, char *argv[])
Info<< "Feature line extraction is only valid on closed manifold surfaces."
<< endl;
bool writeObj = args.optionFound("writeObj");
const fileName surfFileName = args[1];
const fileName outFileName = args[2];
@ -153,6 +209,8 @@ int main(int argc, char *argv[])
<< "Output feature set : " << outFileName << nl
<< endl;
fileName sFeatFileName = surfFileName.lessExt().name();
// Read
// ~~~~
@ -164,7 +222,6 @@ int main(int argc, char *argv[])
Info<< endl;
// Either construct features from surface&featureangle or read set.
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -187,9 +244,9 @@ int main(int argc, char *argv[])
set = surfaceFeatures(surf, includedAngle);
Info<< nl << "Writing initial features" << endl;
set.write("initial.fSet");
set.writeObj("initial");
// Info<< nl << "Writing initial features" << endl;
// set.write("initial.fSet");
// set.writeObj("initial");
}
else
{
@ -200,7 +257,6 @@ int main(int argc, char *argv[])
<< exit(FatalError);
}
Info<< nl
<< "Initial feature set:" << nl
<< " feature points : " << set.featurePoints().size() << nl
@ -284,8 +340,8 @@ int main(int argc, char *argv[])
Info<< endl << "Writing trimmed features to " << outFileName << endl;
newSet.write(outFileName);
Info<< endl << "Writing edge objs." << endl;
newSet.writeObj("final");
// Info<< endl << "Writing edge objs." << endl;
// newSet.writeObj("final");
Info<< nl
<< "Final feature set:" << nl
@ -297,20 +353,22 @@ int main(int argc, char *argv[])
<< " internal edges : " << newSet.nInternalEdges() << nl
<< endl;
// Extracting and writing a featureEdgeMesh
// Extracting and writing a extendedFeatureEdgeMesh
extendedFeatureEdgeMesh feMesh
(
newSet,
runTime,
surfFileName.lessExt().name() + ".featureEdgeMesh"
sFeatFileName + ".extendedFeatureEdgeMesh"
);
Info<< nl << "Writing extendedFeatureEdgeMesh to " << feMesh.objectPath()
<< endl;
if (writeObj)
{
feMesh.writeObj(surfFileName.lessExt().name());
}
feMesh.write();

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -95,6 +95,7 @@ cleanCase()
> /dev/null 2>&1 \
)
rm -rf VTK > /dev/null 2>&1
rm -f 0/cellLevel 0/pointLevel
if [ -e constant/polyMesh/blockMeshDict.m4 ]
then

View File

@ -39,7 +39,6 @@
#
# Checks for
# - illegal code, e.g. <TAB>
# - copyright is current, e.g. if present, contains XXX-<current-year>
# - columns greater than 80 for *.[CH] files
#
# Note
@ -138,8 +137,8 @@ checkIllegalCode()
{
echo "$hookName: check bad strings/characters etc ..." 1>&2
reBad="(N""abla|"$'\t'")"
msgBad="N""abla or <TAB>"
reBad="("$'\t'")"
msgBad="<TAB>"
scope=$(gitScope $@)
@ -167,40 +166,6 @@ checkIllegalCode()
}
#
# check that OpenCFD copyright is current
#
checkCopyright()
{
year=$(date +%Y)
echo "$hookName: check copyright ..." 1>&2
scope=$(gitScope $@)
badFiles=$(
for f in $fileList
do
# NB: need to have OpenCFD on a separate line to prevent
# this check being caught by itself!
#
# parse line numbers from grep output:
# <lineNr>: contents
#
lines=$(git grep -F -hn -e Copyright \
--and -e OpenCFD \
--and --not -e "$year" \
$scope"$f" |
sed -e 's@:.*@@' |
tr '\n' ' '
)
[ -n "$lines" ] && echo "$Indent$f -- lines: $lines"
done
)
dieOnBadFiles "Update copyright year, e.g. XXXX-$year"
}
#
# limit line length to 80-columns
#
@ -308,9 +273,6 @@ bad=$(git diff-index --cached --check $against --) || die "$bad"
# check for illegal code, e.g. <TAB>, etc
checkIllegalCode
# ensure OpenCFD copyright contains correct year
checkCopyright
# ensure code conforms to 80 columns max
checkLineLengthNonDirective

View File

@ -39,7 +39,6 @@
#
# Checks for
# - illegal code, e.g. <TAB>
# - copyright is current, e.g. if present, contains XXX-<current-year>
# - columns greater than 80 for *.[CH] files
#
#------------------------------------------------------------------------------
@ -101,8 +100,8 @@ checkIllegalCode()
{
echo "$hookName: check bad strings/characters etc ..." 1>&2
reBad="(N""abla|"$'\t'"|"$'\r\n'")"
msgBad="N""abla, <TAB> or DOS-line-endings"
reBad="("$'\t'"|"$'\r\n'")"
msgBad="<TAB> or DOS-line-endings"
scope=$(gitScope $@)
@ -130,40 +129,6 @@ checkIllegalCode()
}
#
# check that OpenCFD copyright is current
#
checkCopyright()
{
year=$(date +%Y)
echo "$hookName: check copyright ..." 1>&2
scope=$(gitScope $@)
badFiles=$(
for f in $fileList
do
# NB: need to have OpenCFD on a separate line to prevent
# this check being caught by itself!
#
# parse line numbers from grep output:
# <lineNr>: contents
#
lines=$(git grep -F -hn -e Copyright \
--and -e OpenCFD \
--and --not -e "$year" \
$scope"$f" |
sed -e 's@:.*@@' |
tr '\n' ' '
)
[ -n "$lines" ] && echo "$Indent$f -- lines: $lines"
done
)
dieOnBadFiles "Update copyright year, e.g. XXXX-$year"
}
#
# limit line length to 80-columns
#
@ -297,9 +262,6 @@ do
# check for illegal code, e.g. <TAB>, etc
checkIllegalCode $newSHA1
# ensure OpenCFD copyright contains correct year
checkCopyright $newSHA1
# ensure code conforms to 80 columns max
checkLineLengthNonDirective $newSHA1

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.7 |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -388,6 +388,10 @@ case SYSTEMOPENMPI:
setenv PLIBS "`mpicc --showme:link`"
set libDir=`echo "$PLIBS" | sed -e 's/.*-L\([^ ]*\).*/\1/'`
# Bit of a hack: strip off 'lib' and hope this is the path to openmpi
# include files and libraries.
setenv MPI_ARCH_PATH "${libDir:h}"
if ($?FOAM_VERBOSE && $?prompt) then
echo "Using system installed MPI:"
echo " compile flags : $PINC"

View File

@ -408,6 +408,10 @@ SYSTEMOPENMPI)
export PLIBS="`mpicc --showme:link`"
libDir=`echo "$PLIBS" | sed -e 's/.*-L\([^ ]*\).*/\1/'`
# Bit of a hack: strip off 'lib' and hope this is the path to openmpi
# include files and libraries.
export MPI_ARCH_PATH="${libDir%/*}"
if [ "$FOAM_VERBOSE" -a "$PS1" ]
then
echo "Using system installed MPI:"

View File

@ -126,7 +126,7 @@ Foam::treeDataCell::treeDataCell
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::pointField Foam::treeDataCell::points() const
Foam::pointField Foam::treeDataCell::shapePoints() const
{
pointField cc(cellLabels_.size());

View File

@ -125,7 +125,7 @@ public:
//- Get representative point cloud for all shapes inside
// (one point per shape)
pointField points() const;
pointField shapePoints() const;
// Search

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -287,7 +287,7 @@ Foam::Xfer<Foam::labelList> Foam::PackedBoolList::used() const
// * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
Foam::PackedBoolList&
Foam::PackedBoolList::operator=(const UList<bool>& lst)
Foam::PackedBoolList::operator=(const Foam::UList<bool>& lst)
{
this->setSize(lst.size());

View File

@ -115,7 +115,7 @@ public:
inline PackedBoolList(const Xfer<PackedList<1> >&);
//- Construct from a list of bools
explicit inline PackedBoolList(const UList<bool>&);
explicit inline PackedBoolList(const Foam::UList<bool>&);
//- Construct from a list of labels
// using the labels as indices to indicate which bits are set

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -73,7 +73,7 @@ inline Foam::PackedBoolList::PackedBoolList(const Xfer<PackedList<1> >& lst)
{}
inline Foam::PackedBoolList::PackedBoolList(const UList<bool>& lst)
inline Foam::PackedBoolList::PackedBoolList(const Foam::UList<bool>& lst)
:
PackedList<1>()
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -47,9 +47,6 @@ SourceFiles
namespace Foam
{
class Istream;
class Ostream;
// Forward declaration of friend functions and operators
template<class T, class BaseType> class CompactIOField;
@ -58,6 +55,7 @@ template<class T, class BaseType> Istream& operator>>
Istream&,
CompactIOField<T, BaseType>&
);
template<class T, class BaseType> Ostream& operator<<
(
Ostream&,
@ -122,23 +120,6 @@ public:
void operator=(const CompactIOField<T, BaseType>&);
void operator=(const Field<T>&);
// IOstream operators
//- Read Field from Istream, discarding contents of existing Field.
friend Istream& operator>> <T, BaseType>
(
Istream&,
CompactIOField<T, BaseType>&
);
// Write Field to Ostream.
friend Ostream& operator<< <T, BaseType>
(
Ostream&,
const CompactIOField<T, BaseType>&
);
};

View File

@ -124,16 +124,14 @@ Foam::IOdictionary::IOdictionary(const IOobject& io)
regIOobject(io)
{
// Temporary warning
if (io.readOpt() == IOobject::MUST_READ)
if (debug && io.readOpt() == IOobject::MUST_READ)
{
WarningIn("IOdictionary::IOdictionary(const IOobject&)")
//FatalErrorIn("IOdictionary::IOdictionary(const IOobject&)")
<< "Dictionary " << name()
<< " constructed with IOobject::MUST_READ"
" instead of IOobject::MUST_READ_IF_MODIFIED." << nl
<< "Use MUST_READ_IF_MODIFIED if you need automatic rereading."
<< endl;
//<< abort(FatalError);
}
// Everyone check or just master
@ -182,7 +180,7 @@ Foam::IOdictionary::IOdictionary(const IOobject& io, const dictionary& dict)
regIOobject(io)
{
// Temporary warning
if (io.readOpt() == IOobject::MUST_READ)
if (debug && io.readOpt() == IOobject::MUST_READ)
{
WarningIn
(

View File

@ -168,6 +168,12 @@ void Foam::Time::readDict()
Pout.precision(IOstream::defaultPrecision());
Perr.precision(IOstream::defaultPrecision());
FatalError().precision(IOstream::defaultPrecision());
FatalIOError.error::operator()().precision
(
IOstream::defaultPrecision()
);
}
if (controlDict_.found("writeCompression"))

View File

@ -55,6 +55,10 @@ Foam::dlLibraryTable::~dlLibraryTable()
{
forAllConstIter(dlLibraryTable, *this, iter)
{
// bug in dlclose - does not call static destructors of
// loaded library when actually unloading the library.
// See https://bugzilla.novell.com/show_bug.cgi?id=680125 and 657627.
// Seems related to using a non-system compiler!
dlClose(iter.key());
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -55,6 +55,7 @@ Ostream& operator<<
Ostream&,
const DynamicField<T, SizeInc, SizeMult, SizeDiv>&
);
template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
Istream& operator>>
(
@ -234,23 +235,6 @@ public:
//- Assignment from UList
inline void operator=(const UList<T>&);
// IOstream operators
// Write DynamicField to Ostream.
friend Ostream& operator<< <T, SizeInc, SizeMult, SizeDiv>
(
Ostream&,
const DynamicField<T, SizeInc, SizeMult, SizeDiv>&
);
//- Read from Istream, discarding contents of existing DynamicField.
friend Istream& operator>> <T, SizeInc, SizeMult, SizeDiv>
(
Istream&,
DynamicField<T, SizeInc, SizeMult, SizeDiv>&
);
};

View File

@ -34,6 +34,9 @@ License
#include "OSspecific.H"
#include "demandDrivenData.H"
#include "polyMeshTetDecomposition.H"
#include "indexedOctree.H"
#include "treeDataCell.H"
#include "SubField.H"
#include "pointMesh.H"

View File

@ -55,6 +55,8 @@ Foam::label Foam::polyMeshTetDecomposition::findSharedBasePoint
const point& oCc = pC[oCI];
List<scalar> tetQualities(2, 0.0);
forAll(f, faceBasePtI)
{
scalar thisBaseMinTetQuality = VGREAT;
@ -66,8 +68,6 @@ Foam::label Foam::polyMeshTetDecomposition::findSharedBasePoint
label facePtI = (tetPtI + faceBasePtI) % f.size();
label otherFacePtI = f.fcIndex(facePtI);
List<scalar> tetQualities(2, 0.0);
{
// owner cell tet
label ptAI = f[facePtI];

View File

@ -35,6 +35,7 @@ License
#include "Time.H"
#include "diagTensor.H"
#include "transformField.H"
#include "SubField.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //

View File

@ -31,6 +31,7 @@ License
#include "contiguous.H"
#include "transform.H"
#include "transformList.H"
#include "SubField.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //

View File

@ -25,6 +25,8 @@ License
#include "primitiveMesh.H"
#include "demandDrivenData.H"
#include "indexedOctree.H"
#include "treeDataCell.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //

View File

@ -56,8 +56,6 @@ SourceFiles
#include "DynamicList.H"
#include "edgeList.H"
#include "pointField.H"
#include "SubField.H"
#include "SubList.H"
#include "faceList.H"
#include "cellList.H"
#include "cellShapeList.H"
@ -65,16 +63,16 @@ SourceFiles
#include "boolList.H"
#include "HashSet.H"
#include "Map.H"
#include "EdgeMap.H"
#include "boundBox.H"
#include "indexedOctree.H"
#include "treeDataCell.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward declaration of classes
class treeDataCell;
template<class Type> class indexedOctree;
/*---------------------------------------------------------------------------*\
Class primitiveMesh Declaration
\*---------------------------------------------------------------------------*/

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -29,7 +29,7 @@ License
#include "ListOps.H"
#include "unitConversion.H"
#include "SortableList.H"
#include "EdgeMap.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //

View File

@ -24,8 +24,11 @@ License
\*---------------------------------------------------------------------------*/
#include "primitiveMesh.H"
#include "indexedOctree.H"
#include "treeDataCell.H"
#include "demandDrivenData.H"
#include "indexedOctree.H"
#include "treeDataCell.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //

View File

@ -25,6 +25,7 @@ License
#include "primitiveMesh.H"
#include "cell.H"
#include "boundBox.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -51,7 +51,6 @@ void Foam::ignitionSite::findIgnitionCells(const fvMesh& mesh)
cellVolumes_[0] = vols[ignCell];
scalar minDist = GREAT;
label nearestCell = 0;
label nIgnCells = 1;
forAll(centres, celli)
@ -60,7 +59,6 @@ void Foam::ignitionSite::findIgnitionCells(const fvMesh& mesh)
if (dist < minDist)
{
nearestCell = celli;
minDist = dist;
}

View File

@ -39,8 +39,10 @@ correction
{
const fvMesh& mesh = this->mesh();
GeometricField<Type, pointPatchField, pointMesh> pvf =
volPointInterpolation::New(mesh).interpolate(vf);
GeometricField<Type, pointPatchField, pointMesh> pvf
(
volPointInterpolation::New(mesh).interpolate(vf)
);
tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > tsfCorr =
linearInterpolate(vf);

View File

@ -654,8 +654,6 @@ void Foam::InteractionLists<ParticleType>::findExtendedProcBbsInRange
{
List<label> permutationIndices(nTrans, 0);
vector s = vector::zero;
if (nTrans == 0 && procI != Pstream::myProcNo())
{
treeBoundBox extendedReferredProcBb = allExtendedProcBbs[procI];

View File

@ -32,6 +32,8 @@ Foam::label Foam::particle::particleCount_ = 0;
const Foam::scalar Foam::particle::trackingCorrectionTol = 1e-5;
const Foam::scalar Foam::particle::lambdaDistanceToleranceCoeff = 1e3*SMALL;
namespace Foam
{
defineTypeNameAndDebug(particle, 0);

View File

@ -164,7 +164,8 @@ protected:
DynamicList<label>& faceList,
const tetPointRef& tet,
const FixedList<vector, 4>& tetAreas,
const FixedList<label, 4>& tetPlaneBasePtIs
const FixedList<label, 4>& tetPlaneBasePtIs,
const scalar tol
) const;
//- Find the lambda value for the line to-from across the
@ -178,7 +179,8 @@ protected:
const label tetPlaneBasePtI,
const label cellI,
const label tetFaceI,
const label tetPtI
const label tetPtI,
const scalar tol
) const;
//- Find the lambda value for a moving tri face
@ -191,7 +193,8 @@ protected:
const label tetPlaneBasePtI,
const label cellI,
const label tetFaceI,
const label tetPtI
const label tetPtI,
const scalar tol
) const;
//- Modify the tet owner data by crossing triI
@ -291,6 +294,10 @@ public:
// 'rescue' it from a tracking problem
static const scalar trackingCorrectionTol;
//- Fraction of the cell volume to use in determining tolerance values
// for the denominator and numerator of lambda
static const scalar lambdaDistanceToleranceCoeff;
// Constructors

View File

@ -34,7 +34,8 @@ inline void Foam::particle::findTris
DynamicList<label>& faceList,
const tetPointRef& tet,
const FixedList<vector, 4>& tetAreas,
const FixedList<label, 4>& tetPlaneBasePtIs
const FixedList<label, 4>& tetPlaneBasePtIs,
const scalar tol
) const
{
faceList.clear();
@ -52,7 +53,8 @@ inline void Foam::particle::findTris
tetPlaneBasePtIs[i],
cellI_,
tetFaceI_,
tetPtI_
tetPtI_,
tol
);
if ((lambda > 0.0) && (lambda < 1.0))
@ -72,7 +74,8 @@ inline Foam::scalar Foam::particle::tetLambda
const label tetPlaneBasePtI,
const label cellI,
const label tetFaceI,
const label tetPtI
const label tetPtI,
const scalar tol
) const
{
const pointField& pPts = mesh_.points();
@ -88,7 +91,8 @@ inline Foam::scalar Foam::particle::tetLambda
tetPlaneBasePtI,
cellI,
tetFaceI,
tetPtI
tetPtI,
tol
);
}
@ -97,12 +101,17 @@ inline Foam::scalar Foam::particle::tetLambda
scalar lambdaNumerator = (base - from) & n;
scalar lambdaDenominator = (to - from) & n;
if (mag(lambdaDenominator) < SMALL)
// n carries the area of the tet faces, so the dot product with a
// delta-length has the units of volume. Comparing the component of each
// delta-length in the direction of n times the face area to a fraction of
// the cell volume.
if (mag(lambdaDenominator) < tol)
{
if (mag(lambdaNumerator) < SMALL)
if (mag(lambdaNumerator) < tol)
{
// Track starts on the face, and is potentially
// parallel to it. +-SMALL/+-SMALL is not a good
// parallel to it. +-tol/+-tol is not a good
// comparison, return 0.0, in anticipation of tet
// centre correction.
@ -110,10 +119,11 @@ inline Foam::scalar Foam::particle::tetLambda
}
else
{
if (mag((to - from)) < SMALL)
if (mag((to - from)) < tol/mag(n))
{
// Zero length track, not along the face, face
// cannot be crossed.
// 'Zero' length track (compared to the tolerance, which is
// based on the cell volume, divided by the tet face area), not
// along the face, face cannot be crossed.
return GREAT;
}
@ -139,7 +149,8 @@ inline Foam::scalar Foam::particle::movingTetLambda
const label tetPlaneBasePtI,
const label cellI,
const label tetFaceI,
const label tetPtI
const label tetPtI,
const scalar tol
) const
{
const pointField& pPts = mesh_.points();
@ -291,12 +302,12 @@ inline Foam::scalar Foam::particle::movingTetLambda
}
if (mag(lambdaDenominator) < SMALL)
if (mag(lambdaDenominator) < tol)
{
if (mag(lambdaNumerator) < SMALL)
if (mag(lambdaNumerator) < tol)
{
// Track starts on the face, and is potentially
// parallel to it. +-SMALL)/+-SMALL is not a good
// parallel to it. +-tol)/+-tol is not a good
// comparison, return 0.0, in anticipation of tet
// centre correction.
@ -304,7 +315,7 @@ inline Foam::scalar Foam::particle::movingTetLambda
}
else
{
if (mag((to - from)) < SMALL)
if (mag((to - from)) < tol/mag(n))
{
// Zero length track, not along the face, face
// cannot be crossed.

View File

@ -30,6 +30,7 @@ License
#include "symmetryPolyPatch.H"
#include "wallPolyPatch.H"
#include "wedgePolyPatch.H"
#include "meshTools.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
@ -285,6 +286,11 @@ Foam::scalar Foam::particle::trackToFace
// be a different tet to the one that the particle occupies.
tetIndices faceHitTetIs;
// What tolerance is appropriate the minimum lambda numerator and
// denominator for tracking in this cell.
scalar lambdaDistanceTolerance =
lambdaDistanceToleranceCoeff*mesh_.cellVolumes()[cellI_];
do
{
if (triI != -1)
@ -370,7 +376,15 @@ Foam::scalar Foam::particle::trackToFace
tetPlaneBasePtIs[2] = basePtI;
tetPlaneBasePtIs[3] = basePtI;
findTris(endPosition, tris, tet, tetAreas, tetPlaneBasePtIs);
findTris
(
endPosition,
tris,
tet,
tetAreas,
tetPlaneBasePtIs,
lambdaDistanceTolerance
);
// Reset variables for new track
triI = -1;
@ -414,7 +428,8 @@ Foam::scalar Foam::particle::trackToFace
tetPlaneBasePtIs[tI],
cellI_,
tetFaceI_,
tetPtI_
tetPtI_,
lambdaDistanceTolerance
);
if (lam < lambdaMin)
@ -463,7 +478,7 @@ Foam::scalar Foam::particle::trackToFace
// << origId_ << " " << origProc_<< nl
// << "# face: " << tetFaceI_ << nl
// << "# tetPtI: " << tetPtI_ << nl
// << "# tetBasePtI: " << mesh.tetBasePtIs()[tetFaceI_] << nl
// << "# tetBasePtI: " << mesh_.tetBasePtIs()[tetFaceI_] << nl
// << "# tet.mag(): " << tet.mag() << nl
// << "# tet.quality(): " << tet.quality()
// << endl;
@ -703,6 +718,9 @@ void Foam::particle::hitWallFaces
const Foam::cell& thisCell = mesh_.cells()[cellI_];
scalar lambdaDistanceTolerance =
lambdaDistanceToleranceCoeff*mesh_.cellVolumes()[cellI_];
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
forAll(thisCell, cFI)
@ -754,7 +772,8 @@ void Foam::particle::hitWallFaces
f[tetIs.faceBasePt()],
cellI_,
fI,
tetIs.tetPt()
tetIs.tetPt(),
lambdaDistanceTolerance
);
if ((tetClambda <= 0.0) || (tetClambda >= 1.0))
@ -780,7 +799,8 @@ void Foam::particle::hitWallFaces
f[tetIs.faceBasePt()],
cellI_,
fI,
tetIs.tetPt()
tetIs.tetPt(),
lambdaDistanceTolerance
);
pointHit hitInfo(vector::zero);

View File

@ -440,7 +440,6 @@ void Foam::parcel::updateParcelProperties
scalar oldhv = fuels.hl(pg, T(), X());
scalar Np = N(oldDensity);
scalar newDensity = oldDensity;
scalar newMass = oldMass;
scalar newhg = oldhg;
scalar newhv = oldhv;
@ -460,7 +459,6 @@ void Foam::parcel::updateParcelProperties
// first time
if (n > 1)
{
newDensity = fuels.rho(pg, Tnew, X());
newMass = m();
newhg = 0.0;
scalarField Ynew(fuels.Y(X()));

View File

@ -112,7 +112,6 @@ void Foam::LISA::atomizeParcel
vector uDir = p.U()/mag(p.U());
scalar uGas = mag(vel & uDir);
vector Ug = uGas*uDir;
// Might be the relative velocity between Liquid and Gas, but using the
// absolute velocity of the parcel as suggested by the authors

View File

@ -118,9 +118,6 @@ void Foam::SHF::breakupParcel
scalar reLiquid = p.Re(rhoLiquid, vel, muLiquid);
scalar ohnesorge = sqrt(weLiquid)/(reLiquid + VSMALL);
vector acceleration = p.Urel(vel)/p.tMom();
vector trajectory = p.U()/mag(p.U());
vector vRel = p.Urel(vel);
scalar weGasCorr = weGas/(1.0 + weCorrCoeff_*ohnesorge);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -246,9 +246,6 @@ void Foam::blobsSwirlInjector::calculateHX
)
);
scalar hOLD = -100.0;
scalar xOLD = -100.0;
label i;
for (i=0; i<20; i++)
@ -267,10 +264,6 @@ void Foam::blobsSwirlInjector::calculateHX
);
x_ = sqr(1.0 - 2.0*h_/injectorDiameter);
hOLD = h_;
xOLD = x_;
}
x_ = sqr(1.0 - 2.0*h_/injectorDiameter);

View File

@ -607,12 +607,17 @@ void Foam::InjectionModel<CloudType>::inject(TrackData& td)
pPtr->rho()
);
// Add the new parcel
if (pPtr->move(td, dt))
{
td.cloud().addParticle(pPtr);
massAdded += pPtr->nParticle()*pPtr->mass();
parcelsAdded++;
}
else
{
delete pPtr;
}
}
}
}

View File

@ -163,13 +163,14 @@ void Foam::NonInertialFrameForce<CloudType>::cacheFields(const bool store)
)
)
{
uniformDimensionedVectorField omegaDot = this->mesh().template
uniformDimensionedVectorField centreOfRotation =
this->mesh().template
lookupObject<uniformDimensionedVectorField>
(
centreOfRotationName_
);
centreOfRotation_ = omegaDot.value();
centreOfRotation_ = centreOfRotation.value();
}
}
}
@ -187,7 +188,7 @@ Foam::forceSuSp Foam::NonInertialFrameForce<CloudType>::calcNonCoupled
{
forceSuSp value(vector::zero, 0.0);
const vector& r = p.position() - centreOfRotation_;
const vector r = p.position() - centreOfRotation_;
value.Su() =
mass

View File

@ -4,6 +4,7 @@ autoHexMeshDriver = $(autoHexMesh)/autoHexMeshDriver
$(autoHexMeshDriver)/autoLayerDriver.C
$(autoHexMeshDriver)/autoLayerDriverShrink.C
$(autoHexMeshDriver)/autoSnapDriver.C
$(autoHexMeshDriver)/autoSnapDriverFeature.C
$(autoHexMeshDriver)/autoRefineDriver.C
$(autoHexMeshDriver)/layerParameters/layerParameters.C
@ -16,6 +17,7 @@ $(autoHexMesh)/meshRefinement/meshRefinement.C
$(autoHexMesh)/meshRefinement/meshRefinementMerge.C
$(autoHexMesh)/meshRefinement/meshRefinementProblemCells.C
$(autoHexMesh)/meshRefinement/meshRefinementRefine.C
$(autoHexMesh)/refinementFeatures/refinementFeatures.C
$(autoHexMesh)/refinementSurfaces/refinementSurfaces.C
$(autoHexMesh)/shellSurfaces/shellSurfaces.C
$(autoHexMesh)/trackedParticle/trackedParticle.C

View File

@ -59,622 +59,6 @@ defineTypeNameAndDebug(autoLayerDriver, 0);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
Foam::label Foam::autoLayerDriver::mergePatchFacesUndo
(
const scalar minCos,
const scalar concaveCos,
const dictionary& motionDict
)
{
fvMesh& mesh = meshRefiner_.mesh();
// Patch face merging engine
combineFaces faceCombiner(mesh, true);
// Pick up all candidate cells on boundary
labelHashSet boundaryCells(mesh.nFaces()-mesh.nInternalFaces());
{
labelList patchIDs(meshRefiner_.meshedPatches());
const polyBoundaryMesh& patches = mesh.boundaryMesh();
forAll(patchIDs, i)
{
label patchI = patchIDs[i];
const polyPatch& patch = patches[patchI];
if (!patch.coupled())
{
forAll(patch, i)
{
boundaryCells.insert(mesh.faceOwner()[patch.start()+i]);
}
}
}
}
// Get all sets of faces that can be merged
labelListList allFaceSets
(
faceCombiner.getMergeSets
(
minCos,
concaveCos,
boundaryCells
)
);
label nFaceSets = returnReduce(allFaceSets.size(), sumOp<label>());
Info<< "Merging " << nFaceSets << " sets of faces." << nl << endl;
if (nFaceSets > 0)
{
if (debug)
{
faceSet allSets(mesh, "allFaceSets", allFaceSets.size());
forAll(allFaceSets, setI)
{
forAll(allFaceSets[setI], i)
{
allSets.insert(allFaceSets[setI][i]);
}
}
Pout<< "Writing all faces to be merged to set "
<< allSets.objectPath() << endl;
allSets.instance() = mesh.time().timeName();
allSets.write();
}
// Topology changes container
polyTopoChange meshMod(mesh);
// Merge all faces of a set into the first face of the set.
faceCombiner.setRefinement(allFaceSets, meshMod);
// Experimental: store data for all the points that have been deleted
meshRefiner_.storeData
(
faceCombiner.savedPointLabels(), // points to store
labelList(0), // faces to store
labelList(0) // cells to store
);
// Change the mesh (no inflation)
autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh, false, true);
// Update fields
mesh.updateMesh(map);
// Move mesh (since morphing does not do this)
if (map().hasMotionPoints())
{
mesh.movePoints(map().preMotionPoints());
}
else
{
// Delete mesh volumes.
mesh.clearOut();
}
faceCombiner.updateMesh(map);
meshRefiner_.updateMesh(map, labelList(0));
for (label iteration = 0; iteration < 100; iteration++)
{
Info<< nl
<< "Undo iteration " << iteration << nl
<< "----------------" << endl;
// Check mesh for errors
// ~~~~~~~~~~~~~~~~~~~~~
faceSet errorFaces
(
mesh,
"errorFaces",
mesh.nFaces()-mesh.nInternalFaces()
);
bool hasErrors = motionSmoother::checkMesh
(
false, // report
mesh,
motionDict,
errorFaces
);
//if (checkEdgeConnectivity)
//{
// Info<< "Checking edge-face connectivity (duplicate faces"
// << " or non-consecutive shared vertices)" << endl;
//
// label nOldSize = errorFaces.size();
//
// hasErrors =
// mesh.checkFaceFaces
// (
// false,
// &errorFaces
// )
// || hasErrors;
//
// Info<< "Detected additional "
// << returnReduce
// (
// errorFaces.size() - nOldSize,
// sumOp<label>()
// )
// << " faces with illegal face-face connectivity"
// << endl;
//}
if (!hasErrors)
{
break;
}
if (debug)
{
errorFaces.instance() = mesh.time().timeName();
Pout<< "Writing all faces in error to faceSet "
<< errorFaces.objectPath() << nl << endl;
errorFaces.write();
}
// Check any master cells for using any of the error faces
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DynamicList<label> mastersToRestore(allFaceSets.size());
forAll(allFaceSets, setI)
{
label masterFaceI = faceCombiner.masterFace()[setI];
if (masterFaceI != -1)
{
label masterCellII = mesh.faceOwner()[masterFaceI];
const cell& cFaces = mesh.cells()[masterCellII];
forAll(cFaces, i)
{
if (errorFaces.found(cFaces[i]))
{
mastersToRestore.append(masterFaceI);
break;
}
}
}
}
mastersToRestore.shrink();
label nRestore = returnReduce
(
mastersToRestore.size(),
sumOp<label>()
);
Info<< "Masters that need to be restored:"
<< nRestore << endl;
if (debug)
{
faceSet restoreSet(mesh, "mastersToRestore", mastersToRestore);
restoreSet.instance() = mesh.time().timeName();
Pout<< "Writing all " << mastersToRestore.size()
<< " masterfaces to be restored to set "
<< restoreSet.objectPath() << endl;
restoreSet.write();
}
if (nRestore == 0)
{
break;
}
// Undo
// ~~~~
// Topology changes container
polyTopoChange meshMod(mesh);
// Merge all faces of a set into the first face of the set.
// Experimental:mark all points/faces/cells that have been restored.
Map<label> restoredPoints(0);
Map<label> restoredFaces(0);
Map<label> restoredCells(0);
faceCombiner.setUnrefinement
(
mastersToRestore,
meshMod,
restoredPoints,
restoredFaces,
restoredCells
);
// Change the mesh (no inflation)
autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh, false, true);
// Update fields
mesh.updateMesh(map);
// Move mesh (since morphing does not do this)
if (map().hasMotionPoints())
{
mesh.movePoints(map().preMotionPoints());
}
else
{
// Delete mesh volumes.
mesh.clearOut();
}
faceCombiner.updateMesh(map);
// Renumber restore maps
inplaceMapKey(map().reversePointMap(), restoredPoints);
inplaceMapKey(map().reverseFaceMap(), restoredFaces);
inplaceMapKey(map().reverseCellMap(), restoredCells);
// Experimental:restore all points/face/cells in maps
meshRefiner_.updateMesh
(
map,
labelList(0), // changedFaces
restoredPoints,
restoredFaces,
restoredCells
);
Info<< endl;
}
if (debug)
{
Pout<< "Writing merged-faces mesh to time "
<< meshRefiner_.timeName() << nl << endl;
mesh.write();
}
}
else
{
Info<< "No faces merged ..." << endl;
}
return nFaceSets;
}
// Remove points. pointCanBeDeleted is parallel synchronised.
Foam::autoPtr<Foam::mapPolyMesh> Foam::autoLayerDriver::doRemovePoints
(
removePoints& pointRemover,
const boolList& pointCanBeDeleted
)
{
fvMesh& mesh = meshRefiner_.mesh();
// Topology changes container
polyTopoChange meshMod(mesh);
pointRemover.setRefinement(pointCanBeDeleted, meshMod);
// Change the mesh (no inflation)
autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh, false, true);
// Update fields
mesh.updateMesh(map);
// Move mesh (since morphing does not do this)
if (map().hasMotionPoints())
{
mesh.movePoints(map().preMotionPoints());
}
else
{
// Delete mesh volumes.
mesh.clearOut();
}
pointRemover.updateMesh(map);
meshRefiner_.updateMesh(map, labelList(0));
return map;
}
// Restore faces (which contain removed points)
Foam::autoPtr<Foam::mapPolyMesh> Foam::autoLayerDriver::doRestorePoints
(
removePoints& pointRemover,
const labelList& facesToRestore
)
{
fvMesh& mesh = meshRefiner_.mesh();
// Topology changes container
polyTopoChange meshMod(mesh);
// Determine sets of points and faces to restore
labelList localFaces, localPoints;
pointRemover.getUnrefimentSet
(
facesToRestore,
localFaces,
localPoints
);
// Undo the changes on the faces that are in error.
pointRemover.setUnrefinement
(
localFaces,
localPoints,
meshMod
);
// Change the mesh (no inflation)
autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh, false, true);
// Update fields
mesh.updateMesh(map);
// Move mesh (since morphing does not do this)
if (map().hasMotionPoints())
{
mesh.movePoints(map().preMotionPoints());
}
else
{
// Delete mesh volumes.
mesh.clearOut();
}
pointRemover.updateMesh(map);
meshRefiner_.updateMesh(map, labelList(0));
return map;
}
// Collect all faces that are both in candidateFaces and in the set.
// If coupled face also collects the coupled face.
Foam::labelList Foam::autoLayerDriver::collectFaces
(
const labelList& candidateFaces,
const labelHashSet& set
) const
{
const fvMesh& mesh = meshRefiner_.mesh();
// Has face been selected?
boolList selected(mesh.nFaces(), false);
forAll(candidateFaces, i)
{
label faceI = candidateFaces[i];
if (set.found(faceI))
{
selected[faceI] = true;
}
}
syncTools::syncFaceList
(
mesh,
selected,
orEqOp<bool>() // combine operator
);
labelList selectedFaces(findIndices(selected, true));
return selectedFaces;
}
// Pick up faces of cells of faces in set.
Foam::labelList Foam::autoLayerDriver::growFaceCellFace
(
const labelHashSet& set
) const
{
const fvMesh& mesh = meshRefiner_.mesh();
boolList selected(mesh.nFaces(), false);
forAllConstIter(faceSet, set, iter)
{
label faceI = iter.key();
label own = mesh.faceOwner()[faceI];
const cell& ownFaces = mesh.cells()[own];
forAll(ownFaces, ownFaceI)
{
selected[ownFaces[ownFaceI]] = true;
}
if (mesh.isInternalFace(faceI))
{
label nbr = mesh.faceNeighbour()[faceI];
const cell& nbrFaces = mesh.cells()[nbr];
forAll(nbrFaces, nbrFaceI)
{
selected[nbrFaces[nbrFaceI]] = true;
}
}
}
syncTools::syncFaceList
(
mesh,
selected,
orEqOp<bool>() // combine operator
);
return findIndices(selected, true);
}
// Remove points not used by any face or points used by only two faces where
// the edges are in line
Foam::label Foam::autoLayerDriver::mergeEdgesUndo
(
const scalar minCos,
const dictionary& motionDict
)
{
fvMesh& mesh = meshRefiner_.mesh();
Info<< nl
<< "Merging all points on surface that" << nl
<< "- are used by only two boundary faces and" << nl
<< "- make an angle with a cosine of more than " << minCos
<< "." << nl << endl;
// Point removal analysis engine with undo
removePoints pointRemover(mesh, true);
// Count usage of points
boolList pointCanBeDeleted;
label nRemove = pointRemover.countPointUsage(minCos, pointCanBeDeleted);
if (nRemove > 0)
{
Info<< "Removing " << nRemove
<< " straight edge points ..." << nl << endl;
// Remove points
// ~~~~~~~~~~~~~
doRemovePoints(pointRemover, pointCanBeDeleted);
for (label iteration = 0; iteration < 100; iteration++)
{
Info<< nl
<< "Undo iteration " << iteration << nl
<< "----------------" << endl;
// Check mesh for errors
// ~~~~~~~~~~~~~~~~~~~~~
faceSet errorFaces
(
mesh,
"errorFaces",
mesh.nFaces()-mesh.nInternalFaces()
);
bool hasErrors = motionSmoother::checkMesh
(
false, // report
mesh,
motionDict,
errorFaces
);
//if (checkEdgeConnectivity)
//{
// Info<< "Checking edge-face connectivity (duplicate faces"
// << " or non-consecutive shared vertices)" << endl;
//
// label nOldSize = errorFaces.size();
//
// hasErrors =
// mesh.checkFaceFaces
// (
// false,
// &errorFaces
// )
// || hasErrors;
//
// Info<< "Detected additional "
// << returnReduce(errorFaces.size()-nOldSize,sumOp<label>())
// << " faces with illegal face-face connectivity"
// << endl;
//}
if (!hasErrors)
{
break;
}
if (debug)
{
errorFaces.instance() = mesh.time().timeName();
Pout<< "**Writing all faces in error to faceSet "
<< errorFaces.objectPath() << nl << endl;
errorFaces.write();
}
labelList masterErrorFaces
(
collectFaces
(
pointRemover.savedFaceLabels(),
errorFaces
)
);
label n = returnReduce(masterErrorFaces.size(), sumOp<label>());
Info<< "Detected " << n
<< " error faces on boundaries that have been merged."
<< " These will be restored to their original faces." << nl
<< endl;
if (n == 0)
{
if (hasErrors)
{
Info<< "Detected "
<< returnReduce(errorFaces.size(), sumOp<label>())
<< " error faces in mesh."
<< " Restoring neighbours of faces in error." << nl
<< endl;
labelList expandedErrorFaces
(
growFaceCellFace
(
errorFaces
)
);
doRestorePoints(pointRemover, expandedErrorFaces);
}
break;
}
doRestorePoints(pointRemover, masterErrorFaces);
}
if (debug)
{
Pout<< "Writing merged-edges mesh to time "
<< meshRefiner_.timeName() << nl << endl;
mesh.write();
}
}
else
{
Info<< "No straight edges simplified and no points removed ..." << endl;
}
return nRemove;
}
// For debugging: Dump displacement to .obj files
void Foam::autoLayerDriver::dumpDisplacement
(
@ -793,7 +177,7 @@ void Foam::autoLayerDriver::checkMeshManifold() const
<< " points where this happens to pointSet "
<< nonManifoldPoints.name() << endl;
nonManifoldPoints.instance() = mesh.time().timeName();
nonManifoldPoints.instance() = meshRefiner_.timeName();
nonManifoldPoints.write();
}
Info<< endl;
@ -1080,7 +464,6 @@ void Foam::autoLayerDriver::handleWarpedFaces
}
//// No extrusion on cells with multiple patch faces. There ususally is a reason
//// why combinePatchFaces hasn't succeeded.
//void Foam::autoLayerDriver::handleMultiplePatchFaces
@ -1133,7 +516,7 @@ void Foam::autoLayerDriver::handleWarpedFaces
//
// if (nMultiPatchCells > 0)
// {
// multiPatchCells.instance() = mesh.time().timeName();
// multiPatchCells.instance() = meshRefiner_.timeName();
// Info<< "Writing " << nMultiPatchCells
// << " cells with multiple (connected) patch faces to cellSet "
// << multiPatchCells.objectPath() << endl;
@ -2547,9 +1930,15 @@ void Foam::autoLayerDriver::mergePatchFacesUndo
<< " (0=straight, 180=fully concave)" << nl
<< endl;
label nChanged = mergePatchFacesUndo(minCos, concaveCos, motionDict);
label nChanged = meshRefiner_.mergePatchFacesUndo
(
minCos,
concaveCos,
meshRefiner_.meshedPatches(),
motionDict
);
nChanged += mergeEdgesUndo(minCos, motionDict);
nChanged += meshRefiner_.mergeEdgesUndo(minCos, motionDict);
}
@ -3191,6 +2580,7 @@ void Foam::autoLayerDriver::addLayers
"addedCells",
findIndices(flaggedCells, true)
);
addedCellSet.instance() = meshRefiner_.timeName();
Info<< "Writing "
<< returnReduce(addedCellSet.size(), sumOp<label>())
<< " added cells to cellSet "
@ -3203,6 +2593,7 @@ void Foam::autoLayerDriver::addLayers
"layerFaces",
findIndices(flaggedCells, true)
);
layerFacesSet.instance() = meshRefiner_.timeName();
Info<< "Writing "
<< returnReduce(layerFacesSet.size(), sumOp<label>())
<< " faces inside added layer to faceSet "
@ -3279,6 +2670,9 @@ void Foam::autoLayerDriver::addLayers
mesh.clearOut();
}
// Reset the instance for if in overwrite mode
mesh.setInstance(meshRefiner_.timeName());
meshRefiner_.updateMesh(map, labelList(0));
@ -3345,6 +2739,7 @@ void Foam::autoLayerDriver::addLayers
// ~~~~~~~~~~
cellSet addedCellSet(mesh, "addedCells", findIndices(flaggedCells, true));
addedCellSet.instance() = meshRefiner_.timeName();
Info<< "Writing "
<< returnReduce(addedCellSet.size(), sumOp<label>())
<< " added cells to cellSet "
@ -3352,6 +2747,7 @@ void Foam::autoLayerDriver::addLayers
addedCellSet.write();
faceSet layerFacesSet(mesh, "layerFaces", findIndices(flaggedFaces, true));
layerFacesSet.instance() = meshRefiner_.timeName();
Info<< "Writing "
<< returnReduce(layerFacesSet.size(), sumOp<label>())
<< " faces inside added layer to faceSet "

View File

@ -105,46 +105,6 @@ class autoLayerDriver
// Private Member Functions
// Face merging
//- Merge patch faces. Undo until no checkMesh errors.
label mergePatchFacesUndo
(
const scalar minCos,
const scalar concaveCos,
const dictionary&
);
//- Remove points.
autoPtr<mapPolyMesh> doRemovePoints
(
removePoints& pointRemover,
const boolList& pointCanBeDeleted
);
//- Restore faces (which contain removed points)
autoPtr<mapPolyMesh> doRestorePoints
(
removePoints& pointRemover,
const labelList& facesToRestore
);
//- Return candidateFaces that are also in set.
labelList collectFaces
(
const labelList& candidateFaces,
const labelHashSet& set
) const;
//- Pick up faces of cells of faces in set.
labelList growFaceCellFace(const labelHashSet&) const;
//- Remove points not used by any face or points used by only
// two faces where the edges are in line
label mergeEdgesUndo(const scalar minCos, const dictionary&);
// Layers
//- For debugging: Dump displacement to .obj files

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -30,8 +30,8 @@ License
#include "cellSet.H"
#include "syncTools.H"
#include "refinementParameters.H"
#include "featureEdgeMesh.H"
#include "refinementSurfaces.H"
#include "refinementFeatures.H"
#include "shellSurfaces.H"
#include "mapDistributePolyMesh.H"
#include "unitConversion.H"
@ -48,62 +48,6 @@ defineTypeNameAndDebug(autoRefineDriver, 0);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// Read explicit feature edges
Foam::label Foam::autoRefineDriver::readFeatureEdges
(
const PtrList<dictionary>& featDicts,
PtrList<featureEdgeMesh>& featureMeshes,
labelList& featureLevels
) const
{
Info<< "Reading external feature lines." << endl;
const fvMesh& mesh = meshRefiner_.mesh();
featureMeshes.setSize(featDicts.size());
featureLevels.setSize(featDicts.size());
forAll(featDicts, i)
{
const dictionary& dict = featDicts[i];
fileName featFileName(dict.lookup("file"));
featureMeshes.set
(
i,
new featureEdgeMesh
(
IOobject
(
featFileName, // name
//mesh.time().findInstance("triSurface", featFileName),
// // instance
mesh.time().constant(), // instance
"triSurface", // local
mesh.time(), // registry
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
)
)
);
featureMeshes[i].mergePoints(meshRefiner_.mergeDistance());
featureLevels[i] = readLabel(dict.lookup("level"));
Info<< "Refinement level " << featureLevels[i]
<< " for all cells crossed by feature " << featFileName
<< " (" << featureMeshes[i].points().size() << " points, "
<< featureMeshes[i].edges().size() << " edges)." << endl;
}
Info<< "Read feature lines in = "
<< mesh.time().cpuTimeIncrement() << " s" << nl << endl;
return featureMeshes.size();
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -128,23 +72,15 @@ Foam::autoRefineDriver::autoRefineDriver
Foam::label Foam::autoRefineDriver::featureEdgeRefine
(
const refinementParameters& refineParams,
const PtrList<dictionary>& featDicts,
const label maxIter,
const label minRefine
)
{
const fvMesh& mesh = meshRefiner_.mesh();
// Read explicit feature edges
PtrList<featureEdgeMesh> featureMeshes;
// Per feature the refinement level
labelList featureLevels;
readFeatureEdges(featDicts, featureMeshes, featureLevels);
label iter = 0;
if (featureMeshes.size() && maxIter > 0)
if (meshRefiner_.features().size() && maxIter > 0)
{
for (; iter < maxIter; iter++)
{
@ -160,9 +96,6 @@ Foam::label Foam::autoRefineDriver::featureEdgeRefine
refineParams.keepPoints()[0], // For now only use one.
refineParams.curvature(),
featureMeshes,
featureLevels,
true, // featureRefinement
false, // internalRefinement
false, // surfaceRefinement
@ -266,8 +199,6 @@ Foam::label Foam::autoRefineDriver::surfaceOnlyRefine
// Only look at surface intersections (minLevel and surface curvature),
// do not do internal refinement (refinementShells)
const PtrList<featureEdgeMesh> dummyFeatures;
labelList candidateCells
(
meshRefiner_.refineCandidates
@ -275,9 +206,6 @@ Foam::label Foam::autoRefineDriver::surfaceOnlyRefine
refineParams.keepPoints()[0],
refineParams.curvature(),
dummyFeatures, // dummy featureMeshes;
labelList(0), // dummy featureLevels;
false, // featureRefinement
false, // internalRefinement
true, // surfaceRefinement
@ -432,8 +360,6 @@ Foam::label Foam::autoRefineDriver::shellRefine
<< "----------------------------" << nl
<< endl;
const PtrList<featureEdgeMesh> dummyFeatures;
labelList candidateCells
(
meshRefiner_.refineCandidates
@ -441,9 +367,6 @@ Foam::label Foam::autoRefineDriver::shellRefine
refineParams.keepPoints()[0],
refineParams.curvature(),
dummyFeatures, // dummy featureMeshes;
labelList(0), // dummy featureLevels;
false, // featureRefinement
true, // internalRefinement
false, // surfaceRefinement
@ -459,7 +382,7 @@ Foam::label Foam::autoRefineDriver::shellRefine
<< " cells to cellSet candidateCellsFromShells." << endl;
cellSet c(mesh, "candidateCellsFromShells", candidateCells);
c.instance() = mesh.time().timeName();
c.instance() = meshRefiner_.timeName();
c.write();
}
@ -677,6 +600,7 @@ void Foam::autoRefineDriver::splitAndMergeBaffles
handleSnapProblems, // remove perp edge connected cells
perpAngle, // perp angle
false, // merge free standing baffles?
//true, // merge free standing baffles?
motionDict,
const_cast<Time&>(mesh.time()),
globalToPatch_,
@ -735,7 +659,8 @@ void Foam::autoRefineDriver::splitAndMergeBaffles
void Foam::autoRefineDriver::mergePatchFaces
(
const refinementParameters& refineParams
const refinementParameters& refineParams,
const dictionary& motionDict
)
{
const fvMesh& mesh = meshRefiner_.mesh();
@ -750,11 +675,12 @@ void Foam::autoRefineDriver::mergePatchFaces
const_cast<Time&>(mesh.time())++;
}
meshRefiner_.mergePatchFaces
meshRefiner_.mergePatchFacesUndo
(
Foam::cos(degToRad(45.0)),
Foam::cos(degToRad(45.0)),
meshRefiner_.meshedPatches()
meshRefiner_.meshedPatches(),
motionDict
);
if (debug)
@ -762,7 +688,7 @@ void Foam::autoRefineDriver::mergePatchFaces
meshRefiner_.checkData();
}
meshRefiner_.mergeEdges(Foam::cos(degToRad(45.0)));
meshRefiner_.mergeEdgesUndo(Foam::cos(degToRad(45.0)), motionDict);
if (debug)
{
@ -789,13 +715,10 @@ void Foam::autoRefineDriver::doRefine
// Check that all the keep points are inside the mesh.
refineParams.findCells(mesh);
PtrList<dictionary> featDicts(refineDict.lookup("features"));
// Refine around feature edges
featureEdgeRefine
(
refineParams,
featDicts,
100, // maxIter
0 // min cells to refine
);
@ -833,7 +756,7 @@ void Foam::autoRefineDriver::doRefine
// Do something about cells with refined faces on the boundary
if (prepareForSnapping)
{
mergePatchFaces(refineParams);
mergePatchFaces(refineParams, motionDict);
}

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