OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
progcond_c.c
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 "hardware.inc"
24#include "c_header.inc"
25
26/*Cvf51e6 Nouvelle routine*/
27/*Routine pour afficher la progression de la condensation sur la sortie standard */
28#include <stdio.h>
29
30void progcond_c(int *icur, int *imax, int *iproc, int *ilvl, int *id, int *istep)
31{
32 char outline[80];
33 double percent ;
34
35 percent=(double)(*icur) / *imax * 100 ;
36 if (*istep == 0) {sprintf(outline,"%s%4d%s%4d%s%4d%s%5.1f%s"," SUBGRAPH: ",*iproc," LEVEL: ",*ilvl," SUP-ELEM: ",*id," - ",percent,"% ") ;}
37 else if (*istep == 1) {sprintf(outline,"%s%4d%s%4d%s%4d%s%5.1f%s"," SUBGRAPH: ",*iproc," LEVEL: ",*ilvl," SUP-ELEM: ",*id," - ",percent,"% - EXTRACTION ") ;}
38 else if (*istep == 2) {sprintf(outline,"%s%4d%s%4d%s%4d%s%5.1f%s"," SUBGRAPH: ",*iproc," LEVEL: ",*ilvl," SUP-ELEM: ",*id," - ",percent,"% - RESOLUTION ") ;}
39 else if (*istep == 3) {sprintf(outline,"%s%4d%s%4d%s%4d%s%5.1f%s"," SUBGRAPH: ",*iproc," LEVEL: ",*ilvl," SUP-ELEM: ",*id," - ",percent,"% - CONDENSATION") ;}
40 fprintf(stdout,"\r%s",outline) ;
41 if (*icur == *imax && (*istep == 0 || *istep == 3)) {fprintf(stdout,"\r%s%4d%s\n"," SUBGRAPH: ",*iproc," - COMPLETE ") ;}
42 fflush(stdout) ;
43}
44
45void _FCALL PROGCOND_C(int *icur, int *imax, int *iproc, int *ilvl, int *id, int *istep)
46{
47 progcond_c(icur, imax, iproc, ilvl, id, istep) ;
48}
49void progcond_c_(int *icur, int *imax, int *iproc, int *ilvl, int *id, int *istep)
50{
51 progcond_c(icur, imax, iproc, ilvl, id, istep) ;
52}
53void progcond_c__(int *icur, int *imax, int *iproc, int *ilvl, int *id, int *istep)
54{
55 progcond_c(icur, imax, iproc, ilvl, id, istep) ;
56}
57
58/*Cvf51e6 Nouvelle routine*/
59/*Routine pour afficher la progression de la condensation sur la sortie standard en SPMD*/
60
61void progcondp_c(int *icur, int *imax, int *iproc, int *id)
62{
63 char outline[11];
64 double percent ;
65 char ctab[80] ;
66 int i,j ;
67
68 percent=(double)(*icur) / *imax * 100 ;
69 ctab[0]='\r' ;
70 for (i=1;i<(*iproc);i++) {j=2*(i-1)+1 ;
71 ctab[j]='\t' ;
72 j=2*i ;
73 ctab[j]='\t';}
74 j=2 * (*iproc - 1) + 1 ;
75 ctab[j]='%' ;
76 j+=1 ;
77 ctab[j]='s' ;
78 j+=1 ;
79 ctab[j]='\0' ;
80 sprintf(outline,"%s%2d%s%3.0f%s","P ",*iproc," ",percent,"% ") ;
81 fprintf(stdout,ctab,outline) ;
82 fflush(stdout) ;
83}
84
85void _FCALL PROGCONDP_C(int *icur, int *imax, int *iproc, int *id)
86{
87 progcondp_c(icur, imax, iproc, id) ;
88}
89void progcondp_c_(int *icur, int *imax, int *iproc, int *id)
90{
91 progcondp_c(icur, imax, iproc, id) ;
92}
93void progcondp_c__(int *icur, int *imax, int *iproc, int *id)
94{
95 progcondp_c(icur, imax, iproc, id) ;
96}
#define _FCALL
void progcondp_c__(int *icur, int *imax, int *iproc, int *id)
Definition progcond_c.c:93
void progcondp_c_(int *icur, int *imax, int *iproc, int *id)
Definition progcond_c.c:89
void progcond_c__(int *icur, int *imax, int *iproc, int *ilvl, int *id, int *istep)
Definition progcond_c.c:53
void progcond_c(int *icur, int *imax, int *iproc, int *ilvl, int *id, int *istep)
Definition progcond_c.c:30
void progcondp_c(int *icur, int *imax, int *iproc, int *id)
Definition progcond_c.c:61
void _FCALL PROGCONDP_C(int *icur, int *imax, int *iproc, int *id)
Definition progcond_c.c:85
void _FCALL PROGCOND_C(int *icur, int *imax, int *iproc, int *ilvl, int *id, int *istep)
Definition progcond_c.c:45
void progcond_c_(int *icur, int *imax, int *iproc, int *ilvl, int *id, int *istep)
Definition progcond_c.c:49