Hello,
I'm trying to use a python function "impact_UDL" in my command file where one of the parameter is Y. I can't write a command file with the command FORMULE that work and I don't know why. I try to use the formula as a load case in MECA_STATIQUE :
Definition de la fonction python de chargement UDL
def impact_UDL(Y, Y_voie_1, largeur_voie, alphaq1_q1k, alphaqi_qik):
On teste si Y est dans la voie 1
if ((Y < Y_voie_1) and (Y > (Y_voie_1-largeur_voie))):
return (-alphaq1_q1k)
elif (Y < 0):
return (-alphaqi_qik)
else:
return 0.
Definition d'une formule correspondant au chargement UDL
sigmaUDL = FORMULE(
NOM_PARA=('Y'),
VALE='impact_UDL(Y, Y_voie_1, largeur_voie, alphaq1_q1k, alphaqi_qik)',
impact_UDL=impact_UDL
)
Definition du chargement UDL
imp_UDL = AFFE_CHAR_MECA_F(FORCE_COQUE=_F(FZ=sigmaUDL,
GROUP_MA=('surf_roulement', )),
MODELE=model)
I currently use version v2023 of Salome_Meca. Besides, I am not sure but I think that the code worked with a previous version of Salome_meca (v2018 I think).
I tried to follow the documentation "Opérateur FORMULE" (U4.31.05) but that doesn't work (I tried to add impact_UDL=impact_UDL at the end of my FORMULE command (where impact_UDL is my python function), but that doesn't work neither...). With a simplier load (self weight), the calculation works.
Does someone can help me ? You'll find attached my command file. My mesh file is just a rectangular horizontal surface.
Regards,
Bertrand Cauvin