COOLFluiD  Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
BlockAccumulator.hpp
Go to the documentation of this file.
1 // Copyright (C) 2010-2013 von Karman Institute for Fluid Dynamics, Belgium
2 //
3 // This software is distributed under the terms of the
4 // GNU Lesser General Public License version 3 (LGPLv3).
5 // See doc/lgpl.txt and doc/gpl.txt for the license text.
6 
7 #ifndef cf3_Math_LSS_BlockAccumulator_hpp
8 #define cf3_Math_LSS_BlockAccumulator_hpp
9 
10 // blockaccumulator would keep local RealMatrix and rhs and solution together
11 // time splitting could be implemented here?
12 // multi rhs+sol thinggy?
13 // blockaccumulator should collect solution beforehand to avoid the mess of looking out for values in the big vector at assembly -> what if for example fvm looks for neighbours?
14 
16 
17 #include "math/MatrixTypes.hpp"
18 #include "math/LSS/LibLSS.hpp"
19 
21 
22 namespace cf3 {
23 namespace math {
24 namespace LSS {
25 
27 
29 public:
30 
32  void resize(Uint numnodes, Uint numeqs)
33  {
34  const Uint size=numnodes*numeqs;
35  mat.resize(size,size);
36  sol.resize(size);
37  rhs.resize(size);
38  indices.resize(numnodes);
39  };
40 
42  void reset(Real reset_to=0.)
43  {
44  mat.setConstant(reset_to);
45  sol.setConstant(reset_to);
46  rhs.setConstant(reset_to);
47  }
48 
50  template<typename T> void neighbour_indices(const T& idx_vector )
51  {
52  cf3_assert(indices.size()==idx_vector.size());
53  for (Uint i=0; i<(const Uint)indices.size(); i++)
54  indices[i]=idx_vector[i];
55  };
56 
58  Uint size() const { return sol.size(); };
59 
61  Uint block_size() const { return indices.size(); };
62 
65  Eigen::Matrix<Real, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> mat;
66 
69 
72 
74  std::vector<Uint> indices;
75 
76  // rest of the operations should directly be the stuff off eigen
77 
78 };
79 
81 
82 } // namespace LSS
83 } // namespace math
84 } // namespace cf3
85 
86 #endif // cf3_Math_LSS_BlockAccumulator_hpp
void resize(Uint numnodes, Uint numeqs)
setting up sizes
#define cf3_assert(a)
Definition: Assertions.hpp:93
void neighbour_indices(const T &idx_vector)
entering the indices where the local matrix is lying
#define LSS_API
Define the macro LSS_API.
Definition: LibLSS.hpp:22
std::vector< Uint > indices
local numbering of the unknowns
Uint size() const
how many rows/columns
Eigen::Matrix< Real, Eigen::Dynamic, 1 > RealVector
Dynamic sized column vector.
Definition: MatrixTypes.hpp:25
Top-level namespace for coolfluid.
Definition: Action.cpp:18
RealVector sol
accessor to blockaccumulator's solution vector
void reset(Real reset_to=0.)
reset the values to the value of reset_to
unsigned int Uint
typedef for unsigned int
Definition: CF.hpp:90
RealVector rhs
accessor to blockaccumulator's right hand side vector
Send comments to:
COOLFluiD Web Admin