OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
c_domain_decomposition_rbody.cpp File Reference
#include <iostream>
#include <vector>
#include <map>

Go to the source code of this file.

Macros

#define _FCALL

Functions

void c_prevent_decomposition_rbody_ (int *rbodysize, int *elements)
void c_enforce_constraints_rbody_ (int *cep, int *nspmd, int *nrby)
void _FCALL C_PREVENT_DECOMPOSITION_RBODY (int *rbodysize, int *elements)
void c_prvent_decomposition_rbody__ (int *rbodysize, int *elements)
void c_prevent_decomposition_rbody (int *rbodysize, int *elements)
void _FCALL C_ENFORCE_CONSTRAINTS_RBODY (int *cep, int *nspmd, int *nrby)
void c_enforce_constraints_rbody__ (int *cep, int *nspmd, int *nrby)
void c_enforce_constraints_rbody (int *cep, int *nspmd, int *nrby)

Variables

std::vector< std::vector< int > > rbody

Macro Definition Documentation

◆ _FCALL

#define _FCALL

Definition at line 27 of file c_domain_decomposition_rbody.cpp.

Function Documentation

◆ C_ENFORCE_CONSTRAINTS_RBODY()

void _FCALL C_ENFORCE_CONSTRAINTS_RBODY ( int * cep,
int * nspmd,
int * nrby )

Definition at line 132 of file c_domain_decomposition_rbody.cpp.

133 {
135 }
void c_enforce_constraints_rbody_(int *cep, int *nspmd, int *nrby)
static int nspmd
Definition rad2rad_c.c:126

◆ c_enforce_constraints_rbody()

void c_enforce_constraints_rbody ( int * cep,
int * nspmd,
int * nrby )

Definition at line 140 of file c_domain_decomposition_rbody.cpp.

141 {
143 }

◆ c_enforce_constraints_rbody_()

void c_enforce_constraints_rbody_ ( int * cep,
int * nspmd,
int * nrby )

Definition at line 57 of file c_domain_decomposition_rbody.cpp.

58 {
59
60
61 int const number_proc = *nspmd ;
62
63 std::vector<int> compteur(*nspmd,0);
64 std::vector<int> compteur_2(*nspmd,0);
65
66 for(const auto & c : rbody)
67 {
68
69 for(int i=0 ; i<number_proc ; i++)
70 {
71 compteur_2[i] = 0 ;
72 }
73
74 for(const auto & v : c)
75 {
76 compteur_2[ cep[v-1]-1 ] += 1 ;
77 }
78
79 int id_proc, number_element,number_rby ;
80 id_proc = -1 ;
81 number_element= -1 ;
82 number_rby= *nrby + 1 ;
83// ----------------------------------------------------
84// stick all the elements of the rigid body on the processor P
85// with the lowest total number of element
86
87/* for(int i=0 ; i<number_proc ; i++){
88 if(number_element<compteur_2[i]){
89 id_proc = i+1 ;
90 number_element=compteur_2[i] ;
91 }
92 }
93// ----------------------------------------------------
94*/
95// ----------------------------------------------------
96// stick all the elements of the rigid body on the processor P
97// with the lowest total number of rigid body
98 // find id_proc : the processor ID with the lowest number of /RBODY
99 for(int i=0 ; i<number_proc ; i++){
100 if(compteur_2[i]>0 && compteur[i]<number_rby){
101 id_proc = i+1 ;
102 number_rby = compteur[i] ;
103 }
104 }
105 // stick the element v-1 to id_proc
106 int domain = id_proc;
107 compteur[domain-1] = compteur[domain-1] + 1 ;
108 for(const auto & v : c)
109 {
110 cep[v-1] = domain;
111 }
112// ----------------------------------------------------
113 }
114 rbody.clear();
115 }
std::vector< std::vector< int > > rbody

◆ c_enforce_constraints_rbody__()

void c_enforce_constraints_rbody__ ( int * cep,
int * nspmd,
int * nrby )

Definition at line 136 of file c_domain_decomposition_rbody.cpp.

137 {
139 }

◆ C_PREVENT_DECOMPOSITION_RBODY()

void _FCALL C_PREVENT_DECOMPOSITION_RBODY ( int * rbodysize,
int * elements )

Definition at line 119 of file c_domain_decomposition_rbody.cpp.

120 {
121 c_prevent_decomposition_rbody_(rbodysize,elements);
122 }
void c_prevent_decomposition_rbody_(int *rbodysize, int *elements)

◆ c_prevent_decomposition_rbody()

void c_prevent_decomposition_rbody ( int * rbodysize,
int * elements )

Definition at line 127 of file c_domain_decomposition_rbody.cpp.

128 {
129 c_prevent_decomposition_rbody_(rbodysize,elements);
130 }

◆ c_prevent_decomposition_rbody_()

void c_prevent_decomposition_rbody_ ( int * rbodysize,
int * elements )

Definition at line 40 of file c_domain_decomposition_rbody.cpp.

41 {
42 const int cs = (*rbodysize);
43 rbody.emplace_back(elements, elements+cs);
44 }

◆ c_prvent_decomposition_rbody__()

void c_prvent_decomposition_rbody__ ( int * rbodysize,
int * elements )

Definition at line 123 of file c_domain_decomposition_rbody.cpp.

124 {
125 c_prevent_decomposition_rbody_(rbodysize,elements);
126 }

Variable Documentation

◆ rbody

std::vector<std::vector<int> > rbody

Definition at line 31 of file c_domain_decomposition_rbody.cpp.