13 #if !defined(KRATOS_GRAPH_COLORING_PROCESS_H_INCLUDED )
14 #define KRATOS_GRAPH_COLORING_PROCESS_H_INCLUDED
78 mNumberOfPartitions(NumberOfPartitions), mrMaxColor(rMaxColor), mrDomainsGraph(rDomainsGraph), mrDomainsColoredGraph(rDomainsColoredGraph)
111 mrDomainsColoredGraph.
resize(mNumberOfPartitions, 2*mNumberOfPartitions,
false);
112 mrDomainsColoredGraph =
ScalarMatrix(mNumberOfPartitions, 2*mNumberOfPartitions, -1.00);
115 for(
SizeType i = 0 ;
i < mrDomainsGraph.size1() ;
i++)
116 for(
SizeType j =
i + 1 ;
j < mrDomainsGraph.size2() ;
j++)
117 if(mrDomainsGraph(
i,
j) != 0.00)
119 if((mrDomainsColoredGraph(
i,
color) == -1.00) && (mrDomainsColoredGraph(
j,
color) == -1.00))
121 mrDomainsColoredGraph(
i,
color) =
j;
122 mrDomainsColoredGraph(
j,
color) =
i;
123 if(mrMaxColor <
static_cast<int>(
color + 1))
124 mrMaxColor =
color + 1;
136 std::string
Info()
const override
138 return "GraphColoringProcess";
144 rOStream <<
"GraphColoringProcess";
170 int mNumberOfPartitions;
207 rOStream << std::endl;
Getting a graph of connectivities (of domains) and performs a coloring procedure.
Definition: graph_coloring_process.h:43
KRATOS_CLASS_POINTER_DEFINITION(GraphColoringProcess)
Pointer definition of GraphColoringProcess.
void Execute() override
Execute method is used to execute the Process algorithms.
Definition: graph_coloring_process.h:99
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: graph_coloring_process.h:148
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: graph_coloring_process.h:142
std::size_t IndexType
Definition: graph_coloring_process.h:51
std::size_t SizeType
Definition: graph_coloring_process.h:50
virtual ~GraphColoringProcess()
Destructor.
Definition: graph_coloring_process.h:82
DenseMatrix< int > GraphType
Definition: graph_coloring_process.h:55
void operator()()
Definition: graph_coloring_process.h:89
GraphColoringProcess(int NumberOfPartitions, const GraphType &rDomainsGraph, GraphType &rDomainsColoredGraph, int &rMaxColor)
Constructor.
Definition: graph_coloring_process.h:77
std::string Info() const override
Turn back information as a string.
Definition: graph_coloring_process.h:136
Definition: amatrix_interface.h:41
void resize(std::size_t NewSize1, std::size_t NewSize2, bool preserve=0)
Definition: amatrix_interface.h:224
The base class for all processes in Kratos.
Definition: process.h:49
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
scalar_matrix< double > ScalarMatrix
Definition: amatrix_interface.h:728
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
color
Definition: all_t_win_vs_m_fixed_error.py:230
int j
Definition: quadrature.py:648
integer i
Definition: TensorModule.f:17