smatrix.hh

Go to the documentation of this file.
1 
9 #ifndef smatrix_hh
10 #define smatrix_hh
11 
12 #include "basics/outputOperator.hh"
13 #include "basics/typedefs.hh"
14 #include "toolbox/array.hh"
15 
16 namespace concepts {
17 
18  // forward declaration
19  template<class F>
20  class TColumn;
21 
22  template<class F>
23  class ShapeFunction1D;
24 
25  // *********************************************************** SMatrixBase **
26 
54  template<class F>
55  class SMatrixBase : public virtual OutputOperator {
56  public:
58  virtual void operator()(const TColumn<F>& src, TColumn<F>& dest) const = 0;
59 
61  virtual uint size() const = 0;
62  protected:
63  virtual std::ostream& info(std::ostream& os) const;
64  };
65 
66  // ************************************************************* SMatrix1D **
67 
79  class SMatrix1D : public SMatrixBase<Real> {
80  public:
97  const ShapeFunction1D<Real>& left,
98  const ShapeFunction1D<Real>& right);
99 
111  SMatrix1D(const SMatrix1D& s, const bool flip = false);
112  virtual void operator()(const TColumn<Real>& src,
113  TColumn<Real>& dest) const;
115  void scale(const Real factor);
116  virtual uint size() const;
117  protected:
118  virtual std::ostream& info(std::ostream& os) const;
119  private:
121  const uint n_;
122 
134 
144 
153  };
154 
155  // ********************************************************* SMatrixTensor **
156 
167  template<class F, int dim>
168  class SMatrixTensor : public SMatrixBase<F> {
169  public:
175  SMatrixTensor(const SMatrixBase<F>& matrix, const uint position);
176  virtual void operator()(const TColumn<F>& src, TColumn<F>& dest) const;
177  virtual uint size() const;
178  protected:
179  virtual std::ostream& info(std::ostream& os) const;
180  private:
182  const uint position_;
183  };
184 
185  // ******************************************************** SMatrixCompose **
186 
191  template<class F>
192  class SMatrixCompose : public SMatrixBase<F> {
193  public:
199  inline SMatrixCompose(const SMatrixBase<F>& A, const SMatrixBase<F>& B,
200  const SMatrixBase<F>* C = 0) : A_(A), B_(B), C_(C) {}
201  virtual void operator()(const TColumn<F>& src, TColumn<F>& dest) const;
202  virtual uint size() const;
203  protected:
204  virtual std::ostream& info(std::ostream& os) const;
205  private:
212  };
213 
214 
215  // ************************************************** SMatrixGeneralTensor **
216 
228  template<class F, int dim>
229  class SMatrixGeneralTensor : public SMatrixBase<F> {
230  public:
238  SMatrixGeneralTensor(const SMatrixBase<F>& matrix, const uint* n,
239  const uint position);
246  SMatrixGeneralTensor(const SMatrixBase<F>& matrix, const uint position);
247  virtual void operator()(const TColumn<F>& src, TColumn<F>& dest) const;
248  virtual uint size() const;
249  protected:
250  virtual std::ostream& info(std::ostream& os) const;
251  private:
253  uint n_[dim];
254  const uint position_;
255  };
256 
257 
258  // ********************************************************** SMatrixBlock **
259 
273  template<class F, int dim>
274  class SMatrixBlock : public SMatrixBase<F> {
275  public:
282  const SMatrixBase<F>* C = 0);
283  virtual void operator()(const TColumn<F>& src, TColumn<F>& dest) const;
285  inline uint size() const { return size_; }
286  protected:
287  virtual std::ostream& info(std::ostream& os) const;
288  private:
296  uint* n_;
298  uint size_;
299  };
300 
301 } // namespace concepts
302 
303 #endif // smatrix_hh
uint * n_
Size of the matrices.
Definition: smatrix.hh:296
A column of a T matrix.
Definition: analytical.hh:18
virtual std::ostream & info(std::ostream &os) const
virtual void operator()(const TColumn< F > &src, TColumn< F > &dest) const =0
Application operator.
virtual uint size() const
Returns the size of the S matrix.
virtual void operator()(const TColumn< F > &src, TColumn< F > &dest) const
Application operator.
S matrix for elements in dimensions 2 and 3 with tensorized shape functions.
Definition: space.hh:34
virtual std::ostream & info(std::ostream &os) const
const SMatrixBase< F > * C_
Third, optional factor.
Definition: smatrix.hh:211
uint size_
Aggregate size of S matrix.
Definition: smatrix.hh:298
const SMatrixBase< Real > & matrix_
Definition: smatrix.hh:181
S matrix for elements in dimensions 2 and 3 with tensorized shape functions, with arbitrary number of...
Definition: smatrix.hh:229
virtual std::ostream & info(std::ostream &os) const
virtual void operator()(const TColumn< F > &src, TColumn< F > &dest) const
Application operator.
SMatrixGeneralTensor(const SMatrixBase< F > &matrix, const uint position)
Constructor, where number of shapefunctions is in all directions equal and taken from matrix.
const SMatrixBase< F > & B_
Second block.
Definition: smatrix.hh:292
S matrix in block form for tensorised shape functions.
Definition: smatrix.hh:274
virtual void operator()(const TColumn< Real > &src, TColumn< Real > &dest) const
Application operator.
const uint n_
Size of the S matrices.
Definition: smatrix.hh:121
virtual uint size() const
Returns the size of the S matrix.
void scale(const Real factor)
scales the S Matrix by a factor, used for edge elements
SMatrix1D(const ShapeFunction1D< Real > &small, const ShapeFunction1D< Real > &left, const ShapeFunction1D< Real > &right)
Constructor.
const SMatrixBase< F > & B_
Second factor.
Definition: smatrix.hh:209
virtual std::ostream & info(std::ostream &os) const
virtual uint size() const
SMatrix1D(const SMatrix1D &s, const bool flip=false)
Modified copy constructor.
SMatrixBlock(const SMatrixBase< F > &A, const SMatrixBase< F > &B, const SMatrixBase< F > *C=0)
Constructor.
An abstract class for an S matrix.
virtual std::ostream & info(std::ostream &os) const
Array< Real > data_
Data of the S matrices.
Definition: smatrix.hh:133
virtual uint size() const =0
Returns the size of the S matrix.
SMatrixCompose(const SMatrixBase< F > &A, const SMatrixBase< F > &B, const SMatrixBase< F > *C=0)
Constructor.
Definition: smatrix.hh:199
virtual uint size() const
uint size() const
Returns the size of the S matrix (number of rows or columns)
Definition: smatrix.hh:285
SMatrixGeneralTensor(const SMatrixBase< F > &matrix, const uint *n, const uint position)
Constructor.
Real * right_
Data for the S matrix of the right subelement.
Definition: smatrix.hh:152
const SMatrixBase< Real > & matrix_
Definition: smatrix.hh:252
const SMatrixBase< F > & A_
First block.
Definition: smatrix.hh:290
const SMatrixBase< F > & A_
First factor.
Definition: smatrix.hh:207
Composing S matrices.
Definition: smatrix.hh:192
SMatrixTensor(const SMatrixBase< F > &matrix, const uint position)
Constructor.
virtual void operator()(const TColumn< F > &src, TColumn< F > &dest) const
const uint position_
Definition: smatrix.hh:182
const SMatrixBase< F > * C_
Third, optional block.
Definition: smatrix.hh:294
Real * left_
Data for the S matrix of the left subelement.
Definition: smatrix.hh:143
One dimensional S matrix.
Definition: smatrix.hh:79
double Real
Type normally used for a floating point number.
Definition: typedefs.hh:36
Basic namespace for Concepts-2.
Definition: pml_formula.h:16
virtual std::ostream & info(std::ostream &os) const
virtual void operator()(const TColumn< F > &src, TColumn< F > &dest) const
Application operator.
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich