OOFEM 3.0
Loading...
Searching...
No Matches
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 - 2025 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
48namespace 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
58{
59protected:
60 std::vector<FloatArray> columns; // data values per column
61 std::vector<IntArray> rowind; // row_ind per column
62
63 int base; // index base: offset of first element
64
65public:
69 DynCompCol(int n=0);
71 DynCompCol(const DynCompCol & S);
73 DynCompCol &operator = ( const DynCompCol & C );
75 virtual ~DynCompCol() {}
76
77 // Overloaded methods:
78 std::unique_ptr<SparseMtrx> clone() const override;
79 void times(const FloatArray &x, FloatArray &answer) const override;
80 void timesT(const FloatArray &x, FloatArray &answer) const override;
81 void times(double x) override;
82 int buildInternalStructure(EngngModel *, int, const UnknownNumberingScheme &) override;
83 int assemble(const IntArray &loc, const FloatMatrix &mat) override;
84 int assemble(const IntArray &rloc, const IntArray &cloc, const FloatMatrix &mat) override;
85 bool canBeFactorized() const override { return false; }
86 void zero() override;
87 const char* giveClassName() const override { return "DynCompCol"; }
88 SparseMtrxType giveType() const override { return SMT_DynCompCol; }
89 bool isAsymmetric() const override { return true; }
90 double &at(int i, int j) override;
91 double at(int i, int j) const override;
92 void printStatistics() const override;
93
94 /*******************************/
95 /* Access and info functions */
96 /*******************************/
98 const IntArray &row_ind(int i) const { return rowind[ i ]; }
100 const FloatArray &column(int i) const { return columns[ i ]; }
101
102protected:
103
104 /***********************************/
105 /* General access function (slow) */
106 /***********************************/
108 double operator() (int i, int j) const;
110 double &operator() (int i, int j);
111
113 int giveRowIndx(int col, int row) const;
115 int insertRowInColumn(int col, int row);
116
117 void checkSizeTowards(IntArray &);
118 void checkSizeTowards(const IntArray &rloc, const IntArray &cloc);
119 void growTo(int);
120};
121} // end namespace oofem
122#endif // dyncompcol_h
const char * giveClassName() const override
Definition dyncompcol.h:87
DynCompCol(int n=0)
Definition dyncompcol.C:54
std::vector< IntArray > rowind
Definition dyncompcol.h:61
std::vector< FloatArray > columns
Definition dyncompcol.h:60
SparseMtrxType giveType() const override
Sparse matrix type identification.
Definition dyncompcol.h:88
const IntArray & row_ind(int i) const
Returns row index for i-th column.
Definition dyncompcol.h:98
bool canBeFactorized() const override
Determines, whether receiver can be factorized.
Definition dyncompcol.h:85
bool isAsymmetric() const override
Returns true if asymmetric.
Definition dyncompcol.h:89
virtual ~DynCompCol()
Destructor.
Definition dyncompcol.h:75
const FloatArray & column(int i) const
Returns column values.
Definition dyncompcol.h:100
SparseMtrx(int n=0, int m=0)
Definition sparsemtrx.h:89
#define S(p)
Definition mdm.C:469
FloatArrayF< N > assemble(const FloatArrayF< M > &x, int const (&c)[M])
Assemble components into zero matrix.
FloatMatrixF< N, M > zero()
Constructs a zero matrix (this is the default behavior when constructing a matrix,...
@ SMT_DynCompCol
Dynamically growing compressed column.
#define OOFEM_EXPORT
Definition oofemcfg.h:7

This page is part of the OOFEM-3.0 documentation. Copyright Copyright (C) 1994-2025 Borek Patzak Bořek Patzák
Project e-mail: oofem@fsv.cvut.cz
Generated at for OOFEM by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2011