OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
c_domain_decomposition.cpp
Go to the documentation of this file.
1//Copyright> OpenRadioss
2//Copyright> Copyright (C) 1986-2025 Altair Engineering Inc.
3//Copyright>
4//Copyright> This program is free software: you can redistribute it and/or modify
5//Copyright> it under the terms of the GNU Affero General Public License as published by
6//Copyright> the Free Software Foundation, either version 3 of the License, or
7//Copyright> (at your option) any later version.
8//Copyright>
9//Copyright> This program is distributed in the hope that it will be useful,
10//Copyright> but WITHOUT ANY WARRANTY; without even the implied warranty of
11//Copyright> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12//Copyright> GNU Affero General Public License for more details.
13//Copyright>
14//Copyright> You should have received a copy of the GNU Affero General Public License
15//Copyright> along with this program. If not, see <https://www.gnu.org/licenses/>.
16//Copyright>
17//Copyright>
18//Copyright> Commercial Alternative: Altair Radioss Software
19//Copyright>
20//Copyright> As an alternative to this open-source version, Altair also offers Altair Radioss
21//Copyright> software under a commercial license. Contact Altair to discuss further if the
22//Copyright> commercial version may interest you: https://www.altair.com/radioss/.
23#include <iostream>
24#include <vector>
25#include <map>
26
27#define _FCALL
28
29
30// global vector of hash table
31std::vector<std::vector<int>> clusters;
32
33extern "C" {
34 void c_prevent_decomposition_(int * clusterSize, int * elements )
35 {
36 const int cs = (*clusterSize);
37 clusters.emplace_back(elements, elements+cs);
38 }
39
40 void c_enforce_constraints_(int * cep)
41 {
42 for(const auto & c : clusters)
43 {
44 const int domain = cep[c[0]-1];
45 for(const auto & v : c)
46 {
47 cep[v-1] = domain;
48 }
49 }
50 clusters.clear();
51 }
52
53
54 // Fortran 2 C porting
55 void _FCALL C_PREVENT_DECOMPOSITION(int * clusterSize, int * elements)
56 {
57 c_prevent_decomposition_(clusterSize,elements);
58 }
59 void c_prvent_decomposition__(int * clusterSize, int * elements)
60 {
61 c_prevent_decomposition_(clusterSize,elements);
62 }
63 void c_prevent_decomposition(int * clusterSize,int * elements)
64 {
65 c_prevent_decomposition_(clusterSize,elements);
66 }
67
69 {
71 }
73 {
75 }
76 void c_enforce_constraints(int * cep)
77 {
79 }
80
81}
void c_prevent_decomposition(int *clusterSize, int *elements)
std::vector< std::vector< int > > clusters
void c_enforce_constraints__(int *cep)
void c_enforce_constraints(int *cep)
void c_enforce_constraints_(int *cep)
void _FCALL C_PREVENT_DECOMPOSITION(int *clusterSize, int *elements)
void c_prevent_decomposition_(int *clusterSize, int *elements)
void c_prvent_decomposition__(int *clusterSize, int *elements)
void _FCALL C_ENFORCE_CONSTRAINTS(int *cep)
#define _FCALL