@@ -50,7 +50,8 @@ MeshFunction::MeshFunction (const EquationSystems & eqn_systems,
50
50
_vector (vec ),
51
51
_dof_map (dof_map ),
52
52
_system_vars (std ::move (vars )),
53
- _out_of_mesh_mode (false)
53
+ _out_of_mesh_mode (false),
54
+ _new_resize (0 )
54
55
{
55
56
}
56
57
@@ -67,7 +68,8 @@ MeshFunction::MeshFunction (const EquationSystems & eqn_systems,
67
68
_vector (vec ),
68
69
_dof_map (dof_map ),
69
70
_system_vars (1 ,var ),
70
- _out_of_mesh_mode (false )
71
+ _out_of_mesh_mode (false ),
72
+ _new_resize (0 )
71
73
{
72
74
}
73
75
@@ -78,7 +80,8 @@ MeshFunction::MeshFunction (const MeshFunction & mf):
78
80
_vector (mf ._vector ),
79
81
_dof_map (mf ._dof_map ),
80
82
_system_vars (mf ._system_vars ),
81
- _out_of_mesh_mode (mf ._out_of_mesh_mode )
83
+ _out_of_mesh_mode (mf ._out_of_mesh_mode ),
84
+ _new_resize (0 )
82
85
{
83
86
// Initialize the mf and set the point locator if the
84
87
// input mf had done so.
@@ -118,8 +121,31 @@ void MeshFunction::init ()
118
121
const MeshBase & mesh = this -> _eqn_systems .get_mesh ();
119
122
_point_locator = mesh .sub_point_locator ();
120
123
121
- // ready for use
122
- this -> _initialized = true;
124
+ int vec_dim = 0 ;
125
+ int n_vector_vars = 0 ;
126
+ int n_scalar_vars = 0 ;
127
+
128
+ int total_variables = _dof_map .n_variables ();
129
+ const MeshBase & mesh = this -> _eqn_systems .get_mesh ();
130
+ _point_locator = mesh .sub_point_locator ();
131
+
132
+ for (int i = 0 ; i < total_variables ; ++ i )
133
+ {
134
+ FEType fe_type = _dof_map .variable_type (i );
135
+ if (fe_type != SCALAR )
136
+ {
137
+ n_vector_vars ++ ;
138
+ int vector_dim = FEInterface ::n_vec_dim (mesh , fe_type );
139
+ if (vector_dim > vec_dim )
140
+ vec_dim = vector_dim ;
141
+ }
142
+ else
143
+ n_scalar_vars ++ ;
144
+
145
+ }
146
+
147
+ // ready for use
148
+ this -> _initialized = true;
123
149
}
124
150
125
151
0 commit comments