@@ -120,7 +120,8 @@ evaluate_thermal_physics_impl(
120
120
121
121
// Compute the source term.
122
122
// TODO do this on the GPU
123
- heat_sources.update_time (t);
123
+ auto host_heat_sources = heat_sources.copy_to_host ();
124
+ host_heat_sources.update_time (t);
124
125
dealii::LA::distributed::Vector<double , dealii::MemorySpace::Host> source (
125
126
y.get_partitioner ());
126
127
source = 0 .;
@@ -165,7 +166,7 @@ evaluate_thermal_physics_impl(
165
166
double const inv_rho_cp = thermal_operator_dev->get_inv_rho_cp (cell, q);
166
167
double quad_pt_source = 0 .;
167
168
dealii::Point<dim> const &q_point = fe_values.quadrature_point (q);
168
- quad_pt_source += heat_sources .value (q_point, current_source_height);
169
+ quad_pt_source += host_heat_sources .value (q_point, current_source_height);
169
170
170
171
cell_source[i] += inv_rho_cp * quad_pt_source *
171
172
fe_values.shape_value (i, q) * fe_values.JxW (q);
@@ -464,7 +465,8 @@ ThermalPhysics<dim, p_order, fe_degree, MaterialStates, MemorySpaceType,
464
465
cell->set_active_fe_index (1 );
465
466
}
466
467
467
- _current_source_height = _heat_sources.get_current_height (0.0 );
468
+ auto host_heat_sources = _heat_sources.copy_to_host ();
469
+ _current_source_height = host_heat_sources.get_current_height (0.0 );
468
470
}
469
471
470
472
template <int dim, int p_order, int fe_degree, typename MaterialStates,
@@ -818,7 +820,7 @@ double ThermalPhysics<dim, p_order, fe_degree, MaterialStates, MemorySpaceType,
818
820
dealii::LA::distributed::Vector<double , MemorySpaceType> &solution,
819
821
std::vector<Timer> &timers)
820
822
{
821
- _current_source_height = _heat_sources.get_current_height (t);
823
+ _current_source_height = _heat_sources.copy_to_host (). get_current_height (t);
822
824
823
825
auto eval = [&](double const t, LA_Vector const &y)
824
826
{ return evaluate_thermal_physics (t, y, timers); };
0 commit comments