OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
symcompcol.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 // Inspired by SPARSELib++
36 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
37 /* ******** *** SparseLib++ */
38 /* ******* ** *** *** *** v. 1.5c */
39 /* ***** *** ******** ******** */
40 /* ***** *** ******** ******** R. Pozo */
41 /* ** ******* *** ** *** *** K. Remington */
42 /* ******** ******** A. Lumsdaine */
43 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
44 /* */
45 /* */
46 /* SparseLib++ : Sparse Matrix Library */
47 /* */
48 /* National Institute of Standards and Technology */
49 /* University of Notre Dame */
50 /* Authors: R. Pozo, K. Remington, A. Lumsdaine */
51 /* */
52 /* NOTICE */
53 /* */
54 /* Permission to use, copy, modify, and distribute this software and */
55 /* its documentation for any purpose and without fee is hereby granted */
56 /* provided that the above notice appear in all copies and supporting */
57 /* documentation. */
58 /* */
59 /* Neither the Institutions (National Institute of Standards and Technology, */
60 /* University of Notre Dame) nor the Authors make any representations about */
61 /* the suitability of this software for any purpose. This software is */
62 /* provided ``as is'' without expressed or implied warranty. */
63 /* */
64 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
65 
66 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
67 /* Compressed column sparse matrix (O-based, Fortran) */
68 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
69 
70 
71 #ifndef symcompcol_h
72 #define symcompcol_h
73 
74 #include "compcol.h"
75 
76 namespace oofem {
81 class OOFEM_EXPORT SymCompCol : public CompCol
82 {
83 public:
90  SymCompCol(int n);
96  SymCompCol();
98  SymCompCol(const SymCompCol & S);
100  virtual ~SymCompCol() { }
101 
102  // Overloaded methods
103  virtual SparseMtrx *GiveCopy() const;
104  virtual void times(const FloatArray &x, FloatArray &answer) const;
105  virtual void timesT(const FloatArray &x, FloatArray &answer) const { this->times(x, answer); }
106  virtual void times(double x);
107  virtual int buildInternalStructure(EngngModel *, int, const UnknownNumberingScheme &);
108  virtual int assemble(const IntArray &loc, const FloatMatrix &mat);
109  virtual int assemble(const IntArray &rloc, const IntArray &cloc, const FloatMatrix &mat);
110  virtual bool canBeFactorized() const { return false; }
111  virtual void zero();
112  virtual double &at(int i, int j);
113  virtual double at(int i, int j) const;
114  virtual const char* giveClassName() const { return "SymCompCol"; }
115  virtual SparseMtrxType giveType() const { return SMT_SymCompCol; }
116  virtual bool isAntisymmetric() const { return false; }
117 
118 
119  const double &val(int i) const { return val_(i); }
120  const int &row_ind(int i) const { return rowind_(i); }
121  const int &col_ptr(int i) const { return colptr_(i); }
122  int dim(int i) const { return dim_ [ i ]; }
123 
124 protected:
125  /*******************************/
126  /* Access and info functions */
127  /*******************************/
128 
129  double &val(int i) { return val_(i); }
130  int &row_ind(int i) { return rowind_(i); }
131  int &col_ptr(int i) { return colptr_(i); }
132 
133  int size(int i) const { return dim_ [ i ]; }
134  int NumNonzeros() const { return nz_; }
135  int base() const { return base_; }
136 
137  /***********************************/
138  /* General access function (slow) */
139  /***********************************/
141  double operator() (int i, int j) const;
143  double &operator() (int i, int j);
144 };
145 } // end namespace oofem
146 #endif // symcompcol_h
virtual ~SymCompCol()
Destructor.
Definition: symcompcol.h:100
Base class for all matrices stored in sparse format.
Definition: sparsemtrx.h:60
double & val(int i)
Definition: symcompcol.h:129
virtual bool isAntisymmetric() const
Definition: symcompcol.h:116
const int & col_ptr(int i) const
Definition: symcompcol.h:121
#define S(p)
Definition: mdm.C:481
int size(int i) const
Definition: symcompcol.h:133
Class implementing an array of integers.
Definition: intarray.h:61
virtual const char * giveClassName() const
Definition: symcompcol.h:114
const double & val(int i) const
Definition: symcompcol.h:119
virtual bool canBeFactorized() const
Determines, whether receiver can be factorized.
Definition: symcompcol.h:110
Symmetric compressed column.
SparseMtrxType
Enumerative type used to identify the sparse matrix type.
int & col_ptr(int i)
Definition: symcompcol.h:131
Abstract base class allowing to control the way, how equations are assigned to individual DOFs...
virtual void timesT(const FloatArray &x, FloatArray &answer) const
Evaluates .
Definition: symcompcol.h:105
Implementation of symmetric sparse matrix stored using compressed column/row storage.
Definition: symcompcol.h:81
Class representing vector of real numbers.
Definition: floatarray.h:82
virtual SparseMtrxType giveType() const
Sparse matrix type identification.
Definition: symcompcol.h:115
Implementation of matrix containing floating point numbers.
Definition: floatmatrix.h:94
int & row_ind(int i)
Definition: symcompcol.h:130
int NumNonzeros() const
Definition: symcompcol.h:134
const int & row_ind(int i) const
Definition: symcompcol.h:120
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.
int dim(int i) const
Definition: symcompcol.h:122
int base() const
Definition: symcompcol.h:135

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:31 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011