* TOPOADJO PROCEDUR FD218221 25/12/18 21:15:02 12429 ************************************************************************ ** Procedure called by TOPOCONT to compute the total derivative of the ** total constraint (G) with respect to the design variables, using the ** partial derivatives with respect to the physical densities and the ** adjoint method. ** ** If the loading is physical density dependent, its volume-normalized ** sensitivity with respect to the design variables should also be ** provided on the design zone (D). ** ** Author: ** Guenhael Le Quilliec (LaMe - Polytech Tours) ** ** Version: ** 1.0 2025/11/21 Initial version ************************************************************************ DEBP TOPOADJO tab*'TABLE' dGdYD*'MCHAML' dGdUI*'CHPOINT' ; * Input data * ********** Wtab = tab.'WTABLE' ; *Ltab = Wtab.'LOGIQUE' ; VD = Wtab.'VOLUME_D' ; mshI = Wtab.'MAILLAGE_I' ; modMD = Wtab.'MECANIQUE'.'MODELE_D' ; modMA = Wtab.'MECANIQUE'.'MODELE_A' ; modMI = Wtab.'MECANIQUE'.'MODELE_I' ; ZmatMA = Wtab.'MECANIQUE'.'CARACTERISTIQUES_Z_A' ; bdcMB = Wtab.'MECANIQUE'.'BLOCAGES' ; resB = Wtab.'RESOLUTION_B' ; * Initialization * ************** * Derivative of the material characteristics with respect to Y dZmatMI = TOPOMATE modMI Wtab.'MECANIQUE'.'CARACTERISTIQUES_I' Wtab.'MECANIQUE'.'SENSIBILITE_Z_I' tab.'COMPOSANTES' ; * Logical for physical density dependent loading * If loading is physical density dependent SI LdFdY ; FINS ; * Vector of adjoint variables λ on I * ********************************** * λ = - K_Z⁻¹ * ∂G/∂U * Remark1: -λ is calculated on mshA, then restricted to I * Remark2: minus sign is compensated later SI (EGA tab.'SEUIL_ELEMENTS_ACTIFS' 0.0) ; * Penalized rigidity matrix K on A OUBL ZKA ; SINO ; * TODO à rendre compatible en cas de zone active non connexe. * En attendant on fait la résolution sur B * Appliquer un seuil sur l'aggrégation des contraintes locales? (c.f. Verbart Fig.14) tmp1 = Wtab.'MECANIQUE'.'MODELE_B' ; tmp2 = Wtab.'MECANIQUE'.'CARACTERISTIQUES_B' ; OUBL ZKB ; FINS ; * Rename components and switch to mass integration points * Sensitivities of the constraints term C with respect to physical densities Y on I * ********************************************************************************* * As the constraints are KU - F = 0, the constraints term is C = λᵀ * (KU - F). * Their sensitivities are ∂C/∂Y = λᵀ * (∂K/∂Y U - ∂F/∂Y) * ∂K/∂Y on I * ∂K/∂Y * U on I **tmp = dKdYI * UI ; * TODO version approchée en attendant d'avoir une version Fortran ? * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -λ * ∂K/∂Y * U on I SI FAUX ; FIN itr ; SINO ; * Création de maillages d'éléments dissociés à partir d'un maillage * initial dont tous les éléments reposent sur une grille régulière MESS 'Pareparation du maillage temporaire pour TOPOADJO...' ; crt = tab.'ELIM_CRITERE' ; msh = Wtab.'MAILLAGE_B' ; s1 = maxel1 - minel1 ; s2 = maxel2 - minel2 ; s3 = maxel3 - minel3 ; nb2 = ENTI 'PROC' ((max2 - min2) / s2) ; nb3 = ENTI 'PROC' ((max3 - min3) / s3) ; raw0 = el1 ; REPE itr (nb1 - 1) ; FIN itr ; ELIM raw0 crt ; raw1 = el1 ; REPE itr ((nb1 - 1) / 2) ; FIN itr ; ELIM raw0 raw1 crt ; layer1 = raw1 ; layer2 = raw2 ; REPE itr ((nb2 - 1) / 2) ; FIN itr ; layer3 = raw3 ; layer4 = raw4 ; REPE itr ((nb2 - 2) / 2) ; FIN itr ; msh1 = layer1 ; msh2 = layer2 ; msh3 = layer3 ; msh4 = layer4 ; REPE itr ((nb3 - 1) / 2) ; FIN itr ; msh5 = layer5 ; msh6 = layer6 ; msh7 = layer7 ; msh8 = layer8 ; REPE itr ((nb3 - 2) / 2) ; FIN itr ; msh1to8 = msh1 ET msh2 ET msh3 ET msh4 ET msh5 ET msh6 ET msh7 et msh8 ; ELIM msh msh1to8 crt ; mshD = Wtab.'MAILLAGE_D' ; MESS 'Maillage temporaire genere pour TOPOADJO.' ; SINO ; * cnt = cnt COUL 'ROUG' ; s1 = maxel1 - minel1 ; s2 = maxel2 - minel2 ; nb2 = ENTI 'PROC' ((max2 - min2) / s2) ; raw0 = el1 ; REPE itr (nb1 - 1) ; FIN itr ; ELIM raw0 crt ; raw1 = el1 ; REPE itr ((nb1 - 1) / 2) ; FIN itr ; ELIM raw0 raw1 crt ; msh1 = raw1 ; msh2 = raw2 ; REPE itr ((nb2 - 1) / 2) ; FIN itr ; msh3 = raw3 ; REPE itr ((nb2 - 2) / 2) ; FIN itr ; msh1234 = msh1 ET msh2 ET msh3 ; ELIM msh msh1234 crt ; msh1234 = msh1234 ET msh4 ; mshD = Wtab.'MAILLAGE_D' ; FINS ; Wtab.'TOPOADJO_TEMPORAIRE' = mshtab ; * REPE itr 4 ; * TRAC (mshtab.(&itr) ET cnt) ; * FIN itr ; ' Pour le moment, seuls les maillages reguliers sont' ' compatibles avec une contrainte limite de von Mises.') ; FINS ; FINS ; mshtab = Wtab.'TOPOADJO_TEMPORAIRE' ; matMI = Wtab.'MECANIQUE'.'CARACTERISTIQUES_I' ; nbr = 4 ; nbr = 8 ; FINS ; REPE itr nbr ; * Je ne peux pas faire la résultante par élément, à la place * j'intègre, je divise par le volume puis je multiplie par le Nb de * noeuds. Ça diffère en axi car le volume que "représente" chaque noeud * est différent mais cette différence s'estompe loin de l'axe Z * et si les éléments sont radialement étroits. * Ça va aussi différer si les éléments sont quadratiques. * Bref c'est une rustine temporaire et qui aide à avoir des performances * raisonables. SI (EGA &itr 1) ; tmp = tmp4 ; SINO ; tmp = tmp Et tmp4 ; FINS ; FIN itr ; FINS ; *TRAC tmp modMI ; * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * dC/dY on I * Remark: minus sign on λ is compensated here SI LdFdY ; * If the loading is physical density dependent * ∂C/∂Y = λᵀ * (∂K/∂Y * U - ∂F/∂Y) SINO ; * Otherwise * ∂C/∂Y = λᵀ * (∂K/∂Y * U) dCdYI = -1.0 * tmp ; FINS ; * Total derivative of G with respect to physical densities Y on D * *************************************************************** * Total derivative dG/dY * Volume-normalization * ******************** NtotdGdYD = totdGdYD / VD ; FINP NtotdGdYD ;
© Cast3M 2003 - Tous droits réservés.
Mentions légales