OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
analyse_mat.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include "hardware.inc"
#include "analyse_name.inc"
#include "analyse.h"

Go to the source code of this file.

Macros

#define _FCALL

Functions

static int compar_mat (const void *mat_1_p, const void *mat_2_p)
static void analyse_mat (int *nbmat, float *tabmat)
void anmat (int *nbmat, float *tabmat)
void anmat_ (int *nbmat, float *tabmat)
void anmat__ (int *nbmat, float *tabmat)
void _FCALL ANMAT (int *nbmat, float *tabmat)

Macro Definition Documentation

◆ _FCALL

#define _FCALL

Definition at line 37 of file analyse_mat.c.

Function Documentation

◆ analyse_mat()

void analyse_mat ( int * nbmat,
float * tabmat )
static

Definition at line 72 of file analyse_mat.c.

73{
74 int i;
75 int cnt=0;
76 int nummat = *nbmat;
77 int nummid = nummat/2;
78
79 float e_rho_mid;
80 float e_rho_min;
81 float e_rho_max;
82 float e_rho_tmp;
83
84 qsort(tabmat,nummat, 3*sizeof(float),compar_mat);
85
86 if (tabmat[nummid*3+2] == 0)
87 e_rho_mid = 0;
88 else
89 e_rho_mid = tabmat[nummid*3+1]/tabmat[nummid*3+2];
90
91 e_rho_min = e_rho_mid/100;
92 e_rho_max = e_rho_mid * 100;
93
94/* el41m21 printf( " %d %e \n", nummid, e_rho_mid); */
95
96 for(i=0; i<nummat; i++)
97 {
98 if (tabmat[i*3+2] == 0)
99 e_rho_tmp = 0;
100 else
101 e_rho_tmp = tabmat[i*3+1]/tabmat[i*3+2];
102
103/* el41m21 printf( "%d %e \n", i, e_rho_tmp); */
104
105 if (e_rho_tmp<=e_rho_min)
106 {
107 analyse_stack_int((int)(tabmat[i*3]));
108 analyse_stack_float(e_rho_tmp);
109 analyse_stack_float(e_rho_mid);
110 analyse_call_error(AN_INFO, 464, ANINFO_BLIND_2);
111 cnt++;
112 }
113 else if (e_rho_tmp>e_rho_max)
114 {
115 analyse_stack_int((int)(tabmat[i*3]));
116 analyse_stack_float(e_rho_tmp);
117 analyse_stack_float(e_rho_mid);
118 analyse_call_error(AN_INFO, 465, ANINFO_BLIND_2);
119 cnt++;
120 }
121 }
122
125
126}
void analyse_stack_float(float r)
Definition analyse.c:294
void analyse_stack_int(int i)
Definition analyse.c:334
void analyse_call_check(int id)
Definition analyse.c:802
void analyse_call_error(int type, int id, int mode)
Definition analyse.c:580
static int compar_mat(const void *mat_1_p, const void *mat_2_p)
Definition analyse_mat.c:48
recursive subroutine qsort(a, idx, first, last)

◆ ANMAT()

void _FCALL ANMAT ( int * nbmat,
float * tabmat )

Definition at line 144 of file analyse_mat.c.

145{
146 analyse_mat(nbmat, tabmat);
147}
static void analyse_mat(int *nbmat, float *tabmat)
Definition analyse_mat.c:72

◆ anmat()

void anmat ( int * nbmat,
float * tabmat )

Definition at line 128 of file analyse_mat.c.

129{
130 analyse_mat(nbmat, tabmat);
131}

◆ anmat_()

void anmat_ ( int * nbmat,
float * tabmat )

Definition at line 133 of file analyse_mat.c.

134{
135 analyse_mat(nbmat, tabmat);
136}

◆ anmat__()

void anmat__ ( int * nbmat,
float * tabmat )

Definition at line 138 of file analyse_mat.c.

139{
140 analyse_mat(nbmat, tabmat);
141}

◆ compar_mat()

int compar_mat ( const void * mat_1_p,
const void * mat_2_p )
static

Definition at line 48 of file analyse_mat.c.

49{
50 float *mat_1;
51 float *mat_2;
52 float test;
53
54 mat_1 = (float *)mat_1_p;
55 mat_2 = (float *)mat_2_p;
56
57 if (*(mat_1+2) == 0) return -1;
58 if (*(mat_2+2) == 0) return 1;
59
60 test = (((*(mat_1+1))/(*(mat_1+2))) - ((*(mat_2+1))/(*(mat_2+2))));
61
62 if (test < 0)
63 return -1;
64 else if (test == 0)
65 return 0;
66 else
67 return 1;
68
69}