* TOPORSTR PROCEDUR FD218221 25/12/18 21:15:13 12429 ************************************************************************ ** Procedure called by TOPOOBJE to apply geometric restrictions to an ** input field. ** ** Remark: the input field must be an intensive quantity ** and defined on the design zone (D). ** ** Author: ** Guenhael Le Quilliec (LaMe - Polytech Tours) ** ** Version: ** 2.0 2025/11/13 Made compatible with TOPOPTIM V4.0 ** 1.1 2021/03/19 Fixed a minor issue by adding 'SCALAIRE' type for the ** sensitivity ** 1.0 2017/04/18 Initial version ************************************************************************ * General input data * ****************** Wtab = tab.'WTABLE' ; Ltab = Wtab.'LOGIQUE' ; * If there is nothing to do * ************************* SI (NON Ltab.'RESTRICTIONS') ; * Return input field FINS ; * Input data * ********** * Criterion to fuse the nodes crt = tab.'ELIM_CRITERE' ; * Node mesh of the centroids ctrmshD = Wtab.'MAILLAGE_GRAVITE_D' ; * Preprocessing * ************* * Switch from element field to nodal field * Apply restrictions * ****************** * Loop over each restriction * Find the next restriction rst = tab.'RESTRICTIONS'.&itr ; SINO ; QUIT itr ; FINS ; * Get node mesh of centroids of the restricted zone * and its initial sensitivity SI Lrstzon ; ELIM ctrmshD ctrmsh1 crt ; SINO ; ctrmsh1 = ctrmshD ; fld1 = fldD ; FINS ; * Make copies with prescribed geometric transformation * Fuse nodes of their supports * Compute mean sensitivity fields ELIM ctrmsh1 msh2 crt ; fld1 = (fld1 + fld2) / 2.0 ; FINS ; ELIM ctrmsh1 msh2 crt ; fld1 = (fld1 + fld2) / 2.0 ; FINS ; ELIM ctrmsh1 msh2 crt ; fld1 = (fld1 + fld2) / 2.0 ; FINS ; SI (rst.'PERIODES' EGA 2) ; SINO ; FINS ; ELIM ctrmsh1 msh2 crt ; fld1 = (fld1 + fld2) / 2.0 ; SINO ; mshtab.(0) = ctrmsh1 ; fldtab.(0) = fld1 ; p0 = rst.'PERIODES' ; a0 = 360.0 / p0 ; p1 = rst.'POIN1' ; p2 = rst.'POIN2' ; REPE itr1 (p0 - 1) ; old = &itr1 - 1 ; FIN itr1 ; SINO ; p1 = rst.'POIN1' ; REPE itr1 (p0 - 1) ; old = &itr1 - 1 ; FIN itr1 ; FINS ; REPE itr1 (p0 - 1) ; fld1 = fld1 + fldtab.&itr1 ; FIN itr1 ; fld1 = fld1 / p0 ; FINS ; FINS ; mshtab.(0) = ctrmsh1 ; fldtab.(0) = fld1 ; p0 = rst.'PERIODES' ; REPE itr1 (p0 - 1) ; old = &itr1 - 1 ; itr2 = -1 * &itr1 ; old = itr2 + 1 ; FIN itr1 ; REPE itr1 (p0 - 1) ; fld1 = fld1 + fldtab.&itr1 ; itr2 = -1 * &itr1 ; fld1 = fld1 + fldtab.itr2 ; FIN itr1 ; fld1 = fld1 / p0 ; FINS ; * Compute final sensitivity SI Lrstzon ; SINO ; fldD = fld1 ; FINS ; FIN itr ; * Postprocessing * ************** * Switch sensitivity back from nodal field to element field 'TYPE' 'SCALAIRE' 'GRAVITE' ; * In thermal mode, 'GRAVITE' option is not respected * This issue is resolved by using CHAN 'GRAVITE' SI (NON Ltab.'MECANIQUE') ; FINS ; FINP fldD ;
© Cast3M 2003 - Tous droits réservés.
Mentions légales