XC Open source finite element analysis program
skymatr.h
1 //----------------------------------------------------------------------------
2 // XC program; finite element analysis code
3 // for structural analysis and design.
4 //
5 // Copyright (C) Luis Claudio Pérez Tato
6 //
7 // This program derives from OpenSees <http://opensees.berkeley.edu>
8 // developed by the «Pacific earthquake engineering research center».
9 //
10 // Except for the restrictions that may arise from the copyright
11 // of the original program (see copyright_opensees.txt)
12 // XC is free software: you can redistribute it and/or modify
13 // it under the terms of the GNU General Public License as published by
14 // the Free Software Foundation, either version 3 of the License, or
15 // (at your option) any later version.
16 //
17 // This software is distributed in the hope that it will be useful, but
18 // WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21 //
22 //
23 // You should have received a copy of the GNU General Public License
24 // along with this program.
25 // If not, see <http://www.gnu.org/licenses/>.
26 //----------------------------------------------------------------------------
27 //#############################################################################
28 // #
29 // #
30 // /~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/~~\ #
31 // | |____| #
32 // | | #
33 // | | #
34 // | | #
35 // | | #
36 // | B A S E C L A S S E S | #
37 // | | #
38 // | | #
39 // | | #
40 // | | #
41 // | C + + H E A D E R | #
42 // | | #
43 // | | #
44 // | | #
45 // | | #
46 // /~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/ | #
47 // \_________________________________________\__/ #
48 // #
49 // #
50 //#############################################################################
51 //#############################################################################
52 //##############################################################################
53 //# COPYRIGHT (C): :-)) #
54 //# PROJECT: Object Oriented Finite Element Program #
55 //# PURPOSE: #
56 //# CLASS: skymatrix #
57 //# #
58 //# VERSION: #
59 //# LANGUAGE: C++.ver >= 2.0 ( Borland C++ ver=3.10, SUN C++ ver=2.1 )#
60 //# TARGET OS: DOS || UNIX || . . . #
61 //# PROGRAMMER(S): Boris Jeremic #
62 //# #
63 //# #
64 //# DATE: November '92 #
65 //# UPDATE HISTORY: 05 - __ avgust '93. redefined as derived class from #
66 //# ndarray class #
67 //# August 22-29 '94 choped to separate files and worked on #
68 //# const and & issues #
69 //# August 30-31 '94 added use_def_dim to full the CC #
70 //# resolved problem with temoraries for #
71 //# operators + and - ( +=, -= ) #
72 //# #
73 //# September 09 '94 starting to rewrite things after a talk#
74 //# by Stephen Jonson " Objecting the Objects". The point is#
75 //# to forget about inheriting skymatrix from ndarray and #
76 //# start from separate branch! #
77 //# #
78 //# September 11 '94 it works #
79 //# September 12-13 '94 looking for the solver for symmetric#
80 //# and unsymmetric sparse matrices. #
81 //# One solution is Taylor's profile #
82 //# solver ( see FEM4ed by O.Z. and R.T.#
83 //# September 27 '94 profile solver for symmetric and #
84 //# Nonsymmetric systems works! #
85 //# (from FEM4ed by O.Z. and R.T.) #
86 //# #
87 //# #
88 //##############################################################################
89 
90 #ifndef SKYMATRIX_HH
91 #define SKYMATRIX_HH
92 
93 #include <string>
94 //#include <femdata.h>
95 //#include <brick3d.h>
96 //#include <node.h>
97 //#include <stifmat.h>
98 
99 
100 namespace XC {
102  {
103 // private:
104  struct skymatrix_rep
105  {
106  int * columnheight;
107  int * maxa;
108  double * data;
109  int square_dim;
110  } *pc_skymatrix_rep;
111 
112  public:
113 
114  skymatrix(int order_n, int *maxa, double *initval);
115  ~skymatrix();
116 
117 
118  int dimension_of_sky_M(void ) const; // dimension of sky matrix
119  int *get_MAXA(void) const; // get pointer to array of
120 
121  double & val(int row, int col); // element selection;
122  double cval(int row, int col) const; // element selection;
123 
124  double mmin( ); // find minimum element in the skymatrix
125  double mmax( ); // find maximum element in the skymatrix
126 
127  void lower_print(const std::string &msg = ""); // print lower part of
128  // skymatrix with a message
129  void upper_print(const std::string &msg = ""); // print upper part of
130  // skymatrix with a message
131  void full_print(const std::string &msg = ""); // print sky matrix
132  // as a full matrix with a message
133 
134 
135 
136 
137  skymatrix & v_ldl_factorize( ); // ldl factorizing sky matrix
138  double * d_reduce_r_h_s_l_v ( double * );
139  double * d_back_substitute ( double * );
140 
141 
142  private:
143  void error(const std::string &msg1,const std::string &msg2 = "") const; // private function
144 
145  double & mval(int , int ) const;
146 // full_val inline function allows you to treat skymatrix as if it is full
147 // float matrix. The function will calculate position inside sky matrix
148 // and return appropriate number if row and col are bellow skyline or
149 // return zero (0) if row and col are above sky line
150  double full_val (int , int ) const;
151 
152  };
153 } // end of XC namespace
154 
155 
156 #endif
Definition: skymatr.h:101
================================================================================
Definition: ContinuaReprComponent.h:34