1 #include <deal.II/base/tensor.h> 3 #include <deal.II/fe/fe_values.h> 5 #include <deal.II/dofs/dof_handler.h> 6 #include <deal.II/dofs/dof_tools.h> 8 #include <deal.II/dofs/dof_renumbering.h> 10 #include <deal.II/dofs/dof_accessor.h> 12 #include <deal.II/lac/vector.h> 14 #include "ADTypes.hpp" 16 #include <deal.II/fe/fe_dgq.h> 18 #include "strong_dg.hpp" 23 template <
typename real>
24 double getValue(
const real &x) {
25 if constexpr (std::is_same<real, double>::value) {
28 return getValue(x.value());
34 template <
int dim,
int nspecies,
int nstate,
typename real,
typename MeshType>
37 const unsigned int degree,
38 const unsigned int max_degree_input,
39 const unsigned int grid_degree_input,
40 const std::shared_ptr<Triangulation> triangulation_input)
41 :
DGBaseState<dim,nspecies,nstate,real,MeshType>::
DGBaseState(parameters_input, degree, max_degree_input, grid_degree_input, triangulation_input)
42 , do_compute_filtered_solution(this->all_parameters->physics_model_param.do_compute_filtered_solution)
43 , apply_modal_high_pass_filter_on_filtered_solution(this->all_parameters->physics_model_param.apply_modal_high_pass_filter_on_filtered_solution)
44 , poly_degree_max_large_scales(this->all_parameters->physics_model_param.poly_degree_max_large_scales)
45 , using_wall_model(this->all_parameters->using_wall_model)
46 , wall_model_input_from_second_element(this->all_parameters->wall_model_input_from_second_element)
47 , use_projected_entropy_variables_for_nsfr_boundary_term(this->all_parameters->use_projected_entropy_variables_for_nsfr_boundary_term)
50 template <
int dim,
int nspecies,
int nstate,
typename real,
typename MeshType>
51 template <
typename adtype>
53 const unsigned int poly_degree,
54 const unsigned int grid_degree,
55 const std::vector<adtype> &metric_coeffs,
58 std::array<std::vector<adtype>,dim> &mapping_support_points)
60 const dealii::FESystem<dim> &fe_metric = this->
high_order_grid->fe_system;
61 const unsigned int n_metric_dofs = fe_metric.dofs_per_cell;
62 const unsigned int n_grid_nodes = n_metric_dofs / dim;
65 for(
int idim=0; idim<dim; idim++){
66 mapping_support_points[idim].resize(n_grid_nodes);
68 const std::vector<unsigned int > &index_renumbering = dealii::FETools::hierarchic_to_lexicographic_numbering<dim>(grid_degree);
69 for (
unsigned int idof = 0; idof< n_metric_dofs; ++idof) {
70 const adtype val = metric_coeffs[idof];
71 const unsigned int istate = fe_metric.system_to_component_index(idof).first;
72 const unsigned int ishape = fe_metric.system_to_component_index(idof).second;
73 const unsigned int igrid_node = index_renumbering[ishape];
74 mapping_support_points[istate][igrid_node] = val;
78 mapping_support_points,
89 template <
int dim,
int nspecies,
int nstate,
typename real,
typename MeshType>
90 template <
typename adtype>
92 typename dealii::DoFHandler<dim>::active_cell_iterator cell,
93 const dealii::types::global_dof_index current_cell_index,
94 const std::vector<adtype> &soln_coeffs,
95 const dealii::Tensor<1,dim,std::vector<adtype>> &aux_soln_coeffs,
96 const std::vector<adtype> &,
97 const std::vector<real> &local_dual,
98 const std::vector<dealii::types::global_dof_index> &,
99 const std::vector<dealii::types::global_dof_index> &,
100 const unsigned int poly_degree,
101 const unsigned int grid_degree,
110 std::array<std::vector<adtype>,dim> &,
111 dealii::hp::FEValues<dim,dim> &,
112 dealii::hp::FEValues<dim,dim> &,
113 const dealii::FESystem<dim,dim> &,
114 std::vector<adtype> &rhs,
115 dealii::Tensor<1,dim,std::vector<adtype>> &local_auxiliary_RHS,
116 const bool compute_auxiliary_right_hand_side,
117 adtype &dual_dot_residual)
127 soln_basis, soln_basis,
128 flux_basis, flux_basis,
129 flux_basis_stiffness,
130 soln_basis_projection_oper_int, soln_basis_projection_oper_ext,
138 const unsigned int n_dofs_cell = this->
fe_collection[poly_degree].dofs_per_cell;
139 const unsigned int n_shape_fns = n_dofs_cell /
nstate;
140 std::array<std::vector<adtype>,
nstate> soln_coeff;
141 std::array<dealii::Tensor<1,dim,std::vector<adtype>>,
nstate> aux_soln_coeff;
142 for (
unsigned int idof = 0; idof < n_dofs_cell; ++idof) {
143 const unsigned int istate = this->
fe_collection[poly_degree].system_to_component_index(idof).first;
144 const unsigned int ishape = this->
fe_collection[poly_degree].system_to_component_index(idof).second;
146 soln_coeff[istate].resize(n_shape_fns);
147 soln_coeff[istate][ishape] = soln_coeffs[idof];
148 for(
int idim=0; idim<dim; idim++){
150 aux_soln_coeff[istate][idim].resize(n_shape_fns);
152 aux_soln_coeff[istate][idim][ishape] = aux_soln_coeffs[idim][idof];
155 aux_soln_coeff[istate][idim][ishape] = 0.0;
161 if(compute_auxiliary_right_hand_side){
162 assemble_volume_term_auxiliary_equation<adtype>(
168 local_auxiliary_RHS);
171 assemble_volume_term_strong<adtype>(
179 flux_basis_stiffness,
180 soln_basis_projection_oper_int,
184 for(
unsigned int idof=0; idof<n_dofs_cell; idof++){
185 dual_dot_residual += rhs[idof] * local_dual[idof];
190 template <
int dim,
int nspecies,
int nstate,
typename real,
typename MeshType>
191 template<
typename adtype>
193 typename dealii::DoFHandler<dim>::active_cell_iterator cell,
194 const dealii::types::global_dof_index current_cell_index,
195 const std::vector<adtype> &soln_coeffs,
196 const dealii::Tensor<1,dim,std::vector<adtype>> &aux_soln_coeffs,
197 const std::vector<adtype> &,
198 const std::vector<real> &local_dual,
199 const unsigned int face_number,
200 const unsigned int boundary_id,
204 const unsigned int poly_degree,
211 std::array<std::vector<adtype>,dim> &mapping_support_points,
212 dealii::hp::FEFaceValues<dim,dim> &,
213 const dealii::FESystem<dim,dim> &,
215 std::vector<adtype> &rhs,
216 dealii::Tensor<1,dim,std::vector<adtype>> &local_auxiliary_RHS,
217 const bool compute_auxiliary_right_hand_side,
218 adtype &dual_dot_residual)
221 const dealii::FESystem<dim> &fe_metric = this->
high_order_grid->fe_system;
222 const unsigned int n_metric_dofs = fe_metric.dofs_per_cell;
223 const unsigned int n_grid_nodes = n_metric_dofs / dim;
229 mapping_support_points,
236 const unsigned int n_dofs_cell = this->
fe_collection[poly_degree].dofs_per_cell;
237 const unsigned int n_shape_fns = n_dofs_cell /
nstate;
239 std::vector<bool> face_orientation = {cell->face_orientation(face_number), cell->face_rotation(face_number), cell->face_flip(face_number)};
240 std::array<std::vector<adtype>,
nstate> soln_coeff;
241 std::array<dealii::Tensor<1,dim,std::vector<adtype>>,
nstate> aux_soln_coeff;
242 for (
unsigned int idof = 0; idof < n_dofs_cell; ++idof) {
243 const unsigned int istate = this->
fe_collection[poly_degree].system_to_component_index(idof).first;
244 const unsigned int ishape = this->
fe_collection[poly_degree].system_to_component_index(idof).second;
246 soln_coeff[istate].resize(n_shape_fns);
247 soln_coeff[istate][ishape] = soln_coeffs[idof];
248 for(
int idim=0; idim<dim; idim++){
250 aux_soln_coeff[istate][idim].resize(n_shape_fns);
252 aux_soln_coeff[istate][idim][ishape] = aux_soln_coeffs[idim][idof];
255 aux_soln_coeff[istate][idim][ishape] = 0.0;
261 if(compute_auxiliary_right_hand_side){
262 assemble_boundary_term_auxiliary_equation<adtype> (
263 face_number, current_cell_index,
268 soln_basis, metric_oper,
271 local_auxiliary_RHS);
274 assemble_boundary_term_strong<adtype> (
279 soln_coeff, aux_soln_coeff,
280 boundary_id, poly_degree, penalty,
283 soln_basis_projection_oper_int,
285 physics, conv_num_flux, diss_num_flux,
287 for(
unsigned int idof=0; idof<n_dofs_cell; idof++){
288 dual_dot_residual += rhs[idof] * local_dual[idof];
294 template <
int dim,
int nspecies,
int nstate,
typename real,
typename MeshType>
295 template <
typename adtype>
297 typename dealii::DoFHandler<dim>::active_cell_iterator cell,
298 typename dealii::DoFHandler<dim>::active_cell_iterator neighbor_cell,
299 const dealii::types::global_dof_index current_cell_index,
300 const dealii::types::global_dof_index neighbor_cell_index,
301 const unsigned int iface,
302 const unsigned int neighbor_iface,
303 const std::vector<adtype> &soln_coeffs_int,
304 const std::vector<adtype> &soln_coeffs_ext,
305 const dealii::Tensor<1,dim,std::vector<adtype>> &aux_soln_coeffs_int,
306 const dealii::Tensor<1,dim,std::vector<adtype>> &aux_soln_coeffs_ext,
307 const std::vector<adtype> &,
308 const std::vector<adtype> &metric_coeff_ext,
309 const std::vector< double > &dual_int,
310 const std::vector< double > &dual_ext,
311 const unsigned int poly_degree_int,
312 const unsigned int poly_degree_ext,
314 const unsigned int grid_degree_ext,
325 std::array<std::vector<adtype>,dim> &mapping_support_points,
329 dealii::hp::FEFaceValues<dim,dim> &,
330 dealii::hp::FEFaceValues<dim,dim> &,
331 dealii::hp::FESubfaceValues<dim,dim> &,
332 const dealii::FESystem<dim,dim> &,
333 const dealii::FESystem<dim,dim> &,
335 std::vector<adtype> &rhs_int,
336 std::vector<adtype> &rhs_ext,
337 dealii::Tensor<1,dim,std::vector<adtype>> &aux_rhs_int,
338 dealii::Tensor<1,dim,std::vector<adtype>> &aux_rhs_ext,
339 const bool compute_auxiliary_right_hand_side,
340 adtype &dual_dot_residual,
345 const dealii::FESystem<dim> &fe_metric = this->
high_order_grid->fe_system;
346 const unsigned int n_metric_dofs = fe_metric.dofs_per_cell;
347 const unsigned int n_grid_nodes = n_metric_dofs / dim;
354 mapping_support_points,
364 soln_basis_int, soln_basis_ext,
365 flux_basis_int, flux_basis_ext,
366 flux_basis_stiffness,
367 soln_basis_projection_oper_int, soln_basis_projection_oper_ext,
371 if(!compute_auxiliary_right_hand_side){
375 std::array<std::vector<adtype>,dim> mapping_support_points_neigh;
376 for(
int idim=0; idim<dim; idim++){
377 mapping_support_points_neigh[idim].resize(n_grid_nodes);
379 const std::vector<unsigned int > &index_renumbering = dealii::FETools::hierarchic_to_lexicographic_numbering<dim>(grid_degree_ext);
380 for (
unsigned int idof = 0; idof< n_metric_dofs; ++idof) {
381 const adtype val = metric_coeff_ext[idof];
382 const unsigned int istate = fe_metric.system_to_component_index(idof).first;
383 const unsigned int ishape = fe_metric.system_to_component_index(idof).second;
384 const unsigned int igrid_node = index_renumbering[ishape];
385 mapping_support_points_neigh[istate][igrid_node] = val;
390 mapping_support_points_neigh,
395 const unsigned int n_dofs_int = this->
fe_collection[poly_degree_int].dofs_per_cell;
396 const unsigned int n_dofs_ext = this->
fe_collection[poly_degree_ext].dofs_per_cell;
397 const unsigned int n_shape_fns_int = n_dofs_int /
nstate;
398 const unsigned int n_shape_fns_ext = n_dofs_ext /
nstate;
400 std::vector<bool> face_orientation_int = {cell->face_orientation(iface), cell->face_rotation(iface), cell->face_flip(iface)};
402 std::vector<bool> face_orientation_ext = {neighbor_cell->face_orientation(neighbor_iface), neighbor_cell->face_rotation(neighbor_iface), neighbor_cell->face_flip(neighbor_iface)};
404 std::array<std::vector<adtype>,
nstate> soln_coeff_int;
405 std::array<dealii::Tensor<1,dim,std::vector<adtype>>,
nstate> aux_soln_coeff_int;
406 for (
unsigned int idof = 0; idof < n_dofs_int; ++idof) {
407 const unsigned int istate = this->
fe_collection[poly_degree_int].system_to_component_index(idof).first;
408 const unsigned int ishape = this->
fe_collection[poly_degree_int].system_to_component_index(idof).second;
410 soln_coeff_int[istate].resize(n_shape_fns_int);
412 soln_coeff_int[istate][ishape] = soln_coeffs_int[idof];
413 for(
int idim=0; idim<dim; idim++){
415 aux_soln_coeff_int[istate][idim].resize(n_shape_fns_int);
418 aux_soln_coeff_int[istate][idim][ishape] = aux_soln_coeffs_int[idim][idof];
421 aux_soln_coeff_int[istate][idim][ishape] = 0.0;
427 std::array<std::vector<adtype>,
nstate> soln_coeff_ext;
428 std::array<dealii::Tensor<1,dim,std::vector<adtype>>,
nstate> aux_soln_coeff_ext;
429 for (
unsigned int idof = 0; idof < n_dofs_ext; ++idof) {
430 const unsigned int istate = this->
fe_collection[poly_degree_ext].system_to_component_index(idof).first;
431 const unsigned int ishape = this->
fe_collection[poly_degree_ext].system_to_component_index(idof).second;
433 soln_coeff_ext[istate].resize(n_shape_fns_ext);
435 soln_coeff_ext[istate][ishape] = soln_coeffs_ext[idof];
436 for(
int idim=0; idim<dim; idim++){
438 aux_soln_coeff_ext[istate][idim].resize(n_shape_fns_ext);
441 aux_soln_coeff_ext[istate][idim][ishape] = aux_soln_coeffs_ext[idim][idof];
444 aux_soln_coeff_ext[istate][idim][ishape] = 0.0;
449 if(compute_auxiliary_right_hand_side){
450 assemble_face_term_auxiliary_equation<adtype> (
451 iface, neighbor_iface,
452 current_cell_index, neighbor_cell_index,
453 face_orientation_int, face_orientation_ext,
454 soln_coeff_int, soln_coeff_ext,
455 poly_degree_int, poly_degree_ext,
456 soln_basis_int, soln_basis_ext,
460 aux_rhs_int, aux_rhs_ext);
463 assemble_face_term_strong<adtype> (
464 iface, neighbor_iface,
467 face_orientation_int,
468 face_orientation_ext,
469 soln_coeff_int, soln_coeff_ext,
470 aux_soln_coeff_int, aux_soln_coeff_ext,
471 poly_degree_int, poly_degree_ext,
473 soln_basis_int, soln_basis_ext,
474 flux_basis_int, flux_basis_ext,
475 soln_basis_projection_oper_int, soln_basis_projection_oper_ext,
476 metric_oper_int, metric_oper_ext,
477 physics, conv_num_flux, diss_num_flux,
479 for(
unsigned int idof=0; idof<n_dofs_int; idof++){
480 dual_dot_residual += rhs_int[idof] * dual_int[idof];
482 for(
unsigned int idof=0; idof<n_dofs_ext; idof++){
483 dual_dot_residual += rhs_ext[idof] * dual_ext[idof];
497 template <
int dim,
int nspecies,
int nstate,
typename real,
typename MeshType>
504 if(pde_type == PDE_enum::burgers_viscous){
505 pcout <<
"DG Strong not yet verified for Burgers' viscous. Aborting..." << std::endl;
512 if(compute_dRdW || compute_dRdX || compute_d2R)
514 pcout <<
"DG Strong's viscous terms cannot yet be automatically differentiated. Aborting..."<<std::endl;
518 for(
int idim=0; idim<dim; idim++){
524 dealii::hp::MappingCollection<dim> mapping_collection(mapping);
544 soln_basis_int, soln_basis_ext,
545 flux_basis_int, flux_basis_ext,
546 flux_basis_stiffness,
547 soln_basis_projection_oper_int, soln_basis_projection_oper_ext,
550 auto metric_cell = this->
high_order_grid->dof_handler_grid.begin_active();
556 for (
auto soln_cell = this->
dof_handler.begin_active(); soln_cell != this->
dof_handler.end(); ++soln_cell, ++metric_cell) {
557 if (!soln_cell->is_locally_owned())
continue;
558 this->
template assemble_cell_residual_and_ad_derivatives<codi_HessianComputationType>(
561 compute_dRdW, compute_dRdX, compute_d2R,
562 fe_values_collection_volume,
563 fe_values_collection_face_int,
564 fe_values_collection_face_ext,
565 fe_values_collection_subface,
566 fe_values_collection_volume_lagrange,
571 flux_basis_stiffness,
572 soln_basis_projection_oper_int,
573 soln_basis_projection_oper_ext,
580 else if(compute_dRdW || compute_dRdX)
583 for (
auto soln_cell = this->
dof_handler.begin_active(); soln_cell != this->
dof_handler.end(); ++soln_cell, ++metric_cell) {
584 if (!soln_cell->is_locally_owned())
continue;
585 this->
template assemble_cell_residual_and_ad_derivatives<codi_JacobianComputationType>(
588 compute_dRdW, compute_dRdX, compute_d2R,
589 fe_values_collection_volume,
590 fe_values_collection_face_int,
591 fe_values_collection_face_ext,
592 fe_values_collection_subface,
593 fe_values_collection_volume_lagrange,
598 flux_basis_stiffness,
599 soln_basis_projection_oper_int,
600 soln_basis_projection_oper_ext,
610 for (
auto soln_cell = this->
dof_handler.begin_active(); soln_cell != this->
dof_handler.end(); ++soln_cell, ++metric_cell) {
611 if (!soln_cell->is_locally_owned())
continue;
612 this->
template assemble_cell_residual_and_ad_derivatives<double>(
615 compute_dRdW, compute_dRdX, compute_d2R,
616 fe_values_collection_volume,
617 fe_values_collection_face_int,
618 fe_values_collection_face_ext,
619 fe_values_collection_subface,
620 fe_values_collection_volume_lagrange,
625 flux_basis_stiffness,
626 soln_basis_projection_oper_int,
627 soln_basis_projection_oper_ext,
635 for(
int idim=0; idim<dim; idim++){
652 pcout <<
"ERROR: " <<
"auxiliary currently only works for explicit time advancement. Aborting..." << std::endl;
665 template <
int dim,
int nspecies,
int nstate,
typename real,
typename MeshType>
666 template <
typename adtype>
668 const std::array<std::vector<adtype>,
nstate> &soln_coeff,
669 const unsigned int poly_degree,
673 dealii::Tensor<1,dim,std::vector<adtype>> &local_auxiliary_RHS)
677 const unsigned int n_dofs_cell = this->
fe_collection[poly_degree].dofs_per_cell;
678 const unsigned int n_shape_fns = n_dofs_cell /
nstate;
683 for(
int istate=0; istate<
nstate; istate++){
684 std::vector<adtype> soln_at_q(n_quad_pts);
693 dealii::Tensor<1,dim,std::vector<adtype>> ref_gradient_basis_fns_times_soln;
694 for(
int idim=0; idim<dim; idim++){
695 ref_gradient_basis_fns_times_soln[idim].resize(n_quad_pts);
702 for(
int idim=0; idim<dim; idim++){
703 std::vector<adtype> phys_gradient_u(n_quad_pts);
704 for(
unsigned int iquad=0; iquad<n_quad_pts; iquad++){
705 for(
int jdim=0; jdim<dim; jdim++){
708 * ref_gradient_basis_fns_times_soln[jdim][iquad];
712 std::vector<adtype> rhs(n_shape_fns);
719 for(
unsigned int ishape=0; ishape<n_shape_fns; ishape++){
720 local_auxiliary_RHS[idim][istate*n_shape_fns + ishape] += rhs[ishape];
726 template <
int dim,
int nspecies,
int nstate,
typename real,
typename MeshType>
727 template <
typename adtype>
729 const unsigned int iface,
730 const dealii::types::global_dof_index current_cell_index,
731 std::vector<bool> face_orientation,
732 const std::array<std::vector<adtype>,
nstate> &soln_coeff,
733 const unsigned int poly_degree,
734 const unsigned int boundary_id,
739 dealii::Tensor<1,dim,std::vector<adtype>> &local_auxiliary_RHS)
741 (void) current_cell_index;
746 const unsigned int n_shape_fns = n_dofs /
nstate;
749 std::array<std::vector<adtype>,
nstate> soln_at_surf_q;
750 std::array<dealii::Tensor<1,dim,std::vector<adtype>>,
nstate> ref_grad_soln_at_vol_q;
751 for(
int istate=0; istate<
nstate; ++istate){
753 soln_at_surf_q[istate].resize(n_face_quad_pts);
756 iface, soln_coeff[istate], soln_at_surf_q[istate],
760 for(
int idim=0; idim<dim; idim++){
761 ref_grad_soln_at_vol_q[istate][idim].resize(n_quad_pts_vol);
769 std::array<dealii::Tensor<1,dim,std::vector<adtype>>,nstate> phys_grad_soln_at_surf_q;
770 for(
int istate=0; istate<
nstate; istate++){
772 for(
int idim=0; idim<dim; idim++){
773 std::vector<adtype> phys_gradient_u(n_quad_pts_vol);
774 for(
unsigned int iquad=0; iquad<n_quad_pts_vol; iquad++){
775 for(
int jdim=0; jdim<dim; jdim++){
778 * ref_grad_soln_at_vol_q[istate][jdim][iquad];
780 phys_gradient_u[iquad] /= metric_oper.
det_Jac_vol[iquad];
782 phys_grad_soln_at_surf_q[istate][idim].resize(n_face_quad_pts);
785 iface, phys_gradient_u, phys_grad_soln_at_surf_q[istate][idim],
793 const dealii::Tensor<1,dim,double> unit_ref_normal_int = dealii::GeometryInfo<dim>::unit_normal_vector[iface];
794 std::array<dealii::Tensor<1,dim,std::vector<adtype>>,nstate> surf_num_flux_minus_surf_soln_dot_normal;
795 for(
unsigned int iquad=0; iquad<n_face_quad_pts; iquad++){
801 dealii::Tensor<2,dim,adtype> metric_cofactor_surf;
802 for(
int idim=0; idim<dim; idim++){
803 for(
int jdim=0; jdim<dim; jdim++){
807 std::array<adtype,nstate> soln_state;
808 std::array<dealii::Tensor<1,dim,adtype>,nstate> phys_grad_soln_state;
809 for(
int istate=0; istate<
nstate; istate++){
810 soln_state[istate] = soln_at_surf_q[istate][iquad];
811 for(
int idim=0; idim<dim; idim++){
812 phys_grad_soln_state[istate][idim] = phys_grad_soln_at_surf_q[istate][idim][iquad];
816 dealii::Tensor<1,dim,adtype> unit_phys_normal_int;
818 metric_cofactor_surf,
819 unit_phys_normal_int);
820 adtype face_Jac_norm_scaled = 0.0;
821 for(
int idim=0; idim<dim; idim++){
822 face_Jac_norm_scaled += unit_phys_normal_int[idim] * unit_phys_normal_int[idim];
824 face_Jac_norm_scaled = sqrt(face_Jac_norm_scaled);
825 unit_phys_normal_int /= face_Jac_norm_scaled;
827 std::array<adtype,nstate> soln_boundary;
828 std::array<dealii::Tensor<1,dim,adtype>,nstate> grad_soln_boundary;
829 dealii::Point<dim,adtype> surf_flux_node;
830 for(
int idim=0; idim<dim; idim++){
831 surf_flux_node[idim] = metric_oper.
flux_nodes_surf[iface][idim][iquad];
833 pde_physics.
boundary_face_values_viscous_flux (boundary_id, surf_flux_node, unit_phys_normal_int, soln_state, phys_grad_soln_state, soln_state, phys_grad_soln_state, soln_boundary, grad_soln_boundary);
835 std::array<adtype,nstate> diss_soln_num_flux;
836 diss_soln_num_flux = diss_num_flux.
evaluate_solution_flux(soln_state, soln_boundary, unit_phys_normal_int);
838 for(
int istate=0; istate<
nstate; istate++){
839 for(
int idim=0; idim<dim; idim++){
842 surf_num_flux_minus_surf_soln_dot_normal[istate][idim].resize(n_face_quad_pts);
845 surf_num_flux_minus_surf_soln_dot_normal[istate][idim][iquad]
846 = (diss_soln_num_flux[istate] - soln_at_surf_q[istate][iquad]) * unit_phys_normal_int[idim] * face_Jac_norm_scaled;
852 for(
int istate=0; istate<
nstate; istate++){
853 for(
int idim=0; idim<dim; idim++){
854 std::vector<adtype> rhs(n_shape_fns);
858 surf_num_flux_minus_surf_soln_dot_normal[istate][idim],
859 surf_quad_weights, rhs,
863 for(
unsigned int ishape=0; ishape<n_shape_fns; ishape++){
864 local_auxiliary_RHS[idim][istate*n_shape_fns + ishape] += rhs[ishape];
870 template <
int dim,
int nspecies,
int nstate,
typename real,
typename MeshType>
871 template <
typename adtype>
873 const unsigned int iface,
874 const unsigned int neighbor_iface,
875 const dealii::types::global_dof_index current_cell_index,
876 const dealii::types::global_dof_index neighbor_cell_index,
877 std::vector<bool> face_orientation_int,
878 std::vector<bool> face_orientation_ext,
879 const std::array<std::vector<adtype>,
nstate> &soln_coeff_int,
880 const std::array<std::vector<adtype>,
nstate> &soln_coeff_ext,
881 const unsigned int poly_degree_int,
882 const unsigned int poly_degree_ext,
888 dealii::Tensor<1,dim,std::vector<adtype>> &local_auxiliary_RHS_int,
889 dealii::Tensor<1,dim,std::vector<adtype>> &local_auxiliary_RHS_ext)
891 (void) current_cell_index;
892 (void) neighbor_cell_index;
896 const unsigned int n_dofs_int = this->
fe_collection[poly_degree_int].dofs_per_cell;
897 const unsigned int n_dofs_ext = this->
fe_collection[poly_degree_ext].dofs_per_cell;
899 const unsigned int n_shape_fns_int = n_dofs_int /
nstate;
900 const unsigned int n_shape_fns_ext = n_dofs_ext /
nstate;
903 std::array<std::vector<adtype>,
nstate> soln_at_surf_q_int;
904 std::array<std::vector<adtype>,
nstate> soln_at_surf_q_ext;
905 for(
int istate=0; istate<
nstate; ++istate){
907 soln_at_surf_q_int[istate].resize(n_face_quad_pts);
908 soln_at_surf_q_ext[istate].resize(n_face_quad_pts);
912 soln_coeff_int[istate], soln_at_surf_q_int[istate],
917 soln_coeff_ext[istate], soln_at_surf_q_ext[istate],
924 const dealii::Tensor<1,dim,double> unit_ref_normal_int = dealii::GeometryInfo<dim>::unit_normal_vector[iface];
925 std::array<dealii::Tensor<1,dim,std::vector<adtype>>,nstate> surf_num_flux_minus_surf_soln_int_dot_normal;
926 std::array<dealii::Tensor<1,dim,std::vector<adtype>>,nstate> surf_num_flux_minus_surf_soln_ext_dot_normal;
927 for (
unsigned int iquad=0; iquad<n_face_quad_pts; ++iquad) {
933 dealii::Tensor<2,dim,adtype> metric_cofactor_surf;
934 for(
int idim=0; idim<dim; idim++){
935 for(
int jdim=0; jdim<dim; jdim++){
940 dealii::Tensor<1,dim,adtype> unit_phys_normal_int;
942 metric_cofactor_surf,
943 unit_phys_normal_int);
944 adtype face_Jac_norm_scaled = 0.0;
945 for(
int idim=0; idim<dim; idim++){
946 face_Jac_norm_scaled += unit_phys_normal_int[idim] * unit_phys_normal_int[idim];
948 face_Jac_norm_scaled = sqrt(face_Jac_norm_scaled);
949 unit_phys_normal_int /= face_Jac_norm_scaled;
951 std::array<adtype,nstate> diss_soln_num_flux;
952 std::array<adtype,nstate> soln_state_int;
953 std::array<adtype,nstate> soln_state_ext;
954 for(
int istate=0; istate<
nstate; istate++){
955 soln_state_int[istate] = soln_at_surf_q_int[istate][iquad];
956 soln_state_ext[istate] = soln_at_surf_q_ext[istate][iquad];
958 diss_soln_num_flux = diss_num_flux.
evaluate_solution_flux(soln_state_int, soln_state_ext, unit_phys_normal_int);
960 for(
int istate=0; istate<
nstate; istate++){
961 for(
int idim=0; idim<dim; idim++){
964 surf_num_flux_minus_surf_soln_int_dot_normal[istate][idim].resize(n_face_quad_pts);
965 surf_num_flux_minus_surf_soln_ext_dot_normal[istate][idim].resize(n_face_quad_pts);
968 surf_num_flux_minus_surf_soln_int_dot_normal[istate][idim][iquad]
969 = (diss_soln_num_flux[istate] - soln_at_surf_q_int[istate][iquad]) * unit_phys_normal_int[idim] * face_Jac_norm_scaled;
971 surf_num_flux_minus_surf_soln_ext_dot_normal[istate][idim][iquad]
972 = (diss_soln_num_flux[istate] - soln_at_surf_q_ext[istate][iquad]) * (- unit_phys_normal_int[idim]) * face_Jac_norm_scaled;
978 for(
int istate=0; istate<
nstate; istate++){
979 for(
int idim=0; idim<dim; idim++){
980 std::vector<adtype> rhs_int(n_shape_fns_int);
984 surf_num_flux_minus_surf_soln_int_dot_normal[istate][idim],
985 surf_quad_weights, rhs_int,
990 for(
unsigned int ishape=0; ishape<n_shape_fns_int; ishape++){
991 local_auxiliary_RHS_int[idim][istate*n_shape_fns_int + ishape] += rhs_int[ishape];
993 std::vector<adtype> rhs_ext(n_shape_fns_ext);
997 surf_num_flux_minus_surf_soln_ext_dot_normal[istate][idim],
998 surf_quad_weights, rhs_ext,
1003 for(
unsigned int ishape=0; ishape<n_shape_fns_ext; ishape++){
1004 local_auxiliary_RHS_ext[idim][istate*n_shape_fns_ext + ishape] += rhs_ext[ishape];
1015 template <
int dim,
int nspecies,
int nstate,
typename real,
typename MeshType>
1016 template <
typename adtype>
1018 typename dealii::DoFHandler<dim>::active_cell_iterator cell,
1019 const dealii::types::global_dof_index current_cell_index,
1020 const std::array<std::vector<adtype>,
nstate> &soln_coeff,
1021 const std::array<dealii::Tensor<1,dim,std::vector<adtype>>,
nstate> &aux_soln_coeff,
1022 const unsigned int poly_degree,
1029 std::vector<adtype> &local_rhs_int_cell)
1032 const unsigned int n_dofs_cell = this->
fe_collection[poly_degree].dofs_per_cell;
1033 const unsigned int n_shape_fns = n_dofs_cell /
nstate;
1035 assert(n_quad_pts == pow(n_quad_pts_1D, dim));
1040 std::array<std::vector<adtype>,
nstate> soln_at_q;
1041 std::array<dealii::Tensor<1,dim,std::vector<adtype>>,
nstate> aux_soln_at_q;
1042 std::vector<std::array<double,nstate>> soln_at_q_for_max_CFL(n_quad_pts);
1045 for(
int istate=0; istate<
nstate; istate++){
1046 soln_at_q[istate].resize(n_quad_pts);
1049 for(
int idim=0; idim<dim; idim++){
1050 aux_soln_at_q[istate][idim].resize(n_quad_pts);
1054 for(
unsigned int iquad=0; iquad<n_quad_pts; iquad++){
1055 soln_at_q_for_max_CFL[iquad][istate] = getValue<adtype>(soln_at_q[istate][iquad]);
1060 std::array<std::vector<adtype>,nstate> legendre_soln_at_q;
1061 std::array<dealii::Tensor<1,dim,std::vector<adtype>>,nstate> legendre_aux_soln_at_q;
1067 std::array<std::vector<adtype>,nstate> primitive_soln_at_q;
1068 std::array<dealii::Tensor<1,dim,std::vector<adtype>>,nstate> primitive_aux_soln_at_q;
1070 for(
int istate=0; istate<
nstate; istate++){
1071 primitive_soln_at_q[istate].resize(n_quad_pts);
1072 for(
int idim=0; idim<dim; idim++){
1073 primitive_aux_soln_at_q[istate][idim].resize(n_quad_pts);
1077 for (
unsigned int iquad=0; iquad<n_quad_pts; ++iquad) {
1079 std::array<adtype,nstate> soln_state;
1080 std::array<dealii::Tensor<1,dim,adtype>,nstate> aux_soln_state;
1081 for(
int istate=0; istate<
nstate; istate++){
1082 soln_state[istate] = soln_at_q[istate][iquad];
1083 for(
int idim=0; idim<dim; idim++){
1084 aux_soln_state[istate][idim] = aux_soln_at_q[istate][idim][iquad];
1091 for(
int istate=0; istate<
nstate; istate++){
1092 primitive_soln_at_q[istate][iquad] = primitive_soln_state[istate];
1093 for(
int idim=0; idim<dim; idim++){
1094 primitive_aux_soln_at_q[istate][idim][iquad] = primitive_aux_soln_state[istate][idim];
1103 std::array<std::vector<adtype>,nstate> primitive_legendre_soln_at_q;
1104 std::array<dealii::Tensor<1,dim,std::vector<adtype>>,nstate> primitive_legendre_aux_soln_at_q;
1108 dealii::FE_DGQLegendre<1,1> legendre_poly_1D(poly_degree);
1116 for(
int istate=0; istate<
nstate; istate++){
1121 std::vector<adtype> legendre_soln_coeff(n_shape_fns);
1122 legendre_soln_basis_projection_oper.
matrix_vector_mult_1D(primitive_soln_at_q[istate], legendre_soln_coeff,
1126 for(
unsigned int ishape=0; ishape<n_shape_fns; ishape++){
1127 if(ishape < p_min_filtered){
1128 legendre_soln_coeff[ishape] = 0.0;
1133 primitive_legendre_soln_at_q[istate].resize(n_quad_pts);
1134 legendre_soln_basis.
matrix_vector_mult_1D(legendre_soln_coeff, primitive_legendre_soln_at_q[istate],
1141 dealii::Tensor<1,dim,std::vector<adtype>> legendre_aux_soln_coeff;
1142 for(
int idim=0; idim<dim; idim++){
1144 legendre_aux_soln_coeff[idim].resize(n_shape_fns);
1146 legendre_soln_basis_projection_oper.
matrix_vector_mult_1D(primitive_aux_soln_at_q[istate][idim], legendre_aux_soln_coeff[idim],
1150 for(
unsigned int ishape=0; ishape<n_shape_fns; ishape++){
1151 if(ishape < p_min_filtered){
1152 legendre_aux_soln_coeff[idim][ishape] = 0.0;
1158 for(
unsigned int ishape=0; ishape<n_shape_fns; ishape++){
1159 legendre_aux_soln_coeff[idim][ishape] = 0.0;
1163 primitive_legendre_aux_soln_at_q[istate][idim].resize(n_quad_pts);
1164 legendre_soln_basis.
matrix_vector_mult_1D(legendre_aux_soln_coeff[idim], primitive_legendre_aux_soln_at_q[istate][idim],
1173 for(
int istate=0; istate<
nstate; istate++){
1174 legendre_soln_at_q[istate].resize(n_quad_pts);
1175 for(
int idim=0; idim<dim; idim++){
1176 legendre_aux_soln_at_q[istate][idim].resize(n_quad_pts);
1180 for (
unsigned int iquad=0; iquad<n_quad_pts; ++iquad) {
1182 std::array<adtype,nstate> primitive_legendre_soln_state;
1183 std::array<dealii::Tensor<1,dim,adtype>,nstate> primitive_legendre_aux_soln_state;
1184 for(
int istate=0; istate<
nstate; istate++){
1185 primitive_legendre_soln_state[istate] = primitive_legendre_soln_at_q[istate][iquad];
1186 for(
int idim=0; idim<dim; idim++){
1187 primitive_legendre_aux_soln_state[istate][idim] = primitive_legendre_aux_soln_at_q[istate][idim][iquad];
1194 for(
int istate=0; istate<
nstate; istate++){
1195 legendre_soln_at_q[istate][iquad] = legendre_soln_state[istate];
1196 for(
int idim=0; idim<dim; idim++){
1197 legendre_aux_soln_at_q[istate][idim][iquad] = legendre_aux_soln_state[istate][idim];
1206 real max_artificial_diss = 0.0;
1208 typename dealii::DoFHandler<dim>::active_cell_iterator artificial_dissipation_cell(
1210 std::vector<dealii::types::global_dof_index> dof_indices_artificial_dissipation(n_dofs_arti_diss);
1211 artificial_dissipation_cell->get_dof_indices (dof_indices_artificial_dissipation);
1212 for (
unsigned int iquad=0; iquad<n_quad_pts; ++iquad) {
1213 real artificial_diss_coeff_at_q = 0.0;
1216 for (
unsigned int idof=0; idof<n_dofs_arti_diss; ++idof) {
1217 const unsigned int index = dof_indices_artificial_dissipation[idof];
1220 max_artificial_diss = std::max(artificial_diss_coeff_at_q, max_artificial_diss);
1224 double cell_volume_estimate = 0.0;
1225 for (
unsigned int iquad=0; iquad<n_quad_pts; ++iquad) {
1226 cell_volume_estimate += getValue<adtype>(metric_oper.
det_Jac_vol[iquad]) * vol_quad_weights[iquad];
1229 const real diameter = cell->diameter();
1230 const real cell_diameter = cell_volume / std::pow(diameter,dim-1);
1231 const real cell_radius = 0.5 * cell_diameter;
1232 this->cell_volume[current_cell_index] =
cell_volume;
1233 this->
max_dt_cell[current_cell_index] = this->
evaluate_CFL ( soln_at_q_for_max_CFL, max_artificial_diss, cell_radius, poly_degree);
1236 std::array<std::vector<adtype>,nstate> entropy_var_at_q;
1237 std::array<std::vector<adtype>,nstate> projected_entropy_var_at_q;
1239 for(
int istate=0; istate<
nstate; istate++){
1240 entropy_var_at_q[istate].resize(n_quad_pts);
1241 projected_entropy_var_at_q[istate].resize(n_quad_pts);
1243 for(
unsigned int iquad=0; iquad<n_quad_pts; iquad++){
1244 std::array<adtype,nstate> soln_state;
1245 for(
int istate=0; istate<
nstate; istate++){
1246 soln_state[istate] = soln_at_q[istate][iquad];
1248 std::array<adtype,nstate> entropy_var;
1250 for(
int istate=0; istate<
nstate; istate++){
1251 entropy_var_at_q[istate][iquad] = entropy_var[istate];
1254 for(
int istate=0; istate<
nstate; istate++){
1255 std::vector<adtype> entropy_var_coeff(n_shape_fns);;
1260 projected_entropy_var_at_q[istate],
1270 std::array<dealii::Tensor<1,dim,std::vector<adtype>>,nstate> conv_ref_flux_at_q;
1271 std::array<dealii::Tensor<1,dim,std::vector<adtype>>,nstate> diffusive_ref_flux_at_q;
1272 std::array<std::vector<adtype>,nstate> source_at_q;
1273 std::array<std::vector<adtype>,nstate> physical_source_at_q;
1276 std::array<std::array<std::vector<adtype>,dim>,nstate> conv_ref_2pt_flux_at_q;
1278 std::vector<std::array<unsigned int,dim>> Hadamard_rows_sparsity(n_quad_pts * n_quad_pts_1D);
1279 std::vector<std::array<unsigned int,dim>> Hadamard_columns_sparsity(n_quad_pts * n_quad_pts_1D);
1282 for(
int istate=0; istate<
nstate; istate++){
1283 for(
int idim=0; idim<dim; idim++){
1284 conv_ref_2pt_flux_at_q[istate][idim].resize(n_quad_pts * n_quad_pts_1D);
1293 for (
unsigned int iquad=0; iquad<n_quad_pts; ++iquad) {
1295 std::array<adtype,nstate> soln_state;
1296 std::array<dealii::Tensor<1,dim,adtype>,nstate> aux_soln_state;
1297 std::array<adtype,nstate> filtered_soln_state;
1298 std::array<dealii::Tensor<1,dim,adtype>,nstate> filtered_aux_soln_state;
1299 for(
int istate=0; istate<
nstate; istate++){
1300 soln_state[istate] = soln_at_q[istate][iquad];
1302 for(
int idim=0; idim<dim; idim++){
1303 aux_soln_state[istate][idim] = aux_soln_at_q[istate][idim][iquad];
1311 dealii::Tensor<2,dim,adtype> metric_cofactor;
1312 for(
int idim=0; idim<dim; idim++){
1313 for(
int jdim=0; jdim<dim; jdim++){
1321 std::array<dealii::Tensor<1,dim,adtype>,nstate> conv_phys_flux;
1324 std::array<adtype,nstate> entropy_var;
1325 for(
int istate=0; istate<
nstate; istate++){
1326 entropy_var[istate] = projected_entropy_var_at_q[istate][iquad];
1331 for(
unsigned int row_index = iquad * n_quad_pts_1D, column_index = 0;
1333 column_index < n_quad_pts_1D;
1334 row_index++, column_index++){
1336 if(Hadamard_rows_sparsity[row_index][0] != iquad){
1337 pcout<<
"The volume Hadamard rows sparsity pattern does not match. Aborting..."<<std::endl;
1345 for(
int ref_dim=0; ref_dim<dim; ref_dim++){
1346 const unsigned int flux_quad = Hadamard_columns_sparsity[row_index][ref_dim];
1348 dealii::Tensor<2,dim,adtype> metric_cofactor_flux_basis;
1349 for(
int idim=0; idim<dim; idim++){
1350 for(
int jdim=0; jdim<dim; jdim++){
1351 metric_cofactor_flux_basis[idim][jdim] = metric_oper.
metric_cofactor_vol[idim][jdim][flux_quad];
1354 std::array<adtype,nstate> soln_state_flux_basis;
1355 std::array<adtype,nstate> entropy_var_flux_basis;
1356 for(
int istate=0; istate<
nstate; istate++){
1357 entropy_var_flux_basis[istate] = projected_entropy_var_at_q[istate][flux_quad];
1362 std::array<dealii::Tensor<1,dim,adtype>,nstate> conv_phys_flux_2pt;
1365 for(
int istate=0; istate<
nstate; istate++){
1366 dealii::Tensor<1,dim,adtype> conv_ref_flux_2pt;
1368 dealii::Tensor<2,dim,adtype> metric_cofactor_split;
1369 for(
int idim=0; idim<dim; idim++){
1370 for(
int jdim=0; jdim<dim; jdim++){
1371 metric_cofactor_split[idim][jdim] = 0.5 * (metric_cofactor[idim][jdim] + metric_cofactor_flux_basis[idim][jdim]);
1375 conv_phys_flux_2pt[istate],
1376 metric_cofactor_split,
1379 conv_ref_2pt_flux_at_q[istate][ref_dim][iquad * n_quad_pts_1D + column_index] = conv_ref_flux_2pt[ref_dim];
1390 std::array<dealii::Tensor<1,dim,adtype>,nstate> diffusive_phys_flux;
1392 diffusive_phys_flux = pde_physics.
dissipative_flux(soln_state, aux_soln_state, filtered_soln_state, filtered_aux_soln_state, current_cell_index);
1395 std::array<adtype,nstate> manufactured_source;
1397 dealii::Point<dim,adtype> vol_flux_node;
1398 for(
int idim=0; idim<dim; idim++){
1402 manufactured_source = pde_physics.
source_term (vol_flux_node, soln_state, this->
current_time, current_cell_index);
1406 std::array<adtype,nstate> physical_source;
1408 dealii::Point<dim,adtype> vol_flux_node;
1409 for(
int idim=0; idim<dim; idim++){
1413 physical_source = pde_physics.
physical_source_term (vol_flux_node, soln_state, aux_soln_state, current_cell_index);
1417 for(
int istate=0; istate<
nstate; istate++){
1418 dealii::Tensor<1,dim,adtype> conv_ref_flux;
1419 dealii::Tensor<1,dim,adtype> diffusive_ref_flux;
1431 conv_phys_flux[istate],
1437 diffusive_phys_flux[istate],
1439 diffusive_ref_flux);
1444 for(
int idim=0; idim<dim; idim++){
1447 conv_ref_flux_at_q[istate][idim].resize(n_quad_pts);
1448 diffusive_ref_flux_at_q[istate][idim].resize(n_quad_pts);
1455 conv_ref_flux_at_q[istate][idim][iquad] = conv_ref_flux[idim];
1458 diffusive_ref_flux_at_q[istate][idim][iquad] = diffusive_ref_flux[idim];
1462 source_at_q[istate].resize(n_quad_pts);
1464 source_at_q[istate][iquad] = manufactured_source[istate];
1468 physical_source_at_q[istate].resize(n_quad_pts);
1470 physical_source_at_q[istate][iquad] = physical_source[istate];
1476 std::array<dealii::FullMatrix<real>,dim> flux_basis_stiffness_skew_symm_oper_sparse;
1478 for(
int idim=0; idim<dim; idim++){
1479 flux_basis_stiffness_skew_symm_oper_sparse[idim].reinit(n_quad_pts, n_quad_pts_1D);
1482 Hadamard_rows_sparsity, Hadamard_columns_sparsity,
1484 oneD_vol_quad_weights,
1485 flux_basis_stiffness_skew_symm_oper_sparse);
1491 for(
int istate=0; istate<
nstate; istate++){
1494 std::vector<adtype> conv_flux_divergence(n_quad_pts);
1495 std::vector<adtype> diffusive_flux_divergence(n_quad_pts);
1503 for(
int ref_dim=0; ref_dim<dim; ref_dim++){
1504 std::vector<adtype> divergence_ref_flux_Hadamard_product(n_quad_pts * n_quad_pts_1D);
1505 flux_basis.
Hadamard_product_AD_vector(flux_basis_stiffness_skew_symm_oper_sparse[ref_dim], conv_ref_2pt_flux_at_q[istate][ref_dim], divergence_ref_flux_Hadamard_product);
1507 for(
unsigned int iquad=0; iquad<n_quad_pts; iquad++){
1509 conv_flux_divergence[iquad] = 0.0;
1511 for(
unsigned int iquad_1D=0; iquad_1D<n_quad_pts_1D; iquad_1D++){
1512 conv_flux_divergence[iquad] += divergence_ref_flux_Hadamard_product[iquad * n_quad_pts_1D + iquad_1D];
1538 std::vector<adtype> rhs(n_shape_fns);
1542 std::vector<real> ones(n_quad_pts, 1.0);
1556 std::vector<adtype> JxWxsource(n_quad_pts);
1557 for(
unsigned int iquad=0; iquad<n_quad_pts; iquad++){
1558 JxWxsource[iquad] = vol_quad_weights[iquad] * metric_oper.
det_Jac_vol[iquad]*source_at_q[istate][iquad];
1560 std::vector<real> ones(n_quad_pts, 1.0);
1566 std::vector<adtype> JxWxphys_source(n_quad_pts);
1567 for(
unsigned int iquad=0; iquad<n_quad_pts; iquad++){
1568 JxWxphys_source[iquad] = vol_quad_weights[iquad] * metric_oper.
det_Jac_vol[iquad] * physical_source_at_q[istate][iquad];
1570 std::vector<real> ones(n_quad_pts, 1.0);
1574 for(
unsigned int ishape=0; ishape<n_shape_fns; ishape++){
1575 local_rhs_int_cell[istate*n_shape_fns + ishape] += rhs[ishape];
1581 template <
int dim,
int nspecies,
int nstate,
typename real,
typename MeshType>
1582 template <
typename adtype>
1584 typename dealii::DoFHandler<dim>::active_cell_iterator current_cell,
1585 const unsigned int iface,
1586 const dealii::types::global_dof_index current_cell_index,
1587 std::vector<bool> face_orientation,
1588 const std::array<std::vector<adtype>,
nstate> &soln_coeff,
1589 const std::array<dealii::Tensor<1,dim,std::vector<adtype>>,
nstate> &aux_soln_coeff,
1590 const unsigned int boundary_id,
1591 const unsigned int poly_degree,
1600 std::vector<adtype> &local_rhs_cell)
1603 const int opposite_iface = (iface == 0) ? 1 : (
1604 (iface == 1) ? 0 : (
1605 (iface == 2) ? 3 : (
1606 (iface == 3) ? 2 : (
1607 (iface == 4) ? 5 : (
1608 (iface == 5) ? 4 : -1)))));
1609 if(opposite_iface == -1) {
1610 pcout <<
"ERROR: Invalid iface, opposite_iface is -1. Aborting..."<<std::endl;
1613 std::vector<bool> opposite_face_orientation = {current_cell->face_orientation(opposite_iface), current_cell->face_rotation(opposite_iface), current_cell->face_flip(opposite_iface)};
1618 const auto neighbor_cell = (this->
using_wall_model) ? current_cell->neighbor(opposite_iface) : current_cell;
1619 const unsigned int neighbor_iface = (this->
using_wall_model) ? current_cell->neighbor_face_no(opposite_iface) : 0;
1620 const int i_fele_n = neighbor_cell->active_fe_index();
1621 const unsigned int n_dofs_neigh_cell = this->
fe_collection[i_fele_n].n_dofs_per_cell();
1623 std::vector<dealii::types::global_dof_index> neighbor_dofs_indices;
1624 neighbor_dofs_indices.resize(n_dofs_neigh_cell);
1625 neighbor_cell->get_dof_indices (neighbor_dofs_indices);
1626 std::vector<bool> neighbor_face_orientation = {neighbor_cell->face_orientation(neighbor_iface), neighbor_cell->face_rotation(neighbor_iface), neighbor_cell->face_flip(neighbor_iface)};
1628 AssertDimension (n_dofs_neigh_cell, neighbor_dofs_indices.size());
1634 const unsigned int n_shape_fns = n_dofs /
nstate;
1641 std::array<std::vector<adtype>,
nstate> neighbor_soln_coeff;
1642 for (
unsigned int idof = 0; idof <
n_dofs; ++idof) {
1643 const unsigned int istate = this->
fe_collection[poly_degree].system_to_component_index(idof).first;
1644 const unsigned int ishape = this->
fe_collection[poly_degree].system_to_component_index(idof).second;
1647 neighbor_soln_coeff[istate].resize(n_shape_fns);
1650 neighbor_soln_coeff[istate][ishape] = this->
solution(neighbor_dofs_indices[idof]);
1654 std::array<std::vector<adtype>,
nstate> soln_at_vol_q;
1655 std::array<dealii::Tensor<1,dim,std::vector<adtype>>,
nstate> aux_soln_at_vol_q;
1657 std::array<std::vector<adtype>,
nstate> soln_at_surf_q;
1658 std::array<dealii::Tensor<1,dim,std::vector<adtype>>,
nstate> aux_soln_at_surf_q;
1660 std::array<std::vector<adtype>,
nstate> soln_at_opposite_surf_q;
1661 for(
int istate=0; istate<
nstate; ++istate){
1663 soln_at_vol_q[istate].resize(n_quad_pts_vol);
1669 soln_at_surf_q[istate].resize(n_face_quad_pts);
1673 soln_coeff[istate], soln_at_surf_q[istate],
1678 soln_at_opposite_surf_q[istate].resize(n_face_quad_pts);
1680 if(this->wall_model_input_from_second_element) {
1682 neighbor_soln_coeff[istate], soln_at_opposite_surf_q[istate],
1687 soln_coeff[istate], soln_at_opposite_surf_q[istate],
1693 for(
int idim=0; idim<dim; idim++){
1695 aux_soln_at_vol_q[istate][idim].resize(n_quad_pts_vol);
1701 aux_soln_at_surf_q[istate][idim].resize(n_face_quad_pts);
1705 aux_soln_coeff[istate][idim], aux_soln_at_surf_q[istate][idim],
1713 std::array<std::vector<adtype>,nstate> legendre_soln_at_vol_q;
1714 std::array<dealii::Tensor<1,dim,std::vector<adtype>>,nstate> legendre_aux_soln_at_vol_q;
1716 std::array<std::vector<adtype>,nstate> legendre_soln_at_surf_q;
1717 std::array<dealii::Tensor<1,dim,std::vector<adtype>>,nstate> legendre_aux_soln_at_surf_q;
1723 std::array<std::vector<adtype>,nstate> primitive_soln_at_vol_q;
1724 std::array<dealii::Tensor<1,dim,std::vector<adtype>>,nstate> primitive_aux_soln_at_vol_q;
1725 std::array<std::vector<adtype>,nstate> primitive_soln_at_surf_q;
1726 std::array<dealii::Tensor<1,dim,std::vector<adtype>>,nstate> primitive_aux_soln_at_surf_q;
1728 for(
int istate=0; istate<
nstate; istate++){
1729 primitive_soln_at_vol_q[istate].resize(n_quad_pts_vol);
1730 primitive_soln_at_surf_q[istate].resize(n_face_quad_pts);
1731 for(
int idim=0; idim<dim; idim++){
1732 primitive_aux_soln_at_vol_q[istate][idim].resize(n_quad_pts_vol);
1733 primitive_aux_soln_at_surf_q[istate][idim].resize(n_face_quad_pts);
1738 for (
unsigned int iquad=0; iquad<n_quad_pts_vol; ++iquad) {
1740 std::array<adtype,nstate> soln_state;
1741 std::array<dealii::Tensor<1,dim,adtype>,nstate> aux_soln_state;
1742 for(
int istate=0; istate<
nstate; istate++){
1743 soln_state[istate] = soln_at_vol_q[istate][iquad];
1744 for(
int idim=0; idim<dim; idim++){
1745 aux_soln_state[istate][idim] = aux_soln_at_vol_q[istate][idim][iquad];
1752 for(
int istate=0; istate<
nstate; istate++){
1753 primitive_soln_at_vol_q[istate][iquad] = primitive_soln_state[istate];
1754 for(
int idim=0; idim<dim; idim++){
1755 primitive_aux_soln_at_vol_q[istate][idim][iquad] = primitive_aux_soln_state[istate][idim];
1760 for(
unsigned int iquad_face=0; iquad_face<n_face_quad_pts; iquad_face++){
1762 std::array<adtype,nstate> soln_state;
1763 std::array<dealii::Tensor<1,dim,adtype>,nstate> aux_soln_state;
1764 for(
int istate=0; istate<
nstate; istate++){
1765 soln_state[istate] = soln_at_surf_q[istate][iquad_face];
1766 for(
int idim=0; idim<dim; idim++){
1767 aux_soln_state[istate][idim] = aux_soln_at_surf_q[istate][idim][iquad_face];
1774 for(
int istate=0; istate<
nstate; istate++){
1775 primitive_soln_at_surf_q[istate][iquad_face] = primitive_soln_state[istate];
1776 for(
int idim=0; idim<dim; idim++){
1777 primitive_aux_soln_at_surf_q[istate][idim][iquad_face] = primitive_aux_soln_state[istate][idim];
1786 std::array<std::vector<adtype>,nstate> primitive_legendre_soln_at_vol_q;
1787 std::array<dealii::Tensor<1,dim,std::vector<adtype>>,nstate> primitive_legendre_aux_soln_at_vol_q;
1788 std::array<std::vector<adtype>,nstate> primitive_legendre_soln_at_surf_q;
1789 std::array<dealii::Tensor<1,dim,std::vector<adtype>>,nstate> primitive_legendre_aux_soln_at_surf_q;
1793 dealii::FE_DGQLegendre<1,1> legendre_poly_1D(poly_degree);
1802 for(
int istate=0; istate<
nstate; istate++){
1807 std::vector<adtype> legendre_soln_coeff(n_shape_fns);
1808 legendre_soln_basis_projection_oper.
matrix_vector_mult_1D(primitive_soln_at_vol_q[istate], legendre_soln_coeff,
1812 for(
unsigned int ishape=0; ishape<n_shape_fns; ishape++){
1813 if(ishape < p_min_filtered){
1814 legendre_soln_coeff[ishape] = 0.0;
1819 primitive_legendre_soln_at_vol_q[istate].resize(n_quad_pts_vol);
1820 legendre_soln_basis.
matrix_vector_mult_1D(legendre_soln_coeff, primitive_legendre_soln_at_vol_q[istate],
1822 primitive_legendre_soln_at_surf_q[istate].resize(n_face_quad_pts);
1825 legendre_soln_coeff, primitive_legendre_soln_at_surf_q[istate],
1833 dealii::Tensor<1,dim,std::vector<adtype>> legendre_aux_soln_coeff;
1834 for(
int idim=0; idim<dim; idim++){
1836 legendre_aux_soln_coeff[idim].resize(n_shape_fns);
1838 legendre_soln_basis_projection_oper.
matrix_vector_mult_1D(primitive_aux_soln_at_vol_q[istate][idim], legendre_aux_soln_coeff[idim],
1842 for(
unsigned int ishape=0; ishape<n_shape_fns; ishape++){
1843 if(ishape < p_min_filtered){
1844 legendre_aux_soln_coeff[idim][ishape] = 0.0;
1850 for(
unsigned int ishape=0; ishape<n_shape_fns; ishape++){
1851 legendre_aux_soln_coeff[idim][ishape] = 0.0;
1855 primitive_legendre_aux_soln_at_vol_q[istate][idim].resize(n_quad_pts_vol);
1856 legendre_soln_basis.
matrix_vector_mult_1D(legendre_aux_soln_coeff[idim], primitive_legendre_aux_soln_at_vol_q[istate][idim],
1858 primitive_legendre_aux_soln_at_surf_q[istate][idim].resize(n_face_quad_pts);
1861 legendre_aux_soln_coeff[idim], primitive_legendre_aux_soln_at_surf_q[istate][idim],
1871 for(
int istate=0; istate<
nstate; istate++){
1872 legendre_soln_at_vol_q[istate].resize(n_quad_pts_vol);
1873 legendre_soln_at_surf_q[istate].resize(n_face_quad_pts);
1874 for(
int idim=0; idim<dim; idim++){
1875 legendre_aux_soln_at_vol_q[istate][idim].resize(n_quad_pts_vol);
1876 legendre_aux_soln_at_surf_q[istate][idim].resize(n_face_quad_pts);
1881 for (
unsigned int iquad=0; iquad<n_quad_pts_vol; ++iquad) {
1883 std::array<adtype,nstate> primitive_legendre_soln_state;
1884 std::array<dealii::Tensor<1,dim,adtype>,nstate> primitive_legendre_aux_soln_state;
1885 for(
int istate=0; istate<
nstate; istate++){
1886 primitive_legendre_soln_state[istate] = primitive_legendre_soln_at_vol_q[istate][iquad];
1887 for(
int idim=0; idim<dim; idim++){
1888 primitive_legendre_aux_soln_state[istate][idim] = primitive_legendre_aux_soln_at_vol_q[istate][idim][iquad];
1895 for(
int istate=0; istate<
nstate; istate++){
1896 legendre_soln_at_vol_q[istate][iquad] = legendre_soln_state[istate];
1897 for(
int idim=0; idim<dim; idim++){
1898 legendre_aux_soln_at_vol_q[istate][idim][iquad] = legendre_aux_soln_state[istate][idim];
1903 for (
unsigned int iquad_face=0; iquad_face<n_face_quad_pts; iquad_face++) {
1905 std::array<adtype,nstate> primitive_legendre_soln_state;
1906 std::array<dealii::Tensor<1,dim,adtype>,nstate> primitive_legendre_aux_soln_state;
1907 for(
int istate=0; istate<
nstate; istate++){
1908 primitive_legendre_soln_state[istate] = primitive_legendre_soln_at_surf_q[istate][iquad_face];
1909 for(
int idim=0; idim<dim; idim++){
1910 primitive_legendre_aux_soln_state[istate][idim] = primitive_legendre_aux_soln_at_surf_q[istate][idim][iquad_face];
1917 for(
int istate=0; istate<
nstate; istate++){
1918 legendre_soln_at_surf_q[istate][iquad_face] = legendre_soln_state[istate];
1919 for(
int idim=0; idim<dim; idim++){
1920 legendre_aux_soln_at_surf_q[istate][idim][iquad_face] = legendre_aux_soln_state[istate][idim];
1930 std::array<dealii::Tensor<1,dim,std::vector<adtype>>,nstate> conv_ref_flux_at_vol_q;
1931 std::array<dealii::Tensor<1,dim,std::vector<adtype>>,nstate> diffusive_ref_flux_at_vol_q;
1932 for (
unsigned int iquad=0; iquad<n_quad_pts_vol; ++iquad) {
1936 dealii::Tensor<2,dim,adtype> metric_cofactor_vol;
1937 for(
int idim=0; idim<dim; idim++){
1938 for(
int jdim=0; jdim<dim; jdim++){
1942 std::array<adtype,nstate> soln_state;
1943 std::array<dealii::Tensor<1,dim,adtype>,nstate> aux_soln_state;
1944 std::array<adtype,nstate> filtered_soln_state;
1945 std::array<dealii::Tensor<1,dim,adtype>,nstate> filtered_aux_soln_state;
1946 for(
int istate=0; istate<
nstate; istate++){
1947 soln_state[istate] = soln_at_vol_q[istate][iquad];
1949 for(
int idim=0; idim<dim; idim++){
1950 aux_soln_state[istate][idim] = aux_soln_at_vol_q[istate][idim][iquad];
1956 std::array<dealii::Tensor<1,dim,adtype>,nstate> conv_phys_flux;
1962 std::array<dealii::Tensor<1,dim,adtype>,nstate> diffusive_phys_flux;
1963 diffusive_phys_flux = pde_physics.
dissipative_flux(soln_state, aux_soln_state, filtered_soln_state, filtered_aux_soln_state, current_cell_index);
1966 for(
int istate=0; istate<
nstate; istate++){
1967 dealii::Tensor<1,dim,adtype> conv_ref_flux;
1968 dealii::Tensor<1,dim,adtype> diffusive_ref_flux;
1972 conv_phys_flux[istate],
1973 metric_cofactor_vol,
1978 diffusive_phys_flux[istate],
1979 metric_cofactor_vol,
1980 diffusive_ref_flux);
1985 for(
int idim=0; idim<dim; idim++){
1988 conv_ref_flux_at_vol_q[istate][idim].resize(n_quad_pts_vol);
1989 diffusive_ref_flux_at_vol_q[istate][idim].resize(n_quad_pts_vol);
1993 conv_ref_flux_at_vol_q[istate][idim][iquad] = conv_ref_flux[idim];
1996 diffusive_ref_flux_at_vol_q[istate][idim][iquad] = diffusive_ref_flux[idim];
2006 const dealii::Tensor<1,dim,double> unit_ref_normal_int = dealii::GeometryInfo<dim>::unit_normal_vector[iface];
2007 const int dim_not_zero = iface / 2;
2009 std::array<std::vector<adtype>,nstate> conv_int_vol_ref_flux_interp_to_face_dot_ref_normal;
2010 std::array<std::vector<adtype>,nstate> diffusive_int_vol_ref_flux_interp_to_face_dot_ref_normal;
2011 for(
int istate=0; istate<
nstate; istate++){
2013 conv_int_vol_ref_flux_interp_to_face_dot_ref_normal[istate].resize(n_face_quad_pts);
2014 diffusive_int_vol_ref_flux_interp_to_face_dot_ref_normal[istate].resize(n_face_quad_pts);
2023 conv_ref_flux_at_vol_q[istate][dim_not_zero],
2024 conv_int_vol_ref_flux_interp_to_face_dot_ref_normal[istate],
2027 false, unit_ref_normal_int[dim_not_zero]);
2033 diffusive_ref_flux_at_vol_q[istate][dim_not_zero],
2034 diffusive_int_vol_ref_flux_interp_to_face_dot_ref_normal[istate],
2037 false, unit_ref_normal_int[dim_not_zero]);
2047 std::array<std::vector<adtype>,nstate> entropy_var_vol;
2048 for(
unsigned int iquad=0; iquad<n_quad_pts_vol; iquad++){
2049 std::array<adtype,nstate> soln_state;
2050 for(
int istate=0; istate<
nstate; istate++){
2051 soln_state[istate] = soln_at_vol_q[istate][iquad];
2053 std::array<adtype,nstate> entropy_var;
2055 for(
int istate=0; istate<
nstate; istate++){
2057 entropy_var_vol[istate].resize(n_quad_pts_vol);
2059 entropy_var_vol[istate][iquad] = entropy_var[istate];
2064 std::array<std::vector<adtype>,nstate> projected_entropy_var_vol;
2065 std::array<std::vector<adtype>,nstate> projected_entropy_var_surf;
2066 for(
int istate=0; istate<
nstate; istate++){
2068 projected_entropy_var_vol[istate].resize(n_quad_pts_vol);
2069 projected_entropy_var_surf[istate].resize(n_face_quad_pts);
2072 std::vector<adtype> entropy_var_coeff(n_shape_fns);
2077 projected_entropy_var_vol[istate],
2082 projected_entropy_var_surf[istate],
2088 const unsigned int row_size = n_face_quad_pts * n_quad_pts_1D;
2089 const unsigned int col_size = n_face_quad_pts * n_quad_pts_1D;
2090 std::vector<unsigned int> Hadamard_rows_sparsity(row_size);
2091 std::vector<unsigned int> Hadamard_columns_sparsity(col_size);
2096 std::array<std::vector<adtype>,nstate> surf_vol_ref_2pt_flux_interp_surf;
2097 std::array<std::vector<adtype>,nstate> surf_vol_ref_2pt_flux_interp_vol;
2100 std::array<std::vector<adtype>,nstate> surface_ref_2pt_flux;
2102 for(
int istate=0; istate<
nstate; istate++){
2103 surface_ref_2pt_flux[istate].resize(n_face_quad_pts * n_quad_pts_1D);
2105 for(
unsigned int iquad_face=0; iquad_face<n_face_quad_pts; iquad_face++){
2106 dealii::Tensor<2,dim,adtype> metric_cofactor_surf;
2107 for(
int idim=0; idim<dim; idim++){
2108 for(
int jdim=0; jdim<dim; jdim++){
2114 std::array<adtype,nstate> entropy_var_face;
2115 for(
int istate=0; istate<
nstate; istate++){
2116 entropy_var_face[istate] = projected_entropy_var_surf[istate][iquad_face];
2118 std::array<adtype,nstate> soln_state_face;
2122 for(
unsigned int row_index = iquad_face * n_quad_pts_1D, column_index = 0;
2123 column_index < n_quad_pts_1D;
2124 row_index++, column_index++){
2126 if(Hadamard_rows_sparsity[row_index] != iquad_face){
2127 pcout<<
"The boundary Hadamard rows sparsity pattern does not match."<<std::endl;
2131 const unsigned int iquad_vol = Hadamard_columns_sparsity[row_index];
2135 dealii::Tensor<2,dim,adtype> metric_cofactor_vol;
2136 for(
int idim=0; idim<dim; idim++){
2137 for(
int jdim=0; jdim<dim; jdim++){
2141 std::array<adtype,nstate> entropy_var;
2142 for(
int istate=0; istate<
nstate; istate++){
2143 entropy_var[istate] = projected_entropy_var_vol[istate][iquad_vol];
2145 std::array<adtype,nstate> soln_state;
2152 std::array<dealii::Tensor<1,dim,adtype>,nstate> conv_phys_flux_2pt;
2154 for(
int istate=0; istate<
nstate; istate++){
2155 dealii::Tensor<1,dim,adtype> conv_ref_flux_2pt;
2157 dealii::Tensor<2,dim,adtype> metric_cofactor_split;
2158 for(
int idim=0; idim<dim; idim++){
2159 for(
int jdim=0; jdim<dim; jdim++){
2160 metric_cofactor_split[idim][jdim] = 0.5 * (metric_cofactor_surf[idim][jdim] + metric_cofactor_vol[idim][jdim]);
2164 conv_phys_flux_2pt[istate],
2165 metric_cofactor_split,
2168 surface_ref_2pt_flux[istate][iquad_face * n_quad_pts_1D + column_index] = conv_ref_flux_2pt[dim_not_zero];
2175 const int iface_1D = iface % 2;
2177 dealii::FullMatrix<real> surf_oper_sparse(n_face_quad_pts, n_quad_pts_1D);
2179 Hadamard_rows_sparsity, Hadamard_columns_sparsity,
2181 oneD_quad_weights_vol,
2187 for(
int istate=0; istate<
nstate; istate++){
2189 std::vector<adtype> surface_ref_2pt_flux_int_Hadamard_with_surf_oper(n_face_quad_pts * n_quad_pts_1D);
2191 surface_ref_2pt_flux[istate],
2192 surface_ref_2pt_flux_int_Hadamard_with_surf_oper);
2194 surf_vol_ref_2pt_flux_interp_surf[istate].resize(n_face_quad_pts);
2195 surf_vol_ref_2pt_flux_interp_vol[istate].resize(n_quad_pts_vol);
2197 for(
unsigned int iface_quad=0; iface_quad<n_face_quad_pts; iface_quad++){
2198 for(
unsigned int iquad_int=0; iquad_int<n_quad_pts_1D; iquad_int++){
2199 surf_vol_ref_2pt_flux_interp_surf[istate][iface_quad]
2200 -= surface_ref_2pt_flux_int_Hadamard_with_surf_oper[iface_quad * n_quad_pts_1D + iquad_int]
2201 * unit_ref_normal_int[dim_not_zero];
2202 const unsigned int column_index = iface_quad * n_quad_pts_1D + iquad_int;
2203 surf_vol_ref_2pt_flux_interp_vol[istate][Hadamard_columns_sparsity[column_index]]
2204 += surface_ref_2pt_flux_int_Hadamard_with_surf_oper[iface_quad * n_quad_pts_1D + iquad_int]
2205 * unit_ref_normal_int[dim_not_zero];
2213 std::array<std::vector<adtype>,nstate> conv_flux_dot_normal;
2214 std::array<std::vector<adtype>,nstate> diss_flux_dot_normal_diff;
2216 for (
unsigned int iquad=0; iquad<n_face_quad_pts; ++iquad) {
2222 dealii::Tensor<2,dim,adtype> metric_cofactor_surf;
2223 for(
int idim=0; idim<dim; idim++){
2224 for(
int jdim=0; jdim<dim; jdim++){
2229 dealii::Tensor<1,dim,adtype> unit_phys_normal_int;
2231 metric_cofactor_surf,
2232 unit_phys_normal_int);
2233 adtype face_Jac_norm_scaled = 0.0;
2234 for(
int idim=0; idim<dim; idim++){
2235 face_Jac_norm_scaled += unit_phys_normal_int[idim] * unit_phys_normal_int[idim];
2237 face_Jac_norm_scaled = sqrt(face_Jac_norm_scaled);
2238 unit_phys_normal_int /= face_Jac_norm_scaled;
2242 std::array<adtype,nstate> entropy_var_face;
2243 std::array<dealii::Tensor<1,dim,adtype>,nstate> aux_soln_state;
2244 std::array<adtype,nstate> soln_interp_to_face;
2245 std::array<adtype,nstate> soln_state;
2246 std::array<adtype,nstate> opposite_surf_soln_state;
2247 std::array<adtype,nstate> filtered_soln_state;
2248 std::array<dealii::Tensor<1,dim,adtype>,nstate> filtered_aux_soln_state;
2249 for(
int istate=0; istate<
nstate; istate++){
2250 soln_interp_to_face[istate] = soln_at_surf_q[istate][iquad];
2251 soln_state[istate] = soln_interp_to_face[istate];
2252 entropy_var_face[istate] = projected_entropy_var_surf[istate][iquad];
2253 if(this->
using_wall_model && (boundary_id == 1001)) opposite_surf_soln_state[istate] = soln_at_opposite_surf_q[istate][iquad];
2255 for(
int idim=0; idim<dim; idim++){
2256 aux_soln_state[istate][idim] = aux_soln_at_surf_q[istate][idim][iquad];
2262 if((this->
all_parameters->
use_split_form || this->all_parameters->use_curvilinear_split_form) && this->use_projected_entropy_variables_for_nsfr_boundary_term) {
2266 std::array<adtype,nstate> soln_boundary;
2267 std::array<dealii::Tensor<1,dim,adtype>,nstate> grad_soln_boundary;
2268 dealii::Point<dim,adtype> surf_flux_node;
2269 for(
int idim=0; idim<dim; idim++){
2270 surf_flux_node[idim] = metric_oper.
flux_nodes_surf[iface][idim][iquad];
2276 pde_physics.
boundary_face_values (boundary_id, surf_flux_node, unit_phys_normal_int, soln_state, aux_soln_state, filtered_soln_state, filtered_aux_soln_state, soln_boundary, grad_soln_boundary);
2279 std::array<adtype,nstate> conv_num_flux_dot_n_at_q;
2280 conv_num_flux_dot_n_at_q = conv_num_flux.
evaluate_flux(soln_state, soln_boundary, unit_phys_normal_int);
2283 pde_physics.
boundary_face_values_viscous_flux (boundary_id, surf_flux_node, unit_phys_normal_int, soln_state, aux_soln_state, filtered_soln_state, filtered_aux_soln_state, soln_boundary, grad_soln_boundary);
2284 std::array<adtype,nstate> diss_auxi_num_flux_dot_n_at_q;
2287 opposite_surf_soln_state, aux_soln_state,
2288 filtered_soln_state, filtered_aux_soln_state,
2291 unit_phys_normal_int,
2295 current_cell_index, current_cell_index,
2297 soln_interp_to_face, soln_boundary,
2298 aux_soln_state, grad_soln_boundary,
2299 filtered_soln_state, soln_boundary,
2300 filtered_aux_soln_state, grad_soln_boundary,
2301 unit_phys_normal_int, penalty,
true, boundary_id);
2304 for(
int istate=0; istate<
nstate; istate++){
2307 conv_flux_dot_normal[istate].resize(n_face_quad_pts);
2308 diss_flux_dot_normal_diff[istate].resize(n_face_quad_pts);
2311 conv_flux_dot_normal[istate][iquad] = face_Jac_norm_scaled * conv_num_flux_dot_n_at_q[istate];
2312 diss_flux_dot_normal_diff[istate][iquad] = face_Jac_norm_scaled * diss_auxi_num_flux_dot_n_at_q[istate]
2313 - diffusive_int_vol_ref_flux_interp_to_face_dot_ref_normal[istate][iquad];
2318 for(
int istate=0; istate<
nstate; istate++){
2319 std::vector<adtype> rhs(n_shape_fns);
2322 std::vector<real> ones_surf(n_face_quad_pts, 1.0);
2325 surf_vol_ref_2pt_flux_interp_surf[istate],
2330 std::vector<real> ones_vol(n_quad_pts_vol, 1.0);
2339 conv_int_vol_ref_flux_interp_to_face_dot_ref_normal[istate],
2340 face_quad_weights, rhs,
2348 conv_flux_dot_normal[istate],
2349 face_quad_weights, rhs,
2356 diss_flux_dot_normal_diff[istate],
2357 face_quad_weights, rhs,
2362 for(
unsigned int ishape=0; ishape<n_shape_fns; ishape++){
2363 local_rhs_cell[istate*n_shape_fns + ishape] += rhs[ishape];
2369 template <
int dim,
int nspecies,
int nstate,
typename real,
typename MeshType>
2370 template <
typename adtype>
2372 const unsigned int iface,
2373 const unsigned int neighbor_iface,
2374 const dealii::types::global_dof_index current_cell_index,
2375 const dealii::types::global_dof_index neighbor_cell_index,
2376 std::vector<bool> face_orientation_int,
2377 std::vector<bool> face_orientation_ext,
2378 const std::array<std::vector<adtype>,
nstate> &soln_coeff_int,
2379 const std::array<std::vector<adtype>,
nstate> &soln_coeff_ext,
2380 const std::array<dealii::Tensor<1,dim,std::vector<adtype>>,
nstate> &aux_soln_coeff_int,
2381 const std::array<dealii::Tensor<1,dim,std::vector<adtype>>,
nstate> &aux_soln_coeff_ext,
2382 const unsigned int poly_degree_int,
2383 const unsigned int poly_degree_ext,
2396 std::vector<adtype> &local_rhs_int_cell,
2397 std::vector<adtype> &local_rhs_ext_cell)
2407 const unsigned int n_dofs_int = this->
fe_collection[poly_degree_int].dofs_per_cell;
2408 const unsigned int n_dofs_ext = this->
fe_collection[poly_degree_ext].dofs_per_cell;
2410 const unsigned int n_shape_fns_int = n_dofs_int /
nstate;
2411 const unsigned int n_shape_fns_ext = n_dofs_ext /
nstate;
2414 std::array<std::vector<adtype>,
nstate> soln_at_vol_q_int;
2415 std::array<std::vector<adtype>,
nstate> soln_at_vol_q_ext;
2416 std::array<dealii::Tensor<1,dim,std::vector<adtype>>,
nstate> aux_soln_at_vol_q_int;
2417 std::array<dealii::Tensor<1,dim,std::vector<adtype>>,
nstate> aux_soln_at_vol_q_ext;
2419 std::array<std::vector<adtype>,
nstate> soln_at_surf_q_int;
2420 std::array<std::vector<adtype>,
nstate> soln_at_surf_q_ext;
2421 std::array<dealii::Tensor<1,dim,std::vector<adtype>>,
nstate> aux_soln_at_surf_q_int;
2422 std::array<dealii::Tensor<1,dim,std::vector<adtype>>,
nstate> aux_soln_at_surf_q_ext;
2423 for(
int istate=0; istate<
nstate; ++istate){
2425 soln_at_vol_q_int[istate].resize(n_quad_pts_vol_int);
2426 soln_at_vol_q_ext[istate].resize(n_quad_pts_vol_ext);
2434 soln_at_surf_q_int[istate].resize(n_face_quad_pts);
2435 soln_at_surf_q_ext[istate].resize(n_face_quad_pts);
2439 soln_coeff_int[istate], soln_at_surf_q_int[istate],
2444 soln_coeff_ext[istate], soln_at_surf_q_ext[istate],
2448 for(
int idim=0; idim<dim; idim++){
2450 aux_soln_at_vol_q_int[istate][idim].resize(n_quad_pts_vol_int);
2451 aux_soln_at_vol_q_ext[istate][idim].resize(n_quad_pts_vol_ext);
2453 soln_basis_int.
matrix_vector_mult_1D(aux_soln_coeff_int[istate][idim], aux_soln_at_vol_q_int[istate][idim],
2455 soln_basis_ext.
matrix_vector_mult_1D(aux_soln_coeff_ext[istate][idim], aux_soln_at_vol_q_ext[istate][idim],
2459 aux_soln_at_surf_q_int[istate][idim].resize(n_face_quad_pts);
2460 aux_soln_at_surf_q_ext[istate][idim].resize(n_face_quad_pts);
2464 aux_soln_coeff_int[istate][idim], aux_soln_at_surf_q_int[istate][idim],
2469 aux_soln_coeff_ext[istate][idim], aux_soln_at_surf_q_ext[istate][idim],
2477 std::array<std::vector<adtype>,nstate> legendre_soln_at_vol_q_int;
2478 std::array<dealii::Tensor<1,dim,std::vector<adtype>>,nstate> legendre_aux_soln_at_vol_q_int;
2479 std::array<std::vector<adtype>,nstate> legendre_soln_at_vol_q_ext;
2480 std::array<dealii::Tensor<1,dim,std::vector<adtype>>,nstate> legendre_aux_soln_at_vol_q_ext;
2482 std::array<std::vector<adtype>,nstate> legendre_soln_at_surf_q_int;
2483 std::array<dealii::Tensor<1,dim,std::vector<adtype>>,nstate> legendre_aux_soln_at_surf_q_int;
2484 std::array<std::vector<adtype>,nstate> legendre_soln_at_surf_q_ext;
2485 std::array<dealii::Tensor<1,dim,std::vector<adtype>>,nstate> legendre_aux_soln_at_surf_q_ext;
2491 std::array<std::vector<adtype>,nstate> primitive_soln_at_vol_q_int;
2492 std::array<dealii::Tensor<1,dim,std::vector<adtype>>,nstate> primitive_aux_soln_at_vol_q_int;
2493 std::array<std::vector<adtype>,nstate> primitive_soln_at_surf_q_int;
2494 std::array<dealii::Tensor<1,dim,std::vector<adtype>>,nstate> primitive_aux_soln_at_surf_q_int;
2495 std::array<std::vector<adtype>,nstate> primitive_soln_at_vol_q_ext;
2496 std::array<dealii::Tensor<1,dim,std::vector<adtype>>,nstate> primitive_aux_soln_at_vol_q_ext;
2497 std::array<std::vector<adtype>,nstate> primitive_soln_at_surf_q_ext;
2498 std::array<dealii::Tensor<1,dim,std::vector<adtype>>,nstate> primitive_aux_soln_at_surf_q_ext;
2500 for(
int istate=0; istate<
nstate; istate++){
2501 primitive_soln_at_vol_q_int[istate].resize(n_quad_pts_vol_int);
2502 primitive_soln_at_surf_q_int[istate].resize(n_face_quad_pts);
2503 primitive_soln_at_vol_q_ext[istate].resize(n_quad_pts_vol_ext);
2504 primitive_soln_at_surf_q_ext[istate].resize(n_face_quad_pts);
2505 for(
int idim=0; idim<dim; idim++){
2506 primitive_aux_soln_at_vol_q_int[istate][idim].resize(n_quad_pts_vol_int);
2507 primitive_aux_soln_at_surf_q_int[istate][idim].resize(n_face_quad_pts);
2508 primitive_aux_soln_at_vol_q_ext[istate][idim].resize(n_quad_pts_vol_ext);
2509 primitive_aux_soln_at_surf_q_ext[istate][idim].resize(n_face_quad_pts);
2514 for (
unsigned int iquad=0; iquad<n_quad_pts_vol_int; ++iquad) {
2516 std::array<adtype,nstate> soln_state;
2517 std::array<dealii::Tensor<1,dim,adtype>,nstate> aux_soln_state;
2518 for(
int istate=0; istate<
nstate; istate++){
2519 soln_state[istate] = soln_at_vol_q_int[istate][iquad];
2520 for(
int idim=0; idim<dim; idim++){
2521 aux_soln_state[istate][idim] = aux_soln_at_vol_q_int[istate][idim][iquad];
2528 for(
int istate=0; istate<
nstate; istate++){
2529 primitive_soln_at_vol_q_int[istate][iquad] = primitive_soln_state[istate];
2530 for(
int idim=0; idim<dim; idim++){
2531 primitive_aux_soln_at_vol_q_int[istate][idim][iquad] = primitive_aux_soln_state[istate][idim];
2536 for (
unsigned int iquad=0; iquad<n_quad_pts_vol_ext; ++iquad) {
2538 std::array<adtype,nstate> soln_state;
2539 std::array<dealii::Tensor<1,dim,adtype>,nstate> aux_soln_state;
2540 for(
int istate=0; istate<
nstate; istate++){
2541 soln_state[istate] = soln_at_vol_q_ext[istate][iquad];
2542 for(
int idim=0; idim<dim; idim++){
2543 aux_soln_state[istate][idim] = aux_soln_at_vol_q_ext[istate][idim][iquad];
2550 for(
int istate=0; istate<
nstate; istate++){
2551 primitive_soln_at_vol_q_ext[istate][iquad] = primitive_soln_state[istate];
2552 for(
int idim=0; idim<dim; idim++){
2553 primitive_aux_soln_at_vol_q_ext[istate][idim][iquad] = primitive_aux_soln_state[istate][idim];
2558 for(
unsigned int iquad_face=0; iquad_face<n_face_quad_pts; iquad_face++){
2560 std::array<adtype,nstate> soln_state;
2561 std::array<dealii::Tensor<1,dim,adtype>,nstate> aux_soln_state;
2562 for(
int istate=0; istate<
nstate; istate++){
2563 soln_state[istate] = soln_at_surf_q_int[istate][iquad_face];
2564 for(
int idim=0; idim<dim; idim++){
2565 aux_soln_state[istate][idim] = aux_soln_at_surf_q_int[istate][idim][iquad_face];
2572 for(
int istate=0; istate<
nstate; istate++){
2573 primitive_soln_at_surf_q_int[istate][iquad_face] = primitive_soln_state[istate];
2574 for(
int idim=0; idim<dim; idim++){
2575 primitive_aux_soln_at_surf_q_int[istate][idim][iquad_face] = primitive_aux_soln_state[istate][idim];
2580 for(
unsigned int iquad_face=0; iquad_face<n_face_quad_pts; iquad_face++){
2582 std::array<adtype,nstate> soln_state;
2583 std::array<dealii::Tensor<1,dim,adtype>,nstate> aux_soln_state;
2584 for(
int istate=0; istate<
nstate; istate++){
2585 soln_state[istate] = soln_at_surf_q_ext[istate][iquad_face];
2586 for(
int idim=0; idim<dim; idim++){
2587 aux_soln_state[istate][idim] = aux_soln_at_surf_q_ext[istate][idim][iquad_face];
2594 for(
int istate=0; istate<
nstate; istate++){
2595 primitive_soln_at_surf_q_ext[istate][iquad_face] = primitive_soln_state[istate];
2596 for(
int idim=0; idim<dim; idim++){
2597 primitive_aux_soln_at_surf_q_ext[istate][idim][iquad_face] = primitive_aux_soln_state[istate][idim];
2606 std::array<std::vector<adtype>,nstate> primitive_legendre_soln_at_vol_q_int;
2607 std::array<dealii::Tensor<1,dim,std::vector<adtype>>,nstate> primitive_legendre_aux_soln_at_vol_q_int;
2608 std::array<std::vector<adtype>,nstate> primitive_legendre_soln_at_surf_q_int;
2609 std::array<dealii::Tensor<1,dim,std::vector<adtype>>,nstate> primitive_legendre_aux_soln_at_surf_q_int;
2610 std::array<std::vector<adtype>,nstate> primitive_legendre_soln_at_vol_q_ext;
2611 std::array<dealii::Tensor<1,dim,std::vector<adtype>>,nstate> primitive_legendre_aux_soln_at_vol_q_ext;
2612 std::array<std::vector<adtype>,nstate> primitive_legendre_soln_at_surf_q_ext;
2613 std::array<dealii::Tensor<1,dim,std::vector<adtype>>,nstate> primitive_legendre_aux_soln_at_surf_q_ext;
2617 dealii::FE_DGQLegendre<1,1> legendre_poly_1D_int(poly_degree_int);
2618 dealii::FE_DGQLegendre<1,1> legendre_poly_1D_ext(poly_degree_ext);
2632 for(
int istate=0; istate<
nstate; istate++){
2637 std::vector<adtype> legendre_soln_coeff_int(n_shape_fns_int);
2638 legendre_soln_basis_projection_oper_int.
matrix_vector_mult_1D(primitive_soln_at_vol_q_int[istate], legendre_soln_coeff_int,
2640 std::vector<adtype> legendre_soln_coeff_ext(n_shape_fns_ext);
2641 legendre_soln_basis_projection_oper_ext.
matrix_vector_mult_1D(primitive_soln_at_vol_q_ext[istate], legendre_soln_coeff_ext,
2645 for(
unsigned int ishape=0; ishape<n_shape_fns_int; ishape++){
2646 if(ishape < p_min_filtered){
2647 legendre_soln_coeff_int[ishape] = 0.0;
2650 for(
unsigned int ishape=0; ishape<n_shape_fns_ext; ishape++){
2651 if(ishape < p_min_filtered){
2652 legendre_soln_coeff_ext[ishape] = 0.0;
2657 primitive_legendre_soln_at_vol_q_int[istate].resize(n_quad_pts_vol_int);
2658 legendre_soln_basis_int.
matrix_vector_mult_1D(legendre_soln_coeff_int, primitive_legendre_soln_at_vol_q_int[istate],
2660 primitive_legendre_soln_at_surf_q_int[istate].resize(n_face_quad_pts);
2662 legendre_soln_coeff_int, primitive_legendre_soln_at_surf_q_int[istate],
2665 primitive_legendre_soln_at_vol_q_ext[istate].resize(n_quad_pts_vol_ext);
2666 legendre_soln_basis_ext.
matrix_vector_mult_1D(legendre_soln_coeff_ext, primitive_legendre_soln_at_vol_q_ext[istate],
2668 primitive_legendre_soln_at_surf_q_ext[istate].resize(n_face_quad_pts);
2670 legendre_soln_coeff_ext, primitive_legendre_soln_at_surf_q_ext[istate],
2678 dealii::Tensor<1,dim,std::vector<adtype>> legendre_aux_soln_coeff_int;
2679 dealii::Tensor<1,dim,std::vector<adtype>> legendre_aux_soln_coeff_ext;
2680 for(
int idim=0; idim<dim; idim++){
2682 legendre_aux_soln_coeff_int[idim].resize(n_shape_fns_int);
2683 legendre_aux_soln_coeff_ext[idim].resize(n_shape_fns_ext);
2685 legendre_soln_basis_projection_oper_int.
matrix_vector_mult_1D(primitive_aux_soln_at_vol_q_int[istate][idim], legendre_aux_soln_coeff_int[idim],
2687 legendre_soln_basis_projection_oper_ext.
matrix_vector_mult_1D(primitive_aux_soln_at_vol_q_ext[istate][idim], legendre_aux_soln_coeff_ext[idim],
2691 for(
unsigned int ishape=0; ishape<n_shape_fns_int; ishape++){
2692 if(ishape < p_min_filtered){
2693 legendre_aux_soln_coeff_int[idim][ishape] = 0.0;
2696 for(
unsigned int ishape=0; ishape<n_shape_fns_ext; ishape++){
2697 if(ishape < p_min_filtered){
2698 legendre_aux_soln_coeff_ext[idim][ishape] = 0.0;
2704 for(
unsigned int ishape=0; ishape<n_shape_fns_int; ishape++){
2705 legendre_aux_soln_coeff_int[idim][ishape] = 0.0;
2707 for(
unsigned int ishape=0; ishape<n_shape_fns_ext; ishape++){
2708 legendre_aux_soln_coeff_ext[idim][ishape] = 0.0;
2712 primitive_legendre_aux_soln_at_vol_q_int[istate][idim].resize(n_quad_pts_vol_int);
2713 legendre_soln_basis_int.
matrix_vector_mult_1D(legendre_aux_soln_coeff_int[idim], primitive_legendre_aux_soln_at_vol_q_int[istate][idim],
2715 primitive_legendre_aux_soln_at_surf_q_int[istate][idim].resize(n_face_quad_pts);
2717 legendre_aux_soln_coeff_int[idim], primitive_legendre_aux_soln_at_surf_q_int[istate][idim],
2720 primitive_legendre_aux_soln_at_vol_q_ext[istate][idim].resize(n_quad_pts_vol_ext);
2721 legendre_soln_basis_ext.
matrix_vector_mult_1D(legendre_aux_soln_coeff_ext[idim], primitive_legendre_aux_soln_at_vol_q_ext[istate][idim],
2723 primitive_legendre_aux_soln_at_surf_q_ext[istate][idim].resize(n_face_quad_pts);
2725 legendre_aux_soln_coeff_ext[idim], primitive_legendre_aux_soln_at_surf_q_ext[istate][idim],
2735 for(
int istate=0; istate<
nstate; istate++){
2736 legendre_soln_at_vol_q_int[istate].resize(n_quad_pts_vol_int);
2737 legendre_soln_at_surf_q_int[istate].resize(n_face_quad_pts);
2738 legendre_soln_at_vol_q_ext[istate].resize(n_quad_pts_vol_ext);
2739 legendre_soln_at_surf_q_ext[istate].resize(n_face_quad_pts);
2740 for(
int idim=0; idim<dim; idim++){
2741 legendre_aux_soln_at_vol_q_int[istate][idim].resize(n_quad_pts_vol_int);
2742 legendre_aux_soln_at_surf_q_int[istate][idim].resize(n_face_quad_pts);
2743 legendre_aux_soln_at_vol_q_ext[istate][idim].resize(n_quad_pts_vol_ext);
2744 legendre_aux_soln_at_surf_q_ext[istate][idim].resize(n_face_quad_pts);
2749 for (
unsigned int iquad=0; iquad<n_quad_pts_vol_int; ++iquad) {
2751 std::array<adtype,nstate> primitive_legendre_soln_state;
2752 std::array<dealii::Tensor<1,dim,adtype>,nstate> primitive_legendre_aux_soln_state;
2753 for(
int istate=0; istate<
nstate; istate++){
2754 primitive_legendre_soln_state[istate] = primitive_legendre_soln_at_vol_q_int[istate][iquad];
2755 for(
int idim=0; idim<dim; idim++){
2756 primitive_legendre_aux_soln_state[istate][idim] = primitive_legendre_aux_soln_at_vol_q_int[istate][idim][iquad];
2763 for(
int istate=0; istate<
nstate; istate++){
2764 legendre_soln_at_vol_q_int[istate][iquad] = legendre_soln_state[istate];
2765 for(
int idim=0; idim<dim; idim++){
2766 legendre_aux_soln_at_vol_q_int[istate][idim][iquad] = legendre_aux_soln_state[istate][idim];
2771 for (
unsigned int iquad=0; iquad<n_quad_pts_vol_ext; ++iquad) {
2773 std::array<adtype,nstate> primitive_legendre_soln_state;
2774 std::array<dealii::Tensor<1,dim,adtype>,nstate> primitive_legendre_aux_soln_state;
2775 for(
int istate=0; istate<
nstate; istate++){
2776 primitive_legendre_soln_state[istate] = primitive_legendre_soln_at_vol_q_ext[istate][iquad];
2777 for(
int idim=0; idim<dim; idim++){
2778 primitive_legendre_aux_soln_state[istate][idim] = primitive_legendre_aux_soln_at_vol_q_ext[istate][idim][iquad];
2785 for(
int istate=0; istate<
nstate; istate++){
2786 legendre_soln_at_vol_q_ext[istate][iquad] = legendre_soln_state[istate];
2787 for(
int idim=0; idim<dim; idim++){
2788 legendre_aux_soln_at_vol_q_ext[istate][idim][iquad] = legendre_aux_soln_state[istate][idim];
2793 for (
unsigned int iquad_face=0; iquad_face<n_face_quad_pts; iquad_face++) {
2795 std::array<adtype,nstate> primitive_legendre_soln_state;
2796 std::array<dealii::Tensor<1,dim,adtype>,nstate> primitive_legendre_aux_soln_state;
2797 for(
int istate=0; istate<
nstate; istate++){
2798 primitive_legendre_soln_state[istate] = primitive_legendre_soln_at_surf_q_int[istate][iquad_face];
2799 for(
int idim=0; idim<dim; idim++){
2800 primitive_legendre_aux_soln_state[istate][idim] = primitive_legendre_aux_soln_at_surf_q_int[istate][idim][iquad_face];
2807 for(
int istate=0; istate<
nstate; istate++){
2808 legendre_soln_at_surf_q_int[istate][iquad_face] = legendre_soln_state[istate];
2809 for(
int idim=0; idim<dim; idim++){
2810 legendre_aux_soln_at_surf_q_int[istate][idim][iquad_face] = legendre_aux_soln_state[istate][idim];
2815 for (
unsigned int iquad_face=0; iquad_face<n_face_quad_pts; iquad_face++) {
2817 std::array<adtype,nstate> primitive_legendre_soln_state;
2818 std::array<dealii::Tensor<1,dim,adtype>,nstate> primitive_legendre_aux_soln_state;
2819 for(
int istate=0; istate<
nstate; istate++){
2820 primitive_legendre_soln_state[istate] = primitive_legendre_soln_at_surf_q_ext[istate][iquad_face];
2821 for(
int idim=0; idim<dim; idim++){
2822 primitive_legendre_aux_soln_state[istate][idim] = primitive_legendre_aux_soln_at_surf_q_ext[istate][idim][iquad_face];
2829 for(
int istate=0; istate<
nstate; istate++){
2830 legendre_soln_at_surf_q_ext[istate][iquad_face] = legendre_soln_state[istate];
2831 for(
int idim=0; idim<dim; idim++){
2832 legendre_aux_soln_at_surf_q_ext[istate][idim][iquad_face] = legendre_aux_soln_state[istate][idim];
2843 std::array<dealii::Tensor<1,dim,std::vector<adtype>>,nstate> conv_ref_flux_at_vol_q_int;
2844 std::array<dealii::Tensor<1,dim,std::vector<adtype>>,nstate> diffusive_ref_flux_at_vol_q_int;
2845 for (
unsigned int iquad=0; iquad<n_quad_pts_vol_int; ++iquad) {
2849 dealii::Tensor<2,dim,adtype> metric_cofactor_vol_int;
2850 for(
int idim=0; idim<dim; idim++){
2851 for(
int jdim=0; jdim<dim; jdim++){
2852 metric_cofactor_vol_int[idim][jdim] = metric_oper_int.
metric_cofactor_vol[idim][jdim][iquad];
2855 std::array<adtype,nstate> soln_state;
2856 std::array<dealii::Tensor<1,dim,adtype>,nstate> aux_soln_state;
2857 std::array<adtype,nstate> filtered_soln_state;
2858 std::array<dealii::Tensor<1,dim,adtype>,nstate> filtered_aux_soln_state;
2859 for(
int istate=0; istate<
nstate; istate++){
2860 soln_state[istate] = soln_at_vol_q_int[istate][iquad];
2862 for(
int idim=0; idim<dim; idim++){
2863 aux_soln_state[istate][idim] = aux_soln_at_vol_q_int[istate][idim][iquad];
2869 std::array<dealii::Tensor<1,dim,adtype>,nstate> conv_phys_flux;
2876 std::array<dealii::Tensor<1,dim,adtype>,nstate> diffusive_phys_flux;
2877 diffusive_phys_flux = pde_physics.
dissipative_flux(soln_state, aux_soln_state, filtered_soln_state, filtered_aux_soln_state, current_cell_index);
2880 for(
int istate=0; istate<
nstate; istate++){
2881 dealii::Tensor<1,dim,adtype> conv_ref_flux;
2882 dealii::Tensor<1,dim,adtype> diffusive_ref_flux;
2886 conv_phys_flux[istate],
2887 metric_cofactor_vol_int,
2892 diffusive_phys_flux[istate],
2893 metric_cofactor_vol_int,
2894 diffusive_ref_flux);
2899 for(
int idim=0; idim<dim; idim++){
2902 conv_ref_flux_at_vol_q_int[istate][idim].resize(n_quad_pts_vol_int);
2903 diffusive_ref_flux_at_vol_q_int[istate][idim].resize(n_quad_pts_vol_int);
2907 conv_ref_flux_at_vol_q_int[istate][idim][iquad] = conv_ref_flux[idim];
2909 diffusive_ref_flux_at_vol_q_int[istate][idim][iquad] = diffusive_ref_flux[idim];
2916 std::array<dealii::Tensor<1,dim,std::vector<adtype>>,nstate> conv_ref_flux_at_vol_q_ext;
2917 std::array<dealii::Tensor<1,dim,std::vector<adtype>>,nstate> diffusive_ref_flux_at_vol_q_ext;
2918 for (
unsigned int iquad=0; iquad<n_quad_pts_vol_ext; ++iquad) {
2921 dealii::Tensor<2,dim,adtype> metric_cofactor_vol_ext;
2922 for(
int idim=0; idim<dim; idim++){
2923 for(
int jdim=0; jdim<dim; jdim++){
2924 metric_cofactor_vol_ext[idim][jdim] = metric_oper_ext.
metric_cofactor_vol[idim][jdim][iquad];
2928 std::array<adtype,nstate> soln_state;
2929 std::array<dealii::Tensor<1,dim,adtype>,nstate> aux_soln_state;
2930 std::array<adtype,nstate> filtered_soln_state;
2931 std::array<dealii::Tensor<1,dim,adtype>,nstate> filtered_aux_soln_state;
2932 for(
int istate=0; istate<
nstate; istate++){
2933 soln_state[istate] = soln_at_vol_q_ext[istate][iquad];
2935 for(
int idim=0; idim<dim; idim++){
2936 aux_soln_state[istate][idim] = aux_soln_at_vol_q_ext[istate][idim][iquad];
2942 std::array<dealii::Tensor<1,dim,adtype>,nstate> conv_phys_flux;
2948 std::array<dealii::Tensor<1,dim,adtype>,nstate> diffusive_phys_flux;
2949 diffusive_phys_flux = pde_physics.
dissipative_flux(soln_state, aux_soln_state, filtered_soln_state, filtered_aux_soln_state, neighbor_cell_index);
2952 for(
int istate=0; istate<
nstate; istate++){
2953 dealii::Tensor<1,dim,adtype> conv_ref_flux;
2954 dealii::Tensor<1,dim,adtype> diffusive_ref_flux;
2958 conv_phys_flux[istate],
2959 metric_cofactor_vol_ext,
2964 diffusive_phys_flux[istate],
2965 metric_cofactor_vol_ext,
2966 diffusive_ref_flux);
2971 for(
int idim=0; idim<dim; idim++){
2974 conv_ref_flux_at_vol_q_ext[istate][idim].resize(n_quad_pts_vol_ext);
2975 diffusive_ref_flux_at_vol_q_ext[istate][idim].resize(n_quad_pts_vol_ext);
2979 conv_ref_flux_at_vol_q_ext[istate][idim][iquad] = conv_ref_flux[idim];
2981 diffusive_ref_flux_at_vol_q_ext[istate][idim][iquad] = diffusive_ref_flux[idim];
2991 const dealii::Tensor<1,dim,double> unit_ref_normal_int = dealii::GeometryInfo<dim>::unit_normal_vector[iface];
2992 const dealii::Tensor<1,dim,double> unit_ref_normal_ext = dealii::GeometryInfo<dim>::unit_normal_vector[neighbor_iface];
2994 const int dim_not_zero_int = iface / 2;
2995 const int dim_not_zero_ext = neighbor_iface / 2;
2997 std::array<std::vector<adtype>,nstate> conv_int_vol_ref_flux_interp_to_face_dot_ref_normal;
2998 std::array<std::vector<adtype>,nstate> conv_ext_vol_ref_flux_interp_to_face_dot_ref_normal;
2999 std::array<std::vector<adtype>,nstate> diffusive_int_vol_ref_flux_interp_to_face_dot_ref_normal;
3000 std::array<std::vector<adtype>,nstate> diffusive_ext_vol_ref_flux_interp_to_face_dot_ref_normal;
3001 for(
int istate=0; istate<
nstate; istate++){
3003 conv_int_vol_ref_flux_interp_to_face_dot_ref_normal[istate].resize(n_face_quad_pts);
3004 conv_ext_vol_ref_flux_interp_to_face_dot_ref_normal[istate].resize(n_face_quad_pts);
3005 diffusive_int_vol_ref_flux_interp_to_face_dot_ref_normal[istate].resize(n_face_quad_pts);
3006 diffusive_ext_vol_ref_flux_interp_to_face_dot_ref_normal[istate].resize(n_face_quad_pts);
3015 conv_ref_flux_at_vol_q_int[istate][dim_not_zero_int],
3016 conv_int_vol_ref_flux_interp_to_face_dot_ref_normal[istate],
3019 false, unit_ref_normal_int[dim_not_zero_int]);
3022 conv_ref_flux_at_vol_q_ext[istate][dim_not_zero_ext],
3023 conv_ext_vol_ref_flux_interp_to_face_dot_ref_normal[istate],
3026 false, unit_ref_normal_ext[dim_not_zero_ext]);
3032 diffusive_ref_flux_at_vol_q_int[istate][dim_not_zero_int],
3033 diffusive_int_vol_ref_flux_interp_to_face_dot_ref_normal[istate],
3036 false, unit_ref_normal_int[dim_not_zero_int]);
3039 diffusive_ref_flux_at_vol_q_ext[istate][dim_not_zero_ext],
3040 diffusive_ext_vol_ref_flux_interp_to_face_dot_ref_normal[istate],
3043 false, unit_ref_normal_ext[dim_not_zero_ext]);
3054 std::array<std::vector<adtype>,nstate> entropy_var_vol_int;
3055 for(
unsigned int iquad=0; iquad<n_quad_pts_vol_int; iquad++){
3056 std::array<adtype,nstate> soln_state;
3057 for(
int istate=0; istate<
nstate; istate++){
3058 soln_state[istate] = soln_at_vol_q_int[istate][iquad];
3060 std::array<adtype,nstate> entropy_var;
3062 for(
int istate=0; istate<
nstate; istate++){
3064 entropy_var_vol_int[istate].resize(n_quad_pts_vol_int);
3066 entropy_var_vol_int[istate][iquad] = entropy_var[istate];
3069 std::array<std::vector<adtype>,nstate> entropy_var_vol_ext;
3070 for(
unsigned int iquad=0; iquad<n_quad_pts_vol_ext; iquad++){
3071 std::array<adtype,nstate> soln_state;
3072 for(
int istate=0; istate<
nstate; istate++){
3073 soln_state[istate] = soln_at_vol_q_ext[istate][iquad];
3075 std::array<adtype,nstate> entropy_var;
3077 for(
int istate=0; istate<
nstate; istate++){
3079 entropy_var_vol_ext[istate].resize(n_quad_pts_vol_ext);
3081 entropy_var_vol_ext[istate][iquad] = entropy_var[istate];
3086 std::array<std::vector<adtype>,nstate> projected_entropy_var_vol_int;
3087 std::array<std::vector<adtype>,nstate> projected_entropy_var_vol_ext;
3088 std::array<std::vector<adtype>,nstate> projected_entropy_var_surf_int;
3089 std::array<std::vector<adtype>,nstate> projected_entropy_var_surf_ext;
3090 std::array<std::vector<adtype>,nstate> projected_entropy_var_surf_int_corrected;
3091 std::array<std::vector<adtype>,nstate> projected_entropy_var_surf_ext_corrected;
3092 for(
int istate=0; istate<
nstate; istate++){
3094 projected_entropy_var_vol_int[istate].resize(n_quad_pts_vol_int);
3095 projected_entropy_var_vol_ext[istate].resize(n_quad_pts_vol_ext);
3096 projected_entropy_var_surf_int[istate].resize(n_face_quad_pts);
3097 projected_entropy_var_surf_ext[istate].resize(n_face_quad_pts);
3098 projected_entropy_var_surf_int_corrected[istate].resize(n_face_quad_pts);
3099 projected_entropy_var_surf_ext_corrected[istate].resize(n_face_quad_pts);
3102 std::vector<adtype> entropy_var_coeff_int(n_shape_fns_int);
3104 entropy_var_coeff_int,
3107 projected_entropy_var_vol_int[istate],
3111 entropy_var_coeff_int,
3112 projected_entropy_var_surf_int[istate],
3118 entropy_var_coeff_int,
3119 projected_entropy_var_surf_int_corrected[istate],
3124 std::vector<adtype> entropy_var_coeff_ext(n_shape_fns_ext);
3126 entropy_var_coeff_ext,
3130 projected_entropy_var_vol_ext[istate],
3134 entropy_var_coeff_ext,
3135 projected_entropy_var_surf_ext[istate],
3141 entropy_var_coeff_ext,
3142 projected_entropy_var_surf_ext_corrected[istate],
3148 const unsigned int row_size_int = n_face_quad_pts * n_quad_pts_1D_int;
3149 const unsigned int col_size_int = n_face_quad_pts * n_quad_pts_1D_int;
3150 std::vector<unsigned int> Hadamard_rows_sparsity_int(row_size_int);
3151 std::vector<unsigned int> Hadamard_columns_sparsity_int(col_size_int);
3152 const unsigned int row_size_ext = n_face_quad_pts * n_quad_pts_1D_ext;
3153 const unsigned int col_size_ext = n_face_quad_pts * n_quad_pts_1D_ext;
3154 std::vector<unsigned int> Hadamard_rows_sparsity_ext(row_size_ext);
3155 std::vector<unsigned int> Hadamard_columns_sparsity_ext(col_size_ext);
3161 std::array<std::vector<adtype>,nstate> surf_vol_ref_2pt_flux_interp_surf_int;
3162 std::array<std::vector<adtype>,nstate> surf_vol_ref_2pt_flux_interp_surf_ext;
3163 std::array<std::vector<adtype>,nstate> surf_vol_ref_2pt_flux_interp_vol_int;
3164 std::array<std::vector<adtype>,nstate> surf_vol_ref_2pt_flux_interp_vol_ext;
3167 std::array<std::vector<adtype>,nstate> surface_ref_2pt_flux_int;
3168 std::array<std::vector<adtype>,nstate> surface_ref_2pt_flux_ext;
3170 for(
int istate=0; istate<
nstate; istate++){
3171 surface_ref_2pt_flux_int[istate].resize(n_face_quad_pts * n_quad_pts_1D_int);
3172 surface_ref_2pt_flux_ext[istate].resize(n_face_quad_pts * n_quad_pts_1D_ext);
3174 for(
unsigned int iquad_face=0; iquad_face<n_face_quad_pts; iquad_face++){
3175 dealii::Tensor<2,dim,adtype> metric_cofactor_surf;
3176 for(
int idim=0; idim<dim; idim++){
3177 for(
int jdim=0; jdim<dim; jdim++){
3178 metric_cofactor_surf[idim][jdim] = metric_oper_int.
metric_cofactor_surf[idim][jdim][iquad_face];
3183 std::array<adtype,nstate> entropy_var_face_int;
3184 std::array<adtype,nstate> entropy_var_face_ext;
3185 for(
int istate=0; istate<
nstate; istate++){
3186 entropy_var_face_int[istate] = projected_entropy_var_surf_int[istate][iquad_face];
3187 entropy_var_face_ext[istate] = projected_entropy_var_surf_ext[istate][iquad_face];
3189 std::array<adtype,nstate> soln_state_face_int;
3191 std::array<adtype,nstate> soln_state_face_ext;
3195 for(
unsigned int row_index = iquad_face * n_quad_pts_1D_int, column_index = 0;
3196 column_index < n_quad_pts_1D_int;
3197 row_index++, column_index++){
3199 if(Hadamard_rows_sparsity_int[row_index] != iquad_face){
3200 pcout<<
"The interior Hadamard rows sparsity pattern does not match."<<std::endl;
3204 const unsigned int iquad_vol = Hadamard_columns_sparsity_int[row_index];
3208 dealii::Tensor<2,dim,adtype> metric_cofactor_vol_int;
3209 for(
int idim=0; idim<dim; idim++){
3210 for(
int jdim=0; jdim<dim; jdim++){
3211 metric_cofactor_vol_int[idim][jdim] = metric_oper_int.
metric_cofactor_vol[idim][jdim][iquad_vol];
3214 std::array<adtype,nstate> entropy_var;
3215 for(
int istate=0; istate<
nstate; istate++){
3216 entropy_var[istate] = projected_entropy_var_vol_int[istate][iquad_vol];
3218 std::array<adtype,nstate> soln_state;
3225 std::array<dealii::Tensor<1,dim,adtype>,nstate> conv_phys_flux_2pt;
3227 for(
int istate=0; istate<
nstate; istate++){
3228 dealii::Tensor<1,dim,adtype> conv_ref_flux_2pt;
3231 dealii::Tensor<2,dim,adtype> metric_cofactor_split;
3232 for(
int idim=0; idim<dim; idim++){
3233 for(
int jdim=0; jdim<dim; jdim++){
3234 metric_cofactor_split[idim][jdim] = 0.5 * (metric_cofactor_surf[idim][jdim] + metric_cofactor_vol_int[idim][jdim]);
3238 conv_phys_flux_2pt[istate],
3239 metric_cofactor_split,
3242 surface_ref_2pt_flux_int[istate][iquad_face * n_quad_pts_1D_int + column_index] = conv_ref_flux_2pt[dim_not_zero_int];
3245 for(
unsigned int row_index = iquad_face * n_quad_pts_1D_ext, column_index = 0;
3246 column_index < n_quad_pts_1D_ext;
3247 row_index++, column_index++){
3249 if(Hadamard_rows_sparsity_ext[row_index] != iquad_face){
3250 pcout<<
"The exterior Hadamard rows sparsity pattern does not match."<<std::endl;
3254 const unsigned int iquad_vol = Hadamard_columns_sparsity_ext[row_index];
3258 dealii::Tensor<2,dim,adtype> metric_cofactor_vol_ext;
3259 for(
int idim=0; idim<dim; idim++){
3260 for(
int jdim=0; jdim<dim; jdim++){
3261 metric_cofactor_vol_ext[idim][jdim] = metric_oper_ext.
metric_cofactor_vol[idim][jdim][iquad_vol];
3264 std::array<adtype,nstate> entropy_var;
3265 for(
int istate=0; istate<
nstate; istate++){
3266 entropy_var[istate] = projected_entropy_var_vol_ext[istate][iquad_vol];
3268 std::array<adtype,nstate> soln_state;
3271 std::array<dealii::Tensor<1,dim,adtype>,nstate> conv_phys_flux_2pt;
3273 for(
int istate=0; istate<
nstate; istate++){
3274 dealii::Tensor<1,dim,adtype> conv_ref_flux_2pt;
3276 dealii::Tensor<2,dim,adtype> metric_cofactor_split;
3277 for(
int idim=0; idim<dim; idim++){
3278 for(
int jdim=0; jdim<dim; jdim++){
3279 metric_cofactor_split[idim][jdim] = 0.5 * (metric_cofactor_surf[idim][jdim] + metric_cofactor_vol_ext[idim][jdim]);
3283 conv_phys_flux_2pt[istate],
3284 metric_cofactor_split,
3287 surface_ref_2pt_flux_ext[istate][iquad_face * n_quad_pts_1D_ext + column_index] = conv_ref_flux_2pt[dim_not_zero_ext];
3295 const int iface_1D = iface % 2;
3297 dealii::FullMatrix<real> surf_oper_sparse_int(n_face_quad_pts, n_quad_pts_1D_int);
3299 Hadamard_rows_sparsity_int, Hadamard_columns_sparsity_int,
3301 oneD_quad_weights_vol_int,
3302 surf_oper_sparse_int,
3304 const int neighbor_iface_1D = neighbor_iface % 2;
3306 dealii::FullMatrix<real> surf_oper_sparse_ext(n_face_quad_pts, n_quad_pts_1D_ext);
3308 Hadamard_rows_sparsity_ext, Hadamard_columns_sparsity_ext,
3310 oneD_quad_weights_vol_ext,
3311 surf_oper_sparse_ext,
3316 for(
int istate=0; istate<
nstate; istate++){
3318 std::vector<adtype> surface_ref_2pt_flux_int_Hadamard_with_surf_oper(n_face_quad_pts * n_quad_pts_1D_int);
3320 surface_ref_2pt_flux_int[istate],
3321 surface_ref_2pt_flux_int_Hadamard_with_surf_oper);
3322 std::vector<adtype> surface_ref_2pt_flux_ext_Hadamard_with_surf_oper(n_face_quad_pts * n_quad_pts_1D_ext);
3324 surface_ref_2pt_flux_ext[istate],
3325 surface_ref_2pt_flux_ext_Hadamard_with_surf_oper);
3327 surf_vol_ref_2pt_flux_interp_surf_int[istate].resize(n_face_quad_pts);
3328 surf_vol_ref_2pt_flux_interp_surf_ext[istate].resize(n_face_quad_pts);
3329 surf_vol_ref_2pt_flux_interp_vol_int[istate].resize(n_quad_pts_vol_int);
3330 surf_vol_ref_2pt_flux_interp_vol_ext[istate].resize(n_quad_pts_vol_ext);
3332 for(
unsigned int iface_quad=0; iface_quad<n_face_quad_pts; iface_quad++){
3333 for(
unsigned int iquad_int=0; iquad_int<n_quad_pts_1D_int; iquad_int++){
3334 surf_vol_ref_2pt_flux_interp_surf_int[istate][iface_quad]
3335 -= surface_ref_2pt_flux_int_Hadamard_with_surf_oper[iface_quad * n_quad_pts_1D_int + iquad_int]
3336 * unit_ref_normal_int[dim_not_zero_int];
3337 const unsigned int column_index = iface_quad * n_quad_pts_1D_int + iquad_int;
3338 surf_vol_ref_2pt_flux_interp_vol_int[istate][Hadamard_columns_sparsity_int[column_index]]
3339 += surface_ref_2pt_flux_int_Hadamard_with_surf_oper[iface_quad * n_quad_pts_1D_int + iquad_int]
3340 * unit_ref_normal_int[dim_not_zero_int];
3342 for(
unsigned int iquad_ext=0; iquad_ext<n_quad_pts_1D_ext; iquad_ext++){
3343 surf_vol_ref_2pt_flux_interp_surf_ext[istate][iface_quad]
3344 -= surface_ref_2pt_flux_ext_Hadamard_with_surf_oper[iface_quad * n_quad_pts_1D_ext + iquad_ext]
3345 * (unit_ref_normal_ext[dim_not_zero_ext]);
3346 const unsigned int column_index = iface_quad * n_quad_pts_1D_ext + iquad_ext;
3347 surf_vol_ref_2pt_flux_interp_vol_ext[istate][Hadamard_columns_sparsity_ext[column_index]]
3348 += surface_ref_2pt_flux_ext_Hadamard_with_surf_oper[iface_quad * n_quad_pts_1D_ext + iquad_ext]
3349 * (unit_ref_normal_ext[dim_not_zero_ext]);
3359 std::array<std::vector<adtype>,nstate> conv_num_flux_dot_n;
3360 std::array<std::vector<adtype>,nstate> diss_auxi_num_flux_dot_n;
3361 for (
unsigned int iquad=0; iquad<n_face_quad_pts; ++iquad) {
3367 dealii::Tensor<2,dim,adtype> metric_cofactor_surf;
3368 for(
int idim=0; idim<dim; idim++){
3369 for(
int jdim=0; jdim<dim; jdim++){
3374 std::array<adtype,nstate> entropy_var_face_int;
3375 std::array<adtype,nstate> entropy_var_face_ext;
3376 std::array<dealii::Tensor<1,dim,adtype>,nstate> aux_soln_state_int;
3377 std::array<dealii::Tensor<1,dim,adtype>,nstate> aux_soln_state_ext;
3378 std::array<adtype,nstate> soln_interp_to_face_int;
3379 std::array<adtype,nstate> soln_interp_to_face_ext;
3380 std::array<dealii::Tensor<1,dim,adtype>,nstate> filtered_aux_soln_state_int;
3381 std::array<dealii::Tensor<1,dim,adtype>,nstate> filtered_aux_soln_state_ext;
3382 std::array<adtype,nstate> filtered_soln_interp_to_face_int;
3383 std::array<adtype,nstate> filtered_soln_interp_to_face_ext;
3384 for(
int istate=0; istate<
nstate; istate++){
3385 soln_interp_to_face_int[istate] = soln_at_surf_q_int[istate][iquad];
3386 soln_interp_to_face_ext[istate] = soln_at_surf_q_ext[istate][iquad];
3389 entropy_var_face_int[istate] = projected_entropy_var_surf_int_corrected[istate][iquad];
3390 entropy_var_face_ext[istate] = projected_entropy_var_surf_ext_corrected[istate][iquad];
3391 for(
int idim=0; idim<dim; idim++){
3392 aux_soln_state_int[istate][idim] = aux_soln_at_surf_q_int[istate][idim][iquad];
3393 aux_soln_state_ext[istate][idim] = aux_soln_at_surf_q_ext[istate][idim][iquad];
3394 if(this->
do_compute_filtered_solution) filtered_aux_soln_state_int[istate][idim] = legendre_aux_soln_at_surf_q_int[istate][idim][iquad];
3395 if(this->
do_compute_filtered_solution) filtered_aux_soln_state_ext[istate][idim] = legendre_aux_soln_at_surf_q_ext[istate][idim][iquad];
3399 std::array<adtype,nstate> soln_state_int;
3401 std::array<adtype,nstate> soln_state_ext;
3406 for(
int istate=0; istate<
nstate; istate++){
3407 soln_state_int[istate] = soln_at_surf_q_int[istate][iquad];
3408 soln_state_ext[istate] = soln_at_surf_q_ext[istate][iquad];
3413 dealii::Tensor<1,dim,adtype> unit_phys_normal_int;
3415 metric_cofactor_surf,
3416 unit_phys_normal_int);
3417 adtype face_Jac_norm_scaled = 0.0;
3418 for(
int idim=0; idim<dim; idim++){
3419 face_Jac_norm_scaled += unit_phys_normal_int[idim] * unit_phys_normal_int[idim];
3421 face_Jac_norm_scaled = sqrt(face_Jac_norm_scaled);
3422 unit_phys_normal_int /= face_Jac_norm_scaled;
3425 std::array<adtype,nstate> conv_num_flux_dot_n_at_q;
3426 std::array<adtype,nstate> diss_auxi_num_flux_dot_n_at_q;
3428 conv_num_flux_dot_n_at_q = conv_num_flux.
evaluate_flux(soln_state_int, soln_state_ext, unit_phys_normal_int);
3431 current_cell_index, neighbor_cell_index,
3433 soln_interp_to_face_int, soln_interp_to_face_ext,
3434 aux_soln_state_int, aux_soln_state_ext,
3435 filtered_soln_interp_to_face_int, filtered_soln_interp_to_face_ext,
3436 filtered_aux_soln_state_int, filtered_aux_soln_state_ext,
3437 unit_phys_normal_int, penalty,
false);
3440 for(
int istate=0; istate<
nstate; istate++){
3447 conv_num_flux_dot_n[istate].resize(n_face_quad_pts);
3448 diss_auxi_num_flux_dot_n[istate].resize(n_face_quad_pts);
3452 conv_num_flux_dot_n[istate][iquad] = face_Jac_norm_scaled * conv_num_flux_dot_n_at_q[istate];
3453 diss_auxi_num_flux_dot_n[istate][iquad] = face_Jac_norm_scaled * diss_auxi_num_flux_dot_n_at_q[istate];
3459 for(
int istate=0; istate<
nstate; istate++){
3461 std::vector<adtype> rhs_int(n_shape_fns_int);
3465 std::vector<real> ones_surf(n_face_quad_pts, 1.0);
3468 surf_vol_ref_2pt_flux_interp_surf_int[istate],
3473 std::vector<real> ones_vol(n_quad_pts_vol_int, 1.0);
3474 soln_basis_int.
inner_product_1D(surf_vol_ref_2pt_flux_interp_vol_int[istate],
3483 conv_int_vol_ref_flux_interp_to_face_dot_ref_normal[istate],
3484 surf_quad_weights, rhs_int,
3492 diffusive_int_vol_ref_flux_interp_to_face_dot_ref_normal[istate],
3493 surf_quad_weights, rhs_int,
3500 conv_num_flux_dot_n[istate],
3501 surf_quad_weights, rhs_int,
3508 diss_auxi_num_flux_dot_n[istate],
3509 surf_quad_weights, rhs_int,
3515 for(
unsigned int ishape=0; ishape<n_shape_fns_int; ishape++){
3516 local_rhs_int_cell[istate*n_shape_fns_int + ishape] += rhs_int[ishape];
3520 std::vector<adtype> rhs_ext(n_shape_fns_ext);
3524 std::vector<real> ones_surf(n_face_quad_pts, 1.0);
3527 surf_vol_ref_2pt_flux_interp_surf_ext[istate],
3533 std::vector<real> ones_vol(n_quad_pts_vol_ext, 1.0);
3534 soln_basis_ext.
inner_product_1D(surf_vol_ref_2pt_flux_interp_vol_ext[istate],
3543 conv_ext_vol_ref_flux_interp_to_face_dot_ref_normal[istate],
3544 surf_quad_weights, rhs_ext,
3552 diffusive_ext_vol_ref_flux_interp_to_face_dot_ref_normal[istate],
3553 surf_quad_weights, rhs_ext,
3560 conv_num_flux_dot_n[istate],
3561 surf_quad_weights, rhs_ext,
3568 diss_auxi_num_flux_dot_n[istate],
3569 surf_quad_weights, rhs_ext,
3575 for(
unsigned int ishape=0; ishape<n_shape_fns_ext; ishape++){
3576 local_rhs_ext_cell[istate*n_shape_fns_ext + ishape] += rhs_ext[ishape];
3587 template <
int dim,
int nspecies,
int nstate,
typename real,
typename MeshType>
3589 typename dealii::DoFHandler<dim>::active_cell_iterator ,
3590 const dealii::types::global_dof_index ,
3591 const dealii::FEValues<dim,dim> &,
3592 const std::vector<dealii::types::global_dof_index> &,
3593 const std::vector<dealii::types::global_dof_index> &,
3594 const unsigned int ,
3595 const unsigned int ,
3596 dealii::Vector<real> &,
3597 const dealii::FEValues<dim,dim> &)
3603 template <
int dim,
int nspecies,
int nstate,
typename real,
typename MeshType>
3611 #if PHILIP_SPECIES==1 3638 #define POSSIBLE_NSTATE (1)(2)(3)(4)(5)(6) 3641 #define INSTANTIATE_DISTRIBUTED(r, data, index) \ 3642 template void DGStrong <PHILIP_DIM, PHILIP_SPECIES, index, double, dealii::parallel::distributed::Triangulation<PHILIP_DIM>>::assemble_face_term_auxiliary_equation<double>(const unsigned int iface, const unsigned int neighbor_iface, const dealii::types::global_dof_index current_cell_index, const dealii::types::global_dof_index neighbor_cell_index, std::vector<bool> face_orientation_int, std::vector<bool> face_orientation_ext, const std::array<std::vector<double>,index> &soln_coeff_int, const std::array<std::vector<double>,index> &soln_coeff_ext, const unsigned int poly_degree_int,const unsigned int poly_degree_ext, OPERATOR::basis_functions<PHILIP_DIM,2*PHILIP_DIM> &soln_basis_int,OPERATOR::basis_functions<PHILIP_DIM,2*PHILIP_DIM> &soln_basis_ext, OPERATOR::metric_operators<double,PHILIP_DIM,2*PHILIP_DIM> &metric_oper_int, const Physics::PhysicsBase<PHILIP_DIM, PHILIP_SPECIES, index, double> &pde_physics, const NumericalFlux::NumericalFluxDissipative<PHILIP_DIM, PHILIP_SPECIES, index, double> &diss_num_flux, dealii::Tensor<1,PHILIP_DIM,std::vector<double>> &local_auxiliary_RHS_int, dealii::Tensor<1,PHILIP_DIM,std::vector<double>> &local_auxiliary_RHS_ext);\ 3643 template void DGStrong <PHILIP_DIM, PHILIP_SPECIES, index, double, dealii::parallel::distributed::Triangulation<PHILIP_DIM>>::assemble_face_term_auxiliary_equation<codi_JacobianComputationType>(const unsigned int iface, const unsigned int neighbor_iface, const dealii::types::global_dof_index current_cell_index, const dealii::types::global_dof_index neighbor_cell_index, std::vector<bool> face_orientation_int, std::vector<bool> face_orientation_ext, const std::array<std::vector<codi_JacobianComputationType>,index> &soln_coeff_int, const std::array<std::vector<codi_JacobianComputationType>,index> &soln_coeff_ext, const unsigned int poly_degree_int,const unsigned int poly_degree_ext, OPERATOR::basis_functions<PHILIP_DIM,2*PHILIP_DIM> &soln_basis_int,OPERATOR::basis_functions<PHILIP_DIM,2*PHILIP_DIM> &soln_basis_ext, OPERATOR::metric_operators<codi_JacobianComputationType,PHILIP_DIM,2*PHILIP_DIM> &metric_oper_int, const Physics::PhysicsBase<PHILIP_DIM, PHILIP_SPECIES, index, codi_JacobianComputationType> &pde_physics, const NumericalFlux::NumericalFluxDissipative<PHILIP_DIM, PHILIP_SPECIES, index, codi_JacobianComputationType> &diss_num_flux, dealii::Tensor<1,PHILIP_DIM,std::vector<codi_JacobianComputationType>> &local_auxiliary_RHS_int, dealii::Tensor<1,PHILIP_DIM,std::vector<codi_JacobianComputationType>> &local_auxiliary_RHS_ext);\ 3644 template void DGStrong <PHILIP_DIM, PHILIP_SPECIES, index, double, dealii::parallel::distributed::Triangulation<PHILIP_DIM>>::assemble_face_term_auxiliary_equation<codi_HessianComputationType>(const unsigned int iface, const unsigned int neighbor_iface, const dealii::types::global_dof_index current_cell_index, const dealii::types::global_dof_index neighbor_cell_index, std::vector<bool> face_orientation_int, std::vector<bool> face_orientation_ext, const std::array<std::vector<codi_HessianComputationType>,index> &soln_coeff_int, const std::array<std::vector<codi_HessianComputationType>,index> &soln_coeff_ext, const unsigned int poly_degree_int,const unsigned int poly_degree_ext, OPERATOR::basis_functions<PHILIP_DIM,2*PHILIP_DIM> &soln_basis_int,OPERATOR::basis_functions<PHILIP_DIM,2*PHILIP_DIM> &soln_basis_ext, OPERATOR::metric_operators<codi_HessianComputationType,PHILIP_DIM,2*PHILIP_DIM> &metric_oper_int, const Physics::PhysicsBase<PHILIP_DIM, PHILIP_SPECIES, index, codi_HessianComputationType> &pde_physics, const NumericalFlux::NumericalFluxDissipative<PHILIP_DIM, PHILIP_SPECIES, index, codi_HessianComputationType> &diss_num_flux, dealii::Tensor<1,PHILIP_DIM,std::vector<codi_HessianComputationType>> &local_auxiliary_RHS_int, dealii::Tensor<1,PHILIP_DIM,std::vector<codi_HessianComputationType>> &local_auxiliary_RHS_ext); 3647 #define INSTANTIATE_SHARED(r, data, index) \ 3648 template void DGStrong <PHILIP_DIM, PHILIP_SPECIES, index, double, dealii::parallel::shared::Triangulation<PHILIP_DIM>>::assemble_face_term_auxiliary_equation<double>(const unsigned int iface, const unsigned int neighbor_iface, const dealii::types::global_dof_index current_cell_index, const dealii::types::global_dof_index neighbor_cell_index, std::vector<bool> face_orientation_int, std::vector<bool> face_orientation_ext, const std::array<std::vector<double>,index> &soln_coeff_int, const std::array<std::vector<double>,index> &soln_coeff_ext, const unsigned int poly_degree_int,const unsigned int poly_degree_ext, OPERATOR::basis_functions<PHILIP_DIM,2*PHILIP_DIM> &soln_basis_int,OPERATOR::basis_functions<PHILIP_DIM,2*PHILIP_DIM> &soln_basis_ext, OPERATOR::metric_operators<double,PHILIP_DIM,2*PHILIP_DIM> &metric_oper_int, const Physics::PhysicsBase<PHILIP_DIM, PHILIP_SPECIES, index, double> &pde_physics, const NumericalFlux::NumericalFluxDissipative<PHILIP_DIM, PHILIP_SPECIES, index, double> &diss_num_flux, dealii::Tensor<1,PHILIP_DIM,std::vector<double>> &local_auxiliary_RHS_int, dealii::Tensor<1,PHILIP_DIM,std::vector<double>> &local_auxiliary_RHS_ext);\ 3649 template void DGStrong <PHILIP_DIM, PHILIP_SPECIES, index, double, dealii::parallel::shared::Triangulation<PHILIP_DIM>>::assemble_face_term_auxiliary_equation<codi_JacobianComputationType>(const unsigned int iface, const unsigned int neighbor_iface, const dealii::types::global_dof_index current_cell_index, const dealii::types::global_dof_index neighbor_cell_index, std::vector<bool> face_orientation_int, std::vector<bool> face_orientation_ext, const std::array<std::vector<codi_JacobianComputationType>,index> &soln_coeff_int, const std::array<std::vector<codi_JacobianComputationType>,index> &soln_coeff_ext, const unsigned int poly_degree_int,const unsigned int poly_degree_ext, OPERATOR::basis_functions<PHILIP_DIM,2*PHILIP_DIM> &soln_basis_int,OPERATOR::basis_functions<PHILIP_DIM,2*PHILIP_DIM> &soln_basis_ext, OPERATOR::metric_operators<codi_JacobianComputationType,PHILIP_DIM,2*PHILIP_DIM> &metric_oper_int, const Physics::PhysicsBase<PHILIP_DIM, PHILIP_SPECIES, index, codi_JacobianComputationType> &pde_physics, const NumericalFlux::NumericalFluxDissipative<PHILIP_DIM, PHILIP_SPECIES, index, codi_JacobianComputationType> &diss_num_flux, dealii::Tensor<1,PHILIP_DIM,std::vector<codi_JacobianComputationType>> &local_auxiliary_RHS_int, dealii::Tensor<1,PHILIP_DIM,std::vector<codi_JacobianComputationType>> &local_auxiliary_RHS_ext);\ 3650 template void DGStrong <PHILIP_DIM, PHILIP_SPECIES, index, double, dealii::parallel::shared::Triangulation<PHILIP_DIM>>::assemble_face_term_auxiliary_equation<codi_HessianComputationType>(const unsigned int iface, const unsigned int neighbor_iface, const dealii::types::global_dof_index current_cell_index, const dealii::types::global_dof_index neighbor_cell_index, std::vector<bool> face_orientation_int, std::vector<bool> face_orientation_ext, const std::array<std::vector<codi_HessianComputationType>,index> &soln_coeff_int, const std::array<std::vector<codi_HessianComputationType>,index> &soln_coeff_ext, const unsigned int poly_degree_int,const unsigned int poly_degree_ext, OPERATOR::basis_functions<PHILIP_DIM,2*PHILIP_DIM> &soln_basis_int,OPERATOR::basis_functions<PHILIP_DIM,2*PHILIP_DIM> &soln_basis_ext, OPERATOR::metric_operators<codi_HessianComputationType,PHILIP_DIM,2*PHILIP_DIM> &metric_oper_int, const Physics::PhysicsBase<PHILIP_DIM, PHILIP_SPECIES, index, codi_HessianComputationType> &pde_physics, const NumericalFlux::NumericalFluxDissipative<PHILIP_DIM, PHILIP_SPECIES, index, codi_HessianComputationType> &diss_num_flux, dealii::Tensor<1,PHILIP_DIM,std::vector<codi_HessianComputationType>> &local_auxiliary_RHS_int, dealii::Tensor<1,PHILIP_DIM,std::vector<codi_HessianComputationType>> &local_auxiliary_RHS_ext); 3653 #define INSTANTIATE_TRIA(r, data, index) \ 3654 template void DGStrong <PHILIP_DIM, PHILIP_SPECIES, index, double, dealii::Triangulation<PHILIP_DIM>>::assemble_face_term_auxiliary_equation<double>(const unsigned int iface, const unsigned int neighbor_iface, const dealii::types::global_dof_index current_cell_index, const dealii::types::global_dof_index neighbor_cell_index, std::vector<bool> face_orientation_int, std::vector<bool> face_orientation_ext, const std::array<std::vector<double>,index> &soln_coeff_int, const std::array<std::vector<double>,index> &soln_coeff_ext, const unsigned int poly_degree_int,const unsigned int poly_degree_ext, OPERATOR::basis_functions<PHILIP_DIM,2*PHILIP_DIM> &soln_basis_int,OPERATOR::basis_functions<PHILIP_DIM,2*PHILIP_DIM> &soln_basis_ext, OPERATOR::metric_operators<double,PHILIP_DIM,2*PHILIP_DIM> &metric_oper_int, const Physics::PhysicsBase<PHILIP_DIM, PHILIP_SPECIES, index, double> &pde_physics, const NumericalFlux::NumericalFluxDissipative<PHILIP_DIM, PHILIP_SPECIES, index, double> &diss_num_flux, dealii::Tensor<1,PHILIP_DIM,std::vector<double>> &local_auxiliary_RHS_int, dealii::Tensor<1,PHILIP_DIM,std::vector<double>> &local_auxiliary_RHS_ext);\ 3655 template void DGStrong <PHILIP_DIM, PHILIP_SPECIES, index, double, dealii::Triangulation<PHILIP_DIM>>::assemble_face_term_auxiliary_equation<codi_JacobianComputationType>(const unsigned int iface, const unsigned int neighbor_iface, const dealii::types::global_dof_index current_cell_index, const dealii::types::global_dof_index neighbor_cell_index, std::vector<bool> face_orientation_int, std::vector<bool> face_orientation_ext, const std::array<std::vector<codi_JacobianComputationType>,index> &soln_coeff_int, const std::array<std::vector<codi_JacobianComputationType>,index> &soln_coeff_ext, const unsigned int poly_degree_int,const unsigned int poly_degree_ext, OPERATOR::basis_functions<PHILIP_DIM,2*PHILIP_DIM> &soln_basis_int,OPERATOR::basis_functions<PHILIP_DIM,2*PHILIP_DIM> &soln_basis_ext, OPERATOR::metric_operators<codi_JacobianComputationType,PHILIP_DIM,2*PHILIP_DIM> &metric_oper_int, const Physics::PhysicsBase<PHILIP_DIM, PHILIP_SPECIES, index, codi_JacobianComputationType> &pde_physics, const NumericalFlux::NumericalFluxDissipative<PHILIP_DIM, PHILIP_SPECIES, index, codi_JacobianComputationType> &diss_num_flux, dealii::Tensor<1,PHILIP_DIM,std::vector<codi_JacobianComputationType>> &local_auxiliary_RHS_int, dealii::Tensor<1,PHILIP_DIM,std::vector<codi_JacobianComputationType>> &local_auxiliary_RHS_ext);\ 3656 template void DGStrong <PHILIP_DIM, PHILIP_SPECIES, index, double, dealii::Triangulation<PHILIP_DIM>>::assemble_face_term_auxiliary_equation<codi_HessianComputationType>(const unsigned int iface, const unsigned int neighbor_iface, const dealii::types::global_dof_index current_cell_index, const dealii::types::global_dof_index neighbor_cell_index, std::vector<bool> face_orientation_int, std::vector<bool> face_orientation_ext, const std::array<std::vector<codi_HessianComputationType>,index> &soln_coeff_int, const std::array<std::vector<codi_HessianComputationType>,index> &soln_coeff_ext, const unsigned int poly_degree_int,const unsigned int poly_degree_ext, OPERATOR::basis_functions<PHILIP_DIM,2*PHILIP_DIM> &soln_basis_int,OPERATOR::basis_functions<PHILIP_DIM,2*PHILIP_DIM> &soln_basis_ext, OPERATOR::metric_operators<codi_HessianComputationType,PHILIP_DIM,2*PHILIP_DIM> &metric_oper_int, const Physics::PhysicsBase<PHILIP_DIM, PHILIP_SPECIES, index, codi_HessianComputationType> &pde_physics, const NumericalFlux::NumericalFluxDissipative<PHILIP_DIM, PHILIP_SPECIES, index, codi_HessianComputationType> &diss_num_flux, dealii::Tensor<1,PHILIP_DIM,std::vector<codi_HessianComputationType>> &local_auxiliary_RHS_int, dealii::Tensor<1,PHILIP_DIM,std::vector<codi_HessianComputationType>> &local_auxiliary_RHS_ext); 3660 BOOST_PP_SEQ_FOR_EACH(INSTANTIATE_DISTRIBUTED, _, POSSIBLE_NSTATE)
3663 BOOST_PP_SEQ_FOR_EACH(INSTANTIATE_SHARED, _, POSSIBLE_NSTATE)
3665 BOOST_PP_SEQ_FOR_EACH(INSTANTIATE_TRIA, _, POSSIBLE_NSTATE)
3667 #define NSTATE PHILIP_DIM+PHILIP_SPECIES+1 3670 template void DGStrong <PHILIP_DIM, PHILIP_SPECIES, NSTATE, double, dealii::parallel::distributed::Triangulation<PHILIP_DIM>>::assemble_face_term_auxiliary_equation<double>(
const unsigned int iface,
const unsigned int neighbor_iface,
const dealii::types::global_dof_index current_cell_index,
const dealii::types::global_dof_index neighbor_cell_index, std::vector<bool> face_orientation_int, std::vector<bool> face_orientation_ext,
const std::array<std::vector<double>,NSTATE> &soln_coeff_int,
const std::array<std::vector<double>,NSTATE> &soln_coeff_ext,
const unsigned int poly_degree_int,
const unsigned int poly_degree_ext,
OPERATOR::basis_functions<PHILIP_DIM,2*PHILIP_DIM> &soln_basis_int,
OPERATOR::basis_functions<PHILIP_DIM,2*PHILIP_DIM> &soln_basis_ext,
OPERATOR::metric_operators<double,PHILIP_DIM,2*PHILIP_DIM> &metric_oper_int,
const Physics::PhysicsBase<PHILIP_DIM, PHILIP_SPECIES, NSTATE, double> &pde_physics,
const NumericalFlux::NumericalFluxDissipative<PHILIP_DIM, PHILIP_SPECIES, NSTATE, double> &diss_num_flux, dealii::Tensor<1,PHILIP_DIM,std::vector<double>> &local_auxiliary_RHS_int, dealii::Tensor<1,PHILIP_DIM,std::vector<double>> &local_auxiliary_RHS_ext);
3673 template void DGStrong <PHILIP_DIM, PHILIP_SPECIES, NSTATE, double, dealii::parallel::shared::Triangulation<PHILIP_DIM>>::assemble_face_term_auxiliary_equation<double>(
const unsigned int iface,
const unsigned int neighbor_iface,
const dealii::types::global_dof_index current_cell_index,
const dealii::types::global_dof_index neighbor_cell_index, std::vector<bool> face_orientation_int, std::vector<bool> face_orientation_ext,
const std::array<std::vector<double>,NSTATE> &soln_coeff_int,
const std::array<std::vector<double>,NSTATE> &soln_coeff_ext,
const unsigned int poly_degree_int,
const unsigned int poly_degree_ext,
OPERATOR::basis_functions<PHILIP_DIM,2*PHILIP_DIM> &soln_basis_int,
OPERATOR::basis_functions<PHILIP_DIM,2*PHILIP_DIM> &soln_basis_ext,
OPERATOR::metric_operators<double,PHILIP_DIM,2*PHILIP_DIM> &metric_oper_int,
const Physics::PhysicsBase<PHILIP_DIM, PHILIP_SPECIES, NSTATE, double> &pde_physics,
const NumericalFlux::NumericalFluxDissipative<PHILIP_DIM, PHILIP_SPECIES, NSTATE, double> &diss_num_flux, dealii::Tensor<1,PHILIP_DIM,std::vector<double>> &local_auxiliary_RHS_int, dealii::Tensor<1,PHILIP_DIM,std::vector<double>> &local_auxiliary_RHS_ext);
3675 template void DGStrong <PHILIP_DIM, PHILIP_SPECIES, NSTATE, double, dealii::Triangulation<PHILIP_DIM>>::assemble_face_term_auxiliary_equation<double>(
const unsigned int iface,
const unsigned int neighbor_iface,
const dealii::types::global_dof_index current_cell_index,
const dealii::types::global_dof_index neighbor_cell_index, std::vector<bool> face_orientation_int, std::vector<bool> face_orientation_ext,
const std::array<std::vector<double>,NSTATE> &soln_coeff_int,
const std::array<std::vector<double>,NSTATE> &soln_coeff_ext,
const unsigned int poly_degree_int,
const unsigned int poly_degree_ext,
OPERATOR::basis_functions<PHILIP_DIM,2*PHILIP_DIM> &soln_basis_int,
OPERATOR::basis_functions<PHILIP_DIM,2*PHILIP_DIM> &soln_basis_ext,
OPERATOR::metric_operators<double,PHILIP_DIM,2*PHILIP_DIM> &metric_oper_int,
const Physics::PhysicsBase<PHILIP_DIM, PHILIP_SPECIES, NSTATE, double> &pde_physics,
const NumericalFlux::NumericalFluxDissipative<PHILIP_DIM, PHILIP_SPECIES, NSTATE, double> &diss_num_flux, dealii::Tensor<1,PHILIP_DIM,std::vector<double>> &local_auxiliary_RHS_int, dealii::Tensor<1,PHILIP_DIM,std::vector<double>> &local_auxiliary_RHS_ext);
void assemble_face_term_strong(const unsigned int iface, const unsigned int neighbor_iface, const dealii::types::global_dof_index current_cell_index, const dealii::types::global_dof_index neighbor_cell_index, std::vector< bool > face_orientation_int, std::vector< bool > face_orientation_ext, const std::array< std::vector< adtype >, nstate > &soln_coeff_int, const std::array< std::vector< adtype >, nstate > &soln_coeff_ext, const std::array< dealii::Tensor< 1, dim, std::vector< adtype >>, nstate > &aux_soln_coeff_int, const std::array< dealii::Tensor< 1, dim, std::vector< adtype >>, nstate > &aux_soln_coeff_ext, const unsigned int poly_degree_int, const unsigned int poly_degree_ext, const real penalty, OPERATOR::basis_functions< dim, 2 *dim > &soln_basis_int, OPERATOR::basis_functions< dim, 2 *dim > &soln_basis_ext, OPERATOR::basis_functions< dim, 2 *dim > &flux_basis_int, OPERATOR::basis_functions< dim, 2 *dim > &flux_basis_ext, OPERATOR::vol_projection_operator< dim, 2 *dim > &soln_basis_projection_oper_int, OPERATOR::vol_projection_operator< dim, 2 *dim > &soln_basis_projection_oper_ext, OPERATOR::metric_operators< adtype, dim, 2 *dim > &metric_oper_int, OPERATOR::metric_operators< adtype, dim, 2 *dim > &metric_oper_ext, Physics::PhysicsBase< dim, nspecies, nstate, adtype > &pde_physics, const NumericalFlux::NumericalFluxConvective< dim, nspecies, nstate, adtype > &conv_num_flux, const NumericalFlux::NumericalFluxDissipative< dim, nspecies, nstate, adtype > &diss_num_flux, std::vector< adtype > &local_rhs_int_cell, std::vector< adtype > &local_rhs_ext_cell)
Strong form primary equation's facet right-hand-side.
void reinit_operators_for_cell_residual_loop(const unsigned int poly_degree_int, const unsigned int poly_degree_ext, const unsigned int grid_degree, OPERATOR::basis_functions< dim, 2 *dim > &soln_basis_int, OPERATOR::basis_functions< dim, 2 *dim > &soln_basis_ext, OPERATOR::basis_functions< dim, 2 *dim > &flux_basis_int, OPERATOR::basis_functions< dim, 2 *dim > &flux_basis_ext, OPERATOR::local_basis_stiffness< dim, 2 *dim > &flux_basis_stiffness, OPERATOR::vol_projection_operator< dim, 2 *dim > &soln_basis_projection_oper_int, OPERATOR::vol_projection_operator< dim, 2 *dim > &soln_basis_projection_oper_ext, OPERATOR::mapping_shape_functions< dim, 2 *dim > &mapping_basis)
Builds needed operators for cell residual loop.
dealii::Tensor< 2, dim, std::vector< real > > metric_cofactor_vol
The volume metric cofactor matrix.
PartialDifferentialEquation pde_type
Store the PDE type to be solved.
const dealii::hp::FECollection< dim > fe_collection_lagrange
Lagrange basis used in strong form.
void build_facet_metric_operators(const unsigned int iface, const unsigned int n_quad_pts, const unsigned int n_metric_dofs, const std::array< std::vector< real >, dim > &mapping_support_points, mapping_shape_functions< dim, n_faces > &mapping_basis, const bool use_invariant_curl_form=false)
Builds the facet metric operators.
virtual std::array< real, nstate > physical_source_term(const dealii::Point< dim, real > &pos, const std::array< real, nstate > &solution, const std::array< dealii::Tensor< 1, dim, real >, nstate > &solution_gradient, const dealii::types::global_dof_index cell_index) const
Physical source term that does require differentiation.
void assemble_face_term_auxiliary_equation(const unsigned int iface, const unsigned int neighbor_iface, const dealii::types::global_dof_index current_cell_index, const dealii::types::global_dof_index neighbor_cell_index, std::vector< bool > face_orientation_int, std::vector< bool > face_orientation_ext, const std::array< std::vector< adtype >, nstate > &soln_coeff_int, const std::array< std::vector< adtype >, nstate > &soln_coeff_ext, const unsigned int poly_degree_int, const unsigned int poly_degree_ext, OPERATOR::basis_functions< dim, 2 *dim > &soln_basis_int, OPERATOR::basis_functions< dim, 2 *dim > &soln_basis_ext, OPERATOR::metric_operators< adtype, dim, 2 *dim > &metric_oper_int, const Physics::PhysicsBase< dim, nspecies, nstate, adtype > &pde_physics, const NumericalFlux::NumericalFluxDissipative< dim, nspecies, nstate, adtype > &diss_num_flux, dealii::Tensor< 1, dim, std::vector< adtype >> &local_auxiliary_RHS_int, dealii::Tensor< 1, dim, std::vector< adtype >> &local_auxiliary_RHS_ext)
Evaluate the facet RHS for the auxiliary equation.
void apply_inverse_global_mass_matrix(const dealii::LinearAlgebra::distributed::Vector< double > &input_vector, dealii::LinearAlgebra::distributed::Vector< double > &output_vector, const bool use_auxiliary_eq=false)
Applies the inverse of the local metric dependent mass matrices when the global is not stored...
void assemble_volume_term_and_build_operators_ad_templated(typename dealii::DoFHandler< dim >::active_cell_iterator cell, const dealii::types::global_dof_index current_cell_index, const std::vector< adtype > &soln_coeffs, const dealii::Tensor< 1, dim, std::vector< adtype >> &aux_soln_coeffs, const std::vector< adtype > &metric_coeffs, const std::vector< real > &local_dual, const std::vector< dealii::types::global_dof_index > &soln_dofs_indices, const std::vector< dealii::types::global_dof_index > &metric_dofs_indices, const unsigned int poly_degree, const unsigned int grid_degree, Physics::PhysicsBase< dim, nspecies, nstate, adtype > &physics, OPERATOR::basis_functions< dim, 2 *dim > &soln_basis, OPERATOR::basis_functions< dim, 2 *dim > &flux_basis, OPERATOR::local_basis_stiffness< dim, 2 *dim > &flux_basis_stiffness, OPERATOR::vol_projection_operator< dim, 2 *dim > &soln_basis_projection_oper_int, OPERATOR::vol_projection_operator< dim, 2 *dim > &soln_basis_projection_oper_ext, OPERATOR::metric_operators< adtype, dim, 2 *dim > &metric_oper, OPERATOR::mapping_shape_functions< dim, 2 *dim > &mapping_basis, std::array< std::vector< adtype >, dim > &mapping_support_points, dealii::hp::FEValues< dim, dim > &, dealii::hp::FEValues< dim, dim > &, const dealii::FESystem< dim, dim > &, std::vector< adtype > &rhs, dealii::Tensor< 1, dim, std::vector< adtype >> &local_auxiliary_RHS, const bool compute_auxiliary_right_hand_side, adtype &dual_dot_residual)
Builds the necessary operators and assembles volume residual for either primary or auxiliary...
virtual std::array< real, nstate > evaluate_solution_flux(const std::array< real, nstate > &soln_int, const std::array< real, nstate > &soln_ext, const dealii::Tensor< 1, dim, real > &normal_int) const =0
Solution flux at the interface.
void assemble_volume_term_explicit(typename dealii::DoFHandler< dim >::active_cell_iterator cell, const dealii::types::global_dof_index current_cell_index, const dealii::FEValues< dim, dim > &fe_values_volume, const std::vector< dealii::types::global_dof_index > ¤t_dofs_indices, const std::vector< dealii::types::global_dof_index > &metric_dof_indices, const unsigned int poly_degree, const unsigned int grid_degree, dealii::Vector< real > ¤t_cell_rhs, const dealii::FEValues< dim, dim > &fe_values_lagrange)
Evaluate the integral over the cell volume.
dealii::LinearAlgebra::distributed::Vector< double > artificial_dissipation_c0
Artificial dissipation coefficients.
void build_volume_metric_operators(const unsigned int poly_degree, const unsigned int grid_degree, const std::vector< adtype > &metric_coeffs, OPERATOR::metric_operators< adtype, dim, 2 *dim > &metric_oper, OPERATOR::mapping_shape_functions< dim, 2 *dim > &mapping_basis, std::array< std::vector< adtype >, dim > &mapping_support_points)
< Parallel std::cout that only outputs on mpi_rank==0
void build_1D_volume_operator(const dealii::FESystem< 1, 1 > &finite_element, const dealii::Quadrature< 1 > &quadrature)
Assembles the one dimensional operator.
std::array< real, nstate > evaluate_flux(const std::array< real, nstate > &soln_int, const std::array< real, nstate > &soln_ext, const dealii::Tensor< 1, dim, real > &normal1) const
Returns the convective numerical flux at an interface.
virtual std::array< real, nstate > dissipative_flux_dot_normal(const std::array< real, nstate > &solution, const std::array< dealii::Tensor< 1, dim, real >, nstate > &solution_gradient, const std::array< real, nstate > &filtered_solution, const std::array< dealii::Tensor< 1, dim, real >, nstate > &filtered_solution_gradient, const bool on_boundary, const dealii::types::global_dof_index cell_index, const dealii::Tensor< 1, dim, real > &normal, const int boundary_type)
Dissipative fluxes dot normal vector.
Base class from which Advection, Diffusion, ConvectionDiffusion, and Euler is derived.
const dealii::FE_Q< dim > fe_q_artificial_dissipation
Continuous distribution of artificial dissipation.
virtual std::array< dealii::Tensor< 1, dim, real >, nstate > convective_flux(const std::array< real, nstate > &solution) const =0
Convective fluxes that will be differentiated once in space.
dealii::ConditionalOStream pcout
Parallel std::cout that only outputs on mpi_rank==0.
dealii::IndexSet ghost_dofs
Locally relevant ghost degrees of freedom.
void matrix_vector_mult_1D(const std::vector< real > &input_vect, std::vector< real > &output_vect, const dealii::FullMatrix< double > &basis_x, const bool adding=false, const double factor=1.0)
Apply the matrix vector operation using the 1D operator in each direction.
const dealii::UpdateFlags neighbor_face_update_flags
Update flags needed at neighbor' face points.
PartialDifferentialEquation
Possible Partial Differential Equations to solve.
dealii::hp::QCollection< dim-1 > face_quadrature_collection
Quadrature used to evaluate face integrals.
Base class of numerical flux associated with dissipation.
Files for the baseline physics.
const bool has_nonzero_physical_source
Flag to signal that physical source term is non-zero.
dealii::DoFHandler< dim > dof_handler_artificial_dissipation
Degrees of freedom handler for C0 artificial dissipation.
ManufacturedSolutionParam manufactured_solution_param
Associated manufactured solution parameters.
bool use_invariant_curl_form
Flag to use invariant curl form for metric cofactor operator.
dealii::QGauss< 0 > oneD_face_quadrature
1D surface quadrature is always one single point for all poly degrees.
std::shared_ptr< HighOrderGrid< dim, real, MeshType > > high_order_grid
High order grid that will provide the MappingFEField.
dealii::Tensor< 2, dim, std::vector< real > > metric_cofactor_surf
The facet metric cofactor matrix, for ONE face.
const int nstate
Number of state variables.
void sum_factorized_Hadamard_sparsity_pattern(const unsigned int rows_size, const unsigned int columns_size, std::vector< std::array< unsigned int, dim >> &rows, std::vector< std::array< unsigned int, dim >> &columns)
Computes the rows and columns vectors with non-zero indices for sum-factorized Hadamard products...
virtual std::array< real, nstate > source_term(const dealii::Point< dim, real > &pos, const std::array< real, nstate > &solution, const real current_time, const dealii::types::global_dof_index cell_index) const =0
Artificial dissipative fluxes that will be differentiated ONCE in space.
dealii::hp::QCollection< dim > volume_quadrature_collection
Finite Element Collection to represent the high-order grid.
void sum_factorized_Hadamard_surface_sparsity_pattern(const unsigned int rows_size, const unsigned int columns_size, std::vector< unsigned int > &rows, std::vector< unsigned int > &columns, const int dim_not_zero)
Computes the rows and columns vectors with non-zero indices for surface sum-factorized Hadamard produ...
virtual std::array< real, nstate > evaluate_auxiliary_flux(const dealii::types::global_dof_index current_cell_index, const dealii::types::global_dof_index neighbor_cell_index_, const real artificial_diss_coeff_int, const real artificial_diss_coeff_ext_, const std::array< real, nstate > &soln_int, const std::array< real, nstate > &soln_ext, const std::array< dealii::Tensor< 1, dim, real >, nstate > &soln_grad_int, const std::array< dealii::Tensor< 1, dim, real >, nstate > &soln_grad_ext_, const std::array< real, nstate > &filtered_soln_int, const std::array< real, nstate > &filtered_soln_ext, const std::array< dealii::Tensor< 1, dim, real >, nstate > &filtered_soln_grad_int, const std::array< dealii::Tensor< 1, dim, real >, nstate > &filtered_soln_grad_ext_, const dealii::Tensor< 1, dim, real > &normal_int, const real &penalty, const bool on_boundary, const int boundary_type=0) const =0
Auxiliary flux at the interface.
ODESolverEnum
Types of ODE solver.
void divergence_matrix_vector_mult_1D(const dealii::Tensor< 1, dim, std::vector< real >> &input_vect, std::vector< real > &output_vect, const dealii::FullMatrix< double > &basis, const dealii::FullMatrix< double > &gradient_basis)
Computes the divergence using sum-factorization where the basis are the same in each direction...
void matrix_vector_mult_surface_1D(const std::vector< bool > face_orientation, const unsigned int face_number, const std::vector< real > &input_vect, std::vector< real > &output_vect, const std::array< dealii::FullMatrix< double >, 2 > &basis_surf, const dealii::FullMatrix< double > &basis_vol, const bool adding=false, const double factor=1.0)
Apply sum-factorization matrix vector multiplication on a surface.
Main parameter class that contains the various other sub-parameter classes.
void assemble_auxiliary_residual(const bool compute_dRdW, const bool compute_dRdX, const bool compute_d2R)
Flag for using projected entropy variables for NSFR boundary term.
void transform_reference_to_physical(const dealii::Tensor< 1, dim, real > &ref, const dealii::Tensor< 2, dim, real > &metric_cofactor, dealii::Tensor< 1, dim, real > &phys)
Given a reference tensor, return the physical tensor.
unsigned int current_degree
Stores the degree of the current poly degree.
virtual std::array< dealii::Tensor< 1, dim, real >, nstate > convert_primitive_gradient_to_conservative_gradient(const std::array< real, nstate > &primitive_soln, const std::array< dealii::Tensor< 1, dim, real >, nstate > &primitive_soln_gradient) const =0
const bool using_wall_model
Flag for using wall model.
std::vector< real > det_Jac_vol
The determinant of the metric Jacobian at volume cubature nodes.
dealii::DoFHandler< dim > dof_handler
Finite Element Collection to represent the high-order grid.
ManufacturedConvergenceStudyParam manufactured_convergence_study_param
Contains parameters for manufactured convergence study.
unsigned int n_dofs() const
Number of degrees of freedom.
const bool do_compute_filtered_solution
Flag to compute the filtered solution.
void build_volume_metric_operators(const unsigned int n_quad_pts, const unsigned int n_metric_dofs, const std::array< std::vector< real >, dim > &mapping_support_points, mapping_shape_functions< dim, n_faces > &mapping_basis, const bool use_invariant_curl_form=false)
Builds the volume metric operators.
virtual std::array< real, nstate > convert_conservative_to_primitive(const std::array< real, nstate > &conservative_soln) const =0
Convert conservative variables to primitive variables.
DGStrong class templated on the number of state variables.
ODESolverParam ode_solver_param
Contains parameters for ODE solver.
bool use_auxiliary_eq
Flag for using the auxiliary equation.
dealii::Vector< double > cell_volume
Time it takes for the maximum wavespeed to cross the cell domain.
void Hadamard_product_AD_vector(const dealii::FullMatrix< double > &input_mat1, const std::vector< real > &input_mat2, std::vector< real > &output_mat)
Computes a single Hadamard product for AD type.
const Parameters::AllParameters *const all_parameters
Pointer to all parameters.
virtual std::array< real, nstate > compute_entropy_variables(const std::array< real, nstate > &conservative_soln) const =0
Computes the entropy variables.
virtual void boundary_face_values_viscous_flux(const int, const dealii::Point< dim, real > &, const dealii::Tensor< 1, dim, real > &, const std::array< real, nstate > &, const std::array< dealii::Tensor< 1, dim, real >, nstate > &, const std::array< real, nstate > &, const std::array< dealii::Tensor< 1, dim, real >, nstate > &, std::array< real, nstate > &, std::array< dealii::Tensor< 1, dim, real >, nstate > &) const
Evaluates boundary values and gradients on the other side of the face for the viscous flux...
MPI_Comm mpi_communicator
MPI communicator.
void sum_factorized_Hadamard_basis_assembly(const unsigned int rows_size_1D, const unsigned int columns_size_1D, const std::vector< std::array< unsigned int, dim >> &rows, const std::vector< std::array< unsigned int, dim >> &columns, const dealii::FullMatrix< double > &basis, const std::vector< double > &weights, std::array< dealii::FullMatrix< double >, dim > &basis_sparse)
Constructs the basis operator storing all non-zero entries for a "sum-factorized" Hadamard product...
dealii::IndexSet locally_owned_dofs
Locally own degrees of freedom.
void assemble_volume_term_auxiliary_equation(const std::array< std::vector< adtype >, nstate > &soln_coeff, const unsigned int poly_degree, OPERATOR::basis_functions< dim, 2 *dim > &soln_basis, OPERATOR::basis_functions< dim, 2 *dim > &flux_basis, OPERATOR::metric_operators< adtype, dim, 2 *dim > &metric_oper, dealii::Tensor< 1, dim, std::vector< adtype >> &local_auxiliary_RHS)
Evaluate the volume RHS for the auxiliary equation.
Base metric operators class that stores functions used in both the volume and on surface.
std::array< dealii::LinearAlgebra::distributed::Vector< double >, dim > auxiliary_solution
The auxiliary equations' solution.
dealii::FullMatrix< double > oneD_vol_operator
Stores the one dimensional volume operator.
The mapping shape functions evaluated at the desired nodes (facet set included in volume grid nodes f...
Base class of numerical flux associated with convection.
dealii::Vector< double > max_dt_cell
Time it takes for the maximum wavespeed to cross the cell domain.
bool use_manufactured_source_term
Uses non-zero source term based on the manufactured solution and the PDE.
virtual std::array< real, nstate > compute_conservative_variables_from_entropy_variables(const std::array< real, nstate > &entropy_var) const =0
Computes the conservative variables from the entropy variables.
bool use_split_form
Flag to use split form.
virtual std::array< dealii::Tensor< 1, dim, real >, nstate > convert_conservative_gradient_to_primitive_gradient(const std::array< real, nstate > &conservative_soln, const std::array< dealii::Tensor< 1, dim, real >, nstate > &conservative_soln_gradient) const =0
void assemble_boundary_term_and_build_operators_ad_templated(typename dealii::DoFHandler< dim >::active_cell_iterator cell, const dealii::types::global_dof_index current_cell_index, const std::vector< adtype > &soln_coeffs, const dealii::Tensor< 1, dim, std::vector< adtype >> &aux_soln_coeffs, const std::vector< adtype > &metric_coeffs, const std::vector< real > &local_dual, const unsigned int face_number, const unsigned int boundary_id, Physics::PhysicsBase< dim, nspecies, nstate, adtype > &physics, const NumericalFlux::NumericalFluxConvective< dim, nspecies, nstate, adtype > &conv_num_flux, const NumericalFlux::NumericalFluxDissipative< dim, nspecies, nstate, adtype > &diss_num_flux, const unsigned int poly_degree, const unsigned int grid_degree, OPERATOR::basis_functions< dim, 2 *dim > &soln_basis, OPERATOR::basis_functions< dim, 2 *dim > &flux_basis, OPERATOR::vol_projection_operator< dim, 2 *dim > &soln_basis_projection_oper_int, OPERATOR::metric_operators< adtype, dim, 2 *dim > &metric_oper, OPERATOR::mapping_shape_functions< dim, 2 *dim > &mapping_basis, std::array< std::vector< adtype >, dim > &mapping_support_points, dealii::hp::FEFaceValues< dim, dim > &, const dealii::FESystem< dim, dim > &, const real penalty, std::vector< adtype > &rhs, dealii::Tensor< 1, dim, std::vector< adtype >> &local_auxiliary_RHS, const bool compute_auxiliary_right_hand_side, adtype &dual_dot_residual)
Builds the necessary operators and assembles boundary residual for either primary or auxiliary...
std::array< dealii::FullMatrix< double >, 2 > oneD_surf_operator
Stores the one dimensional surface operator.
void build_1D_volume_operator(const dealii::FESystem< 1, 1 > &finite_element, const dealii::Quadrature< 1 > &quadrature)
Assembles the one dimensional operator.
DGStrong(const Parameters::AllParameters *const parameters_input, const unsigned int degree, const unsigned int max_degree_input, const unsigned int grid_degree_input, const std::shared_ptr< Triangulation > triangulation_input)
Constructor.
virtual void boundary_face_values(const int, const dealii::Point< dim, real > &, const dealii::Tensor< 1, dim, real > &, const std::array< real, nstate > &, const std::array< dealii::Tensor< 1, dim, real >, nstate > &, const std::array< real, nstate > &, const std::array< dealii::Tensor< 1, dim, real >, nstate > &, std::array< real, nstate > &, std::array< dealii::Tensor< 1, dim, real >, nstate > &) const
Evaluates boundary values and gradients on the other side of the face for the convective flux...
const bool apply_modal_high_pass_filter_on_filtered_solution
Flag to apply modal high pass filter on the filtered solution.
void inner_product_1D(const std::vector< real > &input_vect, const std::vector< double > &weight_vect, std::vector< real > &output_vect, const dealii::FullMatrix< double > &basis_x, const bool adding=false, const double factor=1.0)
Apply the inner product operation using the 1D operator in each direction.
void transform_physical_to_reference(const dealii::Tensor< 1, dim, real > &phys, const dealii::Tensor< 2, dim, real > &metric_cofactor, dealii::Tensor< 1, dim, real > &ref)
Given a physical tensor, return the reference tensor.
void assemble_boundary_term_strong(typename dealii::DoFHandler< dim >::active_cell_iterator current_cell, const unsigned int iface, const dealii::types::global_dof_index current_cell_index, std::vector< bool > face_orientation, const std::array< std::vector< adtype >, nstate > &soln_coeff, const std::array< dealii::Tensor< 1, dim, std::vector< adtype >>, nstate > &aux_soln_coeff, const unsigned int boundary_id, const unsigned int poly_degree, const real penalty, OPERATOR::basis_functions< dim, 2 *dim > &soln_basis, OPERATOR::basis_functions< dim, 2 *dim > &flux_basis, OPERATOR::vol_projection_operator< dim, 2 *dim > &soln_basis_projection_oper, OPERATOR::metric_operators< adtype, dim, 2 *dim > &metric_oper, Physics::PhysicsBase< dim, nspecies, nstate, adtype > &pde_physics, const NumericalFlux::NumericalFluxConvective< dim, nspecies, nstate, adtype > &conv_num_flux, const NumericalFlux::NumericalFluxDissipative< dim, nspecies, nstate, adtype > &diss_num_flux, std::vector< adtype > &local_rhs_cell)
Strong form primary equation's boundary right-hand-side.
dealii::LinearAlgebra::distributed::Vector< double > right_hand_side
Residual of the current solution.
dealii::hp::QCollection< 1 > oneD_quadrature_collection
1D quadrature to generate Lagrange polynomials for the sake of flux interpolation.
const dealii::UpdateFlags volume_update_flags
Update flags needed at volume points.
dealii::FullMatrix< double > oneD_grad_operator
Stores the one dimensional gradient operator.
std::array< dealii::LinearAlgebra::distributed::Vector< double >, dim > auxiliary_right_hand_side
The auxiliary equations' right hand sides.
void inner_product_surface_1D(const std::vector< bool > face_orientation, const unsigned int face_number, const std::vector< real > &input_vect, const std::vector< double > &weight_vect, std::vector< real > &output_vect, const std::array< dealii::FullMatrix< double >, 2 > &basis_surf, const dealii::FullMatrix< double > &basis_vol, const bool adding=false, const double factor=1.0)
Apply sum-factorization inner product on a surface.
dealii::LinearAlgebra::distributed::Vector< double > solution
Current modal coefficients of the solution.
Abstract class templated on the number of state variables.
dealii::LinearAlgebra::distributed::Vector< real > dual
Current optimization dual variables corresponding to the residual constraints also known as the adjoi...
bool use_inverse_mass_on_the_fly
Flag to use inverse mass matrix on-the-fly for explicit solves.
ODESolverEnum ode_solver_type
ODE solver type.
void assemble_face_term_and_build_operators_ad_templated(typename dealii::DoFHandler< dim >::active_cell_iterator cell, typename dealii::DoFHandler< dim >::active_cell_iterator neighbor_cell, const dealii::types::global_dof_index current_cell_index, const dealii::types::global_dof_index neighbor_cell_index, const unsigned int iface, const unsigned int neighbor_iface, const std::vector< adtype > &soln_coeffs_int, const std::vector< adtype > &soln_coeffs_ext, const dealii::Tensor< 1, dim, std::vector< adtype >> &aux_soln_coeffs_int, const dealii::Tensor< 1, dim, std::vector< adtype >> &aux_soln_coeffs_ext, const std::vector< adtype > &metric_coeff_int, const std::vector< adtype > &metric_coeff_ext, const std::vector< double > &dual_int, const std::vector< double > &dual_ext, const unsigned int poly_degree_int, const unsigned int poly_degree_ext, const unsigned int grid_degree_int, const unsigned int grid_degree_ext, OPERATOR::basis_functions< dim, 2 *dim > &soln_basis_int, OPERATOR::basis_functions< dim, 2 *dim > &soln_basis_ext, OPERATOR::basis_functions< dim, 2 *dim > &flux_basis_int, OPERATOR::basis_functions< dim, 2 *dim > &flux_basis_ext, OPERATOR::local_basis_stiffness< dim, 2 *dim > &flux_basis_stiffness, OPERATOR::vol_projection_operator< dim, 2 *dim > &soln_basis_projection_oper_int, OPERATOR::vol_projection_operator< dim, 2 *dim > &soln_basis_projection_oper_ext, OPERATOR::metric_operators< adtype, dim, 2 *dim > &metric_oper_int, OPERATOR::metric_operators< adtype, dim, 2 *dim > &metric_oper_ext, OPERATOR::mapping_shape_functions< dim, 2 *dim > &mapping_basis, std::array< std::vector< adtype >, dim > &mapping_support_points, Physics::PhysicsBase< dim, nspecies, nstate, adtype > &physics, const NumericalFlux::NumericalFluxConvective< dim, nspecies, nstate, adtype > &conv_num_flux, const NumericalFlux::NumericalFluxDissipative< dim, nspecies, nstate, adtype > &diss_num_flux, dealii::hp::FEFaceValues< dim, dim > &, dealii::hp::FEFaceValues< dim, dim > &, dealii::hp::FESubfaceValues< dim, dim > &, const dealii::FESystem< dim, dim > &, const dealii::FESystem< dim, dim > &, const real penalty, std::vector< adtype > &rhs_int, std::vector< adtype > &rhs_ext, dealii::Tensor< 1, dim, std::vector< adtype >> &aux_rhs_int, dealii::Tensor< 1, dim, std::vector< adtype >> &aux_rhs_ext, const bool compute_auxiliary_right_hand_side, adtype &dual_dot_residual, const bool, const unsigned int)
Calls the function to assemble face residual.
const unsigned int max_degree
Maximum degree used for p-refi1nement.
real current_time
The current time set in set_current_time()
dealii::FullMatrix< double > oneD_skew_symm_vol_oper
Skew-symmetric volume operator .
std::array< dealii::Tensor< 1, dim, std::vector< real > >, n_faces > flux_nodes_surf
Stores the physical facet flux nodes.
const dealii::UpdateFlags face_update_flags
Update flags needed at face points.
bool add_artificial_dissipation
Flag to add artificial dissipation from Persson's shock capturing paper.
void sum_factorized_Hadamard_surface_basis_assembly(const unsigned int rows_size, const unsigned int columns_size_1D, const std::vector< unsigned int > &rows, const std::vector< unsigned int > &columns, const dealii::FullMatrix< double > &basis, const std::vector< double > &weights, dealii::FullMatrix< double > &basis_sparse, const int dim_not_zero)
Constructs the basis operator storing all non-zero entries for a "sum-factorized" surface Hadamard p...
const unsigned int max_grid_degree
Maximum grid degree used for hp-refi1nement.
const unsigned int poly_degree_max_large_scales
For filtered solution; lower bound of high pass filter.
void assemble_volume_term_strong(typename dealii::DoFHandler< dim >::active_cell_iterator cell, const dealii::types::global_dof_index current_cell_index, const std::array< std::vector< adtype >, nstate > &soln_coeff, const std::array< dealii::Tensor< 1, dim, std::vector< adtype >>, nstate > &aux_soln_coeff, const unsigned int poly_degree, OPERATOR::basis_functions< dim, 2 *dim > &soln_basis, OPERATOR::basis_functions< dim, 2 *dim > &flux_basis, OPERATOR::local_basis_stiffness< dim, 2 *dim > &flux_basis_stiffness, OPERATOR::vol_projection_operator< dim, 2 *dim > &soln_basis_projection_oper, OPERATOR::metric_operators< adtype, dim, 2 *dim > &metric_oper, Physics::PhysicsBase< dim, nspecies, nstate, adtype > &pde_physics, std::vector< adtype > &local_rhs_int_cell)
Strong form primary equation's volume right-hand-side.
void assemble_boundary_term_auxiliary_equation(const unsigned int iface, const dealii::types::global_dof_index current_cell_index, std::vector< bool > face_orientation, const std::array< std::vector< adtype >, nstate > &soln_coeff, const unsigned int poly_degree, const unsigned int boundary_id, OPERATOR::basis_functions< dim, 2 *dim > &soln_basis, OPERATOR::metric_operators< adtype, dim, 2 *dim > &metric_oper, const Physics::PhysicsBase< dim, nspecies, nstate, adtype > &pde_physics, const NumericalFlux::NumericalFluxDissipative< dim, nspecies, nstate, adtype > &diss_num_flux, dealii::Tensor< 1, dim, std::vector< adtype >> &local_auxiliary_RHS)
Evaluate the boundary RHS for the auxiliary equation.
std::shared_ptr< Triangulation > triangulation
Mesh.
void allocate_dual_vector(const bool compute_d2R)
Allocate the dual vector for optimization.
const dealii::hp::FECollection< dim > fe_collection
Finite Element Collection for p-finite-element to represent the solution.
void gradient_matrix_vector_mult_1D(const std::vector< real > &input_vect, dealii::Tensor< 1, dim, std::vector< real >> &output_vect, const dealii::FullMatrix< double > &basis, const dealii::FullMatrix< double > &gradient_basis)
Computes the gradient of a scalar using sum-factorization where the basis are the same in each direct...
ArtificialDissipationParam artificial_dissipation_param
Contains parameters for artificial dissipation.
virtual std::array< real, nstate > convert_primitive_to_conservative(const std::array< real, nstate > &primitive_soln) const =0
Convert primitive solution to conservative solution.
void build_1D_surface_operator(const dealii::FESystem< 1, 1 > &finite_element, const dealii::Quadrature< 0 > &quadrature)
Assembles the one dimensional operator.
unsigned int current_degree
Stores the degree of the current poly degree.
dealii::Tensor< 1, dim, std::vector< real > > flux_nodes_vol
Stores the physical volume flux nodes.
virtual std::array< dealii::Tensor< 1, dim, real >, nstate > convective_numerical_split_flux(const std::array< real, nstate > &conservative_soln1, const std::array< real, nstate > &conservative_soln2) const
Convective Numerical Split Flux for split form.
virtual std::array< dealii::Tensor< 1, dim, real >, nstate > dissipative_flux(const std::array< real, nstate > &solution, const std::array< dealii::Tensor< 1, dim, real >, nstate > &solution_gradient, const std::array< real, nstate > &filtered_solution, const std::array< dealii::Tensor< 1, dim, real >, nstate > &filtered_solution_gradient, const dealii::types::global_dof_index cell_index)
Dissipative fluxes that will be differentiated ONCE in space.
Projection operator corresponding to basis functions onto M-norm (L2).
Local stiffness matrix without jacobian dependence.
real evaluate_CFL(std::vector< std::array< real, nstate > > soln_at_q, const real artificial_dissipation, const real cell_diameter, const unsigned int cell_degree)
Evaluate the time it takes for the maximum wavespeed to cross the cell domain.
dealii::TrilinosWrappers::SparseMatrix global_inverse_mass_matrix_auxiliary
Global inverse of the auxiliary mass matrix.