Télécharger topoproj.procedur

Retour à la liste

Numérotation des lignes :

  1. * TOPOPROJ PROCEDUR FD218221 25/12/18 21:15:11 12429
  2.  
  3. ************************************************************************
  4. ** Procedure called by TOPOPHYS for projecting the intermediate
  5. ** densities (S) to obtain the physical densities (Y)
  6. **
  7. ** Author:
  8. ** Guenhael Le Quilliec (LaMe - Polytech Tours)
  9. **
  10. ** Version:
  11. ** 1.0 2025/11/13 Initial version
  12. ************************************************************************
  13.  
  14. DEBP TOPOPROJ tab*'TABLE' ;
  15.  
  16. * Input data
  17. * **********
  18.  
  19. Wtab = tab.'WTABLE' ;
  20. Ltab = Wtab.'LOGIQUE' ;
  21.  
  22. * Intermediate (smoothed/filtered) densities to be projected
  23. SD = Wtab.'S_D' ;
  24.  
  25. * Projection stiffness
  26. bta = Wtab.'PROJECTION_RAIDEUR' ;
  27.  
  28. * Projection
  29. * **********
  30.  
  31. SI (bta > 0) ;
  32.  
  33. modD = Wtab.'MODELE_D' ;
  34. matD = Wtab.'CARACTERISTIQUES_D' ;
  35. eta = Wtab.'PROJECTION_SEUIL' ;
  36.  
  37. * Projection with a volume-preserving threshold
  38. SI Ltab.'PROJECTION_VOLUME_CONSTANT' ;
  39.  
  40. * Convergence criteria
  41. Vcrt = tab0.'PROJECTION_VOLUME_CRITERE' ;
  42. etacrt = tab0.'PROJECTION_SEUIL_CRITERE' ;
  43.  
  44. * Bounds of the threshold
  45. eta1 = 0.0 ;
  46. eta2 = 1.0 ;
  47. * Initial volume to be preserved
  48. SVtotD = INTG SD modD matD ;
  49.  
  50. * Bisection algorithm
  51. REPE loop0 tab0.'PROJECTION_MAX_IT' ;
  52.  
  53. YD = TOPOFONC tab.'PROJECTION' 'VALEUR' SD bta eta ;
  54. YVtotD = INTG YD modD matD ;
  55.  
  56. * Test convergence
  57. SI (((ABS ((YVtotD / SVtotD) - 1.0)) < Vcrt) OU
  58. (((eta2 - eta1) / (eta1 + eta2)) < etacrt)) ;
  59. QUIT loop0 ;
  60. FINS ;
  61.  
  62. * Update threshold bounds
  63. SI (YVtotD > SVtotD) ;
  64. eta1 = eta ;
  65. SINO ;
  66. eta2 = eta ;
  67. FINS ;
  68.  
  69. * Compute new threshold
  70. eta = 0.5 * (eta1 + eta2) ;
  71.  
  72. FIN loop0 ;
  73.  
  74. * Save final treshold
  75. Wtab.'PROJECTION_SEUIL' = eta ;
  76.  
  77. * Or simple projection with a fixed threshold
  78. SINO ;
  79.  
  80. eta = Wtab.'PROJECTION_SEUIL' ;
  81. YD = TOPOFONC tab.'PROJECTION' 'VALEUR' SD bta eta ;
  82.  
  83. FINS ;
  84.  
  85. SINO ;
  86.  
  87. YD = SD ;
  88.  
  89. FINS ;
  90.  
  91. * Output data
  92. * ***********
  93.  
  94. * Projected physical densities (Y)
  95. Wtab.'Y_D' = YD ;
  96.  
  97. FINP ;
  98.  
  99.  
  100.  

© Cast3M 2003 - Tous droits réservés.
Mentions légales