@@ -53,20 +53,24 @@ namespace ConvectionDiffusionPlugin {
53
53
template <int dim>
54
54
class cd_sss_data
55
55
{
56
+ public:
57
+ typedef SmartPtr<CplUserData<number, dim> > user_data_type;
56
58
/* * the data for the source/sink:
57
59
* [0]: total contaminant flux through the point
58
60
*/
59
- MathVector<1 > m_values;
61
+ protected:
62
+ // MathVector<1> m_values;
63
+ number m_values;
60
64
61
- SmartPtr<UserData<MathVector< 1 >, dim> > m_spData; // /< an alternative method to specify the data
65
+ user_data_type m_spData; // /< an alternative method to specify the data
62
66
63
67
public:
64
68
65
69
// / class construction (there must exist a 'dummy' constructor!)
66
- cd_sss_data () {m_values [ 0 ] = 0 ;}
70
+ cd_sss_data () {m_values = 0 ;}
67
71
68
72
// / returns the flux
69
- number flux () {return m_values [ 0 ] ;}
73
+ number flux () {return m_values ;}
70
74
71
75
// / computes the data from the user data object
72
76
void compute
@@ -83,21 +87,22 @@ class cd_sss_data
83
87
// / sets the data
84
88
void set (number flux)
85
89
{
86
- m_values[ 0 ] = flux;
90
+ m_values = flux;
87
91
m_spData = SPNULL;
88
92
}
89
93
90
94
// / sets the data by an object
91
- void set (SmartPtr<UserData<MathVector< 1 >, dim> > spData)
95
+ void set (user_data_type spData)
92
96
{
93
97
m_spData = spData;
94
98
}
95
-
99
+
100
+ #ifdef UG_FOR_LUA
96
101
// / set as a LUA function
97
102
void set (LuaFunctionHandle func)
98
- {
99
- m_spData = make_sp ( new LuaUserData<MathVector< 1 >, dim> (func));
100
- }
103
+ { m_spData = make_sp ( new LuaUserData<number, dim> (func)); }
104
+ # endif
105
+
101
106
};
102
107
103
108
/* * Class for markers of the point sources and sinks
@@ -186,7 +191,10 @@ template <int dim> class cd_line_sss_data : public cd_sss_data<dim>, public line
186
191
template <int dim>
187
192
class CDSingularSourcesAndSinks
188
193
: public FVSingularSourcesAndSinks<dim, cd_point_sss_data<dim>, cd_line_sss_data<dim> >
189
- {};
194
+ {
195
+ public:
196
+ typedef cd_point_sss_data<dim> user_data_type;
197
+ };
190
198
191
199
} // namespace ConvectionDiffusionPlugin
192
200
} // end namespace ug
0 commit comments