36 #include <boost/config.hpp> 39 #include <boost/graph/adjacency_list.hpp> 40 #include <boost/graph/sloan_ordering.hpp> 41 #include <boost/graph/properties.hpp> 42 #include <boost/graph/bandwidth.hpp> 43 #include <boost/graph/profile.hpp> 44 #include <boost/graph/wavefront.hpp> 48 using namespace boost;
51 typedef adjacency_list
73 typedef graph_traits<Graph>::vertex_descriptor
Vertex;
74 typedef graph_traits<Graph>::vertices_size_type
size_type;
106 dict.optionalSubDict(typeName +
"Coeffs")
107 .getOrDefault(
"reverse", false)
119 using namespace Foam;
122 graph_traits<Graph>::vertex_iterator ui, ui_end;
126 for (boost::tie(ui, ui_end) =
vertices(
G); ui != ui_end; ++ui)
128 deg[*ui] = degree(*ui,
G);
135 std::vector<Vertex> sloan_order(num_vertices(
G));
141 get(vertex_color,
G),
143 get(vertex_priority,
G)
146 labelList orderedToOld(sloan_order.size());
149 orderedToOld[
c] = index_map[sloan_order[
c]];
176 if (
pp.coupled() && !isA<processorPolyPatch>(
pp))
198 && !isA<processorPolyPatch>(
pp)
199 && refCast<const coupledPolyPatch>(
pp).owner()
202 label bFacei =
pp.offset();
204 for (
const label ownCelli :
pp.faceCells())
206 const label nbrCelli = nbr[bFacei];
209 if (ownCelli < nbrCelli)
211 add_edge(ownCelli, nbrCelli,
G);
215 add_edge(nbrCelli, ownCelli,
G);
221 return renumberImpl(
G, reverse_);
234 const auto& neighbours = cellCells[celli];
236 for (
const label nbr : neighbours)
240 add_edge(celli, nbr,
G);
245 return renumberImpl(
G, reverse_);
258 const auto& neighbours = cellCells[celli];
260 for (
const label nbr : neighbours)
264 add_edge(celli, nbr,
G);
269 return renumberImpl(
G, reverse_);
graph_traits< Graph >::vertex_descriptor Vertex
void size(const label n)
Older name for setAddressableSize.
label size() const noexcept
The primary size (the number of rows/sublists)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
virtual const labelList & faceNeighbour() const
Return face neighbour.
const dimensionedScalar G
Newtonian constant of gravitation.
virtual labelList renumber(const polyMesh &mesh) const
Return the cell visit order (from ordered back to original cell id) using the mesh to determine the c...
SloanRenumber(const bool reverse=false)
Default construct, optionally with reverse.
Macros for easy insertion into run-time selection tables.
#define forAll(list, i)
Loop across all elements in list.
pointField vertices(const blockVertexList &bvl)
Abstract base class for renumbering.
A List obtained as a section of another List.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
virtual const labelList & faceOwner() const
Return face owner.
adjacency_list< setS, vecS, undirectedS, property< vertex_color_t, default_color_type, property< vertex_degree_t, Foam::label, property< vertex_priority_t, Foam::scalar > > >> Graph
label nInternalFaces() const noexcept
Number of internal faces.
void reverse(UList< T > &list, const label n)
Reverse the first n elements of the list.
graph_traits< Graph >::vertices_size_type size_type
A packed storage of objects of type <T> using an offset table for access.
label nCells() const noexcept
Number of mesh cells.
const dimensionedScalar c
Speed of light in a vacuum.
Mesh consisting of general polyhedral cells.
A patch is a list of labels that address the faces in the global face list.
label nBoundaryFaces() const noexcept
Number of boundary faces (== nFaces - nInternalFaces)
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())