1 // Copyright (c) 1995-1999 Matra Datavision
2 // Copyright (c) 1999-2012 OPEN CASCADE SAS
4 // The content of this file is subject to the Open CASCADE Technology Public
5 // License Version 6.5 (the "License"). You may not use the content of this file
6 // except in compliance with the License. Please obtain a copy of the License
7 // at http://www.opencascade.org and read it completely before using this file.
9 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
10 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
12 // The Original Code and all software distributed under the License is
13 // distributed on an "AS IS" basis, without warranty of any kind, and the
14 // Initial Developer hereby disclaims all such warranties, including without
15 // limitation, any warranties of merchantability, fitness for a particular
16 // purpose or non-infringement. Please see the License for the specific terms
17 // and conditions governing the rights and limitations under the License.
22 // Approximation d un ensemble de points contraints (MultiLine) avec une
23 // solution approchee (MultiCurve). L algorithme utilise est l algorithme
24 // d Uzawa du package mathematique.
26 #define No_Standard_RangeError
27 #define No_Standard_OutOfRange
29 #include <math_Vector.hxx>
30 #include <math_Matrix.hxx>
31 #include <AppParCurves_Constraint.hxx>
32 #include <AppParCurves_ConstraintCouple.hxx>
33 #include <AppParCurves_MultiPoint.hxx>
34 #include <AppParCurves.hxx>
35 #include <Standard_DimensionError.hxx>
36 #include <math_Uzawa.hxx>
37 #include <TColStd_Array1OfInteger.hxx>
38 #include <TColStd_Array2OfInteger.hxx>
40 #include <gp_Pnt2d.hxx>
42 #include <gp_Vec2d.hxx>
43 #include <TColgp_Array1OfPnt.hxx>
44 #include <TColgp_Array1OfPnt2d.hxx>
45 #include <TColgp_Array1OfVec.hxx>
46 #include <TColgp_Array1OfVec2d.hxx>
49 AppParCurves_ResolConstraint::
50 AppParCurves_ResolConstraint(const MultiLine& SSP,
51 AppParCurves_MultiCurve& SCurv,
52 const Standard_Integer FirstPoint,
53 const Standard_Integer LastPoint,
54 const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints,
55 const math_Matrix& Bern,
56 const math_Matrix& DerivativeBern,
57 const Standard_Real Tolerance):
58 Cont(1, NbConstraints(SSP, FirstPoint,
59 LastPoint, TheConstraints),
60 1, NbColumns(SSP, SCurv.NbPoles()-1), 0.0),
61 DeCont(1, NbConstraints(SSP, FirstPoint,
62 LastPoint, TheConstraints),
63 1, NbColumns(SSP, SCurv.NbPoles()-1), 0.0),
64 Secont(1, NbConstraints(SSP, FirstPoint,
65 LastPoint, TheConstraints), 0.0),
66 CTCinv(1, NbConstraints(SSP, FirstPoint,
67 LastPoint, TheConstraints),
68 1, NbConstraints(SSP, FirstPoint,
69 LastPoint, TheConstraints)),
70 Vardua(1, NbConstraints(SSP, FirstPoint,
71 LastPoint, TheConstraints)),
72 IPas(1, LastPoint-FirstPoint+1),
73 ITan(1, LastPoint-FirstPoint+1),
74 ICurv(1, LastPoint-FirstPoint+1)
76 Standard_Integer i, j, k, NbCu= SCurv.NbCurves();
78 Standard_Integer Inc3, IncSec, IncCol, IP = 0, CCol;
79 Standard_Integer myindex, Def = SCurv.NbPoles()-1;
80 Standard_Integer nb3d, nb2d, Npol= Def+1, Npol2 = 2*Npol;
81 Standard_Real T1 = 0., T2 = 0., T3, Tmax, Daij;
87 AppParCurves_ConstraintCouple mycouple;
88 AppParCurves_Constraint FC = AppParCurves_NoConstraint,
89 LC = AppParCurves_NoConstraint, Cons;
93 // Boucle de calcul du nombre de points de passage afin de dimensionner
98 for (i = TheConstraints->Lower(); i <= TheConstraints->Upper(); i++) {
99 mycouple = TheConstraints->Value(i);
100 myindex = mycouple.Index();
101 Cons = mycouple.Constraint();
102 if (myindex == FirstPoint) FC = Cons;
103 if (myindex == LastPoint) LC = Cons;
105 IncPass++; // IncPass = nbre de points de passage.
106 IPas(IncPass) = myindex;
109 IncTan++; // IncTan= nbre de points de tangence.
110 ITan(IncTan) = myindex;
113 IncCurv++; // IncCurv = nbre de pts de courbure.
114 ICurv(IncCurv) = myindex;
120 Done = Standard_True;
124 nb3d = ToolLine::NbP3d(SSP);
125 nb2d = ToolLine::NbP2d(SSP);
126 Standard_Integer mynb3d=nb3d, mynb2d=nb2d;
127 if (nb3d == 0) mynb3d = 1;
128 if (nb2d == 0) mynb2d = 1;
129 CCol = nb3d* 3 + nb2d* 2;
132 // Declaration et initialisation des matrices et vecteurs de contraintes:
133 math_Matrix ContInit(1, IncPass, 1, Npol);
134 math_Vector Start(1, CCol*Npol);
135 TColStd_Array2OfInteger Ibont(1, NbCu, 1, IncTan);
138 // Remplissage de Cont pour les points de passage:
139 // =================================================
140 for (i =1; i <= IncPass; i++) { // Cette partie ne depend que de Bernstein
142 for (j = 1; j <= Npol; j++) {
143 ContInit(i, j) = Bern(Npt, j);
146 for (i = 1; i <= CCol; i++) {
147 Cont.Set(IncPass*(i-1)+1, IncPass*i, Npol*(i-1)+1, Npol*i, ContInit);
151 // recuperation des vecteurs de depart pour Uzawa. Ce vecteur represente les
153 // Remplissage de secont et resolution.
155 TColgp_Array1OfVec tabV(1, mynb3d);
156 TColgp_Array1OfVec2d tabV2d(1, mynb2d);
157 TColgp_Array1OfPnt tabP(1, mynb3d);
158 TColgp_Array1OfPnt2d tabP2d(1, mynb2d);
160 Inc3 = CCol*IncPass +1;
163 for (k = 1; k <= NbCu; k++) {
165 for (i = 1; i <= IncTan; i++) {
167 // choix du maximum de tangence pour exprimer la colinearite:
168 Ok = ToolLine::Tangency(SSP, Npt, tabV);
173 if (Abs(T2) > Tmax) {
177 if (Abs(T3) > Tmax) {
181 if (Ibont(k, i) == 3) {
182 for (j = 1; j <= Npol; j++) {
183 Daij = DerivativeBern(Npt, j);
184 Cont(Inc3, j+ Npol + IncCol) = Daij*T3/Tmax;
185 Cont(Inc3, j + Npol2 + IncCol) = -Daij *T2/Tmax;
186 Cont(Inc3+1, j+ IncCol) = Daij* T3/Tmax;
187 Cont(Inc3+1, j+ Npol2 + IncCol) = -Daij*T1/Tmax;
190 else if (Ibont(k, i) == 1) {
191 for (j = 1; j <= Npol; j++) {
192 Daij = DerivativeBern(Npt, j);
193 Cont(Inc3, j + IncCol) = Daij*T3/Tmax;
194 Cont(Inc3, j + Npol2 + IncCol) = -Daij *T1/Tmax;
195 Cont(Inc3+1, j+ IncCol) = Daij* T2/Tmax;
196 Cont(Inc3+1, j+ Npol +IncCol) = -Daij*T1/Tmax;
199 else if (Ibont(k, i) == 2) {
200 for (j = 1; j <= Def+1; j++) {
201 Daij = DerivativeBern(Npt, j);
202 Cont(Inc3, j+ Npol + IncCol) = Daij*T3/Tmax;
203 Cont(Inc3, j + Npol2 + IncCol) = -Daij *T2/Tmax;
204 Cont(Inc3+1, j+ IncCol) = Daij* T2/Tmax;
205 Cont(Inc3+1, j+ Npol + IncCol) = -Daij*T1/Tmax;
211 // Remplissage du second membre:
212 for (i = 1; i <= IncPass; i++) {
213 ToolLine::Value(SSP, IPas(i), tabP);
215 Secont(i + IncSec) = Poi.X();
216 Secont(i + IncPass + IncSec) = Poi.Y();
217 Secont(i + 2*IncPass + IncSec) = Poi.Z();
219 IncSec = IncSec + 3*IncPass;
221 // Vecteur de depart:
222 for (j =1; j <= Npol; j++) {
223 Poi = SCurv.Value(j).Point(k);
224 Start(j + IncCol) = Poi.X();
225 Start(j+ Npol + IncCol) = Poi.Y();
226 Start(j + Npol2 + IncCol) = Poi.Z();
228 IncCol = IncCol + 3*Npol;
233 for (i = 1; i <= IncTan; i++) {
235 Ok = ToolLine::Tangency(SSP, Npt, tabV2d);
236 V2d = tabV2d(k-nb3d);
241 if (Abs(T2) > Tmax) {
245 for (j = 1; j <= Npol; j++) {
246 Daij = DerivativeBern(Npt, j);
247 Cont(Inc3, j + IncCol) = Daij*T2;
248 Cont(Inc3, j + Npol + IncCol) = -Daij*T1;
253 // Remplissage du second membre:
254 for (i = 1; i <= IncPass; i++) {
255 ToolLine::Value(SSP, IPas(i), tabP2d);
256 Poi2d = tabP2d(i-nb3d);
257 Secont(i + IncSec) = Poi2d.X();
258 Secont(i + IncPass + IncSec) = Poi2d.Y();
260 IncSec = IncSec + 2*IncPass;
262 // Remplissage du vecteur de depart:
263 for (j = 1; j <= Npol; j++) {
264 Poi2d = SCurv.Value(j).Point2d(k);
265 Start(j + IncCol) = Poi2d.X();
266 Start(j + Npol + IncCol) = Poi2d.Y();
268 IncCol = IncCol + Npol2;
272 // Equations exprimant le meme rapport de tangence sur chaque courbe:
273 // On prend les coordonnees les plus significatives.
276 for (i = 1; i <= IncTan; ++i) {
279 for (k = 1; k <= NbCu-1; ++k) {
281 // Initialize first relation variable (T1)
282 Standard_Integer addIndex_1 = 0, aVal = Ibont(k, i);
288 Ok = ToolLine::Tangency(SSP, Npt, tabV);
294 Ok = ToolLine::Tangency(SSP, Npt, tabV2d);
295 V2d = tabV2d(k-nb3d);
305 Ok = ToolLine::Tangency(SSP, Npt, tabV);
310 Ok = ToolLine::Tangency(SSP, Npt, tabV2d);
311 V2d = tabV2d(k-nb3d);
320 Ok = ToolLine::Tangency(SSP, Npt, tabV);
324 addIndex_1 = 2 * Npol;
328 // Initialize second relation variable (T2)
329 Standard_Integer addIndex_2 = 0, aNextVal = Ibont(k + 1, i);
335 Ok = ToolLine::Tangency(SSP, Npt, tabV);
340 Ok = ToolLine::Tangency(SSP, Npt, tabV2d);
341 V2d = tabV2d(k+1-nb3d);
350 Ok = ToolLine::Tangency(SSP, Npt, tabV);
355 Ok = ToolLine::Tangency(SSP, Npt, tabV2d);
356 V2d = tabV2d(k+1-nb3d);
364 Ok = ToolLine::Tangency(SSP, Npt, tabV);
367 addIndex_2 = 2 * Npol;
372 // Relations between T1 and T2:
373 for (j = 1; j <= Npol; j++) {
374 Daij = DerivativeBern(Npt, j);
375 Cont(Inc3, j + IncCol + addIndex_1) = Daij*T2;
376 Cont(Inc3, j + IP + IncCol + addIndex_2) = -Daij*T1;
384 // Equations concernant la courbure:
389 for (k = 1; k <= NbCu; k++) {
390 for (i = 1; i <= IncCurv; i++) {
392 AppDef_MultiPointConstraint MP = SSP.Value(Npt);
393 DDA = SecondDerivativeBern(Parameters(Npt));
394 if (SSP.Value(1).Dimension(k) == 3) {
398 for (j = 1; j <= Npol; j++) {
399 Daij = DerivativeBern(Npt, j);
401 Cont(Inc3, j + IncCol) = D2Aij;
402 Cont(Inc3, j + Npol2 + IncCol) = -C2*Daij;
403 Cont(Inc3, j + Npol + IncCol) = C3*Daij;
405 Cont(Inc3+1, j + Npol + IncCol) = D2Aij;
406 Cont(Inc3+1, j +IncCol) = -C3*Daij;
407 Cont(Inc3+1, j + Npol2 + IncCol) = C1*Daij;
409 Cont(Inc3+2, j + Npol2+IncCol) = D2Aij;
410 Cont(Inc3+2, j + Npol+IncCol) = -C1*Daij;
411 Cont(Inc3+2, j + IncCol) = C2*Daij;
415 else { // Dimension 2:
416 C1 = MP.Curv2d(k).X();
417 C2 = MP.Curv2d(k).Y();
418 for (j = 1; j <= Npol; j++) {
419 Daij = DerivativeBern(Npt, j);
421 Cont(Inc3, j + IncCol) = D2Aij*C1;
422 Cont(Inc3+1, j + Npol + IncCol) = D2Aij*C2;
430 // Resolution par Uzawa:
432 math_Uzawa UzaResol(Cont, Secont, Start, Tolerance);
433 if (!(UzaResol.IsDone())) {
434 Done = Standard_False;
437 CTCinv = UzaResol.InverseCont();
438 UzaResol.Duale(Vardua);
439 for (i = 1; i <= CTCinv.RowNumber(); i++) {
440 for (j = i; j <= CTCinv.RowNumber(); j++) {
441 CTCinv(i, j) = CTCinv(j, i);
444 Done = Standard_True;
445 math_Vector VecPoles (1, CCol*Npol);
446 VecPoles = UzaResol.Value();
448 Standard_Integer polinit = 1, polfin=Npol;
449 if (FC >= 1) polinit = 2;
450 if (LC >= 1) polfin = Npol-1;
452 for (i = polinit; i <= polfin; i++) {
454 AppParCurves_MultiPoint MPol(nb3d, nb2d);
455 for (k = 1; k <= NbCu; k++) {
457 gp_Pnt Pol(VecPoles(IncCol + i),
458 VecPoles(IncCol + Npol +i),
459 VecPoles(IncCol + 2*Npol + i));
460 MPol.SetPoint(k, Pol);
461 IncCol = IncCol + 3*Npol;
464 gp_Pnt2d Pol2d(VecPoles(IncCol + i),
465 VecPoles(IncCol + Npol + i));
466 MPol.SetPoint2d(k, Pol2d);
467 IncCol = IncCol + 2*Npol;
470 SCurv.SetValue(i, MPol);
477 Standard_Boolean AppParCurves_ResolConstraint::IsDone () const {
482 Standard_Integer AppParCurves_ResolConstraint::
483 NbConstraints(const MultiLine& SSP,
484 const Standard_Integer,
485 const Standard_Integer,
486 const Handle(AppParCurves_HArray1OfConstraintCouple)&
490 // Boucle de calcul du nombre de points de passage afin de dimensionner
492 Standard_Integer aIncPass, aIncTan, aIncCurv, aCCol;
494 AppParCurves_Constraint Cons;
500 for (i = TheConstraints->Lower(); i <= TheConstraints->Upper(); i++) {
501 Cons = (TheConstraints->Value(i)).Constraint();
503 aIncPass++; // IncPass = nbre de points de passage.
506 aIncTan++; // IncTan= nbre de points de tangence.
509 aIncCurv++; // IncCurv = nbre de pts de courbure.
512 Standard_Integer nb3d = ToolLine::NbP3d(SSP);
513 Standard_Integer nb2d = ToolLine::NbP2d(SSP);
514 aCCol = nb3d* 3 + nb2d* 2;
516 return aCCol*aIncPass + aIncTan*(aCCol-1) + 3*aIncCurv;
521 Standard_Integer AppParCurves_ResolConstraint::NbColumns(const MultiLine& SSP,
522 const Standard_Integer Deg)
525 Standard_Integer nb3d = ToolLine::NbP3d(SSP);
526 Standard_Integer nb2d = ToolLine::NbP2d(SSP);
527 Standard_Integer CCol = nb3d* 3 + nb2d* 2;
532 const math_Matrix& AppParCurves_ResolConstraint::ConstraintMatrix() const
537 const math_Matrix& AppParCurves_ResolConstraint::InverseMatrix() const
543 const math_Vector& AppParCurves_ResolConstraint::Duale() const
550 const math_Matrix& AppParCurves_ResolConstraint::
551 ConstraintDerivative(const MultiLine& SSP,
552 const math_Vector& Parameters,
553 const Standard_Integer Deg,
554 const math_Matrix& DA)
556 Standard_Integer i, j, k, nb2d, nb3d, CCol, Inc3, IncCol, Npt;
557 Standard_Integer Npol, Npol2, NbCu =ToolLine::NbP3d(SSP)+ToolLine::NbP2d(SSP);
560 Npol = Deg+1; Npol2 = 2*Npol;
562 TColStd_Array2OfInteger Ibont(1, NbCu, 1, IncTan);
563 math_Matrix DeCInit(1, IncPass, 1, Npol);
564 math_Vector DDA(1, Npol);
567 Standard_Real T1, T2, T3, Tmax, DDaij;
568 // Standard_Integer FirstP = IPas(1);
569 nb3d = ToolLine::NbP3d(SSP);
570 nb2d = ToolLine::NbP2d(SSP);
571 Standard_Integer mynb3d = nb3d, mynb2d = nb2d;
572 if (nb3d == 0) mynb3d = 1;
573 if (nb2d == 0) mynb2d = 1;
574 CCol = nb3d* 3 + nb2d* 2;
576 TColgp_Array1OfVec tabV(1, mynb3d);
577 TColgp_Array1OfVec2d tabV2d(1, mynb2d);
578 TColgp_Array1OfPnt tabP(1, mynb3d);
579 TColgp_Array1OfPnt2d tabP2d(1, mynb2d);
581 for (i = 1; i <= DeCont.RowNumber(); i++)
582 for (j = 1; j <= DeCont.ColNumber(); j++)
586 // Remplissage de DK pour les points de passages:
588 for (i =1; i <= IncPass; i++) {
590 for (j = 1; j <= Npol; j++) DeCInit(i, j) = DA(Npt, j);
592 for (i = 1; i <= CCol; i++) {
593 DeCont.Set(IncPass*(i-1)+1, IncPass*i, Npol*(i-1)+1, Npol*i, DeCInit);
597 // Pour les points de tangence:
599 Inc3 = CCol*IncPass +1;
602 for (k = 1; k <= NbCu; k++) {
604 for (i = 1; i <= IncTan; i++) {
606 // MultiPoint MPoint = ToolLine::Value(SSP, Npt);
607 // choix du maximum de tangence pour exprimer la colinearite:
608 Ok = ToolLine::Tangency(SSP, Npt, tabV);
613 if (Abs(T2) > Tmax) {
617 if (Abs(T3) > Tmax) {
621 AppParCurves::SecondDerivativeBernstein(Parameters(Npt), DDA);
622 if (Ibont(k, i) == 3) {
623 for (j = 1; j <= Npol; j++) {
625 DeCont(Inc3, j+ Npol + IncCol) = DDaij*T3/Tmax;
626 DeCont(Inc3, j + Npol2 + IncCol) = -DDaij *T2/Tmax;
627 DeCont(Inc3+1, j+ IncCol) = DDaij* T3/Tmax;
628 DeCont(Inc3+1, j+ Npol2 + IncCol) = -DDaij*T1/Tmax;
631 else if (Ibont(k, i) == 1) {
632 for (j = 1; j <= Npol; j++) {
634 DeCont(Inc3, j + IncCol) = DDaij*T3/Tmax;
635 DeCont(Inc3, j + Npol2 + IncCol) = -DDaij *T1/Tmax;
636 DeCont(Inc3+1, j+ IncCol) = DDaij* T2/Tmax;
637 DeCont(Inc3+1, j+ Npol +IncCol) = -DDaij*T1/Tmax;
640 else if (Ibont(k, i) == 2) {
641 for (j = 1; j <= Npol; j++) {
643 DeCont(Inc3, j+ Npol + IncCol) = DDaij*T3/Tmax;
644 DeCont(Inc3, j + Npol2 + IncCol) = -DDaij *T2/Tmax;
645 DeCont(Inc3+1, j+ IncCol) = DDaij* T2/Tmax;
646 DeCont(Inc3+1, j+ Npol + IncCol) = -DDaij*T1/Tmax;
651 IncCol = IncCol + 3*Npol;
654 for (i = 1; i <= IncTan; i++) {
656 AppParCurves::SecondDerivativeBernstein(Parameters(Npt), DDA);
657 Ok = ToolLine::Tangency(SSP, Npt, tabV2d);
662 if (Abs(T2) > Tmax) {
666 for (j = 1; j <= Npol; j++) {
668 DeCont(Inc3, j + IncCol) = DDaij*T2;
669 DeCont(Inc3, j + Npol + IncCol) = -DDaij*T1;
676 // Equations exprimant le meme rapport de tangence sur chaque courbe:
677 // On prend les coordonnees les plus significatives.
680 for (i =1; i <= IncTan; i++) {
683 AppParCurves::SecondDerivativeBernstein(Parameters(Npt), DDA);
684 // MultiPoint MP = ToolLine::Value(SSP, Npt);
685 for (k = 1; k <= NbCu-1; k++) {
687 if (Ibont(k, i) == 1) {
689 Ok = ToolLine::Tangency(SSP, Npt, tabV);
695 Ok = ToolLine::Tangency(SSP, Npt, tabV2d);
700 if (Ibont(k+1, i) == 1) { // Relations entre T1x et T2x:
702 Ok = ToolLine::Tangency(SSP, Npt, tabV);
707 Ok = ToolLine::Tangency(SSP, Npt, tabV2d);
711 for (j = 1; j <= Npol; j++) {
713 Cont(Inc3, j + IncCol) = Daij*T2;
714 Cont(Inc3, j + IP + IncCol) = -Daij*T1;
716 IncCol = IncCol + IP;
718 else if (Ibont(k+1, i) == 2) { // Relations entre T1x et T2y:
720 Ok = ToolLine::Tangency(SSP, Npt, tabV);
725 Ok = ToolLine::Tangency(SSP, Npt, tabV2d);
729 for (j = 1; j <= Npol; j++) {
731 Cont(Inc3, j + IncCol) = Daij*T2;
732 Cont(Inc3, j + IP + Npol + IncCol) = -Daij*T1;
734 IncCol = IncCol + IP;
736 else if (Ibont(k+1,i) == 3) { // Relations entre T1x et T2z:
737 Ok = ToolLine::Tangency(SSP, Npt, tabV);
740 for (j = 1; j <= Npol; j++) {
742 Cont(Inc3, j + IncCol) = Daij*T2;
743 Cont(Inc3, j + IP + 2*Npol + IncCol) = -Daij*T1;
745 IncCol = IncCol + IP;
748 else if (Ibont(k,i) == 2) {
750 Ok = ToolLine::Tangency(SSP, Npt, tabV);
756 Ok = ToolLine::Tangency(SSP, Npt, tabV2d);
761 if (Ibont(k+1, i) == 1) { // Relations entre T1y et T2x:
763 Ok = ToolLine::Tangency(SSP, Npt, tabV);
768 Ok = ToolLine::Tangency(SSP, Npt, tabV2d);
772 for (j = 1; j <= Npol; j++) {
774 Cont(Inc3, j + Npol + IncCol) = Daij*T2;
775 Cont(Inc3, j + IP + IncCol) = -Daij*T1;
777 IncCol = IncCol + IP;
780 else if (Ibont(k+1, i) == 2) { // Relations entre T1y et T2y:
782 Ok = ToolLine::Tangency(SSP, Npt, tabV);
787 Ok = ToolLine::Tangency(SSP, Npt, tabV2d);
791 for (j = 1; j <= Npol; j++) {
793 Cont(Inc3, j + Npol + IncCol) = Daij*T2;
794 Cont(Inc3, j + IP + Npol + IncCol) = -Daij*T1;
796 IncCol = IncCol + IP;
799 else if (Ibont(k+1,i)== 3) { // Relations entre T1y et T2z:
800 Ok = ToolLine::Tangency(SSP, Npt, tabV);
803 for (j = 1; j <= Npol; j++) {
805 Cont(Inc3, j + Npol +IncCol) = Daij*T2;
806 Cont(Inc3, j + IP + 2*Npol + IncCol) = -Daij*T1;
808 IncCol = IncCol + IP;
813 Ok = ToolLine::Tangency(SSP, Npt, tabV);
817 if (Ibont(k+1, i) == 1) { // Relations entre T1z et T2x:
819 Ok = ToolLine::Tangency(SSP, Npt, tabV);
824 Ok = ToolLine::Tangency(SSP, Npt, tabV2d);
828 for (j = 1; j <= Npol; j++) {
830 Cont(Inc3, j + 2*Npol +IncCol) = Daij*T2;
831 Cont(Inc3, j + IP + IncCol) = -Daij*T1;
833 IncCol = IncCol + IP;
836 else if (Ibont(k+1, i) == 2) { // Relations entre T1z et T2y:
838 Ok = ToolLine::Tangency(SSP, Npt, tabV);
843 Ok = ToolLine::Tangency(SSP, Npt, tabV2d);
847 for (j = 1; j <= Npol; j++) {
849 Cont(Inc3, j + 2*Npol +IncCol) = Daij*T2;
850 Cont(Inc3, j + IP + Npol + IncCol) = -Daij*T1;
852 IncCol = IncCol + IP;
855 else if (Ibont(k+1,i)==3) { // Relations entre T1z et T2z:
856 Ok = ToolLine::Tangency(SSP, Npt, tabV);
859 for (j = 1; j <= Npol; j++) {
861 Cont(Inc3, j + 2*Npol + IncCol) = Daij*T2;
862 Cont(Inc3, j + IP + 2*Npol + IncCol) = -Daij*T1;
864 IncCol = IncCol + IP;