ENH: viewFactorsGen: re-enable 2D. See #2560

This reverts the v2206 behaviour so does not include
the edge-integration (2LI) optimisation - it uses
the exact same code as v2206.
This commit is contained in:
mattijs
2022-10-03 16:54:58 +01:00
parent 5677e10d90
commit c59b6db3c4
3 changed files with 92 additions and 10 deletions

View File

@ -53,6 +53,15 @@ void Foam::singleCellFvMesh::agglomerateMesh
const polyPatch& pp = oldPatches[patchi];
if (pp.size() > 0)
{
if (agglom[patchi].size() != pp.size())
{
FatalErrorInFunction
<< "agglomeration on patch " << patchi
<< " (size " << pp.size()
<< ") is of size " << agglom[patchi].size()
<< exit(FatalError);
}
nAgglom[patchi] = max(agglom[patchi])+1;
forAll(pp, i)
@ -229,6 +238,7 @@ void Foam::singleCellFvMesh::agglomerateMesh
patchSizes[patchi] = coarseI-patchStarts[patchi];
}
//patchFaces.setSize(coarseI);
//Pout<< "patchStarts:" << patchStarts << endl;
//Pout<< "patchSizes:" << patchSizes << endl;
@ -398,7 +408,8 @@ void Foam::singleCellFvMesh::agglomerateMesh
Foam::singleCellFvMesh::singleCellFvMesh
(
const IOobject& io,
const fvMesh& mesh
const fvMesh& mesh,
const bool doInit
)
:
fvMesh(io, Zero, false),
@ -478,6 +489,12 @@ Foam::singleCellFvMesh::singleCellFvMesh
}
agglomerateMesh(mesh, agglom);
// initialise all (lower levels and current)
if (doInit)
{
fvMesh::init(true); // initialise fvMesh and underlying levels
}
}
@ -485,7 +502,8 @@ Foam::singleCellFvMesh::singleCellFvMesh
(
const IOobject& io,
const fvMesh& mesh,
const labelListList& patchFaceAgglomeration
const labelListList& patchFaceAgglomeration,
const bool doInit
)
:
fvMesh(io, Zero, false),
@ -556,12 +574,17 @@ Foam::singleCellFvMesh::singleCellFvMesh
)
{
agglomerateMesh(mesh, patchFaceAgglomeration);
// initialise all (lower levels and current)
if (doInit)
{
fvMesh::init(true); // initialise fvMesh and underlying levels
}
}
Foam::singleCellFvMesh::singleCellFvMesh(const IOobject& io)
Foam::singleCellFvMesh::singleCellFvMesh(const IOobject& io, const bool doInit)
:
fvMesh(io),
fvMesh(io, doInit),
patchFaceAgglomeration_
(
IOobject

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019,2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -155,7 +155,12 @@ public:
// Constructors
//- Construct from fvMesh and no agglomeration
singleCellFvMesh(const IOobject& io, const fvMesh&);
singleCellFvMesh
(
const IOobject& io,
const fvMesh&,
const bool doInit=true
);
//- Construct from fvMesh and agglomeration of boundary faces.
// Agglomeration is per patch, per patch face index the agglomeration
@ -164,11 +169,13 @@ public:
(
const IOobject& io,
const fvMesh&,
const labelListList& patchFaceAgglomeration
const labelListList& patchFaceAgglomeration,
const bool doInit=true
);
//- Read from IOobject
singleCellFvMesh(const IOobject& io);
singleCellFvMesh(const IOobject& io, const bool doInit=true);
// Member Functions