// File: Plate_Plate.cxx // Created: Thu Oct 19 19:28:16 1995 // Author: Andre LIEUTIER // // 26-Mar-96 : xab : inclusion des inlines trop gros // 15-Oct-96 : alr : extraction des inlines (pas tous ceux inclus par xab) // 19-Fev-97 : jct : ajout des methodes UVBox et UVConstraints (G1134) // 10-Dec-97 : jag : Gros debug sur delete, et sur la methode Copy... // 13-Jan-98 : alr : ajout des derivees pour contraintes G3 et approx. C2 // 28-Avr-98 : alr : Prise en compte des Linear*Constraint, methodes SolveTI1,SolveTI2,SolveTI3 #include #include #include #include #include #include #include //======================================================================= //function : Plate_Plate //purpose : //======================================================================= Plate_Plate::Plate_Plate() : order(0), n_el(0), n_dim(0), solution(0),points(0),deru(0),derv(0), OK(Standard_False),maxConstraintOrder(0) { PolynomialPartOnly = Standard_False; } //======================================================================= //function : Plate_Plate //purpose : //======================================================================= Plate_Plate::Plate_Plate(const Plate_Plate& Ref) : order(Ref.order),n_el(Ref.n_el),n_dim(Ref.n_dim), solution(0),points(0),deru(0),derv(0), OK(Ref.OK) { Standard_Integer i; if (Ref.OK) { if (n_dim >0 && Ref.solution != 0) { solution = new gp_XYZ[n_dim]; for(i=0; i0) { if (Ref.points != 0) { points = new gp_XY[n_el]; for(i=0; i0 && Ref.solution != 0) { solution = new gp_XYZ[n_dim]; for(i=0; i0) { if (Ref.points != 0) { points = new gp_XY[n_el]; for(i=0; i 9) return; if(n_el<1) return; if(anisotropie < 1.e-6) return; if(anisotropie > 1.e+6) return; // computation of the bounding box of the 2d PPconstraints Standard_Real xmin,xmax,ymin,ymax; UVBox(xmin,xmax,ymin,ymax); Standard_Real du = 0.5*(xmax - xmin); if(anisotropie >1.) du *= anisotropie; if(du < 1.e-10) return; ddu[0] = 1; Standard_Integer i ; for( i=1;i<=9;i++) ddu[i] = ddu[i-1] / du; Standard_Real dv = 0.5*(ymax - ymin); if(anisotropie <1.) dv /= anisotropie; if(dv < 1.e-10) return; ddv[0] = 1; for(i=1;i<=9;i++) ddv[i] = ddv[i-1] / dv; if(myLScalarConstraints.IsEmpty()) { if(myLXYZConstraints.IsEmpty()) SolveTI1(IterationNumber); else SolveTI2(IterationNumber); } else SolveTI3(IterationNumber); } //======================================================================= //function : SolveTI1 //purpose : to solve the set of constraints in the easiest case, // only PinPointConstraints are loaded //======================================================================= void Plate_Plate::SolveTI1(const Standard_Integer IterationNumber) { // computation of square matrix members n_dim = n_el + order*(order+1)/2; math_Matrix mat(0, n_dim-1, 0, n_dim-1, 0.); delete [] (gp_XY*)points; points = new gp_XY[n_el]; Standard_Integer i ; for( i=0; iChangeValue(iu,iv) = Solution(i)*ddu[iu]*ddv[iv]; //Coefs->ChangeValue(idu,idv) = Solution(i); // il faut remettre cette ligne si on enleve ls facteurs dans // la methode Polm. i++; } } //======================================================================= //function : Plate_Plate::Continuity //purpose :give back the continuity order of the Plate function //======================================================================= Standard_Integer Plate_Plate::Continuity() const { return 2*order - 3 - maxConstraintOrder; } //======================================================================= //function : Plate_Plate::SolEm //purpose : compute the (iu,iv)th derivative of the fondamental solution // of Laplcian at the power order //======================================================================= static Standard_Real Uold = 1.e20; static Standard_Real Vold = 1.e20; static Standard_Real U2=0; static Standard_Real R=0; static Standard_Real L=0; Standard_Real Plate_Plate::SolEm(const gp_XY& point2d, const Standard_Integer iu, const Standard_Integer iv) const { // Standard_Real U2; // Standard_Real R; // Standard_Real L; // Standard_Real U,V; Standard_Integer IU,IV; if(iv>iu) { // SolEm is symetric in (u<->v) : we swap u and v if iv>iu // to avoid some code IU = iv; IV = iu; U = point2d.Y() *ddv[1]; V = point2d.X() *ddu[1]; } else { IU = iu; IV = iv; U = point2d.X() *ddu[1]; V = point2d.Y() *ddv[1]; } if((U==Uold)&&(V==Vold) ) { if (R<1.e-20) return 0; } else { Uold = U; Vold = V; U2 = U*U; R = U2+V*V; if (R<1.e-20) return 0; L = log(R); } Standard_Real DUV = 0; Standard_Integer m = order; Standard_Integer mm1 = m-1; Standard_Real &r = R; //Standard_Real pr = pow(R, mm1 - IU - IV); // cette expression prend beaucoup de temps //(ne tient pas compte de la petite valeur entiere de l'exposant) // Standard_Integer expo = mm1 - IU - IV; Standard_Real pr; if(expo<0) { pr = R; for(Standard_Integer i=1;i<-expo;i++) pr *= R; pr = 1./pr; } else if(expo>0) { pr = R; for(Standard_Integer i=1;iUMax) UMax = x; Standard_Real y = myConstraints(i).Pnt2d().Y(); if(yVMax) VMax = y; } for(i=1; i<=myLXYZConstraints.Length();i++) for(Standard_Integer j=1;j<= myLXYZConstraints(i).GetPPC().Length(); j++) { Standard_Real x = myLXYZConstraints(i).GetPPC()(j).Pnt2d().X(); if(xUMax) UMax = x; Standard_Real y = myLXYZConstraints(i).GetPPC()(j).Pnt2d().Y(); if(yVMax) VMax = y; } for(i=1; i<=myLScalarConstraints.Length();i++) for(Standard_Integer j=1;j<= myLScalarConstraints(i).GetPPC().Length(); j++) { Standard_Real x = myLScalarConstraints(i).GetPPC()(j).Pnt2d().X(); if(xUMax) UMax = x; Standard_Real y = myLScalarConstraints(i).GetPPC()(j).Pnt2d().Y(); if(yVMax) VMax = y; } if(UMax-UMin < Bmin) { Standard_Real UM = 0.5*(UMin+UMax); UMin = UM - 0.5*Bmin; UMax = UM + 0.5*Bmin; } if(VMax-VMin < Bmin) { Standard_Real VM = 0.5*(VMin+VMax); VMin = VM - 0.5*Bmin; VMax = VM + 0.5*Bmin; } } //======================================================================= //function : UVConstraints //purpose : //======================================================================= void Plate_Plate::UVConstraints(TColgp_SequenceOfXY& Seq) const { for (Standard_Integer i=1;i<=myConstraints.Length();i++) { if ((myConstraints.Value(i).Idu()==0) && (myConstraints.Value(i).Idv()==0)) Seq.Append((myConstraints.Value(i)).Pnt2d()); } } //======================================================================= void Plate_Plate::SetPolynomialPartOnly(const Standard_Boolean PPOnly) { PolynomialPartOnly = PPOnly; }