William

I used three scalers. Compilation is sucsseful

I appreciate if yould check the way I am assigning the properties for three diameters (1e-6, 2.8e-6 and 4.5e-6 m)

Also, is there a better way to retrieve HMAG_p

Regards

DEFINE_DPM_SCALAR_UPDATE(magnetic_properties, cell, thread, initialize, p)

{

cphase_state_t *c=&(p->cphase);

float MSAT_Myone,MSAT_M270,MSAT_M450;

float FUNCH2, HMAG_p,CHI_p;

MSAT_Myone=4.965e4;

MSAT_M270=1.705e4;

MSAT_M450=3.1595e4;

HMAG_p=C_UDMI(P_CELL(p),P_CELL_THREAD(p),11);

if((P_DIAM(p)>=0.99e-6) && (P_DIAM(p)<=1.01e-6)){P_magnetic_sat(p)= MSAT_Myone,P_magnetic_chi(p)=1.4; }

if((P_DIAM(p)>2.79e-6) && (P_DIAM(p)<2.81e-6)){P_magnetic_sat(p)= MSAT_M270,P_magnetic_chi(p)=0.17; }

if((P_DIAM(p)>4.49e-6) && (P_DIAM(p)<4.51e-6)){P_magnetic_sat(p) = MSAT_M450,P_magnetic_chi(p)=0.25; }

if (HMAG_p < P_magnetic_sat(p)/P_magnetic_chi(p))

{

P_magnetic_fuch(p) =P_magnetic_chi(p);

}

else

{

P_magnetic_fuch(p)=P_magnetic_sat(p) / HMAG_p;

}

C_UDMI(P_CELL(p),P_CELL_THREAD(p),13)=P_magnetic_fuch(p);

}