0024157: Parallelization of assembly part of BO
[occt.git] / src / math / math_Uzawa.cdl
1 -- Created on: 1991-08-22
2 -- Created by: Laurent PAINNOT
3 -- Copyright (c) 1991-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
5 --
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.
10 --
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.
13 --
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.
20
21
22
23
24 class Uzawa from math
25
26     ---Purpose: This class implements a system resolution C*X = B with
27     --          an approach solution X0. There are no conditions on the 
28     --          number of equations. The algorithm used is the Uzawa 
29     --          algorithm. It is possible to have equal or inequal  (<)
30     --          equations to solve. The resolution is done with a 
31     --          minimization of Norm(X-X0).
32     --          If there are only equal equations, the resolution is directly
33     --          done and is similar to Gauss resolution with an optimisation
34     --          because the matrix is a symmetric matrix.
35     --          (The resolution is done with Crout algorithm)
36
37
38
39 uses Matrix from math, 
40      Vector from math,
41      OStream from Standard
42
43 raises NotDone from StdFail,
44        ConstructionError from Standard
45
46 is
47
48     Create(Cont: Matrix; Secont, StartingPoint: Vector; 
49            EpsLix: Real = 1.0e-06; EpsLic: Real = 1.0e-06;
50            NbIterations: Integer = 500)
51             ---Purpose: Given an input matrix Cont, two input vectors Secont
52             --          and StartingPoint, it solves Cont*X = Secont (only
53             --          = equations) with a minimization of Norme(X-X0).
54             --          The maximun iterations number allowed is fixed to 
55             --          NbIterations.
56             --          The tolerance EpsLic is fixed for the dual variable 
57             --          convergence. The tolerance EpsLix is used for the 
58             --          convergence of X.
59             --          Exception ConstuctionError is raised if the line number
60             --          of Cont is different from the length of Secont.
61           
62     returns Uzawa
63     raises ConstructionError;
64     
65     
66     Create(Cont: Matrix; Secont, StartingPoint: Vector; Nci, Nce: Integer;
67            EpsLix: Real = 1.0e-06; EpsLic: Real = 1.0e-06; 
68            NbIterations: Integer = 500)
69             ---Purpose: Given an input matrix Cont, two input vectors Secont
70             --          and StartingPoint, it solves Cont*X = Secont (the Nce
71             --          first equations are equal equations and the Nci last 
72             --          equations are inequalities <) with a minimization
73             --          of Norme(X-X0).
74             --          The maximun iterations number allowed is fixed to 
75             --          NbIterations.
76             --          The tolerance EpsLic is fixed for the dual variable 
77             --          convergence. The tolerance EpsLix is used for the 
78             --          convergence of X.
79             --          There are no conditions on Nce and Nci.
80             --          Exception ConstuctionError is raised if the line number
81             --          of Cont is different from the length of Secont and from
82             --          Nce + Nci.
83
84     returns Uzawa
85     raises ConstructionError;
86
87
88     Perform(me: in out; Cont: Matrix; Secont, StartingPoint: Vector; 
89             Nci, Nce: Integer; EpsLix: Real = 1.0e-06; 
90             EpsLic: Real = 1.0e-06; NbIterations: Integer = 500)
91             ---Purpose: Is used internally by the two constructors above.
92
93     is static protected;
94     
95         
96     IsDone(me)
97         ---Purpose: Returns true if the computations are successful, otherwise returns false.
98         ---C++: inline
99     returns Boolean
100     is static;
101     
102     
103     Value(me) 
104         ---Purpose: Returns the vector solution of the system above.
105         --          An exception is raised if NotDone.
106         ---C++: inline
107         ---C++: return const&    
108     returns Vector
109     raises NotDone
110     is static;
111     
112
113     InitialError(me)
114         ---Purpose: Returns the initial error Cont*StartingPoint-Secont.
115         --          An exception is raised if NotDone.
116         ---C++: inline
117         ---C++: return const&
118     returns Vector
119     raises NotDone
120     is static;
121     
122     
123     Duale(me; V : out Vector)
124         ---Purpose: returns the duale variables V of the systeme.
125     
126     raises NotDone
127     is static;
128     
129     
130     Error(me)
131         ---Purpose: Returns the difference between X solution and the 
132         --          StartingPoint.
133         --          An exception is raised if NotDone.
134         ---C++: inline
135         ---C++: return const&
136     returns Vector
137     raises NotDone
138     is static;
139      
140      
141     NbIterations(me)
142         ---Purpose: returns the number of iterations really done.
143         --          An exception is raised if NotDone.
144         ---C++: inline
145     returns Integer
146     raises NotDone
147     is static;
148     
149     
150     InverseCont(me)
151         ---Purpose: returns the inverse matrix of (C * Transposed(C)).
152         --          This result is needed for the computation of the gradient
153         --          when approximating a curve.
154         ---C++: inline
155         ---C++: return const&
156     returns Matrix
157     raises NotDone
158     is static;
159
160
161     Dump(me; o: in out OStream)
162         ---Purpose: Prints information on the current state of the object.
163
164     is static;
165
166
167
168 fields
169
170 Resul :   Vector;
171 Erruza:   Vector;
172 Errinit:  Vector;
173 Vardua:   Vector;
174 CTCinv:   Matrix;
175 NbIter :  Integer;
176 Done:     Boolean;
177
178 end Uzawa;