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