24 template <
int dim,
int spacedim>
34 , cell_quadrature(quadrature)
35 , face_quadrature(face_quadrature)
36 , cell_update_flags(update_flags)
37 , neighbor_cell_update_flags(update_flags)
38 , face_update_flags(face_update_flags)
39 , neighbor_face_update_flags(face_update_flags)
40 , local_dof_indices(fe.dofs_per_cell)
41 , neighbor_dof_indices(fe.dofs_per_cell)
46 template <
int dim,
int spacedim>
58 , cell_quadrature(quadrature)
59 , face_quadrature(face_quadrature)
60 , cell_update_flags(update_flags)
61 , neighbor_cell_update_flags(neighbor_update_flags)
62 , face_update_flags(face_update_flags)
63 , neighbor_face_update_flags(neighbor_face_update_flags)
64 , local_dof_indices(fe.dofs_per_cell)
65 , neighbor_dof_indices(fe.dofs_per_cell)
70 template <
int dim,
int spacedim>
87 template <
int dim,
int spacedim>
100 neighbor_update_flags,
103 neighbor_face_update_flags)
108 template <
int dim,
int spacedim>
111 : mapping(scratch.mapping)
113 , cell_quadrature(scratch.cell_quadrature)
114 , face_quadrature(scratch.face_quadrature)
115 , cell_update_flags(scratch.cell_update_flags)
116 , neighbor_cell_update_flags(scratch.neighbor_cell_update_flags)
117 , face_update_flags(scratch.face_update_flags)
118 , neighbor_face_update_flags(scratch.neighbor_face_update_flags)
119 , local_dof_indices(scratch.local_dof_indices)
120 , neighbor_dof_indices(scratch.neighbor_dof_indices)
121 , user_data_storage(scratch.user_data_storage)
122 , internal_data_storage(scratch.internal_data_storage)
127 template <
int dim,
int spacedim>
133 fe_values = std_cxx14::make_unique<FEValues<dim, spacedim>>(
134 *mapping, *fe, cell_quadrature, cell_update_flags);
136 fe_values->reinit(cell);
137 cell->get_dof_indices(local_dof_indices);
138 current_fe_values = fe_values.get();
144 template <
int dim,
int spacedim>
148 const unsigned int face_no)
151 fe_face_values = std_cxx14::make_unique<FEFaceValues<dim, spacedim>>(
152 *mapping, *fe, face_quadrature, face_update_flags);
154 fe_face_values->reinit(cell, face_no);
155 cell->get_dof_indices(local_dof_indices);
156 current_fe_values = fe_face_values.get();
157 return *fe_face_values;
162 template <
int dim,
int spacedim>
166 const unsigned int face_no,
167 const unsigned int subface_no)
171 if (!fe_subface_values)
173 std_cxx14::make_unique<FESubfaceValues<dim, spacedim>>(
174 *mapping, *fe, face_quadrature, face_update_flags);
175 fe_subface_values->reinit(cell, face_no, subface_no);
176 cell->get_dof_indices(local_dof_indices);
178 current_fe_values = fe_subface_values.get();
179 return *fe_subface_values;
182 return reinit(cell, face_no);
187 template <
int dim,
int spacedim>
192 if (!neighbor_fe_values)
193 neighbor_fe_values = std_cxx14::make_unique<FEValues<dim, spacedim>>(
194 *mapping, *fe, cell_quadrature, neighbor_cell_update_flags);
196 neighbor_fe_values->reinit(cell);
197 cell->get_dof_indices(neighbor_dof_indices);
198 current_neighbor_fe_values = neighbor_fe_values.get();
199 return *neighbor_fe_values;
204 template <
int dim,
int spacedim>
208 const unsigned int face_no)
210 if (!neighbor_fe_face_values)
211 neighbor_fe_face_values =
212 std_cxx14::make_unique<FEFaceValues<dim, spacedim>>(
213 *mapping, *fe, face_quadrature, neighbor_face_update_flags);
214 neighbor_fe_face_values->reinit(cell, face_no);
215 cell->get_dof_indices(neighbor_dof_indices);
216 current_neighbor_fe_values = neighbor_fe_face_values.get();
217 return *neighbor_fe_face_values;
222 template <
int dim,
int spacedim>
226 const unsigned int face_no,
227 const unsigned int subface_no)
231 if (!neighbor_fe_subface_values)
232 neighbor_fe_subface_values =
233 std_cxx14::make_unique<FESubfaceValues<dim, spacedim>>(
234 *mapping, *fe, face_quadrature, neighbor_face_update_flags);
235 neighbor_fe_subface_values->reinit(cell, face_no, subface_no);
236 cell->get_dof_indices(neighbor_dof_indices);
237 current_neighbor_fe_values = neighbor_fe_subface_values.get();
238 return *neighbor_fe_subface_values;
241 return reinit_neighbor(cell, face_no);
246 template <
int dim,
int spacedim>
250 Assert(current_fe_values !=
nullptr,
251 ExcMessage(
"You have to initialize the cache using one of the "
252 "reinit functions first!"));
253 return *current_fe_values;
258 template <
int dim,
int spacedim>
262 Assert(current_neighbor_fe_values !=
nullptr,
263 ExcMessage(
"You have to initialize the cache using one of the "
264 "reinit functions first!"));
265 return *current_neighbor_fe_values;
270 template <
int dim,
int spacedim>
271 const std::vector<Point<spacedim>> &
274 return get_current_fe_values().get_quadrature_points();
279 template <
int dim,
int spacedim>
280 const std::vector<double> &
283 return get_current_fe_values().get_JxW_values();
288 template <
int dim,
int spacedim>
289 const std::vector<double> &
292 return get_current_neighbor_fe_values().get_JxW_values();
297 template <
int dim,
int spacedim>
298 const std::vector<Tensor<1, spacedim>> &
301 return get_current_fe_values().get_normal_vectors();
306 template <
int dim,
int spacedim>
307 const std::vector<Tensor<1, spacedim>> &
310 return get_current_neighbor_fe_values().get_normal_vectors();
315 template <
int dim,
int spacedim>
316 const std::vector<types::global_dof_index> &
319 return local_dof_indices;
324 template <
int dim,
int spacedim>
325 const std::vector<types::global_dof_index> &
328 return neighbor_dof_indices;
333 template <
int dim,
int spacedim>
337 return user_data_storage;
342 template <
int dim,
int spacedim>
356 #include "scratch_data.inst"