OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
 
Loading...
Searching...
No Matches
System.hpp
1/*
2 * System.hpp
3 *
4 * Created on: Oct 5, 2015
5 * Author: i-bird
6 */
7
8#ifndef OPENFPM_NUMERICS_SRC_FINITEDIFFERENCE_SYSTEM_HPP_
9#define OPENFPM_NUMERICS_SRC_FINITEDIFFERENCE_SYSTEM_HPP_
10
11
22template<unsigned int dim, unsigned int nvf, unsigned int ncf, typename ... eqs>
23class System
24{
25 // Define the number of constant fields
26 typedef num_cfields boost::mpl::int_<nf>;
27
28 // Define the number of variable fields
29 typedef num_vfields boost::mpl::int_<nf>;
30
31 // set of equations as boost::mpl::vector
32 typedef eqs_v make_vactor<eqs>;
33
39 template<unsigned int ord=EQS_FIELDS> void value(const grid_key_dx_dist<dim> & pos)
40 {
41 if (EQS_FIELDS)
42 value_f(pos);
43 else
44 value_s(pos);
45 }
46
51 template<unsigned int eq_id> void value_s(grid_key_dx_dist<dim> & it)
52 {
53 boost::mpl::at<eqs_v,boost::mpl::int_<eq_id>>::type eq;
54
55 eq.value_s(it);
56 }
57
62 template<unsigned int eq_id> void value_f(grid_key_dx_dist<dim> & it)
63 {
64 boost::mpl::at<eqs_v,boost::mpl::int_<eq_id>>::type eq;
65
66 eq.value_f(it);
67 }
68};
69
70
71#endif /* OPENFPM_NUMERICS_SRC_FINITEDIFFERENCE_SYSTEM_HPP_ */
System of equations.
Definition System.hpp:24
void value(const grid_key_dx_dist< dim > &pos)
Create the row of the Matrix.
Definition System.hpp:39
void value_f(grid_key_dx_dist< dim > &it)
fill the row
Definition System.hpp:62
void value_s(grid_key_dx_dist< dim > &it)
fill the row
Definition System.hpp:51