mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-05 18:16:23 +03:00
0023952: Improving thread-safety of intersections, approximations and other modeling algorithms
AdvApp2Var_SysBase::mcrgene_ size reduced from 1000 to 32 elements, and each element reworked into typed structure. fixed IntAna_Curve.cxx to prevent access to #NAN# SigneSqrtDis fixed alignment of doubles by 8 bytes, and minor corrections Minor correction: static const N given more specific name (MAX_ALLOC_NB) Added QAcommands OCC23952sweep and OCC23952intersect Added test cases bugs/modalg_5/bug23952_1 bug23952_2
This commit is contained in:
parent
416d012709
commit
1ef32e96ee
@ -277,7 +277,7 @@ int mma1cdi_(integer *ndimen,
|
||||
doublereal *hermit,
|
||||
integer *iercod)
|
||||
{
|
||||
static integer c__1 = 1;
|
||||
integer c__1 = 1;
|
||||
|
||||
/* System generated locals */
|
||||
integer contr1_dim1, contr1_offset, contr2_dim1, contr2_offset,
|
||||
@ -286,9 +286,9 @@ int mma1cdi_(integer *ndimen,
|
||||
i__2, i__3;
|
||||
|
||||
/* Local variables */
|
||||
static integer nroo2, ncfhe, nd, ii, kk;
|
||||
static integer ibb, kkm, kkp;
|
||||
static doublereal bid1, bid2, bid3;
|
||||
integer nroo2, ncfhe, nd, ii, kk;
|
||||
integer ibb, kkm, kkp;
|
||||
doublereal bid1, bid2, bid3;
|
||||
|
||||
/* **********************************************************************
|
||||
*/
|
||||
@ -505,8 +505,8 @@ int mma1cnt_(integer *ndimen,
|
||||
i__2, i__3;
|
||||
|
||||
/* Local variables */
|
||||
static integer nd, ii, jj, ibb;
|
||||
static doublereal bid;
|
||||
integer nd, ii, jj, ibb;
|
||||
doublereal bid;
|
||||
|
||||
|
||||
/* ***********************************************************************
|
||||
@ -643,10 +643,10 @@ int mma1fdi_(integer *ndimen,
|
||||
doublereal d__1;
|
||||
|
||||
/* Local variables */
|
||||
static integer ideb, ifin, nroo2, ideru, iderv;
|
||||
static doublereal renor;
|
||||
static integer ii, nd, ibb, iim, nbp, iip;
|
||||
static doublereal bid1, bid2;
|
||||
integer ideb, ifin, nroo2, ideru, iderv;
|
||||
doublereal renor;
|
||||
integer ii, nd, ibb, iim, nbp, iip;
|
||||
doublereal bid1, bid2;
|
||||
|
||||
/* **********************************************************************
|
||||
*/
|
||||
@ -971,8 +971,8 @@ int mma1fer_(integer *,//ndimen,
|
||||
integer crvjac_dim1, crvjac_offset, i__1, i__2;
|
||||
|
||||
/* Local variables */
|
||||
static integer idim, ncfja, ncfnw, ndses, ii, kk, ibb, ier;
|
||||
static integer nbr0;
|
||||
integer idim, ncfja, ncfnw, ndses, ii, kk, ibb, ier;
|
||||
integer nbr0;
|
||||
|
||||
|
||||
/* ***********************************************************************
|
||||
@ -1165,7 +1165,7 @@ int AdvApp2Var_ApproxF2var::mma1her_(const integer *iordre,
|
||||
integer hermit_dim1, hermit_offset;
|
||||
|
||||
/* Local variables */
|
||||
static integer ibb;
|
||||
integer ibb;
|
||||
|
||||
|
||||
|
||||
@ -1333,7 +1333,7 @@ int mma1jak_(integer *ndimen,
|
||||
crvjac_dim1, crvjac_offset, cgauss_dim1;
|
||||
|
||||
/* Local variables */
|
||||
static integer ibb;
|
||||
integer ibb;
|
||||
|
||||
/* **********************************************************************
|
||||
*/
|
||||
@ -1448,9 +1448,9 @@ int mma1noc_(doublereal *dfuvin,
|
||||
doublereal d__1;
|
||||
|
||||
/* Local variables */
|
||||
static doublereal rider, riord;
|
||||
static integer nd, ibb;
|
||||
static doublereal bid;
|
||||
doublereal rider, riord;
|
||||
integer nd, ibb;
|
||||
doublereal bid;
|
||||
/* **********************************************************************
|
||||
*/
|
||||
|
||||
@ -1581,8 +1581,8 @@ int mma1nop_(integer *nbroot,
|
||||
integer i__1;
|
||||
|
||||
/* Local variables */
|
||||
static doublereal alinu, blinu, alinv, blinv;
|
||||
static integer ii, ibb;
|
||||
doublereal alinu, blinu, alinv, blinv;
|
||||
integer ii, ibb;
|
||||
|
||||
/* ***********************************************************************
|
||||
*/
|
||||
@ -1700,11 +1700,11 @@ int AdvApp2Var_ApproxF2var::mma2ac1_(integer const *ndimen,
|
||||
patjac_dim2, patjac_offset, i__1, i__2, i__3, i__4, i__5;
|
||||
|
||||
/* Local variables */
|
||||
static logical ldbg;
|
||||
static integer ndgu, ndgv;
|
||||
static doublereal bidu1, bidu2, bidv1, bidv2;
|
||||
static integer ioru1, iorv1, ii, nd, jj, ku, kv;
|
||||
static doublereal cnt1, cnt2, cnt3, cnt4;
|
||||
logical ldbg;
|
||||
integer ndgu, ndgv;
|
||||
doublereal bidu1, bidu2, bidv1, bidv2;
|
||||
integer ioru1, iorv1, ii, nd, jj, ku, kv;
|
||||
doublereal cnt1, cnt2, cnt3, cnt4;
|
||||
|
||||
/* **********************************************************************
|
||||
*/
|
||||
@ -1865,9 +1865,9 @@ int AdvApp2Var_ApproxF2var::mma2ac2_(const integer *ndimen,
|
||||
vhermt_dim1, vhermt_offset, i__1, i__2, i__3, i__4;
|
||||
|
||||
/* Local variables */
|
||||
static logical ldbg;
|
||||
static integer ndgv1, ndgv2, ii, jj, nd, kk;
|
||||
static doublereal bid1, bid2;
|
||||
logical ldbg;
|
||||
integer ndgv1, ndgv2, ii, jj, nd, kk;
|
||||
doublereal bid1, bid2;
|
||||
|
||||
/* **********************************************************************
|
||||
*/
|
||||
@ -2011,9 +2011,9 @@ int AdvApp2Var_ApproxF2var::mma2ac3_(const integer *ndimen,
|
||||
uhermt_dim1, uhermt_offset, i__1, i__2, i__3, i__4;
|
||||
|
||||
/* Local variables */
|
||||
static logical ldbg;
|
||||
static integer ndgu1, ndgu2, ii, jj, nd, kk;
|
||||
static doublereal bid1, bid2;
|
||||
logical ldbg;
|
||||
integer ndgu1, ndgu2, ii, jj, nd, kk;
|
||||
doublereal bid1, bid2;
|
||||
|
||||
/* **********************************************************************
|
||||
*/
|
||||
@ -2157,8 +2157,8 @@ int AdvApp2Var_ApproxF2var::mma2can_(const integer *ncfmxu,
|
||||
patcan_offset, i__1, i__2;
|
||||
|
||||
/* Local variables */
|
||||
static logical ldbg;
|
||||
static integer ilon1, ilon2, ii, nd;
|
||||
logical ldbg;
|
||||
integer ilon1, ilon2, ii, nd;
|
||||
|
||||
/* **********************************************************************
|
||||
*/
|
||||
@ -2310,7 +2310,7 @@ int mma2cd1_(integer *ndimen,
|
||||
doublereal *diditb)
|
||||
|
||||
{
|
||||
static integer c__1 = 1;
|
||||
integer c__1 = 1;
|
||||
|
||||
/* System generated locals */
|
||||
integer contr1_dim1, contr1_dim2, contr1_offset, contr2_dim1, contr2_dim2,
|
||||
@ -2324,10 +2324,10 @@ int mma2cd1_(integer *ndimen,
|
||||
i__5;
|
||||
|
||||
/* Local variables */
|
||||
static integer ncfhu, ncfhv, nuroo, nvroo, nd, ii, jj, kk, ll, ibb, kkm,
|
||||
integer ncfhu, ncfhv, nuroo, nvroo, nd, ii, jj, kk, ll, ibb, kkm,
|
||||
llm, kkp, llp;
|
||||
static doublereal bid1, bid2, bid3, bid4;
|
||||
static doublereal diu1, diu2, div1, div2, sou1, sou2, sov1, sov2;
|
||||
doublereal bid1, bid2, bid3, bid4;
|
||||
doublereal diu1, diu2, div1, div2, sou1, sou2, sov1, sov2;
|
||||
|
||||
/* **********************************************************************
|
||||
*/
|
||||
@ -2670,7 +2670,7 @@ int mma2cd2_(integer *ndimen,
|
||||
doublereal *diditb)
|
||||
|
||||
{
|
||||
static integer c__1 = 1;
|
||||
integer c__1 = 1;
|
||||
/* System generated locals */
|
||||
integer sotbv1_dim1, sotbv1_dim2, sotbv1_offset, sotbv2_dim1, sotbv2_dim2,
|
||||
sotbv2_offset, ditbv1_dim1, ditbv1_dim2, ditbv1_offset,
|
||||
@ -2681,8 +2681,8 @@ int mma2cd2_(integer *ndimen,
|
||||
disotb_dim1, disotb_dim2, disotb_offset, i__1, i__2, i__3, i__4;
|
||||
|
||||
/* Local variables */
|
||||
static integer ncfhv, nuroo, nvroo, ii, nd, jj, kk, ibb, jjm, jjp;
|
||||
static doublereal bid1, bid2, bid3, bid4;
|
||||
integer ncfhv, nuroo, nvroo, ii, nd, jj, kk, ibb, jjm, jjp;
|
||||
doublereal bid1, bid2, bid3, bid4;
|
||||
|
||||
/* **********************************************************************
|
||||
*/
|
||||
@ -2982,7 +2982,7 @@ int mma2cd3_(integer *ndimen,
|
||||
doublereal *diditb)
|
||||
|
||||
{
|
||||
static integer c__1 = 1;
|
||||
integer c__1 = 1;
|
||||
|
||||
/* System generated locals */
|
||||
integer sotbu1_dim1, sotbu1_dim2, sotbu1_offset, sotbu2_dim1, sotbu2_dim2,
|
||||
@ -2994,8 +2994,8 @@ int mma2cd3_(integer *ndimen,
|
||||
disotb_dim1, disotb_dim2, disotb_offset, i__1, i__2, i__3, i__4;
|
||||
|
||||
/* Local variables */
|
||||
static integer ncfhu, nuroo, nvroo, ii, nd, jj, kk, ibb, kkm, kkp;
|
||||
static doublereal bid1, bid2, bid3, bid4;
|
||||
integer ncfhu, nuroo, nvroo, ii, nd, jj, kk, ibb, kkm, kkp;
|
||||
doublereal bid1, bid2, bid3, bid4;
|
||||
|
||||
/* **********************************************************************
|
||||
*/
|
||||
@ -3308,7 +3308,7 @@ int AdvApp2Var_ApproxF2var::mma2cdi_( integer *ndimen,
|
||||
integer *iercod)
|
||||
|
||||
{
|
||||
static integer c__8 = 8;
|
||||
integer c__8 = 8;
|
||||
|
||||
/* System generated locals */
|
||||
integer contr1_dim1, contr1_dim2, contr1_offset, contr2_dim1, contr2_dim2,
|
||||
@ -3319,13 +3319,13 @@ int AdvApp2Var_ApproxF2var::mma2cdi_( integer *ndimen,
|
||||
disotb_offset;
|
||||
|
||||
/* Local variables */
|
||||
static integer ilong;
|
||||
static intptr_t iofwr;
|
||||
static doublereal wrkar[1];
|
||||
static integer iszwr;
|
||||
static integer ibb, ier;
|
||||
static integer isz1, isz2, isz3, isz4;
|
||||
static intptr_t ipt1, ipt2, ipt3, ipt4;
|
||||
integer ilong;
|
||||
intptr_t iofwr;
|
||||
doublereal* wrkar = 0;
|
||||
integer iszwr;
|
||||
integer ibb, ier;
|
||||
integer isz1, isz2, isz3, isz4;
|
||||
intptr_t ipt1, ipt2, ipt3, ipt4;
|
||||
|
||||
|
||||
|
||||
@ -3471,6 +3471,7 @@ int AdvApp2Var_ApproxF2var::mma2cdi_( integer *ndimen,
|
||||
--sotbv2;
|
||||
--ditbv1;
|
||||
--ditbv2;
|
||||
AdvApp2Var_SysBase anAdvApp2Var_SysBase;
|
||||
|
||||
/* Function Body */
|
||||
ibb = AdvApp2Var_SysBase::mnfndeb_();
|
||||
@ -3506,7 +3507,7 @@ int AdvApp2Var_ApproxF2var::mma2cdi_( integer *ndimen,
|
||||
isz3 = ((*iordru + 1) << 1) * *nbpntu;
|
||||
isz4 = ((*iordrv + 1) << 1) * *nbpntv;
|
||||
iszwr = isz1 + isz2 + isz3 + isz4;
|
||||
AdvApp2Var_SysBase::mcrrqst_(&c__8, &iszwr, wrkar, &iofwr, &ier);
|
||||
anAdvApp2Var_SysBase.mcrrqst_(&c__8, &iszwr, wrkar, &iofwr, &ier);
|
||||
if (ier > 0) {
|
||||
goto L9013;
|
||||
}
|
||||
@ -3579,7 +3580,7 @@ L9013:
|
||||
|
||||
L9999:
|
||||
if (iofwr != 0) {
|
||||
AdvApp2Var_SysBase::mcrdelt_(&c__8, &iszwr, wrkar, &iofwr, &ier);
|
||||
anAdvApp2Var_SysBase.mcrdelt_(&c__8, &iszwr, wrkar, &iofwr, &ier);
|
||||
}
|
||||
if (ier > 0) {
|
||||
*iercod = 13;
|
||||
@ -3623,7 +3624,7 @@ int AdvApp2Var_ApproxF2var::mma2ce1_(integer *numdec,
|
||||
integer *iercod)
|
||||
|
||||
{
|
||||
static integer c__8 = 8;
|
||||
integer c__8 = 8;
|
||||
|
||||
/* System generated locals */
|
||||
integer sosotb_dim1, sosotb_dim2, sosotb_offset, disotb_dim1, disotb_dim2,
|
||||
@ -3632,13 +3633,13 @@ int AdvApp2Var_ApproxF2var::mma2ce1_(integer *numdec,
|
||||
patjac_offset;
|
||||
|
||||
/* Local variables */
|
||||
static logical ldbg;
|
||||
static intptr_t iofwr;
|
||||
static doublereal wrkar[1];
|
||||
static integer iszwr;
|
||||
static integer ier;
|
||||
static integer isz1, isz2, isz3, isz4, isz5, isz6, isz7;
|
||||
static intptr_t ipt1, ipt2, ipt3, ipt4, ipt5, ipt6, ipt7;
|
||||
logical ldbg;
|
||||
intptr_t iofwr;
|
||||
doublereal* wrkar = 0;
|
||||
integer iszwr;
|
||||
integer ier;
|
||||
integer isz1, isz2, isz3, isz4, isz5, isz6, isz7;
|
||||
intptr_t ipt1, ipt2, ipt3, ipt4, ipt5, ipt6, ipt7;
|
||||
|
||||
|
||||
|
||||
@ -3799,7 +3800,8 @@ int AdvApp2Var_ApproxF2var::mma2ce1_(integer *numdec,
|
||||
isz6 = *ndjacv + 1 - ((*iordrv + 1) << 1);
|
||||
isz7 = *ndimen << 2;
|
||||
iszwr = isz1 + isz2 + isz3 + isz4 + isz5 + isz6 + isz7;
|
||||
AdvApp2Var_SysBase::mcrrqst_(&c__8, &iszwr, wrkar, &iofwr, &ier);
|
||||
AdvApp2Var_SysBase anAdvApp2Var_SysBase;
|
||||
anAdvApp2Var_SysBase.mcrrqst_(&c__8, &iszwr, wrkar, &iofwr, &ier);
|
||||
if (ier > 0) {
|
||||
goto L9013;
|
||||
}
|
||||
@ -3853,7 +3855,7 @@ L9013:
|
||||
|
||||
L9999:
|
||||
if (iofwr != 0) {
|
||||
AdvApp2Var_SysBase::mcrdelt_(&c__8, &iszwr, wrkar, &iofwr, &ier);
|
||||
anAdvApp2Var_SysBase.mcrdelt_(&c__8, &iszwr, wrkar, &iofwr, &ier);
|
||||
}
|
||||
if (ier > 0) {
|
||||
*iercod = 13;
|
||||
@ -3913,12 +3915,12 @@ int mma2ce2_(integer *numdec,
|
||||
patjac_offset, vecerr_dim1, vecerr_offset, i__1, i__2, i__3, i__4;
|
||||
|
||||
/* Local variables */
|
||||
static logical ldbg;
|
||||
static integer idim, igsu, minu, minv, maxu, maxv, igsv;
|
||||
static doublereal vaux[3];
|
||||
static integer i2rdu, i2rdv, ndses, nd, ii, jj, kk, nu, nv;
|
||||
static doublereal zu, zv;
|
||||
static integer nu1, nv1;
|
||||
logical ldbg;
|
||||
integer idim, igsu, minu, minv, maxu, maxv, igsv;
|
||||
doublereal vaux[3];
|
||||
integer i2rdu, i2rdv, ndses, nd, ii, jj, kk, nu, nv;
|
||||
doublereal zu, zv;
|
||||
integer nu1, nv1;
|
||||
|
||||
/* **********************************************************************
|
||||
*/
|
||||
@ -4678,9 +4680,9 @@ int mma2cfu_(integer *ndujac,
|
||||
soditb_offset, diditb_dim1, i__1, i__2;
|
||||
|
||||
/* Local variables */
|
||||
static logical ldbg;
|
||||
static integer nptu2, nptv2, ii, jj;
|
||||
static doublereal bid0, bid1, bid2;
|
||||
logical ldbg;
|
||||
integer nptu2, nptv2, ii, jj;
|
||||
doublereal bid0, bid1, bid2;
|
||||
|
||||
/* **********************************************************************
|
||||
*/
|
||||
@ -4894,9 +4896,9 @@ int mma2cfv_(integer *ndvjac,
|
||||
patjac_offset, i__1, i__2;
|
||||
|
||||
/* Local variables */
|
||||
static logical ldbg;
|
||||
static integer nptv2, ii, jj;
|
||||
static doublereal bid1;
|
||||
logical ldbg;
|
||||
integer nptv2, ii, jj;
|
||||
doublereal bid1;
|
||||
|
||||
/* **********************************************************************
|
||||
*/
|
||||
@ -5052,9 +5054,9 @@ int AdvApp2Var_ApproxF2var::mma2ds1_(integer *ndimen,
|
||||
fpntab_offset, i__1;
|
||||
|
||||
/* Local variables */
|
||||
static logical ldbg;
|
||||
static integer ibid1, ibid2, iuouv, nd;
|
||||
static integer isz1, isz2;
|
||||
logical ldbg;
|
||||
integer ibid1, ibid2, iuouv, nd;
|
||||
integer isz1, isz2;
|
||||
|
||||
/* **********************************************************************
|
||||
*/
|
||||
@ -5365,7 +5367,7 @@ int mma2ds2_(integer *ndimen,
|
||||
integer *iercod)
|
||||
|
||||
{
|
||||
static integer c__0 = 0;
|
||||
integer c__0 = 0;
|
||||
/* System generated locals */
|
||||
integer sosotb_dim1, sosotb_dim2, sosotb_offset, disotb_dim1, disotb_dim2,
|
||||
disotb_offset, soditb_dim1, soditb_dim2, soditb_offset,
|
||||
@ -5373,12 +5375,12 @@ int mma2ds2_(integer *ndimen,
|
||||
fpntab_offset, i__1, i__2, i__3;
|
||||
|
||||
/* Local variables */
|
||||
static integer jdec;
|
||||
static logical ldbg;
|
||||
static doublereal alinu, blinu, alinv, blinv, tcons;
|
||||
static doublereal dbfn1[2], dbfn2[2];
|
||||
static integer nuroo, nvroo, id, iu, iv;
|
||||
static doublereal um, up;
|
||||
integer jdec;
|
||||
logical ldbg;
|
||||
doublereal alinu, blinu, alinv, blinv, tcons;
|
||||
doublereal dbfn1[2], dbfn2[2];
|
||||
integer nuroo, nvroo, id, iu, iv;
|
||||
doublereal um, up;
|
||||
|
||||
|
||||
/* **********************************************************************
|
||||
@ -5749,11 +5751,11 @@ int mma2er1_(integer *ndjacu,
|
||||
doublereal d__1;
|
||||
|
||||
/* Local variables */
|
||||
static logical ldbg;
|
||||
static integer minu, minv;
|
||||
static doublereal vaux[2];
|
||||
static integer ii, nd, jj;
|
||||
static doublereal bid0, bid1;
|
||||
logical ldbg;
|
||||
integer minu, minv;
|
||||
doublereal vaux[2];
|
||||
integer ii, nd, jj;
|
||||
doublereal bid0, bid1;
|
||||
|
||||
/* **********************************************************************
|
||||
*/
|
||||
@ -5915,12 +5917,12 @@ int mma2er2_(integer *ndjacu,
|
||||
doublereal d__1;
|
||||
|
||||
/* Local variables */
|
||||
static logical ldbg;
|
||||
static doublereal vaux[2];
|
||||
static integer i2rdu, i2rdv;
|
||||
static doublereal errnu, errnv;
|
||||
static integer ii, nd, jj, nu, nv;
|
||||
static doublereal bid0, bid1;
|
||||
logical ldbg;
|
||||
doublereal vaux[2];
|
||||
integer i2rdu, i2rdv;
|
||||
doublereal errnu, errnv;
|
||||
integer ii, nd, jj, nu, nv;
|
||||
doublereal bid0, bid1;
|
||||
|
||||
/* **********************************************************************
|
||||
*/
|
||||
@ -6155,7 +6157,7 @@ int AdvApp2Var_ApproxF2var::mma2fnc_(integer *ndimen,
|
||||
integer *iercod)
|
||||
|
||||
{
|
||||
static integer c__8 = 8;
|
||||
integer c__8 = 8;
|
||||
|
||||
/* System generated locals */
|
||||
integer courbe_dim1, courbe_dim2, courbe_offset, somtab_dim1, somtab_dim2,
|
||||
@ -6166,22 +6168,22 @@ int AdvApp2Var_ApproxF2var::mma2fnc_(integer *ndimen,
|
||||
doublereal d__1;
|
||||
|
||||
/* Local variables */
|
||||
static integer ideb;
|
||||
static doublereal tmil;
|
||||
static integer ideb1, ibid1, ibid2, ncfja, ndgre, ilong,
|
||||
integer ideb;
|
||||
doublereal tmil;
|
||||
integer ideb1, ibid1, ibid2, ncfja, ndgre, ilong,
|
||||
ndwrk;
|
||||
static doublereal wrkar[1];
|
||||
static integer nupil;
|
||||
static intptr_t iofwr;
|
||||
static doublereal uvpav[4] /* was [2][2] */;
|
||||
static integer nd, ii;
|
||||
static integer ibb;
|
||||
static integer ier;
|
||||
static doublereal uv11[4] /* was [2][2] */;
|
||||
static integer ncb1;
|
||||
static doublereal eps3;
|
||||
static integer isz1, isz2, isz3, isz4, isz5;
|
||||
static intptr_t ipt1, ipt2, ipt3, ipt4, ipt5,iptt, jptt;
|
||||
doublereal* wrkar = 0;
|
||||
integer nupil;
|
||||
intptr_t iofwr;
|
||||
doublereal uvpav[4] /* was [2][2] */;
|
||||
integer nd, ii;
|
||||
integer ibb;
|
||||
integer ier;
|
||||
doublereal uv11[4] /* was [2][2] */;
|
||||
integer ncb1;
|
||||
doublereal eps3;
|
||||
integer isz1, isz2, isz3, isz4, isz5;
|
||||
intptr_t ipt1, ipt2, ipt3, ipt4, ipt5,iptt, jptt;
|
||||
|
||||
/* **********************************************************************
|
||||
*/
|
||||
@ -6370,6 +6372,7 @@ int AdvApp2Var_ApproxF2var::mma2fnc_(integer *ndimen,
|
||||
courbe_dim2 = *ndimen;
|
||||
courbe_offset = courbe_dim1 * (courbe_dim2 + 1) + 1;
|
||||
courbe -= courbe_offset;
|
||||
AdvApp2Var_SysBase anAdvApp2Var_SysBase;
|
||||
|
||||
/* Function Body */
|
||||
ibb = AdvApp2Var_SysBase::mnfndeb_();
|
||||
@ -6429,7 +6432,7 @@ int AdvApp2Var_ApproxF2var::mma2fnc_(integer *ndimen,
|
||||
isz5 = (*ndgjac + 1) * *ndimen;
|
||||
|
||||
ndwrk = isz1 + isz2 + isz3 + isz4 + isz5;
|
||||
AdvApp2Var_SysBase::mcrrqst_(&c__8, &ndwrk, wrkar, &iofwr, &ier);
|
||||
anAdvApp2Var_SysBase.mcrrqst_(&c__8, &ndwrk, wrkar, &iofwr, &ier);
|
||||
if (ier > 0) {
|
||||
goto L9013; }
|
||||
/* --> For the parameters of discretisation (NBROOT+2 extremities). */
|
||||
@ -6666,7 +6669,7 @@ L9100:
|
||||
|
||||
L9900:
|
||||
if (iofwr != 0) {
|
||||
AdvApp2Var_SysBase::mcrdelt_(&c__8, &ndwrk, wrkar, &iofwr, &ier);
|
||||
anAdvApp2Var_SysBase.mcrdelt_(&c__8, &ndwrk, wrkar, &iofwr, &ier);
|
||||
}
|
||||
if (ier > 0) {
|
||||
*iercod = 13;
|
||||
@ -6715,9 +6718,9 @@ int AdvApp2Var_ApproxF2var::mma2fx6_(integer *ncfmxu,
|
||||
doublereal d__1, d__2;
|
||||
|
||||
/* Local variables */
|
||||
static integer idim, ncfu, ncfv, id, ii, nd, jj, ku, kv, ns, ibb;
|
||||
static doublereal bid;
|
||||
static doublereal tol;
|
||||
integer idim, ncfu, ncfv, id, ii, nd, jj, ku, kv, ns, ibb;
|
||||
doublereal bid;
|
||||
doublereal tol;
|
||||
|
||||
/* **********************************************************************
|
||||
*/
|
||||
@ -7146,9 +7149,9 @@ int AdvApp2Var_ApproxF2var::mma2jmx_(integer *ndgjac,
|
||||
integer i__1;
|
||||
|
||||
/* Local variables */
|
||||
static logical ldbg;
|
||||
static integer numax, ii;
|
||||
static doublereal bid;
|
||||
logical ldbg;
|
||||
integer numax, ii;
|
||||
doublereal bid;
|
||||
|
||||
|
||||
/* **********************************************************************
|
||||
@ -7250,9 +7253,9 @@ int mma2moy_(integer *ndgumx,
|
||||
integer patjac_dim1, patjac_dim2, patjac_offset, i__1, i__2, i__3;
|
||||
|
||||
/* Local variables */
|
||||
static logical ldbg;
|
||||
static integer minu, minv, idebu, idebv, ii, nd, jj;
|
||||
static doublereal bid0, bid1;
|
||||
logical ldbg;
|
||||
integer minu, minv, idebu, idebv, ii, nd, jj;
|
||||
doublereal bid0, bid1;
|
||||
|
||||
|
||||
/* **********************************************************************
|
||||
@ -7397,7 +7400,7 @@ int AdvApp2Var_ApproxF2var::mma2roo_(integer *nbpntu,
|
||||
integer i__1;
|
||||
|
||||
/* Local variables */
|
||||
static integer ii, ibb;
|
||||
integer ii, ibb;
|
||||
|
||||
/* **********************************************************************
|
||||
*/
|
||||
@ -7503,9 +7506,9 @@ int mmmapcoe_(integer *ndim,
|
||||
crvjac_dim1, crvjac_offset, gsstab_dim1, i__1, i__2, i__3;
|
||||
|
||||
/* Local variables */
|
||||
static integer igss, ikdeb;
|
||||
static doublereal bidon;
|
||||
static integer nd, ik, ir, nbroot, ibb;
|
||||
integer igss, ikdeb;
|
||||
doublereal bidon;
|
||||
integer nd, ik, ir, nbroot, ibb;
|
||||
|
||||
/* **********************************************************************
|
||||
*/
|
||||
@ -7664,9 +7667,9 @@ int mmaperm_(integer *ncofmx,
|
||||
integer crvjac_dim1, crvjac_offset, i__1, i__2;
|
||||
|
||||
/* Local variables */
|
||||
static doublereal bidj;
|
||||
static integer i__, ia, nd, ncfcut, ibb;
|
||||
static doublereal bid;
|
||||
doublereal bidj;
|
||||
integer i__, ia, nd, ncfcut, ibb;
|
||||
doublereal bid;
|
||||
|
||||
/* **********************************************************************
|
||||
*/
|
||||
@ -7773,7 +7776,7 @@ int AdvApp2Var_ApproxF2var::mmapptt_(const integer *ndgjac,
|
||||
integer cgauss_dim1, i__1;
|
||||
|
||||
/* Local variables */
|
||||
static integer kjac, iptt, ipdb0, infdg, iptdb, mxjac, ilong, ibb;
|
||||
integer kjac, iptt, ipdb0, infdg, iptdb, mxjac, ilong, ibb;
|
||||
|
||||
/* **********************************************************************
|
||||
*/
|
||||
@ -8077,7 +8080,7 @@ int mmjacpt_(const integer *ndimen,
|
||||
ptcaux_offset, i__1, i__2, i__3;
|
||||
|
||||
/* Local variables */
|
||||
static integer kdim, nd, ii, jj, ibb;
|
||||
integer kdim, nd, ii, jj, ibb;
|
||||
|
||||
/* ***********************************************************************
|
||||
*/
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -16,6 +16,7 @@
|
||||
// and conditions governing the rights and limitations under the License.
|
||||
|
||||
// AdvApp2Var_SysBase.cxx
|
||||
#include <assert.h>
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@ -34,9 +35,6 @@ int __s__cmp();
|
||||
static
|
||||
int macrbrk_();
|
||||
|
||||
static
|
||||
int macrchk_();
|
||||
|
||||
static
|
||||
int macrclw_(intptr_t *iadfld,
|
||||
intptr_t *iadflf,
|
||||
@ -121,24 +119,11 @@ int mcrgetv_(integer *sz,
|
||||
void* *iad,
|
||||
integer *ier);
|
||||
|
||||
static
|
||||
int mcrlist_(integer *ier);
|
||||
|
||||
static
|
||||
int mcrlocv_(void* t,
|
||||
intptr_t *l);
|
||||
|
||||
|
||||
/* Structures */
|
||||
static struct {
|
||||
intptr_t icore[12000];
|
||||
integer ncore, lprot;
|
||||
} mcrgene_;
|
||||
|
||||
static struct {
|
||||
integer nrqst[2], ndelt[2], nbyte[2], mbyte[2];
|
||||
} mcrstac_;
|
||||
|
||||
static struct {
|
||||
integer lec, imp, keyb, mae, jscrn, itblt, ibb;
|
||||
} mblank__;
|
||||
@ -146,6 +131,25 @@ static struct {
|
||||
#define mcrfill_ABS(a) (((a)<0)?(-(a)):(a))
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : AdvApp2Var_SysBase
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
AdvApp2Var_SysBase::AdvApp2Var_SysBase()
|
||||
{
|
||||
mainial_();
|
||||
memset (&mcrstac_, 0, sizeof (mcrstac_));
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ~AdvApp2Var_SysBase
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
AdvApp2Var_SysBase::~AdvApp2Var_SysBase()
|
||||
{
|
||||
assert (mcrgene_.ncore == 0); //otherwise memory leaking
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : macinit_
|
||||
//purpose :
|
||||
@ -156,7 +160,7 @@ int AdvApp2Var_SysBase::macinit_(integer *imode,
|
||||
{
|
||||
|
||||
/* Fortran I/O blocks */
|
||||
static cilist io______1 = { 0, 0, 0, (char*) "(' --- Debug-mode : ',I10,' ---')", 0 };
|
||||
cilist io______1 = { 0, 0, 0, (char*) "(' --- Debug-mode : ',I10,' ---')", 0 };
|
||||
|
||||
/* ************************************************************************/
|
||||
/* FUNCTION : */
|
||||
@ -292,14 +296,12 @@ int AdvApp2Var_SysBase::macrai4_(integer *nbelem,
|
||||
*/
|
||||
|
||||
integer iunit;
|
||||
/* Parameter adjustments */
|
||||
--itablo;
|
||||
|
||||
|
||||
iunit = sizeof(integer);
|
||||
/* Function Body */
|
||||
if (*nbelem > *maxelm) {
|
||||
AdvApp2Var_SysBase::mcrrqst_(&iunit, nbelem, &itablo[1], iofset, iercod);
|
||||
/*AdvApp2Var_SysBase::*/mcrrqst_(&iunit, nbelem, itablo, iofset, iercod);
|
||||
} else {
|
||||
*iercod = 0;
|
||||
*iofset = 0;
|
||||
@ -318,7 +320,7 @@ int AdvApp2Var_SysBase::macrar8_(integer *nbelem,
|
||||
integer *iercod)
|
||||
|
||||
{
|
||||
static integer c__8 = 8;
|
||||
integer c__8 = 8;
|
||||
|
||||
/* ***********************************************************************
|
||||
*/
|
||||
@ -366,12 +368,9 @@ int AdvApp2Var_SysBase::macrar8_(integer *nbelem,
|
||||
*/
|
||||
|
||||
|
||||
/* Parameter adjustments */
|
||||
--xtablo;
|
||||
|
||||
/* Function Body */
|
||||
if (*nbelem > *maxelm) {
|
||||
AdvApp2Var_SysBase::mcrrqst_(&c__8, nbelem, &xtablo[1], iofset, iercod);
|
||||
/*AdvApp2Var_SysBase::*/mcrrqst_(&c__8, nbelem, xtablo, iofset, iercod);
|
||||
} else {
|
||||
*iercod = 0;
|
||||
*iofset = 0;
|
||||
@ -392,16 +391,16 @@ int macrbrk_()
|
||||
//function : macrchk_
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
int macrchk_()
|
||||
int AdvApp2Var_SysBase::macrchk_()
|
||||
{
|
||||
/* System generated locals */
|
||||
integer i__1;
|
||||
|
||||
/* Local variables */
|
||||
static integer i__, j;
|
||||
static intptr_t ioff;
|
||||
static doublereal t[1];
|
||||
static intptr_t loc;
|
||||
integer i__, j;
|
||||
intptr_t ioff;
|
||||
doublereal* t = 0;
|
||||
intptr_t loc;
|
||||
|
||||
/* ***********************************************************************
|
||||
*/
|
||||
@ -489,27 +488,28 @@ int macrchk_()
|
||||
mcrlocv_(t, &loc);
|
||||
/* CONTROL OF FLAGS IN THE TABLE */
|
||||
i__1 = mcrgene_.ncore;
|
||||
for (i__ = 1; i__ <= i__1; ++i__) {
|
||||
|
||||
for (j = 10; j <= 11; ++j) {
|
||||
|
||||
if (mcrgene_.icore[j + i__ * 12 - 13] != -1) {
|
||||
for (i__ = 0; i__ < i__1; ++i__) {
|
||||
|
||||
//p to access startaddr and endaddr
|
||||
intptr_t* p = &mcrgene_.icore[i__].startaddr;
|
||||
for (j = 0; j <= 1; ++j) {
|
||||
intptr_t* pp = p + j;
|
||||
if (*pp != -1) {
|
||||
|
||||
ioff = (mcrgene_.icore[j + i__ * 12 - 13] - loc) / 8;
|
||||
ioff = (*pp - loc) / 8;
|
||||
|
||||
if (t[ioff] != -134744073.) {
|
||||
|
||||
/* MSG : '*** ERREUR : REMOVAL FROM MEMORY OF ADDRESS
|
||||
E:',ICORE(J,I) */
|
||||
/* AND OF RANK ICORE(12,I) */
|
||||
macrerr_(&mcrgene_.icore[j + i__ * 12 - 13],
|
||||
&mcrgene_.icore[i__ * 12 - 1]);
|
||||
macrerr_(pp, p + 2);
|
||||
|
||||
/* BACK-PARCING IN PHASE OF PRODUCTION */
|
||||
maostrb_();
|
||||
|
||||
/* REMOVAL OF THE ADDRESS OF FLAG TO AVOID REMAKING ITS CONTROL */
|
||||
mcrgene_.icore[j + i__ * 12 - 13] = -1;
|
||||
*pp = -1;
|
||||
|
||||
}
|
||||
|
||||
@ -587,14 +587,12 @@ int AdvApp2Var_SysBase::macrdi4_(integer *nbelem,
|
||||
*/
|
||||
integer iunit;
|
||||
|
||||
/* Parameter adjustments */
|
||||
--itablo;
|
||||
iunit = sizeof(integer);
|
||||
/* Function Body */
|
||||
if (*iofset != 0) {
|
||||
AdvApp2Var_SysBase::mcrdelt_(&iunit,
|
||||
nbelem,
|
||||
&itablo[1],
|
||||
itablo,
|
||||
iofset,
|
||||
iercod);
|
||||
} else {
|
||||
@ -614,7 +612,7 @@ int AdvApp2Var_SysBase::macrdr8_(integer *nbelem,
|
||||
integer *iercod)
|
||||
|
||||
{
|
||||
static integer c__8 = 8;
|
||||
integer c__8 = 8;
|
||||
|
||||
/* ***********************************************************************
|
||||
*/
|
||||
@ -657,13 +655,9 @@ int AdvApp2Var_SysBase::macrdr8_(integer *nbelem,
|
||||
/* ***********************************************************************
|
||||
*/
|
||||
|
||||
|
||||
/* Parameter adjustments */
|
||||
--xtablo;
|
||||
|
||||
/* Function Body */
|
||||
if (*iofset != 0) {
|
||||
AdvApp2Var_SysBase::mcrdelt_(&c__8, nbelem, &xtablo[1], iofset, iercod);
|
||||
AdvApp2Var_SysBase::mcrdelt_(&c__8, nbelem, xtablo, iofset, iercod);
|
||||
} else {
|
||||
*iercod = 0;
|
||||
}
|
||||
@ -678,12 +672,12 @@ int macrerr_(intptr_t *,//iad,
|
||||
intptr_t *)//nalloc)
|
||||
|
||||
{
|
||||
//static integer c__1 = 1;
|
||||
//integer c__1 = 1;
|
||||
/* Builtin functions */
|
||||
//integer /*s__wsfe(),*/ /*do__fio(),*/ e__wsfe();
|
||||
|
||||
/* Fortran I/O blocks */
|
||||
//static cilist io___1 = { 0, 6, 0, "(X,A,I9,A,I3)", 0 };
|
||||
//cilist io___1 = { 0, 6, 0, "(X,A,I9,A,I3)", 0 };
|
||||
|
||||
/* ***********************************************************************
|
||||
*/
|
||||
@ -743,13 +737,18 @@ int macrgfl_(intptr_t *iadfld,
|
||||
{
|
||||
/* Initialized data */
|
||||
|
||||
static integer ifois = 0;
|
||||
/* original code used static integer ifois=0 which served as static
|
||||
initialization flag and was only used to call matrsym_() once; now
|
||||
this flag is not used as matrsym_() always returns 0 and has no
|
||||
useful contents
|
||||
*/
|
||||
integer ifois = 1;
|
||||
|
||||
static char cbid[1];
|
||||
static integer ibid, ienr;
|
||||
static doublereal t[1];
|
||||
static integer novfl;
|
||||
static intptr_t ioff,iadrfl, iadt;
|
||||
char cbid[1];
|
||||
integer ibid, ienr;
|
||||
doublereal* t = 0;
|
||||
integer novfl;
|
||||
intptr_t ioff,iadrfl, iadt;
|
||||
|
||||
|
||||
/* ***********************************************************************
|
||||
@ -889,13 +888,13 @@ int macrmsg_(const char *,//crout,
|
||||
{
|
||||
|
||||
/* Local variables */
|
||||
static integer inum, iunite;
|
||||
static char cfm[80], cln[3];
|
||||
integer inum, iunite;
|
||||
char cfm[80], cln[3];
|
||||
|
||||
/* Fortran I/O blocks */
|
||||
static cilist io___5 = { 0, 0, 0, cfm, 0 };
|
||||
static cilist io___6 = { 0, 0, 0, cfm, 0 };
|
||||
static cilist io___7 = { 0, 0, 0, cfm, 0 };
|
||||
cilist io___5 = { 0, 0, 0, cfm, 0 };
|
||||
cilist io___6 = { 0, 0, 0, cfm, 0 };
|
||||
cilist io___7 = { 0, 0, 0, cfm, 0 };
|
||||
|
||||
|
||||
/* ***********************************************************************
|
||||
@ -1211,8 +1210,8 @@ int magtlog_(const char *cnmlog,
|
||||
{
|
||||
|
||||
/* Local variables */
|
||||
static char cbid[255];
|
||||
static integer ibid, ier;
|
||||
char cbid[255];
|
||||
integer ibid, ier;
|
||||
|
||||
|
||||
/* **********************************************************************
|
||||
@ -1342,6 +1341,7 @@ int magtlog_(const char *cnmlog,
|
||||
int AdvApp2Var_SysBase::mainial_()
|
||||
{
|
||||
mcrgene_.ncore = 0;
|
||||
mcrgene_.lprot = 0;
|
||||
return 0 ;
|
||||
} /* mainial_ */
|
||||
|
||||
@ -1354,11 +1354,11 @@ int AdvApp2Var_SysBase::maitbr8_(integer *itaill,
|
||||
doublereal *xval)
|
||||
|
||||
{
|
||||
static integer c__504 = 504;
|
||||
integer c__504 = 504;
|
||||
|
||||
/* Initialized data */
|
||||
|
||||
static doublereal buff0[63] = {
|
||||
doublereal buff0[63] = {
|
||||
0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,
|
||||
0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,
|
||||
0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,
|
||||
@ -1369,9 +1369,9 @@ int AdvApp2Var_SysBase::maitbr8_(integer *itaill,
|
||||
integer i__1;
|
||||
|
||||
/* Local variables */
|
||||
static integer i__;
|
||||
static doublereal buffx[63];
|
||||
static integer nbfois, noffst, nreste, nufois;
|
||||
integer i__;
|
||||
doublereal buffx[63];
|
||||
integer nbfois, noffst, nreste, nufois;
|
||||
|
||||
/* ***********************************************************************
|
||||
*/
|
||||
@ -1611,7 +1611,7 @@ int maostrb_()
|
||||
//=======================================================================
|
||||
int maostrd_()
|
||||
{
|
||||
static integer imod;
|
||||
integer imod;
|
||||
|
||||
/* ***********************************************************************
|
||||
*/
|
||||
@ -1671,15 +1671,15 @@ int maoverf_(integer *nbentr,
|
||||
{
|
||||
/* Initialized data */
|
||||
|
||||
static integer ifois = 0;
|
||||
integer ifois = 0;
|
||||
|
||||
/* System generated locals */
|
||||
integer i__1;
|
||||
|
||||
/* Local variables */
|
||||
static integer ibid;
|
||||
static doublereal buff[63];
|
||||
static integer ioct, indic, nrest, icompt;
|
||||
integer ibid;
|
||||
doublereal buff[63];
|
||||
integer ioct, indic, nrest, icompt;
|
||||
|
||||
/* ***********************************************************************
|
||||
*/
|
||||
@ -1910,7 +1910,7 @@ int matrsym_(const char *cnmsym,
|
||||
|
||||
{
|
||||
/* Local variables */
|
||||
static char chainx[255];
|
||||
char chainx[255];
|
||||
|
||||
/* ***********************************************************************
|
||||
*/
|
||||
@ -1999,17 +1999,17 @@ int mcrcomm_(integer *kop,
|
||||
{
|
||||
/* Initialized data */
|
||||
|
||||
static integer ntab = 0;
|
||||
integer ntab = 0;
|
||||
|
||||
/* System generated locals */
|
||||
integer i__1, i__2;
|
||||
|
||||
/* Local variables */
|
||||
static intptr_t ideb;
|
||||
static doublereal dtab[32000];
|
||||
static intptr_t itab[160] /* was [4][40] */;
|
||||
static intptr_t ipre;
|
||||
static integer i__, j, k;
|
||||
intptr_t ideb;
|
||||
doublereal dtab[32000];
|
||||
intptr_t itab[160] /* was [4][40] */;
|
||||
intptr_t ipre;
|
||||
integer i__, j, k;
|
||||
|
||||
|
||||
/************************************************************************
|
||||
@ -2177,12 +2177,12 @@ int AdvApp2Var_SysBase::mcrdelt_(integer *iunit,
|
||||
integer *iercod)
|
||||
|
||||
{
|
||||
static integer ibid;
|
||||
static doublereal xbid;
|
||||
static integer noct, iver, ksys, i__, n, nrang,
|
||||
integer ibid;
|
||||
doublereal xbid;
|
||||
integer noct, iver, ksys, i__, n, nrang,
|
||||
ibyte, ier;
|
||||
static intptr_t iadfd, iadff, iaddr, loc; /* Les adrresses en long*/
|
||||
static integer kop;
|
||||
intptr_t iadfd, iadff, iaddr, loc; /* Les adrresses en long*/
|
||||
integer kop;
|
||||
|
||||
/* ***********************************************************************
|
||||
*/
|
||||
@ -2310,13 +2310,13 @@ int AdvApp2Var_SysBase::mcrdelt_(integer *iunit,
|
||||
|
||||
/* SEARCH IN MCRGENE */
|
||||
|
||||
n = 0;
|
||||
n = -1;
|
||||
mcrlocv_(t, &loc);
|
||||
|
||||
for (i__ = mcrgene_.ncore; i__ >= 1; --i__) {
|
||||
if (*iunit == mcrgene_.icore[i__ * 12 - 11] && *isize ==
|
||||
mcrgene_.icore[i__ * 12 - 10] && loc == mcrgene_.icore[i__ *
|
||||
12 - 9] && *iofset == mcrgene_.icore[i__ * 12 - 8]) {
|
||||
for (i__ = mcrgene_.ncore - 1; i__ >= 0; --i__) {
|
||||
if (*iunit == mcrgene_.icore[i__].unit && *isize ==
|
||||
mcrgene_.icore[i__].reqsize && loc == mcrgene_.icore[i__].loc
|
||||
&& *iofset == mcrgene_.icore[i__].offset) {
|
||||
n = i__;
|
||||
goto L1100;
|
||||
}
|
||||
@ -2326,18 +2326,18 @@ L1100:
|
||||
|
||||
/* IF THE ALLOCATION DOES NOT EXIST, LEAVE */
|
||||
|
||||
if (n <= 0) {
|
||||
if (n < 0) {
|
||||
goto L9003;
|
||||
}
|
||||
|
||||
/* ALLOCATION RECOGNIZED : RETURN OTHER INFOS */
|
||||
|
||||
ksys = static_cast<integer> (mcrgene_.icore[n * 12 - 7]);
|
||||
ibyte = static_cast<integer> (mcrgene_.icore[n * 12 - 6]);
|
||||
iaddr = mcrgene_.icore[n * 12 - 5];
|
||||
iadfd = mcrgene_.icore[n * 12 - 3];
|
||||
iadff = mcrgene_.icore[n * 12 - 2];
|
||||
nrang = static_cast<integer> (mcrgene_.icore[n * 12 - 1]);
|
||||
ksys = mcrgene_.icore[n].alloctype;
|
||||
ibyte = mcrgene_.icore[n].size;
|
||||
iaddr = mcrgene_.icore[n].addr;
|
||||
iadfd = mcrgene_.icore[n].startaddr;
|
||||
iadff = mcrgene_.icore[n].endaddr;
|
||||
nrang = mcrgene_.icore[n].rank;
|
||||
|
||||
/* Control of flags */
|
||||
|
||||
@ -2346,7 +2346,7 @@ L1100:
|
||||
macrchk_();
|
||||
}
|
||||
|
||||
if (ksys <= 1) {
|
||||
if (ksys == static_allocation) {
|
||||
/* DE-ALLOCATION ON COMMON */
|
||||
kop = 2;
|
||||
mcrcomm_(&kop, &ibyte, &iaddr, &ier);
|
||||
@ -2366,22 +2366,16 @@ L1100:
|
||||
macrclw_(&iadfd, &iadff, &nrang);
|
||||
|
||||
/* UPDATE OF STATISTICS */
|
||||
if (ksys <= 1) {
|
||||
i__ = 1;
|
||||
} else {
|
||||
i__ = 2;
|
||||
}
|
||||
++mcrstac_.ndelt[i__ - 1];
|
||||
mcrstac_.nbyte[i__ - 1] -= static_cast<integer> (mcrgene_.icore[n * 12 - 11] *
|
||||
mcrgene_.icore[n * 12 - 10]);
|
||||
++mcrstac_.ndelt[ksys];
|
||||
mcrstac_.nbyte[ksys] -= mcrgene_.icore[n].unit *
|
||||
mcrgene_.icore[n].reqsize;
|
||||
|
||||
/* REMOVAL OF PARAMETERS IN MCRGENE */
|
||||
if (n < 1000) {
|
||||
/* noct = (mcrgene_1.ncore - n) * 48; */
|
||||
noct = (mcrgene_.ncore - n) * 12 * sizeof(mcrgene_.icore[0]);
|
||||
if (n < MAX_ALLOC_NB - 1) {
|
||||
noct = (mcrgene_.ncore - (n + 1)) * sizeof(mcrgene_.icore[0]);
|
||||
AdvApp2Var_SysBase::mcrfill_(&noct,
|
||||
&mcrgene_.icore[(n + 1) * 12 - 12],
|
||||
&mcrgene_.icore[n * 12 - 12]);
|
||||
&mcrgene_.icore[n + 1],
|
||||
&mcrgene_.icore[n]);
|
||||
}
|
||||
--mcrgene_.ncore;
|
||||
|
||||
@ -2579,7 +2573,7 @@ int mcrgetv_(integer *sz,
|
||||
//function : mcrlist_
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
int mcrlist_(integer *ier)
|
||||
int AdvApp2Var_SysBase::mcrlist_(integer *ier) const
|
||||
|
||||
{
|
||||
/* System generated locals */
|
||||
@ -2588,10 +2582,10 @@ int mcrlist_(integer *ier)
|
||||
/* Builtin functions */
|
||||
|
||||
/* Local variables */
|
||||
static char cfmt[1];
|
||||
static doublereal dfmt;
|
||||
static integer ifmt, i__, nufmt, ntotal;
|
||||
static char subrou[7];
|
||||
char cfmt[1];
|
||||
doublereal dfmt;
|
||||
integer ifmt, i__, nufmt, ntotal;
|
||||
char subrou[7];
|
||||
|
||||
|
||||
/************************************************************************
|
||||
@ -2703,9 +2697,9 @@ int mcrlist_(integer *ier)
|
||||
ntotal = 0;
|
||||
|
||||
i__1 = mcrgene_.ncore;
|
||||
for (i__ = 1; i__ <= i__1; ++i__) {
|
||||
for (i__ = 0; i__ < i__1; ++i__) {
|
||||
nufmt = 2;
|
||||
ifmt = static_cast<integer> (mcrgene_.icore[i__ * 12 - 11] * mcrgene_.icore[i__ * 12 - 10])
|
||||
ifmt = mcrgene_.icore[i__].unit * mcrgene_.icore[i__].reqsize
|
||||
;
|
||||
macrmsg_(subrou, &nufmt, &ifmt, &dfmt, cfmt, 7L, 1L);
|
||||
ntotal += ifmt;
|
||||
@ -2747,12 +2741,12 @@ int AdvApp2Var_SysBase::mcrrqst_(integer *iunit,
|
||||
integer i__1, i__2;
|
||||
|
||||
/* Local variables */
|
||||
static doublereal dfmt;
|
||||
static integer ifmt, iver;
|
||||
static char subr[7];
|
||||
static integer ksys , ibyte, irest, isyst, ier;
|
||||
static intptr_t iadfd, iadff, iaddr,lofset, loc;
|
||||
static integer izu;
|
||||
doublereal dfmt;
|
||||
integer ifmt, iver;
|
||||
char subr[7];
|
||||
integer ksys , ibyte, irest, isyst, ier;
|
||||
intptr_t iadfd, iadff, iaddr,lofset, loc;
|
||||
integer izu;
|
||||
|
||||
|
||||
/* **********************************************************************
|
||||
@ -2904,7 +2898,7 @@ int AdvApp2Var_SysBase::mcrrqst_(integer *iunit,
|
||||
/* Function Body */
|
||||
*iercod = 0;
|
||||
|
||||
if (mcrgene_.ncore >= 1000) {
|
||||
if (mcrgene_.ncore >= MAX_ALLOC_NB) {
|
||||
goto L9001;
|
||||
}
|
||||
if (*iunit != 1 && *iunit != 2 && *iunit != 4 && *iunit != 8) {
|
||||
@ -2972,7 +2966,7 @@ int AdvApp2Var_SysBase::mcrrqst_(integer *iunit,
|
||||
/* ENDIF */
|
||||
/* ELSE */
|
||||
/* ALLOCATION SYSTEME */
|
||||
ksys = 2;
|
||||
ksys = heap_allocation;
|
||||
mcrgetv_(&ibyte, reinterpret_cast<void**> (&iaddr), &ier);
|
||||
if (ier != 0) {
|
||||
goto L9003;
|
||||
@ -3004,19 +2998,19 @@ int AdvApp2Var_SysBase::mcrrqst_(integer *iunit,
|
||||
|
||||
/* RANGING OF PARAMETERS IN MCRGENE */
|
||||
|
||||
mcrgene_.icore[mcrgene_.ncore].prot = mcrgene_.lprot;
|
||||
mcrgene_.icore[mcrgene_.ncore].unit = *iunit;
|
||||
mcrgene_.icore[mcrgene_.ncore].reqsize = *isize;
|
||||
mcrgene_.icore[mcrgene_.ncore].loc = loc;
|
||||
mcrgene_.icore[mcrgene_.ncore].offset = *iofset;
|
||||
mcrgene_.icore[mcrgene_.ncore].alloctype = ksys;
|
||||
mcrgene_.icore[mcrgene_.ncore].size = ibyte;
|
||||
mcrgene_.icore[mcrgene_.ncore].addr = iaddr;
|
||||
mcrgene_.icore[mcrgene_.ncore].userzone = mcrgene_.ncore;
|
||||
mcrgene_.icore[mcrgene_.ncore].startaddr = iadfd;
|
||||
mcrgene_.icore[mcrgene_.ncore].endaddr = iadff;
|
||||
mcrgene_.icore[mcrgene_.ncore].rank = mcrgene_.ncore + 1;
|
||||
++mcrgene_.ncore;
|
||||
mcrgene_.icore[mcrgene_.ncore * 12 - 12] = mcrgene_.lprot;
|
||||
mcrgene_.icore[mcrgene_.ncore * 12 - 11] = *iunit;
|
||||
mcrgene_.icore[mcrgene_.ncore * 12 - 10] = *isize;
|
||||
mcrgene_.icore[mcrgene_.ncore * 12 - 9] = loc;
|
||||
mcrgene_.icore[mcrgene_.ncore * 12 - 8] = *iofset;
|
||||
mcrgene_.icore[mcrgene_.ncore * 12 - 7] = ksys;
|
||||
mcrgene_.icore[mcrgene_.ncore * 12 - 6] = ibyte;
|
||||
mcrgene_.icore[mcrgene_.ncore * 12 - 5] = iaddr;
|
||||
mcrgene_.icore[mcrgene_.ncore * 12 - 4] = mcrgene_.ncore;
|
||||
mcrgene_.icore[mcrgene_.ncore * 12 - 3] = iadfd;
|
||||
mcrgene_.icore[mcrgene_.ncore * 12 - 2] = iadff;
|
||||
mcrgene_.icore[mcrgene_.ncore * 12 - 1] = mcrgene_.ncore;
|
||||
|
||||
mcrgene_.lprot = 0;
|
||||
|
||||
@ -3026,12 +3020,12 @@ int AdvApp2Var_SysBase::mcrrqst_(integer *iunit,
|
||||
|
||||
/* STATISTICS */
|
||||
|
||||
++mcrstac_.nrqst[ksys - 1];
|
||||
mcrstac_.nbyte[ksys - 1] += static_cast<integer> (mcrgene_.icore[mcrgene_.ncore * 12 - 11] *
|
||||
mcrgene_.icore[mcrgene_.ncore * 12 - 10]);
|
||||
++mcrstac_.nrqst[ksys];
|
||||
mcrstac_.nbyte[ksys] += mcrgene_.icore[mcrgene_.ncore - 1].unit *
|
||||
mcrgene_.icore[mcrgene_.ncore - 1].reqsize;
|
||||
/* Computing MAX */
|
||||
i__1 = mcrstac_.mbyte[ksys - 1], i__2 = mcrstac_.nbyte[ksys - 1];
|
||||
mcrstac_.mbyte[ksys - 1] = advapp_max(i__1,i__2);
|
||||
i__1 = mcrstac_.mbyte[ksys], i__2 = mcrstac_.nbyte[ksys];
|
||||
mcrstac_.mbyte[ksys] = advapp_max(i__1,i__2);
|
||||
|
||||
goto L9900;
|
||||
|
||||
@ -3042,7 +3036,7 @@ int AdvApp2Var_SysBase::mcrrqst_(integer *iunit,
|
||||
/* MAX NB OF ALLOC REACHED : */
|
||||
L9001:
|
||||
*iercod = 1;
|
||||
ifmt = 1000;
|
||||
ifmt = MAX_ALLOC_NB;
|
||||
//__s__copy(subr, "MCRRQST", 7L, 7L);
|
||||
macrmsg_(subr, iercod, &ifmt, &dfmt, " ", 7L, 1L);
|
||||
maostrd_();
|
||||
@ -3175,7 +3169,7 @@ int AdvApp2Var_SysBase::msifill_(integer *nbintg,
|
||||
integer *ivecin,
|
||||
integer *ivecou)
|
||||
{
|
||||
static integer nocte;
|
||||
integer nocte;
|
||||
|
||||
/* ***********************************************************************
|
||||
*/
|
||||
@ -3230,7 +3224,7 @@ int AdvApp2Var_SysBase::msrfill_(integer *nbreel,
|
||||
doublereal *vecent,
|
||||
doublereal * vecsor)
|
||||
{
|
||||
static integer nocte;
|
||||
integer nocte;
|
||||
|
||||
|
||||
/* ***********************************************************************
|
||||
@ -3287,7 +3281,7 @@ int AdvApp2Var_SysBase::mswrdbg_(const char *,//ctexte,
|
||||
|
||||
{
|
||||
|
||||
static cilist io___1 = { 0, 0, 0, 0, 0 };
|
||||
cilist io___1 = { 0, 0, 0, 0, 0 };
|
||||
|
||||
|
||||
/* ***********************************************************************
|
||||
|
@ -28,14 +28,17 @@
|
||||
#endif
|
||||
|
||||
class AdvApp2Var_SysBase {
|
||||
public:
|
||||
public:
|
||||
Standard_EXPORT AdvApp2Var_SysBase();
|
||||
Standard_EXPORT ~AdvApp2Var_SysBase();
|
||||
|
||||
//
|
||||
Standard_EXPORT static int mainial_();
|
||||
Standard_EXPORT int mainial_();
|
||||
|
||||
Standard_EXPORT static int macinit_(int *,
|
||||
int *);
|
||||
//
|
||||
Standard_EXPORT static int mcrdelt_(integer *iunit,
|
||||
Standard_EXPORT int mcrdelt_(integer *iunit,
|
||||
integer *isize,
|
||||
void *t,
|
||||
intptr_t *iofset,
|
||||
@ -45,7 +48,7 @@ class AdvApp2Var_SysBase {
|
||||
void *tin,
|
||||
void *tout);
|
||||
|
||||
Standard_EXPORT static int mcrrqst_(integer *iunit,
|
||||
Standard_EXPORT int mcrrqst_(integer *iunit,
|
||||
integer *isize,
|
||||
void *t,
|
||||
intptr_t *iofset,
|
||||
@ -59,23 +62,23 @@ class AdvApp2Var_SysBase {
|
||||
Standard_EXPORT static int e__wsle ();
|
||||
Standard_EXPORT static int s__wsfe ();
|
||||
Standard_EXPORT static int s__wsle ();
|
||||
Standard_EXPORT static int macrai4_(integer *nbelem,
|
||||
Standard_EXPORT int macrai4_(integer *nbelem,
|
||||
integer *maxelm,
|
||||
integer *itablo,
|
||||
intptr_t *iofset,
|
||||
integer *iercod);
|
||||
Standard_EXPORT static int macrar8_(integer *nbelem,
|
||||
Standard_EXPORT int macrar8_(integer *nbelem,
|
||||
integer *maxelm,
|
||||
doublereal *xtablo,
|
||||
intptr_t *iofset,
|
||||
integer *iercod);
|
||||
Standard_EXPORT static int macrdi4_(integer *nbelem,
|
||||
Standard_EXPORT int macrdi4_(integer *nbelem,
|
||||
integer *maxelm,
|
||||
integer *itablo,
|
||||
intptr_t *iofset,
|
||||
integer *iercod);
|
||||
|
||||
Standard_EXPORT static int macrdr8_(integer *nbelem,
|
||||
Standard_EXPORT int macrdr8_(integer *nbelem,
|
||||
integer *maxelm,
|
||||
doublereal *xtablo,
|
||||
intptr_t *iofset,
|
||||
@ -105,6 +108,64 @@ class AdvApp2Var_SysBase {
|
||||
Standard_EXPORT static void mvriraz_(integer *taille,
|
||||
void*adt);
|
||||
|
||||
private:
|
||||
int macrchk_();
|
||||
int mcrlist_(integer *ier) const;
|
||||
|
||||
/* Maximum number of allowed allocation requests.
|
||||
Currently the maximum known number of requests is 7 - see
|
||||
AdvApp2Var_MathBase::mmresol_(). So the current value is a safe margin and
|
||||
a reasonable balance to not provoke stack overflow (especially in
|
||||
multi-threaded execution). Previous number of 1000 was excessive but
|
||||
tolerable when used for static memory.
|
||||
*/
|
||||
static const int MAX_ALLOC_NB = 32;
|
||||
|
||||
enum {
|
||||
static_allocation = 0, /* indicates static allocation, currently not used */
|
||||
heap_allocation = 1 /* indicates heap allocation */
|
||||
};
|
||||
|
||||
/* Describes an individual memory allocation request.
|
||||
See format description in the AdvApp2Var_SysBase.cxx.
|
||||
The field order is preserved and the sizes are chosen to minimize
|
||||
memory footprint. Fields containing address have the intptr_t type
|
||||
for easier arithmetic and to avoid casts in the source code.
|
||||
|
||||
No initialization constructor should be provided to avoid wasting
|
||||
time when allocating a field mcrgene_.
|
||||
*/
|
||||
struct mitem {
|
||||
unsigned char prot;
|
||||
unsigned char unit; //unit of allocation: 1, 2, 4 or 8
|
||||
integer reqsize;
|
||||
intptr_t loc;
|
||||
intptr_t offset;
|
||||
unsigned char alloctype; // static_allocation or heap_allocation
|
||||
integer size;
|
||||
intptr_t addr;
|
||||
integer userzone; //not used
|
||||
intptr_t startaddr;
|
||||
intptr_t endaddr;
|
||||
integer rank;
|
||||
};
|
||||
|
||||
struct {
|
||||
mitem icore[MAX_ALLOC_NB];
|
||||
integer ncore;
|
||||
unsigned char lprot;
|
||||
} mcrgene_;
|
||||
|
||||
/* Contains statistics on allocation requests.
|
||||
Index 0 corresponds to static_allocation, 1 - to heap allocation.
|
||||
nrqst - number of allocation requests;
|
||||
ndelt - number of deallocation requests;
|
||||
nbyte - current number of allocated bytes;
|
||||
mbyte - maximum number of ever allocated bytes.
|
||||
*/
|
||||
struct {
|
||||
integer nrqst[2], ndelt[2], nbyte[2], mbyte[2];
|
||||
} mcrstac_;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -25,8 +25,11 @@
|
||||
static int init_STBAS(void)
|
||||
{
|
||||
int ICODE = 0;
|
||||
//allocation tables are now local, so no global initialization is required
|
||||
#if 0
|
||||
// Init du Tableau des allocs
|
||||
AdvApp2Var_SysBase::mainial_();
|
||||
#endif
|
||||
// Init de LEC IBB IMP
|
||||
AdvApp2Var_SysBase::macinit_(&ICODE, &ICODE);
|
||||
//
|
||||
|
@ -185,8 +185,11 @@ Standard_Boolean ApproxInt_ImpPrmSvSurfaces::Compute( Standard_Real& u1
|
||||
}
|
||||
|
||||
|
||||
static math_Vector BornInf(1,2),BornSup(1,2),F(1,1),X(1,2),Tolerance(1,2);
|
||||
static math_Matrix D(1, 1, 1, 2);
|
||||
Standard_Real aBornInf[2],aBornSup[2],aF[1],aX[2],aTolerance[2];
|
||||
math_Vector BornInf(aBornInf,1,2),BornSup(aBornSup,1,2),F(aF,1,1),
|
||||
X(aX,1,2),Tolerance(aTolerance,1,2);
|
||||
Standard_Real aD[1][2];
|
||||
math_Matrix D(aD,1, 1, 1, 2);
|
||||
|
||||
Standard_Real binfu,bsupu,binfv,bsupv;
|
||||
binfu = ThePSurfaceTool::FirstUParameter(MyPSurf);
|
||||
|
@ -105,7 +105,8 @@ Standard_Boolean ApproxInt_PrmPrmSvSurfaces::Compute( Standard_Real& u1
|
||||
|
||||
MyIsTangent = Standard_True;
|
||||
|
||||
static TColStd_Array1OfReal Param(1,4);
|
||||
Standard_Real aParam[4];//stack vs heap allocation
|
||||
TColStd_Array1OfReal Param (aParam[0],1,4);
|
||||
Param(1) = u1; Param(2) = v1;
|
||||
Param(3) = u2; Param(4) = v2;
|
||||
math_FunctionSetRoot Rsnld(MyIntersectionOn2S.Function());
|
||||
|
@ -378,7 +378,7 @@
|
||||
InternalUVValue(theta,U,V,A,B,C,cost,sint,SigneSqrtDis);
|
||||
//
|
||||
Pt = Value(theta);
|
||||
if(Abs(SigneSqrtDis)<0.0000000001 || Abs(A)<0.0000001) return(Standard_False);
|
||||
if(Abs(A)<0.0000001 || Abs(SigneSqrtDis)<0.0000000001) return(Standard_False);
|
||||
|
||||
|
||||
//-- Approximation de la derivee (mieux que le calcul mathematique!)
|
||||
|
@ -34,6 +34,7 @@ uses
|
||||
|
||||
is
|
||||
|
||||
Create returns HInterTool from IntPatch;
|
||||
|
||||
-- Pour polyedres
|
||||
|
||||
@ -61,12 +62,12 @@ is
|
||||
|
||||
-- Methodes pour recherche des points interieurs
|
||||
|
||||
NbSamplePoints(myclass; S: HSurface from Adaptor3d)
|
||||
NbSamplePoints(me: in out; S: HSurface from Adaptor3d)
|
||||
|
||||
returns Integer from Standard;
|
||||
|
||||
|
||||
SamplePoint(myclass; S : HSurface from Adaptor3d;
|
||||
SamplePoint(me; S: HSurface from Adaptor3d;
|
||||
Index: Integer from Standard;
|
||||
U,V: out Real from Standard);
|
||||
|
||||
@ -220,5 +221,8 @@ is
|
||||
|
||||
returns Boolean from Standard;
|
||||
|
||||
fields
|
||||
|
||||
uinf,vinf,usup,vsup: Real from Standard;
|
||||
|
||||
end HInterTool;
|
||||
|
@ -37,8 +37,10 @@
|
||||
#include <Geom2d_BezierCurve.hxx>
|
||||
#include <Geom2d_BSplineCurve.hxx>
|
||||
|
||||
static Standard_Real uinf,vinf,usup,vsup;
|
||||
|
||||
IntPatch_HInterTool::IntPatch_HInterTool() :
|
||||
uinf (0.), vinf (0.), usup (0.), vsup (0.)
|
||||
{
|
||||
}
|
||||
|
||||
Standard_Integer IntPatch_HInterTool::NbSamplesV (const Handle(Adaptor3d_HSurface)& S,
|
||||
const Standard_Real, const Standard_Real)
|
||||
@ -136,7 +138,7 @@ Standard_Integer IntPatch_HInterTool::NbSamplePoints (const Handle(Adaptor3d_HSu
|
||||
void IntPatch_HInterTool::SamplePoint (const Handle(Adaptor3d_HSurface)& S,
|
||||
const Standard_Integer Index,
|
||||
Standard_Real& U,
|
||||
Standard_Real& V )
|
||||
Standard_Real& V ) const
|
||||
{
|
||||
Standard_Integer nbIntU = 1+NbSamplesU(S,uinf,usup);
|
||||
nbIntU>>=1;
|
||||
|
@ -163,9 +163,10 @@ void ComputeTangency (const IntPatch_TheSOnBounds& solrst,
|
||||
gp_Pnt2d p2d;
|
||||
gp_Vec2d d2d;
|
||||
//
|
||||
static math_Vector X(1, 2);
|
||||
static math_Vector F(1, 1);
|
||||
static math_Matrix D(1, 1, 1, 2);
|
||||
double aX[2], aF[1], aD[1][2];
|
||||
math_Vector X(aX, 1, 2);
|
||||
math_Vector F(aF, 1, 1);
|
||||
math_Matrix D(aD, 1, 1, 1, 2);
|
||||
//
|
||||
seqlength = 0;
|
||||
NbPoints = solrst.NbPoints();
|
||||
|
@ -457,7 +457,7 @@ void IntPatch_RstInt::PutVertexOnLine (Handle(IntPatch_Line)& L,
|
||||
// Si OnFirst = True, c est que la surface Surf correspond a la 1ere
|
||||
// surface donnee aux algo d intersection.
|
||||
|
||||
static IntPatch_SearchPnt Commun;
|
||||
IntPatch_SearchPnt Commun;
|
||||
|
||||
Standard_Real U,V,W;
|
||||
Standard_Real U1,V1,U2,V2;
|
||||
|
@ -54,7 +54,8 @@ void IntStart_SearchInside::Perform (TheFunction& Func,
|
||||
|
||||
done = Standard_False;
|
||||
list.Clear();
|
||||
static math_Vector Binf(1,2), Bsup(1,2), UVap(1,2),toler(1,2);
|
||||
Standard_Real aBinf[2], aBsup[2], aUVap[2], atoler[2];
|
||||
math_Vector Binf(aBinf,1,2), Bsup(aBsup,1,2), UVap(aUVap,1,2), toler(atoler,1,2);
|
||||
gp_Pnt psol;
|
||||
Standard_Boolean testpnt;
|
||||
Standard_Integer i,j,nbpt;
|
||||
@ -140,7 +141,8 @@ void IntStart_SearchInside::Perform (TheFunction& Func,
|
||||
//-- gp_Pnt Pmilieu = ThePSurfaceTool::Value(PS,0.5*(u1+u2),0.5*(v1+v2));
|
||||
gp_Pnt Pextrm1 = ThePSurfaceTool::Value(PS,u1,v1);
|
||||
gp_Pnt Pextrm2 = ThePSurfaceTool::Value(PS,u2,v2);
|
||||
static math_Vector Valf(1,1);
|
||||
Standard_Real aValf[1];
|
||||
math_Vector Valf(aValf,1,1);
|
||||
Func.Value(UVap,Valf);
|
||||
Standard_Real rvalf = Valf(1);
|
||||
Standard_Real DistPP = Pextrm1.SquareDistance(Pextrm2);
|
||||
|
@ -225,13 +225,11 @@ const gp_Pnt &IntTools_SurfaceRangeLocalizeData::GetPointInFrame
|
||||
(const Standard_Integer theUIndex,
|
||||
const Standard_Integer theVIndex) const
|
||||
{
|
||||
static gp_Pnt aNullPnt(0., 0., 0.);
|
||||
|
||||
Standard_Integer aFrmUInd = theUIndex + myUIndMin - 1;
|
||||
Standard_Integer aFrmVInd = theVIndex + myVIndMin - 1;
|
||||
|
||||
if (aFrmUInd > myUIndMax || aFrmVInd > myVIndMax)
|
||||
return aNullPnt;
|
||||
return gp::Origin();
|
||||
|
||||
return myGridPoints->Value(aFrmUInd, aFrmVInd);
|
||||
}
|
||||
|
@ -62,11 +62,6 @@ raises NotDone from StdFail,
|
||||
|
||||
is
|
||||
|
||||
Create
|
||||
|
||||
returns IWalking from IntWalk;
|
||||
|
||||
|
||||
Create(Epsilon, Deflection, Step : Real from Standard)
|
||||
|
||||
---Purpose: Deflection is the maximum deflection admitted between two
|
||||
@ -303,6 +298,7 @@ fields
|
||||
previousd2d : Dir2d from gp;
|
||||
seqAjout : SequenceOfInteger from TColStd;
|
||||
lines : SequenceOfIWLine;
|
||||
|
||||
NbPointsConfondusConsecutifs: Integer from Standard;
|
||||
EpsilonSembleTropGrand : Integer from Standard;
|
||||
end IWalking;
|
||||
|
||||
|
@ -31,7 +31,9 @@ IntWalk_IWalking::IntWalk_IWalking (const Standard_Real Epsilon,
|
||||
fleche(Deflection),
|
||||
pas(Increment),
|
||||
tolerance(1,2),
|
||||
epsilon(Epsilon*Epsilon)
|
||||
epsilon(Epsilon*Epsilon),
|
||||
NbPointsConfondusConsecutifs(0),
|
||||
EpsilonSembleTropGrand(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -328,8 +328,9 @@ Standard_Boolean IntWalk_IWalking::TestArretPassage
|
||||
}
|
||||
}
|
||||
if (Arrive) {
|
||||
static math_Vector bidF(1,1);
|
||||
static math_Matrix bidD(1,1,1,2);
|
||||
Standard_Real abidF[1], abidD[1][2];
|
||||
math_Vector bidF(abidF,1,1);
|
||||
math_Matrix bidD(abidD,1,1,1,2);
|
||||
sp.Values(UV,bidF,bidD);
|
||||
break;
|
||||
}
|
||||
@ -570,8 +571,9 @@ Standard_Boolean IntWalk_IWalking::TestArretAjout
|
||||
Arrive = Standard_True;
|
||||
UV(1) = U1;
|
||||
UV(2) = V1;
|
||||
static math_Vector bidF(1,1);
|
||||
static math_Matrix bidD(1,1,1,2);
|
||||
Standard_Real abidF[1], abidD[1][2];
|
||||
math_Vector bidF(abidF,1,1);
|
||||
math_Matrix bidD(abidD,1,1,1,2);
|
||||
sp.Values(UV,bidF,bidD);
|
||||
break;
|
||||
}
|
||||
@ -667,8 +669,9 @@ void IntWalk_IWalking::TestArretCadre
|
||||
}
|
||||
}
|
||||
if (Found) {
|
||||
static math_Vector bidF(1,1);
|
||||
static math_Matrix bidD(1,1,1,2);
|
||||
Standard_Real abidF[1], abidD[1][2];
|
||||
math_Vector bidF(abidF,1,1);
|
||||
math_Matrix bidD(abidD,1,1,1,2);
|
||||
sp.Values(UV,bidF,bidD);
|
||||
Standard_Integer NBP = Line->NbPoints();
|
||||
Standard_Integer Indextg;
|
||||
@ -742,8 +745,9 @@ void IntWalk_IWalking::TestArretCadre
|
||||
}
|
||||
if (Found) {
|
||||
Irang = -Irang; // jag 941017
|
||||
static math_Vector bidF(1,1);
|
||||
static math_Matrix bidD(1,1,1,2);
|
||||
Standard_Real abidF[1], abidD[1][2];
|
||||
math_Vector bidF(abidF,1,1);
|
||||
math_Matrix bidD(abidD,1,1,1,2);
|
||||
sp.Values(UV,bidF,bidD);
|
||||
return;
|
||||
}
|
||||
|
@ -73,7 +73,8 @@ void IntWalk_IWalking::ComputeOpenLine(const TColStd_SequenceOfReal& Umult,
|
||||
|
||||
{
|
||||
Standard_Integer I, N;
|
||||
static math_Vector BornInf(1,2), BornSup(1,2), UVap(1,2);
|
||||
Standard_Real aBornInf[2], aBornSup[2], aUVap[2];
|
||||
math_Vector BornInf(aBornInf,1,2), BornSup(aBornSup,1,2), UVap(aUVap,1,2);
|
||||
Standard_Real PasC, PasCu, PasCv;
|
||||
Standard_Boolean Arrive; // shows if the line ends
|
||||
Standard_Boolean Cadre; // shows if one is on border of the domain
|
||||
@ -498,8 +499,9 @@ static Standard_Boolean TestPassedSolutionWithNegativeState(const TColStd_Sequen
|
||||
}
|
||||
}
|
||||
if (Arrive) {
|
||||
static math_Vector bidF(1,1);
|
||||
static math_Matrix bidD(1,1,1,2);
|
||||
Standard_Real abidF[1], abidD[1][2];
|
||||
math_Vector bidF(abidF,1,1);
|
||||
math_Matrix bidD(abidD,1,1,1,2);
|
||||
sp.Values(UV,bidF,bidD);
|
||||
break;
|
||||
}
|
||||
|
@ -52,8 +52,9 @@ void IntWalk_IWalking::ComputeCloseLine(const TColStd_SequenceOfReal& Umult,
|
||||
{
|
||||
|
||||
Standard_Integer I,N;
|
||||
static math_Vector BornInf(1,2),BornSup(1,2);
|
||||
static math_Vector Uvap(1,2);// parameters of current approach
|
||||
Standard_Real aBornInf[2], aBornSup[2], aUVap[2];
|
||||
math_Vector BornInf(aBornInf,1,2), BornSup(aBornSup,1,2);
|
||||
math_Vector Uvap(aUVap,1,2);// parameters of current approach
|
||||
Standard_Real PasC; // rate of advancement on the tangent
|
||||
Standard_Real PasCu; // rate of advancement current by U
|
||||
Standard_Real PasCv; // step of advancement current by V
|
||||
|
@ -16,6 +16,15 @@
|
||||
// purpose or non-infringement. Please see the License for the specific terms
|
||||
// and conditions governing the rights and limitations under the License.
|
||||
|
||||
namespace {
|
||||
static const Standard_Real CosRef3D = 0.98;// regle par tests dans U4
|
||||
// correspond a 11.478 d
|
||||
static const Standard_Real CosRef2D = 0.88; // correspond a 25 d
|
||||
static const Standard_Integer MaxDivision = 60; // nombre maxi de division
|
||||
// du pas a cause de
|
||||
// l angle trop grand en 2d (U4)
|
||||
}
|
||||
|
||||
IntWalk_StatusDeflection IntWalk_IWalking::TestDeflection
|
||||
(TheIWFunction& sp,
|
||||
const Standard_Boolean Finished,
|
||||
@ -49,18 +58,10 @@ IntWalk_StatusDeflection IntWalk_IWalking::TestDeflection
|
||||
|
||||
IntWalk_StatusDeflection Status = IntWalk_OK;
|
||||
|
||||
static const Standard_Real CosRef3D = 0.98;// regle par tests dans U4
|
||||
// correspond a 11.478 d
|
||||
static const Standard_Real CosRef2D = 0.88; // correspond a 25 d
|
||||
static const Standard_Integer MaxDivision = 60; // nombre maxi de division
|
||||
// du pas a cause de
|
||||
// l angle trop grand en 2d (U4)
|
||||
//---------------------------------------------------------------------------------
|
||||
//-- lbr le 4 Avril 95 : On peut se trouver ds le cas ou Status renvoie point
|
||||
//-- confondus si epsilon est assez grand (1e-11) . Dans ce cas on boucle
|
||||
//-- sans jamais changer les valeurs envoyees a Rsnld.
|
||||
static Standard_Integer NbPointsConfondusConsecutifs = 0 ;
|
||||
static Standard_Integer EpsilonSembleTropGrand = 0 ;
|
||||
//---------------------------------------------------------------------------------
|
||||
Standard_Real Paramu, Paramv, StepU,StepV;
|
||||
Standard_Real Cosi, Cosi2, Norme;
|
||||
|
@ -58,9 +58,10 @@ void IntWalk_IWalking::MakeWalkingPoint
|
||||
Psol.SetValue(sp.Point(),reversed, U, V);
|
||||
}
|
||||
else if (Case == 11 || Case == 12 ) {
|
||||
static math_Vector UV(1, 2);
|
||||
static math_Vector FF(1, 1);
|
||||
static math_Matrix DD(1, 1, 1, 2);
|
||||
Standard_Real aUV[2], aFF[1], aDD[1][2];
|
||||
math_Vector UV(aUV,1, 2);
|
||||
math_Vector FF(aFF,1, 1);
|
||||
math_Matrix DD(aDD,1, 1, 1, 2);
|
||||
UV(1) = U;
|
||||
UV(2) = V;
|
||||
sp.Values(UV, FF, DD);
|
||||
@ -85,9 +86,10 @@ void IntWalk_IWalking::OpenLine(const Standard_Integer N,
|
||||
{
|
||||
ThePointOfPath PathPnt;
|
||||
|
||||
static math_Vector UV(1, 2);
|
||||
static math_Vector FF(1, 1);
|
||||
static math_Matrix DD(1, 1, 1, 2);
|
||||
Standard_Real aUV[2], aFF[1], aDD[1][2];
|
||||
math_Vector UV(aUV,1, 2);
|
||||
math_Vector FF(aFF,1, 1);
|
||||
math_Matrix DD(aDD,1, 1, 1, 2);
|
||||
|
||||
previousPoint = Line->Value(1);
|
||||
if (!reversed) {
|
||||
|
@ -310,5 +310,6 @@ fields
|
||||
firstd2 : Dir2d from gp;
|
||||
|
||||
myIntersectionOn2S : TheInt2S ;
|
||||
|
||||
STATIC_BLOCAGE_SUR_PAS_TROP_GRAND : Integer from Standard;
|
||||
STATIC_PRECEDENT_INFLEXION : Integer from Standard;
|
||||
end PWalking;
|
||||
|
@ -84,7 +84,9 @@ IntWalk_PWalking::IntWalk_PWalking(const ThePSurface& Caro1,
|
||||
fleche(Deflection),
|
||||
tolconf(Epsilon),
|
||||
sensCheminement(1),
|
||||
myIntersectionOn2S(Caro1,Caro2,TolTangency)
|
||||
myIntersectionOn2S(Caro1,Caro2,TolTangency),
|
||||
STATIC_BLOCAGE_SUR_PAS_TROP_GRAND(0),
|
||||
STATIC_PRECEDENT_INFLEXION(0)
|
||||
{
|
||||
Standard_Real KELARG=20.;
|
||||
//
|
||||
@ -222,7 +224,9 @@ IntWalk_PWalking::IntWalk_PWalking(const ThePSurface& Caro1,
|
||||
fleche(Deflection),
|
||||
tolconf(Epsilon),
|
||||
sensCheminement(1),
|
||||
myIntersectionOn2S(Caro1,Caro2,TolTangency)
|
||||
myIntersectionOn2S(Caro1,Caro2,TolTangency),
|
||||
STATIC_BLOCAGE_SUR_PAS_TROP_GRAND(0),
|
||||
STATIC_PRECEDENT_INFLEXION(0)
|
||||
{
|
||||
Standard_Real KELARG=20.;
|
||||
//
|
||||
|
@ -21,6 +21,13 @@
|
||||
|
||||
//#define DEBUG 0
|
||||
|
||||
namespace {
|
||||
//OCC431(apo): modified ->
|
||||
static const Standard_Real CosRef2D = Cos(M_PI/9.0), AngRef2D = M_PI/2.0;
|
||||
|
||||
static const Standard_Real d = 7.0;
|
||||
}
|
||||
|
||||
IntWalk_StatusDeflection IntWalk_PWalking::TestDeflection()
|
||||
|
||||
// tester si fleche respectee en calculant un majorant de fleche
|
||||
@ -37,9 +44,6 @@ IntWalk_StatusDeflection IntWalk_PWalking::TestDeflection()
|
||||
// tester s il n y a pas changement de rive
|
||||
//
|
||||
{
|
||||
static Standard_Integer STATIC_BLOCAGE_SUR_PAS_TROP_GRAND = 0;
|
||||
static Standard_Integer STATIC_PRECEDENT_INFLEXION = 0;
|
||||
|
||||
if(line->NbPoints() ==1 ) {
|
||||
STATIC_BLOCAGE_SUR_PAS_TROP_GRAND=STATIC_PRECEDENT_INFLEXION=0;
|
||||
}
|
||||
@ -126,10 +130,7 @@ IntWalk_StatusDeflection IntWalk_PWalking::TestDeflection()
|
||||
return(IntWalk_ArretSurPointPrecedent);
|
||||
}
|
||||
//==================================================================================
|
||||
//OCC431(apo): modified ->
|
||||
static Standard_Real CosRef2D = Cos(M_PI/9.0), AngRef2D = M_PI/2.0;
|
||||
|
||||
static Standard_Real /*tolArea = 100.0,*/ d = 7.0;
|
||||
|
||||
Standard_Real tolArea = 100.0;
|
||||
if (ResoU1 < Precision::PConfusion() ||
|
||||
ResoV1 < Precision::PConfusion() ||
|
||||
|
@ -387,8 +387,107 @@ static Standard_Integer OCC23774(Draw_Interpretor& di, Standard_Integer n, const
|
||||
return 0;
|
||||
}
|
||||
|
||||
#include <Geom_SurfaceOfRevolution.hxx>
|
||||
#include <GeomConvert_ApproxSurface.hxx>
|
||||
#include <Geom_BSplineSurface.hxx>
|
||||
#include <Draw.hxx>
|
||||
#include <OSD_Thread.hxx>
|
||||
static void GeomConvertTest (Draw_Interpretor& di, Standard_Integer theTargetNbUPoles, Standard_CString theFileName)
|
||||
{
|
||||
Handle(Geom_Surface) aSurf = DrawTrSurf::GetSurface(theFileName);
|
||||
GeomConvert_ApproxSurface aGAS (aSurf, 1e-4, GeomAbs_C1, GeomAbs_C1, 9, 9, 100, 1);
|
||||
if (!aGAS.IsDone()) {
|
||||
di << "ApproxSurface is not done!" << "\n";
|
||||
return;
|
||||
}
|
||||
const Handle(Geom_BSplineSurface)& aBSurf = aGAS.Surface();
|
||||
if (aBSurf.IsNull()) {
|
||||
di << "BSplineSurface is not created!" << "\n";
|
||||
return;
|
||||
}
|
||||
di << "Number of UPoles:" << aBSurf->NbUPoles() << "\n";
|
||||
QCOMPARE (aBSurf->NbUPoles(), theTargetNbUPoles);
|
||||
}
|
||||
|
||||
struct aData {
|
||||
Draw_Interpretor* di;
|
||||
Standard_Integer nbupoles;
|
||||
Standard_CString filename;
|
||||
};
|
||||
|
||||
Standard_EXPORT Standard_Address convert(Standard_Address data)
|
||||
{
|
||||
aData* info = (aData*) data;
|
||||
GeomConvertTest(*(info->di),info->nbupoles,info->filename);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static Standard_Integer OCC23952sweep (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
|
||||
{
|
||||
if (argc != 3) {
|
||||
di << "Usage: " << argv[0] << " invalid number of arguments" << "\n";
|
||||
return 1;
|
||||
}
|
||||
struct aData aStorage;
|
||||
aStorage.di = &di;
|
||||
aStorage.nbupoles = Draw::Atoi(argv[1]);
|
||||
aStorage.filename = argv[2];
|
||||
|
||||
OSD_Thread aThread1(convert);
|
||||
aThread1.Run(&aStorage);
|
||||
GeomConvertTest(di,aStorage.nbupoles,aStorage.filename);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#include <GeomInt_IntSS.hxx>
|
||||
static void GeomIntSSTest (Draw_Interpretor& di, Standard_Integer theNbSol, Standard_CString theFileName1, Standard_CString theFileName2)
|
||||
{
|
||||
Handle(Geom_Surface) aSurf1 = DrawTrSurf::GetSurface(theFileName1);
|
||||
Handle(Geom_Surface) aSurf2 = DrawTrSurf::GetSurface(theFileName2);
|
||||
GeomInt_IntSS anInter;
|
||||
anInter.Perform(aSurf1, aSurf2, Precision::Confusion(), Standard_True);
|
||||
if (!anInter.IsDone()) {
|
||||
di << "An intersection is not done!" << "\n";
|
||||
return;
|
||||
}
|
||||
|
||||
di << "Number of Lines:" << anInter.NbLines() << "\n";
|
||||
QCOMPARE (anInter.NbLines(), theNbSol);
|
||||
}
|
||||
|
||||
struct aNewData {
|
||||
Draw_Interpretor* di;
|
||||
Standard_Integer nbsol;
|
||||
Standard_CString filename1;
|
||||
Standard_CString filename2;
|
||||
};
|
||||
Standard_EXPORT Standard_Address convert_inter(Standard_Address data)
|
||||
{
|
||||
aNewData* info = (aNewData*) data;
|
||||
GeomIntSSTest(*(info->di),info->nbsol,info->filename1,info->filename2);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static Standard_Integer OCC23952intersect (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
|
||||
{
|
||||
if (argc != 4) {
|
||||
di << "Usage: " << argv[0] << " invalid number of arguments" << "\n";
|
||||
return 1;
|
||||
}
|
||||
struct aNewData aStorage;
|
||||
aStorage.di = &di;
|
||||
aStorage.nbsol = Draw::Atoi(argv[1]);
|
||||
aStorage.filename1 = argv[2];
|
||||
aStorage.filename2 = argv[3];
|
||||
|
||||
OSD_Thread aThread1(convert_inter);
|
||||
aThread1.Run(&aStorage);
|
||||
GeomIntSSTest(di,aStorage.nbsol,aStorage.filename1,aStorage.filename2);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#include <Geom_SurfaceOfRevolution.hxx>
|
||||
static Standard_Integer OCC23683 (Draw_Interpretor& di, Standard_Integer argc,const char ** argv)
|
||||
{
|
||||
if (argc < 2) {
|
||||
@ -479,7 +578,8 @@ void QABugs::Commands_19(Draw_Interpretor& theCommands) {
|
||||
theCommands.Add ("OCC22595", "OCC22595", __FILE__, OCC22595, group);
|
||||
theCommands.Add ("OCC23774", "OCC23774 shape1 shape2", __FILE__, OCC23774, group);
|
||||
theCommands.Add ("OCC23683", "OCC23683 shape", __FILE__, OCC23683, group);
|
||||
theCommands.Add ("OCC23952sweep", "OCC23952sweep nbupoles shape", __FILE__, OCC23952sweep, group);
|
||||
theCommands.Add ("OCC23952intersect", "OCC23952intersect nbsol shape1 shape2", __FILE__, OCC23952intersect, group);
|
||||
theCommands.Add ("test_offset", "test_offset", __FILE__, test_offset, group);
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -201,10 +201,7 @@ static void Solve(math_FunctionWithDerivative& F,
|
||||
|
||||
#define NEWSEQ 1
|
||||
|
||||
#if NEWSEQ
|
||||
TColStd_SequenceOfReal StaticSol;
|
||||
|
||||
#endif
|
||||
static const Standard_Integer methode = 1; //-- 1:(Nv Traitement) 3:(Nv + Ancien +check) 2:(Ancien)
|
||||
|
||||
math_FunctionRoots::math_FunctionRoots(math_FunctionWithDerivative& F,
|
||||
const Standard_Real A,
|
||||
@ -222,7 +219,9 @@ math_FunctionRoots::math_FunctionRoots(math_FunctionWithDerivative& F,
|
||||
}
|
||||
#endif
|
||||
|
||||
static Standard_Integer methode = 1; //-- 1:(Nv Traitement) 3:(Nv + Ancien +check) 2:(Ancien)
|
||||
#if NEWSEQ
|
||||
TColStd_SequenceOfReal StaticSol;
|
||||
#endif
|
||||
Sol.Clear();
|
||||
NbStateSol.Clear();
|
||||
if(methode & 1) {
|
||||
|
@ -29,8 +29,12 @@
|
||||
#include <math_MultipleVarFunction.hxx>
|
||||
|
||||
|
||||
static Standard_Real sqrarg;
|
||||
#define SQR(a) (sqrarg=(a), sqrarg*sqrarg)
|
||||
namespace {
|
||||
static inline Standard_Real SQR (const Standard_Real a)
|
||||
{
|
||||
return a * a;
|
||||
}
|
||||
}
|
||||
|
||||
class DirFunctionBis : public math_Function {
|
||||
|
||||
|
@ -42,9 +42,20 @@
|
||||
#include <math_IntegerVector.hxx>
|
||||
#include <math_Matrix.hxx>
|
||||
|
||||
static Standard_Real at, bt, ct;
|
||||
#define PYTHAG(a,b) ((at=fabs(a)) > (bt=fabs(b)) ? \
|
||||
(ct=bt/at,at*sqrt(1.0+ct*ct)) : (bt ? (ct=at/bt,bt*sqrt(1.0+ct*ct)) : 0.0))
|
||||
namespace {
|
||||
static inline Standard_Real PYTHAG (const Standard_Real a, const Standard_Real b)
|
||||
{
|
||||
Standard_Real at = fabs (a), bt = fabs (b), ct = 0.;
|
||||
if (at > bt) {
|
||||
ct = bt / at;
|
||||
ct = at * sqrt (1.0 + ct * ct);
|
||||
} else if (bt) {
|
||||
ct = at / bt;
|
||||
ct = bt * sqrt (1.0 + ct * ct);
|
||||
}
|
||||
return ct;
|
||||
}
|
||||
}
|
||||
|
||||
#define SIGN(a,b) ((b) >= 0.0 ? fabs(a) : -fabs(a))
|
||||
|
||||
|
19
tests/bugs/modalg_5/bug23952_1
Normal file
19
tests/bugs/modalg_5/bug23952_1
Normal file
@ -0,0 +1,19 @@
|
||||
puts "================"
|
||||
puts "OCC23952"
|
||||
puts "================"
|
||||
puts ""
|
||||
###########################################################################################
|
||||
# Improving thread-safety of intersections, approximations and other modeling algorithms
|
||||
###########################################################################################
|
||||
|
||||
pload QAcommands
|
||||
restore [locate_data_file bug23952_trim-torus.draw] res
|
||||
|
||||
set NbUPoles 18
|
||||
set info [OCC23952sweep $NbUPoles res]
|
||||
|
||||
if { [regexp "theTargetNbUPoles: OK" $info] != 1 } {
|
||||
puts "Error : Number of UPoles is incorrect"
|
||||
} else {
|
||||
puts "OK: Number of UPoles is correct"
|
||||
}
|
21
tests/bugs/modalg_5/bug23952_2
Normal file
21
tests/bugs/modalg_5/bug23952_2
Normal file
@ -0,0 +1,21 @@
|
||||
puts "================"
|
||||
puts "OCC23952"
|
||||
puts "================"
|
||||
puts ""
|
||||
###########################################################################################
|
||||
# Improving thread-safety of intersections, approximations and other modeling algorithms
|
||||
###########################################################################################
|
||||
|
||||
pload QAcommands
|
||||
restore [locate_data_file bug23952_s1.draw] a
|
||||
restore [locate_data_file bug23952_s2.draw] b
|
||||
|
||||
set NbLines 5
|
||||
set info [OCC23952intersect $NbLines a b]
|
||||
|
||||
if { [regexp "theNbSol: OK" $info] != 1 } {
|
||||
puts "Error : Number of intersections is incorrect"
|
||||
} else {
|
||||
puts "OK: Number of intersections is correct"
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user