424cd6bb |
1 | -- Created on: 2005-12-21 |
2 | -- Created by: Sergey KHROMOV |
3 | -- Copyright (c) 2005-2014 OPEN CASCADE SAS |
4 | -- |
5 | -- This file is part of Open CASCADE Technology software library. |
6 | -- |
7 | -- This library is free software; you can redistribute it and/or modify it under |
8 | -- the terms of the GNU Lesser General Public License version 2.1 as published |
9 | -- by the Free Software Foundation, with special exception defined in the file |
10 | -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
11 | -- distribution for complete text of the license and disclaimer of any warranty. |
12 | -- |
13 | -- Alternatively, this file may be used under the terms of Open CASCADE |
14 | -- commercial license or contractual agreement. |
15 | |
16 | class TFunction from BRepGProp inherits Function from math |
17 | |
18 | ---Purpose: This class represents the integrand function for the outer |
19 | -- integral computation. The returned value represents the |
20 | -- integral of UFunction. It depends on the value type and the |
21 | -- flag IsByPoint. |
22 | |
23 | uses |
24 | |
25 | Pnt from gp, |
26 | Address from Standard, |
27 | Boolean from Standard, |
28 | Integer from Standard, |
29 | Real from Standard, |
30 | ValueType from GProp, |
31 | UFunction from BRepGProp, |
32 | Face from BRepGProp |
33 | |
34 | is |
35 | |
36 | Create(theSurface : Face from BRepGProp; |
37 | theVertex : Pnt from gp; |
38 | IsByPoint : Boolean from Standard; |
39 | theCoeffs : Address from Standard; |
40 | theUMin : Real from Standard; |
41 | theTolerance: Real from Standard) |
42 | ---Purpose: Constructor. Initializes the function with the face, the |
43 | -- location point, the flag IsByPoint, the coefficients |
44 | -- theCoeff that have different meaning depending on the value |
45 | -- of IsByPoint. The last two parameters are theUMin - the |
46 | -- lower bound of the inner integral. This value is fixed for |
47 | -- any integral. And the value of tolerance of inner integral |
48 | -- computation. |
49 | -- If IsByPoint is equal to Standard_True, the number of the |
50 | -- coefficients is equal to 3 and they represent X, Y and Z |
51 | -- coordinates (theCoeff[0], theCoeff[1] and theCoeff[2] |
52 | -- correspondingly) of the shift if the inertia is computed |
53 | -- with respect to the point different then the location. |
54 | -- If IsByPoint is equal to Standard_False, the number of the |
55 | -- coefficients is 4 and they represent the compbination of |
56 | -- plane parameters and shift values. |
57 | returns TFunction from BRepGProp; |
58 | |
59 | Init(me: in out); |
60 | |
61 | SetNbKronrodPoints(me: in out; theNbPoints: Integer from Standard); |
62 | ---Purpose: Setting the expected number of Kronrod points for the outer |
63 | -- integral computation. This number is required for |
64 | -- computation of a value of tolerance for inner integral |
65 | -- computation. After GetStateNumber method call, this number |
66 | -- is recomputed by the same law as in |
67 | -- math_KronrodSingleIntegration, i.e. next number of points |
68 | -- is equal to the current number plus a square root of the |
69 | -- current number. If the law in math_KronrodSingleIntegration |
70 | -- is changed, the modification algo should be modified |
71 | -- accordingly. |
72 | ---C++: inline |
73 | |
74 | SetValueType(me: in out; aType: ValueType from GProp); |
75 | ---Purpose: Setting the type of the value to be returned. This |
76 | -- parameter is directly passed to the UFunction. |
77 | ---C++: inline |
78 | |
79 | SetTolerance(me: in out; aTol: Real from Standard); |
80 | ---Purpose: Setting the tolerance for inner integration |
81 | ---C++: inline |
82 | |
83 | ErrorReached(me) |
84 | ---Purpose: Returns the relative reached error of all values computation since |
85 | -- the last call of GetStateNumber method. |
86 | ---C++: inline |
87 | returns Real from Standard; |
88 | |
89 | AbsolutError(me) |
90 | ---Purpose: Returns the absolut reached error of all values computation since |
91 | -- the last call of GetStateNumber method. |
92 | ---C++: inline |
93 | returns Real from Standard; |
94 | |
95 | Value(me: in out; X: Real from Standard; |
96 | F: out Real from Standard) |
97 | ---Purpose: Returns a value of the function. The value represents an |
98 | -- integral of UFunction. It is computed with the predefined |
99 | -- tolerance using the adaptive Gauss-Kronrod method. |
100 | returns Boolean from Standard |
101 | is redefined; |
102 | |
103 | GetStateNumber(me: in out) |
104 | ---Purpose: Redefined method. Remembers the error reached during |
105 | -- computation of integral values since the object creation |
106 | -- or the last call of GetStateNumber. It is invoked in each |
107 | -- algorithm from the package math. Particularly in the |
108 | -- algorithm math_KronrodSingleIntegration that is used to |
109 | -- compute the integral of TFunction. |
110 | returns Integer |
111 | is redefined; |
112 | |
113 | fields |
114 | |
115 | mySurface : Face from BRepGProp; |
116 | myUFunction : UFunction from BRepGProp; |
117 | myUMin : Real from Standard; |
118 | myTolerance : Real from Standard; |
119 | myTolReached: Real from Standard; |
120 | myErrReached: Real from Standard; |
121 | myAbsError : Real from Standard; |
122 | myValueType : ValueType from GProp; |
123 | myIsByPoint : Boolean from Standard; |
124 | myNbPntOuter: Integer from Standard; |
125 | |
126 | end TFunction; |