OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
dyncompcol.h
Go to the documentation of this file.
1 /*
2  *
3  * ##### ##### ###### ###### ### ###
4  * ## ## ## ## ## ## ## ### ##
5  * ## ## ## ## #### #### ## # ##
6  * ## ## ## ## ## ## ## ##
7  * ## ## ## ## ## ## ## ##
8  * ##### ##### ## ###### ## ##
9  *
10  *
11  * OOFEM : Object Oriented Finite Element Code
12  *
13  * Copyright (C) 1993 - 2013 Borek Patzak
14  *
15  *
16  *
17  * Czech Technical University, Faculty of Civil Engineering,
18  * Department of Structural Mechanics, 166 29 Prague, Czech Republic
19  *
20  * This library is free software; you can redistribute it and/or
21  * modify it under the terms of the GNU Lesser General Public
22  * License as published by the Free Software Foundation; either
23  * version 2.1 of the License, or (at your option) any later version.
24  *
25  * This program is distributed in the hope that it will be useful,
26  * but WITHOUT ANY WARRANTY; without even the implied warranty of
27  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28  * Lesser General Public License for more details.
29  *
30  * You should have received a copy of the GNU Lesser General Public
31  * License along with this library; if not, write to the Free Software
32  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
33  */
34 
35 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
36 /* Compressed column sparse matrix (O-based, Fortran) */
37 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
38 
39 
40 #ifndef dyncompcol_h
41 #define dyncompcol_h
42 
43 #include "sparsemtrx.h"
44 #include "intarray.h"
45 
46 #define _IFT_DynCompCol_Name "dcsc"
47 
48 namespace oofem {
49 // alloc chunk for columns
50 #define DynCompCol_CHUNK 8
51 // turns on the stl set container, used to store column data, usually slower
52 //#define DynCompCol_USE_STL_SETS
53 
54 
55 #ifdef DynCompCol_USE_STL_SETS
56  #include <map>
57 #endif
58 
62 class OOFEM_EXPORT DynCompCol : public SparseMtrx
63 {
64 protected:
65 
66 #ifndef DynCompCol_USE_STL_SETS
67  FloatArray * * columns_; // data values per column
68  IntArray **rowind_; // row_ind per column
69 #else
70  std :: vector< std :: map< int, double > > columns;
71 #endif
72 
73  int base_; // index base: offset of first element
74 
75 public:
79  DynCompCol(int n);
83  DynCompCol();
85  DynCompCol(const DynCompCol & S);
87  DynCompCol &operator = ( const DynCompCol & C );
89  virtual ~DynCompCol();
90 
91  // Overloaded methods:
92  SparseMtrx *GiveCopy() const;
93  virtual void times(const FloatArray &x, FloatArray &answer) const;
94  virtual void timesT(const FloatArray &x, FloatArray &answer) const;
95  virtual void times(double x);
96  virtual int buildInternalStructure(EngngModel *, int, const UnknownNumberingScheme &);
97  virtual int assemble(const IntArray &loc, const FloatMatrix &mat);
98  virtual int assemble(const IntArray &rloc, const IntArray &cloc, const FloatMatrix &mat);
99  virtual bool canBeFactorized() const { return false; }
100  virtual void zero();
101  virtual const char* giveClassName() const { return "DynCompCol"; }
102  virtual SparseMtrxType giveType() const { return SMT_DynCompCol; }
103  virtual bool isAsymmetric() const { return true; }
104  virtual double &at(int i, int j);
105  virtual double at(int i, int j) const;
106  virtual void printStatistics() const;
107 
108  /*******************************/
109  /* Access and info functions */
110  /*******************************/
111 #ifndef DynCompCol_USE_STL_SETS
112  const IntArray *row_ind(int i) const { return rowind_ [ i ]; }
115  const FloatArray *column(int i) const { return columns_ [ i ]; }
116 #else
117  std :: map< int, double > *column(int i) const { return columns [ i ]; }
119 #endif
120 
121 protected:
122 
123  /***********************************/
124  /* General access function (slow) */
125  /***********************************/
127  double operator() (int i, int j) const;
129  double &operator() (int i, int j);
130 
131 #ifndef DynCompCol_USE_STL_SETS
132  int giveRowIndx(int col, int row) const;
135  int insertRowInColumn(int col, int row);
136 #endif
137 
138  void checkSizeTowards(IntArray &);
139  void checkSizeTowards(const IntArray &rloc, const IntArray &cloc);
140  void growTo(int);
141 };
142 } // end namespace oofem
143 #endif // dyncompcol_h
Dynamically growing compressed column.
Base class for all matrices stored in sparse format.
Definition: sparsemtrx.h:60
const FloatArray * column(int i) const
Returns column values.
Definition: dyncompcol.h:115
#define S(p)
Definition: mdm.C:481
Class implementing an array of integers.
Definition: intarray.h:61
virtual SparseMtrxType giveType() const
Sparse matrix type identification.
Definition: dyncompcol.h:102
Implementation of sparse matrix stored in compressed column storage.
Definition: dyncompcol.h:62
IntArray ** rowind_
Definition: dyncompcol.h:68
SparseMtrxType
Enumerative type used to identify the sparse matrix type.
virtual const char * giveClassName() const
Definition: dyncompcol.h:101
Abstract base class allowing to control the way, how equations are assigned to individual DOFs...
virtual bool isAsymmetric() const
Returns true if asymmetric.
Definition: dyncompcol.h:103
virtual bool canBeFactorized() const
Determines, whether receiver can be factorized.
Definition: dyncompcol.h:99
FloatArray ** columns_
Definition: dyncompcol.h:67
Class representing vector of real numbers.
Definition: floatarray.h:82
Implementation of matrix containing floating point numbers.
Definition: floatmatrix.h:94
Abstract base class representing the "problem" under consideration.
Definition: engngm.h:181
the oofem namespace is to define a context or scope in which all oofem names are defined.

This page is part of the OOFEM documentation. Copyright (c) 2011 Borek Patzak
Project e-mail: info@oofem.org
Generated at Tue Jan 2 2018 20:07:28 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011