KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
List of all members
Kratos::ModelPartGraphUtilities Class Reference

This file computes the graph representing the connectivity of a modelpart. More...

#include <model_part_graph_utilities.h>

Collaboration diagram for Kratos::ModelPartGraphUtilities:

Public Member Functions

Life Cycle
 ModelPartGraphUtilities ()=delete
 no constructor. More...
 
 ModelPartGraphUtilities (ModelPartGraphUtilities const &rOther)=delete
 Copy constructor. More...
 
Operators
ModelPartGraphUtilitiesoperator= (ModelPartGraphUtilities const &rOther)=delete
 Assignment operator. More...
 

Static Public Member Functions

Operations
static Kratos::unique_ptr< SparseContiguousRowGraph<> > ComputeGraph (const ModelPart &rModelPart)
 
static std::pair< DenseVector< IndexType >, DenseVector< IndexType > > ComputeCSRGraph (const ModelPart &rModelPart)
 
static std::pair< IndexType, DenseVector< double > > ComputeConnectedComponents (const ModelPart::NodesContainerType &rNodes, const DenseVector< IndexType > &rRowIndices, const DenseVector< IndexType > &rColIndices)
 
static std::pair< IndexType, DenseVector< double > > ComputeConnectedComponentsWithActiveNodesCheck (const ModelPart::NodesContainerType &rNodes, const DenseVector< IndexType > &rRowIndices, const DenseVector< IndexType > &rColIndices, const std::vector< bool > &active_nodes_list)
 
static std::vector< IndexTypeApplyMinimalScalarFixity (ModelPart::NodesContainerType &rNodes, const Variable< double > &rVar, const DenseVector< double > &colors, const IndexType ncolors)
 

Static Protected Member Functions

Protected Operations
static void BreadthFirstSearch (const int startVertex, const int color, const DenseVector< IndexType > &rRowIndices, const DenseVector< IndexType > &rColIndices, std::unordered_map< IndexType, int > &rVisited)
 
static void BreadthFirstSearchWithActiveNodesCheck (const int startVertex, const int color, const DenseVector< IndexType > &rRowIndices, const DenseVector< IndexType > &rColIndices, std::unordered_map< IndexType, int > &rVisited, const std::unordered_map< IndexType, bool > &rActiveNodes)
 

Type Definitions

typedef unsigned int IndexType
 
 KRATOS_CLASS_POINTER_DEFINITION (ModelPartGraphUtilities)
 Pointer definition of ModelPartGraphUtilities. More...
 

Detailed Description

This file computes the graph representing the connectivity of a modelpart.

Given a modelpart, it returns the csr_representation of its graph.

Member Typedef Documentation

◆ IndexType

Constructor & Destructor Documentation

◆ ModelPartGraphUtilities() [1/2]

Kratos::ModelPartGraphUtilities::ModelPartGraphUtilities ( )
delete

no constructor.

◆ ModelPartGraphUtilities() [2/2]

Kratos::ModelPartGraphUtilities::ModelPartGraphUtilities ( ModelPartGraphUtilities const &  rOther)
delete

Copy constructor.

Member Function Documentation

◆ ApplyMinimalScalarFixity()

std::vector< ModelPartGraphUtilities::IndexType > Kratos::ModelPartGraphUtilities::ApplyMinimalScalarFixity ( ModelPart::NodesContainerType rNodes,
const Variable< double > &  rVar,
const DenseVector< double > &  colors,
const IndexType  ncolors 
)
static

◆ BreadthFirstSearch()

void Kratos::ModelPartGraphUtilities::BreadthFirstSearch ( const int  startVertex,
const int  color,
const DenseVector< IndexType > &  rRowIndices,
const DenseVector< IndexType > &  rColIndices,
std::unordered_map< IndexType, int > &  rVisited 
)
staticprotected

◆ BreadthFirstSearchWithActiveNodesCheck()

void Kratos::ModelPartGraphUtilities::BreadthFirstSearchWithActiveNodesCheck ( const int  startVertex,
const int  color,
const DenseVector< IndexType > &  rRowIndices,
const DenseVector< IndexType > &  rColIndices,
std::unordered_map< IndexType, int > &  rVisited,
const std::unordered_map< IndexType, bool > &  rActiveNodes 
)
staticprotected

◆ ComputeConnectedComponents()

std::pair< ModelPartGraphUtilities::IndexType, DenseVector< double > > Kratos::ModelPartGraphUtilities::ComputeConnectedComponents ( const ModelPart::NodesContainerType rNodes,
const DenseVector< IndexType > &  rRowIndices,
const DenseVector< IndexType > &  rColIndices 
)
static

This function computes the Connected Components for a given graph, expressed in terms of its CSR representation it returns a pair containing the number of columns identified and the "color" associated to each of the nodes the returned "colors" array is such that one can directly employ the function VariableUtils.SetSolutionStepValue(model_part.Nodes(), colors) to set the value on the nodes in the modelpart for which it was

◆ ComputeConnectedComponentsWithActiveNodesCheck()

std::pair< ModelPartGraphUtilities::IndexType, DenseVector< double > > Kratos::ModelPartGraphUtilities::ComputeConnectedComponentsWithActiveNodesCheck ( const ModelPart::NodesContainerType rNodes,
const DenseVector< IndexType > &  rRowIndices,
const DenseVector< IndexType > &  rColIndices,
const std::vector< bool > &  active_nodes_list 
)
static

◆ ComputeCSRGraph()

std::pair< DenseVector< ModelPartGraphUtilities::IndexType >, DenseVector< ModelPartGraphUtilities::IndexType > > Kratos::ModelPartGraphUtilities::ComputeCSRGraph ( const ModelPart rModelPart)
static

The following function computes the connectivity graph (based on node.Id()-1 so that ids start in 0) expressed as CSR arrays for the modelpart used as input.

Parameters
rModelPartmodelpart of which we will compute the graph
Return values
therow and col arrays in CSR form

NOTE: this function is suboptimal if discontinuous or very large ids are employed (the graph will have empty rows from 0 to the id of the largest node)

◆ ComputeGraph()

Kratos::unique_ptr< SparseContiguousRowGraph<> > Kratos::ModelPartGraphUtilities::ComputeGraph ( const ModelPart rModelPart)
static

The following function computes the connectivity graph (based on node.Id()-1 so that ids start in 0) for the mesh used as input.

Parameters
rModelPartmodelpart of which we will compute the graph
Return values
theGraph being computed

NOTE: this function is suboptimal if discontinuous or very large ids are employed (the graph will have empty rows from 0 to the id of the largest node)

◆ KRATOS_CLASS_POINTER_DEFINITION()

Kratos::ModelPartGraphUtilities::KRATOS_CLASS_POINTER_DEFINITION ( ModelPartGraphUtilities  )

Pointer definition of ModelPartGraphUtilities.

◆ operator=()

ModelPartGraphUtilities& Kratos::ModelPartGraphUtilities::operator= ( ModelPartGraphUtilities const &  rOther)
delete

Assignment operator.


The documentation for this class was generated from the following files: