@@ -61,7 +61,7 @@ syncronize(const double &t,
6161 update_functions_and_constraints (t);
6262 typename LAC::VectorType tmp (solution);
6363 typename LAC::VectorType tmp_dot (solution_dot);
64- constraints. distribute (tmp);
64+ train_constraints[ 0 ]-> distribute (tmp);
6565 constraints_dot.distribute (tmp_dot);
6666
6767 locally_relevant_solution = tmp;
@@ -84,7 +84,7 @@ syncronize(const double &t,
8484 update_functions_and_constraints (t);
8585 typename LAC::VectorType tmp (solution);
8686 typename LAC::VectorType tmp_dot (solution_dot);
87- constraints. distribute (tmp);
87+ train_constraints[ 0 ]-> distribute (tmp);
8888 constraints_dot.distribute (tmp_dot);
8989
9090 locally_relevant_solution = tmp;
@@ -98,8 +98,9 @@ syncronize(const double &t,
9898
9999 typename LAC::VectorType tmp (solution);
100100 typename LAC::VectorType tmp_dot (solution_dot);
101- constraints. distribute (tmp);
101+ train_constraints[ 0 ]-> distribute (tmp);
102102 constraints_dot.distribute (tmp_dot);
103+
103104 locally_relevant_solution = tmp;
104105 locally_relevant_solution_dot = tmp_dot;
105106 }
@@ -113,7 +114,7 @@ syncronize(const double &t,
113114
114115 typename LAC::VectorType tmp (solution);
115116 typename LAC::VectorType tmp_dot (solution_dot);
116- constraints. distribute (tmp);
117+ train_constraints[ 0 ]-> distribute (tmp);
117118 constraints_dot.distribute (tmp_dot);
118119
119120 locally_relevant_solution = tmp;
@@ -134,31 +135,38 @@ void piDoMUS<dim, spacedim, LAC>::update_functions_and_constraints (const double
134135 forcing_terms.set_time (t);
135136 neumann_bcs.set_time (t);
136137 }
138+
137139 // clear previously stored constraints
138- constraints.clear ();
140+ for (unsigned int i=0 ; i<n_matrices; ++i)
141+ train_constraints[i]->clear ();
139142 constraints_dot.clear ();
140143
141144 // compute hanging nodes
142145 DoFTools::make_hanging_node_constraints (*dof_handler,
143- constraints );
146+ *train_constraints[ 0 ] );
144147
145148 DoFTools::make_hanging_node_constraints (*dof_handler,
146149 constraints_dot);
147150
148- // compute boundary values
149- apply_dirichlet_bcs (*dof_handler, dirichlet_bcs, constraints);
151+ zero_average.apply_zero_average_constraints (*dof_handler, *train_constraints[0 ]);
152+
153+
154+
155+ // compute boundary values for the system matrix
156+ apply_dirichlet_bcs (*dof_handler, dirichlet_bcs, *train_constraints[0 ]);
150157 apply_dirichlet_bcs (*dof_handler, dirichlet_bcs_dot, constraints_dot);
151158
152159
153- // apply zero average constraints
154- zero_average.apply_zero_average_constraints (*dof_handler, constraints );
160+ // apply zero average constraints to the system matrix
161+ zero_average.apply_zero_average_constraints (*dof_handler, *train_constraints[ 0 ] );
155162
156163 // add user-supplied bcs
157- signals.update_constraint_matrices (constraints, constraints_dot);
164+ signals.update_constraint_matrices (train_constraints, constraints_dot);
158165
159166 // close the constraints
160- constraints.close ();
161- constraints_dot.close ();
167+ for (unsigned int i=0 ; i<n_matrices; ++i)
168+ train_constraints[i]->close ();
169+ constraints_dot.close ();
162170}
163171
164172template <int dim, int spacedim, typename LAC>
@@ -201,14 +209,14 @@ piDoMUS<dim, spacedim, LAC>::set_constrained_dofs_to_zero(typename LAC::VectorTy
201209 if (global_partitioning.n_elements () > 0 )
202210 {
203211 auto k = global_partitioning.nth_index_in_set (0 );
204- if (constraints. is_constrained (k))
212+ if (train_constraints[ 0 ]-> is_constrained (k))
205213 v[k] = 0 ;
206214 else
207215 v[k] = v[k];
208216 for (unsigned int i = 1 ; i < global_partitioning.n_elements (); ++i)
209217 {
210218 auto j = global_partitioning.nth_index_in_set (i);
211- if (constraints. is_constrained (j))
219+ if (train_constraints[ 0 ]-> is_constrained (j))
212220 v[j] = 0 ;
213221 }
214222 v.compress (VectorOperation::insert);
0 commit comments