1 // Created on: 1998-11-10
2 // Created by: Igor FEOKTISTOV
3 // Copyright (c) 1998-1999 Matra Datavision
4 // Copyright (c) 1999-2012 OPEN CASCADE SAS
6 // The content of this file is subject to the Open CASCADE Technology Public
7 // License Version 6.5 (the "License"). You may not use the content of this file
8 // except in compliance with the License. Please obtain a copy of the License
9 // at http://www.opencascade.org and read it completely before using this file.
11 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
14 // The Original Code and all software distributed under the License is
15 // distributed on an "AS IS" basis, without warranty of any kind, and the
16 // Initial Developer hereby disclaims all such warranties, including without
17 // limitation, any warranties of merchantability, fitness for a particular
18 // purpose or non-infringement. Please see the License for the specific terms
19 // and conditions governing the rights and limitations under the License.
23 #include <FEmTool_ElementsOfRefMatrix.ixx>
24 #include <PLib_Base.hxx>
25 #include <TColStd_Array1OfReal.hxx>
28 FEmTool_ElementsOfRefMatrix::FEmTool_ElementsOfRefMatrix(const Handle(PLib_Base)& TheBase,
29 const Standard_Integer DerOrder):
32 if(DerOrder < 0 || DerOrder > 3)
33 Standard_ConstructionError::Raise("FEmTool_ElementsOfRefMatrix");
35 myDerOrder = DerOrder;
36 myNbEquations = (myBase->WorkDegree()+2)*(myBase->WorkDegree()+1)/2;
40 Standard_Integer FEmTool_ElementsOfRefMatrix::NbVariables() const
45 Standard_Integer FEmTool_ElementsOfRefMatrix::NbEquations() const
50 Standard_Boolean FEmTool_ElementsOfRefMatrix::Value(const math_Vector& X, math_Vector& F)
52 if(F.Length() < myNbEquations) Standard_OutOfRange::Raise("FEmTool_ElementsOfRefMatrix::Value");
54 Standard_Real u = X(X.Lower());
55 TColStd_Array1OfReal Basis(0,myBase->WorkDegree()), Aux(0,myBase->WorkDegree());
62 myBase->D1(u, Aux, Basis);
65 myBase->D2(u, Aux, Aux, Basis);
68 myBase->D3(u, Aux, Aux, Aux, Basis);
72 Standard_Integer i, j, ii = 0;
73 for(i = 0; i<=myBase->WorkDegree(); i++)
74 for(j = i; j<=myBase->WorkDegree(); j++) {
75 F(F.Lower()+ii) = Basis(i)*Basis(j); ii++;