1 // Created on: 1997-10-29
2 // Created by: Roman BORISOV
3 // Copyright (c) 1997-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
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.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16 
17 #ifndef _FEmTool_Assembly_HeaderFile
18 #define _FEmTool_Assembly_HeaderFile
19 
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23 
24 #include <TColStd_Array2OfInteger.hxx>
25 #include <FEmTool_HAssemblyTable.hxx>
26 #include <Standard_Boolean.hxx>
27 #include <math_Vector.hxx>
28 #include <FEmTool_SeqOfLinConstr.hxx>
29 #include <TColStd_SequenceOfReal.hxx>
30 #include <Standard_Integer.hxx>
31 #include <Standard_Real.hxx>
32 class FEmTool_ProfileMatrix;
33 class math_Matrix;
34 
35 
36 //! Assemble and solve system from (one dimensional) Finite Elements
37 class FEmTool_Assembly
38 {
39 public:
40 
41   DEFINE_STANDARD_ALLOC
42 
43 
44   Standard_EXPORT FEmTool_Assembly(const TColStd_Array2OfInteger& Dependence, const Handle(FEmTool_HAssemblyTable)& Table);
45 
46   //! Nullify all Matrix 's Coefficient
47   Standard_EXPORT void NullifyMatrix();
48 
49   //! Add an elementary Matrix in the assembly Matrix
50   //! if  Dependence(Dimension1,Dimension2)  is  False
51   Standard_EXPORT void AddMatrix (const Standard_Integer Element, const Standard_Integer Dimension1, const Standard_Integer Dimension2, const math_Matrix& Mat);
52 
53   //! Nullify  all  Coordinate of  assembly  Vector (second member)
54   Standard_EXPORT void NullifyVector();
55 
56   //! Add an elementary Vector in the assembly Vector (second member)
57   Standard_EXPORT void AddVector (const Standard_Integer Element, const Standard_Integer Dimension, const math_Vector& Vec);
58 
59   //! Delete all Constraints.
60   Standard_EXPORT void ResetConstraint();
61 
62   //! Nullify all Constraints.
63   Standard_EXPORT void NullifyConstraint();
64 
65   Standard_EXPORT void AddConstraint (const Standard_Integer IndexofConstraint, const Standard_Integer Element, const Standard_Integer Dimension, const math_Vector& LinearForm, const Standard_Real Value);
66 
67   //! Solve the assembly system
68   //! Returns Standard_False if the computation failed.
69   Standard_EXPORT Standard_Boolean Solve();
70 
71   Standard_EXPORT void Solution (math_Vector& Solution) const;
72 
73   Standard_EXPORT Standard_Integer NbGlobVar() const;
74 
75   Standard_EXPORT void GetAssemblyTable (Handle(FEmTool_HAssemblyTable)& AssTable) const;
76 
77 
78 
79 
80 protected:
81 
82 
83 
84 
85 
86 private:
87 
88 
89 
90   TColStd_Array2OfInteger myDepTable;
91   Handle(FEmTool_HAssemblyTable) myRefTable;
92   Standard_Boolean IsSolved;
93   Handle(FEmTool_ProfileMatrix) H;
94   math_Vector B;
95   Handle(FEmTool_ProfileMatrix) GHGt;
96   FEmTool_SeqOfLinConstr G;
97   TColStd_SequenceOfReal C;
98 
99 
100 };
101 
102 
103 
104 
105 
106 
107 
108 #endif // _FEmTool_Assembly_HeaderFile
109