Salome HOME
projects
/
modules
/
smesh.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3ac7806
)
19296: EDF 681 SMESH - Pre-evaluation of the number of elements before mesh
author
eap
<eap@opencascade.com>
Mon, 16 Nov 2009 16:11:25 +0000
(16:11 +0000)
committer
eap
<eap@opencascade.com>
Mon, 16 Nov 2009 16:11:25 +0000
(16:11 +0000)
protect ARITHMETIC_1D from FPE
src/StdMeshers/StdMeshers_Regular_1D.cxx
patch
|
blob
|
history
diff --git
a/src/StdMeshers/StdMeshers_Regular_1D.cxx
b/src/StdMeshers/StdMeshers_Regular_1D.cxx
index 8e50b059ba88c416dbc24ed7be91199d7e6b5f79..b2fee20463ce91e499e363aa77e25eb7268b7349 100644
(file)
--- a/
src/StdMeshers/StdMeshers_Regular_1D.cxx
+++ b/
src/StdMeshers/StdMeshers_Regular_1D.cxx
@@
-757,7
+757,7
@@
bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh & theMesh,
double an = _value[ END_LENGTH_IND ];
double q = ( an - a1 ) / ( 2 *theLength/( a1 + an ) - 1 );
- int
n = int( 1 + ( an - a1 ) / q )
;
+ int
n = fabs(q) > numeric_limits<double>::min() ? int( 1 + ( an - a1 ) / q ) : 1+theLength/a1
;
double U1 = theReverse ? l : f;
double Un = theReverse ? f : l;