Chi-Tech
dfem_diffusion_solver.h
Go to the documentation of this file.
1#ifndef DFEM_DIFFUSION_SOLVER_H
2#define DFEM_DIFFUSION_SOLVER_H
3
6
8#include "utils/chi_timer.h"
9
10#include "console/chi_console.h"
12
13#include "mesh/chi_mesh.h"
14
15#include <map>
16
17// forward declaration
18namespace chi_mesh
19{
20class MeshContinuum;
21typedef std::shared_ptr<MeshContinuum> MeshContinuumPtr;
22}
23namespace chi_math
24{
25class SpatialDiscretization;
26typedef std::shared_ptr<SpatialDiscretization> SDMPtr ;
27}
28
29namespace dfem_diffusion
30{
31/** DFEM diffusion solver
32 *
33*/
35{
36public:
38
40
41 size_t num_local_dofs_ = 0;
42 size_t num_globl_dofs_ = 0;
43
44 std::vector<double> field_;
45
46 Vec x_ = nullptr; // approx solution
47 Vec b_ = nullptr; // RHS
48 Mat A_ = nullptr; // linear system matrix
49
50 typedef std::pair<BoundaryType,std::vector<double>> BoundaryInfo;
51 typedef std::map<std::string, BoundaryInfo> BoundaryPreferences;
53 std::map<uint64_t, Boundary> boundaries_;
54
55 explicit Solver(const std::string& in_solver_name);
56 ~Solver() override;
57
58 // void Initialize() override;
59 void Initialize() override;
60 void Execute() override;
61
62 double HPerpendicular(const chi_mesh::Cell& cell, unsigned int f);
63
64 int MapFaceNodeDisc(const chi_mesh::Cell& cur_cell,
65 const chi_mesh::Cell& adj_cell,
66 const std::vector<chi_mesh::Vector3>& cc_node_locs,
67 const std::vector<chi_mesh::Vector3>& ac_node_locs,
68 size_t ccf, size_t acf,
69 size_t ccfi,
70 double epsilon=1.0e-12);
71
72 static double CallLua_iXYZFunction(lua_State* L,
73 const std::string&,
74 int,
75 const chi_mesh::Vector3&);
76
78};
79
80} // namespace dfem_diffusion
81
82
83#endif //DFEM_DIFFUSION_SOLVER_H
84
std::pair< BoundaryType, std::vector< double > > BoundaryInfo
std::map< uint64_t, Boundary > boundaries_
int MapFaceNodeDisc(const chi_mesh::Cell &cur_cell, const chi_mesh::Cell &adj_cell, const std::vector< chi_mesh::Vector3 > &cc_node_locs, const std::vector< chi_mesh::Vector3 > &ac_node_locs, size_t ccf, size_t acf, size_t ccfi, double epsilon=1.0e-12)
Solver(const std::string &in_solver_name)
BoundaryPreferences boundary_preferences_
static double CallLua_iXYZFunction(lua_State *L, const std::string &, int, const chi_mesh::Vector3 &)
std::map< std::string, BoundaryInfo > BoundaryPreferences
chi_mesh::MeshContinuumPtr grid_ptr_
double HPerpendicular(const chi_mesh::Cell &cell, unsigned int f)
std::vector< double > field_
std::shared_ptr< SpatialDiscretization > SDMPtr
std::shared_ptr< MeshContinuum > MeshContinuumPtr
Definition: chi_mesh.h:44
struct _p_Mat * Mat
struct _p_Vec * Vec