Class SPDS

Inheritance Relationships

Derived Types

Class Documentation

class SPDS

Subclassed by opensn::AAH_SPDS, opensn::CBC_SPDS

Public Functions

inline SPDS(const Vector3 &omega, const std::shared_ptr<MeshContinuum> &grid)

Constructs an sweep-plane data strcture (SPDS) with the given direction and grid.

Parameters:
  • omega – The angular direction vector.

  • grid – Reference to the grid.

inline std::shared_ptr<MeshContinuum> GetGrid() const

Return a reference to the MeshContinuum object.

inline const Vector3 &GetOmega() const

Return a reference to the direction vector.

inline const std::vector<int> &GetLocalSubgrid() const

Return a reference to the Sweep-Plane Local Subgrid (SPLS) associated with this SPDS. A SPLS (“spills”) is a contiguous collection of cells that is the lowest level in the SPDS hierarchy. The intent is that the locations responsible for executing sweeps on this collection of cells can readily read to and write from a common data structure. A SPLS contains one or more entire cellsets — it cannot split a cellset.

inline const std::vector<std::vector<int>> &GetLevelizedLocalSubgrid() const

Return a reference to the levelized SPLS.

inline const std::vector<int> &GetLocationDependencies() const

Returns the location dependencies for this SPDS.

inline const std::vector<int> &GetLocationSuccessors() const

Returns the location successors for this SPDS.

inline const std::vector<int> &GetDelayedLocationDependencies() const

Returns the delayed location dependencies for this SPDS.

inline const std::vector<int> &GetDelayedLocationSuccessors() const

Returns the delayed location successors for this SPDS.

inline const std::vector<std::pair<int, int>> &GetLocalSweepFAS() const

Returns the feedback arc set (FAS) for the local cell sweep graph.

inline const std::vector<std::vector<FaceOrientation>> &GetCellFaceOrientations() const

Return the cell face orientations for this SPDS.

std::vector<std::pair<size_t, size_t>> RemoveCyclicDependencies(Graph &g)

Removes cyclic dependencies from the given graph.

Parameters:

g – The graph from which cyclic dependencies are to be removed.

Returns:

FAS as a vector of graph edges.

int MapLocJToPrelocI(int locJ) const

Maps location J to a predecessor location.

int MapLocJToDeplocI(int locJ) const

Maps location J to a dependent location.

void PrintGhostedGraph() const
virtual ~SPDS() = default

Protected Functions

void PopulateCellRelationships(const Vector3 &omega, std::set<int> &location_dependencies, std::set<int> &location_successors, std::vector<std::set<std::pair<int, double>>> &cell_successors)

Populates cell relationships and face orientations.

Parameters:
  • omega – The angular direction vector.

  • location_dependencies – Location dependencies.

  • location_successors – Location successors.

  • cell_successorsCell successors.

std::vector<std::vector<Vertex>> FindSCCs(Graph &g)

Find bi-, tri-, and n-connected strongly connected components (SCCs) in the given graph.

void SCCAlgorithm(Vertex u, Graph &g, int &time, std::vector<int> &disc, std::vector<int> &low, std::vector<bool> &on_stack, std::stack<Vertex> &stack, std::vector<std::vector<Vertex>> &SCCs)

Tarjan’s algorithm for finding SCCs in a graph.

Parameters:
  • u – The current vertex being processed.

  • g – The graph being analyzed.

  • time – Global timer for discovery times.

  • discVector of discovery times for each vertex.

  • lowVector of low values for each vertex.

  • on_stackVector tracking whether each vertex is in the stack.

  • stackVertex stack.

  • SCCs – Output vector to store the resulting SCCs.

std::vector<std::pair<int, int>> FindApproxMinimumFAS(Graph &g, std::vector<Vertex> &scc_vertices)

Finds an approximate minimum feedback arc set (FAS) to break cycles in the graph.

Parameters:
  • g – The graph being analyzed.

  • scc_vertices – Vertices within the current strongly connected component.

Returns:

Vector of pairs representing edges to remove to break cycles.

Protected Attributes

Vector3 omega_

Angular direction vector.

const std::shared_ptr<MeshContinuum> grid_

Reference to the grid.

std::vector<int> spls_

Sweep-plane local subgrid associated with this SPDS.

std::vector<std::vector<int>> levelized_spls_

Levelized sweep-plane local subgrid associated with this SPDS.

std::vector<int> location_dependencies_

Location dependencies.

std::vector<int> location_successors_

Location successors.

std::vector<int> delayed_location_dependencies_

Delayed location dependencies.

std::vector<int> delayed_location_successors_

Delayed location successors.

std::vector<std::pair<int, int>> local_sweep_fas_

Vector of edges representing the FAS used to break cycles in the local cell sweep graph.

std::vector<std::vector<FaceOrientation>> cell_face_orientations_

Cell face orientations for the cells in the local cell graph.