37 #include <boost/config.hpp> 40 #include <boost/graph/adjacency_list.hpp> 41 #include <boost/graph/sloan_ordering.hpp> 42 #include <boost/graph/properties.hpp> 43 #include <boost/graph/bandwidth.hpp> 44 #include <boost/graph/profile.hpp> 45 #include <boost/graph/wavefront.hpp> 49 using namespace boost;
52 typedef adjacency_list
74 typedef graph_traits<Graph>::vertex_descriptor
Vertex;
75 typedef graph_traits<Graph>::vertices_size_type
size_type;
97 dict.optionalSubDict(typeName +
"Coeffs")
98 .getOrDefault(
"reverse", false)
110 using namespace Foam;
113 graph_traits<Graph>::vertex_iterator ui, ui_end;
117 for (boost::tie(ui, ui_end) =
vertices(
G); ui != ui_end; ++ui)
119 deg[*ui] = degree(*ui,
G);
126 std::vector<Vertex> sloan_order(num_vertices(
G));
132 get(vertex_color,
G),
134 get(vertex_priority,
G)
137 labelList orderedToOld(sloan_order.size());
140 orderedToOld[
c] = index_map[sloan_order[
c]];
168 if (
pp.coupled() && !isA<processorPolyPatch>(
pp))
190 && !isA<processorPolyPatch>(
pp)
191 && refCast<const coupledPolyPatch>(
pp).owner()
194 label bFacei =
pp.offset();
196 for (
const label ownCelli :
pp.faceCells())
198 const label nbrCelli = nbr[bFacei];
201 if (ownCelli < nbrCelli)
203 add_edge(ownCelli, nbrCelli,
G);
207 add_edge(nbrCelli, ownCelli,
G);
213 return renumberImpl(
G, reverse_);
227 const auto& neighbours = cellCells[celli];
229 for (
const label nbr : neighbours)
233 add_edge(celli, nbr,
G);
238 return renumberImpl(
G, reverse_);
252 const auto& neighbours = cellCells[celli];
254 for (
const label nbr : neighbours)
258 add_edge(celli, nbr,
G);
263 return renumberImpl(
G, reverse_);
graph_traits< Graph >::vertex_descriptor Vertex
void size(const label n)
Older name for setAddressableSize.
virtual labelList renumber(const pointField &) const
Return the order in which cells need to be visited (ie. from ordered back to original cell label)...
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.
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
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 unstructured matrix 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())