1 // Created on: 1998-11-10
2 // Created by: Igor FEOKTISTOV
3 // Copyright (c) 1998-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
18 #include <FEmTool_ElementsOfRefMatrix.hxx>
19 #include <PLib_Base.hxx>
20 #include <Standard_ConstructionError.hxx>
21 #include <TColStd_Array1OfReal.hxx>
23 FEmTool_ElementsOfRefMatrix::FEmTool_ElementsOfRefMatrix(const Handle(PLib_Base)& TheBase,
24 const Standard_Integer DerOrder):
27 if(DerOrder < 0 || DerOrder > 3)
28 throw Standard_ConstructionError("FEmTool_ElementsOfRefMatrix");
30 myDerOrder = DerOrder;
31 myNbEquations = (myBase->WorkDegree()+2)*(myBase->WorkDegree()+1)/2;
35 Standard_Integer FEmTool_ElementsOfRefMatrix::NbVariables() const
40 Standard_Integer FEmTool_ElementsOfRefMatrix::NbEquations() const
45 Standard_Boolean FEmTool_ElementsOfRefMatrix::Value(const math_Vector& X, math_Vector& F)
47 if(F.Length() < myNbEquations) throw Standard_OutOfRange("FEmTool_ElementsOfRefMatrix::Value");
49 Standard_Real u = X(X.Lower());
50 TColStd_Array1OfReal Basis(0,myBase->WorkDegree()), Aux(0,myBase->WorkDegree());
57 myBase->D1(u, Aux, Basis);
60 myBase->D2(u, Aux, Aux, Basis);
63 myBase->D3(u, Aux, Aux, Aux, Basis);
67 Standard_Integer i, j, ii = 0;
68 for(i = 0; i<=myBase->WorkDegree(); i++)
69 for(j = i; j<=myBase->WorkDegree(); j++) {
70 F(F.Lower()+ii) = Basis(i)*Basis(j); ii++;