138 |
|
Dim grill As New grille |
139 |
|
Dim Bbox() As Double |
140 |
|
Dim path As String |
141 |
< |
Dim Eng As Double |
141 |
> |
Dim Eng As Double = 0 |
142 |
|
Dim coef_min As Double |
143 |
|
Erx = (100 - Erx) / 100 ' valeur d'erreur d'analyse exacte a priori |
144 |
|
|
169 |
|
|
170 |
|
'Calul de Eng |
171 |
|
Eng = determination_ecart_nodal_global_retraits_mat(Erx, coef_min) |
172 |
< |
|
172 |
> |
If Eng = 0 Then Continue For |
173 |
|
|
174 |
|
'initialistation de la grille |
175 |
|
|
1630 |
|
swedge = TabEdge(cpt2) |
1631 |
|
vEdgeU = swedge.GetCurveParams2 |
1632 |
|
longueur = GetEdgeLenght(swedge) |
1633 |
< |
pasmax = distance_entre_points(Eng, TabEdgeDouble(0, cpt2), TabEdgeDouble(1, cpt2), TabEdgeDouble(2, cpt2), 0.5) |
1633 |
> |
pasmax = distance_entre_points(Eng, TabEdgeDouble(0, cpt2), TabEdgeDouble(1, cpt2), TabEdgeDouble(2, cpt2)) |
1634 |
|
|
1635 |
|
nbpas = 3 * Math.Max(2, Math.Floor(longueur / pasmax - 0.0001) + 1) |
1636 |
|
pas = (vEdgeU(7) - vEdgeU(6)) / nbpas |
1716 |
|
vSurfParam = swsurf.Parameterization |
1717 |
|
|
1718 |
|
vUVlong = GetUVLong(swface) |
1719 |
< |
pasmax = distance_entre_points(Eng, TabFaceDouble(0, cpt3), TabFaceDouble(1, cpt3), TabFaceDouble(2, cpt3), 0.5) |
1719 |
> |
pasmax = distance_entre_points(Eng, TabFaceDouble(0, cpt3), TabFaceDouble(1, cpt3), TabFaceDouble(2, cpt3)) |
1720 |
|
|
1721 |
|
nbpasU = 3 * Math.Max(2, Math.Floor(vUVlong(0) / pasmax - 0.0001) + 1) |
1722 |
|
nbpasV = 3 * Math.Max(2, Math.Floor(vUVlong(1) / pasmax - 0.0001) + 1) |
2140 |
|
|
2141 |
|
|
2142 |
|
End Sub |
2143 |
< |
Function distance_entre_points(ByVal eng As Double, ByVal coef As Double, ByVal lmbd As Double, ByVal courbure As Double, ByVal erreur As Double) As Double |
2143 |
> |
Function distance_entre_points(ByVal eng As Double, ByVal coef As Double, ByVal lmbd As Double, ByVal courbure As Double, Optional ByVal erreur As Double = 1) As Double |
2144 |
|
Dim rmax As Double |
2145 |
|
Dim nor As Double = 0.5 |
2146 |
|
Dim eni As Double = eng * coef |
2787 |
|
Dim nb_retrait_mat As Integer = 0 |
2788 |
|
Dim param(1) As Double |
2789 |
|
Dim Eng_moy As Double = 0 |
2790 |
+ |
Dim Eng_ref As Double = 0 |
2791 |
|
Dim tmp() As Double |
2792 |
|
Dim Eni As Double |
2793 |
|
|
2794 |
|
ReDim Preserve Tabretrait_mat(0) |
2795 |
|
Tabretrait_mat(0) = New retrait_mat(Nothing, 0) |
2796 |
+ |
raffinn_auto_retrait_mat(0, 0, 0, 0, 0, 0, 0, param) |
2797 |
|
|
2798 |
|
swfaceref = swbody.GetFirstFace |
2799 |
|
For cpt1 = 0 To swbody.GetFaceCount - 1 |
2829 |
|
nb_retrait_mat = nb_retrait_mat + 1 |
2830 |
|
ReDim Preserve Tabretrait_mat(nb_retrait_mat - 1) |
2831 |
|
Tabretrait_mat(nb_retrait_mat - 1) = New retrait_mat(swface, diametre) |
2832 |
< |
raffinn_auto_retrait_mat(0, 0, 0, 0, 0, 0, 0, param) |
2831 |
< |
Eng_moy = Eng_moy + diametre / 2 * Erx_m / (param(0) * Math.Pow(contrainte_vm_rm_ref(1, 2, tmp), param(1))) ' Calcul de En_reference à une distance de 1 fois le rayon de reference (fin de zone à gradients de contraintes perturbés) puis multiplication par le rayon de la caractéristique (extrapolation) |
2832 |
< |
If Eni = 0 Then Eni = Eng_moy |
2832 |
> |
If Eni = 0 Then Eni = diametre / 2 * Erx_m / (param(0) * Math.Pow(contrainte_vm_rm_ref(1, 2, tmp), param(1))) |
2833 |
|
Eni = Math.Min(Eni, diametre / 2 * Erx_m / (param(0) * Math.Pow(contrainte_vm_rm_ref(0, 2, tmp), param(1)))) ' calcul du Eni minimal sur le domaine |
2834 |
< |
End If |
2834 |
> |
End If |
2835 |
|
End If |
2836 |
|
Next cpt3 |
2837 |
|
Else |
2859 |
|
nb_retrait_mat = nb_retrait_mat + 1 |
2860 |
|
ReDim Preserve Tabretrait_mat(nb_retrait_mat - 1) |
2861 |
|
Tabretrait_mat(nb_retrait_mat - 1) = New retrait_mat(swfaceref, diametre) |
2862 |
< |
raffinn_auto_retrait_mat(0, 0, 0, 0, 0, 0, 0, param) |
2863 |
< |
Eng_moy = Eng_moy + diametre / 2 * Erx_m / (param(0) * Math.Pow(contrainte_vm_rm_ref(1, 2, tmp), param(1))) ' Calcul de En_reference à une distance de 1 fois le rayon de reference (fin de zone à gradients de contraintes perturbés) puis multiplication par le rayon de la caractéristique (extrapolation) |
2864 |
< |
If Eni = 0 Then Eni = Eng_moy |
2862 |
> |
If Eni = 0 Then Eni = diametre / 2 * Erx_m / (param(0) * Math.Pow(contrainte_vm_rm_ref(1, 2, tmp), param(1))) |
2863 |
|
Eni = Math.Min(Eni, diametre / 2 * Erx_m / (param(0) * Math.Pow(contrainte_vm_rm_ref(0, 2, tmp), param(1)))) ' calcul du Eni minimal sur le domaine |
2864 |
|
End If |
2865 |
|
Else |
2882 |
|
nb_retrait_mat = nb_retrait_mat + 1 |
2883 |
|
ReDim Preserve Tabretrait_mat(nb_retrait_mat - 1) |
2884 |
|
Tabretrait_mat(nb_retrait_mat - 1) = New retrait_mat(swfaceref, diametre) |
2885 |
< |
raffinn_auto_retrait_mat(0, 0, 0, 0, 0, 0, 0, param) |
2888 |
< |
Eng_moy = Eng_moy + diametre / 2 * Erx_m / (param(0) * Math.Pow(contrainte_vm_rm_ref(1, 2, tmp), param(1))) ' Calcul de En_reference à une distance de 1 fois le rayon de reference (fin de zone à gradients de contraintes perturbés) puis multiplication par le rayon de la caractéristique (extrapolation) |
2889 |
< |
If Eni = 0 Then Eni = Eng_moy |
2885 |
> |
If Eni = 0 Then Eni = diametre / 2 * Erx_m / (param(0) * Math.Pow(contrainte_vm_rm_ref(1, 2, tmp), param(1))) |
2886 |
|
Eni = Math.Min(Eni, diametre / 2 * Erx_m / (param(0) * Math.Pow(contrainte_vm_rm_ref(0, 2, tmp), param(1)))) ' calcul du Eni minimal sur le domaine |
2887 |
|
End If |
2888 |
|
End If |
2893 |
|
swfaceref = swfaceref.GetNextFace |
2894 |
|
Next cpt1 |
2895 |
|
|
2896 |
< |
If nb_retrait_mat > 0 Or Tabretrait_mat(0).diametre > 0 Then |
2901 |
< |
Eng_moy = Eng_moy / nb_retrait_mat |
2896 |
> |
If nb_retrait_mat Then |
2897 |
|
raffinn_auto_retrait_mat(0, 0, 0, 0, 0, 0, 0, param) |
2898 |
+ |
Eng_ref = Erx_m / (param(0) * Math.Pow(contrainte_vm_rm_ref(1, 2, tmp), param(1))) ' Calcul de En_reference à une distance de 1 fois le rayon de reference (fin de zone à gradients de contraintes perturbés) |
2899 |
+ |
diametre = 0 |
2900 |
+ |
For cpt1 = 0 To nb_retrait_mat - 1 |
2901 |
+ |
diametre = diametre + Tabretrait_mat(cpt1).diametre |
2902 |
+ |
Next |
2903 |
+ |
diametre = diametre / nb_retrait_mat |
2904 |
+ |
|
2905 |
+ |
Eng_moy = Eng_ref * diametre / 2 |
2906 |
|
determination_ecart_nodal_global_retraits_mat = Eng_moy |
2907 |
|
coeffmin = Eni / Eng_moy |
2908 |
|
'MsgBox("Pré-optimisation de maillage des caractéristiques Retraits de matière avec une écart nodal global de " & 1000 * Eng_moy & "mm") |