Chi-Tech
cfem_diffusion_solver.h
Go to the documentation of this file.
1#ifndef CFEM_DIFFUSION_SOLVER_H
2#define CFEM_DIFFUSION_SOLVER_H
3
6
8#include "utils/chi_timer.h"
9
10#include "console/chi_console.h"
11
12#include <map>
13
14#include "mesh/chi_mesh.h"
15
16// forward declaration
17namespace chi_mesh
18{
19class MeshContinuum;
20typedef std::shared_ptr<MeshContinuum> MeshContinuumPtr;
21}
22namespace chi_math
23{
24class SpatialDiscretization;
25typedef std::shared_ptr<SpatialDiscretization> SDMPtr ;
26}
27
28namespace cfem_diffusion
29{
30/** CFEM diffusion solver
31 *
32*/
34{
35public:
37
39
40 size_t num_local_dofs_ = 0;
41 size_t num_globl_dofs_ = 0;
42
43 Vec x_ = nullptr; // approx solution
44 Vec b_ = nullptr; // RHS
45 Mat A_ = nullptr; // linear system matrix
46
47 typedef std::pair<BoundaryType,std::vector<double>> BoundaryInfo;
48 typedef std::map<std::string, BoundaryInfo> BoundaryPreferences;
50 std::map<uint64_t, Boundary> boundaries_;
51
52 explicit Solver(const std::string& in_solver_name);
53 ~Solver() override;
54
55 // void Initialize() override;
56 void Initialize() override;
57
58 void Execute() override;
59
60 static double CallLua_iXYZFunction(lua_State* L,
61 const std::string&,
62 int,
63 const chi_mesh::Vector3&);
64
66};
67
68} // namespace cfem_diffusion
69
70
71#endif //CFEM_DIFFUSION_SOLVER_H
72
Solver(const std::string &in_solver_name)
std::map< uint64_t, Boundary > boundaries_
BoundaryPreferences boundary_preferences_
std::map< std::string, BoundaryInfo > BoundaryPreferences
chi_mesh::MeshContinuumPtr grid_ptr_
static double CallLua_iXYZFunction(lua_State *L, const std::string &, int, const chi_mesh::Vector3 &)
std::pair< BoundaryType, std::vector< double > > BoundaryInfo
std::shared_ptr< SpatialDiscretization > SDMPtr
std::shared_ptr< MeshContinuum > MeshContinuumPtr
Definition: chi_mesh.h:44
struct _p_Mat * Mat
struct _p_Vec * Vec