* TOPOSENS PROCEDUR FD218221 24/01/24 21:15:01 11828 * TOPOSENS PROCEDUR CB215821 21/04/15 14:10:01 9715 ************************************************************************ ** Procedure called by TOPOPTIM for calculating the sensitivity field ** and the objective value. ** ** Author: ** Guenhael Le Quilliec (LaMe - Polytech Tours) ** ** Version: ** 1.0 2021/04/15 ************************************************************************ DEBP TOPOSENS tab0*'TABLE' ; * Input data * ********** vdM0 = tab0.'RAPPORT_RAIDEURS_MECANIQUES' ; vdT0 = tab0.'RAPPORT_RAIDEURS_THERMIQUES' ; WghtMcn0 = tab0.'POIDS_MECANISME' ; WghtM0 = tab0.'POIDS_ENERGIE_DEFO' ; WghtT0 = tab0.'POIDS_TEMPERATURE' ; wtab0 = tab0.'WTABLE' ; bool0 = wtab0.'BOOL' ; p0 = wtab0.'FACTEUR_P' ; bmsh1 = wtab0.'MAILLAGE'.'GRAVITE' ; mdlA = wtab0.'RESOLUTION'.'A' ; SI bool0.'CAS_MULTIPLES' ; case_nb0 = wtab0.'NB_CAS' ; FINS ; NbStp0 = wtab0.'NB_PAS' ; FINS ; SI bool0.'MECANIQUE' ; volElM1 = wtab0.'MECANIQUE'.'VOLUME'.(1) ; modM1 = wtab0.'MECANIQUE'.'MODELE'.(1) ; FINS ; SI bool0.'THERMIQUE' ; volElT1 = wtab0.'THERMIQUE'.'VOLUME'.(1) ; modT1 = wtab0.'THERMIQUE'.'MODELE'.(1) ; FINS ; x0 = wtab0.'TOPOLOGIE' ; obj0 = wtab0.'OBJECTIF' ; dc0 = wtab0.'SENSIBILITE' ; * Active mesh, model, material and resolution belonging to msh1 * ************************************************************* SI bool0.'MECANIQUE' ; FINS ; SI bool0.'THERMIQUE' ; FINS ; * Mechanism objective value and the sensitivity field * *************************************************** SI bool0.'MECANISME' ; SI bool0.'CAS_MULTIPLES' ; REPE loop0 case_nb0 ; * epsAS = ELAS modMA sigAS matMA ; SINO ; * sigAE = REDU (mdlA.&loop0.'MECANISME_ENTREE'.'CONTRAINTES') mshA ; * epsAS = REDU (mdlA.&loop0.'MECANISME_SORTIE'.'DEFORMATIONS') mshA ; FINS ; * 1/2.Cijkl.[1/2(diUEj+djUEi)].[1/2(dkUSl+dlUSk)] * =1/2.Cijkl.EPSEij.EPSSkl * =1/2.EPSEij.SIGSij * Element field of the strain energy density at barycenter * Total strain energy * Objective function: obj0 = obj0 + (WghtMcn0 * tmp0 / case_nb0) ; * Rigidity property field at barycenter * 1/2.EPSEij.EPSSij * Sensitivity field: dc0 = dc0 + ((WghtMcn0 / case_nb0) * tmp0 * ((1.0 - vdM0) * p0 * (x0**(p0 - 1.0)))) ; * Objective function: *TODO obj0 = obj0 + (0.0 / case_nb0) ; FIN loop0 ; SINO ; * epsAS = ELAS modMA sigAS matMA ; SINO ; * sigAE = REDU (mdlA.'MECANISME_ENTREE'.'CONTRAINTES') mshA ; * epsAS = REDU (mdlA.'MECANISME_SORTIE'.'DEFORMATIONS') mshA ; FINS ; * 1/2.Cijkl.[1/2(diUEj+djUEi)].[1/2(dkUSl+dlUSk)] * =1/2.Cijkl.EPSEij.EPSSkl * =1/2.EPSEij.SIGSij * Element field of the strain energy density at barycenter * Total strain energy * Objective function: obj0 = obj0 + (WghtMcn0 * tmp0) ; * Rigidity property field at barycenter * 1/2.EPSEij.EPSSij * Sensitivity field: dc0 = dc0 + (WghtMcn0 * tmp0 * ((1.0 - vdM0) * p0 * (x0**(p0 - 1.0)))) ; FINS ; FINS ; * Strain energy objective value and the sensitivity field * ******************************************************* *SI (bool0.'MECANIQUE' ET ((ABS WghtM0) > tab0.'PRECISION')) ; SI (bool0.'MECANIQUE' ET (NEG WghtM0 0.0)) ; SI bool0.'CAS_MULTIPLES' ; REPE loop0 case_nb0 ; SINO ; FINS ; * 1/2.Cijkl.[1/2(diUj+djUi)].[1/2(dkUl+dlUk)] * =1/2.Cijkl.EPSij.EPSkl * =1/2.EPSij.SIGij * =Element field of the elastic strain energy density at * integration points: * Element field of the strain energy density at barycenter * Objective function: * Add the total elastic strain energy * weight / nb of cases * Rigidity property field at barycenter * 1/2.EPSij.EPSij * Sensitivity field: dc0 = dc0 + ((WghtM0 / case_nb0) * tmp0 * ((vdM0 - 1.0) * p0 * (x0**(p0 - 1.0)))) ; FIN loop0 ; SINO ; SINO ; FINS ; * 1/2.Cijkl.[1/2(diUj+djUi)].[1/2(dkUl+dlUk)] * =1/2.Cijkl.EPSij.EPSkl * =1/2.EPSij.SIGij * =Element field of the elastic strain energy density at * integration points: * Element field of the strain energy density at barycenter * Total strain energy * Objective function obj0 = obj0 + (WghtM0 * tmp0) ; * Rigidity property field at barycenter * 1/2.EPSij.EPSij * Sensitivity field dc0 = dc0 + (WghtM0 * tmp0 * ((vdM0 - 1.0) * p0 * (x0**(p0 - 1.0)))) ; FINS ; FINS ; * Thermal compliance objective value and the sensitivity field * ************************************************************ *SI (bool0.'THERMIQUE' ET ((ABS WghtT0) > tab0.'PRECISION')) ; SI (bool0.'THERMIQUE' ET (NEG WghtT0 0.0)) ; SI bool0.'CAS_MULTIPLES' ; REPE loop0 case_nb0 ; * Temperature node field SINO ; FINS ; * 1/2.K.grad(T).grad(T) * =1/2.K.grad(T)^2 * =Element field of the thermal compliance density at integration points: * (without 1/2 nor K, they will be added locally for better performances) * Element field at barycenter * Conductivity field at barycenter: K * Integration (with K) * Objective function (with 1/2) obj0 = obj0 + (WghtT0 * 0.5 * tmp0 / case_nb0) ; * Switch the model of the element field eneA * from Therm to Mecha SI bool0.'MECANIQUE' ; FINS ; * Sensitivity field (with 1/2) dc0 = dc0 + ((WghtT0 * 0.5 / case_nb0) * tmp0 * ((vdT0 - 1.0) * p0 * (x0**(p0 - 1.0)))) ; FIN loop0 ; SINO ; * Temperature node field SINO ; FINS ; * 1/2.K.grad(T).grad(T) * =1/2.K.grad(T)^2 * =Element field of the thermal compliance density at integration points: * (without 1/2 nor K, they will be added locally for better performances) * Element field at barycenter * Conductivity field at barycenter: K ** mess 'tmp0 * eneA' ; ** tmp0 = CHAN 'GRAVITE' modTA (EXCO 'K' matTA 'SCAL') ' ' ; ** mess 'tmp0 (6b)' ; list resu tmp0 ; * Integration (with K) ** mess 'tmp0 * eneA' ; ** tmp0 = INTG (eneA * tmp0) modTA matTA ; * Objective function (with 1/2) obj0 = obj0 + (WghtT0 * 0.5 * tmp0) ; * Switch the model of the element field eneA * from Therm to Mecha SI bool0.'MECANIQUE' ; FINS ; * Sensitivity field (with 1/2) dc0 = dc0 + ((WghtT0 * 0.5) * tmp0 * ((vdT0 - 1.0) * p0 * (x0**(p0 - 1.0)))) ; FINS ; FINS ; * Output data * *********** * Save the objectove value and the sensitivity field tab0.'WTABLE'.'OBJECTIF' = obj0 ; tab0.'WTABLE'.'SENSIBILITE' = dc0 ; FINP ;
© Cast3M 2003 - Tous droits réservés.
Mentions légales