ENH: refine renumberMesh and renumberMethod (addenda to !669)

- provide no_topology() characteristic to avoid triggering potentially
  expensive mesh connectivity calculations when they are not required.

- remove/deprecate unused pointField references from the renumber
  methods. These appear to have crept in from outer similarities
  with decompositionMethod, but have no meaning for renumbering.

- remove/deprecate various unused aggregation renumberings since these
  have been previously replaced by pre-calling calcCellCells, or
  using bandCompression directly.

- make regionFaceOrder for block-wise renumbering optional and
  treat as experimental (ie, default is now disabled).

  The original idea was to sort the intra-region and inter-region faces
  separately. However, this will mostly lead to non-upper triangular
  ordering between regions, which checkMesh and others don't really like.

ENH: add timing information for various renumberMesh stages

ENH: add reset of clockTime and cpuTime increment

- simplifies section-wise timings

ENH: add globalIndex::null() and fieldTypes::processorType conveniences

- provides more central management of these characteristics
This commit is contained in:
Mark Olesen 2024-03-10 14:32:57 +01:00
parent 618faa0ab6
commit 0c84e50583
36 changed files with 541 additions and 448 deletions

View File

@ -206,7 +206,7 @@ int main(int argc, char *argv[])
#endif
loopInsert(map, nElem);
(void)timer.cpuTimeIncrement();
timer.resetCpuTimeIncrement();
unsigned long sum = 0;
for (label loopi = 0; loopi < nFind*nLoops; ++loopi)
@ -268,7 +268,7 @@ int main(int argc, char *argv[])
HashSet<label, Hash<label>> map(32);
loopInsert(map, nElem);
(void)timer.cpuTimeIncrement();
timer.resetCpuTimeIncrement();
unsigned long sum = 0;
for (label loopi = 0; loopi < nFind*nLoops; ++loopi)

View File

@ -1,3 +1,3 @@
Test-nullObject.C
Test-nullObject.cxx
EXE = $(FOAM_USER_APPBIN)/Test-nullObject

View File

@ -37,6 +37,7 @@ Description
#include "HashSet.H"
#include "faceList.H"
#include "pointField.H"
#include "globalIndex.H"
#include "IOstreams.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -150,6 +151,18 @@ int main()
NullObject::nullObject = "hello world";
NullObject::nullObject = Foam::identity(5);
{
const auto& gi = globalIndex::null();
Info<< "globalIndex::null() => "
<< " empty: " << gi.empty()
<< " nProcs: " << gi.nProcs()
<< " total-size: " << gi.totalSize() << nl;
// Even this works
Info<< " offsets: " << gi.offsets() << nl;
}
Info<< nl;
return 0;

View File

@ -123,6 +123,7 @@ Usage
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "clockTime.H"
#include "timeSelector.H"
#include "IOobjectList.H"
#include "fvMesh.H"
@ -147,6 +148,24 @@ Usage
using namespace Foam;
// Slightly messy way of handling timing, but since the timing points
// are scattered between 'main()' and other local functions...
clockTime timer;
// Timing categories
enum TimingType
{
READ_MESH, // Reading mesh
READ_FIELDS, // Reading fields
DECOMPOSE, // Domain decomposition (if any)
CELL_CELLS, // globalMeshData::calcCellCells
RENUMBER, // The renumberMethod
REORDER, // Mesh reordering (topoChange)
WRITING, // Writing mesh/fields
};
FixedList<double, 8> timings;
// Create named field from labelList for post-processing
tmp<volScalarField> createScalarField
@ -205,8 +224,8 @@ void getBand
scalar& sumSqrIntersect // scalar to avoid overflow
)
{
labelList cellBandwidth(nCells, Zero);
scalarField nIntersect(nCells, Zero);
labelList cellBandwidth(nCells, Foam::zero{});
scalarField nIntersect(nCells, Foam::zero{});
forAll(neighbour, facei)
{
@ -627,8 +646,33 @@ CompactListList<label> regionRenumber
invertOneToManyCompact(nRegions, cellToRegion)
);
if (method.needs_mesh())
if (method.no_topology())
{
// Special case when renumberMesh is only used for decomposition.
// - can skip generating the connectivity
// - nonetheless calculate the order in case it is non-identity
timer.resetTimeIncrement();
forAll(regionCellOrder, regioni)
{
// Note: cellMap is identical to regionToCells[regioni]
// since it is already sorted
labelList subCellOrder =
method.renumber(regionCellOrder[regioni].size());
// Per region reordering (inplace but with SubList)
regionCellOrder[regioni] =
labelUIndList(regionCellOrder[regioni], subCellOrder)();
}
timings[TimingType::RENUMBER] += timer.timeIncrement();
}
else if (method.needs_mesh())
{
timer.resetTimeIncrement();
forAll(regionCellOrder, regioni)
{
// Info<< " region " << regioni
@ -645,20 +689,20 @@ CompactListList<label> regionRenumber
// (assuming they are properly sorted!)
const labelList& cellMap = subsetter.cellMap();
labelList subCellOrder = method.renumber
(
subsetter.subMesh(),
subsetter.subMesh().cellCentres()
);
labelList subCellOrder = method.renumber(subsetter.subMesh());
UPstream::parRun(oldParRun); // Restore parallel state
// Per region reordering
regionCellOrder[regioni] = labelUIndList(cellMap, subCellOrder);
}
timings[TimingType::RENUMBER] += timer.timeIncrement();
}
else
{
timer.resetTimeIncrement();
forAll(regionCellOrder, regioni)
{
// Info<< " region " << regioni
@ -677,17 +721,16 @@ CompactListList<label> regionRenumber
cellCells
);
// Note: cellCentres not needed by every renumber method
labelList subCellOrder = method.renumber
(
cellCells,
pointField(mesh.cellCentres(), cellMap)
);
timings[TimingType::CELL_CELLS] += timer.timeIncrement();
labelList subCellOrder = method.renumber(cellCells);
UPstream::parRun(oldParRun); // Restore parallel state
// Per region reordering
regionCellOrder[regioni] = labelUIndList(cellMap, subCellOrder);
timings[TimingType::RENUMBER] += timer.timeIncrement();
}
}
// Info<< endl;
@ -832,8 +875,15 @@ int main(int argc, char *argv[])
runTime.setTime(Times[startTime], startTime);
// Start/reset all timings
timer.resetTime();
timings = Foam::zero{};
#include "createNamedMeshes.H"
timings[TimingType::READ_MESH] += timer.timeIncrement();
for (fvMesh& mesh : meshes)
{
@ -881,6 +931,7 @@ int main(int argc, char *argv[])
bool sortCoupledFaceCells = false;
bool writeMaps = args.found("write-maps");
bool orderPoints = false;
bool useRegionFaceOrder = false;
label blockSize = 0;
// Construct renumberMethod
@ -920,6 +971,12 @@ int main(int argc, char *argv[])
<< " and region-external."
<< nl << endl;
}
if (blockSize > 0)
{
useRegionFaceOrder =
renumberDict.getOrDefault("regionFaceOrder", false);
}
}
orderPoints = renumberDict.getOrDefault("orderPoints", false);
@ -969,12 +1026,12 @@ int main(int argc, char *argv[])
{
renumberPtr.reset(new CuthillMcKeeRenumber(renumberDict));
Info<< "Using renumber-method: " << renumberPtr().type()
<< " [default]" << nl << endl;
<< " [default]" << endl;
}
else
{
Info<< "Using renumber-method: " << renumberPtr().type()
<< nl << endl;
<< endl;
}
@ -1042,6 +1099,10 @@ int main(int argc, char *argv[])
if (!dryrun && doFields)
{
Info<< nl << "Reading fields" << nl;
timer.resetTimeIncrement();
objects = IOobjectList(mesh, runTime.timeName());
storedObjects.reserve(objects.size());
@ -1089,6 +1150,8 @@ int main(int argc, char *argv[])
#undef ReadFields
#undef ReadPointFields
timings[TimingType::READ_FIELDS] += timer.timeIncrement();
}
@ -1116,6 +1179,8 @@ int main(int argc, char *argv[])
if (blockSize > 0 && !doDecompose)
{
timer.resetTimeIncrement();
// Renumbering in two phases. Should be done in one so mapping of
// fields is done correctly!
@ -1143,6 +1208,7 @@ int main(int argc, char *argv[])
UPstream::parRun(oldParRun); // Restore parallel state
timings[TimingType::DECOMPOSE] += timer.timeIncrement();
// For debugging: write out region
createScalarField
@ -1163,12 +1229,14 @@ int main(int argc, char *argv[])
cellOrder = regionCellOrder.values();
// Determine new to old face order with new cell numbering
faceOrder = getRegionFaceOrder
(
mesh,
cellOrder,
cellToRegion
);
if (useRegionFaceOrder)
{
faceOrder = getRegionFaceOrder(mesh, cellOrder, cellToRegion);
}
else
{
faceOrder = getFaceOrder(mesh, cellOrder);
}
}
else
{
@ -1178,6 +1246,8 @@ int main(int argc, char *argv[])
// 1. decompose into regions (like decomposePar)
// 2. renumber each sub-region
timer.resetTimeIncrement();
// Read decompositionMethod dictionary
IOdictionary decomposeDict
(
@ -1212,6 +1282,8 @@ int main(int argc, char *argv[])
)
);
timings[TimingType::DECOMPOSE] += timer.timeIncrement();
UPstream::parRun(oldParRun); // Restore parallel state
CompactListList<label> regionCellOrder =
@ -1236,11 +1308,21 @@ int main(int argc, char *argv[])
else
{
// Determines sorted back to original cell ordering
cellOrder = renumberPtr().renumber
(
mesh,
mesh.cellCentres()
);
const auto& method = renumberPtr();
timer.resetTimeIncrement();
if (method.no_topology())
{
cellOrder = method.renumber(mesh.nCells());
}
else
{
cellOrder = method.renumber(mesh);
}
timings[TimingType::RENUMBER] += timer.timeIncrement();
}
@ -1321,11 +1403,7 @@ int main(int argc, char *argv[])
// Determine new to old face order with new cell numbering
faceOrder = getFaceOrder
(
mesh,
cellOrder // New to old cell
);
faceOrder = getFaceOrder(mesh, cellOrder);
}
@ -1681,6 +1759,8 @@ int main(int argc, char *argv[])
}
else
{
timer.resetTimeIncrement();
if (overwrite)
{
mesh.setInstance(oldInstance);
@ -1720,6 +1800,8 @@ int main(int argc, char *argv[])
mesh.write();
timings[TimingType::WRITING] += timer.timeIncrement();
if (writeMaps)
{
// For debugging: write out region
@ -1771,6 +1853,19 @@ int main(int argc, char *argv[])
}
}
Info<< nl
<< "Timings:" << nl
<< " read mesh : " << timings[TimingType::READ_MESH] << nl
<< " read fields : " << timings[TimingType::READ_FIELDS] << nl
<< " decompose : " << timings[TimingType::DECOMPOSE] << nl
<< " cell-cells : " << timings[TimingType::CELL_CELLS] << nl
<< " renumber : " << timings[TimingType::RENUMBER] << nl
<< " write : " << timings[TimingType::WRITING] << nl
<< "TotalTime = " << timer.elapsedTime() << " s" << nl
<< nl;
runTime.printExecutionTime(Info);
Info<< "End\n" << endl;
return 0;

View File

@ -38,6 +38,11 @@ sortCoupledFaceCells false;
// Optional entry: sort points into internal and boundary points
//orderPoints false;
// Optional entry (experimental) - for block-by-block (blockSize > 0) option:
// - sort intra-region and iter-region faces separately.
// This will likely lead to non-upper triangular ordering between regions.
//regionFaceOrder false;
method CuthillMcKee;
//method RCM; // == reverseCuthillMcKee;

View File

@ -77,6 +77,12 @@ void Foam::cpuTimePosix::resetCpuTime()
}
void Foam::cpuTimePosix::resetCpuTimeIncrement() const
{
last_.update();
}
double Foam::cpuTimePosix::elapsedCpuTime() const
{
last_.update();

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2014 OpenFOAM Foundation
Copyright (C) 2018 OpenCFD Ltd.
Copyright (C) 2018-2024 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -72,7 +72,8 @@ class cpuTimePosix
//- Start time, at the time of construction
value_type start_;
//- Last time when elapsedTime or timeIncrement was called
//- Last time when elapsedCpuTime or cpuTimeIncrement was called.
//- Also affected by resetCpuTime and resetCpuTimeIncrement.
mutable value_type last_;
@ -95,10 +96,14 @@ public:
//- Reset to use the current time for the start time
void resetCpuTime();
//- Return CPU time (in seconds) from the start
//- Reset to use the current time for the increment point
void resetCpuTimeIncrement() const;
//- Return CPU time [seconds] from the start
double elapsedCpuTime() const;
//- Return CPU time (in seconds) since last call to cpuTimeIncrement()
//- Return CPU time [seconds] since last call to cpuTimeIncrement(),
//- resetCpuTimeIncrement().
double cpuTimeIncrement() const;
};

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018-2023 OpenCFD Ltd.
Copyright (C) 2018-2024 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -59,6 +59,11 @@ const Foam::word Foam::fieldTypes::extrapolatedCalculatedType
Foam::fieldTypes::extrapolatedCalculatedTypeName_()
);
const Foam::word Foam::fieldTypes::processorType
(
Foam::fieldTypes::processorTypeName_()
);
const Foam::word Foam::fieldTypes::zeroGradientType
(
Foam::fieldTypes::zeroGradientTypeName_()

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2018-2023 OpenCFD Ltd.
Copyright (C) 2018-2024 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -105,6 +105,12 @@ inline const char* extrapolatedCalculatedTypeName_() noexcept
//- A combined \c zero-gradient and \c calculated patch field type
extern const word extrapolatedCalculatedType;
//- A \c processor patch field type
inline const char* processorTypeName_() noexcept { return "processor"; }
//- A \c processor patch field type
extern const word processorType;
//- A \c zeroGradient patch field type
inline const char* zeroGradientTypeName_() noexcept { return "zeroGradient"; }

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation
Copyright (C) 2018-2020 OpenCFD Ltd.
Copyright (C) 2018-2024 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -46,8 +46,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef clockTime_H
#define clockTime_H
#ifndef Foam_clockTime_H
#define Foam_clockTime_H
#include "clockValue.H"
@ -67,7 +67,8 @@ class clockTime
//- Time point at start, or after resetTime
clockValue start_;
//- Time point when elapsedTime or timeIncrement was called
//- Time point when elapsedTime or timeIncrement was called.
//- Also updated by resetTime and resetTimeIncrement.
mutable clockValue last_;
@ -84,13 +85,18 @@ public:
// Member Functions
//- Reset to use the current clock value for the start point
//- Reset to use the current clock value for the start
//- and increment points
inline void resetTime();
//- Reset to use the current clock value for the increment point
inline void resetTimeIncrement() const;
//- The time [seconds] since the start point
inline double elapsedTime() const;
//- The time [seconds] since the last call to timeIncrement()
//- The time [seconds] since the last call to elapsedTime(),
//- timeIncrement() or resetTime(), resetTimeIncrement()
inline double timeIncrement() const;
};

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018-2020 OpenCFD Ltd.
Copyright (C) 2018-2024 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -50,6 +50,12 @@ inline void Foam::clockTime::resetTime()
}
inline void Foam::clockTime::resetTimeIncrement() const
{
last_.update();
}
inline double Foam::clockTime::elapsedTime() const
{
last_.update();

View File

@ -36,8 +36,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef clockValue_H
#define clockValue_H
#ifndef Foam_clockValue_H
#define Foam_clockValue_H
#include <chrono>
#include <string>
@ -93,10 +93,7 @@ public:
// Member Functions
//- The time duration
inline const value_type& value() const
{
return value_;
}
const value_type& value() const noexcept { return value_; }
//- Reset to zero
inline void clear();

View File

@ -65,6 +65,12 @@ void Foam::cpuTimeCxx::resetCpuTime()
}
void Foam::cpuTimeCxx::resetCpuTimeIncrement() const
{
last_.update();
}
double Foam::cpuTimeCxx::elapsedCpuTime() const
{
last_.update();

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018-2019 OpenCFD Ltd.
Copyright (C) 2018-2024 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -37,8 +37,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef cpuTimeCxx_H
#define cpuTimeCxx_H
#ifndef Foam_cpuTimeCxx_H
#define Foam_cpuTimeCxx_H
#include <ctime>
@ -71,7 +71,8 @@ class cpuTimeCxx
//- Start time, at the time of construction
value_type start_;
//- Last time when elapsedTime or timeIncrement was called
//- Last time when elapsedCpuTime or cpuTimeIncrement was called.
//- Also affected by resetCpuTime and resetCpuTimeIncrement.
mutable value_type last_;
@ -91,13 +92,17 @@ public:
// Member Functions
//- Reset to use the current time for the start time
//- Reset to use the current time for the start and increment points
void resetCpuTime();
//- Reset to use the current time for the increment point
void resetCpuTimeIncrement() const;
//- Return CPU time (in seconds) from the start
double elapsedCpuTime() const;
//- Return CPU time (in seconds) since last call to cpuTimeIncrement()
//- Return CPU time [seconds] since last call to cpuTimeIncrement(),
//- resetCpuTimeIncrement().
double cpuTimeIncrement() const;
};

View File

@ -158,7 +158,7 @@ public:
{
if (!suspend_ && timer_)
{
(void) timer_->cpuTimeIncrement();
timer_->resetCpuTimeIncrement();
}
}

View File

@ -159,6 +159,13 @@ Foam::labelList cuthill_mckee_algorithm
}
}
// Debug:
// - the peak capacity of queuedCells approximates the
// maximum intermediate bandwidth
#if 0
Pout<< "bandCompression: peak-capacity=" << queuedCells.capacity() << nl;
#endif
// Now we have new-to-old in newOrder.
return newOrder;
}
@ -306,8 +313,14 @@ Foam::labelList Foam::meshTools::bandCompression
}
}
// Now we have new-to-old in newOrder.
// Debug:
// - the peak capacity of queuedCells approximates the
// maximum intermediate bandwidth
#if 0
Pout<< "bandCompression: peak-capacity=" << queuedCells.capacity() << nl;
#endif
// Now we have new-to-old in newOrder.
return newOrder;
}

View File

@ -103,15 +103,17 @@ labelList bandCompression
namespace Foam
{
//- Forward to meshTools::bandCompression
//- Deprecated - prefer meshTools::bandCompression()
// \deprecated(2022-03) prefer meshTools::bandCompression()
FOAM_DEPRECATED_FOR(2022-03, "meshTools::bandCompression()")
inline labelList bandCompression(const labelListList& cellCellAddressing)
{
return meshTools::bandCompression(cellCellAddressing);
}
//- Forward to meshTools::bandCompression
//- Deprecated - prefer meshTools::bandCompression()
// \deprecated(2022-03) prefer meshTools::bandCompression()
FOAM_DEPRECATED_FOR(2022-03, "meshTools::bandCompression()")
inline labelList bandCompression
(
const labelUList& cellCells,

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2018-2023 OpenCFD Ltd.
Copyright (C) 2018-2024 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -118,6 +118,16 @@ public:
struct gatherNonLocal{};
// Static Member Functions
//- Return a null globalIndex (reference to a nullObject).
//- Behaves like an empty globalIndex
static const globalIndex& null() noexcept
{
return NullObjectRef<globalIndex>();
}
// Constructors
//- Default construct (empty)

View File

@ -30,7 +30,6 @@ License
#include "SloanRenumber.H"
#include "addToRunTimeSelectionTable.H"
#include "globalMeshData.H"
#include "processorPolyPatch.H"
#include "syncTools.H"
@ -165,8 +164,7 @@ Foam::labelList renumberImpl(Graph& G, const bool useReverse)
Foam::labelList Foam::SloanRenumber::renumber
(
const polyMesh& mesh,
const pointField& points
const polyMesh& mesh
) const
{
// Construct graph : faceOwner + connections across cyclics.
@ -186,7 +184,7 @@ Foam::labelList Foam::SloanRenumber::renumber
Graph G(mesh.nCells());
// Add internal faces
forAll(mesh.faceNeighbour(), facei)
for (label facei = 0; facei < mesh.nInternalFaces(); ++facei)
{
add_edge(mesh.faceOwner()[facei], mesh.faceNeighbour()[facei], G);
}
@ -226,8 +224,7 @@ Foam::labelList Foam::SloanRenumber::renumber
Foam::labelList Foam::SloanRenumber::renumber
(
const CompactListList<label>& cellCells,
const pointField&
const CompactListList<label>& cellCells
) const
{
Graph G(cellCells.size());
@ -251,8 +248,7 @@ Foam::labelList Foam::SloanRenumber::renumber
Foam::labelList Foam::SloanRenumber::renumber
(
const labelListList& cellCells,
const pointField&
const labelListList& cellCells
) const
{
Graph G(cellCells.size());

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2012-2015 OpenFOAM Foundation
Copyright (C) 2022 OpenCFD Ltd.
Copyright (C) 2022-2024 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -83,44 +83,26 @@ public:
//- Toggle reverse on/off
void reverse(bool on) noexcept { reverse_ = on; }
//- The renumbering method does not require a polyMesh
virtual bool needs_mesh() const { return false; }
// With mesh topology
//- Return the cell visit order (from ordered back to original cell id)
//- using the mesh to determine the connectivity.
virtual labelList renumber(const polyMesh& mesh) const;
//- Return the order in which cells need to be visited
//- (ie. from ordered back to original cell label).
// This is only defined for geometric renumberMethods.
virtual labelList renumber(const pointField&) const
{
NotImplemented;
return labelList();
}
// With explicit topology
//- Return the order in which cells need to be visited
//- (ie. from ordered back to original cell label).
// Use the mesh connectivity (if needed)
//- Return the cell visit order (from ordered back to original cell id)
virtual labelList renumber
(
const polyMesh& mesh,
const pointField& cc
const CompactListList<label>& cellCells
) const;
//- Return the order in which cells need to be visited
//- (ie. from ordered back to original cell label).
//- Return the cell visit order (from ordered back to original cell id)
virtual labelList renumber
(
const CompactListList<label>& cellCells,
const pointField& cellCentres
) const;
//- Return the order in which cells need to be visited
//- (ie. from ordered back to original cell label).
// The connectivity is equal to mesh.cellCells() except
// - the connections are across coupled patches
virtual labelList renumber
(
const labelListList& cellCells,
const pointField& cc
const labelListList& cellCells
) const;
};

View File

@ -112,8 +112,7 @@ Foam::reverseCuthillMcKeeRenumber::reverseCuthillMcKeeRenumber
Foam::labelList Foam::CuthillMcKeeRenumber::renumber
(
const polyMesh& mesh,
const pointField&
const polyMesh& mesh
) const
{
labelList orderedToOld = meshTools::bandCompression(mesh);
@ -129,26 +128,7 @@ Foam::labelList Foam::CuthillMcKeeRenumber::renumber
Foam::labelList Foam::CuthillMcKeeRenumber::renumber
(
const labelList& cellCells,
const labelList& offsets,
const pointField& cc
) const
{
labelList orderedToOld = meshTools::bandCompression(cellCells, offsets);
if (reverse_)
{
Foam::reverse(orderedToOld);
}
return orderedToOld;
}
Foam::labelList Foam::CuthillMcKeeRenumber::renumber
(
const CompactListList<label>& cellCells,
const pointField&
const CompactListList<label>& cellCells
) const
{
labelList orderedToOld = meshTools::bandCompression(cellCells);
@ -164,8 +144,7 @@ Foam::labelList Foam::CuthillMcKeeRenumber::renumber
Foam::labelList Foam::CuthillMcKeeRenumber::renumber
(
const labelListList& cellCells,
const pointField&
const labelListList& cellCells
) const
{
labelList orderedToOld = meshTools::bandCompression(cellCells);
@ -179,4 +158,21 @@ Foam::labelList Foam::CuthillMcKeeRenumber::renumber
}
// Foam::labelList Foam::CuthillMcKeeRenumber::renumber
// (
// const labelUList& cellCells,
// const labelUList& offsets
// ) const
// {
// labelList orderedToOld = meshTools::bandCompression(cellCells, offsets);
//
// if (reverse_)
// {
// Foam::reverse(orderedToOld);
// }
//
// return orderedToOld;
// }
// ************************************************************************* //

View File

@ -30,6 +30,9 @@ Class
Description
Cuthill-McKee renumbering (CM or RCM)
SeeAlso
Foam::meshTools::bandCompression
SourceFiles
CuthillMcKeeRenumber.C
@ -85,62 +88,32 @@ public:
//- Toggle reverse on/off
void reverse(bool on) noexcept { reverse_ = on; }
//- The renumbering method does not require a polyMesh
virtual bool needs_mesh() const { return false; }
// With mesh topology
//- Return the order in which cells need to be visited
//- (ie. from ordered back to original cell label).
// This is only defined for geometric renumberMethods.
virtual labelList renumber(const pointField&) const
{
NotImplemented;
return labelList();
}
//- Return the order in which cells need to be visited
//- (ie. from ordered back to original cell label).
// Use the mesh connectivity (if needed)
//- Return the cell visit order (from ordered back to original cell id)
//- using the mesh to determine the connectivity.
virtual labelList renumber
(
//! Mesh connectivity (see globalMeshData::calcCellCells)
const polyMesh& mesh,
//! \em ignored
const pointField& cellCentres
const polyMesh& mesh
) const;
//- Return the order in which cells need to be visited
//- (ie. from ordered back to original cell label).
// Connectivity in losort addressing (= neighbour + offsets into
// neighbour)
virtual labelList renumber
(
const labelList& cellCells,
const labelList& offsets,
//! \em ignored
const pointField& cellCentres
) const;
//- Return the order in which cells need to be visited
//- (ie. from ordered back to original cell label).
// With explicit topology
//- Return the cell visit order (from ordered back to original cell id).
virtual labelList renumber
(
//! Mesh connectivity
const CompactListList<label>& cellCells,
//! \em ignored
const pointField& cellCentres
const CompactListList<label>& cellCells
) const;
//- Return the order in which cells need to be visited
//- (ie. from ordered back to original cell label).
// The connectivity is equal to mesh.cellCells() except
// - the connections are across coupled patches
//- Return the cell visit order (from ordered back to original cell id).
virtual labelList renumber
(
//! Mesh connectivity
const labelListList& cellCells,
//! \em ignored
const pointField& cellCentres
const labelListList& cellCells
) const;
};

View File

@ -68,10 +68,11 @@ Foam::manualRenumber::manualRenumber(const dictionary& dict)
Foam::labelList Foam::manualRenumber::renumber
(
const polyMesh& mesh,
const pointField& points
const polyMesh& mesh
) const
{
const label nCells = mesh.nCells();
labelList newToOld
(
labelIOList::readContents
@ -87,31 +88,27 @@ Foam::labelList Foam::manualRenumber::renumber
);
// Check if the final renumbering is OK
if (newToOld.size() != points.size())
if (newToOld.size() != nCells)
{
FatalErrorInFunction
<< "Size of renumber list does not correspond "
<< "to the number of points. Size: "
<< newToOld.size() << " Number of points: "
<< points.size()
<< ".\n" << "Manual renumbering data read from file "
<< dataFile_ << "." << endl
<< "Size of renumber list: "
<< newToOld.size() << " != number of cells: " << nCells << nl
<< "Renumbering data read from file " << dataFile_ << endl
<< exit(FatalError);
}
// Invert to see if one to one
labelList oldToNew(points.size(), -1);
labelList oldToNew(nCells, -1);
forAll(newToOld, i)
{
const label origCelli = newToOld[i];
if (origCelli < 0 || origCelli >= points.size())
if (origCelli < 0 || origCelli >= nCells)
{
FatalErrorInFunction
<< "Renumbering is not one-to-one. Index "
<< i << " maps onto original cell " << origCelli
<< ".\n" << "Manual renumbering data read from file "
<< dataFile_ << nl
<< "Renumbering range error. Index " << i
<< " maps to cell " << origCelli << " from " << nCells << nl
<< "Renumbering data read from file " << dataFile_ << endl
<< exit(FatalError);
}
@ -124,8 +121,7 @@ Foam::labelList Foam::manualRenumber::renumber
FatalErrorInFunction
<< "Renumbering is not one-to-one. Index " << i << " and "
<< oldToNew[origCelli] << " map onto " << origCelli << nl
<< "Manual renumbering data read from file "
<< dataFile_ << nl
<< "Renumbering data read from file " << dataFile_ << endl
<< exit(FatalError);
}
}

View File

@ -80,41 +80,31 @@ public:
virtual bool needs_mesh() const { return true; }
//- Return the order in which cells need to be visited
//- (ie. from ordered back to original cell label).
virtual labelList renumber(const pointField&) const
{
NotImplemented;
return labelList();
}
// With mesh topology
//- Return the order in which cells need to be visited
//- (ie. from ordered back to original cell label).
// Uses mesh for regIOobject
//- Return the cell visit order (from ordered back to original cell id)
//- using the mesh for its IOobject and instance.
virtual labelList renumber(const polyMesh& mesh) const;
// With explicit topology - Not implemented!
//- Return the cell visit order (from ordered back to original cell id)
//- Not implemented!
virtual labelList renumber
(
const polyMesh& mesh,
const pointField& cc
) const;
//- Return the order in which cells need to be visited
//- (ie. from ordered back to original cell label).
virtual labelList renumber
(
const CompactListList<label>& cellCells,
const pointField& cellCentres
const CompactListList<label>& cellCells
) const
{
NotImplemented;
return labelList();
}
//- Return the order in which cells need to be visited
//- (ie. from ordered back to original cell label).
//- Return the cell visit order (from ordered back to original cell id)
//- Not implemented!
virtual labelList renumber
(
const labelListList& cellCells,
const pointField& cellCentres
const labelListList& cellCells
) const
{
NotImplemented;

View File

@ -60,6 +60,15 @@ Foam::noRenumber::noRenumber(const dictionary& dict)
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::labelList Foam::noRenumber::renumber
(
const label nCells
) const
{
return Foam::identity(nCells);
}
Foam::labelList Foam::noRenumber::renumber
(
const pointField& cellCentres
@ -71,8 +80,7 @@ Foam::labelList Foam::noRenumber::renumber
Foam::labelList Foam::noRenumber::renumber
(
const polyMesh& mesh,
const pointField&
const polyMesh& mesh
) const
{
return Foam::identity(mesh.nCells());
@ -81,8 +89,7 @@ Foam::labelList Foam::noRenumber::renumber
Foam::labelList Foam::noRenumber::renumber
(
const CompactListList<label>& cellCells,
const pointField&
const CompactListList<label>& cellCells
) const
{
return Foam::identity(cellCells.size());
@ -91,8 +98,7 @@ Foam::labelList Foam::noRenumber::renumber
Foam::labelList Foam::noRenumber::renumber
(
const labelListList& cellCells,
const pointField&
const labelListList& cellCells
) const
{
return Foam::identity(cellCells.size());

View File

@ -73,42 +73,48 @@ public:
// Member Functions
//- The renumbering method does not require a polyMesh
virtual bool needs_mesh() const { return false; }
//- Renumbering method without mesh or cell-cell topology!
virtual bool no_topology() const { return true; }
//- Return the order in which cells need to be visited
//- (ie. from ordered back to original cell label).
// No topology
//- Return the cell visit order (from ordered back to original cell id)
//- based solely on the number of cells.
virtual labelList renumber(const label nCells) const;
//- Return the cell visit order (from ordered back to original cell id).
//- based solely on pointField size
virtual labelList renumber(const pointField&) const;
//- Return the order in which cells need to be visited
//- (ie. from ordered back to original cell label).
// With mesh topology
//- Return the cell visit order (from ordered back to original cell id)
//- using the mesh only for the number of cells
virtual labelList renumber
(
//! Mesh number of cells
const polyMesh& mesh,
//! \em ignored
const pointField& cellCentres
//! Mesh provides the number of cells
const polyMesh& mesh
) const;
//- Return the order in which cells need to be visited
//- (ie. from ordered back to original cell label).
// With explicit topology
//- Return the cell visit order (from ordered back to original cell id)
//- using the topology only for the number of cells
virtual labelList renumber
(
//! Mesh connectivity for number of cells
const CompactListList<label>& cellCells,
//! \em ignored
const pointField& cellCentres
//! Connectivity provides the number of cells
const CompactListList<label>& cellCells
) const;
//- Return the order in which cells need to be visited
//- (ie. from ordered back to original cell label).
//- Return the cell visit order (from ordered back to original cell id)
//- using the topology only for the number of cells
virtual labelList renumber
(
//! Mesh connectivity for number of cells
const labelListList& cellCells,
//! \em ignored
const pointField& cellCentres
//! Connectivity provides the number of cells
const labelListList& cellCells
) const;
};

View File

@ -86,6 +86,15 @@ Foam::randomRenumber::randomRenumber(const dictionary& dict)
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::labelList Foam::randomRenumber::renumber
(
const label nCells
) const
{
return randomMap(nCells);
}
Foam::labelList Foam::randomRenumber::renumber
(
const pointField& cellCentres
@ -97,8 +106,7 @@ Foam::labelList Foam::randomRenumber::renumber
Foam::labelList Foam::randomRenumber::renumber
(
const polyMesh& mesh,
const pointField&
const polyMesh& mesh
) const
{
return randomMap(mesh.nCells());
@ -107,8 +115,7 @@ Foam::labelList Foam::randomRenumber::renumber
Foam::labelList Foam::randomRenumber::renumber
(
const CompactListList<label>& cellCells,
const pointField&
const CompactListList<label>& cellCells
) const
{
return randomMap(cellCells.size());
@ -117,8 +124,7 @@ Foam::labelList Foam::randomRenumber::renumber
Foam::labelList Foam::randomRenumber::renumber
(
const labelListList& cellCells,
const pointField&
const labelListList& cellCells
) const
{
return randomMap(cellCells.size());

View File

@ -72,42 +72,48 @@ public:
// Member Functions
//- The renumbering method does not require a polyMesh
virtual bool needs_mesh() const { return false; }
//- Renumbering method without mesh or cell-cell topology!
virtual bool no_topology() const { return true; }
//- Return the order in which cells need to be visited
//- (ie. from ordered back to original cell label).
// No topology
//- Return the cell visit order (from ordered back to original cell id)
//- based solely on the number of cells.
virtual labelList renumber(const label nCells) const;
//- Return the cell visit order (from ordered back to original cell id).
//- based solely on pointField size
virtual labelList renumber(const pointField&) const;
//- Return the order in which cells need to be visited
//- (ie. from ordered back to original cell label).
// With mesh topology
//- Return the cell visit order (from ordered back to original cell id)
//- using the mesh only for the number of cells
virtual labelList renumber
(
//! Mesh number of cells
const polyMesh& mesh,
//! \em ignored
const pointField& cellCentres
//! Mesh provides the number of cells
const polyMesh& mesh
) const;
//- Return the order in which cells need to be visited
//- (ie. from ordered back to original cell label).
// With explicit topology
//- Return the cell visit order (from ordered back to original cell id)
//- using the topology only for the number of cells
virtual labelList renumber
(
//! Mesh connectivity for number of cells
const CompactListList<label>& cellCells,
//! \em ignored
const pointField& cellCentres
//! Connectivity provides the number of cells
const CompactListList<label>& cellCells
) const;
//- Return the order in which cells need to be visited
//- (ie. from ordered back to original cell label).
//- Return the cell visit order (from ordered back to original cell id)
//- using the topology only for the number of cells
virtual labelList renumber
(
//! Mesh connectivity for number of cells
const labelListList& cellCells,
//! \em ignored
const pointField& cellCentres
//! Connectivity provides the number of cells
const labelListList& cellCells
) const;
};

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2019-2023 OpenCFD Ltd.
Copyright (C) 2019-2024 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -82,10 +82,14 @@ Foam::autoPtr<Foam::renumberMethod> Foam::renumberMethod::New
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::labelList Foam::renumberMethod::renumber
(
const pointField&
) const
Foam::labelList Foam::renumberMethod::renumber(const label nCells) const
{
NotImplemented;
return labelList();
}
Foam::labelList Foam::renumberMethod::renumber(const pointField& cc) const
{
NotImplemented;
return labelList();
@ -94,44 +98,21 @@ Foam::labelList Foam::renumberMethod::renumber
Foam::labelList Foam::renumberMethod::renumber
(
const polyMesh& mesh,
const pointField& points
const polyMesh& mesh
) const
{
// Local mesh connectivity
CompactListList<label> cellCells;
globalMeshData::calcCellCells(mesh, cellCells);
return renumber(cellCells, points);
}
Foam::labelList Foam::renumberMethod::renumber
(
const CompactListList<label>& cellCells,
const pointField& points
) const
{
return renumber(cellCells.unpack(), points);
}
Foam::labelList Foam::renumberMethod::renumber
(
const labelList& cellCells,
const labelList& offsets,
const pointField& cc
) const
{
NotImplemented;
return labelList();
return renumber(cellCells);
}
Foam::labelList Foam::renumberMethod::renumber
(
const polyMesh& mesh,
const labelList& fineToCoarse,
const labelUList& fineToCoarse,
const pointField& coarsePoints
) const
{
@ -140,16 +121,13 @@ Foam::labelList Foam::renumberMethod::renumber
(
mesh,
fineToCoarse,
coarsePoints.size(),
coarsePoints.size(), // nLocalCoarse
false, // local only (parallel = false)
coarseCellCells
);
// Renumber based on agglomerated points
labelList coarseDistribution
(
renumber(coarseCellCells, coarsePoints)
);
labelList coarseDistribution = renumber(coarseCellCells);
// From coarse back to fine for original mesh
return labelList(coarseDistribution, fineToCoarse);

View File

@ -98,72 +98,99 @@ public:
// Member Functions
//- Does renumbering method require a polyMesh?
//- Renumbering method without mesh or cell-cell topology
//- (very special case)
virtual bool no_topology() const { return false; }
//- Renumbering method requires a polyMesh for its topology
virtual bool needs_mesh() const { return false; }
// No topology
//- Return the order in which cells need to be visited
//- (ie. from ordered back to original cell label).
// This is only defined for geometric renumber methods.
//- Return the cell visit order (from ordered back to original cell id)
//- based solely on the number of cells.
// Only applicable for no_topology() methods.
virtual labelList renumber(const label nCells) const;
//- Return the cell visit order (from ordered back to original cell id)
//- based solely on the cell centres (or number of cell centres).
// Only applicable for no_topology() methods.
virtual labelList renumber(const pointField&) const;
// Topology provided by mesh
// With mesh topology
//- Return the order in which cells need to be visited
//- (ie. from ordered back to original cell label).
// Use the mesh connectivity (if needed)
virtual labelList renumber(const polyMesh&, const pointField&) const;
//- Return the cell visit order (from ordered back to original cell id)
//- using the mesh to determine the connectivity.
virtual labelList renumber(const polyMesh& mesh) const;
//- Return the order in which cells need to be visited
//- (ie. from ordered back to original cell label).
// Gets passed agglomeration map (from fine to coarse cells) and coarse
// cell
// location. Can be overridden by renumberMethods that provide this
// functionality natively. Coarse cells are local to the processor
// (if in parallel). If you want to have coarse cells spanning
// processors use the globalCellCells instead.
// With explicit topology
//- Return the cell visit order (from ordered back to original cell id),
virtual labelList renumber
(
//! Mesh connectivity
const CompactListList<label>& cellCells
) const = 0;
//- Return the cell visit order (from ordered back to original cell id),
virtual labelList renumber
(
//! Mesh connectivity
const labelListList& cellCells
) const = 0;
// Housekeeping
//- Deprecated - the pointField is unused
// \deprecated(2024-03) the pointField is unused
FOAM_DEPRECATED_FOR(2024-03, "renumber(const polyMesh&)")
virtual labelList renumber
(
const polyMesh& mesh,
const labelList& fineToCoarse,
const pointField& coarsePoints
) const;
// Topology provided explicitly
//- Return the order in which cells need to be visited
//- (ie. from ordered back to original cell label).
// Addressing in losort addressing (= neighbour + offsets into
// neighbour)
virtual labelList renumber
(
const labelList& cellCells,
const labelList& offsets,
const pointField&
) const;
) const
{
return renumber(mesh);
}
//- Return the order in which cells need to be visited
//- (ie. from ordered back to original cell label).
// Uses 'unpack' internally, so should be overloaded when possible
//- Deprecated - the pointField is unused
// \deprecated(2024-03) the pointField is unused
FOAM_DEPRECATED_FOR(2024-03, "renumber(const CompactListList<label>&)")
virtual labelList renumber
(
const CompactListList<label>& cellCells,
const pointField& cellCentres
) const;
const pointField&
) const
{
return renumber(cellCells);
}
//- Return the order in which cells need to be visited
//- (ie. from ordered back to original cell label).
// The connectivity is equal to mesh.cellCells() except
// - the connections are across coupled patches
//- Deprecated - the pointField is unused
// \deprecated(2024-03) the pointField is unused
FOAM_DEPRECATED_FOR(2024-03, "renumber(const labelListList&)")
virtual labelList renumber
(
const labelListList& cellCells,
const pointField& cellCentres
) const = 0;
const pointField&
) const
{
return renumber(cellCells);
}
//- Deprecated - renumbering with agglomeration map.
//- Calculate globalCellCells directly
// \deprecated(2024-03) calculate globalCellCells directly
FOAM_DEPRECATED_FOR(2024-03, "calcCellCells and renumber separately")
virtual labelList renumber
(
const polyMesh& mesh,
const labelUList& fineToCoarse,
const pointField& coarsePoints
) const;
};

View File

@ -159,8 +159,7 @@ Foam::labelList Foam::springRenumber::renumberImpl
Foam::labelList Foam::springRenumber::renumber
(
const polyMesh& mesh,
const pointField&
const polyMesh& mesh
) const
{
// Local mesh connectivity
@ -173,8 +172,7 @@ Foam::labelList Foam::springRenumber::renumber
Foam::labelList Foam::springRenumber::renumber
(
const CompactListList<label>& cellCells,
const pointField&
const CompactListList<label>& cellCells
) const
{
return renumberImpl(cellCells);
@ -183,8 +181,7 @@ Foam::labelList Foam::springRenumber::renumber
Foam::labelList Foam::springRenumber::renumber
(
const labelListList& cellCells,
const pointField&
const labelListList& cellCells
) const
{
return renumberImpl(cellCells);

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2022 OpenCFD Ltd.
Copyright (C) 2022-2024 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -111,40 +111,31 @@ public:
// Member Functions
//- Return the order in which cells need to be visited
//- (ie. from ordered back to original cell label).
// This is only defined for geometric renumberMethods.
virtual labelList renumber(const pointField&) const
{
NotImplemented;
return labelList();
}
// With mesh topology
//- Return the order in which cells need to be visited
//- (ie. from ordered back to original cell label).
// Use the mesh connectivity (if needed)
//- Return the cell visit order (from ordered back to original cell id)
//- using the mesh to determine the connectivity.
virtual labelList renumber
(
const polyMesh& mesh,
const pointField&
//! Mesh connectivity (see globalMeshData::calcCellCells)
const polyMesh& mesh
) const;
//- Return the order in which cells need to be visited
//- (ie. from ordered back to original cell label).
// With explicit topology
//- Return the cell visit order (from ordered back to original cell id)
virtual labelList renumber
(
const CompactListList<label>& cellCells,
const pointField& cellCentres
//! Mesh connectivity
const CompactListList<label>& cellCells
) const;
//- Return the order in which cells need to be visited
//- (ie. from ordered back to original cell label).
// The connectivity is equal to mesh.cellCells() except
// - the connections are across coupled patches
//- Return the cell visit order (from ordered back to original cell id)
virtual labelList renumber
(
const labelListList& cellCells,
const pointField& cellCentres
//! Mesh connectivity
const labelListList& cellCells
) const;
};

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2012-2017 OpenFOAM Foundation
Copyright (C) 2018-2020 OpenCFD Ltd.
Copyright (C) 2018-2024 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -137,18 +137,9 @@ bool Foam::structuredRenumber::layerLess::operator()
Foam::labelList Foam::structuredRenumber::renumber
(
const polyMesh& mesh,
const pointField& points
const polyMesh& mesh
) const
{
if (points.size() != mesh.nCells())
{
FatalErrorInFunction
<< "Number of points " << points.size()
<< " should equal the number of cells " << mesh.nCells()
<< exit(FatalError);
}
const polyBoundaryMesh& pbm = mesh.boundaryMesh();
const labelHashSet patchIDs(pbm.patchSet(patches_));
@ -187,21 +178,20 @@ Foam::labelList Foam::structuredRenumber::renumber
dynamic_cast<const fvMesh&>(mesh),
patchCells
);
const fvMesh& subMesh = subsetter.subMesh();
pointField subPoints(points, subsetter.cellMap());
const labelList& cellMap = subsetter.cellMap();
// Locally renumber the layer of cells
labelList subOrder(method_().renumber(subMesh, subPoints));
labelList subOrder = method_().renumber(subsetter.subMesh());
labelList subOrigToOrdered(invert(subOrder.size(), subOrder));
globalIndex globalSubCells(subOrder.size());
const globalIndex globalSubCells(subOrder.size());
// Transfer to final decomposition and convert into global numbering
forAll(subOrder, i)
{
orderedToOld[subsetter.cellMap()[i]] =
orderedToOld[cellMap[i]] =
globalSubCells.toGlobal(subOrigToOrdered[i]);
}
}
@ -253,11 +243,7 @@ Foam::labelList Foam::structuredRenumber::renumber
// by any visited cell so are used only if the number of nLayers is limited.
labelList oldToOrdered
(
invert
(
mesh.nCells(),
method_().renumber(mesh, points)
)
invert(mesh.nCells(), method_().renumber(mesh))
);
// Use specialised sorting to sorted either layers or columns first

View File

@ -132,46 +132,38 @@ public:
// Member Functions
//- Renumbering method requires a polyMesh
//- Renumbering method requires a polyMesh!
virtual bool needs_mesh() const { return true; }
//- Return the order in which cells need to be visited
//- (ie. from ordered back to original cell label).
// This is only defined for geometric renumberMethods.
virtual labelList renumber(const pointField&) const
{
NotImplemented;
return labelList();
}
// With mesh topology
//- Return the order in which cells need to be visited
//- (ie. from ordered back to original cell label).
// Use the mesh connectivity (if needed)
//- Return the cell visit order (from ordered back to original cell id)
// using the mesh.
virtual labelList renumber
(
const polyMesh& mesh,
const pointField& cc
const polyMesh& mesh
) const;
//- Return the order in which cells need to be visited
//- (ie. from ordered back to original cell label).
// With explicit topology - Not implemented!
//- Return the cell visit order (from ordered back to original cell id).
//- Not implemented!
virtual labelList renumber
(
const CompactListList<label>& cellCells,
const pointField& cellCentres
const CompactListList<label>& cellCells
) const
{
NotImplemented;
return labelList();
}
//- Return the order in which cells need to be visited
//- (ie. from ordered back to original cell label).
//- Return the cell visit order (from ordered back to original cell id).
//- Not implemented!
virtual labelList renumber
(
const labelListList& cellCells,
const pointField& cellCentres
const labelListList& cellCells
) const
{
NotImplemented;

View File

@ -24,10 +24,7 @@ License
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::zoltanRenumber
Description
Notes
Renumber using Zoltan
Zoltan install:
@ -46,9 +43,6 @@ Description
--prefix=$ZOLTAN_ARCH_DIR \
--with-ccflags=-fPIC --with-cxxflags=-fPIC --with-ldflags=-shared
SourceFiles
zoltanRenumber.C
\*---------------------------------------------------------------------------*/
#include "zoltanRenumber.H"
@ -365,8 +359,7 @@ Foam::zoltanRenumber::zoltanRenumber(const dictionary& dict)
Foam::labelList Foam::zoltanRenumber::renumber
(
const polyMesh& pMesh,
const pointField& points
const polyMesh& pMesh
) const
{
// Zoltan_Initialize will trigger MPI_Init() if not already done.

View File

@ -83,46 +83,38 @@ public:
// Member Functions
//- Renumbering method requires a polyMesh
//- Renumbering method requires a polyMesh for its topology
virtual bool needs_mesh() const { return true; }
//- Return the order in which cells need to be visited
//- (ie. from ordered back to original cell label).
// This is only defined for geometric renumberMethods.
virtual labelList renumber(const pointField&) const
{
NotImplemented;
return labelList();
}
// With mesh topology
//- Return the order in which cells need to be visited
//- (ie. from ordered back to original cell label).
// Use the mesh connectivity (if needed)
//- Return the cell visit order (from ordered back to original cell id)
//- uses the mesh for connectivity and global exchanges
virtual labelList renumber
(
const polyMesh& mesh,
const pointField& cc
const polyMesh& mesh
) const;
//- Return the order in which cells need to be visited
//- (ie. from ordered back to original cell label).
// With explicit topology - Not implemented!
//- Return the cell visit order (from ordered back to original cell id).
//- Not implemented!
virtual labelList renumber
(
const CompactListList<label>& cellCells,
const pointField& cellCentres
const CompactListList<label>& cellCells
) const
{
NotImplemented;
return labelList();
}
//- Return the order in which cells need to be visited
//- (ie. from ordered back to original cell label).
//- Return the cell visit order (from ordered back to original cell id).
//- Not implemented!
virtual labelList renumber
(
const labelListList& cellCells,
const pointField& cellCentres
const labelListList& cellCells
) const
{
NotImplemented;