MoCSI API Reference
Loading...
Searching...
No Matches
GridBase.h
Go to the documentation of this file.
1#ifndef GRID_BASE_H
2#define GRID_BASE_H
3
4#include <memory>
5
7#include "GenericElement.h"
8#include "ShapeBase.h"
10
15template <typename T>
17{
18 protected:
20 int grid_size{-1};
21 std::shared_ptr<ShapeBase<T>> m_poly_mesh{};
23 std::vector<std::unique_ptr<GenericElement<T>>> all_cells{};
24
25 public:
26 std::vector<std::unique_ptr<GenericElement<T>>>& getCells()
27 {
29 return all_cells;
30 }
31
32 virtual void createGrid() = 0;
33
34 void setMesh(std::shared_ptr<ShapeBase<T>> mesh);
35 int getGridSize() const { return grid_size; }
36
37 GridBase();
39 ~GridBase() = default;
40};
41
45template <typename T>
49
55template <typename T>
57 : sim{sim_ptr}, m_poly_mesh{mesh_ptr}
58{
59}
60
67template <typename T>
69{
70 this->m_poly_mesh = mesh;
71}
72
73#endif
Concrete implementation of a matrix class representing a Compressed Sparse Rows (CSR) matrix....
Definition CsrMatrix.h:37
CsrSparseMatrix()
Constructor for an empty CsrSparseMatrix object. Leaves all storage arrays empty but sets the flag to...
Definition CsrMatrix.h:94
Definition GridBase.h:17
std::vector< std::unique_ptr< GenericElement< T > > > all_cells
Definition GridBase.h:23
std::shared_ptr< ShapeBase< T > > m_poly_mesh
Definition GridBase.h:21
bool can_contain_nullptrs
Definition GridBase.h:19
GridBase()
Default Constructor.
Definition GridBase.h:46
void setMesh(std::shared_ptr< ShapeBase< T > > mesh)
Sets the bounding surface mesh for the object, if a mesh is used.
Definition GridBase.h:68
virtual void createGrid()=0
~GridBase()=default
int grid_size
Definition GridBase.h:20
int getGridSize() const
Definition GridBase.h:35
std::vector< std::unique_ptr< GenericElement< T > > > & getCells()
Definition GridBase.h:26
SimulationClassBase< T > * sim
Definition GridBase.h:22