IFEM  90A354
BlockElmMats.h
Go to the documentation of this file.
1 // $Id$
2 //==============================================================================
12 //==============================================================================
13 
14 #ifndef _BLOCK_ELM_MATS_H
15 #define _BLOCK_ELM_MATS_H
16 
17 #include "ElmMats.h"
18 
19 
29 class BlockElmMats : public ElmMats
30 {
31 public:
35  BlockElmMats(size_t nBlk, size_t nBas) :
36  neldof(0), blockInfo(nBlk), basisInfo(nBas) {}
38  virtual ~BlockElmMats() {}
39 
40  using ElmMats::redim;
48  bool redim(size_t blkIndex, size_t nen, size_t ncmp = 1, char basis = 1);
55  bool redimOffDiag(size_t blkIndex, char symmetric = 1);
59  bool finalize();
60 
62  virtual const Matrix& getNewtonMatrix() const;
64  virtual const Vector& getRHSVector() const;
65 
66 private:
68  struct Block
69  {
70  char basis;
71  size_t ncmp;
72  size_t idof;
73 
75  Block(size_t c = 0, char b = 0) : basis(b), ncmp(c), idof(0) {}
76  };
77 
79  struct Basis
80  {
81  size_t nen;
82  size_t ncmp;
83 
85  Basis() : nen(0), ncmp(0) {}
86  };
87 
88  size_t neldof;
89  std::vector<Block> blockInfo;
90  std::vector<Basis> basisInfo;
91  std::vector<char> symmFlag;
92 };
93 
94 #endif
Representation of the element matrices for a FEM problem.
Class representing the block element matrices for a FEM problem.
Definition: BlockElmMats.h:30
virtual const Matrix & getNewtonMatrix() const
Returns the element-level Newton matrix.
Definition: BlockElmMats.C:104
std::vector< char > symmFlag
Symmetry flag for off-diagonal blocks.
Definition: BlockElmMats.h:91
size_t neldof
Size of newton matrix.
Definition: BlockElmMats.h:88
bool redimOffDiag(size_t blkIndex, char symmetric=1)
Sets the dimension of an off-diagonal block sub-matrix.
Definition: BlockElmMats.C:51
virtual const Vector & getRHSVector() const
Returns the element-level right-hand-side vector.
Definition: BlockElmMats.C:174
bool finalize()
Calculates the dimension of the Newton matrix.
Definition: BlockElmMats.C:76
std::vector< Block > blockInfo
Block information.
Definition: BlockElmMats.h:89
BlockElmMats(size_t nBlk, size_t nBas)
The constructor initializes the block information arrays.
Definition: BlockElmMats.h:35
std::vector< Basis > basisInfo
Basis information.
Definition: BlockElmMats.h:90
virtual ~BlockElmMats()
Empty destructor.
Definition: BlockElmMats.h:38
void redim(size_t ndim)
Sets the dimension of the element matrices and vectors.
Definition: ElmMats.C:25
Class collecting the element matrices associated with a FEM problem.
Definition: ElmMats.h:34
std::vector< Vector > b
The element right-hand-side vectors.
Definition: ElmMats.h:73
std::vector< double > c
The scalar quantities.
Definition: ElmMats.h:74
void redim(size_t ndim)
Sets the dimension of the element matrices and vectors.
Definition: ElmMats.C:25
A vector class with some added algebraic operations.
Definition: matrix.h:64
A struct with some key parameters for each basis.
Definition: BlockElmMats.h:80
size_t nen
Number of element nodes for the basis.
Definition: BlockElmMats.h:81
Basis()
Default constructor.
Definition: BlockElmMats.h:85
size_t ncmp
Number of nodal components for the basis.
Definition: BlockElmMats.h:82
A struct with some key parameters for each block.
Definition: BlockElmMats.h:69
char basis
Basis associated with the block.
Definition: BlockElmMats.h:70
size_t ncmp
Number of nodal components for the block.
Definition: BlockElmMats.h:71
size_t idof
The first element DOF of the block.
Definition: BlockElmMats.h:72
Block(size_t c=0, char b=0)
Default constructor.
Definition: BlockElmMats.h:75