b311480e |
1 | -- Created on: 1997-10-29 |
2 | -- Created by: Roman BORISOV |
3 | -- Copyright (c) 1997-1999 Matra Datavision |
973c2be1 |
4 | -- Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | -- |
973c2be1 |
6 | -- This file is part of Open CASCADE Technology software library. |
b311480e |
7 | -- |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
13 | -- |
973c2be1 |
14 | -- Alternatively, this file may be used under the terms of Open CASCADE |
15 | -- commercial license or contractual agreement. |
7fd59977 |
16 | |
17 | class ProfileMatrix from FEmTool inherits SparseMatrix from FEmTool |
18 | |
19 | ---Purpose: Symmetric Sparse ProfileMatrix useful for 1D Finite |
20 | -- Element methods |
21 | |
22 | uses |
23 | HArray1OfInteger from TColStd, |
24 | Array1OfInteger from TColStd, |
25 | Array2OfInteger from TColStd, |
26 | HArray1OfReal from TColStd, |
27 | Vector from math |
28 | |
29 | raises |
30 | NotDone from StdFail, |
31 | NotImplemented from Standard, |
32 | OutOfRange from Standard |
33 | |
34 | is |
35 | Create(FirstIndexes : Array1OfInteger) |
6e33d3ce |
36 | returns ProfileMatrix from FEmTool; |
7fd59977 |
37 | |
38 | Init(me: mutable; Value : Real); |
39 | |
40 | ChangeValue(me: mutable; I, J : Integer) |
41 | ---C++: return & |
42 | returns Real |
43 | raises OutOfRange; |
44 | |
45 | Decompose(me : mutable) |
46 | ---Purpose: To make a Factorization of <me> |
47 | returns Boolean; |
48 | |
49 | Solve(me; B : Vector; X : in out Vector) |
50 | ---Purpose: Direct Solve of AX = B |
51 | raises NotDone from StdFail; -- if <me> is not decomposed |
52 | |
53 | Prepare(me : mutable) |
54 | ---Purpose: Make Preparation to iterative solve |
55 | returns Boolean |
56 | raises NotImplemented from Standard; |
57 | |
58 | Solve(me; B : Vector; |
59 | Init : Vector; |
60 | X : out Vector; |
61 | Residual : out Vector; |
62 | Tolerance : Real = 1.0e-8; |
63 | NbIterations: Integer = 50) |
64 | ---Purpose: Iterative solve of AX = B |
65 | raises NotDone from StdFail; -- if <me> is not prepared; |
66 | |
67 | Multiplied(me; X: Vector; MX : in out Vector); |
68 | ---Purpose: returns the product of a SparseMatrix by a vector. |
69 | -- An exception is raised if the dimensions are different |
70 | |
71 | RowNumber(me) |
72 | ---Purpose: returns the row range of a matrix. |
73 | returns Integer; |
74 | |
75 | |
76 | ColNumber(me) |
77 | ---Purpose: returns the column range of the matrix. |
78 | returns Integer; |
79 | |
80 | IsInProfile(me; i, j : Integer) |
81 | returns Boolean; |
82 | |
83 | -- for debug |
84 | |
85 | OutM(me); |
86 | |
87 | OutS(me); |
88 | |
89 | fields |
90 | profile : Array2OfInteger; -- Like MPOSIT in Fortran |
91 | ProfileMatrix : HArray1OfReal; -- Like AMATRI in Fortran |
92 | SMatrix : HArray1OfReal; -- Like SMATRI in Fortran |
93 | NextCoeff : HArray1OfInteger; -- Like POSUIV in Fortran |
94 | IsDecomp : Boolean; |
95 | end ProfileMatrix; |